@emulsify/core 3.4.1 → 4.0.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.
Files changed (110) hide show
  1. package/.cli/init.js +40 -31
  2. package/.storybook/_drupal.js +129 -8
  3. package/.storybook/css-components.js +13 -0
  4. package/.storybook/css-dist.js +5 -0
  5. package/.storybook/emulsifyTheme.js +10 -7
  6. package/.storybook/main.js +417 -65
  7. package/.storybook/manager.js +11 -18
  8. package/.storybook/preview.js +93 -37
  9. package/.storybook/utils.js +70 -69
  10. package/README.md +110 -59
  11. package/config/.stylelintrc.json +2 -6
  12. package/config/a11y.config.js +9 -5
  13. package/config/babel.config.js +5 -0
  14. package/config/eslint.config.js +6 -3
  15. package/config/postcss.config.js +5 -0
  16. package/config/vite/entries.js +227 -0
  17. package/config/vite/environment.js +39 -0
  18. package/config/vite/platforms.js +70 -0
  19. package/config/vite/plugins/copy-src-assets.js +76 -0
  20. package/config/vite/plugins/copy-twig-files.js +84 -0
  21. package/config/vite/plugins/css-asset-relativizer.js +40 -0
  22. package/config/vite/plugins/index.js +105 -0
  23. package/config/vite/plugins/mirror-components.js +358 -0
  24. package/config/vite/plugins/require-context.js +311 -0
  25. package/config/vite/plugins/source-file-index.js +184 -0
  26. package/config/vite/plugins/svg-sprite.js +117 -0
  27. package/config/vite/plugins/twig-extension-installers.js +36 -0
  28. package/config/vite/plugins/twig-module.js +1251 -0
  29. package/config/vite/plugins/virtual-twig-asset-sources.js +404 -0
  30. package/config/vite/plugins/virtual-twig-globs.js +136 -0
  31. package/config/vite/plugins/vituum-patch.js +167 -0
  32. package/config/vite/plugins/yaml-module.js +133 -0
  33. package/config/vite/plugins.js +12 -0
  34. package/config/vite/project-config.js +192 -0
  35. package/config/vite/project-extensions.js +177 -0
  36. package/config/vite/project-structure.js +447 -0
  37. package/config/vite/twig-extensions.js +109 -0
  38. package/config/vite/utils/fs-safe.js +66 -0
  39. package/config/vite/utils/paths.js +40 -0
  40. package/config/vite/utils/react-singleton.js +85 -0
  41. package/config/vite/utils/unique.js +36 -0
  42. package/config/vite/vite.config.js +161 -0
  43. package/package.json +168 -88
  44. package/scripts/a11y.js +70 -16
  45. package/scripts/audit-twig-stories.js +378 -0
  46. package/scripts/audit.js +1602 -0
  47. package/scripts/check-node-version.js +18 -0
  48. package/scripts/loadYaml.js +5 -1
  49. package/src/extensions/index.js +8 -0
  50. package/src/extensions/react/index.js +12 -0
  51. package/src/extensions/react/register.js +45 -0
  52. package/src/extensions/shared/attributes.js +308 -0
  53. package/src/extensions/shared/html.js +41 -0
  54. package/src/extensions/shared/lists.js +38 -0
  55. package/src/extensions/shared/object.js +22 -0
  56. package/src/extensions/twig/function-map.js +20 -0
  57. package/src/extensions/twig/functions/add-attributes.js +39 -0
  58. package/src/extensions/twig/functions/bem.js +166 -0
  59. package/src/extensions/twig/index.js +13 -0
  60. package/src/extensions/twig/register.js +52 -0
  61. package/src/extensions/twig/tag-map.js +16 -0
  62. package/src/extensions/twig/tags/switch.js +266 -0
  63. package/src/storybook/index.js +14 -0
  64. package/src/storybook/main-config.js +132 -0
  65. package/src/storybook/platform-behaviors.js +60 -0
  66. package/src/storybook/preview-parameters.js +81 -0
  67. package/src/storybook/render-twig.js +295 -0
  68. package/src/storybook/twig/drupal-filters.js +7 -0
  69. package/src/storybook/twig/include-function.js +109 -0
  70. package/src/storybook/twig/include.js +28 -0
  71. package/src/storybook/twig/reference-paths.js +294 -0
  72. package/src/storybook/twig/resolver.js +318 -0
  73. package/src/storybook/twig/setup.js +39 -0
  74. package/src/storybook/twig/source-events.js +5 -0
  75. package/src/storybook/twig/source-extensions.js +24 -0
  76. package/src/storybook/twig/source-function.js +239 -0
  77. package/src/storybook/twig/source.js +39 -0
  78. package/.all-contributorsrc +0 -45
  79. package/.editorconfig +0 -5
  80. package/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md +0 -18
  81. package/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md +0 -11
  82. package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
  83. package/.github/dependabot.yml +0 -6
  84. package/.github/workflows/addtoprojects.yml +0 -21
  85. package/.github/workflows/contributors.yml +0 -37
  86. package/.github/workflows/lint.yml +0 -22
  87. package/.github/workflows/semantic-release.yml +0 -24
  88. package/.husky/commit-msg +0 -2
  89. package/.husky/pre-commit +0 -2
  90. package/.nvmrc +0 -1
  91. package/.prettierignore +0 -4
  92. package/.storybook/polyfills/twig-include.js +0 -36
  93. package/.storybook/polyfills/twig-resolver.js +0 -68
  94. package/.storybook/polyfills/twig-source.js +0 -54
  95. package/.storybook/webpack.config.js +0 -193
  96. package/CODE_OF_CONDUCT.md +0 -56
  97. package/commitlint.config.js +0 -5
  98. package/config/jest.config.js +0 -19
  99. package/config/webpack/app.js +0 -1
  100. package/config/webpack/loaders.js +0 -167
  101. package/config/webpack/optimizers.js +0 -17
  102. package/config/webpack/plugins.js +0 -283
  103. package/config/webpack/resolves.js +0 -157
  104. package/config/webpack/sdc-loader.js +0 -16
  105. package/config/webpack/webpack.common.js +0 -268
  106. package/config/webpack/webpack.dev.js +0 -41
  107. package/config/webpack/webpack.prod.js +0 -6
  108. package/release.config.cjs +0 -30
  109. package/scripts/a11y.test.js +0 -172
  110. package/scripts/loadYaml.test.js +0 -30
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @file React singleton helpers for Storybook and Vite config.
3
+ */
4
+
5
+ import { unique } from './unique.js';
6
+
7
+ /**
8
+ * React modules that must resolve from the consumer project root.
9
+ *
10
+ * @type {string[]}
11
+ */
12
+ export const reactSingletonModules = [
13
+ 'react',
14
+ 'react-dom',
15
+ 'react/jsx-runtime',
16
+ 'react/jsx-dev-runtime',
17
+ ];
18
+
19
+ const asArray = (value) => (Array.isArray(value) ? value : []);
20
+
21
+ const isObjectAlias = (alias) =>
22
+ alias && typeof alias === 'object' && !Array.isArray(alias);
23
+
24
+ /**
25
+ * Merge Vite alias config when all aliases use object syntax.
26
+ *
27
+ * Array-style aliases are already order-sensitive Vite config, so this helper
28
+ * leaves mixed/array alias forms to Vite's normal merge behavior.
29
+ *
30
+ * @param {...import('vite').UserConfig} configs - Vite config objects.
31
+ * @returns {object|undefined} Merged alias object when applicable.
32
+ */
33
+ function mergeObjectAliases(...configs) {
34
+ const aliases = configs
35
+ .map((config) => config?.resolve?.alias)
36
+ .filter(Boolean);
37
+
38
+ if (!aliases.length || aliases.some((alias) => !isObjectAlias(alias))) {
39
+ return undefined;
40
+ }
41
+
42
+ return Object.assign({}, ...aliases);
43
+ }
44
+
45
+ /**
46
+ * Merge Vite resolve config while forcing React to a single project instance.
47
+ *
48
+ * Later configs override earlier shallow resolve properties, while all dedupe
49
+ * lists are preserved and extended with React's runtime modules.
50
+ *
51
+ * @param {...import('vite').UserConfig} configs - Vite config objects.
52
+ * @returns {import('vite').UserConfig['resolve']} Merged resolve config.
53
+ */
54
+ export function mergeReactSingletonResolve(...configs) {
55
+ const alias = mergeObjectAliases(...configs);
56
+ const mergedResolve = configs.reduce(
57
+ (merged, config) => ({
58
+ ...merged,
59
+ ...(config?.resolve || {}),
60
+ }),
61
+ {},
62
+ );
63
+
64
+ return {
65
+ ...mergedResolve,
66
+ ...(alias ? { alias } : {}),
67
+ dedupe: unique([
68
+ ...configs.flatMap((config) => asArray(config?.resolve?.dedupe)),
69
+ ...reactSingletonModules,
70
+ ]),
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Merge optimizeDeps include lists and include React singleton modules.
76
+ *
77
+ * @param {...string[]} includeLists - Existing optimizeDeps include arrays.
78
+ * @returns {string[]} Merged include list.
79
+ */
80
+ export function mergeReactSingletonOptimizeDeps(...includeLists) {
81
+ return unique([
82
+ ...includeLists.flatMap((includeList) => asArray(includeList)),
83
+ ...reactSingletonModules,
84
+ ]);
85
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @file Shared array de-duplication helpers.
3
+ */
4
+
5
+ /**
6
+ * Return values in first-seen order with duplicates removed.
7
+ *
8
+ * @template T
9
+ * @param {T[]} values - Values to deduplicate.
10
+ * @returns {T[]} Unique values.
11
+ */
12
+ export function unique(values = []) {
13
+ return Array.from(new Set(values));
14
+ }
15
+
16
+ /**
17
+ * Return values in first-seen order with duplicates removed by key.
18
+ *
19
+ * @template T
20
+ * @param {T[]} values - Values to deduplicate.
21
+ * @param {(value: T) => *} keyFn - Function that returns a comparable key.
22
+ * @returns {T[]} Unique values.
23
+ */
24
+ export function uniqueBy(values = [], keyFn) {
25
+ const seen = new Set();
26
+ const result = [];
27
+
28
+ for (const value of values) {
29
+ const key = keyFn(value);
30
+ if (seen.has(key)) continue;
31
+ seen.add(key);
32
+ result.push(value);
33
+ }
34
+
35
+ return result;
36
+ }
@@ -0,0 +1,161 @@
1
+ /**
2
+ * @file Vite configuration for Emulsify.
3
+ * @see https://vite.dev/config/
4
+ *
5
+ * @overview
6
+ * This configuration wires Emulsify's Vite build in a few clear steps:
7
+ *
8
+ * 1. Resolve the build environment (paths, platform flags) via {@link resolveEnvironment}.
9
+ * 2. Build the Rollup/Vite entries map with {@link buildInputs}.
10
+ * 3. Load optional project extensions (extra plugins and/or a config patcher)
11
+ * from `config/emulsify-core/vite/plugins.*` via {@link loadProjectExtensions}.
12
+ * 4. Assemble a base Vite config and optionally let the project extend/override
13
+ * parts of it by returning a patch object from `extendConfig(...)`.
14
+ *
15
+ * Notes:
16
+ * - CSS & JS sourcemaps are enabled.
17
+ * - CSS assets keep their path and drop the internal `__style` suffix if present.
18
+ */
19
+
20
+ import { defineConfig, mergeConfig } from 'vite';
21
+ import path from 'node:path';
22
+
23
+ import { resolveEnvironment } from './environment.js';
24
+ import { makePlugins } from './plugins.js';
25
+ import { buildInputs } from './entries.js';
26
+ import { createSourceFileIndex } from './plugins/source-file-index.js';
27
+ import { loadProjectExtensions } from './project-extensions.js';
28
+ import { mergeReactSingletonResolve } from './utils/react-singleton.js';
29
+
30
+ export default defineConfig(async () => {
31
+ /**
32
+ * Environment details for this build (project paths, platform, flags).
33
+ * @typedef {Object} EmulsifyEnv
34
+ * @property {string} projectDir - Absolute project root.
35
+ * @property {string} srcDir - Absolute source directory (`src/` if present, otherwise `components/`).
36
+ * @property {boolean} srcExists - Whether `src/` exists in the project.
37
+ * @property {string} platform - Deployment platform (e.g., `"drupal"`).
38
+ * @property {boolean} [SDC] - Single Directory Components toggle, if available.
39
+ * @property {boolean} [structureOverrides] - Whether component structure overrides are enabled.
40
+ * @property {string[]} [structureRoots] - Override roots, if provided.
41
+ * @property {object} [platformAdapter] - Active platform behavior adapter.
42
+ */
43
+
44
+ /** @type {EmulsifyEnv} */
45
+ const env = resolveEnvironment();
46
+ const sourceFileIndex = createSourceFileIndex(env.projectStructure);
47
+ const envWithSourceFileIndex = { ...env, sourceFileIndex };
48
+
49
+ // Build the Rollup/Vite entry map: keys encode output paths, values source files.
50
+ /** @type {Record<string, string>} */
51
+ const entries = buildInputs({
52
+ projectDir: env.projectDir,
53
+ srcDir: env.srcDir,
54
+ srcExists: env.srcExists,
55
+ isDrupal: env.platform === 'drupal',
56
+ SDC: env.SDC,
57
+ structureOverrides: env.structureOverrides,
58
+ structureRoots: env.structureRoots,
59
+ structureImplementations: env.structureImplementations,
60
+ projectStructure: env.projectStructure,
61
+ sourceFileIndex,
62
+ });
63
+
64
+ // Load optional project-provided plugins and config patches.
65
+ /**
66
+ * @type {{
67
+ * projectPlugins: import('vite').PluginOption[],
68
+ * extendConfig?: (base: import('vite').UserConfig, ctx: { env: EmulsifyEnv }) => import('vite').UserConfig
69
+ * }}
70
+ */
71
+ const { projectPlugins, extendConfig } = await loadProjectExtensions({ env });
72
+
73
+ // Assemble the base config before applying project extensions.
74
+ /** @type {import('vite').UserConfig} */
75
+ const base = {
76
+ // Treat the current working directory as the root.
77
+ root: process.cwd(),
78
+
79
+ // Core plugin set + project-provided plugins (if any).
80
+ plugins: [...makePlugins(envWithSourceFileIndex), ...projectPlugins],
81
+
82
+ // Keep React-based story helpers on the consumer project's React singleton.
83
+ resolve: mergeReactSingletonResolve(),
84
+
85
+ // Generate CSS sourcemaps in dev; JS sourcemaps are set in `build.sourcemap`.
86
+ css: {
87
+ devSourcemap: true,
88
+ },
89
+
90
+ build: {
91
+ // Clean the output directory before building.
92
+ emptyOutDir: true,
93
+
94
+ // All outputs are written into ./dist/
95
+ outDir: 'dist/',
96
+
97
+ // Emit production sourcemaps as well.
98
+ sourcemap: true,
99
+
100
+ rollupOptions: {
101
+ // Multi-entry input map constructed above.
102
+ input: entries,
103
+
104
+ // Keep file names deterministic and strip the internal CSS key suffix.
105
+ output: {
106
+ entryFileNames: '[name].js',
107
+
108
+ /**
109
+ * Decide asset filenames. Normalizes `.css` paths and removes the `__style`
110
+ * suffix used to avoid name collisions in entry keys.
111
+ * @param {import('rollup').PreRenderedAsset} assetInfo
112
+ * @returns {string}
113
+ */
114
+ assetFileNames: (assetInfo) => {
115
+ const file = assetInfo.name || assetInfo.fileName || '';
116
+ if (file.endsWith('.css')) {
117
+ // Drop the CSS key suffix used to avoid JS/CSS entry collisions.
118
+ return file.replace(/__style(?=\.css$)/, '');
119
+ }
120
+ const [original] = Array.isArray(assetInfo.originalFileNames)
121
+ ? assetInfo.originalFileNames
122
+ : assetInfo.originalFileName
123
+ ? [assetInfo.originalFileName]
124
+ : [];
125
+ if (original) {
126
+ const normalizedOriginal = path.normalize(original);
127
+ const relativeToProject = path.isAbsolute(normalizedOriginal)
128
+ ? path.relative(env.projectDir, normalizedOriginal)
129
+ : normalizedOriginal.replace(/^[/\\]+/, '');
130
+ const normalizedRelative = relativeToProject
131
+ .split(path.sep)
132
+ .join('/');
133
+ // Prevent traversing above dist/ if a relative path climbs directories.
134
+ const safePath = normalizedRelative.startsWith('..')
135
+ ? normalizedRelative.replace(/^(\.\.\/)+/g, '')
136
+ : normalizedRelative;
137
+ if (safePath) {
138
+ return safePath;
139
+ }
140
+ }
141
+ return 'assets/[name][extname]';
142
+ },
143
+ },
144
+ },
145
+ },
146
+
147
+ // Dev server tweaks; disable polling by default for performance.
148
+ server: {
149
+ watch: { usePolling: false },
150
+ },
151
+ };
152
+
153
+ // Let project extensions patch the final Vite config.
154
+ /** @type {import('vite').UserConfig} */
155
+ const patched =
156
+ typeof extendConfig === 'function'
157
+ ? mergeConfig(base, extendConfig(base, { env }) || {})
158
+ : base;
159
+
160
+ return patched;
161
+ });
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@emulsify/core",
3
- "version": "3.4.1",
4
- "description": "Bundled tooling for Storybook development + Webpack Build",
3
+ "version": "4.0.0",
4
+ "description": "Bundled tooling for Storybook development + Vite Build",
5
5
  "keywords": [
6
6
  "component library",
7
+ "craftcms",
7
8
  "design system",
8
9
  "drupal",
9
10
  "pattern library",
10
11
  "storybook",
11
- "styleguide"
12
+ "styleguide",
13
+ "twig",
14
+ "vite",
15
+ "wordpress"
12
16
  ],
13
17
  "author": "Four Kitchens <shout@fourkitchens.com>",
14
18
  "license": "GPL-2.0",
@@ -16,6 +20,10 @@
16
20
  "node": ">=24"
17
21
  },
18
22
  "type": "module",
23
+ "bin": {
24
+ "emulsify-audit": "./scripts/audit.js",
25
+ "emulsify-audit-twig-stories": "./scripts/audit-twig-stories.js"
26
+ },
19
27
  "repository": {
20
28
  "type": "git",
21
29
  "url": "git+https://github.com/emulsify-ds/emulsify-core.git"
@@ -24,6 +32,99 @@
24
32
  "url": "https://github.com/emulsify-ds/emulsify-core/issues"
25
33
  },
26
34
  "homepage": "https://github.com/emulsify-ds/emulsify-core#readme",
35
+ "files": [
36
+ ".cli/init.js",
37
+ ".storybook/_drupal.js",
38
+ ".storybook/css-components.js",
39
+ ".storybook/css-dist.js",
40
+ ".storybook/emulsifyTheme.js",
41
+ ".storybook/main.js",
42
+ ".storybook/manager.js",
43
+ ".storybook/preview.js",
44
+ ".storybook/utils.js",
45
+ "assets/**/*",
46
+ "config/.prettierrc.json",
47
+ "config/.stylelintrc.json",
48
+ "config/a11y.config.js",
49
+ "config/babel.config.js",
50
+ "config/eslint.config.js",
51
+ "config/postcss.config.js",
52
+ "config/vite/entries.js",
53
+ "config/vite/environment.js",
54
+ "config/vite/platforms.js",
55
+ "config/vite/plugins/copy-src-assets.js",
56
+ "config/vite/plugins/copy-twig-files.js",
57
+ "config/vite/plugins/css-asset-relativizer.js",
58
+ "config/vite/plugins/index.js",
59
+ "config/vite/plugins/mirror-components.js",
60
+ "config/vite/plugins/require-context.js",
61
+ "config/vite/plugins/source-file-index.js",
62
+ "config/vite/plugins/svg-sprite.js",
63
+ "config/vite/plugins/twig-extension-installers.js",
64
+ "config/vite/plugins/twig-module.js",
65
+ "config/vite/plugins/virtual-twig-asset-sources.js",
66
+ "config/vite/plugins/virtual-twig-globs.js",
67
+ "config/vite/plugins/vituum-patch.js",
68
+ "config/vite/plugins/yaml-module.js",
69
+ "config/vite/plugins.js",
70
+ "config/vite/project-config.js",
71
+ "config/vite/project-extensions.js",
72
+ "config/vite/project-structure.js",
73
+ "config/vite/twig-extensions.js",
74
+ "config/vite/utils/fs-safe.js",
75
+ "config/vite/utils/paths.js",
76
+ "config/vite/utils/react-singleton.js",
77
+ "config/vite/utils/unique.js",
78
+ "config/vite/vite.config.js",
79
+ "scripts/a11y.js",
80
+ "scripts/audit.js",
81
+ "scripts/audit-twig-stories.js",
82
+ "scripts/check-node-version.js",
83
+ "scripts/loadYaml.js",
84
+ "src/extensions/index.js",
85
+ "src/extensions/react/index.js",
86
+ "src/extensions/react/register.js",
87
+ "src/extensions/shared/attributes.js",
88
+ "src/extensions/shared/html.js",
89
+ "src/extensions/shared/lists.js",
90
+ "src/extensions/shared/object.js",
91
+ "src/extensions/twig/function-map.js",
92
+ "src/extensions/twig/functions/add-attributes.js",
93
+ "src/extensions/twig/functions/bem.js",
94
+ "src/extensions/twig/index.js",
95
+ "src/extensions/twig/register.js",
96
+ "src/extensions/twig/tag-map.js",
97
+ "src/extensions/twig/tags/switch.js",
98
+ "src/storybook/index.js",
99
+ "src/storybook/main-config.js",
100
+ "src/storybook/platform-behaviors.js",
101
+ "src/storybook/preview-parameters.js",
102
+ "src/storybook/render-twig.js",
103
+ "src/storybook/twig/include-function.js",
104
+ "src/storybook/twig/include.js",
105
+ "src/storybook/twig/drupal-filters.js",
106
+ "src/storybook/twig/reference-paths.js",
107
+ "src/storybook/twig/resolver.js",
108
+ "src/storybook/twig/setup.js",
109
+ "src/storybook/twig/source-events.js",
110
+ "src/storybook/twig/source-extensions.js",
111
+ "src/storybook/twig/source-function.js",
112
+ "src/storybook/twig/source.js"
113
+ ],
114
+ "exports": {
115
+ ".": "./src/extensions/index.js",
116
+ "./extensions": "./src/extensions/index.js",
117
+ "./extensions/react": "./src/extensions/react/index.js",
118
+ "./extensions/twig": "./src/extensions/twig/index.js",
119
+ "./storybook": "./src/storybook/index.js",
120
+ "./storybook/twig/drupal-filters": "./src/storybook/twig/drupal-filters.js",
121
+ "./storybook/twig/include-function": "./src/storybook/twig/include-function.js",
122
+ "./storybook/twig/source-function": "./src/storybook/twig/source-function.js",
123
+ "./storybook/twig/source": "./src/storybook/twig/source.js",
124
+ "./vite": "./config/vite/vite.config.js",
125
+ "./vite/plugins": "./config/vite/plugins.js",
126
+ "./package.json": "./package.json"
127
+ },
27
128
  "publishConfig": {
28
129
  "access": "public"
29
130
  },
@@ -31,122 +132,101 @@
31
132
  "scripts-prepend-node-path": "auto"
32
133
  },
33
134
  "scripts": {
34
- "coverage": "npm run test && open-cli .coverage/lcov-report/index.html",
35
- "format": "npm run lint-fix; npm run prettier-fix",
36
- "husky:commit-msg": "commitlint --edit $1",
37
- "husky:pre-commit": "npm run lint",
38
- "lint": "npm run lint-js",
39
- "lint-fix": "npm run lint-js -- --fix",
40
- "lint-js": "eslint --config config/eslint.config.js --no-error-on-unmatched-pattern ./config ./storybook",
41
- "lint-staged": "lint-staged",
42
- "prepare": "[ -d '.git' ] && (husky install) || true",
43
- "prettier": "prettier --config config/prettierrc.json --ignore-unknown \"**/*.{js,yml,scss,md}\"",
44
- "prettier-fix": "prettier --config config/prettierrc.json --write --ignore-unknown \"**/*.{js,yml,scss,md}\"",
45
- "semantic-release": "semantic-release --config ./release.config.cjs",
46
- "storybook": "NODE_OPTIONS=--no-deprecation storybook dev --ci -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -p 6006",
47
- "storybook-build": "storybook build -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -o .out",
48
- "storybook-deploy": "storybook-to-ghpages -o .out",
49
- "test": "jest --coverage --config ./config/jest.config.js",
50
- "twatch": "jest --no-coverage --watch --verbose"
135
+ "check-node-version": "node scripts/check-node-version.js",
136
+ "audit": "npm run check-node-version && node scripts/audit.js",
137
+ "audit:twig-stories": "npm run check-node-version && node scripts/audit-twig-stories.js",
138
+ "coverage": "npm run check-node-version && npm run test && open-cli .coverage/lcov-report/index.html",
139
+ "format": "npm run check-node-version && npm run lint-fix && npm run prettier-fix",
140
+ "fixtures:release": "npm run check-node-version && node scripts/release-fixtures.js",
141
+ "fixtures:release:list": "npm run check-node-version && node scripts/release-fixtures.js --list",
142
+ "husky:commit-msg": "npm run check-node-version && commitlint --edit $1",
143
+ "husky:pre-commit": "npm run check-node-version && npm run lint",
144
+ "lint": "npm run check-node-version && npm run lint-js && npm run prettier",
145
+ "lint-fix": "npm run check-node-version && npm run lint-js -- --fix",
146
+ "lint-js": "npm run check-node-version && eslint --config config/eslint.config.js ./.cli ./.storybook ./config ./scripts ./src",
147
+ "lint-staged": "npm run check-node-version && lint-staged",
148
+ "prepare": "npm run check-node-version && husky",
149
+ "prettier": "npm run check-node-version && prettier --check --config config/.prettierrc.json --ignore-unknown \"**/*.{js,mjs,cjs,jsx,json,yml,yaml,scss,md,twig}\"",
150
+ "prettier-fix": "npm run check-node-version && prettier --config config/.prettierrc.json --write --ignore-unknown \"**/*.{js,mjs,cjs,jsx,json,yml,yaml,scss,md,twig}\"",
151
+ "semantic-release": "npm run check-node-version && semantic-release --config ./release.config.cjs",
152
+ "version:develop": "npm run check-node-version && node scripts/bump-version-from-commits.js",
153
+ "storybook": "npm run check-node-version && NODE_OPTIONS=--no-deprecation storybook dev -p 6006 --no-open --exact-port",
154
+ "storybook-build": "npm run check-node-version && storybook build -o .out",
155
+ "storybook-deploy": "npm run check-node-version && storybook-to-ghpages -o .out",
156
+ "test": "npm run check-node-version && jest --coverage --config ./config/jest.config.js",
157
+ "twatch": "npm run check-node-version && jest --no-coverage --watch --verbose"
51
158
  },
52
159
  "dependencies": {
53
- "@babel/core": "^7.28.5",
54
- "@babel/eslint-parser": "^7.28.5",
55
- "@babel/preset-env": "^7.28.5",
160
+ "@babel/core": "^7.28.4",
161
+ "@babel/eslint-parser": "^7.28.6",
162
+ "@babel/preset-env": "^7.28.3",
56
163
  "@emulsify/cli": "^1.11.4",
57
- "@eslint/js": "^9.38.0",
58
- "@storybook/addon-a11y": "^8.6.14",
59
- "@storybook/addon-actions": "^8.6.14",
60
- "@storybook/addon-essentials": "^8.6.14",
61
- "@storybook/addon-links": "^8.6.14",
62
- "@storybook/addon-styling-webpack": "^1.0.1",
63
- "@storybook/addon-themes": "^8.6.14",
64
- "@storybook/html": "^8.6.14",
65
- "@storybook/html-webpack5": "^8.6.14",
66
- "@storybook/manager-api": "^8.6.14",
67
- "@storybook/preview-api": "^8.6.14",
68
- "@storybook/theming": "^8.6.14",
69
- "add-attributes-twig-extension": "^0.1.0",
164
+ "@eslint/js": "^9.39.4",
165
+ "@storybook/addon-a11y": "^10.1.4",
166
+ "@storybook/addon-links": "^10.1.4",
167
+ "@storybook/addon-themes": "^10.1.4",
168
+ "@storybook/react": "^10.1.4",
169
+ "@storybook/react-vite": "^10.1.4",
170
+ "@vituum/vite-plugin-twig": "^1.1.0",
70
171
  "autoprefixer": "^10.4.21",
71
- "babel-loader": "^10.0.0",
72
172
  "babel-preset-minify": "^0.5.2",
73
- "bem-twig-extension": "^0.1.1",
74
- "breakpoint-sass": "^3.0.0",
75
- "clean-webpack-plugin": "^4.0.0",
76
173
  "concurrently": "^9.2.1",
77
- "copy-webpack-plugin": "^13.0.1",
78
- "css-loader": "^7.1.1",
79
- "eslint": "^9.38.0",
174
+ "eslint": "^9.39.4",
80
175
  "eslint-config-prettier": "^10.1.8",
81
176
  "eslint-plugin-import": "^2.32.0",
82
177
  "eslint-plugin-jest": "^29.0.1",
83
178
  "eslint-plugin-prettier": "^5.5.4",
84
- "eslint-plugin-security": "^3.0.1",
85
- "eslint-plugin-storybook": "^0.12.0",
86
- "eslint-webpack-plugin": "^5.0.2",
87
- "file-loader": "^6.2.0",
88
- "fs-extra": "^11.3.2",
89
- "glob": "^11.0.3",
179
+ "eslint-plugin-security": "^4.0.0",
180
+ "eslint-plugin-storybook": "^10.1.4",
181
+ "fs-extra": "^11.3.1",
182
+ "glob": "^13.0.6",
90
183
  "graceful-fs": "^4.2.11",
91
- "html-webpack-plugin": "^5.6.4",
92
- "image-minimizer-webpack-plugin": "^4.1.4",
93
- "imagemin": "^9.0.1",
94
- "imagemin-jpegtran": "^8.0.0",
95
- "imagemin-optipng": "^8.0.0",
96
184
  "jest": "^30.2.0",
97
185
  "jest-environment-jsdom": "^30.2.0",
98
186
  "js-yaml": "^4.1.0",
99
- "js-yaml-loader": "^1.2.2",
100
- "mini-css-extract-plugin": "^2.9.4",
101
- "node-sass-glob-importer": "^5.3.3",
102
187
  "normalize.css": "^8.0.1",
103
- "open-cli": "^8.0.0",
188
+ "open-cli": "^9.0.0",
104
189
  "pa11y": "^9.0.1",
105
- "postcss": "^8.5.6",
106
- "postcss-loader": "^8.2.0",
190
+ "postcss": "^8.5.4",
107
191
  "postcss-scss": "^4.0.9",
108
192
  "ramda": "^0.32.0",
109
193
  "regenerator-runtime": "^0.14.1",
110
194
  "sass": "^1.93.2",
111
- "sass-loader": "^16.0.6",
112
- "storybook": "^8.6.14",
113
- "style-dictionary": "^5.1.1",
114
- "stylelint": "^16.25.0",
115
- "stylelint-config-standard-scss": "^16.0.0",
195
+ "storybook": "^10.1.4",
196
+ "stylelint": "^17.12.0",
197
+ "stylelint-config-standard-scss": "^17.0.0",
116
198
  "stylelint-prettier": "^5.0.3",
117
- "stylelint-selector-bem-pattern": "^4.0.1",
118
- "stylelint-webpack-plugin": "^5.0.1",
119
- "svg-spritemap-webpack-plugin": "^5.0.3",
120
- "token-transformer": "^0.0.33",
199
+ "stylelint-selector-bem-pattern": "^5.0.0",
200
+ "twig": "^3.0.0",
121
201
  "twig-drupal-filters": "^3.2.0",
122
- "twig-testing-library": "^1.2.0",
123
- "twigjs-loader": "^1.0.3",
124
- "webpack": "^5.102.1",
125
- "webpack-cli": "^6.0.1",
126
- "webpack-merge": "^6.0.1",
127
- "webpack-remove-empty-scripts": "^1.1.1",
202
+ "vite": "^7.3.3",
203
+ "vite-plugin-sass-glob-import": "^6.0.0",
204
+ "vite-plugin-static-copy": "^4.1.0",
205
+ "vite-plugin-svg-sprite": "^0.7.0",
128
206
  "yaml": "^2.8.1"
129
207
  },
130
208
  "devDependencies": {
131
- "@commitlint/cli": "^20.1.0",
132
- "@commitlint/config-conventional": "^20.0.0",
209
+ "@commitlint/cli": "^21.0.1",
210
+ "@commitlint/config-conventional": "^21.0.1",
133
211
  "@semantic-release/changelog": "^6.0.2",
134
212
  "@semantic-release/commit-analyzer": "^13.0.1",
135
213
  "@semantic-release/git": "^10.0.1",
136
- "@semantic-release/github": "^11.0.6",
214
+ "@semantic-release/github": "^12.0.8",
215
+ "@semantic-release/npm": "^13.1.5",
137
216
  "@semantic-release/release-notes-generator": "^14.1.0",
138
- "all-contributors-cli": "^6.26.1",
139
217
  "husky": "^9.1.7",
140
- "lint-staged": "^16.2.6",
141
- "semantic-release": "^24.2.9"
218
+ "lint-staged": "^17.0.5",
219
+ "react": "^19.2.0",
220
+ "react-dom": "^19.2.0",
221
+ "semantic-release": "^25.0.3"
222
+ },
223
+ "peerDependencies": {
224
+ "react": "^18.0.0 || ^19.0.0",
225
+ "react-dom": "^18.0.0 || ^19.0.0"
142
226
  },
143
227
  "overrides": {
144
- "inflight": "^1.0.7",
145
- "graceful-fs": "^4.2.11",
146
- "glob": "^11.0.3",
147
- "rimraf": "^4.3.0",
148
- "source-map-url": "^0.4.1",
149
- "source-map-resolve": "^0.6.0",
150
- "uuid": "^8.3.2"
228
+ "glob": "^13.0.6",
229
+ "locutus": "^3.0.36",
230
+ "minimatch@3.0.x": "^3.1.5"
151
231
  }
152
232
  }