storybook 10.1.0-alpha.1 → 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-6UBDPV7P.js → builder-manager-HA7CYFCK.js} +32 -12
- package/dist/_node-chunks/camelcase-QALD4XFE.js +18 -0
- package/dist/_node-chunks/{chunk-6GD23U64.js → chunk-2XY53ALL.js} +8 -8
- package/dist/_node-chunks/{chunk-VYRFXLRO.js → chunk-3CBQMG2A.js} +7 -7
- package/dist/_node-chunks/{chunk-II4AFH3V.js → chunk-3WDAPZYQ.js} +7 -7
- package/dist/_node-chunks/{chunk-GD2FXWDF.js → chunk-4ZB555EJ.js} +7 -7
- package/dist/_node-chunks/{chunk-BCDHUXAJ.js → chunk-52DXKXY3.js} +8 -8
- package/dist/_node-chunks/{chunk-TUFWZUTO.js → chunk-5OVB4A6F.js} +7 -7
- package/dist/_node-chunks/chunk-AGHGNXGH.js +18 -0
- package/dist/_node-chunks/{chunk-4GE6Q4MX.js → chunk-B23X5ZCK.js} +7 -7
- package/dist/_node-chunks/{chunk-BYVQZ2HU.js → chunk-B2DAHWJK.js} +7 -7
- package/dist/_node-chunks/{chunk-WNOSTIYP.js → chunk-CC4PW5MJ.js} +7 -7
- package/dist/_node-chunks/{chunk-FY7XZPLY.js → chunk-D7NIZELR.js} +67 -59
- package/dist/_node-chunks/{chunk-X67VGZN4.js → chunk-DO5Q3H4L.js} +7 -7
- package/dist/_node-chunks/{chunk-2RIKHYCS.js → chunk-ECK7WVFX.js} +12 -12
- package/dist/_node-chunks/{chunk-TXHNWNH4.js → chunk-EUH3NHXA.js} +7 -7
- package/dist/_node-chunks/{chunk-LAU7VVPC.js → chunk-F3XOPI6H.js} +7 -7
- package/dist/_node-chunks/{chunk-3JCSHYSU.js → chunk-FOQHPHCV.js} +7 -7
- package/dist/_node-chunks/{chunk-XW7YMR7I.js → chunk-G6EL47NS.js} +7 -7
- package/dist/_node-chunks/{chunk-HORWITP7.js → chunk-GFLS4TJB.js} +7 -7
- package/dist/_node-chunks/{chunk-FEOC7OX2.js → chunk-J3XZKWHE.js} +8 -8
- package/dist/_node-chunks/{chunk-RVE4UTVQ.js → chunk-LE63EHJ5.js} +12 -12
- package/dist/_node-chunks/{chunk-7TNUMFKR.js → chunk-M47XA42S.js} +9 -9
- package/dist/_node-chunks/{chunk-XCEBYOA4.js → chunk-OOI74AL3.js} +6 -6
- package/dist/_node-chunks/{chunk-CJHAP7SE.js → chunk-OVXB5GGT.js} +7 -7
- package/dist/_node-chunks/chunk-PRJHT3GJ.js +61 -0
- package/dist/_node-chunks/{chunk-DAMVKHAC.js → chunk-Q52PVUSU.js} +7 -7
- package/dist/_node-chunks/{chunk-J7N7PD5Q.js → chunk-RMHAL25C.js} +9 -9
- package/dist/_node-chunks/{chunk-ULWNTI6M.js → chunk-SDCF5RNN.js} +15 -15
- package/dist/_node-chunks/{chunk-MF2PUEWG.js → chunk-UJ5SJ23M.js} +7 -7
- package/dist/_node-chunks/{chunk-5SEHHENC.js → chunk-UPHK4ETU.js} +19 -17
- package/dist/_node-chunks/{chunk-6OAXYS5T.js → chunk-V7VURIPB.js} +8 -8
- package/dist/_node-chunks/{chunk-3FPF5Y2F.js → chunk-VPR5IBMG.js} +6 -6
- package/dist/_node-chunks/{chunk-QNUGJO6L.js → chunk-X4XU27M6.js} +7 -7
- package/dist/_node-chunks/{chunk-SCTKVDWR.js → chunk-ZHSCUGNP.js} +1467 -148
- package/dist/_node-chunks/{dist-APCKHSY3.js → dist-6TXHNR5C.js} +9 -9
- package/dist/_node-chunks/{globby-TSGXGDA2.js → globby-PBTV6PX6.js} +9 -9
- package/dist/_node-chunks/{lib-DZ5TVIU5.js → lib-4RTDZVGX.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-Z6BYQCPN.js → mdx-N42X6CFJ-COWEH7KR.js} +8 -8
- package/dist/_node-chunks/{p-limit-MLJNGG2K.js → p-limit-PBVZQOFY.js} +7 -7
- package/dist/_node-chunks/{plugin-HJLCLGNT.js → plugin-6ZPCS4LI.js} +10 -10
- package/dist/_node-chunks/{plugin-J3JI3ZKJ.js → plugin-EOZKYZAG.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-3QHNTM5B.js → webpack-inject-mocker-runtime-plugin-35HMSMR5.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-4Y3MWPJ6.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 +1070 -188
- 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 +23 -23
- 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.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-WKJOVNPM.js +0 -18
- package/dist/_node-chunks/chunk-HM6B7FE5.js +0 -18
- package/dist/_node-chunks/chunk-ZRFYQ46H.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,61 +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 {
|
|
62
64
|
join,
|
|
63
65
|
relative,
|
|
64
66
|
resolve
|
|
65
|
-
} from "../_node-chunks/chunk-
|
|
67
|
+
} from "../_node-chunks/chunk-B2DAHWJK.js";
|
|
66
68
|
import {
|
|
67
69
|
require_prompts
|
|
68
|
-
} from "../_node-chunks/chunk-
|
|
69
|
-
import "../_node-chunks/chunk-
|
|
70
|
+
} from "../_node-chunks/chunk-UJ5SJ23M.js";
|
|
71
|
+
import "../_node-chunks/chunk-3CBQMG2A.js";
|
|
70
72
|
import {
|
|
71
73
|
slash
|
|
72
|
-
} from "../_node-chunks/chunk-
|
|
74
|
+
} from "../_node-chunks/chunk-3WDAPZYQ.js";
|
|
73
75
|
import {
|
|
74
76
|
require_dist
|
|
75
|
-
} from "../_node-chunks/chunk-
|
|
77
|
+
} from "../_node-chunks/chunk-5OVB4A6F.js";
|
|
76
78
|
import {
|
|
77
79
|
require_lib,
|
|
78
80
|
require_src
|
|
79
|
-
} from "../_node-chunks/chunk-
|
|
81
|
+
} from "../_node-chunks/chunk-F3XOPI6H.js";
|
|
80
82
|
import {
|
|
81
83
|
require_picocolors
|
|
82
|
-
} from "../_node-chunks/chunk-
|
|
84
|
+
} from "../_node-chunks/chunk-X4XU27M6.js";
|
|
83
85
|
import {
|
|
84
86
|
__commonJS,
|
|
85
87
|
__name,
|
|
86
88
|
__require,
|
|
87
89
|
__toESM
|
|
88
|
-
} from "../_node-chunks/chunk-
|
|
90
|
+
} from "../_node-chunks/chunk-OOI74AL3.js";
|
|
89
91
|
|
|
90
92
|
// ../node_modules/tsconfig-paths/lib/filesystem.js
|
|
91
93
|
var require_filesystem = __commonJS({
|
|
@@ -94,12 +96,12 @@ var require_filesystem = __commonJS({
|
|
|
94
96
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95
97
|
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
96
98
|
var fs6 = __require("fs");
|
|
97
|
-
function fileExistsSync(
|
|
98
|
-
if (!fs6.existsSync(
|
|
99
|
+
function fileExistsSync(path3) {
|
|
100
|
+
if (!fs6.existsSync(path3)) {
|
|
99
101
|
return false;
|
|
100
102
|
}
|
|
101
103
|
try {
|
|
102
|
-
var stats = fs6.statSync(
|
|
104
|
+
var stats = fs6.statSync(path3);
|
|
103
105
|
return stats.isFile();
|
|
104
106
|
} catch (err) {
|
|
105
107
|
return false;
|
|
@@ -115,8 +117,8 @@ var require_filesystem = __commonJS({
|
|
|
115
117
|
}
|
|
116
118
|
__name(readJsonFromDiskSync, "readJsonFromDiskSync");
|
|
117
119
|
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
118
|
-
function readJsonFromDiskAsync(
|
|
119
|
-
fs6.readFile(
|
|
120
|
+
function readJsonFromDiskAsync(path3, callback) {
|
|
121
|
+
fs6.readFile(path3, "utf8", function(err, result) {
|
|
120
122
|
if (err || !result) {
|
|
121
123
|
return callback();
|
|
122
124
|
}
|
|
@@ -126,8 +128,8 @@ var require_filesystem = __commonJS({
|
|
|
126
128
|
}
|
|
127
129
|
__name(readJsonFromDiskAsync, "readJsonFromDiskAsync");
|
|
128
130
|
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
129
|
-
function fileExistsAsync(
|
|
130
|
-
fs6.stat(
|
|
131
|
+
function fileExistsAsync(path22, callback2) {
|
|
132
|
+
fs6.stat(path22, function(err, stats) {
|
|
131
133
|
if (err) {
|
|
132
134
|
return callback2(void 0, false);
|
|
133
135
|
}
|
|
@@ -136,8 +138,8 @@ var require_filesystem = __commonJS({
|
|
|
136
138
|
}
|
|
137
139
|
__name(fileExistsAsync, "fileExistsAsync");
|
|
138
140
|
exports.fileExistsAsync = fileExistsAsync;
|
|
139
|
-
function removeExtension(
|
|
140
|
-
return
|
|
141
|
+
function removeExtension(path3) {
|
|
142
|
+
return path3.substring(0, path3.lastIndexOf(".")) || path3;
|
|
141
143
|
}
|
|
142
144
|
__name(removeExtension, "removeExtension");
|
|
143
145
|
exports.removeExtension = removeExtension;
|
|
@@ -150,7 +152,7 @@ var require_mapping_entry = __commonJS({
|
|
|
150
152
|
"use strict";
|
|
151
153
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
152
154
|
exports.getAbsoluteMappingEntries = void 0;
|
|
153
|
-
var
|
|
155
|
+
var path3 = __require("path");
|
|
154
156
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
155
157
|
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
156
158
|
var absolutePaths = [];
|
|
@@ -159,7 +161,7 @@ var require_mapping_entry = __commonJS({
|
|
|
159
161
|
absolutePaths.push({
|
|
160
162
|
pattern: key,
|
|
161
163
|
paths: paths[key].map(function(pathToResolve) {
|
|
162
|
-
return
|
|
164
|
+
return path3.resolve(absoluteBaseUrl, pathToResolve);
|
|
163
165
|
})
|
|
164
166
|
});
|
|
165
167
|
}
|
|
@@ -193,7 +195,7 @@ var require_try_path = __commonJS({
|
|
|
193
195
|
"use strict";
|
|
194
196
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195
197
|
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
196
|
-
var
|
|
198
|
+
var path3 = __require("path");
|
|
197
199
|
var path_1 = __require("path");
|
|
198
200
|
var filesystem_1 = require_filesystem();
|
|
199
201
|
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
@@ -213,9 +215,9 @@ var require_try_path = __commonJS({
|
|
|
213
215
|
}));
|
|
214
216
|
pathsToTry.push({
|
|
215
217
|
type: "package",
|
|
216
|
-
path:
|
|
218
|
+
path: path3.join(physicalPath, "/package.json")
|
|
217
219
|
});
|
|
218
|
-
var indexPath =
|
|
220
|
+
var indexPath = path3.join(physicalPath, "/index");
|
|
219
221
|
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
220
222
|
return { type: "index", path: indexPath + e };
|
|
221
223
|
}));
|
|
@@ -271,7 +273,7 @@ var require_match_path_sync = __commonJS({
|
|
|
271
273
|
"use strict";
|
|
272
274
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
273
275
|
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
274
|
-
var
|
|
276
|
+
var path3 = __require("path");
|
|
275
277
|
var Filesystem = require_filesystem();
|
|
276
278
|
var MappingEntry = require_mapping_entry();
|
|
277
279
|
var TryPath = require_try_path();
|
|
@@ -317,7 +319,7 @@ var require_match_path_sync = __commonJS({
|
|
|
317
319
|
return obj[key];
|
|
318
320
|
}, packageJson);
|
|
319
321
|
if (candidateMapping && typeof candidateMapping === "string") {
|
|
320
|
-
var candidateFilePath =
|
|
322
|
+
var candidateFilePath = path3.join(path3.dirname(packageJsonPath), candidateMapping);
|
|
321
323
|
if (fileExists2(candidateFilePath)) {
|
|
322
324
|
return candidateFilePath;
|
|
323
325
|
}
|
|
@@ -363,7 +365,7 @@ var require_match_path_async = __commonJS({
|
|
|
363
365
|
"use strict";
|
|
364
366
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
365
367
|
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
366
|
-
var
|
|
368
|
+
var path3 = __require("path");
|
|
367
369
|
var TryPath = require_try_path();
|
|
368
370
|
var MappingEntry = require_mapping_entry();
|
|
369
371
|
var Filesystem = require_filesystem();
|
|
@@ -419,7 +421,7 @@ var require_match_path_async = __commonJS({
|
|
|
419
421
|
if (typeof mainFieldMapping !== "string") {
|
|
420
422
|
return tryNext();
|
|
421
423
|
}
|
|
422
|
-
var mappedFilePath =
|
|
424
|
+
var mappedFilePath = path3.join(path3.dirname(packageJsonPath), mainFieldMapping);
|
|
423
425
|
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
424
426
|
if (err) {
|
|
425
427
|
return doneCallback(err);
|
|
@@ -511,7 +513,7 @@ var require_tsconfig_loader = __commonJS({
|
|
|
511
513
|
};
|
|
512
514
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
513
515
|
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
514
|
-
var
|
|
516
|
+
var path3 = __require("path");
|
|
515
517
|
var fs6 = __require("fs");
|
|
516
518
|
var JSON5 = require_lib();
|
|
517
519
|
var StripBom = require_strip_bom();
|
|
@@ -543,14 +545,14 @@ var require_tsconfig_loader = __commonJS({
|
|
|
543
545
|
__name(loadSyncDefault, "loadSyncDefault");
|
|
544
546
|
function resolveConfigPath(cwd, filename) {
|
|
545
547
|
if (filename) {
|
|
546
|
-
var absolutePath = fs6.lstatSync(filename).isDirectory() ?
|
|
548
|
+
var absolutePath = fs6.lstatSync(filename).isDirectory() ? path3.resolve(filename, "./tsconfig.json") : path3.resolve(cwd, filename);
|
|
547
549
|
return absolutePath;
|
|
548
550
|
}
|
|
549
551
|
if (fs6.statSync(cwd).isFile()) {
|
|
550
|
-
return
|
|
552
|
+
return path3.resolve(cwd);
|
|
551
553
|
}
|
|
552
554
|
var configAbsolutePath = walkForTsConfig(cwd);
|
|
553
|
-
return configAbsolutePath ?
|
|
555
|
+
return configAbsolutePath ? path3.resolve(configAbsolutePath) : void 0;
|
|
554
556
|
}
|
|
555
557
|
__name(resolveConfigPath, "resolveConfigPath");
|
|
556
558
|
function walkForTsConfig(directory, readdirSync2) {
|
|
@@ -562,10 +564,10 @@ var require_tsconfig_loader = __commonJS({
|
|
|
562
564
|
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
563
565
|
var fileToCheck = filesToCheck_1[_i];
|
|
564
566
|
if (files.indexOf(fileToCheck) !== -1) {
|
|
565
|
-
return
|
|
567
|
+
return path3.join(directory, fileToCheck);
|
|
566
568
|
}
|
|
567
569
|
}
|
|
568
|
-
var parentDirectory =
|
|
570
|
+
var parentDirectory = path3.dirname(directory);
|
|
569
571
|
if (directory === parentDirectory) {
|
|
570
572
|
return void 0;
|
|
571
573
|
}
|
|
@@ -614,15 +616,15 @@ var require_tsconfig_loader = __commonJS({
|
|
|
614
616
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
615
617
|
extendedConfigValue += ".json";
|
|
616
618
|
}
|
|
617
|
-
var currentDir =
|
|
618
|
-
var extendedConfigPath =
|
|
619
|
+
var currentDir = path3.dirname(configFilePath);
|
|
620
|
+
var extendedConfigPath = path3.join(currentDir, extendedConfigValue);
|
|
619
621
|
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath)) {
|
|
620
|
-
extendedConfigPath =
|
|
622
|
+
extendedConfigPath = path3.join(currentDir, "node_modules", extendedConfigValue);
|
|
621
623
|
}
|
|
622
624
|
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync) || {};
|
|
623
625
|
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
624
|
-
var extendsDir =
|
|
625
|
-
config.compilerOptions.baseUrl =
|
|
626
|
+
var extendsDir = path3.dirname(extendedConfigValue);
|
|
627
|
+
config.compilerOptions.baseUrl = path3.join(extendsDir, config.compilerOptions.baseUrl);
|
|
626
628
|
}
|
|
627
629
|
return config;
|
|
628
630
|
}
|
|
@@ -643,7 +645,7 @@ var require_config_loader = __commonJS({
|
|
|
643
645
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
644
646
|
exports.configLoader = exports.loadConfig = void 0;
|
|
645
647
|
var TsConfigLoader2 = require_tsconfig_loader();
|
|
646
|
-
var
|
|
648
|
+
var path3 = __require("path");
|
|
647
649
|
function loadConfig3(cwd) {
|
|
648
650
|
if (cwd === void 0) {
|
|
649
651
|
cwd = process.cwd();
|
|
@@ -655,7 +657,7 @@ var require_config_loader = __commonJS({
|
|
|
655
657
|
function configLoader(_a) {
|
|
656
658
|
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
657
659
|
if (explicitParams) {
|
|
658
|
-
var absoluteBaseUrl =
|
|
660
|
+
var absoluteBaseUrl = path3.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path3.join(cwd, explicitParams.baseUrl);
|
|
659
661
|
return {
|
|
660
662
|
resultType: "success",
|
|
661
663
|
configFileAbsolutePath: "",
|
|
@@ -682,7 +684,7 @@ var require_config_loader = __commonJS({
|
|
|
682
684
|
resultType: "success",
|
|
683
685
|
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
684
686
|
baseUrl: loadResult.baseUrl,
|
|
685
|
-
absoluteBaseUrl:
|
|
687
|
+
absoluteBaseUrl: path3.resolve(path3.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
686
688
|
paths: loadResult.paths || {},
|
|
687
689
|
addMatchAll: loadResult.baseUrl !== void 0
|
|
688
690
|
};
|
|
@@ -2150,14 +2152,14 @@ var require_polyfills = __commonJS({
|
|
|
2150
2152
|
fs6.fstatSync = statFixSync(fs6.fstatSync);
|
|
2151
2153
|
fs6.lstatSync = statFixSync(fs6.lstatSync);
|
|
2152
2154
|
if (fs6.chmod && !fs6.lchmod) {
|
|
2153
|
-
fs6.lchmod = function(
|
|
2155
|
+
fs6.lchmod = function(path3, mode, cb) {
|
|
2154
2156
|
if (cb) process.nextTick(cb);
|
|
2155
2157
|
};
|
|
2156
2158
|
fs6.lchmodSync = function() {
|
|
2157
2159
|
};
|
|
2158
2160
|
}
|
|
2159
2161
|
if (fs6.chown && !fs6.lchown) {
|
|
2160
|
-
fs6.lchown = function(
|
|
2162
|
+
fs6.lchown = function(path3, uid, gid, cb) {
|
|
2161
2163
|
if (cb) process.nextTick(cb);
|
|
2162
2164
|
};
|
|
2163
2165
|
fs6.lchownSync = function() {
|
|
@@ -2226,9 +2228,9 @@ var require_polyfills = __commonJS({
|
|
|
2226
2228
|
};
|
|
2227
2229
|
}(fs6.readSync);
|
|
2228
2230
|
function patchLchmod(fs7) {
|
|
2229
|
-
fs7.lchmod = function(
|
|
2231
|
+
fs7.lchmod = function(path3, mode, callback) {
|
|
2230
2232
|
fs7.open(
|
|
2231
|
-
|
|
2233
|
+
path3,
|
|
2232
2234
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
2233
2235
|
mode,
|
|
2234
2236
|
function(err, fd) {
|
|
@@ -2244,8 +2246,8 @@ var require_polyfills = __commonJS({
|
|
|
2244
2246
|
}
|
|
2245
2247
|
);
|
|
2246
2248
|
};
|
|
2247
|
-
fs7.lchmodSync = function(
|
|
2248
|
-
var fd = fs7.openSync(
|
|
2249
|
+
fs7.lchmodSync = function(path3, mode) {
|
|
2250
|
+
var fd = fs7.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
2249
2251
|
var threw = true;
|
|
2250
2252
|
var ret;
|
|
2251
2253
|
try {
|
|
@@ -2267,8 +2269,8 @@ var require_polyfills = __commonJS({
|
|
|
2267
2269
|
__name(patchLchmod, "patchLchmod");
|
|
2268
2270
|
function patchLutimes(fs7) {
|
|
2269
2271
|
if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
|
|
2270
|
-
fs7.lutimes = function(
|
|
2271
|
-
fs7.open(
|
|
2272
|
+
fs7.lutimes = function(path3, at, mt, cb) {
|
|
2273
|
+
fs7.open(path3, constants.O_SYMLINK, function(er, fd) {
|
|
2272
2274
|
if (er) {
|
|
2273
2275
|
if (cb) cb(er);
|
|
2274
2276
|
return;
|
|
@@ -2280,8 +2282,8 @@ var require_polyfills = __commonJS({
|
|
|
2280
2282
|
});
|
|
2281
2283
|
});
|
|
2282
2284
|
};
|
|
2283
|
-
fs7.lutimesSync = function(
|
|
2284
|
-
var fd = fs7.openSync(
|
|
2285
|
+
fs7.lutimesSync = function(path3, at, mt) {
|
|
2286
|
+
var fd = fs7.openSync(path3, constants.O_SYMLINK);
|
|
2285
2287
|
var ret;
|
|
2286
2288
|
var threw = true;
|
|
2287
2289
|
try {
|
|
@@ -2409,11 +2411,11 @@ var require_legacy_streams = __commonJS({
|
|
|
2409
2411
|
ReadStream,
|
|
2410
2412
|
WriteStream
|
|
2411
2413
|
};
|
|
2412
|
-
function ReadStream(
|
|
2413
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
2414
|
+
function ReadStream(path3, options) {
|
|
2415
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path3, options);
|
|
2414
2416
|
Stream.call(this);
|
|
2415
2417
|
var self2 = this;
|
|
2416
|
-
this.path =
|
|
2418
|
+
this.path = path3;
|
|
2417
2419
|
this.fd = null;
|
|
2418
2420
|
this.readable = true;
|
|
2419
2421
|
this.paused = false;
|
|
@@ -2459,10 +2461,10 @@ var require_legacy_streams = __commonJS({
|
|
|
2459
2461
|
});
|
|
2460
2462
|
}
|
|
2461
2463
|
__name(ReadStream, "ReadStream");
|
|
2462
|
-
function WriteStream(
|
|
2463
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
2464
|
+
function WriteStream(path3, options) {
|
|
2465
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path3, options);
|
|
2464
2466
|
Stream.call(this);
|
|
2465
|
-
this.path =
|
|
2467
|
+
this.path = path3;
|
|
2466
2468
|
this.fd = null;
|
|
2467
2469
|
this.writable = true;
|
|
2468
2470
|
this.flags = "w";
|
|
@@ -2612,14 +2614,14 @@ var require_graceful_fs = __commonJS({
|
|
|
2612
2614
|
fs7.createWriteStream = createWriteStream2;
|
|
2613
2615
|
var fs$readFile = fs7.readFile;
|
|
2614
2616
|
fs7.readFile = readFile5;
|
|
2615
|
-
function readFile5(
|
|
2617
|
+
function readFile5(path3, options, cb) {
|
|
2616
2618
|
if (typeof options === "function")
|
|
2617
2619
|
cb = options, options = null;
|
|
2618
|
-
return go$readFile(
|
|
2619
|
-
function go$readFile(
|
|
2620
|
-
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) {
|
|
2621
2623
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2622
|
-
enqueue([go$readFile, [
|
|
2624
|
+
enqueue([go$readFile, [path4, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2623
2625
|
else {
|
|
2624
2626
|
if (typeof cb2 === "function")
|
|
2625
2627
|
cb2.apply(this, arguments);
|
|
@@ -2630,15 +2632,15 @@ var require_graceful_fs = __commonJS({
|
|
|
2630
2632
|
}
|
|
2631
2633
|
__name(readFile5, "readFile");
|
|
2632
2634
|
var fs$writeFile = fs7.writeFile;
|
|
2633
|
-
fs7.writeFile =
|
|
2634
|
-
function
|
|
2635
|
+
fs7.writeFile = writeFile5;
|
|
2636
|
+
function writeFile5(path3, data, options, cb) {
|
|
2635
2637
|
if (typeof options === "function")
|
|
2636
2638
|
cb = options, options = null;
|
|
2637
|
-
return go$writeFile(
|
|
2638
|
-
function go$writeFile(
|
|
2639
|
-
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) {
|
|
2640
2642
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2641
|
-
enqueue([go$writeFile, [
|
|
2643
|
+
enqueue([go$writeFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2642
2644
|
else {
|
|
2643
2645
|
if (typeof cb2 === "function")
|
|
2644
2646
|
cb2.apply(this, arguments);
|
|
@@ -2647,18 +2649,18 @@ var require_graceful_fs = __commonJS({
|
|
|
2647
2649
|
}
|
|
2648
2650
|
__name(go$writeFile, "go$writeFile");
|
|
2649
2651
|
}
|
|
2650
|
-
__name(
|
|
2652
|
+
__name(writeFile5, "writeFile");
|
|
2651
2653
|
var fs$appendFile = fs7.appendFile;
|
|
2652
2654
|
if (fs$appendFile)
|
|
2653
2655
|
fs7.appendFile = appendFile;
|
|
2654
|
-
function appendFile(
|
|
2656
|
+
function appendFile(path3, data, options, cb) {
|
|
2655
2657
|
if (typeof options === "function")
|
|
2656
2658
|
cb = options, options = null;
|
|
2657
|
-
return go$appendFile(
|
|
2658
|
-
function go$appendFile(
|
|
2659
|
-
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) {
|
|
2660
2662
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2661
|
-
enqueue([go$appendFile, [
|
|
2663
|
+
enqueue([go$appendFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2662
2664
|
else {
|
|
2663
2665
|
if (typeof cb2 === "function")
|
|
2664
2666
|
cb2.apply(this, arguments);
|
|
@@ -2693,31 +2695,31 @@ var require_graceful_fs = __commonJS({
|
|
|
2693
2695
|
var fs$readdir = fs7.readdir;
|
|
2694
2696
|
fs7.readdir = readdir;
|
|
2695
2697
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
2696
|
-
function readdir(
|
|
2698
|
+
function readdir(path3, options, cb) {
|
|
2697
2699
|
if (typeof options === "function")
|
|
2698
2700
|
cb = options, options = null;
|
|
2699
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(
|
|
2700
|
-
return fs$readdir(
|
|
2701
|
-
|
|
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,
|
|
2702
2704
|
options2,
|
|
2703
2705
|
cb2,
|
|
2704
2706
|
startTime
|
|
2705
2707
|
));
|
|
2706
|
-
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(
|
|
2707
|
-
return fs$readdir(
|
|
2708
|
-
|
|
2708
|
+
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(path4, options2, cb2, startTime) {
|
|
2709
|
+
return fs$readdir(path4, options2, fs$readdirCallback(
|
|
2710
|
+
path4,
|
|
2709
2711
|
options2,
|
|
2710
2712
|
cb2,
|
|
2711
2713
|
startTime
|
|
2712
2714
|
));
|
|
2713
2715
|
}, "go$readdir");
|
|
2714
|
-
return go$readdir(
|
|
2715
|
-
function fs$readdirCallback(
|
|
2716
|
+
return go$readdir(path3, options, cb);
|
|
2717
|
+
function fs$readdirCallback(path4, options2, cb2, startTime) {
|
|
2716
2718
|
return function(err, files) {
|
|
2717
2719
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2718
2720
|
enqueue([
|
|
2719
2721
|
go$readdir,
|
|
2720
|
-
[
|
|
2722
|
+
[path4, options2, cb2],
|
|
2721
2723
|
err,
|
|
2722
2724
|
startTime || Date.now(),
|
|
2723
2725
|
Date.now()
|
|
@@ -2790,7 +2792,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2790
2792
|
enumerable: true,
|
|
2791
2793
|
configurable: true
|
|
2792
2794
|
});
|
|
2793
|
-
function ReadStream(
|
|
2795
|
+
function ReadStream(path3, options) {
|
|
2794
2796
|
if (this instanceof ReadStream)
|
|
2795
2797
|
return fs$ReadStream.apply(this, arguments), this;
|
|
2796
2798
|
else
|
|
@@ -2812,7 +2814,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2812
2814
|
});
|
|
2813
2815
|
}
|
|
2814
2816
|
__name(ReadStream$open, "ReadStream$open");
|
|
2815
|
-
function WriteStream(
|
|
2817
|
+
function WriteStream(path3, options) {
|
|
2816
2818
|
if (this instanceof WriteStream)
|
|
2817
2819
|
return fs$WriteStream.apply(this, arguments), this;
|
|
2818
2820
|
else
|
|
@@ -2832,24 +2834,24 @@ var require_graceful_fs = __commonJS({
|
|
|
2832
2834
|
});
|
|
2833
2835
|
}
|
|
2834
2836
|
__name(WriteStream$open, "WriteStream$open");
|
|
2835
|
-
function createReadStream(
|
|
2836
|
-
return new fs7.ReadStream(
|
|
2837
|
+
function createReadStream(path3, options) {
|
|
2838
|
+
return new fs7.ReadStream(path3, options);
|
|
2837
2839
|
}
|
|
2838
2840
|
__name(createReadStream, "createReadStream");
|
|
2839
|
-
function createWriteStream2(
|
|
2840
|
-
return new fs7.WriteStream(
|
|
2841
|
+
function createWriteStream2(path3, options) {
|
|
2842
|
+
return new fs7.WriteStream(path3, options);
|
|
2841
2843
|
}
|
|
2842
2844
|
__name(createWriteStream2, "createWriteStream");
|
|
2843
2845
|
var fs$open = fs7.open;
|
|
2844
2846
|
fs7.open = open2;
|
|
2845
|
-
function open2(
|
|
2847
|
+
function open2(path3, flags, mode, cb) {
|
|
2846
2848
|
if (typeof mode === "function")
|
|
2847
2849
|
cb = mode, mode = null;
|
|
2848
|
-
return go$open(
|
|
2849
|
-
function go$open(
|
|
2850
|
-
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) {
|
|
2851
2853
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2852
|
-
enqueue([go$open, [
|
|
2854
|
+
enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2853
2855
|
else {
|
|
2854
2856
|
if (typeof cb2 === "function")
|
|
2855
2857
|
cb2.apply(this, arguments);
|
|
@@ -2922,7 +2924,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2922
2924
|
var require_reducePlan = __commonJS({
|
|
2923
2925
|
"../node_modules/watchpack/lib/reducePlan.js"(exports, module) {
|
|
2924
2926
|
"use strict";
|
|
2925
|
-
var
|
|
2927
|
+
var path3 = __require("path");
|
|
2926
2928
|
module.exports = (plan, limit) => {
|
|
2927
2929
|
const treeMap = /* @__PURE__ */ new Map();
|
|
2928
2930
|
for (const [filePath, value] of plan) {
|
|
@@ -2937,7 +2939,7 @@ var require_reducePlan = __commonJS({
|
|
|
2937
2939
|
}
|
|
2938
2940
|
let currentCount = treeMap.size;
|
|
2939
2941
|
for (const node of treeMap.values()) {
|
|
2940
|
-
const parentPath =
|
|
2942
|
+
const parentPath = path3.dirname(node.filePath);
|
|
2941
2943
|
if (parentPath !== node.filePath) {
|
|
2942
2944
|
let parent = treeMap.get(parentPath);
|
|
2943
2945
|
if (parent === void 0) {
|
|
@@ -3032,7 +3034,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3032
3034
|
"../node_modules/watchpack/lib/watchEventSource.js"(exports) {
|
|
3033
3035
|
"use strict";
|
|
3034
3036
|
var fs6 = __require("fs");
|
|
3035
|
-
var
|
|
3037
|
+
var path3 = __require("path");
|
|
3036
3038
|
var { EventEmitter } = __require("events");
|
|
3037
3039
|
var reducePlan = require_reducePlan();
|
|
3038
3040
|
var IS_OSX = __require("os").platform() === "darwin";
|
|
@@ -3054,7 +3056,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3054
3056
|
__name(createEPERMError, "createEPERMError");
|
|
3055
3057
|
function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {
|
|
3056
3058
|
return (type, filename) => {
|
|
3057
|
-
if (type === "rename" &&
|
|
3059
|
+
if (type === "rename" && path3.isAbsolute(filename) && path3.basename(filename) === path3.basename(filePath)) {
|
|
3058
3060
|
if (!IS_OSX) {
|
|
3059
3061
|
watcher.emit("error", createEPERMError(filename));
|
|
3060
3062
|
}
|
|
@@ -3141,7 +3143,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3141
3143
|
w.emit("change", type);
|
|
3142
3144
|
}
|
|
3143
3145
|
} else {
|
|
3144
|
-
const dir =
|
|
3146
|
+
const dir = path3.dirname(filename);
|
|
3145
3147
|
const watchers = this.mapPathToWatchers.get(dir);
|
|
3146
3148
|
if (recursiveWatcherLogging) {
|
|
3147
3149
|
process.stderr.write(
|
|
@@ -3151,7 +3153,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3151
3153
|
}
|
|
3152
3154
|
if (watchers === void 0) return;
|
|
3153
3155
|
for (const w of watchers) {
|
|
3154
|
-
w.emit("change", type,
|
|
3156
|
+
w.emit("change", type, path3.basename(filename));
|
|
3155
3157
|
}
|
|
3156
3158
|
}
|
|
3157
3159
|
});
|
|
@@ -3270,7 +3272,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3270
3272
|
}
|
|
3271
3273
|
for (const watcher of recursiveWatchers.values()) {
|
|
3272
3274
|
for (const [w, subpath] of watcher.getWatchers()) {
|
|
3273
|
-
addWatcher(w,
|
|
3275
|
+
addWatcher(w, path3.join(watcher.rootPath, subpath));
|
|
3274
3276
|
}
|
|
3275
3277
|
}
|
|
3276
3278
|
for (const watcher of directWatchers.values()) {
|
|
@@ -3326,7 +3328,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3326
3328
|
recursiveWatcher.add(filePath, watcher);
|
|
3327
3329
|
return watcher;
|
|
3328
3330
|
}
|
|
3329
|
-
const parent =
|
|
3331
|
+
const parent = path3.dirname(current);
|
|
3330
3332
|
if (parent === current) break;
|
|
3331
3333
|
current = parent;
|
|
3332
3334
|
}
|
|
@@ -3357,7 +3359,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3357
3359
|
"use strict";
|
|
3358
3360
|
var EventEmitter = __require("events").EventEmitter;
|
|
3359
3361
|
var fs6 = require_graceful_fs();
|
|
3360
|
-
var
|
|
3362
|
+
var path3 = __require("path");
|
|
3361
3363
|
var watchEventSource = require_watchEventSource();
|
|
3362
3364
|
var EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
|
|
3363
3365
|
var FS_ACCURACY = 2e3;
|
|
@@ -3453,8 +3455,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3453
3455
|
this.onWatcherError(err);
|
|
3454
3456
|
}
|
|
3455
3457
|
}
|
|
3456
|
-
forEachWatcher(
|
|
3457
|
-
const watchers = this.watchers.get(withoutCase(
|
|
3458
|
+
forEachWatcher(path4, fn) {
|
|
3459
|
+
const watchers = this.watchers.get(withoutCase(path4));
|
|
3458
3460
|
if (watchers !== void 0) {
|
|
3459
3461
|
for (const w of watchers) {
|
|
3460
3462
|
fn(w);
|
|
@@ -3682,7 +3684,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3682
3684
|
this.doScan(false);
|
|
3683
3685
|
return;
|
|
3684
3686
|
}
|
|
3685
|
-
const filePath =
|
|
3687
|
+
const filePath = path3.join(this.path, filename);
|
|
3686
3688
|
if (this.ignored(filePath)) return;
|
|
3687
3689
|
if (this._activeEvents.get(filename) === void 0) {
|
|
3688
3690
|
this._activeEvents.set(filename, false);
|
|
@@ -3700,7 +3702,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3700
3702
|
if (err.code !== "ENOENT" && err.code !== "EPERM" && err.code !== "EBUSY") {
|
|
3701
3703
|
this.onStatsError(err);
|
|
3702
3704
|
} else {
|
|
3703
|
-
if (filename ===
|
|
3705
|
+
if (filename === path3.basename(this.path)) {
|
|
3704
3706
|
if (!fs6.existsSync(this.path)) {
|
|
3705
3707
|
this.onDirectoryRemoved("stat failed");
|
|
3706
3708
|
}
|
|
@@ -3780,8 +3782,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3780
3782
|
}
|
|
3781
3783
|
watchInParentDirectory() {
|
|
3782
3784
|
if (!this.parentWatcher) {
|
|
3783
|
-
const parentDir =
|
|
3784
|
-
if (
|
|
3785
|
+
const parentDir = path3.dirname(this.path);
|
|
3786
|
+
if (path3.dirname(parentDir) === parentDir) return;
|
|
3785
3787
|
this.parentWatcher = this.watcherManager.watchFile(this.path, 1);
|
|
3786
3788
|
this.parentWatcher.on("change", (mtime, type) => {
|
|
3787
3789
|
if (this.closed) return;
|
|
@@ -3851,7 +3853,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3851
3853
|
return;
|
|
3852
3854
|
}
|
|
3853
3855
|
const itemPaths = new Set(
|
|
3854
|
-
items.map((item) =>
|
|
3856
|
+
items.map((item) => path3.join(this.path, item.normalize("NFC")))
|
|
3855
3857
|
);
|
|
3856
3858
|
for (const file of this.files.keys()) {
|
|
3857
3859
|
if (!itemPaths.has(file)) {
|
|
@@ -3960,9 +3962,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3960
3962
|
if (!this.initialScan) {
|
|
3961
3963
|
for (const watchers of this.watchers.values()) {
|
|
3962
3964
|
for (const watcher of watchers) {
|
|
3963
|
-
const
|
|
3964
|
-
if (!Object.prototype.hasOwnProperty.call(obj,
|
|
3965
|
-
obj[
|
|
3965
|
+
const path4 = watcher.path;
|
|
3966
|
+
if (!Object.prototype.hasOwnProperty.call(obj, path4)) {
|
|
3967
|
+
obj[path4] = null;
|
|
3966
3968
|
}
|
|
3967
3969
|
}
|
|
3968
3970
|
}
|
|
@@ -4002,9 +4004,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
4002
4004
|
if (!this.initialScan) {
|
|
4003
4005
|
for (const watchers of this.watchers.values()) {
|
|
4004
4006
|
for (const watcher of watchers) {
|
|
4005
|
-
const
|
|
4006
|
-
if (!fileTimestamps.has(
|
|
4007
|
-
fileTimestamps.set(
|
|
4007
|
+
const path4 = watcher.path;
|
|
4008
|
+
if (!fileTimestamps.has(path4)) {
|
|
4009
|
+
fileTimestamps.set(path4, null);
|
|
4008
4010
|
}
|
|
4009
4011
|
}
|
|
4010
4012
|
}
|
|
@@ -4055,7 +4057,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
4055
4057
|
var require_getWatcherManager = __commonJS({
|
|
4056
4058
|
"../node_modules/watchpack/lib/getWatcherManager.js"(exports, module) {
|
|
4057
4059
|
"use strict";
|
|
4058
|
-
var
|
|
4060
|
+
var path3 = __require("path");
|
|
4059
4061
|
var DirectoryWatcher = require_DirectoryWatcher();
|
|
4060
4062
|
var WatcherManager = class {
|
|
4061
4063
|
static {
|
|
@@ -4078,7 +4080,7 @@ var require_getWatcherManager = __commonJS({
|
|
|
4078
4080
|
return watcher;
|
|
4079
4081
|
}
|
|
4080
4082
|
watchFile(p, startTime) {
|
|
4081
|
-
const directory =
|
|
4083
|
+
const directory = path3.dirname(p);
|
|
4082
4084
|
if (directory === p) return null;
|
|
4083
4085
|
return this.getDirectoryWatcher(directory).watch(p, startTime);
|
|
4084
4086
|
}
|
|
@@ -4103,7 +4105,7 @@ var require_LinkResolver = __commonJS({
|
|
|
4103
4105
|
"../node_modules/watchpack/lib/LinkResolver.js"(exports, module) {
|
|
4104
4106
|
"use strict";
|
|
4105
4107
|
var fs6 = __require("fs");
|
|
4106
|
-
var
|
|
4108
|
+
var path3 = __require("path");
|
|
4107
4109
|
var EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);
|
|
4108
4110
|
if (process.platform === "win32") EXPECTED_ERRORS.add("UNKNOWN");
|
|
4109
4111
|
var LinkResolver = class {
|
|
@@ -4122,7 +4124,7 @@ var require_LinkResolver = __commonJS({
|
|
|
4122
4124
|
if (cacheEntry !== void 0) {
|
|
4123
4125
|
return cacheEntry;
|
|
4124
4126
|
}
|
|
4125
|
-
const parent =
|
|
4127
|
+
const parent = path3.dirname(file);
|
|
4126
4128
|
if (parent === file) {
|
|
4127
4129
|
const result = Object.freeze([file]);
|
|
4128
4130
|
this.cache.set(file, result);
|
|
@@ -4131,12 +4133,12 @@ var require_LinkResolver = __commonJS({
|
|
|
4131
4133
|
const parentResolved = this.resolve(parent);
|
|
4132
4134
|
let realFile = file;
|
|
4133
4135
|
if (parentResolved[0] !== parent) {
|
|
4134
|
-
const basename4 =
|
|
4135
|
-
realFile =
|
|
4136
|
+
const basename4 = path3.basename(file);
|
|
4137
|
+
realFile = path3.resolve(parentResolved[0], basename4);
|
|
4136
4138
|
}
|
|
4137
4139
|
try {
|
|
4138
4140
|
const linkContent = fs6.readlinkSync(realFile);
|
|
4139
|
-
const resolvedLink =
|
|
4141
|
+
const resolvedLink = path3.resolve(parentResolved[0], linkContent);
|
|
4140
4142
|
const linkResolved = this.resolve(resolvedLink);
|
|
4141
4143
|
let result;
|
|
4142
4144
|
if (linkResolved.length > 1 && parentResolved.length > 1) {
|
|
@@ -4456,7 +4458,7 @@ var require_watchpack = __commonJS({
|
|
|
4456
4458
|
const fileWatchers = this.fileWatchers;
|
|
4457
4459
|
const directoryWatchers = this.directoryWatchers;
|
|
4458
4460
|
const ignored = this.watcherOptions.ignored;
|
|
4459
|
-
const filter = /* @__PURE__ */ __name((
|
|
4461
|
+
const filter = /* @__PURE__ */ __name((path3) => !ignored(path3), "filter");
|
|
4460
4462
|
const addToMap = /* @__PURE__ */ __name((map, key, item) => {
|
|
4461
4463
|
const list = map.get(key);
|
|
4462
4464
|
if (list === void 0) {
|
|
@@ -6047,18 +6049,18 @@ var require_dist2 = __commonJS({
|
|
|
6047
6049
|
}
|
|
6048
6050
|
__name(toKey, "toKey");
|
|
6049
6051
|
var toKey_default = toKey;
|
|
6050
|
-
function baseGet(object,
|
|
6051
|
-
|
|
6052
|
-
var index = 0, length =
|
|
6052
|
+
function baseGet(object, path3) {
|
|
6053
|
+
path3 = castPath_default(path3, object);
|
|
6054
|
+
var index = 0, length = path3.length;
|
|
6053
6055
|
while (object != null && index < length) {
|
|
6054
|
-
object = object[toKey_default(
|
|
6056
|
+
object = object[toKey_default(path3[index++])];
|
|
6055
6057
|
}
|
|
6056
6058
|
return index && index == length ? object : void 0;
|
|
6057
6059
|
}
|
|
6058
6060
|
__name(baseGet, "baseGet");
|
|
6059
6061
|
var baseGet_default = baseGet;
|
|
6060
|
-
function get(object,
|
|
6061
|
-
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);
|
|
6062
6064
|
return result === void 0 ? defaultValue : result;
|
|
6063
6065
|
}
|
|
6064
6066
|
__name(get, "get");
|
|
@@ -8473,7 +8475,7 @@ var require_cli_table3 = __commonJS({
|
|
|
8473
8475
|
import { getPreviewHeadTemplate, getPreviewBodyTemplate } from "storybook/internal/common";
|
|
8474
8476
|
|
|
8475
8477
|
// src/core-server/build-static.ts
|
|
8476
|
-
import { cp as cp2, mkdir } from "node:fs/promises";
|
|
8478
|
+
import { cp as cp2, mkdir, writeFile as writeFile3 } from "node:fs/promises";
|
|
8477
8479
|
import { rm } from "node:fs/promises";
|
|
8478
8480
|
import {
|
|
8479
8481
|
loadAllPresets,
|
|
@@ -8487,6 +8489,811 @@ import { getPrecedingUpgrade, telemetry as telemetry2 } from "storybook/internal
|
|
|
8487
8489
|
import { global as global2 } from "@storybook/global";
|
|
8488
8490
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
8489
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");
|
|
9296
|
+
|
|
8490
9297
|
// src/core-server/utils/StoryIndexGenerator.ts
|
|
8491
9298
|
import { existsSync } from "node:fs";
|
|
8492
9299
|
import { readFile } from "node:fs/promises";
|
|
@@ -8718,12 +9525,13 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8718
9525
|
return cached;
|
|
8719
9526
|
}
|
|
8720
9527
|
const pathToSubIndex = {};
|
|
8721
|
-
const
|
|
8722
|
-
const
|
|
8723
|
-
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, {
|
|
8724
9532
|
absolute: true,
|
|
8725
|
-
cwd:
|
|
8726
|
-
...commonGlobOptions(
|
|
9533
|
+
cwd: globCwd,
|
|
9534
|
+
...commonGlobOptions(globPattern)
|
|
8727
9535
|
});
|
|
8728
9536
|
if (files.length === 0 && !ignoreWarnings) {
|
|
8729
9537
|
once.warn(
|
|
@@ -8868,17 +9676,15 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8868
9676
|
* If no such file exists, assume that the import is from a package and return the raw
|
|
8869
9677
|
*/
|
|
8870
9678
|
resolveComponentPath(rawComponentPath, absolutePath, matchPath) {
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
if (existing) {
|
|
8878
|
-
const relativePath = relative2(this.options.workingDir, existing);
|
|
8879
|
-
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;
|
|
8880
9685
|
}
|
|
8881
|
-
|
|
9686
|
+
const relativePath = relative2(this.options.workingDir, resolved);
|
|
9687
|
+
return slash(normalizeStoryPath(relativePath));
|
|
8882
9688
|
}
|
|
8883
9689
|
async extractStories(specifier, absolutePath, projectTags = []) {
|
|
8884
9690
|
const relativePath = relative2(this.options.workingDir, absolutePath);
|
|
@@ -8977,7 +9783,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
8977
9783
|
const normalizedPath = normalizeStoryPath(relativePath);
|
|
8978
9784
|
const importPath = slash(normalizedPath);
|
|
8979
9785
|
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
8980
|
-
const { analyze } = await import("../_node-chunks/dist-
|
|
9786
|
+
const { analyze } = await import("../_node-chunks/dist-6TXHNR5C.js");
|
|
8981
9787
|
const result = await analyze(content);
|
|
8982
9788
|
if (result.isTemplate) {
|
|
8983
9789
|
return false;
|
|
@@ -9320,7 +10126,7 @@ __name(print, "print");
|
|
|
9320
10126
|
// src/core-server/utils/get-builders.ts
|
|
9321
10127
|
import { MissingBuilderError } from "storybook/internal/server-errors";
|
|
9322
10128
|
async function getManagerBuilder() {
|
|
9323
|
-
return await import("../_node-chunks/builder-manager-
|
|
10129
|
+
return await import("../_node-chunks/builder-manager-HA7CYFCK.js");
|
|
9324
10130
|
}
|
|
9325
10131
|
__name(getManagerBuilder, "getManagerBuilder");
|
|
9326
10132
|
async function getPreviewBuilder(resolvedPreviewBuilder) {
|
|
@@ -9559,7 +10365,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
9559
10365
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
9560
10366
|
basename2(specifier.files)
|
|
9561
10367
|
);
|
|
9562
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
10368
|
+
const { globby } = await import("../_node-chunks/globby-PBTV6PX6.js");
|
|
9563
10369
|
const addedFiles = await globby(slash(dirGlob), commonGlobOptions2(dirGlob));
|
|
9564
10370
|
addedFiles.forEach((filePath) => {
|
|
9565
10371
|
const fileImportPath = toImportPath(filePath);
|
|
@@ -9623,9 +10429,9 @@ function useStoriesJson({
|
|
|
9623
10429
|
const maybeInvalidate = debounce(() => serverChannel.emit(STORY_INDEX_INVALIDATED), DEBOUNCE, {
|
|
9624
10430
|
edges: ["leading", "trailing"]
|
|
9625
10431
|
});
|
|
9626
|
-
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier,
|
|
10432
|
+
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path3, removed) => {
|
|
9627
10433
|
const generator = await initializedStoryIndexGenerator;
|
|
9628
|
-
generator.invalidate(specifier,
|
|
10434
|
+
generator.invalidate(specifier, path3, removed);
|
|
9629
10435
|
maybeInvalidate();
|
|
9630
10436
|
});
|
|
9631
10437
|
if (configDir) {
|
|
@@ -9866,6 +10672,31 @@ async function buildStaticStandalone(options) {
|
|
|
9866
10672
|
initializedStoryIndexGenerator
|
|
9867
10673
|
)
|
|
9868
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
|
+
}
|
|
9869
10700
|
}
|
|
9870
10701
|
if (!core2?.disableProjectJson) {
|
|
9871
10702
|
effects.push(
|
|
@@ -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]);
|
|
@@ -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();
|
|
@@ -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"
|
|
@@ -12269,7 +13151,7 @@ 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
|
|
|
@@ -12358,7 +13240,7 @@ var buildIndex = /* @__PURE__ */ __name(async (options) => {
|
|
|
12358
13240
|
var buildIndexStandalone = /* @__PURE__ */ __name(async (options) => {
|
|
12359
13241
|
const index = await buildIndex(options);
|
|
12360
13242
|
logger12.info(`Writing index to ${options.outputFile}`);
|
|
12361
|
-
await
|
|
13243
|
+
await writeFile4(options.outputFile, JSON.stringify(index));
|
|
12362
13244
|
}, "buildIndexStandalone");
|
|
12363
13245
|
|
|
12364
13246
|
// src/core-server/standalone.ts
|