@storybook/vue3-vite 10.1.0-alpha.9 → 10.1.0-beta.0
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/_node-chunks/chunk-JGFHCZCK.js +29 -0
- package/dist/node/index.js +6 -10
- package/dist/preset.js +90 -188
- package/dist/vite-plugin.js +8 -13
- package/package.json +5 -5
- package/template/cli/ts/Button.stories.ts +1 -5
- package/dist/_node-chunks/chunk-N2S7KTMJ.js +0 -33
- package/dist/_node-chunks/chunk-U3YDWYBF.js +0 -17
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_82yszpqw3dx from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_82yszpqw3dx from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_82yszpqw3dx from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_82yszpqw3dx.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_82yszpqw3dx.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_82yszpqw3dx.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/plugins/vue-template.ts
|
|
14
|
+
async function templateCompilation() {
|
|
15
|
+
return {
|
|
16
|
+
name: "storybook:vue-template-compilation",
|
|
17
|
+
config: () => ({
|
|
18
|
+
resolve: {
|
|
19
|
+
alias: {
|
|
20
|
+
vue: "vue/dist/vue.esm-bundler.js"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
templateCompilation
|
|
29
|
+
};
|
package/dist/node/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_82yszpqw3dx from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_82yszpqw3dx from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_82yszpqw3dx from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_82yszpqw3dx.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_82yszpqw3dx.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_82yszpqw3dx.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "../_node-chunks/chunk-U3YDWYBF.js";
|
|
15
12
|
|
|
16
13
|
// src/node/index.ts
|
|
17
14
|
function defineMain(config) {
|
|
18
15
|
return config;
|
|
19
16
|
}
|
|
20
|
-
__name(defineMain, "defineMain");
|
|
21
17
|
export {
|
|
22
18
|
defineMain
|
|
23
19
|
};
|
package/dist/preset.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_82yszpqw3dx from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_82yszpqw3dx from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_82yszpqw3dx from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_82yszpqw3dx.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_82yszpqw3dx.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_82yszpqw3dx.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
templateCompilation
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import {
|
|
16
|
-
__name
|
|
17
|
-
} from "./_node-chunks/chunk-U3YDWYBF.js";
|
|
14
|
+
} from "./_node-chunks/chunk-JGFHCZCK.js";
|
|
18
15
|
|
|
19
16
|
// src/plugins/vue-component-meta.ts
|
|
20
17
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -28,249 +25,154 @@ import {
|
|
|
28
25
|
} from "vue-component-meta";
|
|
29
26
|
import { parseMulti } from "vue-docgen-api";
|
|
30
27
|
async function vueComponentMeta(tsconfigPath = "tsconfig.json") {
|
|
31
|
-
|
|
32
|
-
const exclude = /\.stories\.(ts|tsx|js|jsx)$|^\0\/virtual:|^\/virtual:|\.storybook\/.*\.(ts|js)$/;
|
|
33
|
-
const include = /\.(vue|ts|js|tsx|jsx)$/;
|
|
34
|
-
const filter = createFilter(include, exclude);
|
|
35
|
-
const checker = await createVueComponentMetaChecker(tsconfigPath);
|
|
28
|
+
let { createFilter } = await import("vite"), filter = createFilter(/\.(vue|ts|js|tsx|jsx)$/, /\.stories\.(ts|tsx|js|jsx)$|^\0\/virtual:|^\/virtual:|\.storybook\/.*\.(ts|js)$/), checker = await createVueComponentMetaChecker(tsconfigPath);
|
|
36
29
|
return {
|
|
37
30
|
name: "storybook:vue-component-meta-plugin",
|
|
38
31
|
async transform(src, id) {
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const exportName = exportNames[index];
|
|
53
|
-
["props", "events", "slots", "exposed"].forEach((key) => {
|
|
54
|
-
meta[key].forEach((value) => {
|
|
55
|
-
if (Array.isArray(value.schema)) {
|
|
56
|
-
value.schema.forEach((eventSchema) => removeNestedSchemas(eventSchema));
|
|
57
|
-
} else {
|
|
58
|
-
removeNestedSchemas(value.schema);
|
|
59
|
-
}
|
|
32
|
+
if (filter(id))
|
|
33
|
+
try {
|
|
34
|
+
let exportNames = checker.getExportNames(id), componentsMeta = exportNames.map((name) => checker.getComponentMeta(id, name));
|
|
35
|
+
componentsMeta = await applyTempFixForEventDescriptions(id, componentsMeta);
|
|
36
|
+
let metaSources = [];
|
|
37
|
+
if (componentsMeta.forEach((meta, index) => {
|
|
38
|
+
if (!meta.props.length && !meta.events.length && !meta.slots.length && !meta.exposed.length || meta.type === TypeMeta.Unknown)
|
|
39
|
+
return;
|
|
40
|
+
let exportName = exportNames[index];
|
|
41
|
+
["props", "events", "slots", "exposed"].forEach((key) => {
|
|
42
|
+
meta[key].forEach((value) => {
|
|
43
|
+
Array.isArray(value.schema) ? value.schema.forEach((eventSchema) => removeNestedSchemas(eventSchema)) : removeNestedSchemas(value.schema);
|
|
44
|
+
});
|
|
60
45
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return true;
|
|
78
|
-
})
|
|
79
|
-
);
|
|
80
|
-
metaSources.push({
|
|
81
|
-
exportName,
|
|
82
|
-
displayName: exportName === "default" ? getFilenameWithoutExtension(id) : exportName,
|
|
83
|
-
...meta,
|
|
84
|
-
exposed,
|
|
85
|
-
sourceFiles: id
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
if (metaSources.length === 0) {
|
|
89
|
-
return void 0;
|
|
90
|
-
}
|
|
91
|
-
const s = new MagicString(src);
|
|
92
|
-
metaSources.forEach((meta) => {
|
|
93
|
-
const isDefaultExport = meta.exportName === "default";
|
|
94
|
-
const name = isDefaultExport ? "_sfc_main" : meta.exportName;
|
|
95
|
-
if (new RegExp(`export {.*${name}.*}`).test(src) || new RegExp(`export \\* from ['"]\\S*${name}['"]`).test(src) || // when using re-exports, some exports might be resolved via checker.getExportNames
|
|
96
|
-
// but are not directly exported inside the current file so we need to ignore them too
|
|
97
|
-
!src.includes(name)) {
|
|
46
|
+
let exposed = (
|
|
47
|
+
// the meta also includes duplicated entries in the "exposed" array with "on"
|
|
48
|
+
// prefix (e.g. onClick instead of click), so we need to filter them out here
|
|
49
|
+
meta.exposed.filter((expose) => {
|
|
50
|
+
let nameWithoutOnPrefix = expose.name;
|
|
51
|
+
return nameWithoutOnPrefix.startsWith("on") && (nameWithoutOnPrefix = lowercaseFirstLetter(expose.name.replace("on", ""))), !meta.events.find((event) => event.name === nameWithoutOnPrefix);
|
|
52
|
+
}).filter((expose) => expose.name === "$slots" ? !meta.slots.map((slot) => slot.name).every((slotName) => expose.type.includes(slotName)) : !0)
|
|
53
|
+
);
|
|
54
|
+
metaSources.push({
|
|
55
|
+
exportName,
|
|
56
|
+
displayName: exportName === "default" ? getFilenameWithoutExtension(id) : exportName,
|
|
57
|
+
...meta,
|
|
58
|
+
exposed,
|
|
59
|
+
sourceFiles: id
|
|
60
|
+
});
|
|
61
|
+
}), metaSources.length === 0)
|
|
98
62
|
return;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
63
|
+
let s = new MagicString(src);
|
|
64
|
+
return metaSources.forEach((meta) => {
|
|
65
|
+
let isDefaultExport = meta.exportName === "default", name = isDefaultExport ? "_sfc_main" : meta.exportName;
|
|
66
|
+
new RegExp(`export {.*${name}.*}`).test(src) || new RegExp(`export \\* from ['"]\\S*${name}['"]`).test(src) || // when using re-exports, some exports might be resolved via checker.getExportNames
|
|
67
|
+
// but are not directly exported inside the current file so we need to ignore them too
|
|
68
|
+
!src.includes(name) || (!id.endsWith(".vue") && isDefaultExport && (s.replace("export default ", "const _sfc_main = "), s.append(`
|
|
69
|
+
export default _sfc_main;`)), s.append(`
|
|
70
|
+
;${name}.__docgenInfo = ${JSON.stringify(meta)}`));
|
|
71
|
+
}), {
|
|
72
|
+
code: s.toString(),
|
|
73
|
+
map: s.generateMap({ hires: !0, source: id })
|
|
74
|
+
};
|
|
75
|
+
} catch {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
114
78
|
},
|
|
115
79
|
// handle hot updates to update the component meta on file changes
|
|
116
80
|
async handleHotUpdate({ file, read, server, modules, timestamp }) {
|
|
117
|
-
|
|
81
|
+
let content = await read();
|
|
118
82
|
checker.updateFile(file, content);
|
|
119
|
-
|
|
120
|
-
for (
|
|
121
|
-
server.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp,
|
|
122
|
-
}
|
|
123
|
-
server.ws.send({ type: "full-reload" });
|
|
124
|
-
return [];
|
|
83
|
+
let invalidatedModules = /* @__PURE__ */ new Set();
|
|
84
|
+
for (let mod of modules)
|
|
85
|
+
server.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, !0);
|
|
86
|
+
return server.ws.send({ type: "full-reload" }), [];
|
|
125
87
|
}
|
|
126
88
|
};
|
|
127
89
|
}
|
|
128
|
-
__name(vueComponentMeta, "vueComponentMeta");
|
|
129
90
|
async function createVueComponentMetaChecker(tsconfigPath = "tsconfig.json") {
|
|
130
|
-
|
|
131
|
-
forceUseTs:
|
|
132
|
-
noDeclarations:
|
|
91
|
+
let checkerOptions = {
|
|
92
|
+
forceUseTs: !0,
|
|
93
|
+
noDeclarations: !0,
|
|
133
94
|
printer: { newLine: 1 }
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const projectTsConfigPath = join(projectRoot, tsconfigPath);
|
|
137
|
-
const defaultChecker = createCheckerByJson(projectRoot, { include: ["**/*"] }, checkerOptions);
|
|
138
|
-
if (await fileExists(projectTsConfigPath)) {
|
|
139
|
-
const references = await getTsConfigReferences(projectTsConfigPath);
|
|
140
|
-
if (references.length > 0) {
|
|
141
|
-
return defaultChecker;
|
|
142
|
-
}
|
|
143
|
-
return createChecker(projectTsConfigPath, checkerOptions);
|
|
144
|
-
}
|
|
145
|
-
return defaultChecker;
|
|
95
|
+
}, projectRoot = getProjectRoot(), projectTsConfigPath = join(projectRoot, tsconfigPath), defaultChecker = createCheckerByJson(projectRoot, { include: ["**/*"] }, checkerOptions);
|
|
96
|
+
return await fileExists(projectTsConfigPath) ? (await getTsConfigReferences(projectTsConfigPath)).length > 0 ? defaultChecker : createChecker(projectTsConfigPath, checkerOptions) : defaultChecker;
|
|
146
97
|
}
|
|
147
|
-
__name(createVueComponentMetaChecker, "createVueComponentMetaChecker");
|
|
148
98
|
function getFilenameWithoutExtension(filename) {
|
|
149
99
|
return parse(filename).name;
|
|
150
100
|
}
|
|
151
|
-
__name(getFilenameWithoutExtension, "getFilenameWithoutExtension");
|
|
152
101
|
function lowercaseFirstLetter(string) {
|
|
153
102
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
154
103
|
}
|
|
155
|
-
__name(lowercaseFirstLetter, "lowercaseFirstLetter");
|
|
156
104
|
async function fileExists(fullPath) {
|
|
157
105
|
try {
|
|
158
|
-
await stat(fullPath);
|
|
159
|
-
return true;
|
|
106
|
+
return await stat(fullPath), !0;
|
|
160
107
|
} catch {
|
|
161
|
-
return
|
|
108
|
+
return !1;
|
|
162
109
|
}
|
|
163
110
|
}
|
|
164
|
-
__name(fileExists, "fileExists");
|
|
165
111
|
async function applyTempFixForEventDescriptions(filename, componentMeta) {
|
|
166
|
-
|
|
167
|
-
if (!hasEvents) {
|
|
112
|
+
if (!componentMeta.some((meta) => meta.events.length))
|
|
168
113
|
return componentMeta;
|
|
169
|
-
}
|
|
170
114
|
try {
|
|
171
|
-
|
|
115
|
+
let parsedComponentDocs = await parseMulti(filename);
|
|
172
116
|
componentMeta.map((meta, index) => {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const description = eventsWithDescription.find((i) => i.name === event.name)?.description;
|
|
179
|
-
if (description) {
|
|
180
|
-
event.description = description;
|
|
181
|
-
}
|
|
182
|
-
return event;
|
|
183
|
-
});
|
|
184
|
-
return meta;
|
|
117
|
+
let eventsWithDescription = parsedComponentDocs[index].events;
|
|
118
|
+
return !meta.events.length || !eventsWithDescription?.length || (meta.events = meta.events.map((event) => {
|
|
119
|
+
let description = eventsWithDescription.find((i) => i.name === event.name)?.description;
|
|
120
|
+
return description && (event.description = description), event;
|
|
121
|
+
})), meta;
|
|
185
122
|
});
|
|
186
123
|
} catch {
|
|
187
124
|
}
|
|
188
125
|
return componentMeta;
|
|
189
126
|
}
|
|
190
|
-
__name(applyTempFixForEventDescriptions, "applyTempFixForEventDescriptions");
|
|
191
127
|
async function getTsConfigReferences(tsConfigPath) {
|
|
192
128
|
try {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return [];
|
|
196
|
-
}
|
|
197
|
-
return content.references;
|
|
129
|
+
let content = JSON.parse(await readFile(tsConfigPath, "utf-8"));
|
|
130
|
+
return !("references" in content) || !Array.isArray(content.references) ? [] : content.references;
|
|
198
131
|
} catch {
|
|
199
132
|
return [];
|
|
200
133
|
}
|
|
201
134
|
}
|
|
202
|
-
__name(getTsConfigReferences, "getTsConfigReferences");
|
|
203
135
|
function removeNestedSchemas(schema) {
|
|
204
|
-
if (typeof schema
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
136
|
+
if (typeof schema == "object") {
|
|
137
|
+
if (schema.kind === "enum") {
|
|
138
|
+
schema.schema?.forEach((enumSchema) => removeNestedSchemas(enumSchema));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
delete schema.schema;
|
|
210
142
|
}
|
|
211
|
-
delete schema.schema;
|
|
212
143
|
}
|
|
213
|
-
__name(removeNestedSchemas, "removeNestedSchemas");
|
|
214
144
|
|
|
215
145
|
// src/plugins/vue-docgen.ts
|
|
216
146
|
import MagicString2 from "magic-string";
|
|
217
147
|
import { parse as parse2 } from "vue-docgen-api";
|
|
218
148
|
async function vueDocgen() {
|
|
219
|
-
|
|
220
|
-
const include = /\.(vue)$/;
|
|
221
|
-
const filter = createFilter(include);
|
|
149
|
+
let { createFilter } = await import("vite"), filter = createFilter(/\.(vue)$/);
|
|
222
150
|
return {
|
|
223
151
|
name: "storybook:vue-docgen-plugin",
|
|
224
152
|
async transform(src, id) {
|
|
225
|
-
if (!filter(id))
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const s = new MagicString2(src);
|
|
230
|
-
s.append(`;_sfc_main.__docgenInfo = ${JSON.stringify(metaData)}`);
|
|
231
|
-
return {
|
|
153
|
+
if (!filter(id))
|
|
154
|
+
return;
|
|
155
|
+
let metaData = await parse2(id), s = new MagicString2(src);
|
|
156
|
+
return s.append(`;_sfc_main.__docgenInfo = ${JSON.stringify(metaData)}`), {
|
|
232
157
|
code: s.toString(),
|
|
233
|
-
map: s.generateMap({ hires:
|
|
158
|
+
map: s.generateMap({ hires: !0, source: id })
|
|
234
159
|
};
|
|
235
160
|
}
|
|
236
161
|
};
|
|
237
162
|
}
|
|
238
|
-
__name(vueDocgen, "vueDocgen");
|
|
239
163
|
|
|
240
164
|
// src/preset.ts
|
|
241
165
|
var core = {
|
|
242
166
|
builder: import.meta.resolve("@storybook/builder-vite"),
|
|
243
167
|
renderer: import.meta.resolve("@storybook/vue3/preset")
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const frameworkOptions = typeof framework === "string" ? {} : framework.options ?? {};
|
|
249
|
-
const docgen = resolveDocgenOptions(frameworkOptions.docgen);
|
|
250
|
-
if (docgen !== false) {
|
|
251
|
-
if (docgen.plugin === "vue-component-meta") {
|
|
252
|
-
plugins.push(await vueComponentMeta(docgen.tsconfig));
|
|
253
|
-
} else {
|
|
254
|
-
plugins.push(await vueDocgen());
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
const { mergeConfig } = await import("vite");
|
|
168
|
+
}, viteFinal = async (config, options) => {
|
|
169
|
+
let plugins = [await templateCompilation()], framework = await options.presets.apply("framework"), frameworkOptions = typeof framework == "string" ? {} : framework.options ?? {}, docgen = resolveDocgenOptions(frameworkOptions.docgen);
|
|
170
|
+
docgen !== !1 && (docgen.plugin === "vue-component-meta" ? plugins.push(await vueComponentMeta(docgen.tsconfig)) : plugins.push(await vueDocgen()));
|
|
171
|
+
let { mergeConfig } = await import("vite");
|
|
258
172
|
return mergeConfig(config, {
|
|
259
173
|
plugins
|
|
260
174
|
});
|
|
261
|
-
}, "
|
|
262
|
-
var resolveDocgenOptions = /* @__PURE__ */ __name((docgen) => {
|
|
263
|
-
if (docgen === false) {
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
if (docgen === void 0 || docgen === true) {
|
|
267
|
-
return { plugin: "vue-docgen-api" };
|
|
268
|
-
}
|
|
269
|
-
if (typeof docgen === "string") {
|
|
270
|
-
return { plugin: docgen };
|
|
271
|
-
}
|
|
272
|
-
return docgen;
|
|
273
|
-
}, "resolveDocgenOptions");
|
|
175
|
+
}, resolveDocgenOptions = (docgen) => docgen === !1 ? !1 : docgen === void 0 || docgen === !0 ? { plugin: "vue-docgen-api" } : typeof docgen == "string" ? { plugin: docgen } : docgen;
|
|
274
176
|
export {
|
|
275
177
|
core,
|
|
276
178
|
viteFinal
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_82yszpqw3dx from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_82yszpqw3dx from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_82yszpqw3dx from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_82yszpqw3dx.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_82yszpqw3dx.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_82yszpqw3dx.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
templateCompilation
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
15
|
-
import {
|
|
16
|
-
__name
|
|
17
|
-
} from "./_node-chunks/chunk-U3YDWYBF.js";
|
|
14
|
+
} from "./_node-chunks/chunk-JGFHCZCK.js";
|
|
18
15
|
|
|
19
16
|
// src/vite-plugin.ts
|
|
20
|
-
var storybookVuePlugin =
|
|
21
|
-
return [templateCompilation()];
|
|
22
|
-
}, "storybookVuePlugin");
|
|
17
|
+
var storybookVuePlugin = () => [templateCompilation()];
|
|
23
18
|
export {
|
|
24
19
|
storybookVuePlugin
|
|
25
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/vue3-vite",
|
|
3
|
-
"version": "10.1.0-
|
|
3
|
+
"version": "10.1.0-beta.0",
|
|
4
4
|
"description": "Storybook for Vue3 and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/builder-vite": "10.1.0-
|
|
55
|
-
"@storybook/vue3": "10.1.0-
|
|
54
|
+
"@storybook/builder-vite": "10.1.0-beta.0",
|
|
55
|
+
"@storybook/vue3": "10.1.0-beta.0",
|
|
56
56
|
"magic-string": "^0.30.0",
|
|
57
57
|
"typescript": "^5.8.3",
|
|
58
58
|
"vue-component-meta": "^2.0.0",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"vite": "^7.0.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"storybook": "^10.1.0-
|
|
67
|
+
"storybook": "^10.1.0-beta.0",
|
|
68
68
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae1l"
|
|
74
74
|
}
|
|
@@ -23,11 +23,7 @@ const meta = {
|
|
|
23
23
|
|
|
24
24
|
export default meta;
|
|
25
25
|
type Story = StoryObj<typeof meta>;
|
|
26
|
-
|
|
27
|
-
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
|
|
28
|
-
* See https://storybook.js.org/docs/api/csf
|
|
29
|
-
* to learn how to use render functions.
|
|
30
|
-
*/
|
|
26
|
+
|
|
31
27
|
export const Primary: Story = {
|
|
32
28
|
args: {
|
|
33
29
|
primary: true,
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_ntckjdze3fa from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_ntckjdze3fa from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_ntckjdze3fa from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_ntckjdze3fa.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_ntckjdze3fa.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_ntckjdze3fa.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-U3YDWYBF.js";
|
|
15
|
-
|
|
16
|
-
// src/plugins/vue-template.ts
|
|
17
|
-
async function templateCompilation() {
|
|
18
|
-
return {
|
|
19
|
-
name: "storybook:vue-template-compilation",
|
|
20
|
-
config: /* @__PURE__ */ __name(() => ({
|
|
21
|
-
resolve: {
|
|
22
|
-
alias: {
|
|
23
|
-
vue: "vue/dist/vue.esm-bundler.js"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}), "config")
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
__name(templateCompilation, "templateCompilation");
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
templateCompilation
|
|
33
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_ntckjdze3fa from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_ntckjdze3fa from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_ntckjdze3fa from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_ntckjdze3fa.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_ntckjdze3fa.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_ntckjdze3fa.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
__name
|
|
17
|
-
};
|