Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
raaymax committed Apr 5, 2024
1 parent d6b0e1c commit b222d4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 74 deletions.
70 changes: 0 additions & 70 deletions src/ui/src/stories/CoreButton.stories.ts

This file was deleted.

18 changes: 14 additions & 4 deletions src/ui/tools/generator_storybook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ async function loadComponents() {
}

function generateImports(component, { filePath, srcPath }) {
return `import type { Meta, StoryObj } from "@storybook/vue3";
return `/* eslint-disable prettier/prettier */
/*
* --------------------------------------------------------------
* This is an autogenerated file. Do not edit this file directly!
* --------------------------------------------------------------
*/
import type { Meta, StoryObj } from "@storybook/vue3";
import { provide, ref, computed } from "vue";
import ${component.nameTrim} from "${relPath(filePath, component.fileRef)}";
import injectionKeys from "${srcPath("injectionKeys")}";
Expand All @@ -37,8 +44,11 @@ import { generateCore } from "${srcPath("stories", "fakeCore")}";`;
function generateArgDefault(field) {
if (field.default !== undefined) {
return ` table: {
defaultValue: { summary: ${JSON.stringify(field.default)} }
},`;
defaultValue: {
summary: ${JSON.stringify(field.default)},
},
},
`;
}
return "";
}
Expand All @@ -47,7 +57,7 @@ function generateArgTypes(component) {
.map(([key, field]) => {
return ` ${key}: {
control: "text",
${generateArgDefault(field)} },`;
${generateArgDefault(field)} },`;
})
.join("\n");
}
Expand Down

0 comments on commit b222d4f

Please sign in to comment.