@storybook/builder-vite 10.1.0-alpha.9 → 10.1.0-beta.1

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.
@@ -0,0 +1,113 @@
1
+ import CJS_COMPAT_NODE_URL_a9ip00j9v9s from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_a9ip00j9v9s from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_a9ip00j9v9s from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_a9ip00j9v9s.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_a9ip00j9v9s.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_a9ip00j9v9s.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __commonJS = (cb, mod) => function() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from == "object" || typeof from == "function")
22
+ for (let key of __getOwnPropNames(from))
23
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
+ // If the importer is in node compatibility mode or this is not an ESM
28
+ // file that has been converted to a CommonJS file using a Babel-
29
+ // compatible transform (i.e. "__esModule" has not been set), then set
30
+ // "default" to the CommonJS "module.exports" for node compatibility.
31
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
32
+ mod
33
+ ));
34
+
35
+ // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
36
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
37
+ function normalizeWindowsPath(input = "") {
38
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
39
+ }
40
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
41
+ var normalize = function(path2) {
42
+ if (path2.length === 0)
43
+ return ".";
44
+ path2 = normalizeWindowsPath(path2);
45
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
46
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
47
+ };
48
+ function cwd() {
49
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
50
+ }
51
+ var resolve = function(...arguments_) {
52
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
53
+ let resolvedPath = "", resolvedAbsolute = !1;
54
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
55
+ let path2 = index >= 0 ? arguments_[index] : cwd();
56
+ !path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path2));
57
+ }
58
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
59
+ };
60
+ function normalizeString(path2, allowAboveRoot) {
61
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
62
+ for (let index = 0; index <= path2.length; ++index) {
63
+ if (index < path2.length)
64
+ char = path2[index];
65
+ else {
66
+ if (char === "/")
67
+ break;
68
+ char = "/";
69
+ }
70
+ if (char === "/") {
71
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
72
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
73
+ if (res.length > 2) {
74
+ let lastSlashIndex = res.lastIndexOf("/");
75
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
76
+ continue;
77
+ } else if (res.length > 0) {
78
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
79
+ continue;
80
+ }
81
+ }
82
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
83
+ } else
84
+ res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
85
+ lastSlash = index, dots = 0;
86
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
87
+ }
88
+ return res;
89
+ }
90
+ var isAbsolute = function(p) {
91
+ return _IS_ABSOLUTE_RE.test(p);
92
+ };
93
+ var relative = function(from, to) {
94
+ let _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
95
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
96
+ return _to.join("/");
97
+ let _fromCopy = [..._from];
98
+ for (let segment of _fromCopy) {
99
+ if (_to[0] !== segment)
100
+ break;
101
+ _from.shift(), _to.shift();
102
+ }
103
+ return [..._from.map(() => ".."), ..._to].join("/");
104
+ };
105
+
106
+ export {
107
+ __commonJS,
108
+ __toESM,
109
+ normalize,
110
+ resolve,
111
+ isAbsolute,
112
+ relative
113
+ };
package/dist/index.d.ts CHANGED
@@ -26,5 +26,6 @@ declare function hasVitePlugins(plugins: PluginOption[], names: string[]): Promi
26
26
  declare function bail(): Promise<void>;
27
27
  declare const start: ViteBuilder['start'];
28
28
  declare const build: ViteBuilder['build'];
29
+ declare const corePresets: string[];
29
30
 
30
- export { type BuilderOptions, type StorybookConfigVite, type ViteBuilder, type ViteFinal, bail, build, hasVitePlugins, start, withoutVitePlugins };
31
+ export { type BuilderOptions, type StorybookConfigVite, type ViteBuilder, type ViteFinal, bail, build, corePresets, hasVitePlugins, start, withoutVitePlugins };