storybook-addon-sdc 0.17.1 → 0.18.2
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/dist/preset.js +19 -8
- package/package.json +6 -6
package/dist/preset.js
CHANGED
|
@@ -425,14 +425,25 @@ var readSDC = (filePath, defs, validate) => {
|
|
|
425
425
|
}
|
|
426
426
|
return sdcSchema;
|
|
427
427
|
};
|
|
428
|
-
var generateImports = (directory, namespaces) =>
|
|
429
|
-
|
|
430
|
-
).
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
428
|
+
var generateImports = (directory, namespaces) => {
|
|
429
|
+
const componentName = basename2(directory);
|
|
430
|
+
return readdirSync2(directory).filter(
|
|
431
|
+
(file) => [".css", ".js", ".mjs", ".twig", ".yml"].includes(extname(file))
|
|
432
|
+
).map((file) => {
|
|
433
|
+
const filePath = `./${file}`;
|
|
434
|
+
const namespace = namespaces.pathToNamespace(directory);
|
|
435
|
+
logger.info(`IMPORT ASSET ${directory}/${file}`);
|
|
436
|
+
if (extname(file) === ".twig") {
|
|
437
|
+
const fileName = basename2(file, ".twig");
|
|
438
|
+
if (fileName === componentName) {
|
|
439
|
+
return `import COMPONENT from '${namespace}/${file}';`;
|
|
440
|
+
}
|
|
441
|
+
logger.info(`Skipping variant template: ${file}`);
|
|
442
|
+
return "";
|
|
443
|
+
}
|
|
444
|
+
return `import '${filePath}';`;
|
|
445
|
+
}).filter(Boolean).join("\n");
|
|
446
|
+
};
|
|
436
447
|
var dynamicImports = (stories, namespaces) => {
|
|
437
448
|
const imports = /* @__PURE__ */ new Set();
|
|
438
449
|
const importComponent = (item) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-addon-sdc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Drupal Single Directory Components as stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"SDC",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"format": "prettier --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"glob": "^
|
|
40
|
+
"glob": "^13.0.0",
|
|
41
41
|
"json-schema-faker": "^0.5.8",
|
|
42
42
|
"jsonschema": "^1.5.0",
|
|
43
43
|
"lodash-es": "^4.17.21",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"yaml": "^2.7.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@storybook/addon-docs": "^
|
|
53
|
-
"@storybook/addon-links": "^
|
|
54
|
-
"@storybook/html-vite": "^
|
|
52
|
+
"@storybook/addon-docs": "^10.0.8",
|
|
53
|
+
"@storybook/addon-links": "^10.0.8",
|
|
54
|
+
"@storybook/html-vite": "^10.0.8",
|
|
55
55
|
"@types/json-schema": "^7.0.15",
|
|
56
56
|
"@types/lodash-es": "^4.17.12",
|
|
57
57
|
"@types/node": "^24.2.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"prompts": "^2.4.2",
|
|
65
65
|
"react": "^19.1.0",
|
|
66
66
|
"react-dom": "^19.1.0",
|
|
67
|
-
"storybook": "^
|
|
67
|
+
"storybook": "^10.0.8",
|
|
68
68
|
"tsup": "^8.4.0",
|
|
69
69
|
"typescript": "^5.8.2",
|
|
70
70
|
"vite": "^6.2.3",
|