@emulsify/core 3.5.0 → 4.0.1
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.
- package/.cli/init.js +40 -31
- package/.storybook/_drupal.js +129 -8
- package/.storybook/css-components.js +13 -0
- package/.storybook/css-dist.js +5 -0
- package/.storybook/emulsifyTheme.js +9 -6
- package/.storybook/main.js +397 -106
- package/.storybook/manager.js +9 -16
- package/.storybook/preview.js +88 -110
- package/.storybook/utils.js +69 -74
- package/README.md +110 -59
- package/config/.stylelintrc.json +2 -6
- package/config/a11y.config.js +9 -5
- package/config/babel.config.js +6 -11
- package/config/eslint.config.js +31 -3
- package/config/postcss.config.js +5 -0
- package/config/vite/entries.js +227 -0
- package/config/vite/environment.js +39 -0
- package/config/vite/platforms.js +70 -0
- package/config/vite/plugins/copy-src-assets.js +76 -0
- package/config/vite/plugins/copy-twig-files.js +84 -0
- package/config/vite/plugins/css-asset-relativizer.js +40 -0
- package/config/vite/plugins/index.js +105 -0
- package/config/vite/plugins/mirror-components.js +358 -0
- package/config/vite/plugins/require-context.js +311 -0
- package/config/vite/plugins/source-file-index.js +184 -0
- package/config/vite/plugins/svg-sprite.js +117 -0
- package/config/vite/plugins/twig-extension-installers.js +36 -0
- package/config/vite/plugins/twig-module.js +1251 -0
- package/config/vite/plugins/virtual-twig-asset-sources.js +404 -0
- package/config/vite/plugins/virtual-twig-globs.js +136 -0
- package/config/vite/plugins/vituum-patch.js +167 -0
- package/config/vite/plugins/yaml-module.js +133 -0
- package/config/vite/plugins.js +12 -0
- package/config/vite/project-config.js +192 -0
- package/config/vite/project-extensions.js +177 -0
- package/config/vite/project-structure.js +447 -0
- package/config/vite/twig-extensions.js +109 -0
- package/config/vite/utils/fs-safe.js +66 -0
- package/config/vite/utils/paths.js +40 -0
- package/config/vite/utils/react-singleton.js +85 -0
- package/config/vite/utils/unique.js +36 -0
- package/config/vite/vite.config.js +161 -0
- package/package.json +164 -75
- package/scripts/a11y.js +70 -16
- package/scripts/audit-twig-stories.js +378 -0
- package/scripts/audit.js +1602 -0
- package/scripts/check-node-version.js +18 -0
- package/scripts/loadYaml.js +5 -1
- package/src/extensions/index.js +8 -0
- package/src/extensions/react/index.js +12 -0
- package/src/extensions/react/register.js +45 -0
- package/src/extensions/shared/attributes.js +308 -0
- package/src/extensions/shared/html.js +41 -0
- package/src/extensions/shared/lists.js +38 -0
- package/src/extensions/shared/object.js +22 -0
- package/src/extensions/twig/function-map.js +20 -0
- package/src/extensions/twig/functions/add-attributes.js +39 -0
- package/src/extensions/twig/functions/bem.js +166 -0
- package/src/extensions/twig/index.js +13 -0
- package/src/extensions/twig/register.js +95 -0
- package/src/extensions/twig/tag-map.js +16 -0
- package/src/extensions/twig/tags/switch.js +266 -0
- package/src/storybook/index.js +14 -0
- package/src/storybook/main-config.js +132 -0
- package/src/storybook/platform-behaviors.js +60 -0
- package/src/storybook/preview-parameters.js +81 -0
- package/src/storybook/render-twig.js +295 -0
- package/src/storybook/twig/drupal-filters.js +7 -0
- package/src/storybook/twig/include-function.js +109 -0
- package/src/storybook/twig/include.js +28 -0
- package/src/storybook/twig/reference-paths.js +294 -0
- package/src/storybook/twig/resolver.js +318 -0
- package/src/storybook/twig/setup.js +39 -0
- package/src/storybook/twig/source-events.js +5 -0
- package/src/storybook/twig/source-extensions.js +24 -0
- package/src/storybook/twig/source-function.js +239 -0
- package/src/storybook/twig/source.js +39 -0
- package/.all-contributorsrc +0 -45
- package/.editorconfig +0 -5
- package/.github/ISSUE_TEMPLATE/BUG_REPORT_TEMPLATE.md +0 -18
- package/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
- package/.github/dependabot.yml +0 -6
- package/.github/workflows/addtoprojects.yml +0 -21
- package/.github/workflows/contributors.yml +0 -37
- package/.github/workflows/lint.yml +0 -22
- package/.github/workflows/semantic-release.yml +0 -24
- package/.husky/commit-msg +0 -2
- package/.husky/pre-commit +0 -2
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/.storybook/polyfills/twig-include.js +0 -40
- package/.storybook/polyfills/twig-resolver.js +0 -70
- package/.storybook/polyfills/twig-source.js +0 -65
- package/.storybook/webpack.config.js +0 -269
- package/CODE_OF_CONDUCT.md +0 -56
- package/commitlint.config.js +0 -5
- package/config/jest.config.js +0 -19
- package/config/webpack/app.js +0 -1
- package/config/webpack/loaders.js +0 -167
- package/config/webpack/optimizers.js +0 -26
- package/config/webpack/plugins.js +0 -283
- package/config/webpack/resolves.js +0 -157
- package/config/webpack/sdc-loader.js +0 -16
- package/config/webpack/webpack.common.js +0 -272
- package/config/webpack/webpack.dev.js +0 -41
- package/config/webpack/webpack.prod.js +0 -6
- package/release.config.cjs +0 -30
- package/scripts/a11y.test.js +0 -172
- 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": "
|
|
4
|
-
"description": "Bundled tooling for Storybook development +
|
|
3
|
+
"version": "4.0.1",
|
|
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,113 +132,101 @@
|
|
|
31
132
|
"scripts-prepend-node-path": "auto"
|
|
32
133
|
},
|
|
33
134
|
"scripts": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
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.
|
|
54
|
-
"@babel/
|
|
160
|
+
"@babel/core": "^7.28.4",
|
|
161
|
+
"@babel/eslint-parser": "^7.28.6",
|
|
162
|
+
"@babel/preset-env": "^7.28.3",
|
|
55
163
|
"@emulsify/cli": "^1.11.4",
|
|
56
|
-
"@eslint/js": "^
|
|
57
|
-
"@storybook/addon-a11y": "^
|
|
58
|
-
"@storybook/addon-links": "^
|
|
59
|
-
"@storybook/addon-
|
|
60
|
-
"@storybook/
|
|
61
|
-
"@storybook/
|
|
62
|
-
"@
|
|
63
|
-
"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",
|
|
64
171
|
"autoprefixer": "^10.4.21",
|
|
65
|
-
"babel-loader": "^10.0.0",
|
|
66
172
|
"babel-preset-minify": "^0.5.2",
|
|
67
|
-
"bem-twig-extension": "^0.1.1",
|
|
68
|
-
"breakpoint-sass": "^3.0.0",
|
|
69
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
70
173
|
"concurrently": "^9.2.1",
|
|
71
|
-
"
|
|
72
|
-
"css-loader": "^7.1.1",
|
|
73
|
-
"eslint": "^10.1.0",
|
|
174
|
+
"eslint": "^9.39.4",
|
|
74
175
|
"eslint-config-prettier": "^10.1.8",
|
|
75
|
-
"eslint-plugin-
|
|
176
|
+
"eslint-plugin-import": "^2.32.0",
|
|
177
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
76
178
|
"eslint-plugin-prettier": "^5.5.4",
|
|
77
179
|
"eslint-plugin-security": "^4.0.0",
|
|
78
|
-
"
|
|
79
|
-
"fs-extra": "^11.3.
|
|
180
|
+
"eslint-plugin-storybook": "^10.1.4",
|
|
181
|
+
"fs-extra": "^11.3.1",
|
|
80
182
|
"glob": "^13.0.6",
|
|
81
183
|
"graceful-fs": "^4.2.11",
|
|
82
|
-
"html-webpack-plugin": "^5.6.4",
|
|
83
|
-
"image-minimizer-webpack-plugin": "^5.0.0",
|
|
84
|
-
"imagemin": "^9.0.1",
|
|
85
|
-
"imagemin-jpegtran": "^8.0.0",
|
|
86
|
-
"imagemin-optipng": "^8.0.0",
|
|
87
184
|
"jest": "^30.2.0",
|
|
88
185
|
"jest-environment-jsdom": "^30.2.0",
|
|
89
186
|
"js-yaml": "^4.1.0",
|
|
90
|
-
"js-yaml-loader": "^1.2.2",
|
|
91
|
-
"mini-css-extract-plugin": "^2.9.4",
|
|
92
|
-
"node-sass-glob-importer": "^5.3.3",
|
|
93
187
|
"normalize.css": "^8.0.1",
|
|
94
188
|
"open-cli": "^9.0.0",
|
|
95
189
|
"pa11y": "^9.0.1",
|
|
96
|
-
"postcss": "^8.5.
|
|
97
|
-
"postcss-loader": "^8.2.0",
|
|
190
|
+
"postcss": "^8.5.4",
|
|
98
191
|
"postcss-scss": "^4.0.9",
|
|
99
192
|
"ramda": "^0.32.0",
|
|
100
193
|
"regenerator-runtime": "^0.14.1",
|
|
101
194
|
"sass": "^1.93.2",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"style-dictionary": "^5.1.1",
|
|
105
|
-
"stylelint": "^17.7.0",
|
|
195
|
+
"storybook": "^10.1.4",
|
|
196
|
+
"stylelint": "^17.12.0",
|
|
106
197
|
"stylelint-config-standard-scss": "^17.0.0",
|
|
107
198
|
"stylelint-prettier": "^5.0.3",
|
|
108
|
-
"stylelint-
|
|
109
|
-
"
|
|
110
|
-
"terser-webpack-plugin": "^5.3.9",
|
|
111
|
-
"token-transformer": "^0.0.33",
|
|
199
|
+
"stylelint-selector-bem-pattern": "^5.0.0",
|
|
200
|
+
"twig": "^3.0.0",
|
|
112
201
|
"twig-drupal-filters": "^3.2.0",
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"webpack-merge": "^6.0.1",
|
|
118
|
-
"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",
|
|
119
206
|
"yaml": "^2.8.1"
|
|
120
207
|
},
|
|
121
208
|
"devDependencies": {
|
|
122
|
-
"@commitlint/cli": "^
|
|
123
|
-
"@commitlint/config-conventional": "^
|
|
209
|
+
"@commitlint/cli": "^21.0.1",
|
|
210
|
+
"@commitlint/config-conventional": "^21.0.1",
|
|
124
211
|
"@semantic-release/changelog": "^6.0.2",
|
|
125
212
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
126
213
|
"@semantic-release/git": "^10.0.1",
|
|
127
|
-
"@semantic-release/github": "^12.0.
|
|
214
|
+
"@semantic-release/github": "^12.0.8",
|
|
215
|
+
"@semantic-release/npm": "^13.1.5",
|
|
128
216
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
129
|
-
"all-contributors-cli": "^6.26.1",
|
|
130
217
|
"husky": "^9.1.7",
|
|
131
|
-
"lint-staged": "^
|
|
218
|
+
"lint-staged": "^17.0.5",
|
|
219
|
+
"react": "^19.2.0",
|
|
220
|
+
"react-dom": "^19.2.0",
|
|
132
221
|
"semantic-release": "^25.0.3"
|
|
133
222
|
},
|
|
223
|
+
"peerDependencies": {
|
|
224
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
225
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
226
|
+
},
|
|
134
227
|
"overrides": {
|
|
135
|
-
"inflight": "^1.0.7",
|
|
136
|
-
"graceful-fs": "^4.2.11",
|
|
137
228
|
"glob": "^13.0.6",
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"source-map-resolve": "^0.6.0",
|
|
141
|
-
"uuid": "^8.3.2"
|
|
229
|
+
"locutus": "^3.0.36",
|
|
230
|
+
"minimatch@3.0.x": "^3.1.5"
|
|
142
231
|
}
|
|
143
232
|
}
|