storybook-addon-sdc 0.5.3 → 0.5.5
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 +13 -12
- package/package.json +1 -1
package/dist/preset.js
CHANGED
|
@@ -8738,20 +8738,22 @@ async function loadExternalDef(defPath) {
|
|
|
8738
8738
|
return (0, import_yaml2.parse)(content);
|
|
8739
8739
|
}
|
|
8740
8740
|
}
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
}
|
|
8746
|
-
return cachedComponentDirectories;
|
|
8747
|
-
};
|
|
8748
|
-
var resolveComponentPath2 = (namespace, component) => {
|
|
8741
|
+
function getComponentDirectories() {
|
|
8742
|
+
return glob.sync("./components/**/*.component.yml");
|
|
8743
|
+
}
|
|
8744
|
+
function resolveComponentPath2(namespace, component) {
|
|
8749
8745
|
const componentDirectories = getComponentDirectories();
|
|
8750
8746
|
const possiblePaths = componentDirectories.map(
|
|
8751
8747
|
(dir) => resolve2(`${dir}/${component}/${component}.component.yml`)
|
|
8752
8748
|
);
|
|
8753
|
-
|
|
8754
|
-
|
|
8749
|
+
const resolvedPath = possiblePaths.find((path) => existsSync2(path));
|
|
8750
|
+
if (!resolvedPath) {
|
|
8751
|
+
logger.error(
|
|
8752
|
+
`Component ${component} could not be resolved in namespace ${namespace}`
|
|
8753
|
+
);
|
|
8754
|
+
}
|
|
8755
|
+
return resolvedPath;
|
|
8756
|
+
}
|
|
8755
8757
|
var defaultOptions = {
|
|
8756
8758
|
validate: "https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json"
|
|
8757
8759
|
};
|
|
@@ -8777,7 +8779,7 @@ async function viteFinal(config, options) {
|
|
|
8777
8779
|
globalDefs[component] = schema;
|
|
8778
8780
|
});
|
|
8779
8781
|
}
|
|
8780
|
-
if (globalDefs
|
|
8782
|
+
if (Object.keys(globalDefs).length > 0) {
|
|
8781
8783
|
logger.info(
|
|
8782
8784
|
`Registering custom definitions: ${Object.keys(globalDefs).join(", ")}`
|
|
8783
8785
|
);
|
|
@@ -8828,6 +8830,5 @@ var previewHead = (head) => `
|
|
|
8828
8830
|
export {
|
|
8829
8831
|
experimental_indexers,
|
|
8830
8832
|
previewHead,
|
|
8831
|
-
resolveComponentPath2 as resolveComponentPath,
|
|
8832
8833
|
viteFinal
|
|
8833
8834
|
};
|