fix(frontend): fix storybook build (#11203)
This commit is contained in:
parent
60366a4558
commit
74a05ec739
1 changed files with 17 additions and 15 deletions
|
@ -96,7 +96,7 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toStories(component: string): string {
|
function toStories(component: string): Promise<string> {
|
||||||
const msw = `${component.slice(0, -'.vue'.length)}.msw`;
|
const msw = `${component.slice(0, -'.vue'.length)}.msw`;
|
||||||
const implStories = `${component.slice(0, -'.vue'.length)}.stories.impl`;
|
const implStories = `${component.slice(0, -'.vue'.length)}.stories.impl`;
|
||||||
const metaStories = `${component.slice(0, -'.vue'.length)}.stories.meta`;
|
const metaStories = `${component.slice(0, -'.vue'.length)}.stories.meta`;
|
||||||
|
@ -394,7 +394,8 @@ function toStories(component: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// glob('src/{components,pages,ui,widgets}/**/*.vue')
|
// glob('src/{components,pages,ui,widgets}/**/*.vue')
|
||||||
Promise.all([
|
(async () => {
|
||||||
|
const globs = await Promise.all([
|
||||||
glob('src/components/global/*.vue'),
|
glob('src/components/global/*.vue'),
|
||||||
glob('src/components/Mk{A,B}*.vue'),
|
glob('src/components/Mk{A,B}*.vue'),
|
||||||
glob('src/components/MkDigitalClock.vue'),
|
glob('src/components/MkDigitalClock.vue'),
|
||||||
|
@ -403,9 +404,10 @@ Promise.all([
|
||||||
glob('src/components/MkUserSetupDialog.vue'),
|
glob('src/components/MkUserSetupDialog.vue'),
|
||||||
glob('src/components/MkUserSetupDialog.*.vue'),
|
glob('src/components/MkUserSetupDialog.*.vue'),
|
||||||
glob('src/pages/user/home.vue'),
|
glob('src/pages/user/home.vue'),
|
||||||
])
|
]);
|
||||||
.then((globs) => globs.flat())
|
const components = globs.flat();
|
||||||
.then((components) => Promise.all(components.map((component) => {
|
await Promise.all(components.map(async (component) => {
|
||||||
const stories = component.replace(/\.vue$/, '.stories.ts');
|
const stories = component.replace(/\.vue$/, '.stories.ts');
|
||||||
return writeFile(stories, toStories(component));
|
await writeFile(stories, await toStories(component));
|
||||||
})));
|
}))
|
||||||
|
})();
|
||||||
|
|
Loading…
Reference in a new issue