@emulsify/core 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,5 +17,5 @@ jobs:
17
17
  with:
18
18
  # You can target a repository in a different organization
19
19
  # to the issue
20
- project-url: https://github.com/orgs/emulsify-ds/projects/6
20
+ project-url: https://github.com/emulsify-ds/emulsify-core
21
21
  github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
@@ -17,13 +17,13 @@ import configOverrides from '../../../../config/emulsify-core/storybook/main.js'
17
17
  * The full path to the current file (ESM compatible).
18
18
  * @type {string}
19
19
  */
20
- const __filename = fileURLToPath(import.meta.url);
20
+ const _filename = fileURLToPath(import.meta.url);
21
21
 
22
22
  /**
23
23
  * The directory name of the current module file.
24
24
  * @type {string}
25
25
  */
26
- const __dirname = path.dirname(__filename);
26
+ const _dirname = path.dirname(_filename);
27
27
 
28
28
  /**
29
29
  * Safely apply any user-provided overrides or fall back to an empty object.
@@ -204,7 +204,7 @@ const config = {
204
204
 
205
205
  // load external manager-head.html if present
206
206
  const externalManagerHeadPath = resolve(
207
- __dirname,
207
+ _dirname,
208
208
  '../../../../config/emulsify-core/storybook/manager-head.html'
209
209
  );
210
210
  let externalManagerHtml = '';
@@ -224,7 +224,7 @@ ${externalManagerHtml}`;
224
224
  */
