@storybook/builder-vite 10.5.0-alpha.7 → 10.5.0-alpha.9
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ytnw9l5mtt from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ytnw9l5mtt from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ytnw9l5mtt.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ytnw9l5mtt.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ytnw9l5mtt from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ytnw9l5mtt from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ytnw9l5mtt.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ytnw9l5mtt.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
normalize,
|
|
25
25
|
relative,
|
|
26
26
|
viteCorePlugins
|
|
27
|
-
} from "./_node-chunks/chunk-
|
|
27
|
+
} from "./_node-chunks/chunk-4OWYWRJ7.js";
|
|
28
28
|
|
|
29
29
|
// ../../../node_modules/picocolors/picocolors.js
|
|
30
30
|
var require_picocolors = __commonJS({
|
|
@@ -1350,7 +1350,7 @@ function cache(name, options) {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
1352
|
// src/plugins/storybook-external-globals-plugin.ts
|
|
1353
|
-
var escapeKeys = (key) => key.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), defaultImportRegExp = "import ([^*{}]+) from", replacementMap = /* @__PURE__ */ new Map([
|
|
1353
|
+
var escapeKeys = (key) => key.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), defaultImportRegExp = "import ([^*{}]+) from", emptyImportRegExp = /^import(?:\s*\{\s*\}\s*from)?\s*['"][^'"]+['"]\s*;?$/, replacementMap = /* @__PURE__ */ new Map([
|
|
1354
1354
|
["import ", "const "],
|
|
1355
1355
|
["import{", "const {"],
|
|
1356
1356
|
["* as ", ""],
|
|
@@ -1410,11 +1410,20 @@ function getDefaultImportReplacement(match) {
|
|
|
1410
1410
|
let matched = match.match(defaultImportRegExp);
|
|
1411
1411
|
return matched && `const {default: ${matched[1]}} =`;
|
|
1412
1412
|
}
|
|
1413
|
+
function getEmptyImportReplacement(importStatement, globalReference) {
|
|
1414
|
+
if (!emptyImportRegExp.test(importStatement.trim()))
|
|
1415
|
+
return;
|
|
1416
|
+
let statementTerminator = importStatement.trimEnd().endsWith(";") ? ";" : "";
|
|
1417
|
+
return `void ${globalReference}${statementTerminator}`;
|
|
1418
|
+
}
|
|
1413
1419
|
function getSearchRegExp(packageName) {
|
|
1414
1420
|
let staticKeys = [...replacementMap.keys()].map(escapeKeys), packageNameLiteral = `.${packageName}.`, dynamicImportExpression = `await import\\(.${packageName}.\\)`, lookup = [defaultImportRegExp, ...staticKeys, packageNameLiteral, dynamicImportExpression];
|
|
1415
1421
|
return new RegExp(`(${lookup.join("|")})`, "g");
|
|
1416
1422
|
}
|
|
1417
1423
|
function rewriteImport(importStatement, globs, packageName) {
|
|
1424
|
+
let emptyImportReplacement = getEmptyImportReplacement(importStatement, globs[packageName]);
|
|
1425
|
+
if (emptyImportReplacement)
|
|
1426
|
+
return emptyImportReplacement;
|
|
1418
1427
|
let search = getSearchRegExp(packageName);
|
|
1419
1428
|
return importStatement.replace(
|
|
1420
1429
|
search,
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_9ytnw9l5mtt from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_9ytnw9l5mtt from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_9ytnw9l5mtt.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_9ytnw9l5mtt.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_9ytnw9l5mtt.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_r4b764fhkh.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
optimizeViteDeps,
|
|
14
14
|
viteCorePlugins
|
|
15
|
-
} from "./_node-chunks/chunk-
|
|
15
|
+
} from "./_node-chunks/chunk-4OWYWRJ7.js";
|
|
16
16
|
export {
|
|
17
17
|
optimizeViteDeps,
|
|
18
18
|
viteCorePlugins
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/builder-vite",
|
|
3
|
-
"version": "10.5.0-alpha.
|
|
3
|
+
"version": "10.5.0-alpha.9",
|
|
4
4
|
"description": "A Storybook builder to dev and build with Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"!src/**/*"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@storybook/csf-plugin": "10.5.0-alpha.
|
|
50
|
+
"@storybook/csf-plugin": "10.5.0-alpha.9",
|
|
51
51
|
"ts-dedent": "^2.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vite": "^7.0.4"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"storybook": "^10.5.0-alpha.
|
|
65
|
+
"storybook": "^10.5.0-alpha.9",
|
|
66
66
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|