storybook 10.1.0-alpha.0 → 10.1.0-alpha.10
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/_browser-chunks/{Color-7ZNS6F6B.js → Color-FQNEU7YS.js} +79 -60
- package/dist/_browser-chunks/{chunk-BOOOPFZF.js → WithTooltip-6NHN2GXF.js} +25 -17
- package/dist/_browser-chunks/{chunk-RNE2IUTB.js → chunk-AW46NMGV.js} +9 -1
- package/dist/_browser-chunks/{chunk-C4XOKMDU.js → chunk-QMY4G4R2.js} +49 -49
- package/dist/_browser-chunks/{syntaxhighlighter-DK2ODWXH.js → syntaxhighlighter-RJZASWHL.js} +5 -5
- package/dist/_node-chunks/{builder-manager-OTO33TIA.js → builder-manager-HA7CYFCK.js} +32 -12
- package/dist/_node-chunks/camelcase-QALD4XFE.js +18 -0
- package/dist/_node-chunks/{chunk-O4KUWXD6.js → chunk-2XY53ALL.js} +8 -8
- package/dist/_node-chunks/{chunk-Q4CZSEBO.js → chunk-3CBQMG2A.js} +7 -7
- package/dist/_node-chunks/{chunk-L5WAZZY3.js → chunk-3WDAPZYQ.js} +7 -7
- package/dist/_node-chunks/{chunk-6C7OBGYG.js → chunk-4ZB555EJ.js} +7 -7
- package/dist/_node-chunks/{chunk-RKANIOER.js → chunk-52DXKXY3.js} +8 -8
- package/dist/_node-chunks/{chunk-HYNQ2IX4.js → chunk-5OVB4A6F.js} +7 -7
- package/dist/_node-chunks/chunk-AGHGNXGH.js +18 -0
- package/dist/_node-chunks/{chunk-OYGAWJQE.js → chunk-B23X5ZCK.js} +7 -7
- package/dist/_node-chunks/{chunk-HHTKRAIE.js → chunk-B2DAHWJK.js} +25 -7
- package/dist/_node-chunks/{chunk-FDDQACQD.js → chunk-CC4PW5MJ.js} +7 -7
- package/dist/_node-chunks/{chunk-Q6QFW2Y7.js → chunk-D7NIZELR.js} +67 -59
- package/dist/_node-chunks/{chunk-EFJRT54D.js → chunk-DO5Q3H4L.js} +7 -7
- package/dist/_node-chunks/{chunk-VW3GGAQI.js → chunk-ECK7WVFX.js} +12 -12
- package/dist/_node-chunks/{chunk-XI2VU32X.js → chunk-EUH3NHXA.js} +7 -7
- package/dist/_node-chunks/{chunk-YS6OLN4N.js → chunk-F3XOPI6H.js} +7 -7
- package/dist/_node-chunks/{chunk-NTB3C5XQ.js → chunk-FOQHPHCV.js} +7 -7
- package/dist/_node-chunks/{chunk-HIGKW2KB.js → chunk-G6EL47NS.js} +7 -7
- package/dist/_node-chunks/{chunk-QOI32MCO.js → chunk-GFLS4TJB.js} +7 -7
- package/dist/_node-chunks/{chunk-2WZNP46P.js → chunk-J3XZKWHE.js} +8 -8
- package/dist/_node-chunks/{chunk-LOF6SIRE.js → chunk-LE63EHJ5.js} +12 -12
- package/dist/_node-chunks/{chunk-RR6Q3657.js → chunk-M47XA42S.js} +9 -9
- package/dist/_node-chunks/{chunk-VL6WDGIU.js → chunk-OOI74AL3.js} +6 -6
- package/dist/_node-chunks/{chunk-AITYHU22.js → chunk-OVXB5GGT.js} +7 -7
- package/dist/_node-chunks/chunk-PRJHT3GJ.js +61 -0
- package/dist/_node-chunks/{chunk-SV7ZHC5Z.js → chunk-Q52PVUSU.js} +7 -7
- package/dist/_node-chunks/{chunk-NTAOH664.js → chunk-RMHAL25C.js} +9 -9
- package/dist/_node-chunks/{chunk-A6T2YN75.js → chunk-SDCF5RNN.js} +15 -15
- package/dist/_node-chunks/{chunk-3ICYWJ3N.js → chunk-UJ5SJ23M.js} +7 -7
- package/dist/_node-chunks/{chunk-FWW4IJCM.js → chunk-UPHK4ETU.js} +19 -17
- package/dist/_node-chunks/{chunk-O3OJUFKU.js → chunk-V7VURIPB.js} +8 -8
- package/dist/_node-chunks/{chunk-6M2IPO4E.js → chunk-VPR5IBMG.js} +6 -6
- package/dist/_node-chunks/{chunk-27W6KHQ2.js → chunk-X4XU27M6.js} +7 -7
- package/dist/_node-chunks/{chunk-ZFRTME73.js → chunk-ZHSCUGNP.js} +1467 -148
- package/dist/_node-chunks/{dist-BA2GAJJB.js → dist-6TXHNR5C.js} +9 -9
- package/dist/_node-chunks/{globby-4HAI4KJH.js → globby-PBTV6PX6.js} +9 -9
- package/dist/_node-chunks/{lib-ITRY6RT7.js → lib-4RTDZVGX.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-7PULFTZI.js → mdx-N42X6CFJ-COWEH7KR.js} +8 -8
- package/dist/_node-chunks/{p-limit-63FY4KTG.js → p-limit-PBVZQOFY.js} +7 -7
- package/dist/_node-chunks/{plugin-2BSKCSMA.js → plugin-6ZPCS4LI.js} +10 -10
- package/dist/_node-chunks/{plugin-JEBMTDIB.js → plugin-EOZKYZAG.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-AZ7YPMMD.js → webpack-inject-mocker-runtime-plugin-35HMSMR5.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-7IF6PA2O.js → webpack-mock-plugin-GT3MA5E2.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.js +50 -74
- package/dist/common/index.d.ts +210 -3
- package/dist/common/index.js +28 -20
- package/dist/components/index.d.ts +472 -280
- package/dist/components/index.js +20367 -75
- package/dist/core-server/index.js +1128 -247
- package/dist/core-server/presets/common-manager.js +1143 -2230
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +27 -27
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.js +13 -6
- package/dist/csf-tools/index.d.ts +15 -4
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +40951 -26253
- package/dist/manager/runtime.js +1688 -2693
- package/dist/manager-api/index.d.ts +11 -3
- package/dist/manager-api/index.js +53 -6
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +473 -448
- package/dist/preview/runtime.js +903 -896
- package/dist/preview-api/index.d.ts +68 -67
- package/dist/preview-api/index.js +5 -5
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +547 -547
- package/dist/theming/create.d.ts +4 -2
- package/dist/theming/create.js +1 -1
- package/dist/theming/index.d.ts +9 -6
- package/dist/theming/index.js +13 -6
- package/dist/types/index.d.ts +50 -5
- package/package.json +14 -6
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-I74EUU5O.js +0 -5809
- package/dist/_node-chunks/camelcase-HURSU73A.js +0 -18
- package/dist/_node-chunks/chunk-P7ZABCRS.js +0 -18
- package/dist/_node-chunks/chunk-QWBT2XCX.js +0 -61
- package/dist/_browser-chunks/{chunk-W4QKLQSC.js → chunk-RW5PKMWM.js} +5 -5
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.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
|
detectPnp
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-LE63EHJ5.js";
|
|
15
15
|
import {
|
|
16
16
|
require_pretty_hrtime
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-GFLS4TJB.js";
|
|
18
18
|
import {
|
|
19
19
|
boxen,
|
|
20
20
|
require_string_width
|
|
21
|
-
} from "../_node-chunks/chunk-
|
|
22
|
-
import "../_node-chunks/chunk-
|
|
21
|
+
} from "../_node-chunks/chunk-J3XZKWHE.js";
|
|
22
|
+
import "../_node-chunks/chunk-Q52PVUSU.js";
|
|
23
23
|
import {
|
|
24
24
|
StatusTypeIdMismatchError,
|
|
25
25
|
StorybookError
|
|
26
|
-
} from "../_node-chunks/chunk-
|
|
26
|
+
} from "../_node-chunks/chunk-RMHAL25C.js";
|
|
27
27
|
import {
|
|
28
28
|
getErrorLevel,
|
|
29
29
|
mapStaticDir,
|
|
@@ -31,59 +31,63 @@ import {
|
|
|
31
31
|
sendTelemetryError,
|
|
32
32
|
useStatics,
|
|
33
33
|
withTelemetry
|
|
34
|
-
} from "../_node-chunks/chunk-
|
|
35
|
-
import "../_node-chunks/chunk-
|
|
34
|
+
} from "../_node-chunks/chunk-ECK7WVFX.js";
|
|
35
|
+
import "../_node-chunks/chunk-4ZB555EJ.js";
|
|
36
36
|
import {
|
|
37
37
|
telemetry
|
|
38
|
-
} from "../_node-chunks/chunk-
|
|
39
|
-
import "../_node-chunks/chunk-
|
|
38
|
+
} from "../_node-chunks/chunk-SDCF5RNN.js";
|
|
39
|
+
import "../_node-chunks/chunk-AGHGNXGH.js";
|
|
40
40
|
import {
|
|
41
|
+
resolveImport,
|
|
42
|
+
supportedExtensions,
|
|
41
43
|
userOrAutoTitleFromSpecifier
|
|
42
|
-
} from "../_node-chunks/chunk-
|
|
43
|
-
import "../_node-chunks/chunk-
|
|
44
|
-
import "../_node-chunks/chunk-
|
|
45
|
-
import "../_node-chunks/chunk-
|
|
44
|
+
} from "../_node-chunks/chunk-ZHSCUGNP.js";
|
|
45
|
+
import "../_node-chunks/chunk-B23X5ZCK.js";
|
|
46
|
+
import "../_node-chunks/chunk-PRJHT3GJ.js";
|
|
47
|
+
import "../_node-chunks/chunk-52DXKXY3.js";
|
|
46
48
|
import {
|
|
47
49
|
optionalEnvToBoolean,
|
|
48
50
|
require_cross_spawn
|
|
49
|
-
} from "../_node-chunks/chunk-
|
|
51
|
+
} from "../_node-chunks/chunk-M47XA42S.js";
|
|
50
52
|
import {
|
|
51
53
|
up2 as up
|
|
52
|
-
} from "../_node-chunks/chunk-
|
|
53
|
-
import "../_node-chunks/chunk-
|
|
54
|
+
} from "../_node-chunks/chunk-EUH3NHXA.js";
|
|
55
|
+
import "../_node-chunks/chunk-G6EL47NS.js";
|
|
54
56
|
import {
|
|
55
57
|
invariant
|
|
56
|
-
} from "../_node-chunks/chunk-
|
|
58
|
+
} from "../_node-chunks/chunk-CC4PW5MJ.js";
|
|
57
59
|
import {
|
|
58
60
|
importModule,
|
|
59
61
|
resolvePackageDir
|
|
60
|
-
} from "../_node-chunks/chunk-
|
|
62
|
+
} from "../_node-chunks/chunk-V7VURIPB.js";
|
|
61
63
|
import {
|
|
64
|
+
join,
|
|
65
|
+
relative,
|
|
62
66
|
resolve
|
|
63
|
-
} from "../_node-chunks/chunk-
|
|
67
|
+
} from "../_node-chunks/chunk-B2DAHWJK.js";
|
|
64
68
|
import {
|
|
65
69
|
require_prompts
|
|
66
|
-
} from "../_node-chunks/chunk-
|
|
67
|
-
import "../_node-chunks/chunk-
|
|
70
|
+
} from "../_node-chunks/chunk-UJ5SJ23M.js";
|
|
71
|
+
import "../_node-chunks/chunk-3CBQMG2A.js";
|
|
68
72
|
import {
|
|
69
73
|
slash
|
|
70
|
-
} from "../_node-chunks/chunk-
|
|
74
|
+
} from "../_node-chunks/chunk-3WDAPZYQ.js";
|
|
71
75
|
import {
|
|
72
76
|
require_dist
|
|
73
|
-
} from "../_node-chunks/chunk-
|
|
77
|
+
} from "../_node-chunks/chunk-5OVB4A6F.js";
|
|
74
78
|
import {
|
|
75
79
|
require_lib,
|
|
76
80
|
require_src
|
|
77
|
-
} from "../_node-chunks/chunk-
|
|
81
|
+
} from "../_node-chunks/chunk-F3XOPI6H.js";
|
|
78
82
|
import {
|
|
79
83
|
require_picocolors
|
|
80
|
-
} from "../_node-chunks/chunk-
|
|
84
|
+
} from "../_node-chunks/chunk-X4XU27M6.js";
|
|
81
85
|
import {
|
|
82
86
|
__commonJS,
|
|
83
87
|
__name,
|
|
84
88
|
__require,
|
|
85
89
|
__toESM
|
|
86
|
-
} from "../_node-chunks/chunk-
|
|
90
|
+
} from "../_node-chunks/chunk-OOI74AL3.js";
|
|
87
91
|
|
|
88
92
|
// ../node_modules/tsconfig-paths/lib/filesystem.js
|
|
89
93
|
var require_filesystem = __commonJS({
|
|
@@ -92,12 +96,12 @@ var require_filesystem = __commonJS({
|
|
|
92
96
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
93
97
|
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
94
98
|
var fs6 = __require("fs");
|
|
95
|
-
function fileExistsSync(
|
|
96
|
-
if (!fs6.existsSync(
|
|
99
|
+
function fileExistsSync(path3) {
|
|
100
|
+
if (!fs6.existsSync(path3)) {
|
|
97
101
|
return false;
|
|
98
102
|
}
|
|
99
103
|
try {
|
|
100
|
-
var stats = fs6.statSync(
|
|
104
|
+
var stats = fs6.statSync(path3);
|
|
101
105
|
return stats.isFile();
|
|
102
106
|
} catch (err) {
|
|
103
107
|
return false;
|
|
@@ -113,8 +117,8 @@ var require_filesystem = __commonJS({
|
|
|
113
117
|
}
|
|
114
118
|
__name(readJsonFromDiskSync, "readJsonFromDiskSync");
|
|
115
119
|
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
116
|
-
function readJsonFromDiskAsync(
|
|
117
|
-
fs6.readFile(
|
|
120
|
+
function readJsonFromDiskAsync(path3, callback) {
|
|
121
|
+
fs6.readFile(path3, "utf8", function(err, result) {
|
|
118
122
|
if (err || !result) {
|
|
119
123
|
return callback();
|
|
120
124
|
}
|
|
@@ -124,8 +128,8 @@ var require_filesystem = __commonJS({
|
|
|
124
128
|
}
|
|
125
129
|
__name(readJsonFromDiskAsync, "readJsonFromDiskAsync");
|
|
126
130
|
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
127
|
-
function fileExistsAsync(
|
|
128
|
-
fs6.stat(
|
|
131
|
+
function fileExistsAsync(path22, callback2) {
|
|
132
|
+
fs6.stat(path22, function(err, stats) {
|
|
129
133
|
if (err) {
|
|
130
134
|
return callback2(void 0, false);
|
|
131
135
|
}
|
|
@@ -134,8 +138,8 @@ var require_filesystem = __commonJS({
|
|
|
134
138
|
}
|
|
135
139
|
__name(fileExistsAsync, "fileExistsAsync");
|
|
136
140
|
exports.fileExistsAsync = fileExistsAsync;
|
|
137
|
-
function removeExtension(
|
|
138
|
-
return
|
|
141
|
+
function removeExtension(path3) {
|
|
142
|
+
return path3.substring(0, path3.lastIndexOf(".")) || path3;
|
|
139
143
|
}
|
|
140
144
|
__name(removeExtension, "removeExtension");
|
|
141
145
|
exports.removeExtension = removeExtension;
|
|
@@ -148,7 +152,7 @@ var require_mapping_entry = __commonJS({
|
|
|
148
152
|
"use strict";
|
|
149
153
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
150
154
|
exports.getAbsoluteMappingEntries = void 0;
|
|
151
|
-
var
|
|
155
|
+
var path3 = __require("path");
|
|
152
156
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
153
157
|
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
154
158
|
var absolutePaths = [];
|
|
@@ -157,7 +161,7 @@ var require_mapping_entry = __commonJS({
|
|
|
157
161
|
absolutePaths.push({
|
|
158
162
|
pattern: key,
|
|
159
163
|
paths: paths[key].map(function(pathToResolve) {
|
|
160
|
-
return
|
|
164
|
+
return path3.resolve(absoluteBaseUrl, pathToResolve);
|
|
161
165
|
})
|
|
162
166
|
});
|
|
163
167
|
}
|
|
@@ -191,7 +195,7 @@ var require_try_path = __commonJS({
|
|
|
191
195
|
"use strict";
|
|
192
196
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
193
197
|
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
194
|
-
var
|
|
198
|
+
var path3 = __require("path");
|
|
195
199
|
var path_1 = __require("path");
|
|
196
200
|
var filesystem_1 = require_filesystem();
|
|
197
201
|
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
@@ -211,9 +215,9 @@ var require_try_path = __commonJS({
|
|
|
211
215
|
}));
|
|
212
216
|
pathsToTry.push({
|
|
213
217
|
type: "package",
|
|
214
|
-
path:
|
|
218
|
+
path: path3.join(physicalPath, "/package.json")
|
|
215
219
|
});
|
|
216
|
-
var indexPath =
|
|
220
|
+
var indexPath = path3.join(physicalPath, "/index");
|
|
217
221
|
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
218
222
|
return { type: "index", path: indexPath + e };
|
|
219
223
|
}));
|
|
@@ -269,7 +273,7 @@ var require_match_path_sync = __commonJS({
|
|
|
269
273
|
"use strict";
|
|
270
274
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
271
275
|
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
272
|
-
var
|
|
276
|
+
var path3 = __require("path");
|
|
273
277
|
var Filesystem = require_filesystem();
|
|
274
278
|
var MappingEntry = require_mapping_entry();
|
|
275
279
|
var TryPath = require_try_path();
|
|
@@ -315,7 +319,7 @@ var require_match_path_sync = __commonJS({
|
|
|
315
319
|
return obj[key];
|
|
316
320
|
}, packageJson);
|
|
317
321
|
if (candidateMapping && typeof candidateMapping === "string") {
|
|
318
|
-
var candidateFilePath =
|
|
322
|
+
var candidateFilePath = path3.join(path3.dirname(packageJsonPath), candidateMapping);
|
|
319
323
|
if (fileExists2(candidateFilePath)) {
|
|
320
324
|
return candidateFilePath;
|
|
321
325
|
}
|
|
@@ -361,7 +365,7 @@ var require_match_path_async = __commonJS({
|
|
|
361
365
|
"use strict";
|
|
362
366
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
363
367
|
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
364
|
-
var
|
|
368
|
+
var path3 = __require("path");
|
|
365
369
|
var TryPath = require_try_path();
|
|
366
370
|
var MappingEntry = require_mapping_entry();
|
|
367
371
|
var Filesystem = require_filesystem();
|
|
@@ -417,7 +421,7 @@ var require_match_path_async = __commonJS({
|
|
|
417
421
|
if (typeof mainFieldMapping !== "string") {
|
|
418
422
|
return tryNext();
|
|
419
423
|
}
|
|
420
|
-
var mappedFilePath =
|
|
424
|
+
var mappedFilePath = path3.join(path3.dirname(packageJsonPath), mainFieldMapping);
|
|
421
425
|
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
422
426
|
if (err) {
|
|
423
427
|
return doneCallback(err);
|
|
@@ -509,7 +513,7 @@ var require_tsconfig_loader = __commonJS({
|
|
|
509
513
|
};
|
|
510
514
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
511
515
|
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
512
|
-
var
|
|
516
|
+
var path3 = __require("path");
|
|
513
517
|
var fs6 = __require("fs");
|
|
514
518
|
var JSON5 = require_lib();
|
|
515
519
|
var StripBom = require_strip_bom();
|
|
@@ -541,14 +545,14 @@ var require_tsconfig_loader = __commonJS({
|
|
|
541
545
|
__name(loadSyncDefault, "loadSyncDefault");
|
|
542
546
|
function resolveConfigPath(cwd, filename) {
|
|
543
547
|
if (filename) {
|
|
544
|
-
var absolutePath = fs6.lstatSync(filename).isDirectory() ?
|
|
548
|
+
var absolutePath = fs6.lstatSync(filename).isDirectory() ? path3.resolve(filename, "./tsconfig.json") : path3.resolve(cwd, filename);
|
|
545
549
|
return absolutePath;
|
|
546
550
|
}
|
|
547
551
|
if (fs6.statSync(cwd).isFile()) {
|
|
548
|
-
return
|
|
552
|
+
return path3.resolve(cwd);
|
|
549
553
|
}
|
|
550
554
|
var configAbsolutePath = walkForTsConfig(cwd);
|
|
551
|
-
return configAbsolutePath ?
|
|
555
|
+
return configAbsolutePath ? path3.resolve(configAbsolutePath) : void 0;
|
|
552
556
|
}
|
|
553
557
|
__name(resolveConfigPath, "resolveConfigPath");
|
|
554
558
|
function walkForTsConfig(directory, readdirSync2) {
|
|
@@ -560,10 +564,10 @@ var require_tsconfig_loader = __commonJS({
|
|
|
560
564
|
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
561
565
|
var fileToCheck = filesToCheck_1[_i];
|
|
562
566
|
if (files.indexOf(fileToCheck) !== -1) {
|
|
563
|
-
return
|
|
567
|
+
return path3.join(directory, fileToCheck);
|
|
564
568
|
}
|
|
565
569
|
}
|
|
566
|
-
var parentDirectory =
|
|
570
|
+
var parentDirectory = path3.dirname(directory);
|
|
567
571
|
if (directory === parentDirectory) {
|
|
568
572
|
return void 0;
|
|
569
573
|
}
|
|
@@ -612,15 +616,15 @@ var require_tsconfig_loader = __commonJS({
|
|
|
612
616
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
613
617
|
extendedConfigValue += ".json";
|
|
614
618
|
}
|
|
615
|
-
var currentDir =
|
|
616
|
-
var extendedConfigPath =
|
|
619
|
+
var currentDir = path3.dirname(configFilePath);
|
|
620
|
+
var extendedConfigPath = path3.join(currentDir, extendedConfigValue);
|
|
617
621
|
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath)) {
|
|
618
|
-
extendedConfigPath =
|
|
622
|
+
extendedConfigPath = path3.join(currentDir, "node_modules", extendedConfigValue);
|
|
619
623
|
}
|
|
620
624
|
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync) || {};
|
|
621
625
|
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
622
|
-
var extendsDir =
|
|
623
|
-
config.compilerOptions.baseUrl =
|
|
626
|
+
var extendsDir = path3.dirname(extendedConfigValue);
|
|
627
|
+
config.compilerOptions.baseUrl = path3.join(extendsDir, config.compilerOptions.baseUrl);
|
|
624
628
|
}
|
|
625
629
|
return config;
|
|
626
630
|
}
|
|
@@ -641,7 +645,7 @@ var require_config_loader = __commonJS({
|
|
|
641
645
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
642
646
|
exports.configLoader = exports.loadConfig = void 0;
|
|
643
647
|
var TsConfigLoader2 = require_tsconfig_loader();
|
|
644
|
-
var
|
|
648
|
+
var path3 = __require("path");
|
|
645
649
|
function loadConfig3(cwd) {
|
|
646
650
|
if (cwd === void 0) {
|
|
647
651
|
cwd = process.cwd();
|
|
@@ -653,7 +657,7 @@ var require_config_loader = __commonJS({
|
|
|
653
657
|
function configLoader(_a) {
|
|
654
658
|
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
655
659
|
if (explicitParams) {
|
|
656
|
-
var absoluteBaseUrl =
|
|
660
|
+
var absoluteBaseUrl = path3.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path3.join(cwd, explicitParams.baseUrl);
|
|
657
661
|
return {
|
|
658
662
|
resultType: "success",
|
|
659
663
|
configFileAbsolutePath: "",
|
|
@@ -680,7 +684,7 @@ var require_config_loader = __commonJS({
|
|
|
680
684
|
resultType: "success",
|
|
681
685
|
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
682
686
|
baseUrl: loadResult.baseUrl,
|
|
683
|
-
absoluteBaseUrl:
|
|
687
|
+
absoluteBaseUrl: path3.resolve(path3.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
684
688
|
paths: loadResult.paths || {},
|
|
685
689
|
addMatchAll: loadResult.baseUrl !== void 0
|
|
686
690
|
};
|
|
@@ -1827,7 +1831,7 @@ var require_parse_chunked = __commonJS({
|
|
|
1827
1831
|
module.exports = function(chunkEmitter) {
|
|
1828
1832
|
let parser = new ChunkParser();
|
|
1829
1833
|
if (isObject(chunkEmitter) && isReadableStream(chunkEmitter)) {
|
|
1830
|
-
return new Promise((
|
|
1834
|
+
return new Promise((resolve4, reject) => {
|
|
1831
1835
|
chunkEmitter.on("data", (chunk) => {
|
|
1832
1836
|
try {
|
|
1833
1837
|
parser.push(chunk);
|
|
@@ -1840,7 +1844,7 @@ var require_parse_chunked = __commonJS({
|
|
|
1840
1844
|
reject(e);
|
|
1841
1845
|
}).on("end", () => {
|
|
1842
1846
|
try {
|
|
1843
|
-
|
|
1847
|
+
resolve4(parser.finish());
|
|
1844
1848
|
} catch (e) {
|
|
1845
1849
|
reject(adjustPosition(e, parser));
|
|
1846
1850
|
} finally {
|
|
@@ -1852,12 +1856,12 @@ var require_parse_chunked = __commonJS({
|
|
|
1852
1856
|
if (typeof chunkEmitter === "function") {
|
|
1853
1857
|
const iterator = chunkEmitter();
|
|
1854
1858
|
if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator)) {
|
|
1855
|
-
return new Promise(async (
|
|
1859
|
+
return new Promise(async (resolve4, reject) => {
|
|
1856
1860
|
try {
|
|
1857
1861
|
for await (const chunk of iterator) {
|
|
1858
1862
|
parser.push(chunk);
|
|
1859
1863
|
}
|
|
1860
|
-
|
|
1864
|
+
resolve4(parser.finish());
|
|
1861
1865
|
} catch (e) {
|
|
1862
1866
|
reject(adjustPosition(e, parser));
|
|
1863
1867
|
} finally {
|
|
@@ -2148,14 +2152,14 @@ var require_polyfills = __commonJS({
|
|
|
2148
2152
|
fs6.fstatSync = statFixSync(fs6.fstatSync);
|
|
2149
2153
|
fs6.lstatSync = statFixSync(fs6.lstatSync);
|
|
2150
2154
|
if (fs6.chmod && !fs6.lchmod) {
|
|
2151
|
-
fs6.lchmod = function(
|
|
2155
|
+
fs6.lchmod = function(path3, mode, cb) {
|
|
2152
2156
|
if (cb) process.nextTick(cb);
|
|
2153
2157
|
};
|
|
2154
2158
|
fs6.lchmodSync = function() {
|
|
2155
2159
|
};
|
|
2156
2160
|
}
|
|
2157
2161
|
if (fs6.chown && !fs6.lchown) {
|
|
2158
|
-
fs6.lchown = function(
|
|
2162
|
+
fs6.lchown = function(path3, uid, gid, cb) {
|
|
2159
2163
|
if (cb) process.nextTick(cb);
|
|
2160
2164
|
};
|
|
2161
2165
|
fs6.lchownSync = function() {
|
|
@@ -2224,9 +2228,9 @@ var require_polyfills = __commonJS({
|
|
|
2224
2228
|
};
|
|
2225
2229
|
}(fs6.readSync);
|
|
2226
2230
|
function patchLchmod(fs7) {
|
|
2227
|
-
fs7.lchmod = function(
|
|
2231
|
+
fs7.lchmod = function(path3, mode, callback) {
|
|
2228
2232
|
fs7.open(
|
|
2229
|
-
|
|
2233
|
+
path3,
|
|
2230
2234
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
2231
2235
|
mode,
|
|
2232
2236
|
function(err, fd) {
|
|
@@ -2242,8 +2246,8 @@ var require_polyfills = __commonJS({
|
|
|
2242
2246
|
}
|
|
2243
2247
|
);
|
|
2244
2248
|
};
|
|
2245
|
-
fs7.lchmodSync = function(
|
|
2246
|
-
var fd = fs7.openSync(
|
|
2249
|
+
fs7.lchmodSync = function(path3, mode) {
|
|
2250
|
+
var fd = fs7.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
2247
2251
|
var threw = true;
|
|
2248
2252
|
var ret;
|
|
2249
2253
|
try {
|
|
@@ -2265,8 +2269,8 @@ var require_polyfills = __commonJS({
|
|
|
2265
2269
|
__name(patchLchmod, "patchLchmod");
|
|
2266
2270
|
function patchLutimes(fs7) {
|
|
2267
2271
|
if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
|
|
2268
|
-
fs7.lutimes = function(
|
|
2269
|
-
fs7.open(
|
|
2272
|
+
fs7.lutimes = function(path3, at, mt, cb) {
|
|
2273
|
+
fs7.open(path3, constants.O_SYMLINK, function(er, fd) {
|
|
2270
2274
|
if (er) {
|
|
2271
2275
|
if (cb) cb(er);
|
|
2272
2276
|
return;
|
|
@@ -2278,8 +2282,8 @@ var require_polyfills = __commonJS({
|
|
|
2278
2282
|
});
|
|
2279
2283
|
});
|
|
2280
2284
|
};
|
|
2281
|
-
fs7.lutimesSync = function(
|
|
2282
|
-
var fd = fs7.openSync(
|
|
2285
|
+
fs7.lutimesSync = function(path3, at, mt) {
|
|
2286
|
+
var fd = fs7.openSync(path3, constants.O_SYMLINK);
|
|
2283
2287
|
var ret;
|
|
2284
2288
|
var threw = true;
|
|
2285
2289
|
try {
|
|
@@ -2407,11 +2411,11 @@ var require_legacy_streams = __commonJS({
|
|
|
2407
2411
|
ReadStream,
|
|
2408
2412
|
WriteStream
|
|
2409
2413
|
};
|
|
2410
|
-
function ReadStream(
|
|
2411
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
2414
|
+
function ReadStream(path3, options) {
|
|
2415
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path3, options);
|
|
2412
2416
|
Stream.call(this);
|
|
2413
2417
|
var self2 = this;
|
|
2414
|
-
this.path =
|
|
2418
|
+
this.path = path3;
|
|
2415
2419
|
this.fd = null;
|
|
2416
2420
|
this.readable = true;
|
|
2417
2421
|
this.paused = false;
|
|
@@ -2457,10 +2461,10 @@ var require_legacy_streams = __commonJS({
|
|
|
2457
2461
|
});
|
|
2458
2462
|
}
|
|
2459
2463
|
__name(ReadStream, "ReadStream");
|
|
2460
|
-
function WriteStream(
|
|
2461
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
2464
|
+
function WriteStream(path3, options) {
|
|
2465
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path3, options);
|
|
2462
2466
|
Stream.call(this);
|
|
2463
|
-
this.path =
|
|
2467
|
+
this.path = path3;
|
|
2464
2468
|
this.fd = null;
|
|
2465
2469
|
this.writable = true;
|
|
2466
2470
|
this.flags = "w";
|
|
@@ -2610,14 +2614,14 @@ var require_graceful_fs = __commonJS({
|
|
|
2610
2614
|
fs7.createWriteStream = createWriteStream2;
|
|
2611
2615
|
var fs$readFile = fs7.readFile;
|
|
2612
2616
|
fs7.readFile = readFile5;
|
|
2613
|
-
function readFile5(
|
|
2617
|
+
function readFile5(path3, options, cb) {
|
|
2614
2618
|
if (typeof options === "function")
|
|
2615
2619
|
cb = options, options = null;
|
|
2616
|
-
return go$readFile(
|
|
2617
|
-
function go$readFile(
|
|
2618
|
-
return fs$readFile(
|
|
2620
|
+
return go$readFile(path3, options, cb);
|
|
2621
|
+
function go$readFile(path4, options2, cb2, startTime) {
|
|
2622
|
+
return fs$readFile(path4, options2, function(err) {
|
|
2619
2623
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2620
|
-
enqueue([go$readFile, [
|
|
2624
|
+
enqueue([go$readFile, [path4, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2621
2625
|
else {
|
|
2622
2626
|
if (typeof cb2 === "function")
|
|
2623
2627
|
cb2.apply(this, arguments);
|
|
@@ -2628,15 +2632,15 @@ var require_graceful_fs = __commonJS({
|
|
|
2628
2632
|
}
|
|
2629
2633
|
__name(readFile5, "readFile");
|
|
2630
2634
|
var fs$writeFile = fs7.writeFile;
|
|
2631
|
-
fs7.writeFile =
|
|
2632
|
-
function
|
|
2635
|
+
fs7.writeFile = writeFile5;
|
|
2636
|
+
function writeFile5(path3, data, options, cb) {
|
|
2633
2637
|
if (typeof options === "function")
|
|
2634
2638
|
cb = options, options = null;
|
|
2635
|
-
return go$writeFile(
|
|
2636
|
-
function go$writeFile(
|
|
2637
|
-
return fs$writeFile(
|
|
2639
|
+
return go$writeFile(path3, data, options, cb);
|
|
2640
|
+
function go$writeFile(path4, data2, options2, cb2, startTime) {
|
|
2641
|
+
return fs$writeFile(path4, data2, options2, function(err) {
|
|
2638
2642
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2639
|
-
enqueue([go$writeFile, [
|
|
2643
|
+
enqueue([go$writeFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2640
2644
|
else {
|
|
2641
2645
|
if (typeof cb2 === "function")
|
|
2642
2646
|
cb2.apply(this, arguments);
|
|
@@ -2645,18 +2649,18 @@ var require_graceful_fs = __commonJS({
|
|
|
2645
2649
|
}
|
|
2646
2650
|
__name(go$writeFile, "go$writeFile");
|
|
2647
2651
|
}
|
|
2648
|
-
__name(
|
|
2652
|
+
__name(writeFile5, "writeFile");
|
|
2649
2653
|
var fs$appendFile = fs7.appendFile;
|
|
2650
2654
|
if (fs$appendFile)
|
|
2651
2655
|
fs7.appendFile = appendFile;
|
|
2652
|
-
function appendFile(
|
|
2656
|
+
function appendFile(path3, data, options, cb) {
|
|
2653
2657
|
if (typeof options === "function")
|
|
2654
2658
|
cb = options, options = null;
|
|
2655
|
-
return go$appendFile(
|
|
2656
|
-
function go$appendFile(
|
|
2657
|
-
return fs$appendFile(
|
|
2659
|
+
return go$appendFile(path3, data, options, cb);
|
|
2660
|
+
function go$appendFile(path4, data2, options2, cb2, startTime) {
|
|
2661
|
+
return fs$appendFile(path4, data2, options2, function(err) {
|
|
2658
2662
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2659
|
-
enqueue([go$appendFile, [
|
|
2663
|
+
enqueue([go$appendFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2660
2664
|
else {
|
|
2661
2665
|
if (typeof cb2 === "function")
|
|
2662
2666
|
cb2.apply(this, arguments);
|
|
@@ -2691,31 +2695,31 @@ var require_graceful_fs = __commonJS({
|
|
|
2691
2695
|
var fs$readdir = fs7.readdir;
|
|
2692
2696
|
fs7.readdir = readdir;
|
|
2693
2697
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
2694
|
-
function readdir(
|
|
2698
|
+
function readdir(path3, options, cb) {
|
|
2695
2699
|
if (typeof options === "function")
|
|
2696
2700
|
cb = options, options = null;
|
|
2697
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(
|
|
2698
|
-
return fs$readdir(
|
|
2699
|
-
|
|
2701
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(path4, options2, cb2, startTime) {
|
|
2702
|
+
return fs$readdir(path4, fs$readdirCallback(
|
|
2703
|
+
path4,
|
|
2700
2704
|
options2,
|
|
2701
2705
|
cb2,
|
|
2702
2706
|
startTime
|
|
2703
2707
|
));
|
|
2704
|
-
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(
|
|
2705
|
-
return fs$readdir(
|
|
2706
|
-
|
|
2708
|
+
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(path4, options2, cb2, startTime) {
|
|
2709
|
+
return fs$readdir(path4, options2, fs$readdirCallback(
|
|
2710
|
+
path4,
|
|
2707
2711
|
options2,
|
|
2708
2712
|
cb2,
|
|
2709
2713
|
startTime
|
|
2710
2714
|
));
|
|
2711
2715
|
}, "go$readdir");
|
|
2712
|
-
return go$readdir(
|
|
2713
|
-
function fs$readdirCallback(
|
|
2716
|
+
return go$readdir(path3, options, cb);
|
|
2717
|
+
function fs$readdirCallback(path4, options2, cb2, startTime) {
|
|
2714
2718
|
return function(err, files) {
|
|
2715
2719
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2716
2720
|
enqueue([
|
|
2717
2721
|
go$readdir,
|
|
2718
|
-
[
|
|
2722
|
+
[path4, options2, cb2],
|
|
2719
2723
|
err,
|
|
2720
2724
|
startTime || Date.now(),
|
|
2721
2725
|
Date.now()
|
|
@@ -2788,7 +2792,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2788
2792
|
enumerable: true,
|
|
2789
2793
|
configurable: true
|
|
2790
2794
|
});
|
|
2791
|
-
function ReadStream(
|
|
2795
|
+
function ReadStream(path3, options) {
|
|
2792
2796
|
if (this instanceof ReadStream)
|
|
2793
2797
|
return fs$ReadStream.apply(this, arguments), this;
|
|
2794
2798
|
else
|
|
@@ -2810,7 +2814,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2810
2814
|
});
|
|
2811
2815
|
}
|
|
2812
2816
|
__name(ReadStream$open, "ReadStream$open");
|
|
2813
|
-
function WriteStream(
|
|
2817
|
+
function WriteStream(path3, options) {
|
|
2814
2818
|
if (this instanceof WriteStream)
|
|
2815
2819
|
return fs$WriteStream.apply(this, arguments), this;
|
|
2816
2820
|
else
|
|
@@ -2830,24 +2834,24 @@ var require_graceful_fs = __commonJS({
|
|
|
2830
2834
|
});
|
|
2831
2835
|
}
|
|
2832
2836
|
__name(WriteStream$open, "WriteStream$open");
|
|
2833
|
-
function createReadStream(
|
|
2834
|
-
return new fs7.ReadStream(
|
|
2837
|
+
function createReadStream(path3, options) {
|
|
2838
|
+
return new fs7.ReadStream(path3, options);
|
|
2835
2839
|
}
|
|
2836
2840
|
__name(createReadStream, "createReadStream");
|
|
2837
|
-
function createWriteStream2(
|
|
2838
|
-
return new fs7.WriteStream(
|
|
2841
|
+
function createWriteStream2(path3, options) {
|
|
2842
|
+
return new fs7.WriteStream(path3, options);
|
|
2839
2843
|
}
|
|
2840
2844
|
__name(createWriteStream2, "createWriteStream");
|
|
2841
2845
|
var fs$open = fs7.open;
|
|
2842
2846
|
fs7.open = open2;
|
|
2843
|
-
function open2(
|
|
2847
|
+
function open2(path3, flags, mode, cb) {
|
|
2844
2848
|
if (typeof mode === "function")
|
|
2845
2849
|
cb = mode, mode = null;
|
|
2846
|
-
return go$open(
|
|
2847
|
-
function go$open(
|
|
2848
|
-
return fs$open(
|
|
2850
|
+
return go$open(path3, flags, mode, cb);
|
|
2851
|
+
function go$open(path4, flags2, mode2, cb2, startTime) {
|
|
2852
|
+
return fs$open(path4, flags2, mode2, function(err, fd) {
|
|
2849
2853
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2850
|
-
enqueue([go$open, [
|
|
2854
|
+
enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2851
2855
|
else {
|
|
2852
2856
|
if (typeof cb2 === "function")
|
|
2853
2857
|
cb2.apply(this, arguments);
|
|
@@ -2920,7 +2924,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2920
2924
|
var require_reducePlan = __commonJS({
|
|
2921
2925
|
"../node_modules/watchpack/lib/reducePlan.js"(exports, module) {
|
|
2922
2926
|
"use strict";
|
|
2923
|
-
var
|
|
2927
|
+
var path3 = __require("path");
|
|
2924
2928
|
module.exports = (plan, limit) => {
|
|
2925
2929
|
const treeMap = /* @__PURE__ */ new Map();
|
|
2926
2930
|
for (const [filePath, value] of plan) {
|
|
@@ -2935,7 +2939,7 @@ var require_reducePlan = __commonJS({
|
|
|
2935
2939
|
}
|
|
2936
2940
|
let currentCount = treeMap.size;
|
|
2937
2941
|
for (const node of treeMap.values()) {
|
|
2938
|
-
const parentPath =
|
|
2942
|
+
const parentPath = path3.dirname(node.filePath);
|
|
2939
2943
|
if (parentPath !== node.filePath) {
|
|
2940
2944
|
let parent = treeMap.get(parentPath);
|
|
2941
2945
|
if (parent === void 0) {
|
|
@@ -3030,7 +3034,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3030
3034
|
"../node_modules/watchpack/lib/watchEventSource.js"(exports) {
|
|
3031
3035
|
"use strict";
|
|
3032
3036
|
var fs6 = __require("fs");
|
|
3033
|
-
var
|
|
3037
|
+
var path3 = __require("path");
|
|
3034
3038
|
var { EventEmitter } = __require("events");
|
|
3035
3039
|
var reducePlan = require_reducePlan();
|
|
3036
3040
|
var IS_OSX = __require("os").platform() === "darwin";
|
|
@@ -3052,7 +3056,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3052
3056
|
__name(createEPERMError, "createEPERMError");
|
|
3053
3057
|
function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {
|
|
3054
3058
|
return (type, filename) => {
|
|
3055
|
-
if (type === "rename" &&
|
|
3059
|
+
if (type === "rename" && path3.isAbsolute(filename) && path3.basename(filename) === path3.basename(filePath)) {
|
|
3056
3060
|
if (!IS_OSX) {
|
|
3057
3061
|
watcher.emit("error", createEPERMError(filename));
|
|
3058
3062
|
}
|
|
@@ -3139,7 +3143,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3139
3143
|
w.emit("change", type);
|
|
3140
3144
|
}
|
|
3141
3145
|
} else {
|
|
3142
|
-
const dir =
|
|
3146
|
+
const dir = path3.dirname(filename);
|
|
3143
3147
|
const watchers = this.mapPathToWatchers.get(dir);
|
|
3144
3148
|
if (recursiveWatcherLogging) {
|
|
3145
3149
|
process.stderr.write(
|
|
@@ -3149,7 +3153,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3149
3153
|
}
|
|
3150
3154
|
if (watchers === void 0) return;
|
|
3151
3155
|
for (const w of watchers) {
|
|
3152
|
-
w.emit("change", type,
|
|
3156
|
+
w.emit("change", type, path3.basename(filename));
|
|
3153
3157
|
}
|
|
3154
3158
|
}
|
|
3155
3159
|
});
|
|
@@ -3268,7 +3272,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3268
3272
|
}
|
|
3269
3273
|
for (const watcher of recursiveWatchers.values()) {
|
|
3270
3274
|
for (const [w, subpath] of watcher.getWatchers()) {
|
|
3271
|
-
addWatcher(w,
|
|
3275
|
+
addWatcher(w, path3.join(watcher.rootPath, subpath));
|
|
3272
3276
|
}
|
|
3273
3277
|
}
|
|
3274
3278
|
for (const watcher of directWatchers.values()) {
|
|
@@ -3324,7 +3328,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3324
3328
|
recursiveWatcher.add(filePath, watcher);
|
|
3325
3329
|
return watcher;
|
|
3326
3330
|
}
|
|
3327
|
-
const parent =
|
|
3331
|
+
const parent = path3.dirname(current);
|
|
3328
3332
|
if (parent === current) break;
|
|
3329
3333
|
current = parent;
|
|
3330
3334
|
}
|
|
@@ -3355,7 +3359,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3355
3359
|
"use strict";
|
|
3356
3360
|
var EventEmitter = __require("events").EventEmitter;
|
|
3357
3361
|
var fs6 = require_graceful_fs();
|
|
3358
|
-
var
|
|
3362
|
+
var path3 = __require("path");
|
|
3359
3363
|
var watchEventSource = require_watchEventSource();
|
|
3360
3364
|
var EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
|
|
3361
3365
|
var FS_ACCURACY = 2e3;
|
|
@@ -3451,8 +3455,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3451
3455
|
this.onWatcherError(err);
|
|
3452
3456
|
}
|
|
3453
3457
|
}
|
|
3454
|
-
forEachWatcher(
|
|
3455
|
-
const watchers = this.watchers.get(withoutCase(
|
|
3458
|
+
forEachWatcher(path4, fn) {
|
|
3459
|
+
const watchers = this.watchers.get(withoutCase(path4));
|
|
3456
3460
|
if (watchers !== void 0) {
|
|
3457
3461
|
for (const w of watchers) {
|
|
3458
3462
|
fn(w);
|
|
@@ -3680,7 +3684,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3680
3684
|
this.doScan(false);
|
|
3681
3685
|
return;
|
|
3682
3686
|
}
|
|
3683
|
-
const filePath =
|
|
3687
|
+
const filePath = path3.join(this.path, filename);
|
|
3684
3688
|
if (this.ignored(filePath)) return;
|
|
3685
3689
|
if (this._activeEvents.get(filename) === void 0) {
|
|
3686
3690
|
this._activeEvents.set(filename, false);
|
|
@@ -3698,7 +3702,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3698
3702
|
if (err.code !== "ENOENT" && err.code !== "EPERM" && err.code !== "EBUSY") {
|
|
3699
3703
|
this.onStatsError(err);
|
|
3700
3704
|
} else {
|
|
3701
|
-
if (filename ===
|
|
3705
|
+
if (filename === path3.basename(this.path)) {
|
|
3702
3706
|
if (!fs6.existsSync(this.path)) {
|
|
3703
3707
|
this.onDirectoryRemoved("stat failed");
|
|
3704
3708
|
}
|
|
@@ -3778,8 +3782,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3778
3782
|
}
|
|
3779
3783
|
watchInParentDirectory() {
|
|
3780
3784
|
if (!this.parentWatcher) {
|
|
3781
|
-
const parentDir =
|
|
3782
|
-
if (
|
|
3785
|
+
const parentDir = path3.dirname(this.path);
|
|
3786
|
+
if (path3.dirname(parentDir) === parentDir) return;
|
|
3783
3787
|
this.parentWatcher = this.watcherManager.watchFile(this.path, 1);
|
|
3784
3788
|
this.parentWatcher.on("change", (mtime, type) => {
|
|
3785
3789
|
if (this.closed) return;
|
|
@@ -3849,7 +3853,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3849
3853
|
return;
|
|
3850
3854
|
}
|
|
3851
3855
|
const itemPaths = new Set(
|
|
3852
|
-
items.map((item) =>
|
|
3856
|
+
items.map((item) => path3.join(this.path, item.normalize("NFC")))
|
|
3853
3857
|
);
|
|
3854
3858
|
for (const file of this.files.keys()) {
|
|
3855
3859
|
if (!itemPaths.has(file)) {
|
|
@@ -3958,9 +3962,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3958
3962
|
if (!this.initialScan) {
|
|
3959
3963
|
for (const watchers of this.watchers.values()) {
|
|
3960
3964
|
for (const watcher of watchers) {
|
|
3961
|
-
const
|
|
3962
|
-
if (!Object.prototype.hasOwnProperty.call(obj,
|
|
3963
|
-
obj[
|
|
3965
|
+
const path4 = watcher.path;
|
|
3966
|
+
if (!Object.prototype.hasOwnProperty.call(obj, path4)) {
|
|
3967
|
+
obj[path4] = null;
|
|
3964
3968
|
}
|
|
3965
3969
|
}
|
|
3966
3970
|
}
|
|
@@ -4000,9 +4004,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
4000
4004
|
if (!this.initialScan) {
|
|
4001
4005
|
for (const watchers of this.watchers.values()) {
|
|
4002
4006
|
for (const watcher of watchers) {
|
|
4003
|
-
const
|
|
4004
|
-
if (!fileTimestamps.has(
|
|
4005
|
-
fileTimestamps.set(
|
|
4007
|
+
const path4 = watcher.path;
|
|
4008
|
+
if (!fileTimestamps.has(path4)) {
|
|
4009
|
+
fileTimestamps.set(path4, null);
|
|
4006
4010
|
}
|
|
4007
4011
|
}
|
|
4008
4012
|
}
|
|
@@ -4053,7 +4057,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
4053
4057
|
var require_getWatcherManager = __commonJS({
|
|
4054
4058
|
"../node_modules/watchpack/lib/getWatcherManager.js"(exports, module) {
|
|
4055
4059
|
"use strict";
|
|
4056
|
-
var
|
|
4060
|
+
var path3 = __require("path");
|
|
4057
4061
|
var DirectoryWatcher = require_DirectoryWatcher();
|
|
4058
4062
|
var WatcherManager = class {
|
|
4059
4063
|
static {
|
|
@@ -4076,7 +4080,7 @@ var require_getWatcherManager = __commonJS({
|
|
|
4076
4080
|
return watcher;
|
|
4077
4081
|
}
|
|
4078
4082
|
watchFile(p, startTime) {
|
|
4079
|
-
const directory =
|
|
4083
|
+
const directory = path3.dirname(p);
|
|
4080
4084
|
if (directory === p) return null;
|
|
4081
4085
|
return this.getDirectoryWatcher(directory).watch(p, startTime);
|
|
4082
4086
|
}
|
|
@@ -4101,7 +4105,7 @@ var require_LinkResolver = __commonJS({
|
|
|
4101
4105
|
"../node_modules/watchpack/lib/LinkResolver.js"(exports, module) {
|
|
4102
4106
|
"use strict";
|
|
4103
4107
|
var fs6 = __require("fs");
|
|
4104
|
-
var
|
|
4108
|
+
var path3 = __require("path");
|
|
4105
4109
|
var EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);
|
|
4106
4110
|
if (process.platform === "win32") EXPECTED_ERRORS.add("UNKNOWN");
|
|
4107
4111
|
var LinkResolver = class {
|
|
@@ -4120,7 +4124,7 @@ var require_LinkResolver = __commonJS({
|
|
|
4120
4124
|
if (cacheEntry !== void 0) {
|
|
4121
4125
|
return cacheEntry;
|
|
4122
4126
|
}
|
|
4123
|
-
const parent =
|
|
4127
|
+
const parent = path3.dirname(file);
|
|
4124
4128
|
if (parent === file) {
|
|
4125
4129
|
const result = Object.freeze([file]);
|
|
4126
4130
|
this.cache.set(file, result);
|
|
@@ -4129,12 +4133,12 @@ var require_LinkResolver = __commonJS({
|
|
|
4129
4133
|
const parentResolved = this.resolve(parent);
|
|
4130
4134
|
let realFile = file;
|
|
4131
4135
|
if (parentResolved[0] !== parent) {
|
|
4132
|
-
const basename4 =
|
|
4133
|
-
realFile =
|
|
4136
|
+
const basename4 = path3.basename(file);
|
|
4137
|
+
realFile = path3.resolve(parentResolved[0], basename4);
|
|
4134
4138
|
}
|
|
4135
4139
|
try {
|
|
4136
4140
|
const linkContent = fs6.readlinkSync(realFile);
|
|
4137
|
-
const resolvedLink =
|
|
4141
|
+
const resolvedLink = path3.resolve(parentResolved[0], linkContent);
|
|
4138
4142
|
const linkResolved = this.resolve(resolvedLink);
|
|
4139
4143
|
let result;
|
|
4140
4144
|
if (linkResolved.length > 1 && parentResolved.length > 1) {
|
|
@@ -4454,7 +4458,7 @@ var require_watchpack = __commonJS({
|
|
|
4454
4458
|
const fileWatchers = this.fileWatchers;
|
|
4455
4459
|
const directoryWatchers = this.directoryWatchers;
|
|
4456
4460
|
const ignored = this.watcherOptions.ignored;
|
|
4457
|
-
const filter = /* @__PURE__ */ __name((
|
|
4461
|
+
const filter = /* @__PURE__ */ __name((path3) => !ignored(path3), "filter");
|
|
4458
4462
|
const addToMap = /* @__PURE__ */ __name((map, key, item) => {
|
|
4459
4463
|
const list = map.get(key);
|
|
4460
4464
|
if (list === void 0) {
|
|
@@ -6045,18 +6049,18 @@ var require_dist2 = __commonJS({
|
|
|
6045
6049
|
}
|
|
6046
6050
|
__name(toKey, "toKey");
|
|
6047
6051
|
var toKey_default = toKey;
|
|
6048
|
-
function baseGet(object,
|
|
6049
|
-
|
|
6050
|
-
var index = 0, length =
|
|
6052
|
+
function baseGet(object, path3) {
|
|
6053
|
+
path3 = castPath_default(path3, object);
|
|
6054
|
+
var index = 0, length = path3.length;
|
|
6051
6055
|
while (object != null && index < length) {
|
|
6052
|
-
object = object[toKey_default(
|
|
6056
|
+
object = object[toKey_default(path3[index++])];
|
|
6053
6057
|
}
|
|
6054
6058
|
return index && index == length ? object : void 0;
|
|
6055
6059
|
}
|
|
6056
6060
|
__name(baseGet, "baseGet");
|
|
6057
6061
|
var baseGet_default = baseGet;
|
|
6058
|
-
function get(object,
|
|
6059
|
-
var result = object == null ? void 0 : baseGet_default(object,
|
|
6062
|
+
function get(object, path3, defaultValue) {
|
|
6063
|
+
var result = object == null ? void 0 : baseGet_default(object, path3);
|
|
6060
6064
|
return result === void 0 ? defaultValue : result;
|
|
6061
6065
|
}
|
|
6062
6066
|
__name(get, "get");
|
|
@@ -6585,9 +6589,9 @@ var require_detect_port = __commonJS({
|
|
|
6585
6589
|
if (typeof callback === "function") {
|
|
6586
6590
|
return tryListen(port, maxPort, hostname, callback);
|
|
6587
6591
|
}
|
|
6588
|
-
return new Promise((
|
|
6592
|
+
return new Promise((resolve4) => {
|
|
6589
6593
|
tryListen(port, maxPort, hostname, (_, realPort) => {
|
|
6590
|
-
|
|
6594
|
+
resolve4(realPort);
|
|
6591
6595
|
});
|
|
6592
6596
|
});
|
|
6593
6597
|
};
|
|
@@ -6668,7 +6672,7 @@ var require_wait_port = __commonJS({
|
|
|
6668
6672
|
"use strict";
|
|
6669
6673
|
var debug = require_src()("wait-port");
|
|
6670
6674
|
var detect = require_detect_port();
|
|
6671
|
-
var sleep = /* @__PURE__ */ __name((ms) => new Promise((
|
|
6675
|
+
var sleep = /* @__PURE__ */ __name((ms) => new Promise((resolve4) => setTimeout(resolve4, ms)), "sleep");
|
|
6672
6676
|
async function waitPort(port, options = {}) {
|
|
6673
6677
|
const { retryInterval = 1e3, retries = Infinity } = options;
|
|
6674
6678
|
let count = 1;
|
|
@@ -8471,10 +8475,8 @@ var require_cli_table3 = __commonJS({
|
|
|
8471
8475
|
import { getPreviewHeadTemplate, getPreviewBodyTemplate } from "storybook/internal/common";
|
|
8472
8476
|
|
|
8473
8477
|
// src/core-server/build-static.ts
|
|
8474
|
-
|
|
8475
|
-
import { cp as cp2, mkdir } from "node:fs/promises";
|
|
8478
|
+
import { cp as cp2, mkdir, writeFile as writeFile3 } from "node:fs/promises";
|
|
8476
8479
|
import { rm } from "node:fs/promises";
|
|
8477
|
-
import { join as join5, relative as relative4, resolve as resolve4 } from "node:path";
|
|
8478
8480
|
import {
|
|
8479
8481
|
loadAllPresets,
|
|
8480
8482
|
loadMainConfig,
|
|
@@ -8485,11 +8487,817 @@ import {
|
|
|
8485
8487
|
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
8486
8488
|
import { getPrecedingUpgrade, telemetry as telemetry2 } from "storybook/internal/telemetry";
|
|
8487
8489
|
import { global as global2 } from "@storybook/global";
|
|
8490
|
+
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
8491
|
+
|
|
8492
|
+
// src/core-server/manifest.ts
|
|
8493
|
+
import path from "node:path";
|
|
8494
|
+
import { groupBy } from "storybook/internal/common";
|
|
8495
|
+
function renderManifestComponentsPage(manifest) {
|
|
8496
|
+
const entries = Object.entries(manifest?.components ?? {}).sort(
|
|
8497
|
+
(a, b) => (a[1].name || a[0]).localeCompare(b[1].name || b[0])
|
|
8498
|
+
);
|
|
8499
|
+
const analyses = entries.map(([, c]) => analyzeComponent(c));
|
|
8500
|
+
const totals = {
|
|
8501
|
+
components: entries.length,
|
|
8502
|
+
componentsWithPropTypeError: analyses.filter((a) => a.hasPropTypeError).length,
|
|
8503
|
+
infos: analyses.filter((a) => a.hasWarns).length,
|
|
8504
|
+
stories: analyses.reduce((sum, a) => sum + a.totalStories, 0),
|
|
8505
|
+
storyErrors: analyses.reduce((sum, a) => sum + a.storyErrors, 0)
|
|
8506
|
+
};
|
|
8507
|
+
const allPill = `<a class="filter-pill all" data-k="all" href="#filter-all">All</a>`;
|
|
8508
|
+
const compErrorsPill = totals.componentsWithPropTypeError > 0 ? `<a class="filter-pill err" data-k="errors" href="#filter-errors">${totals.componentsWithPropTypeError}/${totals.components} prop type ${plural(totals.componentsWithPropTypeError, "error")}</a>` : `<span class="filter-pill ok" aria-disabled="true">${totals.components} components ok</span>`;
|
|
8509
|
+
const compInfosPill = totals.infos > 0 ? `<a class="filter-pill info" data-k="infos" href="#filter-infos">${totals.infos}/${totals.components} ${plural(totals.infos, "info", "infos")}</a>` : "";
|
|
8510
|
+
const storiesPill = totals.storyErrors > 0 ? `<a class="filter-pill err" data-k="story-errors" href="#filter-story-errors">${totals.storyErrors}/${totals.stories} story errors</a>` : `<span class="filter-pill ok" aria-disabled="true">${totals.stories} ${plural(totals.stories, "story", "stories")} ok</span>`;
|
|
8511
|
+
const grid = entries.map(([key, c], idx) => renderComponentCard(key, c, `${idx}`)).join("");
|
|
8512
|
+
const errorGroups = Object.entries(
|
|
8513
|
+
groupBy(
|
|
8514
|
+
entries.map(([, it]) => it).filter((it) => it.error),
|
|
8515
|
+
(manifest2) => manifest2.error?.name ?? "Error"
|
|
8516
|
+
)
|
|
8517
|
+
).sort(([, a], [, b]) => b.length - a.length);
|
|
8518
|
+
const errorGroupsHTML = errorGroups.map(([error, grouped]) => {
|
|
8519
|
+
const id = error.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
8520
|
+
const headerText = `${esc(error)}`;
|
|
8521
|
+
const cards = grouped.map((manifest2, id2) => renderComponentCard(manifest2.id, manifest2, `error-${id2}`)).join("");
|
|
8522
|
+
return `
|
|
8523
|
+
<section class="group">
|
|
8524
|
+
<input id="${id}-toggle" class="group-tg" type="checkbox" hidden />
|
|
8525
|
+
<label for="${id}-toggle" class="group-header">
|
|
8526
|
+
<span class="caret">\u25B8</span>
|
|
8527
|
+
<span class="group-title">${headerText}</span>
|
|
8528
|
+
<span class="group-count">${grouped.length}</span>
|
|
8529
|
+
</label>
|
|
8530
|
+
<div class="group-cards">${cards}</div>
|
|
8531
|
+
</section>
|
|
8532
|
+
`;
|
|
8533
|
+
}).join("");
|
|
8534
|
+
return `<!doctype html>
|
|
8535
|
+
<html lang="en">
|
|
8536
|
+
<head>
|
|
8537
|
+
<meta charset="utf-8" />
|
|
8538
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8539
|
+
<title>Components Manifest</title>
|
|
8540
|
+
<style>
|
|
8541
|
+
:root {
|
|
8542
|
+
--bg: #0b0c10;
|
|
8543
|
+
--panel: #121318;
|
|
8544
|
+
--muted: #9aa0a6;
|
|
8545
|
+
--fg: #e8eaed;
|
|
8546
|
+
--ok: #22c55e;
|
|
8547
|
+
--info: #1e88e5;
|
|
8548
|
+
--err: #c62828;
|
|
8549
|
+
--ok-bg: #0c1a13;
|
|
8550
|
+
--info-bg: #0c1624;
|
|
8551
|
+
--err-bg: #1a0e0e;
|
|
8552
|
+
--chip: #1f2330;
|
|
8553
|
+
--border: #2b2f3a;
|
|
8554
|
+
--link: #8ab4f8;
|
|
8555
|
+
--active-ring: 1px; /* 1px active ring for pills and toggles */
|
|
8556
|
+
}
|
|
8557
|
+
|
|
8558
|
+
* {
|
|
8559
|
+
box-sizing: border-box;
|
|
8560
|
+
}
|
|
8561
|
+
|
|
8562
|
+
html,
|
|
8563
|
+
body {
|
|
8564
|
+
margin: 0;
|
|
8565
|
+
background: var(--bg);
|
|
8566
|
+
color: var(--fg);
|
|
8567
|
+
font: 14px/1.5 system-ui,
|
|
8568
|
+
-apple-system,
|
|
8569
|
+
Segoe UI,
|
|
8570
|
+
Roboto,
|
|
8571
|
+
Ubuntu,
|
|
8572
|
+
Cantarell,
|
|
8573
|
+
'Helvetica Neue',
|
|
8574
|
+
Arial,
|
|
8575
|
+
'Noto Sans';
|
|
8576
|
+
}
|
|
8577
|
+
|
|
8578
|
+
.wrap {
|
|
8579
|
+
max-width: 1100px;
|
|
8580
|
+
margin: 0 auto;
|
|
8581
|
+
padding: 16px 20px;
|
|
8582
|
+
}
|
|
8583
|
+
|
|
8584
|
+
header {
|
|
8585
|
+
position: sticky;
|
|
8586
|
+
top: 0;
|
|
8587
|
+
backdrop-filter: blur(6px);
|
|
8588
|
+
background: color-mix(in srgb, var(--bg) 84%, transparent);
|
|
8589
|
+
border-bottom: 1px solid var(--border);
|
|
8590
|
+
z-index: 10;
|
|
8591
|
+
}
|
|
8592
|
+
|
|
8593
|
+
h1 {
|
|
8594
|
+
font-size: 20px;
|
|
8595
|
+
margin: 0 0 6px;
|
|
8596
|
+
}
|
|
8597
|
+
|
|
8598
|
+
.summary {
|
|
8599
|
+
display: flex;
|
|
8600
|
+
gap: 12px;
|
|
8601
|
+
flex-wrap: wrap;
|
|
8602
|
+
align-items: center;
|
|
8603
|
+
}
|
|
8604
|
+
|
|
8605
|
+
/* Top filter pills */
|
|
8606
|
+
.filter-pill {
|
|
8607
|
+
display: inline-flex;
|
|
8608
|
+
align-items: center;
|
|
8609
|
+
gap: 6px;
|
|
8610
|
+
padding: 6px 12px;
|
|
8611
|
+
border: 1px solid var(--border);
|
|
8612
|
+
border-radius: 999px;
|
|
8613
|
+
background: var(--panel);
|
|
8614
|
+
text-decoration: none;
|
|
8615
|
+
cursor: pointer;
|
|
8616
|
+
user-select: none;
|
|
8617
|
+
color: var(--fg);
|
|
8618
|
+
}
|
|
8619
|
+
|
|
8620
|
+
.filter-pill.ok {
|
|
8621
|
+
color: #b9f6ca;
|
|
8622
|
+
border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
|
|
8623
|
+
background: color-mix(in srgb, var(--ok) 18%, #000);
|
|
8624
|
+
}
|
|
8625
|
+
|
|
8626
|
+
.filter-pill.info {
|
|
8627
|
+
color: #b3d9ff;
|
|
8628
|
+
border-color: color-mix(in srgb, var(--info) 55%, var(--border));
|
|
8629
|
+
background: var(--info-bg);
|
|
8630
|
+
}
|
|
8631
|
+
|
|
8632
|
+
.filter-pill.err {
|
|
8633
|
+
color: #ff9aa0;
|
|
8634
|
+
border-color: color-mix(in srgb, var(--err) 55%, var(--border));
|
|
8635
|
+
background: var(--err-bg);
|
|
8636
|
+
}
|
|
8637
|
+
|
|
8638
|
+
.filter-pill.all {
|
|
8639
|
+
color: #d7dbe0;
|
|
8640
|
+
border-color: var(--border);
|
|
8641
|
+
background: var(--panel);
|
|
8642
|
+
}
|
|
8643
|
+
|
|
8644
|
+
.filter-pill[aria-disabled='true'] {
|
|
8645
|
+
cursor: default;
|
|
8646
|
+
text-decoration: none;
|
|
8647
|
+
}
|
|
8648
|
+
|
|
8649
|
+
.filter-pill:focus,
|
|
8650
|
+
.filter-pill:active {
|
|
8651
|
+
outline: none;
|
|
8652
|
+
box-shadow: none;
|
|
8653
|
+
}
|
|
8654
|
+
|
|
8655
|
+
/* Selected top pill ring via :target */
|
|
8656
|
+
#filter-all:target ~ header .filter-pill[data-k='all'],
|
|
8657
|
+
#filter-errors:target ~ header .filter-pill[data-k='errors'],
|
|
8658
|
+
#filter-infos:target ~ header .filter-pill[data-k='infos'],
|
|
8659
|
+
#filter-story-errors:target ~ header .filter-pill[data-k='story-errors'] {
|
|
8660
|
+
box-shadow: 0 0 0 var(--active-ring) currentColor;
|
|
8661
|
+
border-color: currentColor;
|
|
8662
|
+
}
|
|
8663
|
+
|
|
8664
|
+
/* Hidden targets for filtering */
|
|
8665
|
+
#filter-all,
|
|
8666
|
+
#filter-errors,
|
|
8667
|
+
#filter-infos,
|
|
8668
|
+
#filter-story-errors {
|
|
8669
|
+
display: none;
|
|
8670
|
+
}
|
|
8671
|
+
|
|
8672
|
+
main {
|
|
8673
|
+
padding: 36px 0 40px;
|
|
8674
|
+
}
|
|
8675
|
+
|
|
8676
|
+
.grid {
|
|
8677
|
+
display: grid;
|
|
8678
|
+
grid-template-columns: 1fr;
|
|
8679
|
+
gap: 18px;
|
|
8680
|
+
}
|
|
8681
|
+
|
|
8682
|
+
/* one card per row */
|
|
8683
|
+
|
|
8684
|
+
.card {
|
|
8685
|
+
border: 1px solid var(--border);
|
|
8686
|
+
background: var(--panel);
|
|
8687
|
+
border-radius: 14px;
|
|
8688
|
+
padding: 14px;
|
|
8689
|
+
display: flex;
|
|
8690
|
+
flex-direction: column;
|
|
8691
|
+
gap: 10px;
|
|
8692
|
+
}
|
|
8693
|
+
|
|
8694
|
+
.head {
|
|
8695
|
+
display: flex;
|
|
8696
|
+
flex-direction: column;
|
|
8697
|
+
gap: 8px;
|
|
8698
|
+
}
|
|
8699
|
+
|
|
8700
|
+
.title {
|
|
8701
|
+
display: flex;
|
|
8702
|
+
align-items: center;
|
|
8703
|
+
justify-content: space-between;
|
|
8704
|
+
gap: 10px;
|
|
8705
|
+
}
|
|
8706
|
+
|
|
8707
|
+
.title h2 {
|
|
8708
|
+
font-size: 16px;
|
|
8709
|
+
margin: 0;
|
|
8710
|
+
overflow: hidden;
|
|
8711
|
+
text-overflow: ellipsis;
|
|
8712
|
+
white-space: nowrap;
|
|
8713
|
+
}
|
|
8714
|
+
|
|
8715
|
+
.meta {
|
|
8716
|
+
font-size: 12px;
|
|
8717
|
+
color: var(--muted);
|
|
8718
|
+
overflow: hidden;
|
|
8719
|
+
text-overflow: ellipsis;
|
|
8720
|
+
white-space: nowrap;
|
|
8721
|
+
}
|
|
8722
|
+
|
|
8723
|
+
.kv {
|
|
8724
|
+
display: flex;
|
|
8725
|
+
flex-wrap: wrap;
|
|
8726
|
+
gap: 6px;
|
|
8727
|
+
}
|
|
8728
|
+
|
|
8729
|
+
.chip {
|
|
8730
|
+
font-size: 12px;
|
|
8731
|
+
padding: 4px 8px;
|
|
8732
|
+
border-radius: 999px;
|
|
8733
|
+
background: var(--chip);
|
|
8734
|
+
border: 1px solid var(--border);
|
|
8735
|
+
}
|
|
8736
|
+
|
|
8737
|
+
.hint {
|
|
8738
|
+
color: var(--muted);
|
|
8739
|
+
font-size: 12px;
|
|
8740
|
+
}
|
|
8741
|
+
|
|
8742
|
+
.badges {
|
|
8743
|
+
display: flex;
|
|
8744
|
+
gap: 8px;
|
|
8745
|
+
flex-wrap: wrap;
|
|
8746
|
+
}
|
|
8747
|
+
|
|
8748
|
+
/* Per-card badges: labels become toggles when clickable */
|
|
8749
|
+
.badge {
|
|
8750
|
+
font-size: 12px;
|
|
8751
|
+
padding: 3px 8px;
|
|
8752
|
+
border-radius: 999px;
|
|
8753
|
+
border: 1px solid var(--border);
|
|
8754
|
+
background: var(--chip);
|
|
8755
|
+
color: #d7dbe0;
|
|
8756
|
+
}
|
|
8757
|
+
|
|
8758
|
+
.badge.ok {
|
|
8759
|
+
color: #b9f6ca;
|
|
8760
|
+
border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
|
|
8761
|
+
}
|
|
8762
|
+
|
|
8763
|
+
.badge.info {
|
|
8764
|
+
color: #b3d9ff;
|
|
8765
|
+
border-color: color-mix(in srgb, var(--info) 55%, var(--border));
|
|
8766
|
+
}
|
|
8767
|
+
|
|
8768
|
+
.badge.err {
|
|
8769
|
+
color: #ff9aa0;
|
|
8770
|
+
border-color: color-mix(in srgb, var(--err) 55%, var(--border));
|
|
8771
|
+
}
|
|
8772
|
+
|
|
8773
|
+
.as-toggle {
|
|
8774
|
+
cursor: pointer;
|
|
8775
|
+
}
|
|
8776
|
+
|
|
8777
|
+
/* 1px ring on active toggle */
|
|
8778
|
+
.tg-err:checked + label.as-toggle,
|
|
8779
|
+
.tg-info:checked + label.as-toggle,
|
|
8780
|
+
.tg-stories:checked + label.as-toggle,
|
|
8781
|
+
.tg-props:checked + label.as-toggle {
|
|
8782
|
+
box-shadow: 0 0 0 var(--active-ring) currentColor;
|
|
8783
|
+
border-color: currentColor;
|
|
8784
|
+
}
|
|
8785
|
+
|
|
8786
|
+
/* Panels: hidden by default, shown when respective toggle checked */
|
|
8787
|
+
.panels {
|
|
8788
|
+
display: grid;
|
|
8789
|
+
gap: 10px;
|
|
8790
|
+
}
|
|
8791
|
+
|
|
8792
|
+
.panel {
|
|
8793
|
+
display: none;
|
|
8794
|
+
}
|
|
8795
|
+
|
|
8796
|
+
.tg-err:checked ~ .panels .panel-err {
|
|
8797
|
+
display: grid;
|
|
8798
|
+
}
|
|
8799
|
+
|
|
8800
|
+
.tg-info:checked ~ .panels .panel-info {
|
|
8801
|
+
display: grid;
|
|
8802
|
+
gap: 8px;
|
|
8803
|
+
}
|
|
8804
|
+
|
|
8805
|
+
.tg-stories:checked ~ .panels .panel-stories {
|
|
8806
|
+
display: grid;
|
|
8807
|
+
gap: 8px;
|
|
8808
|
+
}
|
|
8809
|
+
|
|
8810
|
+
.tg-props:checked ~ .panels .panel-props {
|
|
8811
|
+
display: grid;
|
|
8812
|
+
}
|
|
8813
|
+
|
|
8814
|
+
/* Colored notes for prop type error + info */
|
|
8815
|
+
.note {
|
|
8816
|
+
padding: 12px;
|
|
8817
|
+
border: 1px solid var(--border);
|
|
8818
|
+
border-radius: 10px;
|
|
8819
|
+
}
|
|
8820
|
+
|
|
8821
|
+
.note.err {
|
|
8822
|
+
border-color: color-mix(in srgb, var(--err) 55%, var(--border));
|
|
8823
|
+
background: var(--err-bg);
|
|
8824
|
+
color: #ffd1d4;
|
|
8825
|
+
}
|
|
8826
|
+
|
|
8827
|
+
.note.info {
|
|
8828
|
+
border-color: color-mix(in srgb, var(--info) 55%, var(--border));
|
|
8829
|
+
background: var(--info-bg);
|
|
8830
|
+
color: #d6e8ff;
|
|
8831
|
+
}
|
|
8832
|
+
|
|
8833
|
+
.note.ok {
|
|
8834
|
+
border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
|
|
8835
|
+
background: var(--ok-bg);
|
|
8836
|
+
color: var(--fg);
|
|
8837
|
+
}
|
|
8838
|
+
|
|
8839
|
+
.note-title {
|
|
8840
|
+
font-weight: 600;
|
|
8841
|
+
margin-bottom: 6px;
|
|
8842
|
+
}
|
|
8843
|
+
|
|
8844
|
+
.note-body {
|
|
8845
|
+
white-space: normal;
|
|
8846
|
+
}
|
|
8847
|
+
|
|
8848
|
+
/* Story error cards */
|
|
8849
|
+
.ex {
|
|
8850
|
+
padding: 10px;
|
|
8851
|
+
border: 1px solid var(--border);
|
|
8852
|
+
border-radius: 10px;
|
|
8853
|
+
background: #0f131b;
|
|
8854
|
+
}
|
|
8855
|
+
|
|
8856
|
+
.ex.err {
|
|
8857
|
+
border-color: color-mix(in srgb, var(--err) 55%, var(--border));
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8860
|
+
.row {
|
|
8861
|
+
display: flex;
|
|
8862
|
+
align-items: center;
|
|
8863
|
+
gap: 8px;
|
|
8864
|
+
flex-wrap: wrap;
|
|
8865
|
+
}
|
|
8866
|
+
|
|
8867
|
+
.status-dot {
|
|
8868
|
+
width: 8px;
|
|
8869
|
+
height: 8px;
|
|
8870
|
+
border-radius: 50%;
|
|
8871
|
+
display: inline-block;
|
|
8872
|
+
}
|
|
8873
|
+
|
|
8874
|
+
.dot-ok {
|
|
8875
|
+
background: var(--ok);
|
|
8876
|
+
}
|
|
8877
|
+
|
|
8878
|
+
.dot-err {
|
|
8879
|
+
background: var(--err);
|
|
8880
|
+
}
|
|
8881
|
+
|
|
8882
|
+
.ex-name {
|
|
8883
|
+
font-weight: 600;
|
|
8884
|
+
}
|
|
8885
|
+
|
|
8886
|
+
/* Error groups (visible in errors filter) */
|
|
8887
|
+
.error-groups {
|
|
8888
|
+
display: none;
|
|
8889
|
+
margin-bottom: 16px;
|
|
8890
|
+
}
|
|
8891
|
+
|
|
8892
|
+
.group {
|
|
8893
|
+
border: 1px solid var(--border);
|
|
8894
|
+
background: var(--panel);
|
|
8895
|
+
border-radius: 14px;
|
|
8896
|
+
overflow: hidden;
|
|
8897
|
+
}
|
|
8898
|
+
|
|
8899
|
+
.group + .group {
|
|
8900
|
+
margin-top: 12px;
|
|
8901
|
+
}
|
|
8902
|
+
|
|
8903
|
+
.group-header {
|
|
8904
|
+
display: flex;
|
|
8905
|
+
align-items: center;
|
|
8906
|
+
gap: 10px;
|
|
8907
|
+
padding: 12px 14px;
|
|
8908
|
+
cursor: pointer;
|
|
8909
|
+
border-bottom: 1px solid var(--border);
|
|
8910
|
+
}
|
|
8911
|
+
|
|
8912
|
+
.group-header:hover {
|
|
8913
|
+
background: #141722;
|
|
8914
|
+
}
|
|
8915
|
+
|
|
8916
|
+
.group-title {
|
|
8917
|
+
font-weight: 600;
|
|
8918
|
+
flex: 1;
|
|
8919
|
+
}
|
|
8920
|
+
|
|
8921
|
+
.group-count {
|
|
8922
|
+
font-size: 12px;
|
|
8923
|
+
color: var(--muted);
|
|
8924
|
+
}
|
|
8925
|
+
|
|
8926
|
+
.group-cards {
|
|
8927
|
+
display: none;
|
|
8928
|
+
padding: 12px;
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8931
|
+
.group .card {
|
|
8932
|
+
margin: 12px 0;
|
|
8933
|
+
}
|
|
8934
|
+
|
|
8935
|
+
.group .card:first-child {
|
|
8936
|
+
margin-top: 0;
|
|
8937
|
+
}
|
|
8938
|
+
|
|
8939
|
+
.group .card:last-child {
|
|
8940
|
+
margin-bottom: 0;
|
|
8941
|
+
}
|
|
8942
|
+
|
|
8943
|
+
/* caret rotation */
|
|
8944
|
+
.group-tg:checked + label .caret {
|
|
8945
|
+
transform: rotate(90deg);
|
|
8946
|
+
}
|
|
8947
|
+
|
|
8948
|
+
.caret {
|
|
8949
|
+
transition: transform 0.15s ease;
|
|
8950
|
+
}
|
|
8951
|
+
|
|
8952
|
+
/* toggle body */
|
|
8953
|
+
.group-tg:checked ~ .group-cards {
|
|
8954
|
+
display: block;
|
|
8955
|
+
}
|
|
8956
|
+
|
|
8957
|
+
/* CSS-only filtering of cards via top pills */
|
|
8958
|
+
#filter-errors:target ~ main .card:not(.has-error):not(.has-story-error) {
|
|
8959
|
+
display: none;
|
|
8960
|
+
}
|
|
8961
|
+
|
|
8962
|
+
#filter-infos:target ~ main .card:not(.has-info) {
|
|
8963
|
+
display: none;
|
|
8964
|
+
}
|
|
8965
|
+
|
|
8966
|
+
#filter-story-errors:target ~ main .card:not(.has-story-error) {
|
|
8967
|
+
display: none;
|
|
8968
|
+
}
|
|
8969
|
+
|
|
8970
|
+
#filter-all:target ~ main .card {
|
|
8971
|
+
display: block;
|
|
8972
|
+
}
|
|
8973
|
+
|
|
8974
|
+
/* In errors view, hide standalone component-error cards in the regular grid (they will appear in groups) */
|
|
8975
|
+
#filter-errors:target ~ main .grid .card.has-error {
|
|
8976
|
+
display: none;
|
|
8977
|
+
}
|
|
8978
|
+
|
|
8979
|
+
/* Show grouped section only in errors view */
|
|
8980
|
+
#filter-errors:target ~ main .error-groups {
|
|
8981
|
+
display: block;
|
|
8982
|
+
}
|
|
8983
|
+
|
|
8984
|
+
/* When a toggle is checked, show the corresponding panel */
|
|
8985
|
+
.card > .tg-err:checked ~ .panels .panel-err {
|
|
8986
|
+
display: grid;
|
|
8987
|
+
}
|
|
8988
|
+
|
|
8989
|
+
.card > .tg-info:checked ~ .panels .panel-info {
|
|
8990
|
+
display: grid;
|
|
8991
|
+
}
|
|
8992
|
+
|
|
8993
|
+
.card > .tg-stories:checked ~ .panels .panel-stories {
|
|
8994
|
+
display: grid;
|
|
8995
|
+
}
|
|
8996
|
+
|
|
8997
|
+
/* Add vertical spacing around panels only when any panel is visible */
|
|
8998
|
+
.card > .tg-err:checked ~ .panels,
|
|
8999
|
+
.card > .tg-info:checked ~ .panels,
|
|
9000
|
+
.card > .tg-stories:checked ~ .panels,
|
|
9001
|
+
.card > .tg-props:checked ~ .panels {
|
|
9002
|
+
margin: 10px 0;
|
|
9003
|
+
}
|
|
9004
|
+
|
|
9005
|
+
/* Optional: a subtle 1px ring on the active badge, using :has() if available */
|
|
9006
|
+
@supports selector(.card:has(.tg-err:checked)) {
|
|
9007
|
+
.card:has(.tg-err:checked) label[for$='-err'],
|
|
9008
|
+
.card:has(.tg-info:checked) label[for$='-info'],
|
|
9009
|
+
.card:has(.tg-stories:checked) label[for$='-stories'],
|
|
9010
|
+
.card:has(.tg-props:checked) label[for$='-props'] {
|
|
9011
|
+
box-shadow: 0 0 0 1px currentColor;
|
|
9012
|
+
border-color: currentColor;
|
|
9013
|
+
}
|
|
9014
|
+
}
|
|
9015
|
+
|
|
9016
|
+
/* Wrap long lines in code blocks at ~120 characters */
|
|
9017
|
+
pre, code {
|
|
9018
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
9019
|
+
}
|
|
9020
|
+
pre {
|
|
9021
|
+
white-space: pre-wrap;
|
|
9022
|
+
overflow-wrap: anywhere;
|
|
9023
|
+
word-break: break-word;
|
|
9024
|
+
overflow-x: auto; /* fallback for extremely long tokens */
|
|
9025
|
+
margin: 8px 0 0;
|
|
9026
|
+
}
|
|
9027
|
+
pre > code {
|
|
9028
|
+
display: block;
|
|
9029
|
+
white-space: inherit;
|
|
9030
|
+
overflow-wrap: inherit;
|
|
9031
|
+
word-break: inherit;
|
|
9032
|
+
inline-size: min(100%, 120ch);
|
|
9033
|
+
}
|
|
9034
|
+
</style>
|
|
9035
|
+
</head>
|
|
9036
|
+
<body>
|
|
9037
|
+
<!-- Hidden targets for the top-level filters -->
|
|
9038
|
+
<span id="filter-all"></span>
|
|
9039
|
+
<span id="filter-errors"></span>
|
|
9040
|
+
<span id="filter-infos"></span>
|
|
9041
|
+
<span id="filter-story-errors"></span>
|
|
9042
|
+
<header>
|
|
9043
|
+
<div class="wrap">
|
|
9044
|
+
<h1>Components Manifest</h1>
|
|
9045
|
+
<div class="summary">${allPill}${compErrorsPill}${compInfosPill}${storiesPill}</div>
|
|
9046
|
+
</div>
|
|
9047
|
+
</header>
|
|
9048
|
+
<main>
|
|
9049
|
+
<div class="wrap">
|
|
9050
|
+
<div class="grid" role="list">
|
|
9051
|
+
${grid || `<div class="card"><div class="head"><div class="hint">No components.</div></div></div>`}
|
|
9052
|
+
</div>
|
|
9053
|
+
${errorGroups.length ? `<div class="error-groups" role="region" aria-label="Prop type error groups">${errorGroupsHTML}</div>` : ""}
|
|
9054
|
+
</div>
|
|
9055
|
+
</main>
|
|
9056
|
+
</body>
|
|
9057
|
+
</html> `;
|
|
9058
|
+
}
|
|
9059
|
+
__name(renderManifestComponentsPage, "renderManifestComponentsPage");
|
|
9060
|
+
var esc = /* @__PURE__ */ __name((s) => String(s ?? "").replace(
|
|
9061
|
+
/[&<>"']/g,
|
|
9062
|
+
(c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]
|
|
9063
|
+
), "esc");
|
|
9064
|
+
var plural = /* @__PURE__ */ __name((n, one, many = `${one}s`) => n === 1 ? one : many, "plural");
|
|
9065
|
+
function analyzeComponent(c) {
|
|
9066
|
+
const hasPropTypeError = !!c.error;
|
|
9067
|
+
const warns = [];
|
|
9068
|
+
if (!c.description?.trim()) {
|
|
9069
|
+
warns.push("No description found. Write a jsdoc comment such as /** Component description */.");
|
|
9070
|
+
}
|
|
9071
|
+
if (!c.import?.trim()) {
|
|
9072
|
+
warns.push(
|
|
9073
|
+
`Specify an @import jsdoc tag on your component or your stories meta such as @import import { ${c.name} } from 'my-design-system';`
|
|
9074
|
+
);
|
|
9075
|
+
}
|
|
9076
|
+
const totalStories = c.stories?.length ?? 0;
|
|
9077
|
+
const storyErrors = (c.stories ?? []).filter((e) => !!e?.error).length;
|
|
9078
|
+
const storyOk = totalStories - storyErrors;
|
|
9079
|
+
const hasAnyError = hasPropTypeError || storyErrors > 0;
|
|
9080
|
+
return {
|
|
9081
|
+
hasPropTypeError,
|
|
9082
|
+
hasAnyError,
|
|
9083
|
+
hasWarns: warns.length > 0,
|
|
9084
|
+
warns,
|
|
9085
|
+
totalStories,
|
|
9086
|
+
storyErrors,
|
|
9087
|
+
storyOk
|
|
9088
|
+
};
|
|
9089
|
+
}
|
|
9090
|
+
__name(analyzeComponent, "analyzeComponent");
|
|
9091
|
+
function note(title, bodyHTML, kind) {
|
|
9092
|
+
return `
|
|
9093
|
+
<div class="note ${kind}">
|
|
9094
|
+
<div class="note-title">${esc(title)}</div>
|
|
9095
|
+
<div class="note-body">${bodyHTML}</div>
|
|
9096
|
+
</div>`;
|
|
9097
|
+
}
|
|
9098
|
+
__name(note, "note");
|
|
9099
|
+
function renderComponentCard(key, c, id) {
|
|
9100
|
+
const a = analyzeComponent(c);
|
|
9101
|
+
const statusDot = a.hasAnyError ? "dot-err" : "dot-ok";
|
|
9102
|
+
const allStories = c.stories ?? [];
|
|
9103
|
+
const errorStories = allStories.filter((ex) => !!ex?.error);
|
|
9104
|
+
const okStories = allStories.filter((ex) => !ex?.error);
|
|
9105
|
+
const slug = `c-${id}-${(c.id || key).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "")}`;
|
|
9106
|
+
const componentErrorBadge = a.hasPropTypeError ? `<label for="${slug}-err" class="badge err as-toggle">prop type error</label>` : "";
|
|
9107
|
+
const infosBadge = a.hasWarns ? `<label for="${slug}-info" class="badge info as-toggle">${a.warns.length} ${plural(a.warns.length, "info", "infos")}</label>` : "";
|
|
9108
|
+
const storiesBadge = a.totalStories > 0 ? `<label for="${slug}-stories" class="badge ${a.storyErrors > 0 ? "err" : "ok"} as-toggle">${a.storyErrors > 0 ? `${a.storyErrors}/${a.totalStories} story errors` : `${a.totalStories} ${plural(a.totalStories, "story", "stories")}`}</label>` : "";
|
|
9109
|
+
const reactDocgen = !a.hasPropTypeError && "reactDocgen" in c && c.reactDocgen;
|
|
9110
|
+
const parsedDocgen = reactDocgen ? parseReactDocgen(reactDocgen) : void 0;
|
|
9111
|
+
const propEntries = parsedDocgen ? Object.entries(parsedDocgen.props ?? {}) : [];
|
|
9112
|
+
const propTypesBadge = !a.hasPropTypeError && propEntries.length > 0 ? `<label for="${slug}-props" class="badge ok as-toggle">${propEntries.length} ${plural(propEntries.length, "prop type")}</label>` : "";
|
|
9113
|
+
const primaryBadge = componentErrorBadge || propTypesBadge;
|
|
9114
|
+
const propsCode = propEntries.length > 0 ? propEntries.sort(([aName], [bName]) => aName.localeCompare(bName)).map(([propName, info]) => {
|
|
9115
|
+
const description = (info?.description ?? "").trim();
|
|
9116
|
+
const t = (info?.type ?? "any").trim();
|
|
9117
|
+
const optional = info?.required ? "" : "?";
|
|
9118
|
+
const defaultVal = (info?.defaultValue ?? "").trim();
|
|
9119
|
+
const def = defaultVal ? ` = ${defaultVal}` : "";
|
|
9120
|
+
const doc = ["/**", ...description.split("\n").map((line) => ` * ${line}`), " */"].join("\n") + "\n";
|
|
9121
|
+
return `${description ? doc : ""}${propName}${optional}: ${t}${def}`;
|
|
9122
|
+
}).join("\n\n") : "";
|
|
9123
|
+
const tags = c.jsDocTags && typeof c.jsDocTags === "object" ? Object.entries(c.jsDocTags).flatMap(
|
|
9124
|
+
([k, v]) => (Array.isArray(v) ? v : [v]).map(
|
|
9125
|
+
(val) => `<span class="chip">${esc(k)}: ${esc(val)}</span>`
|
|
9126
|
+
)
|
|
9127
|
+
).join("") : "";
|
|
9128
|
+
esc(c.error?.message || "Unknown error");
|
|
9129
|
+
return `
|
|
9130
|
+
<article
|
|
9131
|
+
class="card
|
|
9132
|
+
${a.hasPropTypeError ? "has-error" : "no-error"}
|
|
9133
|
+
${a.hasWarns ? "has-info" : "no-info"}
|
|
9134
|
+
${a.storyErrors ? "has-story-error" : "no-story-error"}"
|
|
9135
|
+
role="listitem"
|
|
9136
|
+
aria-label="${esc(c.name || key)}">
|
|
9137
|
+
<div class="head">
|
|
9138
|
+
<div class="title">
|
|
9139
|
+
<h2><span class="status-dot ${statusDot}"></span> ${esc(c.name || key)}</h2>
|
|
9140
|
+
<div class="badges">
|
|
9141
|
+
${primaryBadge}
|
|
9142
|
+
${infosBadge}
|
|
9143
|
+
${storiesBadge}
|
|
9144
|
+
</div>
|
|
9145
|
+
</div>
|
|
9146
|
+
<div class="meta" title="${esc(c.path)}">${esc(c.id)} \xB7 ${esc(c.path)}</div>
|
|
9147
|
+
${c.summary ? `<div>${esc(c.summary)}</div>` : ""}
|
|
9148
|
+
${c.description ? `<div class="hint">${esc(c.description)}</div>` : ""}
|
|
9149
|
+
${tags ? `<div class="kv">${tags}</div>` : ""}
|
|
9150
|
+
</div>
|
|
9151
|
+
|
|
9152
|
+
<!-- \u2B07\uFE0F Hidden toggles must be siblings BEFORE .panels -->
|
|
9153
|
+
${a.hasPropTypeError ? `<input id="${slug}-err" class="tg tg-err" type="checkbox" hidden />` : ""}
|
|
9154
|
+
${a.hasWarns ? `<input id="${slug}-info" class="tg tg-info" type="checkbox" hidden />` : ""}
|
|
9155
|
+
${a.totalStories > 0 ? `<input id="${slug}-stories" class="tg tg-stories" type="checkbox" hidden />` : ""}
|
|
9156
|
+
${!a.hasPropTypeError && propEntries.length > 0 ? `<input id="${slug}-props" class="tg tg-props" type="checkbox" hidden />` : ""}
|
|
9157
|
+
|
|
9158
|
+
<div class="panels">
|
|
9159
|
+
${a.hasPropTypeError ? `
|
|
9160
|
+
<div class="panel panel-err">
|
|
9161
|
+
${note("Prop type error", `<pre><code>${esc(c.error?.message || "Unknown error")}</code></pre>`, "err")}
|
|
9162
|
+
</div>` : ""}
|
|
9163
|
+
${a.hasWarns ? `
|
|
9164
|
+
<div class="panel panel-info">
|
|
9165
|
+
${a.warns.map((w) => note("Info", esc(w), "info")).join("")}
|
|
9166
|
+
</div>` : ""}
|
|
9167
|
+
${!a.hasPropTypeError && propEntries.length > 0 ? `
|
|
9168
|
+
<div class="panel panel-props">
|
|
9169
|
+
<div class="note ok">
|
|
9170
|
+
<div class="row">
|
|
9171
|
+
<span class="ex-name">Prop types</span>
|
|
9172
|
+
<span class="badge ok">${propEntries.length} ${plural(propEntries.length, "prop type")}</span>
|
|
9173
|
+
</div>
|
|
9174
|
+
<pre><code>Component: ${reactDocgen?.definedInFile ? esc(path.relative(process.cwd(), reactDocgen.definedInFile)) : ""}${reactDocgen?.exportName ? "::" + esc(reactDocgen?.exportName) : ""}</code></pre>
|
|
9175
|
+
<pre><code>Props:</code></pre>
|
|
9176
|
+
<pre><code>${esc(propsCode)}</code></pre>
|
|
9177
|
+
</div>
|
|
9178
|
+
</div>` : ""}
|
|
9179
|
+
${a.totalStories > 0 ? `
|
|
9180
|
+
<div class="panel panel-stories">
|
|
9181
|
+
${errorStories.map(
|
|
9182
|
+
(ex, j) => `
|
|
9183
|
+
<div class="note err">
|
|
9184
|
+
<div class="row">
|
|
9185
|
+
<span class="ex-name">${esc(ex.name)}</span>
|
|
9186
|
+
<span class="badge err">story error</span>
|
|
9187
|
+
</div>
|
|
9188
|
+
${ex?.summary ? `<div class="hint">Summary: ${esc(ex.summary)}</div>` : ""}
|
|
9189
|
+
${ex?.description ? `<div class="hint">${esc(ex.description)}</div>` : ""}
|
|
9190
|
+
${ex?.snippet ? `<pre><code>${esc(ex.snippet)}</code></pre>` : ""}
|
|
9191
|
+
${ex?.error?.message ? `<pre><code>${esc(ex.error.message)}</code></pre>` : ""}
|
|
9192
|
+
</div>`
|
|
9193
|
+
).join("")}
|
|
9194
|
+
|
|
9195
|
+
|
|
9196
|
+
${c.import ? `<div class="note ok">
|
|
9197
|
+
<div class="row">
|
|
9198
|
+
<span class="ex-name">Imports</span>
|
|
9199
|
+
</div>
|
|
9200
|
+
<pre><code>${c.import}</code></pre>
|
|
9201
|
+
</div>` : ""}
|
|
9202
|
+
|
|
9203
|
+
${okStories.map(
|
|
9204
|
+
(ex) => `
|
|
9205
|
+
<div class="note ok">
|
|
9206
|
+
<div class="row">
|
|
9207
|
+
<span class="ex-name">${esc(ex.name)}</span>
|
|
9208
|
+
<span class="badge ok">story ok</span>
|
|
9209
|
+
</div>
|
|
9210
|
+
${ex?.summary ? `<div>${esc(ex.summary)}</div>` : ""}
|
|
9211
|
+
${ex?.description ? `<div class="hint">${esc(ex.description)}</div>` : ""}
|
|
9212
|
+
${ex?.snippet ? `<pre><code>${esc(ex.snippet)}</code></pre>` : ""}
|
|
9213
|
+
</div>`
|
|
9214
|
+
).join("")}
|
|
9215
|
+
</div>` : ""}
|
|
9216
|
+
</div>
|
|
9217
|
+
</article>`;
|
|
9218
|
+
}
|
|
9219
|
+
__name(renderComponentCard, "renderComponentCard");
|
|
9220
|
+
var parseReactDocgen = /* @__PURE__ */ __name((reactDocgen) => {
|
|
9221
|
+
const props = reactDocgen?.props ?? {};
|
|
9222
|
+
return {
|
|
9223
|
+
props: Object.fromEntries(
|
|
9224
|
+
Object.entries(props).map(([propName, prop]) => [
|
|
9225
|
+
propName,
|
|
9226
|
+
{
|
|
9227
|
+
description: prop.description,
|
|
9228
|
+
type: serializeTsType(prop.tsType ?? prop.type),
|
|
9229
|
+
defaultValue: prop.defaultValue?.value,
|
|
9230
|
+
required: prop.required
|
|
9231
|
+
}
|
|
9232
|
+
])
|
|
9233
|
+
)
|
|
9234
|
+
};
|
|
9235
|
+
}, "parseReactDocgen");
|
|
9236
|
+
function serializeTsType(tsType) {
|
|
9237
|
+
if (!tsType) {
|
|
9238
|
+
return void 0;
|
|
9239
|
+
}
|
|
9240
|
+
if ("raw" in tsType && typeof tsType.raw === "string" && tsType.raw.trim().length > 0) {
|
|
9241
|
+
return tsType.raw;
|
|
9242
|
+
}
|
|
9243
|
+
if (!tsType.name) {
|
|
9244
|
+
return void 0;
|
|
9245
|
+
}
|
|
9246
|
+
if ("elements" in tsType) {
|
|
9247
|
+
if (tsType.name === "union") {
|
|
9248
|
+
const parts = (tsType.elements ?? []).map((el) => serializeTsType(el) ?? "unknown");
|
|
9249
|
+
return parts.join(" | ");
|
|
9250
|
+
}
|
|
9251
|
+
if (tsType.name === "intersection") {
|
|
9252
|
+
const parts = (tsType.elements ?? []).map((el) => serializeTsType(el) ?? "unknown");
|
|
9253
|
+
return parts.join(" & ");
|
|
9254
|
+
}
|
|
9255
|
+
if (tsType.name === "Array") {
|
|
9256
|
+
const el = (tsType.elements ?? [])[0];
|
|
9257
|
+
const inner = serializeTsType(el) ?? "unknown";
|
|
9258
|
+
return `${inner}[]`;
|
|
9259
|
+
}
|
|
9260
|
+
if (tsType.name === "tuple") {
|
|
9261
|
+
const parts = (tsType.elements ?? []).map((el) => serializeTsType(el) ?? "unknown");
|
|
9262
|
+
return `[${parts.join(", ")}]`;
|
|
9263
|
+
}
|
|
9264
|
+
}
|
|
9265
|
+
if ("value" in tsType && tsType.name === "literal") {
|
|
9266
|
+
return tsType.value;
|
|
9267
|
+
}
|
|
9268
|
+
if ("signature" in tsType && tsType.name === "signature") {
|
|
9269
|
+
if (tsType.type === "function") {
|
|
9270
|
+
const args = (tsType.signature?.arguments ?? []).map((a) => {
|
|
9271
|
+
const argType = serializeTsType(a.type) ?? "any";
|
|
9272
|
+
return `${a.name}: ${argType}`;
|
|
9273
|
+
});
|
|
9274
|
+
const ret = serializeTsType(tsType.signature?.return) ?? "void";
|
|
9275
|
+
return `(${args.join(", ")}) => ${ret}`;
|
|
9276
|
+
}
|
|
9277
|
+
if (tsType.type === "object") {
|
|
9278
|
+
const props = (tsType.signature?.properties ?? []).map((p) => {
|
|
9279
|
+
const req = Boolean(p.value?.required);
|
|
9280
|
+
const propType = serializeTsType(p.value) ?? "any";
|
|
9281
|
+
return `${p.key}${req ? "" : "?"}: ${propType}`;
|
|
9282
|
+
});
|
|
9283
|
+
return `{ ${props.join("; ")} }`;
|
|
9284
|
+
}
|
|
9285
|
+
return "unknown";
|
|
9286
|
+
}
|
|
9287
|
+
if ("elements" in tsType) {
|
|
9288
|
+
const inner = (tsType.elements ?? []).map((el) => serializeTsType(el) ?? "unknown");
|
|
9289
|
+
if (inner.length > 0) {
|
|
9290
|
+
return `${tsType.name}<${inner.join(", ")}>`;
|
|
9291
|
+
}
|
|
9292
|
+
}
|
|
9293
|
+
return tsType.name;
|
|
9294
|
+
}
|
|
9295
|
+
__name(serializeTsType, "serializeTsType");
|
|
8488
9296
|
|
|
8489
9297
|
// src/core-server/utils/StoryIndexGenerator.ts
|
|
8490
9298
|
import { existsSync } from "node:fs";
|
|
8491
9299
|
import { readFile } from "node:fs/promises";
|
|
8492
|
-
import { dirname, extname, join, normalize, relative, resolve as resolve2, sep } from "node:path";
|
|
9300
|
+
import { dirname, extname, join as join2, normalize, relative as relative2, resolve as resolve2, sep } from "node:path";
|
|
8493
9301
|
import { commonGlobOptions, getProjectRoot, normalizeStoryPath } from "storybook/internal/common";
|
|
8494
9302
|
import { combineTags, storyNameFromExport, toId } from "storybook/internal/csf";
|
|
8495
9303
|
import { getStorySortParameter, loadConfig } from "storybook/internal/csf-tools";
|
|
@@ -8683,7 +9491,7 @@ function isMdxEntry({ tags }) {
|
|
|
8683
9491
|
return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
|
|
8684
9492
|
}
|
|
8685
9493
|
__name(isMdxEntry, "isMdxEntry");
|
|
8686
|
-
var makeAbsolute = /* @__PURE__ */ __name((otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(resolve2(workingDir, normalizeStoryPath(
|
|
9494
|
+
var makeAbsolute = /* @__PURE__ */ __name((otherImport, normalizedPath, workingDir) => otherImport.startsWith(".") ? slash(resolve2(workingDir, normalizeStoryPath(join2(dirname(normalizedPath), otherImport)))) : otherImport, "makeAbsolute");
|
|
8687
9495
|
var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
8688
9496
|
constructor(specifiers, options) {
|
|
8689
9497
|
this.specifiers = specifiers;
|
|
@@ -8717,24 +9525,25 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8717
9525
|
return cached;
|
|
8718
9526
|
}
|
|
8719
9527
|
const pathToSubIndex = {};
|
|
8720
|
-
const
|
|
8721
|
-
const
|
|
8722
|
-
const
|
|
9528
|
+
const globCwd = slash(resolve2(workingDir, specifier.directory));
|
|
9529
|
+
const globPattern = specifier.files;
|
|
9530
|
+
const { globby } = await import("../_node-chunks/globby-PBTV6PX6.js");
|
|
9531
|
+
const files = await globby(globPattern, {
|
|
8723
9532
|
absolute: true,
|
|
8724
|
-
cwd:
|
|
8725
|
-
...commonGlobOptions(
|
|
9533
|
+
cwd: globCwd,
|
|
9534
|
+
...commonGlobOptions(globPattern)
|
|
8726
9535
|
});
|
|
8727
9536
|
if (files.length === 0 && !ignoreWarnings) {
|
|
8728
9537
|
once.warn(
|
|
8729
9538
|
`No story files found for the specified pattern: ${import_picocolors.default.blue(
|
|
8730
|
-
|
|
9539
|
+
join2(specifier.directory, specifier.files)
|
|
8731
9540
|
)}`
|
|
8732
9541
|
);
|
|
8733
9542
|
}
|
|
8734
9543
|
files.sort().forEach((absolutePath) => {
|
|
8735
9544
|
const ext = extname(absolutePath);
|
|
8736
9545
|
if (ext === ".storyshot") {
|
|
8737
|
-
const relativePath =
|
|
9546
|
+
const relativePath = relative2(workingDir, absolutePath);
|
|
8738
9547
|
logger.info(`Skipping ${ext} file ${relativePath}`);
|
|
8739
9548
|
return;
|
|
8740
9549
|
}
|
|
@@ -8786,7 +9595,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8786
9595
|
try {
|
|
8787
9596
|
entry[absolutePath] = await updater(specifier, absolutePath, entry[absolutePath]);
|
|
8788
9597
|
} catch (err) {
|
|
8789
|
-
const relativePath = `.${sep}${
|
|
9598
|
+
const relativePath = `.${sep}${relative2(this.options.workingDir, absolutePath)}`;
|
|
8790
9599
|
entry[absolutePath] = {
|
|
8791
9600
|
type: "error",
|
|
8792
9601
|
err: new IndexingError(
|
|
@@ -8867,20 +9676,18 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8867
9676
|
* If no such file exists, assume that the import is from a package and return the raw
|
|
8868
9677
|
*/
|
|
8869
9678
|
resolveComponentPath(rawComponentPath, absolutePath, matchPath) {
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
if (existing) {
|
|
8877
|
-
const relativePath = relative(this.options.workingDir, existing);
|
|
8878
|
-
return slash(normalizeStoryPath(relativePath));
|
|
9679
|
+
const matchedPath = matchPath?.(rawComponentPath, void 0, void 0, supportedExtensions) ?? rawComponentPath;
|
|
9680
|
+
let resolved;
|
|
9681
|
+
try {
|
|
9682
|
+
resolved = resolveImport(matchedPath, { basedir: dirname(absolutePath) });
|
|
9683
|
+
} catch (_) {
|
|
9684
|
+
return matchedPath;
|
|
8879
9685
|
}
|
|
8880
|
-
|
|
9686
|
+
const relativePath = relative2(this.options.workingDir, resolved);
|
|
9687
|
+
return slash(normalizeStoryPath(relativePath));
|
|
8881
9688
|
}
|
|
8882
9689
|
async extractStories(specifier, absolutePath, projectTags = []) {
|
|
8883
|
-
const relativePath =
|
|
9690
|
+
const relativePath = relative2(this.options.workingDir, absolutePath);
|
|
8884
9691
|
const importPath = slash(normalizeStoryPath(relativePath));
|
|
8885
9692
|
const defaultMakeTitle = /* @__PURE__ */ __name((userTitle) => {
|
|
8886
9693
|
const title = userOrAutoTitleFromSpecifier(importPath, specifier, userTitle);
|
|
@@ -8971,12 +9778,12 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8971
9778
|
};
|
|
8972
9779
|
}
|
|
8973
9780
|
async extractDocs(specifier, absolutePath, projectTags = []) {
|
|
8974
|
-
const relativePath =
|
|
9781
|
+
const relativePath = relative2(this.options.workingDir, absolutePath);
|
|
8975
9782
|
try {
|
|
8976
9783
|
const normalizedPath = normalizeStoryPath(relativePath);
|
|
8977
9784
|
const importPath = slash(normalizedPath);
|
|
8978
9785
|
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
8979
|
-
const { analyze } = await import("../_node-chunks/dist-
|
|
9786
|
+
const { analyze } = await import("../_node-chunks/dist-6TXHNR5C.js");
|
|
8980
9787
|
const result = await analyze(content);
|
|
8981
9788
|
if (result.isTemplate) {
|
|
8982
9789
|
return false;
|
|
@@ -9223,7 +10030,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9223
10030
|
this.lastError = null;
|
|
9224
10031
|
}
|
|
9225
10032
|
async getPreviewCode() {
|
|
9226
|
-
const previewFile = ["js", "jsx", "ts", "tsx", "mjs", "cjs", "mts"].map((ext) =>
|
|
10033
|
+
const previewFile = ["js", "jsx", "ts", "tsx", "mjs", "cjs", "mts"].map((ext) => join2(this.options.configDir, `preview.${ext}`)).find((fname) => existsSync(fname));
|
|
9227
10034
|
return previewFile && (await readFile(previewFile, { encoding: "utf8" })).toString();
|
|
9228
10035
|
}
|
|
9229
10036
|
getProjectTags(previewCode) {
|
|
@@ -9280,7 +10087,7 @@ __name(buildOrThrow, "buildOrThrow");
|
|
|
9280
10087
|
// src/core-server/utils/copy-all-static-files.ts
|
|
9281
10088
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
9282
10089
|
import { cp } from "node:fs/promises";
|
|
9283
|
-
import { join as
|
|
10090
|
+
import { join as join3, relative as relative3 } from "node:path";
|
|
9284
10091
|
import { getDirectoryFromWorkingDir } from "storybook/internal/common";
|
|
9285
10092
|
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
9286
10093
|
async function copyAllStaticFilesRelativeToMain(staticDirs, outputDir, configDir) {
|
|
@@ -9295,8 +10102,8 @@ async function copyAllStaticFilesRelativeToMain(staticDirs, outputDir, configDir
|
|
|
9295
10102
|
directory: staticDirAndTarget
|
|
9296
10103
|
})
|
|
9297
10104
|
);
|
|
9298
|
-
const targetPath =
|
|
9299
|
-
const skipPaths = ["index.html", "iframe.html"].map((f) =>
|
|
10105
|
+
const targetPath = join3(outputDir, to);
|
|
10106
|
+
const skipPaths = ["index.html", "iframe.html"].map((f) => join3(outputDir, f));
|
|
9300
10107
|
if (!from.includes("node_modules")) {
|
|
9301
10108
|
logger2.info(
|
|
9302
10109
|
`=> Copying static files: ${import_picocolors2.default.cyan(print(from))} at ${import_picocolors2.default.cyan(print(targetPath))}`
|
|
@@ -9312,14 +10119,14 @@ async function copyAllStaticFilesRelativeToMain(staticDirs, outputDir, configDir
|
|
|
9312
10119
|
}
|
|
9313
10120
|
__name(copyAllStaticFilesRelativeToMain, "copyAllStaticFilesRelativeToMain");
|
|
9314
10121
|
function print(p) {
|
|
9315
|
-
return
|
|
10122
|
+
return relative3(process.cwd(), p);
|
|
9316
10123
|
}
|
|
9317
10124
|
__name(print, "print");
|
|
9318
10125
|
|
|
9319
10126
|
// src/core-server/utils/get-builders.ts
|
|
9320
10127
|
import { MissingBuilderError } from "storybook/internal/server-errors";
|
|
9321
10128
|
async function getManagerBuilder() {
|
|
9322
|
-
return await import("../_node-chunks/builder-manager-
|
|
10129
|
+
return await import("../_node-chunks/builder-manager-HA7CYFCK.js");
|
|
9323
10130
|
}
|
|
9324
10131
|
__name(getManagerBuilder, "getManagerBuilder");
|
|
9325
10132
|
async function getPreviewBuilder(resolvedPreviewBuilder) {
|
|
@@ -9358,7 +10165,7 @@ __name(useStorybookMetadata, "useStorybookMetadata");
|
|
|
9358
10165
|
var import_json_ext = __toESM(require_src2(), 1);
|
|
9359
10166
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
9360
10167
|
import { createWriteStream } from "node:fs";
|
|
9361
|
-
import { join as
|
|
10168
|
+
import { join as join4 } from "node:path";
|
|
9362
10169
|
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
9363
10170
|
async function outputStats(directory, previewStats, managerStats) {
|
|
9364
10171
|
if (previewStats) {
|
|
@@ -9372,10 +10179,10 @@ async function outputStats(directory, previewStats, managerStats) {
|
|
|
9372
10179
|
}
|
|
9373
10180
|
__name(outputStats, "outputStats");
|
|
9374
10181
|
var writeStats = /* @__PURE__ */ __name(async (directory, name, stats) => {
|
|
9375
|
-
const filePath =
|
|
10182
|
+
const filePath = join4(directory, `${name}-stats.json`);
|
|
9376
10183
|
const { chunks, ...data } = stats.toJson();
|
|
9377
|
-
await new Promise((
|
|
9378
|
-
(0, import_json_ext.stringifyStream)(data, null, 2).on("error", reject).pipe(createWriteStream(filePath)).on("error", reject).on("finish",
|
|
10184
|
+
await new Promise((resolve4, reject) => {
|
|
10185
|
+
(0, import_json_ext.stringifyStream)(data, null, 2).on("error", reject).pipe(createWriteStream(filePath)).on("error", reject).on("finish", resolve4);
|
|
9379
10186
|
});
|
|
9380
10187
|
return filePath;
|
|
9381
10188
|
}, "writeStats");
|
|
@@ -9497,7 +10304,7 @@ var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
|
|
|
9497
10304
|
|
|
9498
10305
|
// src/core-server/utils/watch-story-specifiers.ts
|
|
9499
10306
|
import { lstatSync, readdirSync } from "node:fs";
|
|
9500
|
-
import { basename as basename2, join as
|
|
10307
|
+
import { basename as basename2, join as join5, relative as relative4, resolve as resolve3 } from "node:path";
|
|
9501
10308
|
import { commonGlobOptions as commonGlobOptions2 } from "storybook/internal/common";
|
|
9502
10309
|
var import_watchpack = __toESM(require_watchpack(), 1);
|
|
9503
10310
|
var isDirectory = /* @__PURE__ */ __name((directory) => {
|
|
@@ -9516,9 +10323,9 @@ function getNestedFilesAndDirectories(directories) {
|
|
|
9516
10323
|
}
|
|
9517
10324
|
readdirSync(directory, { withFileTypes: true }).forEach((ent) => {
|
|
9518
10325
|
if (ent.isDirectory()) {
|
|
9519
|
-
traverse(
|
|
10326
|
+
traverse(join5(directory, ent.name));
|
|
9520
10327
|
} else if (ent.isFile()) {
|
|
9521
|
-
files.add(
|
|
10328
|
+
files.add(join5(directory, ent.name));
|
|
9522
10329
|
}
|
|
9523
10330
|
});
|
|
9524
10331
|
traversedDirectories.add(directory);
|
|
@@ -9538,7 +10345,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
9538
10345
|
});
|
|
9539
10346
|
wp.watch({ files, directories });
|
|
9540
10347
|
const toImportPath = /* @__PURE__ */ __name((absolutePath) => {
|
|
9541
|
-
const relativePath =
|
|
10348
|
+
const relativePath = relative4(options.workingDir, absolutePath);
|
|
9542
10349
|
return slash(relativePath.startsWith(".") ? relativePath : `./${relativePath}`);
|
|
9543
10350
|
}, "toImportPath");
|
|
9544
10351
|
async function onChangeOrRemove(absolutePath, removed) {
|
|
@@ -9551,14 +10358,14 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
9551
10358
|
if (!removed && isDirectory(absolutePath)) {
|
|
9552
10359
|
await Promise.all(
|
|
9553
10360
|
specifiers.filter((specifier) => importPath.startsWith(specifier.directory)).map(async (specifier) => {
|
|
9554
|
-
const dirGlob =
|
|
10361
|
+
const dirGlob = join5(
|
|
9555
10362
|
absolutePath,
|
|
9556
10363
|
"**",
|
|
9557
10364
|
// files can be e.g. '**/foo/*/*.js' so we just want the last bit,
|
|
9558
10365
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
9559
10366
|
basename2(specifier.files)
|
|
9560
10367
|
);
|
|
9561
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
10368
|
+
const { globby } = await import("../_node-chunks/globby-PBTV6PX6.js");
|
|
9562
10369
|
const addedFiles = await globby(slash(dirGlob), commonGlobOptions2(dirGlob));
|
|
9563
10370
|
addedFiles.forEach((filePath) => {
|
|
9564
10371
|
const fileImportPath = toImportPath(filePath);
|
|
@@ -9622,9 +10429,9 @@ function useStoriesJson({
|
|
|
9622
10429
|
const maybeInvalidate = debounce(() => serverChannel.emit(STORY_INDEX_INVALIDATED), DEBOUNCE, {
|
|
9623
10430
|
edges: ["leading", "trailing"]
|
|
9624
10431
|
});
|
|
9625
|
-
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier,
|
|
10432
|
+
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path3, removed) => {
|
|
9626
10433
|
const generator = await initializedStoryIndexGenerator;
|
|
9627
|
-
generator.invalidate(specifier,
|
|
10434
|
+
generator.invalidate(specifier, path3, removed);
|
|
9628
10435
|
maybeInvalidate();
|
|
9629
10436
|
});
|
|
9630
10437
|
if (configDir) {
|
|
@@ -9762,10 +10569,10 @@ async function buildStaticStandalone(options) {
|
|
|
9762
10569
|
if (options.outputDir === "") {
|
|
9763
10570
|
throw new Error("Won't remove current directory. Check your outputDir!");
|
|
9764
10571
|
}
|
|
9765
|
-
options.outputDir =
|
|
9766
|
-
options.configDir =
|
|
10572
|
+
options.outputDir = resolve(options.outputDir);
|
|
10573
|
+
options.configDir = resolve(options.configDir);
|
|
9767
10574
|
logger4.info(
|
|
9768
|
-
`=> Cleaning outputDir: ${import_picocolors4.default.cyan(
|
|
10575
|
+
`=> Cleaning outputDir: ${import_picocolors4.default.cyan(relative(process.cwd(), options.outputDir))}`
|
|
9769
10576
|
);
|
|
9770
10577
|
if (options.outputDir === "/") {
|
|
9771
10578
|
throw new Error("Won't remove directory '/'. Check your outputDir!");
|
|
@@ -9778,11 +10585,11 @@ async function buildStaticStandalone(options) {
|
|
|
9778
10585
|
const corePresets = [];
|
|
9779
10586
|
const frameworkName = typeof framework === "string" ? framework : framework?.name;
|
|
9780
10587
|
if (frameworkName) {
|
|
9781
|
-
corePresets.push(
|
|
10588
|
+
corePresets.push(join(frameworkName, "preset"));
|
|
9782
10589
|
} else if (!options.ignorePreview) {
|
|
9783
10590
|
logger4.warn(`you have not specified a framework in your ${options.configDir}/main.js`);
|
|
9784
10591
|
}
|
|
9785
|
-
const commonPreset =
|
|
10592
|
+
const commonPreset = join(
|
|
9786
10593
|
resolvePackageDir("storybook"),
|
|
9787
10594
|
"dist/core-server/presets/common-preset.js"
|
|
9788
10595
|
);
|
|
@@ -9842,7 +10649,7 @@ async function buildStaticStandalone(options) {
|
|
|
9842
10649
|
copyAllStaticFilesRelativeToMain(staticDirs, options.outputDir, options.configDir)
|
|
9843
10650
|
);
|
|
9844
10651
|
}
|
|
9845
|
-
const coreServerPublicDir =
|
|
10652
|
+
const coreServerPublicDir = join(resolvePackageDir("storybook"), "assets/browser");
|
|
9846
10653
|
effects.push(cp2(coreServerPublicDir, options.outputDir, { recursive: true }));
|
|
9847
10654
|
let initializedStoryIndexGenerator = Promise.resolve(void 0);
|
|
9848
10655
|
if (!options.ignorePreview) {
|
|
@@ -9861,14 +10668,39 @@ async function buildStaticStandalone(options) {
|
|
|
9861
10668
|
initializedStoryIndexGenerator = generator.initialize().then(() => generator);
|
|
9862
10669
|
effects.push(
|
|
9863
10670
|
extractStoriesJson(
|
|
9864
|
-
|
|
10671
|
+
join(options.outputDir, "index.json"),
|
|
9865
10672
|
initializedStoryIndexGenerator
|
|
9866
10673
|
)
|
|
9867
10674
|
);
|
|
10675
|
+
if (features?.experimentalComponentsManifest) {
|
|
10676
|
+
const componentManifestGenerator = await presets.apply(
|
|
10677
|
+
"experimental_componentManifestGenerator"
|
|
10678
|
+
);
|
|
10679
|
+
const indexGenerator = await initializedStoryIndexGenerator;
|
|
10680
|
+
if (componentManifestGenerator && indexGenerator) {
|
|
10681
|
+
try {
|
|
10682
|
+
const manifests = await componentManifestGenerator(
|
|
10683
|
+
indexGenerator
|
|
10684
|
+
);
|
|
10685
|
+
await mkdir(join(options.outputDir, "manifests"), { recursive: true });
|
|
10686
|
+
await writeFile3(
|
|
10687
|
+
join(options.outputDir, "manifests", "components.json"),
|
|
10688
|
+
JSON.stringify(manifests)
|
|
10689
|
+
);
|
|
10690
|
+
await writeFile3(
|
|
10691
|
+
join(options.outputDir, "manifests", "components.html"),
|
|
10692
|
+
renderManifestComponentsPage(manifests)
|
|
10693
|
+
);
|
|
10694
|
+
} catch (e) {
|
|
10695
|
+
logger4.error("Failed to generate manifests/components.json");
|
|
10696
|
+
logger4.error(e instanceof Error ? e : String(e));
|
|
10697
|
+
}
|
|
10698
|
+
}
|
|
10699
|
+
}
|
|
9868
10700
|
}
|
|
9869
10701
|
if (!core2?.disableProjectJson) {
|
|
9870
10702
|
effects.push(
|
|
9871
|
-
extractStorybookMetadata(
|
|
10703
|
+
extractStorybookMetadata(join(options.outputDir, "project.json"), options.configDir)
|
|
9872
10704
|
);
|
|
9873
10705
|
}
|
|
9874
10706
|
if (options.debugWebpack) {
|
|
@@ -9921,9 +10753,7 @@ async function buildStaticStandalone(options) {
|
|
|
9921
10753
|
__name(buildStaticStandalone, "buildStaticStandalone");
|
|
9922
10754
|
|
|
9923
10755
|
// src/core-server/build-dev.ts
|
|
9924
|
-
var import_prompts = __toESM(require_prompts(), 1);
|
|
9925
10756
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
9926
|
-
import { join as join7, relative as relative5, resolve as resolve5 } from "node:path";
|
|
9927
10757
|
import {
|
|
9928
10758
|
JsPackageManagerFactory,
|
|
9929
10759
|
getConfigInfo,
|
|
@@ -9940,6 +10770,7 @@ import { deprecate, logger as logger11 } from "storybook/internal/node-logger";
|
|
|
9940
10770
|
import { MissingBuilderError as MissingBuilderError3, NoStatsForViteDevError } from "storybook/internal/server-errors";
|
|
9941
10771
|
import { oneWayHash, telemetry as telemetry4 } from "storybook/internal/telemetry";
|
|
9942
10772
|
import { global as global3 } from "@storybook/global";
|
|
10773
|
+
var import_prompts = __toESM(require_prompts(), 1);
|
|
9943
10774
|
var import_ts_dedent8 = __toESM(require_dist(), 1);
|
|
9944
10775
|
|
|
9945
10776
|
// src/core-server/dev-server.ts
|
|
@@ -10223,14 +11054,14 @@ var Polka = class _Polka extends Trouter {
|
|
|
10223
11054
|
return this;
|
|
10224
11055
|
}
|
|
10225
11056
|
handler(req, res, next) {
|
|
10226
|
-
let info = this.parse(req),
|
|
10227
|
-
let obj = this.find(req.method, req.path =
|
|
10228
|
-
req.url =
|
|
11057
|
+
let info = this.parse(req), path3 = info.pathname;
|
|
11058
|
+
let obj = this.find(req.method, req.path = path3);
|
|
11059
|
+
req.url = path3 + info.search;
|
|
10229
11060
|
req.originalUrl = req.originalUrl || req.url;
|
|
10230
11061
|
req.query = info.query || {};
|
|
10231
11062
|
req.search = info.search;
|
|
10232
11063
|
req.params = obj.params;
|
|
10233
|
-
if (
|
|
11064
|
+
if (path3.length > 1 && path3.indexOf("%", 1) !== -1) {
|
|
10234
11065
|
for (let k in req.params) {
|
|
10235
11066
|
try {
|
|
10236
11067
|
req.params[k] = decodeURIComponent(req.params[k]);
|
|
@@ -10418,13 +11249,13 @@ var UniversalStore = class _UniversalStore {
|
|
|
10418
11249
|
} else {
|
|
10419
11250
|
let syncingResolve;
|
|
10420
11251
|
let syncingReject;
|
|
10421
|
-
const syncingPromise = new Promise((
|
|
11252
|
+
const syncingPromise = new Promise((resolve4, reject) => {
|
|
10422
11253
|
syncingResolve = /* @__PURE__ */ __name(() => {
|
|
10423
11254
|
if (this.syncing.state !== ProgressState.PENDING) {
|
|
10424
11255
|
return;
|
|
10425
11256
|
}
|
|
10426
11257
|
this.syncing.state = ProgressState.RESOLVED;
|
|
10427
|
-
|
|
11258
|
+
resolve4();
|
|
10428
11259
|
}, "syncingResolve");
|
|
10429
11260
|
syncingReject = /* @__PURE__ */ __name((reason) => {
|
|
10430
11261
|
if (this.syncing.state !== ProgressState.PENDING) {
|
|
@@ -10521,9 +11352,9 @@ var UniversalStore = class _UniversalStore {
|
|
|
10521
11352
|
let resolveRef;
|
|
10522
11353
|
let rejectRef;
|
|
10523
11354
|
const promise = new Promise(
|
|
10524
|
-
(
|
|
11355
|
+
(resolve4, reject) => {
|
|
10525
11356
|
resolveRef = /* @__PURE__ */ __name((args) => {
|
|
10526
|
-
|
|
11357
|
+
resolve4(args);
|
|
10527
11358
|
}, "resolveRef");
|
|
10528
11359
|
rejectRef = /* @__PURE__ */ __name((...args) => {
|
|
10529
11360
|
reject(args);
|
|
@@ -10920,7 +11751,7 @@ var fileExists = /* @__PURE__ */ __name((basename4) => [".js", ".mjs", ".cjs"].r
|
|
|
10920
11751
|
async function getMiddleware(configDir) {
|
|
10921
11752
|
const middlewarePath = fileExists(resolve(configDir, "middleware"));
|
|
10922
11753
|
if (middlewarePath) {
|
|
10923
|
-
const middlewareModule = await import(middlewarePath);
|
|
11754
|
+
const middlewareModule = await import("file://" + middlewarePath);
|
|
10924
11755
|
return middlewareModule.default ?? middlewareModule;
|
|
10925
11756
|
}
|
|
10926
11757
|
return () => {
|
|
@@ -10934,7 +11765,7 @@ import { logger as logger5 } from "storybook/internal/node-logger";
|
|
|
10934
11765
|
// ../node_modules/open/index.js
|
|
10935
11766
|
import process7 from "node:process";
|
|
10936
11767
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
10937
|
-
import
|
|
11768
|
+
import path2 from "node:path";
|
|
10938
11769
|
import { fileURLToPath } from "node:url";
|
|
10939
11770
|
import { promisify as promisify5 } from "node:util";
|
|
10940
11771
|
import childProcess from "node:child_process";
|
|
@@ -11187,8 +12018,8 @@ __name(defaultBrowser2, "defaultBrowser");
|
|
|
11187
12018
|
|
|
11188
12019
|
// ../node_modules/open/index.js
|
|
11189
12020
|
var execFile5 = promisify5(childProcess.execFile);
|
|
11190
|
-
var __dirname2 =
|
|
11191
|
-
var localXdgOpenPath =
|
|
12021
|
+
var __dirname2 = path2.dirname(fileURLToPath(import.meta.url));
|
|
12022
|
+
var localXdgOpenPath = path2.join(__dirname2, "xdg-open");
|
|
11192
12023
|
var { platform, arch } = process7;
|
|
11193
12024
|
async function getWindowsDefaultBrowserFromWsl() {
|
|
11194
12025
|
const powershellPath = await powerShellPath();
|
|
@@ -11362,14 +12193,14 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
|
11362
12193
|
}
|
|
11363
12194
|
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
11364
12195
|
if (options.wait) {
|
|
11365
|
-
return new Promise((
|
|
12196
|
+
return new Promise((resolve4, reject) => {
|
|
11366
12197
|
subprocess.once("error", reject);
|
|
11367
12198
|
subprocess.once("close", (exitCode) => {
|
|
11368
12199
|
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
11369
12200
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
11370
12201
|
return;
|
|
11371
12202
|
}
|
|
11372
|
-
|
|
12203
|
+
resolve4(subprocess);
|
|
11373
12204
|
});
|
|
11374
12205
|
});
|
|
11375
12206
|
}
|
|
@@ -11718,9 +12549,9 @@ async function storybookDevServer(options) {
|
|
|
11718
12549
|
throw e;
|
|
11719
12550
|
});
|
|
11720
12551
|
}
|
|
11721
|
-
const listening = new Promise((
|
|
12552
|
+
const listening = new Promise((resolve4, reject) => {
|
|
11722
12553
|
server.once("error", reject);
|
|
11723
|
-
app.listen({ port, host },
|
|
12554
|
+
app.listen({ port, host }, resolve4);
|
|
11724
12555
|
});
|
|
11725
12556
|
await Promise.all([initializedStoryIndexGenerator, listening]).then(async ([indexGenerator]) => {
|
|
11726
12557
|
if (indexGenerator && !options.ci && !options.smokeTest && options.open) {
|
|
@@ -11734,6 +12565,57 @@ async function storybookDevServer(options) {
|
|
|
11734
12565
|
await previewBuilder?.bail().catch();
|
|
11735
12566
|
throw indexError;
|
|
11736
12567
|
}
|
|
12568
|
+
const features = await options.presets.apply("features");
|
|
12569
|
+
if (features?.experimentalComponentsManifest) {
|
|
12570
|
+
app.use("/manifests/components.json", async (req, res) => {
|
|
12571
|
+
try {
|
|
12572
|
+
const componentManifestGenerator = await options.presets.apply(
|
|
12573
|
+
"experimental_componentManifestGenerator"
|
|
12574
|
+
);
|
|
12575
|
+
const indexGenerator = await initializedStoryIndexGenerator;
|
|
12576
|
+
if (componentManifestGenerator && indexGenerator) {
|
|
12577
|
+
const manifest = await componentManifestGenerator(
|
|
12578
|
+
indexGenerator
|
|
12579
|
+
);
|
|
12580
|
+
res.setHeader("Content-Type", "application/json");
|
|
12581
|
+
res.end(JSON.stringify(manifest));
|
|
12582
|
+
return;
|
|
12583
|
+
}
|
|
12584
|
+
res.statusCode = 400;
|
|
12585
|
+
res.end("No component manifest generator configured.");
|
|
12586
|
+
return;
|
|
12587
|
+
} catch (e) {
|
|
12588
|
+
logger8.error(e instanceof Error ? e : String(e));
|
|
12589
|
+
res.statusCode = 500;
|
|
12590
|
+
res.end(e instanceof Error ? e.toString() : String(e));
|
|
12591
|
+
return;
|
|
12592
|
+
}
|
|
12593
|
+
});
|
|
12594
|
+
app.get("/manifests/components.html", async (req, res) => {
|
|
12595
|
+
try {
|
|
12596
|
+
const componentManifestGenerator = await options.presets.apply(
|
|
12597
|
+
"experimental_componentManifestGenerator"
|
|
12598
|
+
);
|
|
12599
|
+
const indexGenerator = await initializedStoryIndexGenerator;
|
|
12600
|
+
if (!componentManifestGenerator || !indexGenerator) {
|
|
12601
|
+
res.statusCode = 400;
|
|
12602
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
12603
|
+
res.end(`<pre>No component manifest generator configured.</pre>`);
|
|
12604
|
+
return;
|
|
12605
|
+
}
|
|
12606
|
+
const manifest = await componentManifestGenerator(
|
|
12607
|
+
indexGenerator
|
|
12608
|
+
);
|
|
12609
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
12610
|
+
res.end(renderManifestComponentsPage(manifest));
|
|
12611
|
+
} catch (e) {
|
|
12612
|
+
res.statusCode = 500;
|
|
12613
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
12614
|
+
invariant(e instanceof Error);
|
|
12615
|
+
res.end(`<pre>${e.stack}</pre>`);
|
|
12616
|
+
}
|
|
12617
|
+
});
|
|
12618
|
+
}
|
|
11737
12619
|
doTelemetry(app, core2, initializedStoryIndexGenerator, options);
|
|
11738
12620
|
async function cancelTelemetry() {
|
|
11739
12621
|
const payload = { eventType: "dev" };
|
|
@@ -12059,14 +12941,14 @@ async function warnWhenUsingArgTypesRegex(previewConfigPath, config) {
|
|
|
12059
12941
|
{ code: previewContent, ast: babelParse(previewContent) }
|
|
12060
12942
|
);
|
|
12061
12943
|
file.path.traverse({
|
|
12062
|
-
Identifier: /* @__PURE__ */ __name((
|
|
12063
|
-
if (
|
|
12944
|
+
Identifier: /* @__PURE__ */ __name((path3) => {
|
|
12945
|
+
if (path3.node.name === "argTypesRegex") {
|
|
12064
12946
|
const message = import_ts_dedent7.dedent`
|
|
12065
12947
|
${import_picocolors9.default.bold("Attention")}: We've detected that you're using ${import_picocolors9.default.cyan(
|
|
12066
12948
|
"actions.argTypesRegex"
|
|
12067
12949
|
)} together with the visual test addon:
|
|
12068
12950
|
|
|
12069
|
-
${
|
|
12951
|
+
${path3.buildCodeFrameError(previewConfigPath).message}
|
|
12070
12952
|
|
|
12071
12953
|
We recommend removing the ${import_picocolors9.default.cyan(
|
|
12072
12954
|
"argTypesRegex"
|
|
@@ -12089,7 +12971,7 @@ __name(warnWhenUsingArgTypesRegex, "warnWhenUsingArgTypesRegex");
|
|
|
12089
12971
|
async function buildDevStandalone(options) {
|
|
12090
12972
|
const { packageJson, versionUpdates } = options;
|
|
12091
12973
|
let { storybookVersion, previewConfigPath } = options;
|
|
12092
|
-
const configDir =
|
|
12974
|
+
const configDir = resolve(options.configDir);
|
|
12093
12975
|
if (packageJson) {
|
|
12094
12976
|
invariant(
|
|
12095
12977
|
packageJson.version !== void 0,
|
|
@@ -12117,9 +12999,9 @@ async function buildDevStandalone(options) {
|
|
|
12117
12999
|
process.exit(1);
|
|
12118
13000
|
}
|
|
12119
13001
|
}
|
|
12120
|
-
const cacheKey = oneWayHash(
|
|
13002
|
+
const cacheKey = oneWayHash(relative(getProjectRoot2(), configDir));
|
|
12121
13003
|
const cacheOutputDir = resolvePathInStorybookCache("public", cacheKey);
|
|
12122
|
-
let outputDir =
|
|
13004
|
+
let outputDir = resolve(options.outputDir || cacheOutputDir);
|
|
12123
13005
|
if (options.smokeTest) {
|
|
12124
13006
|
outputDir = cacheOutputDir;
|
|
12125
13007
|
}
|
|
@@ -12147,7 +13029,7 @@ async function buildDevStandalone(options) {
|
|
|
12147
13029
|
validateFrameworkName(frameworkName);
|
|
12148
13030
|
}
|
|
12149
13031
|
if (frameworkName) {
|
|
12150
|
-
corePresets.push(
|
|
13032
|
+
corePresets.push(join(frameworkName, "preset"));
|
|
12151
13033
|
}
|
|
12152
13034
|
frameworkName = frameworkName || "custom";
|
|
12153
13035
|
const packageManager = JsPackageManagerFactory.getPackageManager({
|
|
@@ -12189,7 +13071,7 @@ async function buildDevStandalone(options) {
|
|
|
12189
13071
|
const deprecationMessage = (0, import_ts_dedent8.dedent)(`Using CommonJS in your main configuration file is deprecated with Vite.
|
|
12190
13072
|
- Refer to the migration guide at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#commonjs-with-vite-is-deprecated`);
|
|
12191
13073
|
const mainJsPath = getInterpretedFile(
|
|
12192
|
-
|
|
13074
|
+
resolve(options.configDir || ".storybook", "main")
|
|
12193
13075
|
);
|
|
12194
13076
|
if (/\.c[jt]s$/.test(mainJsPath)) {
|
|
12195
13077
|
deprecate(deprecationMessage);
|
|
@@ -12203,7 +13085,7 @@ async function buildDevStandalone(options) {
|
|
|
12203
13085
|
const resolvedRenderer = renderer && resolveAddonName2(options.configDir, renderer, options);
|
|
12204
13086
|
presets = await loadAllPresets2({
|
|
12205
13087
|
corePresets: [
|
|
12206
|
-
|
|
13088
|
+
join(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
12207
13089
|
...managerBuilder.corePresets || [],
|
|
12208
13090
|
...previewBuilder.corePresets || [],
|
|
12209
13091
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
@@ -12269,12 +13151,11 @@ async function buildDevStandalone(options) {
|
|
|
12269
13151
|
__name(buildDevStandalone, "buildDevStandalone");
|
|
12270
13152
|
|
|
12271
13153
|
// src/core-server/build-index.ts
|
|
12272
|
-
import { writeFile as
|
|
13154
|
+
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
12273
13155
|
import { normalizeStories as normalizeStories3 } from "storybook/internal/common";
|
|
12274
13156
|
import { logger as logger12 } from "storybook/internal/node-logger";
|
|
12275
13157
|
|
|
12276
13158
|
// src/core-server/load.ts
|
|
12277
|
-
import { join as join8, relative as relative6, resolve as resolve6 } from "node:path";
|
|
12278
13159
|
import {
|
|
12279
13160
|
getProjectRoot as getProjectRoot3,
|
|
12280
13161
|
loadAllPresets as loadAllPresets3,
|
|
@@ -12285,8 +13166,8 @@ import {
|
|
|
12285
13166
|
import { oneWayHash as oneWayHash2 } from "storybook/internal/telemetry";
|
|
12286
13167
|
import { global as global4 } from "@storybook/global";
|
|
12287
13168
|
async function loadStorybook(options) {
|
|
12288
|
-
const configDir =
|
|
12289
|
-
const cacheKey = oneWayHash2(
|
|
13169
|
+
const configDir = resolve(options.configDir);
|
|
13170
|
+
const cacheKey = oneWayHash2(relative(getProjectRoot3(), configDir));
|
|
12290
13171
|
options.configType = "DEVELOPMENT";
|
|
12291
13172
|
options.configDir = configDir;
|
|
12292
13173
|
options.cacheKey = cacheKey;
|
|
@@ -12298,7 +13179,7 @@ async function loadStorybook(options) {
|
|
|
12298
13179
|
validateFrameworkName2(frameworkName);
|
|
12299
13180
|
}
|
|
12300
13181
|
if (frameworkName) {
|
|
12301
|
-
corePresets.push(
|
|
13182
|
+
corePresets.push(join(frameworkName, "preset"));
|
|
12302
13183
|
}
|
|
12303
13184
|
frameworkName = frameworkName || "custom";
|
|
12304
13185
|
let presets = await loadAllPresets3({
|
|
@@ -12313,7 +13194,7 @@ async function loadStorybook(options) {
|
|
|
12313
13194
|
const resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options);
|
|
12314
13195
|
presets = await loadAllPresets3({
|
|
12315
13196
|
corePresets: [
|
|
12316
|
-
|
|
13197
|
+
join(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
12317
13198
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
12318
13199
|
...corePresets
|
|
12319
13200
|
],
|
|
@@ -12359,7 +13240,7 @@ var buildIndex = /* @__PURE__ */ __name(async (options) => {
|
|
|
12359
13240
|
var buildIndexStandalone = /* @__PURE__ */ __name(async (options) => {
|
|
12360
13241
|
const index = await buildIndex(options);
|
|
12361
13242
|
logger12.info(`Writing index to ${options.outputFile}`);
|
|
12362
|
-
await
|
|
13243
|
+
await writeFile4(options.outputFile, JSON.stringify(index));
|
|
12363
13244
|
}, "buildIndexStandalone");
|
|
12364
13245
|
|
|
12365
13246
|
// src/core-server/standalone.ts
|