Skip to content

Commit 84cc401

Browse files
Merge pull request #151 from skilld-labs/kaizen-updates
kaizen updates
2 parents 4e1cce1 + b2948df commit 84cc401

File tree

9 files changed

+24
-25
lines changed

9 files changed

+24
-25
lines changed

packages/kaizen-breakpoints/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
## Usage
1515

16-
1. This package is added as a dependency for [@skilld/kaizen-tg](https://www.npmjs.com/package/@skilld/kaizen-tg) package, so normally once theme is install - you have `kaizen-breakpoints` already under the hood installed.
16+
1. This package is added as a dependency for [@skilld/kaizen-tg](https://www.npmjs.com/package/@skilld/kaizen-tg) package, so normally once theme is installed - you have `kaizen-breakpoints` already under the hood.
1717
2. To see the list of all available breakpoints and its names which you can use in your css and js files - you can run storybook and find it here `/?path=/story/globals-variables--breakpoints` (It is Globals / Variables / Breakpoints) path in storybook
18-
3. Syntax of usage in css files:
18+
3. Syntax of usage in css files (`@db` btw means `drupal breakpoint`):
1919
- `@db l {}` <-- it is analogue of old `@drupal-breakpoint l_1x {}` we had in Kaizen v1
2020
- `@db l_1x {}`
2121
- `@db l_2x {}` <-- this is 2x multiplier for retina screens. We don't use usually it in css files, but this breakpoint needed for Drupal's responsive image groups, for 2x increased image styles.

packages/kaizen-breakpoints/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@skilld/kaizen-breakpoints",
3-
"version": "2.0.0-alpha.1",
3+
"version": "2.0.0-alpha.2",
44
"description": "Breakpoints YML to css and js",
55
"repository": {
66
"type": "git",

packages/kaizen-cg/_templates/component/new/component.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export const basic = (args = {}) => {
3030
if (attrName === 'class') {
3131
attributes.addClass(attrValue);
3232
}
33-
attributes.setAttribute(attrName, attrValue);
33+
else {
34+
attributes.setAttribute(attrName, attrValue);
35+
}
3436
}
3537
}
3638
data.attributes = attributes;

packages/kaizen-cg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@skilld/kaizen-cg",
3-
"version": "2.0.0-alpha.1",
3+
"version": "2.0.0-alpha.2",
44
"description": "Kaizen component generator",
55
"bin": "index.js",
66
"main": "index.js",

packages/kaizen-tg/_templates/drupal-9-theme/new/kaizen-options.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ options.cssFiles = {
2525
ignore: `${options.theme.css}**/_*.css`,
2626
};
2727

28+
options.jsFiles = {
29+
components: `${options.theme.js}**/*.js`,
30+
};
31+
2832
options.buildAssets = `${options.rootPath.project}scripts/assets/`;
2933

3034
options.postCssConfigDirectory = `${options.rootPath.project}`;

packages/kaizen-tg/_templates/drupal-9-theme/new/kaizen.libraries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ base:
88
base:
99
dist/css/styles.css: {}
1010
js:
11-
dist/js/app.js: {}
11+
dist/js/init.js: {}
1212
dependencies:
1313
- core/drupal
1414
- core/once

packages/kaizen-tg/_templates/drupal-9-theme/new/package.json.t

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ to: <%= h.src() %>/<%= h.changeCase.lower(name) %>/package.json
99
"author": "Skilld",
1010
"license": "MIT",
1111
"devDependencies": {
12-
"@skilld/kaizen-cg": "^2.0.0-alpha.1",
12+
"@skilld/kaizen-cg": "^2.0.0-alpha.2",
1313
"@storybook/addon-essentials": "^6.4.19",
1414
"@storybook/addon-postcss": "^2.0.0",
1515
"@storybook/builder-webpack5": "^6.4.19",
@@ -25,7 +25,7 @@ to: <%= h.src() %>/<%= h.changeCase.lower(name) %>/package.json
2525
},
2626
"dependencies": {
2727
"@<%= h.changeCase.lower(name) %>/components": "^1.0.0",
28-
"@skilld/kaizen-breakpoints": "^2.0.0-alpha.1",
28+
"@skilld/kaizen-breakpoints": "^2.0.0-alpha.2",
2929
"@skilld/kaizen-core": "^2.0.0-alpha.1",
3030
"autoprefixer": "^10.4.4",
3131
"cross-env": "^7.0.3",
@@ -39,6 +39,7 @@ to: <%= h.src() %>/<%= h.changeCase.lower(name) %>/package.json
3939
"extract-loader": "^5.1.0",
4040
"file-loader": "^6.2.0",
4141
"glob": "^7.2.0",
42+
"mini-css-extract-plugin": "^2.6.0",
4243
"npm-run-all": "^4.1.5",
4344
"postcss": "^8.4.12",
4445
"postcss-cli": "^9.1.0",

packages/kaizen-tg/_templates/drupal-9-theme/new/webpack.config.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@ const glob = require('glob');
99
const path = require('path');
1010
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
1111
const TerserPlugin = require('terser-webpack-plugin');
12+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
1213
const options = require('./<%= h.changeCase.lower(name) %>-options');
1314

14-
const mapFilenamesToEntries = (pattern, globOptions) =>
15+
const mapJSFilenamesToEntries = (pattern, globOptions) =>
1516
glob.sync(pattern, globOptions).reduce((entries, filename) => {
16-
const [, name] = filename.match(/([^/]+)\.css$/);
17+
const [, name] = filename.match(/([^/]+)\.js$/);
1718
return {
1819
...entries,
1920
[name]: filename,
2021
};
2122
}, {});
2223

2324
module.exports = {
24-
context: options.theme.js,
2525
entry: {
26-
app: './init.js',
27-
...mapFilenamesToEntries(options.cssFiles.components, {
28-
ignore: options.cssFiles.ignore,
29-
}),
3026
sprite: glob.sync(path.resolve(__dirname, 'images/svg/**/*.svg')),
27+
styles: glob.sync(options.cssFiles.components, options.cssFiles.ignore),
28+
...mapJSFilenamesToEntries(options.jsFiles.components, {}),
3129
},
3230
output: {
3331
path: options.rootPath.dist,
@@ -89,21 +87,15 @@ module.exports = {
8987
},
9088
],
9189
},
92-
// Uncomment if you have theme-stored fonts.
93-
// {
94-
// test: /\.(woff|woff2)$/,
95-
// loader: 'file-loader',
96-
// options: {
97-
// outputPath: 'fonts',
98-
// publicPath: '../fonts',
99-
// },
100-
// },
10190
],
10291
},
10392
plugins: [
10493
new SpriteLoaderPlugin({
10594
plainSprite: true,
10695
}),
96+
new MiniCssExtractPlugin({
97+
filename: './dist/css/[name].css',
98+
}),
10799
],
108100
optimization: {
109101
minimize: true,

packages/kaizen-tg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@skilld/kaizen-tg",
3-
"version": "2.0.0-alpha.3",
3+
"version": "2.0.0-alpha.4",
44
"description": "Kaizen drupal theme generator",
55
"bin": "index.js",
66
"main": "index.js",

0 commit comments

Comments
 (0)