225
225
  previewHead: (head) => {
226
226
  const externalHeadPath = resolve(
227
- __dirname,
227
+ _dirname,
228
228
  '../../../../config/emulsify-core/storybook/preview-head.html'
229
229
  );
230
230
 
@@ -5,7 +5,6 @@ const ImageMinimizer = new ImageMinimizerPlugin({
5
5
  implementation: ImageMinimizerPlugin.imageminMinify,
6
6
  options: {
7
7
  plugins: [
8
- ['gifsicle', { interlaced: true }],
9
8
  ['jpegtran', { progressive: true }],
10
9
  ['optipng', { optimizationLevel: 5 }],
11
10
  ],
@@ -12,17 +12,17 @@ import emulsifyConfig from '../../../../../project.emulsify.json' with { type: '
12
12
  * Resolve the directory of this file (without fileURLToPath).
13
13
  * @type {string}
14
14
  */
15
- let __filename = decodeURIComponent(new URL(import.meta.url).pathname);
16
- if (process.platform === 'win32' && __filename.startsWith('/')) {
17
- __filename = __filename.slice(1);
15
+ let _filename = decodeURIComponent(new URL(import.meta.url).pathname);
16
+ if (process.platform === 'win32' && _filename.startsWith('/')) {
17
+ _filename = _filename.slice(1);
18
18
  }
19
- const __dirname = dirname(__filename);
19
+ const _dirname = dirname(_filename);
20
20
 
21
21
  /**
22
22
  * Root of the project (three levels up from this file).
23
23
  * @type {string}
24
24
  */
25
- const projectDir = resolve(__dirname, '../../../../..');
25
+ const projectDir = resolve(_dirname, '../../../../..');
26
26
 
27
27
  /**
28
28
  * Where your source files live (if you have a `/src` folder).
@@ -94,7 +94,8 @@ const CleanPlugin = new CleanWebpackPlugin({
94
94
  protectWebpackAssets: false,
95
95
  cleanOnceBeforeBuildPatterns: [
96
96
  // wipe all compiled assets
97
- `${distPath}/**/*`,
97
+ `${distPath}/**/*.css`,
98
+ `${distPath}/**/*.js`,
98
99
  // but keep any images
99
100
  `!${distPath}/**/*.png`,
100
101
  `!${distPath}/**/*.jpg`,
@@ -23,6 +23,10 @@ const srcDir = fs.pathExistsSync(resolve(projectDir, 'src'))
23
23
  ? resolve(projectDir, 'src')
24
24
  : resolve(projectDir, 'components');
25
25
 
26
+ if (!fs.pathExistsSync(resolve(srcDir))) {
27
+ fs.mkdirSync(srcDir, { recursive: true });
28
+ }
29
+
26
30
  const aliasPattern = resolve(srcDir, '**/!(_*).twig');
27
31
 
28
32
  /**
@@ -1,4 +1,4 @@
1
- import fs from 'fs';
1
+ import fs from 'fs-extra';
2
2
  import { resolve, dirname } from 'path';
3
3
  import { merge } from 'webpack-merge';
4
4
  import common from './webpack.common.js';
@@ -16,16 +16,18 @@ if (process.platform === 'win32' && _filename.startsWith('/')) {
16
16
 
17
17
  const _dirname = dirname(_filename);
18
18
 
19
- const isDrupal = emulsifyConfig.project.platform === 'drupal';
19
+ // Get directories for file contexts.
20
+ const projectDir = resolve(_dirname, '../../../../..');
20
21
 
21
- // Resolve the src directory alongside how you’re already locating project.emulsify.json
22
- const srcDir = resolve(_dirname, '../../../../../src');
22
+ const srcPath = resolve(projectDir, 'src');
23
+ const srcExists = fs.pathExistsSync(srcPath);
24
+ const isDrupal = emulsifyConfig.project.platform === 'drupal';
23
25
 
24
26
  // Always ignore dist
25
27
  const ignored = ['**/dist/**'];
26
28
 
27
29
  // If it’s Drupal and there is no src/, also ignore components
28
- if (isDrupal && !fs.existsSync(srcDir)) {
30
+ if (isDrupal && srcExists) {
29
31
  ignored.push('**/components/**');
30
32
  }
31
33
 
@@ -33,7 +35,6 @@ export default merge(common, {
33
35
  mode: 'development',
34
36
  devtool: 'source-map',
35
37
  watchOptions: {
36
- // You can supply a RegExp, glob strings, or an array thereof
37
38
  ignored,
38
39
  },
39
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emulsify/core",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Bundled tooling for Storybook development + Webpack Build",
5
5
  "keywords": [
6
6
  "component library",
@@ -50,11 +50,11 @@
50
50
  "twatch": "jest --no-coverage --watch --verbose"
51
51
  },
52
52
  "dependencies": {
53
- "@babel/core": "^7.27.4",
54
- "@babel/eslint-parser": "^7.27.5",
55
- "@babel/preset-env": "^7.27.2",
53
+ "@babel/core": "^7.28.4",
54
+ "@babel/eslint-parser": "^7.28.4",
55
+ "@babel/preset-env": "^7.28.3",
56
56
  "@emulsify/cli": "^1.11.4",
57
- "@eslint/js": "^9.29.0",
57
+ "@eslint/js": "^9.35.0",
58
58
  "@storybook/addon-a11y": "^8.6.14",
59
59
  "@storybook/addon-actions": "^8.6.14",
60
60
  "@storybook/addon-essentials": "^8.6.14",
@@ -72,48 +72,47 @@
72
72
  "babel-preset-minify": "^0.5.2",
73
73
  "bem-twig-extension": "^0.1.1",
74
74
  "breakpoint-sass": "^3.0.0",
75
- "chalk": "^5.4.1",
75
+ "chalk": "^5.6.0",
76
76
  "clean-webpack-plugin": "^4.0.0",
77
- "concurrently": "^9.1.2",
78
- "copy-webpack-plugin": "^13.0.0",
77
+ "concurrently": "^9.2.1",
78
+ "copy-webpack-plugin": "^13.0.1",
79
79
  "css-loader": "^7.1.1",
80
- "eslint": "^9.29.0",
81
- "eslint-config-prettier": "^10.1.5",
82
- "eslint-plugin-import": "^2.31.0",
80
+ "eslint": "^9.35.0",
81
+ "eslint-config-prettier": "^10.1.8",
82
+ "eslint-plugin-import": "^2.32.0",
83
83
  "eslint-plugin-jest": "^29.0.1",
84
- "eslint-plugin-prettier": "^5.5.0",
84
+ "eslint-plugin-prettier": "^5.5.4",
85
85
  "eslint-plugin-security": "^3.0.1",
86
86
  "eslint-plugin-storybook": "^0.12.0",
87
87
  "eslint-webpack-plugin": "^5.0.2",
88
88
  "file-loader": "^6.2.0",
89
- "fs-extra": "^11.3.0",
89
+ "fs-extra": "^11.3.1",
90
90
  "glob": "^11.0.3",
91
91
  "graceful-fs": "^4.2.11",
92
- "html-webpack-plugin": "^5.6.3",
93
- "image-minimizer-webpack-plugin": "^4.1.3",
92
+ "html-webpack-plugin": "^5.6.4",
93
+ "image-minimizer-webpack-plugin": "^4.1.4",
94
94
  "imagemin": "^9.0.1",
95
- "imagemin-gifsicle": "^7.0.0",
96
95
  "imagemin-jpegtran": "^8.0.0",
97
96
  "imagemin-optipng": "^8.0.0",
98
- "jest": "^30.0.2",
99
- "jest-environment-jsdom": "^30.0.2",
97
+ "jest": "^30.1.3",
98
+ "jest-environment-jsdom": "^30.1.2",
100
99
  "js-yaml": "^4.1.0",
101
100
  "js-yaml-loader": "^1.2.2",
102
- "mini-css-extract-plugin": "^2.9.2",
101
+ "mini-css-extract-plugin": "^2.9.4",
103
102
  "node-sass-glob-importer": "^5.3.3",
104
103
  "normalize.css": "^8.0.1",
105
104
  "open-cli": "^8.0.0",
106
105
  "pa11y": "^9.0.0",
107
106
  "postcss": "^8.5.6",
108
- "postcss-loader": "^8.1.1",
107
+ "postcss-loader": "^8.2.0",
109
108
  "postcss-scss": "^4.0.9",
110
- "ramda": "^0.30.1",
109
+ "ramda": "^0.31.3",
111
110
  "regenerator-runtime": "^0.14.1",
112
- "sass": "^1.89.2",
111
+ "sass": "^1.92.0",
113
112
  "sass-loader": "^16.0.5",
114
113
  "storybook": "^8.6.14",
115
114
  "style-dictionary": "^4.4.0",
116
- "stylelint": "^16.21.0",
115
+ "stylelint": "^16.23.1",
117
116
  "stylelint-config-standard-scss": "^15.0.1",
118
117
  "stylelint-prettier": "^5.0.3",
119
118
  "stylelint-selector-bem-pattern": "^4.0.1",
@@ -123,10 +122,10 @@
123
122
  "twig-drupal-filters": "^3.2.0",
124
123
  "twig-testing-library": "^1.2.0",
125
124
  "twigjs-loader": "^1.0.3",
126
- "webpack": "^5.99.9",
125
+ "webpack": "^5.101.3",
127
126
  "webpack-cli": "^6.0.1",
128
127
  "webpack-merge": "^6.0.1",
129
- "yaml": "^2.8.0"
128
+ "yaml": "^2.8.1"
130
129
  },
131
130
  "devDependencies": {
132
131
  "@commitlint/cli": "^19.8.1",
@@ -134,12 +133,12 @@
134
133
  "@semantic-release/changelog": "^6.0.2",
135
134
  "@semantic-release/commit-analyzer": "^13.0.1",
136
135
  "@semantic-release/git": "^10.0.1",
137
- "@semantic-release/github": "^11.0.3",
136
+ "@semantic-release/github": "^11.0.5",
138
137
  "@semantic-release/release-notes-generator": "^14.0.3",
139
138
  "all-contributors-cli": "^6.26.1",
140
139
  "husky": "^9.1.7",
141
- "lint-staged": "^16.1.2",
142
- "semantic-release": "^24.2.5"
140
+ "lint-staged": "^16.1.6",
141
+ "semantic-release": "^24.2.7"
143
142
  },
144
143
  "overrides": {
145
144
  "inflight": "^1.0.7",