storybook 10.0.0-beta.5 → 10.0.0-beta.7
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/assets/server/openBrowser.applescript +94 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YQV3EGQ5.js → chunk-OQ6NCFPL.js} +38 -15
- package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
- package/dist/_node-chunks/{builder-manager-ZTS4EIKQ.js → builder-manager-VFP7HSCF.js} +21 -151
- package/dist/_node-chunks/camelcase-ZLZNQMDD.js +18 -0
- package/dist/_node-chunks/{chunk-VQN4WAIA.js → chunk-2GCKJYK6.js} +7 -7
- package/dist/_node-chunks/{chunk-H52PBBSK.js → chunk-3NIQHNDU.js} +7 -7
- package/dist/_node-chunks/{chunk-3VVGIILJ.js → chunk-3QZ7KLON.js} +8 -8
- package/dist/_node-chunks/{chunk-VWSUFVUF.js → chunk-3XXQRL3A.js} +7 -7
- package/dist/_node-chunks/{chunk-OC3TVLYU.js → chunk-46BWYN3K.js} +7 -7
- package/dist/_node-chunks/{chunk-VX5P3IYA.js → chunk-4DIDWIST.js} +7 -7
- package/dist/_node-chunks/{chunk-TBWOUVTA.js → chunk-5YUTWYNI.js} +709 -935
- package/dist/_node-chunks/{chunk-4VDRH7SM.js → chunk-A2DKPKBY.js} +7 -7
- package/dist/_node-chunks/{chunk-KU3JBNPY.js → chunk-BC23FKU4.js} +8 -8
- package/dist/_node-chunks/{chunk-KZB7ELL6.js → chunk-BID2X7MU.js} +7 -7
- package/dist/_node-chunks/{chunk-PIKDGR3O.js → chunk-C4EOB63P.js} +7 -7
- package/dist/_node-chunks/{chunk-TVKUJ3SE.js → chunk-DH7BCQMG.js} +8 -8
- package/dist/_node-chunks/{chunk-J3DQMIO4.js → chunk-FCNWWJV7.js} +7 -7
- package/dist/_node-chunks/{chunk-EIHJ5J3O.js → chunk-GBZZSL2K.js} +264 -109
- package/dist/_node-chunks/{chunk-F7YW5W6B.js → chunk-GCWAGPDV.js} +12 -12
- package/dist/_node-chunks/{chunk-K4YETNYJ.js → chunk-I7SRMFT5.js} +7 -7
- package/dist/_node-chunks/{chunk-TKN5TEZV.js → chunk-IEFSRAX2.js} +13 -13
- package/dist/_node-chunks/{chunk-AK5PHLUA.js → chunk-IGWCAXA2.js} +7 -7
- package/dist/_node-chunks/chunk-IYOHZPPC.js +18 -0
- package/dist/_node-chunks/{chunk-F3WE3456.js → chunk-KVOP6ASA.js} +7 -7
- package/dist/_node-chunks/{chunk-DZJNLBBL.js → chunk-MHVF6Y35.js} +7 -7
- package/dist/_node-chunks/{chunk-UTCFHTQH.js → chunk-MRCMZPA2.js} +7 -7
- package/dist/_node-chunks/chunk-RNHUADRS.js +62 -0
- package/dist/_node-chunks/{chunk-4KRR46V2.js → chunk-RP3VMQPF.js} +15 -15
- package/dist/_node-chunks/{chunk-P7YMEOXF.js → chunk-TFIGR2HH.js} +7 -7
- package/dist/_node-chunks/{chunk-SW3VZAH7.js → chunk-TXDIOSHI.js} +9 -9
- package/dist/_node-chunks/{chunk-WCSHG2QT.js → chunk-U6MJQ7C6.js} +7 -7
- package/dist/_node-chunks/{chunk-ACUNHBEO.js → chunk-XXVKM2ZR.js} +26 -23
- package/dist/_node-chunks/{chunk-QHIU5I7C.js → chunk-YWU65VY4.js} +6 -6
- package/dist/_node-chunks/{chunk-P3TWEOO5.js → chunk-Z3PLI7S2.js} +7 -7
- package/dist/_node-chunks/{chunk-2VMDKLSW.js → chunk-ZM2HT2RW.js} +6 -6
- package/dist/_node-chunks/{chunk-D7SDB4XE.js → chunk-ZPNXCXIT.js} +8 -8
- package/dist/_node-chunks/{dist-OGRBL76N.js → dist-PG4I7ZDU.js} +9 -9
- package/dist/_node-chunks/{globby-65LOULA6.js → globby-HXB6X43W.js} +17 -13
- package/dist/_node-chunks/{lib-TF7JCT3A.js → lib-4JJTZC7T.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-6ZJEUZMZ.js → mdx-N42X6CFJ-3JBJ7PQF.js} +8 -8
- package/dist/_node-chunks/{p-limit-PF7JSPDT.js → p-limit-WBBNX4KI.js} +7 -7
- package/dist/_node-chunks/{plugin-A6XAWMXN.js → plugin-SEQ2OPRK.js} +10 -10
- package/dist/_node-chunks/{plugin-LGHGAC6J.js → plugin-SG6I7RFC.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js → webpack-inject-mocker-runtime-plugin-5O25VYCQ.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-ZJJVMJUS.js → webpack-mock-plugin-35I32SAF.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 +8 -8
- package/dist/cli/index.js +27 -22
- package/dist/common/index.js +21 -21
- package/dist/components/index.js +8 -4
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +1157 -1024
- package/dist/core-server/presets/common-manager.js +84 -39
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -29
- 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.d.ts +9 -4
- package/dist/csf/index.js +37 -8
- package/dist/csf-tools/index.d.ts +13 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1318 -1001
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +2198 -721
- package/dist/manager-api/index.d.ts +12 -5
- package/dist/manager-api/index.js +347 -76
- package/dist/node-logger/index.js +14 -14
- package/dist/preview/runtime.js +103 -63
- package/dist/preview-api/index.d.ts +70 -71
- package/dist/preview-api/index.js +1 -1
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +24 -24
- package/dist/types/index.d.ts +28 -7
- package/dist/viewport/index.d.ts +36 -4
- package/dist/viewport/index.js +1 -1
- package/package.json +5 -4
- package/dist/_node-chunks/camelcase-K3BM7RII.js +0 -18
- package/dist/_node-chunks/chunk-7LG5CLCT.js +0 -18
- package/dist/_node-chunks/chunk-DWJ7TV2O.js +0 -62
- package/dist/_node-chunks/default-browser-id-4RZZMHJE.js +0 -1719
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.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
|
require_pretty_hrtime
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-KVOP6ASA.js";
|
|
15
15
|
import {
|
|
16
16
|
boxen,
|
|
17
17
|
require_string_width
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
19
|
-
import "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-DH7BCQMG.js";
|
|
19
|
+
import "../_node-chunks/chunk-IGWCAXA2.js";
|
|
20
20
|
import {
|
|
21
21
|
StatusTypeIdMismatchError,
|
|
22
22
|
StorybookError
|
|
23
|
-
} from "../_node-chunks/chunk-
|
|
23
|
+
} from "../_node-chunks/chunk-TXDIOSHI.js";
|
|
24
24
|
import {
|
|
25
25
|
getErrorLevel,
|
|
26
26
|
mapStaticDir,
|
|
@@ -28,59 +28,60 @@ import {
|
|
|
28
28
|
sendTelemetryError,
|
|
29
29
|
useStatics,
|
|
30
30
|
withTelemetry
|
|
31
|
-
} from "../_node-chunks/chunk-
|
|
32
|
-
import "../_node-chunks/chunk-
|
|
31
|
+
} from "../_node-chunks/chunk-GCWAGPDV.js";
|
|
32
|
+
import "../_node-chunks/chunk-2GCKJYK6.js";
|
|
33
33
|
import {
|
|
34
34
|
telemetry
|
|
35
|
-
} from "../_node-chunks/chunk-
|
|
36
|
-
import "../_node-chunks/chunk-
|
|
35
|
+
} from "../_node-chunks/chunk-RP3VMQPF.js";
|
|
36
|
+
import "../_node-chunks/chunk-IYOHZPPC.js";
|
|
37
37
|
import {
|
|
38
38
|
userOrAutoTitleFromSpecifier
|
|
39
|
-
} from "../_node-chunks/chunk-
|
|
40
|
-
import "../_node-chunks/chunk-
|
|
41
|
-
import "../_node-chunks/chunk-
|
|
42
|
-
import "../_node-chunks/chunk-
|
|
43
|
-
import "../_node-chunks/chunk-
|
|
39
|
+
} from "../_node-chunks/chunk-XXVKM2ZR.js";
|
|
40
|
+
import "../_node-chunks/chunk-46BWYN3K.js";
|
|
41
|
+
import "../_node-chunks/chunk-U6MJQ7C6.js";
|
|
42
|
+
import "../_node-chunks/chunk-RNHUADRS.js";
|
|
43
|
+
import "../_node-chunks/chunk-ZPNXCXIT.js";
|
|
44
44
|
import {
|
|
45
|
-
optionalEnvToBoolean
|
|
46
|
-
|
|
45
|
+
optionalEnvToBoolean,
|
|
46
|
+
require_cross_spawn
|
|
47
|
+
} from "../_node-chunks/chunk-5YUTWYNI.js";
|
|
47
48
|
import {
|
|
48
49
|
up2 as up
|
|
49
|
-
} from "../_node-chunks/chunk-
|
|
50
|
+
} from "../_node-chunks/chunk-MHVF6Y35.js";
|
|
50
51
|
import {
|
|
51
52
|
invariant
|
|
52
|
-
} from "../_node-chunks/chunk-
|
|
53
|
+
} from "../_node-chunks/chunk-3XXQRL3A.js";
|
|
53
54
|
import {
|
|
54
55
|
importModule,
|
|
55
56
|
resolvePackageDir
|
|
56
|
-
} from "../_node-chunks/chunk-
|
|
57
|
+
} from "../_node-chunks/chunk-BC23FKU4.js";
|
|
57
58
|
import {
|
|
58
59
|
resolve
|
|
59
|
-
} from "../_node-chunks/chunk-
|
|
60
|
+
} from "../_node-chunks/chunk-A2DKPKBY.js";
|
|
60
61
|
import {
|
|
61
62
|
require_prompts
|
|
62
|
-
} from "../_node-chunks/chunk-
|
|
63
|
-
import "../_node-chunks/chunk-
|
|
63
|
+
} from "../_node-chunks/chunk-4DIDWIST.js";
|
|
64
|
+
import "../_node-chunks/chunk-MRCMZPA2.js";
|
|
64
65
|
import {
|
|
65
66
|
slash
|
|
66
|
-
} from "../_node-chunks/chunk-
|
|
67
|
+
} from "../_node-chunks/chunk-FCNWWJV7.js";
|
|
67
68
|
import {
|
|
68
69
|
require_dist
|
|
69
|
-
} from "../_node-chunks/chunk-
|
|
70
|
+
} from "../_node-chunks/chunk-TFIGR2HH.js";
|
|
70
71
|
import {
|
|
71
72
|
require_lib,
|
|
72
73
|
require_src
|
|
73
|
-
} from "../_node-chunks/chunk-
|
|
74
|
+
} from "../_node-chunks/chunk-3NIQHNDU.js";
|
|
74
75
|
import {
|
|
75
76
|
require_picocolors
|
|
76
|
-
} from "../_node-chunks/chunk-
|
|
77
|
+
} from "../_node-chunks/chunk-Z3PLI7S2.js";
|
|
77
78
|
import {
|
|
78
79
|
__commonJS,
|
|
79
80
|
__export,
|
|
80
81
|
__name,
|
|
81
82
|
__require,
|
|
82
83
|
__toESM
|
|
83
|
-
} from "../_node-chunks/chunk-
|
|
84
|
+
} from "../_node-chunks/chunk-ZM2HT2RW.js";
|
|
84
85
|
|
|
85
86
|
// ../node_modules/tsconfig-paths/lib/filesystem.js
|
|
86
87
|
var require_filesystem = __commonJS({
|
|
@@ -88,13 +89,13 @@ var require_filesystem = __commonJS({
|
|
|
88
89
|
"use strict";
|
|
89
90
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
90
91
|
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
91
|
-
var
|
|
92
|
-
function fileExistsSync(
|
|
93
|
-
if (!
|
|
92
|
+
var fs6 = __require("fs");
|
|
93
|
+
function fileExistsSync(path2) {
|
|
94
|
+
if (!fs6.existsSync(path2)) {
|
|
94
95
|
return false;
|
|
95
96
|
}
|
|
96
97
|
try {
|
|
97
|
-
var stats =
|
|
98
|
+
var stats = fs6.statSync(path2);
|
|
98
99
|
return stats.isFile();
|
|
99
100
|
} catch (err) {
|
|
100
101
|
return false;
|
|
@@ -103,15 +104,15 @@ var require_filesystem = __commonJS({
|
|
|
103
104
|
__name(fileExistsSync, "fileExistsSync");
|
|
104
105
|
exports.fileExistsSync = fileExistsSync;
|
|
105
106
|
function readJsonFromDiskSync(packageJsonPath) {
|
|
106
|
-
if (!
|
|
107
|
+
if (!fs6.existsSync(packageJsonPath)) {
|
|
107
108
|
return void 0;
|
|
108
109
|
}
|
|
109
110
|
return __require(packageJsonPath);
|
|
110
111
|
}
|
|
111
112
|
__name(readJsonFromDiskSync, "readJsonFromDiskSync");
|
|
112
113
|
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
113
|
-
function readJsonFromDiskAsync(
|
|
114
|
-
|
|
114
|
+
function readJsonFromDiskAsync(path2, callback) {
|
|
115
|
+
fs6.readFile(path2, "utf8", function(err, result2) {
|
|
115
116
|
if (err || !result2) {
|
|
116
117
|
return callback();
|
|
117
118
|
}
|
|
@@ -122,7 +123,7 @@ var require_filesystem = __commonJS({
|
|
|
122
123
|
__name(readJsonFromDiskAsync, "readJsonFromDiskAsync");
|
|
123
124
|
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
124
125
|
function fileExistsAsync(path2, callback2) {
|
|
125
|
-
|
|
126
|
+
fs6.stat(path2, function(err, stats) {
|
|
126
127
|
if (err) {
|
|
127
128
|
return callback2(void 0, false);
|
|
128
129
|
}
|
|
@@ -131,8 +132,8 @@ var require_filesystem = __commonJS({
|
|
|
131
132
|
}
|
|
132
133
|
__name(fileExistsAsync, "fileExistsAsync");
|
|
133
134
|
exports.fileExistsAsync = fileExistsAsync;
|
|
134
|
-
function removeExtension(
|
|
135
|
-
return
|
|
135
|
+
function removeExtension(path2) {
|
|
136
|
+
return path2.substring(0, path2.lastIndexOf(".")) || path2;
|
|
136
137
|
}
|
|
137
138
|
__name(removeExtension, "removeExtension");
|
|
138
139
|
exports.removeExtension = removeExtension;
|
|
@@ -145,7 +146,7 @@ var require_mapping_entry = __commonJS({
|
|
|
145
146
|
"use strict";
|
|
146
147
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
147
148
|
exports.getAbsoluteMappingEntries = void 0;
|
|
148
|
-
var
|
|
149
|
+
var path2 = __require("path");
|
|
149
150
|
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
150
151
|
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
151
152
|
var absolutePaths = [];
|
|
@@ -154,7 +155,7 @@ var require_mapping_entry = __commonJS({
|
|
|
154
155
|
absolutePaths.push({
|
|
155
156
|
pattern: key,
|
|
156
157
|
paths: paths[key].map(function(pathToResolve) {
|
|
157
|
-
return
|
|
158
|
+
return path2.resolve(absoluteBaseUrl, pathToResolve);
|
|
158
159
|
})
|
|
159
160
|
});
|
|
160
161
|
}
|
|
@@ -188,7 +189,7 @@ var require_try_path = __commonJS({
|
|
|
188
189
|
"use strict";
|
|
189
190
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
190
191
|
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
191
|
-
var
|
|
192
|
+
var path2 = __require("path");
|
|
192
193
|
var path_1 = __require("path");
|
|
193
194
|
var filesystem_1 = require_filesystem();
|
|
194
195
|
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
@@ -208,9 +209,9 @@ var require_try_path = __commonJS({
|
|
|
208
209
|
}));
|
|
209
210
|
pathsToTry.push({
|
|
210
211
|
type: "package",
|
|
211
|
-
path:
|
|
212
|
+
path: path2.join(physicalPath, "/package.json")
|
|
212
213
|
});
|
|
213
|
-
var indexPath =
|
|
214
|
+
var indexPath = path2.join(physicalPath, "/index");
|
|
214
215
|
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
215
216
|
return { type: "index", path: indexPath + e };
|
|
216
217
|
}));
|
|
@@ -266,7 +267,7 @@ var require_match_path_sync = __commonJS({
|
|
|
266
267
|
"use strict";
|
|
267
268
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
268
269
|
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
269
|
-
var
|
|
270
|
+
var path2 = __require("path");
|
|
270
271
|
var Filesystem = require_filesystem();
|
|
271
272
|
var MappingEntry = require_mapping_entry();
|
|
272
273
|
var TryPath = require_try_path();
|
|
@@ -312,7 +313,7 @@ var require_match_path_sync = __commonJS({
|
|
|
312
313
|
return obj[key];
|
|
313
314
|
}, packageJson);
|
|
314
315
|
if (candidateMapping && typeof candidateMapping === "string") {
|
|
315
|
-
var candidateFilePath =
|
|
316
|
+
var candidateFilePath = path2.join(path2.dirname(packageJsonPath), candidateMapping);
|
|
316
317
|
if (fileExists2(candidateFilePath)) {
|
|
317
318
|
return candidateFilePath;
|
|
318
319
|
}
|
|
@@ -358,7 +359,7 @@ var require_match_path_async = __commonJS({
|
|
|
358
359
|
"use strict";
|
|
359
360
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
360
361
|
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
361
|
-
var
|
|
362
|
+
var path2 = __require("path");
|
|
362
363
|
var TryPath = require_try_path();
|
|
363
364
|
var MappingEntry = require_mapping_entry();
|
|
364
365
|
var Filesystem = require_filesystem();
|
|
@@ -414,7 +415,7 @@ var require_match_path_async = __commonJS({
|
|
|
414
415
|
if (typeof mainFieldMapping !== "string") {
|
|
415
416
|
return tryNext();
|
|
416
417
|
}
|
|
417
|
-
var mappedFilePath =
|
|
418
|
+
var mappedFilePath = path2.join(path2.dirname(packageJsonPath), mainFieldMapping);
|
|
418
419
|
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
419
420
|
if (err) {
|
|
420
421
|
return doneCallback(err);
|
|
@@ -506,8 +507,8 @@ var require_tsconfig_loader = __commonJS({
|
|
|
506
507
|
};
|
|
507
508
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
508
509
|
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
509
|
-
var
|
|
510
|
-
var
|
|
510
|
+
var path2 = __require("path");
|
|
511
|
+
var fs6 = __require("fs");
|
|
511
512
|
var JSON5 = require_lib();
|
|
512
513
|
var StripBom = require_strip_bom();
|
|
513
514
|
function tsConfigLoader(_a) {
|
|
@@ -538,29 +539,29 @@ var require_tsconfig_loader = __commonJS({
|
|
|
538
539
|
__name(loadSyncDefault, "loadSyncDefault");
|
|
539
540
|
function resolveConfigPath(cwd, filename) {
|
|
540
541
|
if (filename) {
|
|
541
|
-
var absolutePath =
|
|
542
|
+
var absolutePath = fs6.lstatSync(filename).isDirectory() ? path2.resolve(filename, "./tsconfig.json") : path2.resolve(cwd, filename);
|
|
542
543
|
return absolutePath;
|
|
543
544
|
}
|
|
544
|
-
if (
|
|
545
|
-
return
|
|
545
|
+
if (fs6.statSync(cwd).isFile()) {
|
|
546
|
+
return path2.resolve(cwd);
|
|
546
547
|
}
|
|
547
548
|
var configAbsolutePath = walkForTsConfig(cwd);
|
|
548
|
-
return configAbsolutePath ?
|
|
549
|
+
return configAbsolutePath ? path2.resolve(configAbsolutePath) : void 0;
|
|
549
550
|
}
|
|
550
551
|
__name(resolveConfigPath, "resolveConfigPath");
|
|
551
552
|
function walkForTsConfig(directory, readdirSync2) {
|
|
552
553
|
if (readdirSync2 === void 0) {
|
|
553
|
-
readdirSync2 =
|
|
554
|
+
readdirSync2 = fs6.readdirSync;
|
|
554
555
|
}
|
|
555
556
|
var files = readdirSync2(directory);
|
|
556
557
|
var filesToCheck = ["tsconfig.json", "jsconfig.json"];
|
|
557
558
|
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
558
559
|
var fileToCheck = filesToCheck_1[_i];
|
|
559
560
|
if (files.indexOf(fileToCheck) !== -1) {
|
|
560
|
-
return
|
|
561
|
+
return path2.join(directory, fileToCheck);
|
|
561
562
|
}
|
|
562
563
|
}
|
|
563
|
-
var parentDirectory =
|
|
564
|
+
var parentDirectory = path2.dirname(directory);
|
|
564
565
|
if (directory === parentDirectory) {
|
|
565
566
|
return void 0;
|
|
566
567
|
}
|
|
@@ -570,11 +571,11 @@ var require_tsconfig_loader = __commonJS({
|
|
|
570
571
|
exports.walkForTsConfig = walkForTsConfig;
|
|
571
572
|
function loadTsconfig(configFilePath, existsSync3, readFileSync) {
|
|
572
573
|
if (existsSync3 === void 0) {
|
|
573
|
-
existsSync3 =
|
|
574
|
+
existsSync3 = fs6.existsSync;
|
|
574
575
|
}
|
|
575
576
|
if (readFileSync === void 0) {
|
|
576
577
|
readFileSync = /* @__PURE__ */ __name(function(filename) {
|
|
577
|
-
return
|
|
578
|
+
return fs6.readFileSync(filename, "utf8");
|
|
578
579
|
}, "readFileSync");
|
|
579
580
|
}
|
|
580
581
|
if (!existsSync3(configFilePath)) {
|
|
@@ -609,15 +610,15 @@ var require_tsconfig_loader = __commonJS({
|
|
|
609
610
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
610
611
|
extendedConfigValue += ".json";
|
|
611
612
|
}
|
|
612
|
-
var currentDir =
|
|
613
|
-
var extendedConfigPath =
|
|
613
|
+
var currentDir = path2.dirname(configFilePath);
|
|
614
|
+
var extendedConfigPath = path2.join(currentDir, extendedConfigValue);
|
|
614
615
|
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath)) {
|
|
615
|
-
extendedConfigPath =
|
|
616
|
+
extendedConfigPath = path2.join(currentDir, "node_modules", extendedConfigValue);
|
|
616
617
|
}
|
|
617
618
|
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync) || {};
|
|
618
619
|
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
619
|
-
var extendsDir =
|
|
620
|
-
config.compilerOptions.baseUrl =
|
|
620
|
+
var extendsDir = path2.dirname(extendedConfigValue);
|
|
621
|
+
config.compilerOptions.baseUrl = path2.join(extendsDir, config.compilerOptions.baseUrl);
|
|
621
622
|
}
|
|
622
623
|
return config;
|
|
623
624
|
}
|
|
@@ -638,7 +639,7 @@ var require_config_loader = __commonJS({
|
|
|
638
639
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
639
640
|
exports.configLoader = exports.loadConfig = void 0;
|
|
640
641
|
var TsConfigLoader2 = require_tsconfig_loader();
|
|
641
|
-
var
|
|
642
|
+
var path2 = __require("path");
|
|
642
643
|
function loadConfig3(cwd) {
|
|
643
644
|
if (cwd === void 0) {
|
|
644
645
|
cwd = process.cwd();
|
|
@@ -650,7 +651,7 @@ var require_config_loader = __commonJS({
|
|
|
650
651
|
function configLoader(_a) {
|
|
651
652
|
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
652
653
|
if (explicitParams) {
|
|
653
|
-
var absoluteBaseUrl =
|
|
654
|
+
var absoluteBaseUrl = path2.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path2.join(cwd, explicitParams.baseUrl);
|
|
654
655
|
return {
|
|
655
656
|
resultType: "success",
|
|
656
657
|
configFileAbsolutePath: "",
|
|
@@ -677,7 +678,7 @@ var require_config_loader = __commonJS({
|
|
|
677
678
|
resultType: "success",
|
|
678
679
|
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
679
680
|
baseUrl: loadResult.baseUrl,
|
|
680
|
-
absoluteBaseUrl:
|
|
681
|
+
absoluteBaseUrl: path2.resolve(path2.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
681
682
|
paths: loadResult.paths || {},
|
|
682
683
|
addMatchAll: loadResult.baseUrl !== void 0
|
|
683
684
|
};
|
|
@@ -2099,7 +2100,7 @@ var require_polyfills = __commonJS({
|
|
|
2099
2100
|
var constants = __require("constants");
|
|
2100
2101
|
var origCwd = process.cwd;
|
|
2101
2102
|
var cwd = null;
|
|
2102
|
-
var
|
|
2103
|
+
var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
2103
2104
|
process.cwd = function() {
|
|
2104
2105
|
if (!cwd)
|
|
2105
2106
|
cwd = origCwd.call(process);
|
|
@@ -2119,54 +2120,54 @@ var require_polyfills = __commonJS({
|
|
|
2119
2120
|
}
|
|
2120
2121
|
var chdir;
|
|
2121
2122
|
module.exports = patch;
|
|
2122
|
-
function patch(
|
|
2123
|
+
function patch(fs6) {
|
|
2123
2124
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
2124
|
-
patchLchmod(
|
|
2125
|
-
}
|
|
2126
|
-
if (!
|
|
2127
|
-
patchLutimes(
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
if (
|
|
2148
|
-
|
|
2125
|
+
patchLchmod(fs6);
|
|
2126
|
+
}
|
|
2127
|
+
if (!fs6.lutimes) {
|
|
2128
|
+
patchLutimes(fs6);
|
|
2129
|
+
}
|
|
2130
|
+
fs6.chown = chownFix(fs6.chown);
|
|
2131
|
+
fs6.fchown = chownFix(fs6.fchown);
|
|
2132
|
+
fs6.lchown = chownFix(fs6.lchown);
|
|
2133
|
+
fs6.chmod = chmodFix(fs6.chmod);
|
|
2134
|
+
fs6.fchmod = chmodFix(fs6.fchmod);
|
|
2135
|
+
fs6.lchmod = chmodFix(fs6.lchmod);
|
|
2136
|
+
fs6.chownSync = chownFixSync(fs6.chownSync);
|
|
2137
|
+
fs6.fchownSync = chownFixSync(fs6.fchownSync);
|
|
2138
|
+
fs6.lchownSync = chownFixSync(fs6.lchownSync);
|
|
2139
|
+
fs6.chmodSync = chmodFixSync(fs6.chmodSync);
|
|
2140
|
+
fs6.fchmodSync = chmodFixSync(fs6.fchmodSync);
|
|
2141
|
+
fs6.lchmodSync = chmodFixSync(fs6.lchmodSync);
|
|
2142
|
+
fs6.stat = statFix(fs6.stat);
|
|
2143
|
+
fs6.fstat = statFix(fs6.fstat);
|
|
2144
|
+
fs6.lstat = statFix(fs6.lstat);
|
|
2145
|
+
fs6.statSync = statFixSync(fs6.statSync);
|
|
2146
|
+
fs6.fstatSync = statFixSync(fs6.fstatSync);
|
|
2147
|
+
fs6.lstatSync = statFixSync(fs6.lstatSync);
|
|
2148
|
+
if (fs6.chmod && !fs6.lchmod) {
|
|
2149
|
+
fs6.lchmod = function(path2, mode, cb) {
|
|
2149
2150
|
if (cb) process.nextTick(cb);
|
|
2150
2151
|
};
|
|
2151
|
-
|
|
2152
|
+
fs6.lchmodSync = function() {
|
|
2152
2153
|
};
|
|
2153
2154
|
}
|
|
2154
|
-
if (
|
|
2155
|
-
|
|
2155
|
+
if (fs6.chown && !fs6.lchown) {
|
|
2156
|
+
fs6.lchown = function(path2, uid, gid, cb) {
|
|
2156
2157
|
if (cb) process.nextTick(cb);
|
|
2157
2158
|
};
|
|
2158
|
-
|
|
2159
|
+
fs6.lchownSync = function() {
|
|
2159
2160
|
};
|
|
2160
2161
|
}
|
|
2161
|
-
if (
|
|
2162
|
-
|
|
2162
|
+
if (platform2 === "win32") {
|
|
2163
|
+
fs6.rename = typeof fs6.rename !== "function" ? fs6.rename : function(fs$rename) {
|
|
2163
2164
|
function rename(from, to, cb) {
|
|
2164
2165
|
var start = Date.now();
|
|
2165
2166
|
var backoff = 0;
|
|
2166
2167
|
fs$rename(from, to, /* @__PURE__ */ __name(function CB(er) {
|
|
2167
2168
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
2168
2169
|
setTimeout(function() {
|
|
2169
|
-
|
|
2170
|
+
fs6.stat(to, function(stater, st) {
|
|
2170
2171
|
if (stater && stater.code === "ENOENT")
|
|
2171
2172
|
fs$rename(from, to, CB);
|
|
2172
2173
|
else
|
|
@@ -2183,9 +2184,9 @@ var require_polyfills = __commonJS({
|
|
|
2183
2184
|
__name(rename, "rename");
|
|
2184
2185
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
2185
2186
|
return rename;
|
|
2186
|
-
}(
|
|
2187
|
+
}(fs6.rename);
|
|
2187
2188
|
}
|
|
2188
|
-
|
|
2189
|
+
fs6.read = typeof fs6.read !== "function" ? fs6.read : function(fs$read) {
|
|
2189
2190
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
2190
2191
|
var callback;
|
|
2191
2192
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -2193,23 +2194,23 @@ var require_polyfills = __commonJS({
|
|
|
2193
2194
|
callback = /* @__PURE__ */ __name(function(er, _, __) {
|
|
2194
2195
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
2195
2196
|
eagCounter++;
|
|
2196
|
-
return fs$read.call(
|
|
2197
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
2197
2198
|
}
|
|
2198
2199
|
callback_.apply(this, arguments);
|
|
2199
2200
|
}, "callback");
|
|
2200
2201
|
}
|
|
2201
|
-
return fs$read.call(
|
|
2202
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
2202
2203
|
}
|
|
2203
2204
|
__name(read, "read");
|
|
2204
2205
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
2205
2206
|
return read;
|
|
2206
|
-
}(
|
|
2207
|
-
|
|
2207
|
+
}(fs6.read);
|
|
2208
|
+
fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
2208
2209
|
return function(fd, buffer, offset, length, position) {
|
|
2209
2210
|
var eagCounter = 0;
|
|
2210
2211
|
while (true) {
|
|
2211
2212
|
try {
|
|
2212
|
-
return fs$readSync.call(
|
|
2213
|
+
return fs$readSync.call(fs6, fd, buffer, offset, length, position);
|
|
2213
2214
|
} catch (er) {
|
|
2214
2215
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
2215
2216
|
eagCounter++;
|
|
@@ -2219,11 +2220,11 @@ var require_polyfills = __commonJS({
|
|
|
2219
2220
|
}
|
|
2220
2221
|
}
|
|
2221
2222
|
};
|
|
2222
|
-
}(
|
|
2223
|
-
function patchLchmod(
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2223
|
+
}(fs6.readSync);
|
|
2224
|
+
function patchLchmod(fs7) {
|
|
2225
|
+
fs7.lchmod = function(path2, mode, callback) {
|
|
2226
|
+
fs7.open(
|
|
2227
|
+
path2,
|
|
2227
2228
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
2228
2229
|
mode,
|
|
2229
2230
|
function(err, fd) {
|
|
@@ -2231,74 +2232,74 @@ var require_polyfills = __commonJS({
|
|
|
2231
2232
|
if (callback) callback(err);
|
|
2232
2233
|
return;
|
|
2233
2234
|
}
|
|
2234
|
-
|
|
2235
|
-
|
|
2235
|
+
fs7.fchmod(fd, mode, function(err2) {
|
|
2236
|
+
fs7.close(fd, function(err22) {
|
|
2236
2237
|
if (callback) callback(err2 || err22);
|
|
2237
2238
|
});
|
|
2238
2239
|
});
|
|
2239
2240
|
}
|
|
2240
2241
|
);
|
|
2241
2242
|
};
|
|
2242
|
-
|
|
2243
|
-
var fd =
|
|
2243
|
+
fs7.lchmodSync = function(path2, mode) {
|
|
2244
|
+
var fd = fs7.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
2244
2245
|
var threw = true;
|
|
2245
2246
|
var ret;
|
|
2246
2247
|
try {
|
|
2247
|
-
ret =
|
|
2248
|
+
ret = fs7.fchmodSync(fd, mode);
|
|
2248
2249
|
threw = false;
|
|
2249
2250
|
} finally {
|
|
2250
2251
|
if (threw) {
|
|
2251
2252
|
try {
|
|
2252
|
-
|
|
2253
|
+
fs7.closeSync(fd);
|
|
2253
2254
|
} catch (er) {
|
|
2254
2255
|
}
|
|
2255
2256
|
} else {
|
|
2256
|
-
|
|
2257
|
+
fs7.closeSync(fd);
|
|
2257
2258
|
}
|
|
2258
2259
|
}
|
|
2259
2260
|
return ret;
|
|
2260
2261
|
};
|
|
2261
2262
|
}
|
|
2262
2263
|
__name(patchLchmod, "patchLchmod");
|
|
2263
|
-
function patchLutimes(
|
|
2264
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
2265
|
-
|
|
2266
|
-
|
|
2264
|
+
function patchLutimes(fs7) {
|
|
2265
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
|
|
2266
|
+
fs7.lutimes = function(path2, at2, mt, cb) {
|
|
2267
|
+
fs7.open(path2, constants.O_SYMLINK, function(er, fd) {
|
|
2267
2268
|
if (er) {
|
|
2268
2269
|
if (cb) cb(er);
|
|
2269
2270
|
return;
|
|
2270
2271
|
}
|
|
2271
|
-
|
|
2272
|
-
|
|
2272
|
+
fs7.futimes(fd, at2, mt, function(er2) {
|
|
2273
|
+
fs7.close(fd, function(er22) {
|
|
2273
2274
|
if (cb) cb(er2 || er22);
|
|
2274
2275
|
});
|
|
2275
2276
|
});
|
|
2276
2277
|
});
|
|
2277
2278
|
};
|
|
2278
|
-
|
|
2279
|
-
var fd =
|
|
2279
|
+
fs7.lutimesSync = function(path2, at2, mt) {
|
|
2280
|
+
var fd = fs7.openSync(path2, constants.O_SYMLINK);
|
|
2280
2281
|
var ret;
|
|
2281
2282
|
var threw = true;
|
|
2282
2283
|
try {
|
|
2283
|
-
ret =
|
|
2284
|
+
ret = fs7.futimesSync(fd, at2, mt);
|
|
2284
2285
|
threw = false;
|
|
2285
2286
|
} finally {
|
|
2286
2287
|
if (threw) {
|
|
2287
2288
|
try {
|
|
2288
|
-
|
|
2289
|
+
fs7.closeSync(fd);
|
|
2289
2290
|
} catch (er) {
|
|
2290
2291
|
}
|
|
2291
2292
|
} else {
|
|
2292
|
-
|
|
2293
|
+
fs7.closeSync(fd);
|
|
2293
2294
|
}
|
|
2294
2295
|
}
|
|
2295
2296
|
return ret;
|
|
2296
2297
|
};
|
|
2297
|
-
} else if (
|
|
2298
|
-
|
|
2298
|
+
} else if (fs7.futimes) {
|
|
2299
|
+
fs7.lutimes = function(_a, _b, _c, cb) {
|
|
2299
2300
|
if (cb) process.nextTick(cb);
|
|
2300
2301
|
};
|
|
2301
|
-
|
|
2302
|
+
fs7.lutimesSync = function() {
|
|
2302
2303
|
};
|
|
2303
2304
|
}
|
|
2304
2305
|
}
|
|
@@ -2306,7 +2307,7 @@ var require_polyfills = __commonJS({
|
|
|
2306
2307
|
function chmodFix(orig) {
|
|
2307
2308
|
if (!orig) return orig;
|
|
2308
2309
|
return function(target, mode, cb) {
|
|
2309
|
-
return orig.call(
|
|
2310
|
+
return orig.call(fs6, target, mode, function(er) {
|
|
2310
2311
|
if (chownErOk(er)) er = null;
|
|
2311
2312
|
if (cb) cb.apply(this, arguments);
|
|
2312
2313
|
});
|
|
@@ -2317,7 +2318,7 @@ var require_polyfills = __commonJS({
|
|
|
2317
2318
|
if (!orig) return orig;
|
|
2318
2319
|
return function(target, mode) {
|
|
2319
2320
|
try {
|
|
2320
|
-
return orig.call(
|
|
2321
|
+
return orig.call(fs6, target, mode);
|
|
2321
2322
|
} catch (er) {
|
|
2322
2323
|
if (!chownErOk(er)) throw er;
|
|
2323
2324
|
}
|
|
@@ -2327,7 +2328,7 @@ var require_polyfills = __commonJS({
|
|
|
2327
2328
|
function chownFix(orig) {
|
|
2328
2329
|
if (!orig) return orig;
|
|
2329
2330
|
return function(target, uid, gid, cb) {
|
|
2330
|
-
return orig.call(
|
|
2331
|
+
return orig.call(fs6, target, uid, gid, function(er) {
|
|
2331
2332
|
if (chownErOk(er)) er = null;
|
|
2332
2333
|
if (cb) cb.apply(this, arguments);
|
|
2333
2334
|
});
|
|
@@ -2338,7 +2339,7 @@ var require_polyfills = __commonJS({
|
|
|
2338
2339
|
if (!orig) return orig;
|
|
2339
2340
|
return function(target, uid, gid) {
|
|
2340
2341
|
try {
|
|
2341
|
-
return orig.call(
|
|
2342
|
+
return orig.call(fs6, target, uid, gid);
|
|
2342
2343
|
} catch (er) {
|
|
2343
2344
|
if (!chownErOk(er)) throw er;
|
|
2344
2345
|
}
|
|
@@ -2360,14 +2361,14 @@ var require_polyfills = __commonJS({
|
|
|
2360
2361
|
if (cb) cb.apply(this, arguments);
|
|
2361
2362
|
}
|
|
2362
2363
|
__name(callback, "callback");
|
|
2363
|
-
return options ? orig.call(
|
|
2364
|
+
return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);
|
|
2364
2365
|
};
|
|
2365
2366
|
}
|
|
2366
2367
|
__name(statFix, "statFix");
|
|
2367
2368
|
function statFixSync(orig) {
|
|
2368
2369
|
if (!orig) return orig;
|
|
2369
2370
|
return function(target, options) {
|
|
2370
|
-
var stats = options ? orig.call(
|
|
2371
|
+
var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);
|
|
2371
2372
|
if (stats) {
|
|
2372
2373
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
2373
2374
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -2399,16 +2400,16 @@ var require_legacy_streams = __commonJS({
|
|
|
2399
2400
|
"../node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
2400
2401
|
var Stream = __require("stream").Stream;
|
|
2401
2402
|
module.exports = legacy;
|
|
2402
|
-
function legacy(
|
|
2403
|
+
function legacy(fs6) {
|
|
2403
2404
|
return {
|
|
2404
2405
|
ReadStream,
|
|
2405
2406
|
WriteStream
|
|
2406
2407
|
};
|
|
2407
|
-
function ReadStream(
|
|
2408
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
2408
|
+
function ReadStream(path2, options) {
|
|
2409
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path2, options);
|
|
2409
2410
|
Stream.call(this);
|
|
2410
2411
|
var self2 = this;
|
|
2411
|
-
this.path =
|
|
2412
|
+
this.path = path2;
|
|
2412
2413
|
this.fd = null;
|
|
2413
2414
|
this.readable = true;
|
|
2414
2415
|
this.paused = false;
|
|
@@ -2442,7 +2443,7 @@ var require_legacy_streams = __commonJS({
|
|
|
2442
2443
|
});
|
|
2443
2444
|
return;
|
|
2444
2445
|
}
|
|
2445
|
-
|
|
2446
|
+
fs6.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
2446
2447
|
if (err) {
|
|
2447
2448
|
self2.emit("error", err);
|
|
2448
2449
|
self2.readable = false;
|
|
@@ -2454,10 +2455,10 @@ var require_legacy_streams = __commonJS({
|
|
|
2454
2455
|
});
|
|
2455
2456
|
}
|
|
2456
2457
|
__name(ReadStream, "ReadStream");
|
|
2457
|
-
function WriteStream(
|
|
2458
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
2458
|
+
function WriteStream(path2, options) {
|
|
2459
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path2, options);
|
|
2459
2460
|
Stream.call(this);
|
|
2460
|
-
this.path =
|
|
2461
|
+
this.path = path2;
|
|
2461
2462
|
this.fd = null;
|
|
2462
2463
|
this.writable = true;
|
|
2463
2464
|
this.flags = "w";
|
|
@@ -2482,7 +2483,7 @@ var require_legacy_streams = __commonJS({
|
|
|
2482
2483
|
this.busy = false;
|
|
2483
2484
|
this._queue = [];
|
|
2484
2485
|
if (this.fd === null) {
|
|
2485
|
-
this._open =
|
|
2486
|
+
this._open = fs6.open;
|
|
2486
2487
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
2487
2488
|
this.flush();
|
|
2488
2489
|
}
|
|
@@ -2520,7 +2521,7 @@ var require_clone = __commonJS({
|
|
|
2520
2521
|
// ../node_modules/graceful-fs/graceful-fs.js
|
|
2521
2522
|
var require_graceful_fs = __commonJS({
|
|
2522
2523
|
"../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
2523
|
-
var
|
|
2524
|
+
var fs6 = __require("fs");
|
|
2524
2525
|
var polyfills = require_polyfills();
|
|
2525
2526
|
var legacy = require_legacy_streams();
|
|
2526
2527
|
var clone3 = require_clone();
|
|
@@ -2554,12 +2555,12 @@ var require_graceful_fs = __commonJS({
|
|
|
2554
2555
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
2555
2556
|
console.error(m);
|
|
2556
2557
|
}, "debug");
|
|
2557
|
-
if (!
|
|
2558
|
+
if (!fs6[gracefulQueue]) {
|
|
2558
2559
|
queue = global[gracefulQueue] || [];
|
|
2559
|
-
publishQueue(
|
|
2560
|
-
|
|
2560
|
+
publishQueue(fs6, queue);
|
|
2561
|
+
fs6.close = function(fs$close) {
|
|
2561
2562
|
function close(fd, cb) {
|
|
2562
|
-
return fs$close.call(
|
|
2563
|
+
return fs$close.call(fs6, fd, function(err) {
|
|
2563
2564
|
if (!err) {
|
|
2564
2565
|
resetQueue();
|
|
2565
2566
|
}
|
|
@@ -2572,10 +2573,10 @@ var require_graceful_fs = __commonJS({
|
|
|
2572
2573
|
value: fs$close
|
|
2573
2574
|
});
|
|
2574
2575
|
return close;
|
|
2575
|
-
}(
|
|
2576
|
-
|
|
2576
|
+
}(fs6.close);
|
|
2577
|
+
fs6.closeSync = function(fs$closeSync) {
|
|
2577
2578
|
function closeSync(fd) {
|
|
2578
|
-
fs$closeSync.apply(
|
|
2579
|
+
fs$closeSync.apply(fs6, arguments);
|
|
2579
2580
|
resetQueue();
|
|
2580
2581
|
}
|
|
2581
2582
|
__name(closeSync, "closeSync");
|
|
@@ -2583,38 +2584,38 @@ var require_graceful_fs = __commonJS({
|
|
|
2583
2584
|
value: fs$closeSync
|
|
2584
2585
|
});
|
|
2585
2586
|
return closeSync;
|
|
2586
|
-
}(
|
|
2587
|
+
}(fs6.closeSync);
|
|
2587
2588
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
2588
2589
|
process.on("exit", function() {
|
|
2589
|
-
debug(
|
|
2590
|
-
__require("assert").equal(
|
|
2590
|
+
debug(fs6[gracefulQueue]);
|
|
2591
|
+
__require("assert").equal(fs6[gracefulQueue].length, 0);
|
|
2591
2592
|
});
|
|
2592
2593
|
}
|
|
2593
2594
|
}
|
|
2594
2595
|
var queue;
|
|
2595
2596
|
if (!global[gracefulQueue]) {
|
|
2596
|
-
publishQueue(global,
|
|
2597
|
-
}
|
|
2598
|
-
module.exports = patch(clone3(
|
|
2599
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
2600
|
-
module.exports = patch(
|
|
2601
|
-
|
|
2602
|
-
}
|
|
2603
|
-
function patch(
|
|
2604
|
-
polyfills(
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
var fs$readFile =
|
|
2609
|
-
|
|
2610
|
-
function readFile5(
|
|
2597
|
+
publishQueue(global, fs6[gracefulQueue]);
|
|
2598
|
+
}
|
|
2599
|
+
module.exports = patch(clone3(fs6));
|
|
2600
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) {
|
|
2601
|
+
module.exports = patch(fs6);
|
|
2602
|
+
fs6.__patched = true;
|
|
2603
|
+
}
|
|
2604
|
+
function patch(fs7) {
|
|
2605
|
+
polyfills(fs7);
|
|
2606
|
+
fs7.gracefulify = patch;
|
|
2607
|
+
fs7.createReadStream = createReadStream;
|
|
2608
|
+
fs7.createWriteStream = createWriteStream2;
|
|
2609
|
+
var fs$readFile = fs7.readFile;
|
|
2610
|
+
fs7.readFile = readFile5;
|
|
2611
|
+
function readFile5(path2, options, cb) {
|
|
2611
2612
|
if (typeof options === "function")
|
|
2612
2613
|
cb = options, options = null;
|
|
2613
|
-
return go$readFile(
|
|
2614
|
-
function go$readFile(
|
|
2615
|
-
return fs$readFile(
|
|
2614
|
+
return go$readFile(path2, options, cb);
|
|
2615
|
+
function go$readFile(path3, options2, cb2, startTime) {
|
|
2616
|
+
return fs$readFile(path3, options2, function(err) {
|
|
2616
2617
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2617
|
-
enqueue([go$readFile, [
|
|
2618
|
+
enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2618
2619
|
else {
|
|
2619
2620
|
if (typeof cb2 === "function")
|
|
2620
2621
|
cb2.apply(this, arguments);
|
|
@@ -2624,16 +2625,16 @@ var require_graceful_fs = __commonJS({
|
|
|
2624
2625
|
__name(go$readFile, "go$readFile");
|
|
2625
2626
|
}
|
|
2626
2627
|
__name(readFile5, "readFile");
|
|
2627
|
-
var fs$writeFile =
|
|
2628
|
-
|
|
2629
|
-
function writeFile4(
|
|
2628
|
+
var fs$writeFile = fs7.writeFile;
|
|
2629
|
+
fs7.writeFile = writeFile4;
|
|
2630
|
+
function writeFile4(path2, data, options, cb) {
|
|
2630
2631
|
if (typeof options === "function")
|
|
2631
2632
|
cb = options, options = null;
|
|
2632
|
-
return go$writeFile(
|
|
2633
|
-
function go$writeFile(
|
|
2634
|
-
return fs$writeFile(
|
|
2633
|
+
return go$writeFile(path2, data, options, cb);
|
|
2634
|
+
function go$writeFile(path3, data2, options2, cb2, startTime) {
|
|
2635
|
+
return fs$writeFile(path3, data2, options2, function(err) {
|
|
2635
2636
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2636
|
-
enqueue([go$writeFile, [
|
|
2637
|
+
enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2637
2638
|
else {
|
|
2638
2639
|
if (typeof cb2 === "function")
|
|
2639
2640
|
cb2.apply(this, arguments);
|
|
@@ -2643,17 +2644,17 @@ var require_graceful_fs = __commonJS({
|
|
|
2643
2644
|
__name(go$writeFile, "go$writeFile");
|
|
2644
2645
|
}
|
|
2645
2646
|
__name(writeFile4, "writeFile");
|
|
2646
|
-
var fs$appendFile =
|
|
2647
|
+
var fs$appendFile = fs7.appendFile;
|
|
2647
2648
|
if (fs$appendFile)
|
|
2648
|
-
|
|
2649
|
-
function appendFile(
|
|
2649
|
+
fs7.appendFile = appendFile;
|
|
2650
|
+
function appendFile(path2, data, options, cb) {
|
|
2650
2651
|
if (typeof options === "function")
|
|
2651
2652
|
cb = options, options = null;
|
|
2652
|
-
return go$appendFile(
|
|
2653
|
-
function go$appendFile(
|
|
2654
|
-
return fs$appendFile(
|
|
2653
|
+
return go$appendFile(path2, data, options, cb);
|
|
2654
|
+
function go$appendFile(path3, data2, options2, cb2, startTime) {
|
|
2655
|
+
return fs$appendFile(path3, data2, options2, function(err) {
|
|
2655
2656
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2656
|
-
enqueue([go$appendFile, [
|
|
2657
|
+
enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2657
2658
|
else {
|
|
2658
2659
|
if (typeof cb2 === "function")
|
|
2659
2660
|
cb2.apply(this, arguments);
|
|
@@ -2663,9 +2664,9 @@ var require_graceful_fs = __commonJS({
|
|
|
2663
2664
|
__name(go$appendFile, "go$appendFile");
|
|
2664
2665
|
}
|
|
2665
2666
|
__name(appendFile, "appendFile");
|
|
2666
|
-
var fs$copyFile =
|
|
2667
|
+
var fs$copyFile = fs7.copyFile;
|
|
2667
2668
|
if (fs$copyFile)
|
|
2668
|
-
|
|
2669
|
+
fs7.copyFile = copyFile;
|
|
2669
2670
|
function copyFile(src, dest, flags, cb) {
|
|
2670
2671
|
if (typeof flags === "function") {
|
|
2671
2672
|
cb = flags;
|
|
@@ -2685,34 +2686,34 @@ var require_graceful_fs = __commonJS({
|
|
|
2685
2686
|
__name(go$copyFile, "go$copyFile");
|
|
2686
2687
|
}
|
|
2687
2688
|
__name(copyFile, "copyFile");
|
|
2688
|
-
var fs$readdir =
|
|
2689
|
-
|
|
2689
|
+
var fs$readdir = fs7.readdir;
|
|
2690
|
+
fs7.readdir = readdir;
|
|
2690
2691
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
2691
|
-
function readdir(
|
|
2692
|
+
function readdir(path2, options, cb) {
|
|
2692
2693
|
if (typeof options === "function")
|
|
2693
2694
|
cb = options, options = null;
|
|
2694
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(
|
|
2695
|
-
return fs$readdir(
|
|
2696
|
-
|
|
2695
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? /* @__PURE__ */ __name(function go$readdir2(path3, options2, cb2, startTime) {
|
|
2696
|
+
return fs$readdir(path3, fs$readdirCallback(
|
|
2697
|
+
path3,
|
|
2697
2698
|
options2,
|
|
2698
2699
|
cb2,
|
|
2699
2700
|
startTime
|
|
2700
2701
|
));
|
|
2701
|
-
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(
|
|
2702
|
-
return fs$readdir(
|
|
2703
|
-
|
|
2702
|
+
}, "go$readdir") : /* @__PURE__ */ __name(function go$readdir2(path3, options2, cb2, startTime) {
|
|
2703
|
+
return fs$readdir(path3, options2, fs$readdirCallback(
|
|
2704
|
+
path3,
|
|
2704
2705
|
options2,
|
|
2705
2706
|
cb2,
|
|
2706
2707
|
startTime
|
|
2707
2708
|
));
|
|
2708
2709
|
}, "go$readdir");
|
|
2709
|
-
return go$readdir(
|
|
2710
|
-
function fs$readdirCallback(
|
|
2710
|
+
return go$readdir(path2, options, cb);
|
|
2711
|
+
function fs$readdirCallback(path3, options2, cb2, startTime) {
|
|
2711
2712
|
return function(err, files) {
|
|
2712
2713
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2713
2714
|
enqueue([
|
|
2714
2715
|
go$readdir,
|
|
2715
|
-
[
|
|
2716
|
+
[path3, options2, cb2],
|
|
2716
2717
|
err,
|
|
2717
2718
|
startTime || Date.now(),
|
|
2718
2719
|
Date.now()
|
|
@@ -2729,21 +2730,21 @@ var require_graceful_fs = __commonJS({
|
|
|
2729
2730
|
}
|
|
2730
2731
|
__name(readdir, "readdir");
|
|
2731
2732
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
2732
|
-
var legStreams = legacy(
|
|
2733
|
+
var legStreams = legacy(fs7);
|
|
2733
2734
|
ReadStream = legStreams.ReadStream;
|
|
2734
2735
|
WriteStream = legStreams.WriteStream;
|
|
2735
2736
|
}
|
|
2736
|
-
var fs$ReadStream =
|
|
2737
|
+
var fs$ReadStream = fs7.ReadStream;
|
|
2737
2738
|
if (fs$ReadStream) {
|
|
2738
2739
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
2739
2740
|
ReadStream.prototype.open = ReadStream$open;
|
|
2740
2741
|
}
|
|
2741
|
-
var fs$WriteStream =
|
|
2742
|
+
var fs$WriteStream = fs7.WriteStream;
|
|
2742
2743
|
if (fs$WriteStream) {
|
|
2743
2744
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
2744
2745
|
WriteStream.prototype.open = WriteStream$open;
|
|
2745
2746
|
}
|
|
2746
|
-
Object.defineProperty(
|
|
2747
|
+
Object.defineProperty(fs7, "ReadStream", {
|
|
2747
2748
|
get: /* @__PURE__ */ __name(function() {
|
|
2748
2749
|
return ReadStream;
|
|
2749
2750
|
}, "get"),
|
|
@@ -2753,7 +2754,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2753
2754
|
enumerable: true,
|
|
2754
2755
|
configurable: true
|
|
2755
2756
|
});
|
|
2756
|
-
Object.defineProperty(
|
|
2757
|
+
Object.defineProperty(fs7, "WriteStream", {
|
|
2757
2758
|
get: /* @__PURE__ */ __name(function() {
|
|
2758
2759
|
return WriteStream;
|
|
2759
2760
|
}, "get"),
|
|
@@ -2764,7 +2765,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2764
2765
|
configurable: true
|
|
2765
2766
|
});
|
|
2766
2767
|
var FileReadStream = ReadStream;
|
|
2767
|
-
Object.defineProperty(
|
|
2768
|
+
Object.defineProperty(fs7, "FileReadStream", {
|
|
2768
2769
|
get: /* @__PURE__ */ __name(function() {
|
|
2769
2770
|
return FileReadStream;
|
|
2770
2771
|
}, "get"),
|
|
@@ -2775,7 +2776,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2775
2776
|
configurable: true
|
|
2776
2777
|
});
|
|
2777
2778
|
var FileWriteStream = WriteStream;
|
|
2778
|
-
Object.defineProperty(
|
|
2779
|
+
Object.defineProperty(fs7, "FileWriteStream", {
|
|
2779
2780
|
get: /* @__PURE__ */ __name(function() {
|
|
2780
2781
|
return FileWriteStream;
|
|
2781
2782
|
}, "get"),
|
|
@@ -2785,7 +2786,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2785
2786
|
enumerable: true,
|
|
2786
2787
|
configurable: true
|
|
2787
2788
|
});
|
|
2788
|
-
function ReadStream(
|
|
2789
|
+
function ReadStream(path2, options) {
|
|
2789
2790
|
if (this instanceof ReadStream)
|
|
2790
2791
|
return fs$ReadStream.apply(this, arguments), this;
|
|
2791
2792
|
else
|
|
@@ -2807,7 +2808,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2807
2808
|
});
|
|
2808
2809
|
}
|
|
2809
2810
|
__name(ReadStream$open, "ReadStream$open");
|
|
2810
|
-
function WriteStream(
|
|
2811
|
+
function WriteStream(path2, options) {
|
|
2811
2812
|
if (this instanceof WriteStream)
|
|
2812
2813
|
return fs$WriteStream.apply(this, arguments), this;
|
|
2813
2814
|
else
|
|
@@ -2827,24 +2828,24 @@ var require_graceful_fs = __commonJS({
|
|
|
2827
2828
|
});
|
|
2828
2829
|
}
|
|
2829
2830
|
__name(WriteStream$open, "WriteStream$open");
|
|
2830
|
-
function createReadStream(
|
|
2831
|
-
return new
|
|
2831
|
+
function createReadStream(path2, options) {
|
|
2832
|
+
return new fs7.ReadStream(path2, options);
|
|
2832
2833
|
}
|
|
2833
2834
|
__name(createReadStream, "createReadStream");
|
|
2834
|
-
function createWriteStream2(
|
|
2835
|
-
return new
|
|
2835
|
+
function createWriteStream2(path2, options) {
|
|
2836
|
+
return new fs7.WriteStream(path2, options);
|
|
2836
2837
|
}
|
|
2837
2838
|
__name(createWriteStream2, "createWriteStream");
|
|
2838
|
-
var fs$open =
|
|
2839
|
-
|
|
2840
|
-
function open2(
|
|
2839
|
+
var fs$open = fs7.open;
|
|
2840
|
+
fs7.open = open2;
|
|
2841
|
+
function open2(path2, flags, mode, cb) {
|
|
2841
2842
|
if (typeof mode === "function")
|
|
2842
2843
|
cb = mode, mode = null;
|
|
2843
|
-
return go$open(
|
|
2844
|
-
function go$open(
|
|
2845
|
-
return fs$open(
|
|
2844
|
+
return go$open(path2, flags, mode, cb);
|
|
2845
|
+
function go$open(path3, flags2, mode2, cb2, startTime) {
|
|
2846
|
+
return fs$open(path3, flags2, mode2, function(err, fd) {
|
|
2846
2847
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
2847
|
-
enqueue([go$open, [
|
|
2848
|
+
enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
2848
2849
|
else {
|
|
2849
2850
|
if (typeof cb2 === "function")
|
|
2850
2851
|
cb2.apply(this, arguments);
|
|
@@ -2854,22 +2855,22 @@ var require_graceful_fs = __commonJS({
|
|
|
2854
2855
|
__name(go$open, "go$open");
|
|
2855
2856
|
}
|
|
2856
2857
|
__name(open2, "open");
|
|
2857
|
-
return
|
|
2858
|
+
return fs7;
|
|
2858
2859
|
}
|
|
2859
2860
|
__name(patch, "patch");
|
|
2860
2861
|
function enqueue(elem) {
|
|
2861
2862
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
2862
|
-
|
|
2863
|
+
fs6[gracefulQueue].push(elem);
|
|
2863
2864
|
retry();
|
|
2864
2865
|
}
|
|
2865
2866
|
__name(enqueue, "enqueue");
|
|
2866
2867
|
var retryTimer;
|
|
2867
2868
|
function resetQueue() {
|
|
2868
2869
|
var now2 = Date.now();
|
|
2869
|
-
for (var i = 0; i <
|
|
2870
|
-
if (
|
|
2871
|
-
|
|
2872
|
-
|
|
2870
|
+
for (var i = 0; i < fs6[gracefulQueue].length; ++i) {
|
|
2871
|
+
if (fs6[gracefulQueue][i].length > 2) {
|
|
2872
|
+
fs6[gracefulQueue][i][3] = now2;
|
|
2873
|
+
fs6[gracefulQueue][i][4] = now2;
|
|
2873
2874
|
}
|
|
2874
2875
|
}
|
|
2875
2876
|
retry();
|
|
@@ -2878,9 +2879,9 @@ var require_graceful_fs = __commonJS({
|
|
|
2878
2879
|
function retry() {
|
|
2879
2880
|
clearTimeout(retryTimer);
|
|
2880
2881
|
retryTimer = void 0;
|
|
2881
|
-
if (
|
|
2882
|
+
if (fs6[gracefulQueue].length === 0)
|
|
2882
2883
|
return;
|
|
2883
|
-
var elem =
|
|
2884
|
+
var elem = fs6[gracefulQueue].shift();
|
|
2884
2885
|
var fn = elem[0];
|
|
2885
2886
|
var args = elem[1];
|
|
2886
2887
|
var err = elem[2];
|
|
@@ -2902,7 +2903,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2902
2903
|
debug("RETRY", fn.name, args);
|
|
2903
2904
|
fn.apply(null, args.concat([startTime]));
|
|
2904
2905
|
} else {
|
|
2905
|
-
|
|
2906
|
+
fs6[gracefulQueue].push(elem);
|
|
2906
2907
|
}
|
|
2907
2908
|
}
|
|
2908
2909
|
if (retryTimer === void 0) {
|
|
@@ -2917,7 +2918,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2917
2918
|
var require_reducePlan = __commonJS({
|
|
2918
2919
|
"../node_modules/watchpack/lib/reducePlan.js"(exports, module) {
|
|
2919
2920
|
"use strict";
|
|
2920
|
-
var
|
|
2921
|
+
var path2 = __require("path");
|
|
2921
2922
|
module.exports = (plan, limit) => {
|
|
2922
2923
|
const treeMap = /* @__PURE__ */ new Map();
|
|
2923
2924
|
for (const [filePath, value] of plan) {
|
|
@@ -2932,7 +2933,7 @@ var require_reducePlan = __commonJS({
|
|
|
2932
2933
|
}
|
|
2933
2934
|
let currentCount = treeMap.size;
|
|
2934
2935
|
for (const node of treeMap.values()) {
|
|
2935
|
-
const parentPath =
|
|
2936
|
+
const parentPath = path2.dirname(node.filePath);
|
|
2936
2937
|
if (parentPath !== node.filePath) {
|
|
2937
2938
|
let parent = treeMap.get(parentPath);
|
|
2938
2939
|
if (parent === void 0) {
|
|
@@ -3026,8 +3027,8 @@ var require_reducePlan = __commonJS({
|
|
|
3026
3027
|
var require_watchEventSource = __commonJS({
|
|
3027
3028
|
"../node_modules/watchpack/lib/watchEventSource.js"(exports) {
|
|
3028
3029
|
"use strict";
|
|
3029
|
-
var
|
|
3030
|
-
var
|
|
3030
|
+
var fs6 = __require("fs");
|
|
3031
|
+
var path2 = __require("path");
|
|
3031
3032
|
var { EventEmitter } = __require("events");
|
|
3032
3033
|
var reducePlan = require_reducePlan();
|
|
3033
3034
|
var IS_OSX = __require("os").platform() === "darwin";
|
|
@@ -3049,7 +3050,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3049
3050
|
__name(createEPERMError, "createEPERMError");
|
|
3050
3051
|
function createHandleChangeEvent(watcher, filePath, handleChangeEvent) {
|
|
3051
3052
|
return (type, filename) => {
|
|
3052
|
-
if (type === "rename" &&
|
|
3053
|
+
if (type === "rename" && path2.isAbsolute(filename) && path2.basename(filename) === path2.basename(filePath)) {
|
|
3053
3054
|
if (!IS_OSX) {
|
|
3054
3055
|
watcher.emit("error", createEPERMError(filename));
|
|
3055
3056
|
}
|
|
@@ -3068,7 +3069,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3068
3069
|
this.watchers = /* @__PURE__ */ new Set();
|
|
3069
3070
|
this.watcher = void 0;
|
|
3070
3071
|
try {
|
|
3071
|
-
const watcher =
|
|
3072
|
+
const watcher = fs6.watch(filePath);
|
|
3072
3073
|
this.watcher = watcher;
|
|
3073
3074
|
const handleChangeEvent = createHandleChangeEvent(
|
|
3074
3075
|
watcher,
|
|
@@ -3120,7 +3121,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3120
3121
|
this.mapPathToWatchers = /* @__PURE__ */ new Map();
|
|
3121
3122
|
this.watcher = void 0;
|
|
3122
3123
|
try {
|
|
3123
|
-
const watcher =
|
|
3124
|
+
const watcher = fs6.watch(rootPath, {
|
|
3124
3125
|
recursive: true
|
|
3125
3126
|
});
|
|
3126
3127
|
this.watcher = watcher;
|
|
@@ -3136,7 +3137,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3136
3137
|
w.emit("change", type);
|
|
3137
3138
|
}
|
|
3138
3139
|
} else {
|
|
3139
|
-
const dir =
|
|
3140
|
+
const dir = path2.dirname(filename);
|
|
3140
3141
|
const watchers = this.mapPathToWatchers.get(dir);
|
|
3141
3142
|
if (recursiveWatcherLogging) {
|
|
3142
3143
|
process.stderr.write(
|
|
@@ -3146,7 +3147,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3146
3147
|
}
|
|
3147
3148
|
if (watchers === void 0) return;
|
|
3148
3149
|
for (const w of watchers) {
|
|
3149
|
-
w.emit("change", type,
|
|
3150
|
+
w.emit("change", type, path2.basename(filename));
|
|
3150
3151
|
}
|
|
3151
3152
|
}
|
|
3152
3153
|
});
|
|
@@ -3265,7 +3266,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3265
3266
|
}
|
|
3266
3267
|
for (const watcher of recursiveWatchers.values()) {
|
|
3267
3268
|
for (const [w, subpath] of watcher.getWatchers()) {
|
|
3268
|
-
addWatcher(w,
|
|
3269
|
+
addWatcher(w, path2.join(watcher.rootPath, subpath));
|
|
3269
3270
|
}
|
|
3270
3271
|
}
|
|
3271
3272
|
for (const watcher of directWatchers.values()) {
|
|
@@ -3321,7 +3322,7 @@ var require_watchEventSource = __commonJS({
|
|
|
3321
3322
|
recursiveWatcher.add(filePath, watcher);
|
|
3322
3323
|
return watcher;
|
|
3323
3324
|
}
|
|
3324
|
-
const parent =
|
|
3325
|
+
const parent = path2.dirname(current);
|
|
3325
3326
|
if (parent === current) break;
|
|
3326
3327
|
current = parent;
|
|
3327
3328
|
}
|
|
@@ -3351,8 +3352,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3351
3352
|
"../node_modules/watchpack/lib/DirectoryWatcher.js"(exports, module) {
|
|
3352
3353
|
"use strict";
|
|
3353
3354
|
var EventEmitter = __require("events").EventEmitter;
|
|
3354
|
-
var
|
|
3355
|
-
var
|
|
3355
|
+
var fs6 = require_graceful_fs();
|
|
3356
|
+
var path2 = __require("path");
|
|
3356
3357
|
var watchEventSource = require_watchEventSource();
|
|
3357
3358
|
var EXISTANCE_ONLY_TIME_ENTRY = Object.freeze({});
|
|
3358
3359
|
var FS_ACCURACY = 2e3;
|
|
@@ -3448,8 +3449,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3448
3449
|
this.onWatcherError(err);
|
|
3449
3450
|
}
|
|
3450
3451
|
}
|
|
3451
|
-
forEachWatcher(
|
|
3452
|
-
const watchers = this.watchers.get(withoutCase(
|
|
3452
|
+
forEachWatcher(path3, fn) {
|
|
3453
|
+
const watchers = this.watchers.get(withoutCase(path3));
|
|
3453
3454
|
if (watchers !== void 0) {
|
|
3454
3455
|
for (const w of watchers) {
|
|
3455
3456
|
fn(w);
|
|
@@ -3677,14 +3678,14 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3677
3678
|
this.doScan(false);
|
|
3678
3679
|
return;
|
|
3679
3680
|
}
|
|
3680
|
-
const filePath =
|
|
3681
|
+
const filePath = path2.join(this.path, filename);
|
|
3681
3682
|
if (this.ignored(filePath)) return;
|
|
3682
3683
|
if (this._activeEvents.get(filename) === void 0) {
|
|
3683
3684
|
this._activeEvents.set(filename, false);
|
|
3684
3685
|
const checkStats = /* @__PURE__ */ __name(() => {
|
|
3685
3686
|
if (this.closed) return;
|
|
3686
3687
|
this._activeEvents.set(filename, false);
|
|
3687
|
-
|
|
3688
|
+
fs6.lstat(filePath, (err, stats) => {
|
|
3688
3689
|
if (this.closed) return;
|
|
3689
3690
|
if (this._activeEvents.get(filename) === true) {
|
|
3690
3691
|
process.nextTick(checkStats);
|
|
@@ -3695,8 +3696,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3695
3696
|
if (err.code !== "ENOENT" && err.code !== "EPERM" && err.code !== "EBUSY") {
|
|
3696
3697
|
this.onStatsError(err);
|
|
3697
3698
|
} else {
|
|
3698
|
-
if (filename ===
|
|
3699
|
-
if (!
|
|
3699
|
+
if (filename === path2.basename(this.path)) {
|
|
3700
|
+
if (!fs6.existsSync(this.path)) {
|
|
3700
3701
|
this.onDirectoryRemoved("stat failed");
|
|
3701
3702
|
}
|
|
3702
3703
|
}
|
|
@@ -3775,8 +3776,8 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3775
3776
|
}
|
|
3776
3777
|
watchInParentDirectory() {
|
|
3777
3778
|
if (!this.parentWatcher) {
|
|
3778
|
-
const parentDir =
|
|
3779
|
-
if (
|
|
3779
|
+
const parentDir = path2.dirname(this.path);
|
|
3780
|
+
if (path2.dirname(parentDir) === parentDir) return;
|
|
3780
3781
|
this.parentWatcher = this.watcherManager.watchFile(this.path, 1);
|
|
3781
3782
|
this.parentWatcher.on("change", (mtime, type) => {
|
|
3782
3783
|
if (this.closed) return;
|
|
@@ -3815,7 +3816,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3815
3816
|
}
|
|
3816
3817
|
process.nextTick(() => {
|
|
3817
3818
|
if (this.closed) return;
|
|
3818
|
-
|
|
3819
|
+
fs6.readdir(this.path, (err, items) => {
|
|
3819
3820
|
if (this.closed) return;
|
|
3820
3821
|
if (err) {
|
|
3821
3822
|
if (err.code === "ENOENT" || err.code === "EPERM") {
|
|
@@ -3846,7 +3847,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3846
3847
|
return;
|
|
3847
3848
|
}
|
|
3848
3849
|
const itemPaths = new Set(
|
|
3849
|
-
items.map((item) =>
|
|
3850
|
+
items.map((item) => path2.join(this.path, item.normalize("NFC")))
|
|
3850
3851
|
);
|
|
3851
3852
|
for (const file of this.files.keys()) {
|
|
3852
3853
|
if (!itemPaths.has(file)) {
|
|
@@ -3894,7 +3895,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3894
3895
|
}
|
|
3895
3896
|
});
|
|
3896
3897
|
for (const itemPath of itemPaths) {
|
|
3897
|
-
|
|
3898
|
+
fs6.lstat(itemPath, (err2, stats) => {
|
|
3898
3899
|
if (this.closed) return;
|
|
3899
3900
|
if (err2) {
|
|
3900
3901
|
if (err2.code === "ENOENT" || err2.code === "EPERM" || err2.code === "EACCES" || err2.code === "EBUSY" || // TODO https://github.com/libuv/libuv/pull/4566
|
|
@@ -3955,9 +3956,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3955
3956
|
if (!this.initialScan) {
|
|
3956
3957
|
for (const watchers of this.watchers.values()) {
|
|
3957
3958
|
for (const watcher of watchers) {
|
|
3958
|
-
const
|
|
3959
|
-
if (!Object.prototype.hasOwnProperty.call(obj,
|
|
3960
|
-
obj[
|
|
3959
|
+
const path3 = watcher.path;
|
|
3960
|
+
if (!Object.prototype.hasOwnProperty.call(obj, path3)) {
|
|
3961
|
+
obj[path3] = null;
|
|
3961
3962
|
}
|
|
3962
3963
|
}
|
|
3963
3964
|
}
|
|
@@ -3997,9 +3998,9 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
3997
3998
|
if (!this.initialScan) {
|
|
3998
3999
|
for (const watchers of this.watchers.values()) {
|
|
3999
4000
|
for (const watcher of watchers) {
|
|
4000
|
-
const
|
|
4001
|
-
if (!fileTimestamps.has(
|
|
4002
|
-
fileTimestamps.set(
|
|
4001
|
+
const path3 = watcher.path;
|
|
4002
|
+
if (!fileTimestamps.has(path3)) {
|
|
4003
|
+
fileTimestamps.set(path3, null);
|
|
4003
4004
|
}
|
|
4004
4005
|
}
|
|
4005
4006
|
}
|
|
@@ -4050,7 +4051,7 @@ var require_DirectoryWatcher = __commonJS({
|
|
|
4050
4051
|
var require_getWatcherManager = __commonJS({
|
|
4051
4052
|
"../node_modules/watchpack/lib/getWatcherManager.js"(exports, module) {
|
|
4052
4053
|
"use strict";
|
|
4053
|
-
var
|
|
4054
|
+
var path2 = __require("path");
|
|
4054
4055
|
var DirectoryWatcher = require_DirectoryWatcher();
|
|
4055
4056
|
var WatcherManager = class {
|
|
4056
4057
|
static {
|
|
@@ -4073,7 +4074,7 @@ var require_getWatcherManager = __commonJS({
|
|
|
4073
4074
|
return watcher;
|
|
4074
4075
|
}
|
|
4075
4076
|
watchFile(p, startTime) {
|
|
4076
|
-
const directory =
|
|
4077
|
+
const directory = path2.dirname(p);
|
|
4077
4078
|
if (directory === p) return null;
|
|
4078
4079
|
return this.getDirectoryWatcher(directory).watch(p, startTime);
|
|
4079
4080
|
}
|
|
@@ -4097,8 +4098,8 @@ var require_getWatcherManager = __commonJS({
|
|
|
4097
4098
|
var require_LinkResolver = __commonJS({
|
|
4098
4099
|
"../node_modules/watchpack/lib/LinkResolver.js"(exports, module) {
|
|
4099
4100
|
"use strict";
|
|
4100
|
-
var
|
|
4101
|
-
var
|
|
4101
|
+
var fs6 = __require("fs");
|
|
4102
|
+
var path2 = __require("path");
|
|
4102
4103
|
var EXPECTED_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOENT"]);
|
|
4103
4104
|
if (process.platform === "win32") EXPECTED_ERRORS.add("UNKNOWN");
|
|
4104
4105
|
var LinkResolver = class {
|
|
@@ -4117,7 +4118,7 @@ var require_LinkResolver = __commonJS({
|
|
|
4117
4118
|
if (cacheEntry !== void 0) {
|
|
4118
4119
|
return cacheEntry;
|
|
4119
4120
|
}
|
|
4120
|
-
const parent =
|
|
4121
|
+
const parent = path2.dirname(file);
|
|
4121
4122
|
if (parent === file) {
|
|
4122
4123
|
const result2 = Object.freeze([file]);
|
|
4123
4124
|
this.cache.set(file, result2);
|
|
@@ -4126,12 +4127,12 @@ var require_LinkResolver = __commonJS({
|
|
|
4126
4127
|
const parentResolved = this.resolve(parent);
|
|
4127
4128
|
let realFile = file;
|
|
4128
4129
|
if (parentResolved[0] !== parent) {
|
|
4129
|
-
const basename4 =
|
|
4130
|
-
realFile =
|
|
4130
|
+
const basename4 = path2.basename(file);
|
|
4131
|
+
realFile = path2.resolve(parentResolved[0], basename4);
|
|
4131
4132
|
}
|
|
4132
4133
|
try {
|
|
4133
|
-
const linkContent =
|
|
4134
|
-
const resolvedLink =
|
|
4134
|
+
const linkContent = fs6.readlinkSync(realFile);
|
|
4135
|
+
const resolvedLink = path2.resolve(parentResolved[0], linkContent);
|
|
4135
4136
|
const linkResolved = this.resolve(resolvedLink);
|
|
4136
4137
|
let result2;
|
|
4137
4138
|
if (linkResolved.length > 1 && parentResolved.length > 1) {
|
|
@@ -4451,7 +4452,7 @@ var require_watchpack = __commonJS({
|
|
|
4451
4452
|
const fileWatchers = this.fileWatchers;
|
|
4452
4453
|
const directoryWatchers = this.directoryWatchers;
|
|
4453
4454
|
const ignored = this.watcherOptions.ignored;
|
|
4454
|
-
const filter2 = /* @__PURE__ */ __name((
|
|
4455
|
+
const filter2 = /* @__PURE__ */ __name((path2) => !ignored(path2), "filter");
|
|
4455
4456
|
const addToMap = /* @__PURE__ */ __name((map2, key, item) => {
|
|
4456
4457
|
const list = map2.get(key);
|
|
4457
4458
|
if (list === void 0) {
|
|
@@ -6042,18 +6043,18 @@ var require_dist2 = __commonJS({
|
|
|
6042
6043
|
}
|
|
6043
6044
|
__name(toKey2, "toKey");
|
|
6044
6045
|
var toKey_default = toKey2;
|
|
6045
|
-
function baseGet(object,
|
|
6046
|
-
|
|
6047
|
-
var index = 0, length =
|
|
6046
|
+
function baseGet(object, path2) {
|
|
6047
|
+
path2 = castPath_default(path2, object);
|
|
6048
|
+
var index = 0, length = path2.length;
|
|
6048
6049
|
while (object != null && index < length) {
|
|
6049
|
-
object = object[toKey_default(
|
|
6050
|
+
object = object[toKey_default(path2[index++])];
|
|
6050
6051
|
}
|
|
6051
6052
|
return index && index == length ? object : void 0;
|
|
6052
6053
|
}
|
|
6053
6054
|
__name(baseGet, "baseGet");
|
|
6054
6055
|
var baseGet_default = baseGet;
|
|
6055
|
-
function get2(object,
|
|
6056
|
-
var result2 = object == null ? void 0 : baseGet_default(object,
|
|
6056
|
+
function get2(object, path2, defaultValue) {
|
|
6057
|
+
var result2 = object == null ? void 0 : baseGet_default(object, path2);
|
|
6057
6058
|
return result2 === void 0 ? defaultValue : result2;
|
|
6058
6059
|
}
|
|
6059
6060
|
__name(get2, "get");
|
|
@@ -6361,561 +6362,27 @@ var require_dist2 = __commonJS({
|
|
|
6361
6362
|
}
|
|
6362
6363
|
});
|
|
6363
6364
|
|
|
6364
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/common-name.js
|
|
6365
|
-
var require_common_name = __commonJS({
|
|
6366
|
-
"../node_modules/@aw-web-design/x-default-browser/src/common-name.js"(exports, module) {
|
|
6367
|
-
module.exports = function(out) {
|
|
6368
|
-
return out.isEdge ? "edge" : out.isIE ? "ie" : out.isFirefox ? "firefox" : out.isChrome ? "chrome" : out.isChromium ? "chromium" : out.isOpera ? "opera" : out.isSafari ? "safari" : "unknown";
|
|
6369
|
-
};
|
|
6370
|
-
}
|
|
6371
|
-
});
|
|
6372
|
-
|
|
6373
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/detect-windows10.js
|
|
6374
|
-
var require_detect_windows10 = __commonJS({
|
|
6375
|
-
"../node_modules/@aw-web-design/x-default-browser/src/detect-windows10.js"(exports, module) {
|
|
6376
|
-
var exec = __require("child_process").exec;
|
|
6377
|
-
module.exports = function(callback) {
|
|
6378
|
-
var registryQuery = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\URLAssociations\\http\\UserChoice";
|
|
6379
|
-
var command = "reg query " + registryQuery + ' | findstr "ProgId"';
|
|
6380
|
-
exec(command, function(err, stdout, stderr) {
|
|
6381
|
-
var value;
|
|
6382
|
-
if (err) {
|
|
6383
|
-
if (stderr.length > 0) {
|
|
6384
|
-
return callback("Unable to execute the query: " + err);
|
|
6385
|
-
} else {
|
|
6386
|
-
value = "iexplore.exe";
|
|
6387
|
-
}
|
|
6388
|
-
}
|
|
6389
|
-
if (!value) {
|
|
6390
|
-
stdout = stdout.trim().replace(/\s\s+/g, " ");
|
|
6391
|
-
var split2 = stdout.split(" ");
|
|
6392
|
-
value = split2[2].toLowerCase();
|
|
6393
|
-
}
|
|
6394
|
-
var out = {
|
|
6395
|
-
isEdge: value.indexOf("app") > -1,
|
|
6396
|
-
// AppXq0fevzme2pys62n3e0fbqa7peapykr8v
|
|
6397
|
-
isIE: value.indexOf("ie.http") > -1,
|
|
6398
|
-
// IE.HTTP
|
|
6399
|
-
isSafari: value.indexOf("safari") > -1,
|
|
6400
|
-
// SafariURL
|
|
6401
|
-
isFirefox: value.indexOf("firefox") > -1,
|
|
6402
|
-
// FirefoxURL
|
|
6403
|
-
isChrome: value.indexOf("chrome") > -1,
|
|
6404
|
-
// ChromeHTML
|
|
6405
|
-
isChromium: value.indexOf("chromium") > -1,
|
|
6406
|
-
isOpera: value.indexOf("opera") > -1,
|
|
6407
|
-
// OperaHTML
|
|
6408
|
-
identity: value
|
|
6409
|
-
};
|
|
6410
|
-
out.isBlink = out.isChrome || out.isChromium || out.isOpera;
|
|
6411
|
-
out.isWebkit = out.isSafari || out.isBlink;
|
|
6412
|
-
out.commonName = require_common_name()(out);
|
|
6413
|
-
callback(null, out);
|
|
6414
|
-
});
|
|
6415
|
-
};
|
|
6416
|
-
}
|
|
6417
|
-
});
|
|
6418
|
-
|
|
6419
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/detect-windows.js
|
|
6420
|
-
var require_detect_windows = __commonJS({
|
|
6421
|
-
"../node_modules/@aw-web-design/x-default-browser/src/detect-windows.js"(exports, module) {
|
|
6422
|
-
var exec = __require("child_process").exec;
|
|
6423
|
-
module.exports = function(callback) {
|
|
6424
|
-
var registryQuery = "HKCU\\Software\\Clients\\StartMenuInternet";
|
|
6425
|
-
var command = "reg query " + registryQuery + ' | findstr "REG_SZ"';
|
|
6426
|
-
exec(command, function(err, stdout, stderr) {
|
|
6427
|
-
var value;
|
|
6428
|
-
if (err) {
|
|
6429
|
-
if (stderr.length > 0) {
|
|
6430
|
-
return callback("Unable to execute the query: " + err);
|
|
6431
|
-
} else {
|
|
6432
|
-
value = "iexplore.exe";
|
|
6433
|
-
}
|
|
6434
|
-
}
|
|
6435
|
-
if (!value) {
|
|
6436
|
-
stdout = stdout.replace("NO NAME", "NONAME");
|
|
6437
|
-
var split2 = stdout.trim().split(/(\t| +)/);
|
|
6438
|
-
value = (split2[4] + (split2[5] || "") + (split2[6] || "")).toLowerCase();
|
|
6439
|
-
}
|
|
6440
|
-
var out = {
|
|
6441
|
-
isIE: value.indexOf("iexplore") > -1,
|
|
6442
|
-
// IEXPLORE.EXE / -
|
|
6443
|
-
isSafari: value.indexOf("safari") > -1,
|
|
6444
|
-
// Safari.exe
|
|
6445
|
-
// works also for nightly
|
|
6446
|
-
isFirefox: value.indexOf("firefox") > -1,
|
|
6447
|
-
// FIREFOX.EXE / "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -osint -url "%1"
|
|
6448
|
-
// note that both chrome and chromium are chrome.exe! we can't look for 'chrome' hence
|
|
6449
|
-
isChrome: value.indexOf("google") > -1,
|
|
6450
|
-
// Google Chrome / "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"
|
|
6451
|
-
isChromium: value.indexOf("chromium") > -1,
|
|
6452
|
-
// Chromium.<randomstring> / "C:\Users\<username>\AppData\Local\Chromium\Application\chrome.exe" -- "%1"
|
|
6453
|
-
isOpera: value.indexOf("opera") > -1,
|
|
6454
|
-
// OperaStable / "C:\Program Files (x86)\Opera\launcher.exe" -noautoupdate -- "%1"
|
|
6455
|
-
identity: value
|
|
6456
|
-
};
|
|
6457
|
-
out.isBlink = out.isChrome || out.isChromium || out.isOpera;
|
|
6458
|
-
out.isWebkit = out.isSafari || out.isBlink;
|
|
6459
|
-
out.commonName = require_common_name()(out);
|
|
6460
|
-
callback(null, out);
|
|
6461
|
-
});
|
|
6462
|
-
};
|
|
6463
|
-
}
|
|
6464
|
-
});
|
|
6465
|
-
|
|
6466
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/detect-mac.js
|
|
6467
|
-
var require_detect_mac = __commonJS({
|
|
6468
|
-
"../node_modules/@aw-web-design/x-default-browser/src/detect-mac.js"(exports, module) {
|
|
6469
|
-
var defaultBrowserId = import("../_node-chunks/default-browser-id-4RZZMHJE.js");
|
|
6470
|
-
module.exports = async function(callback) {
|
|
6471
|
-
const id = await defaultBrowserId.then((res) => res.default());
|
|
6472
|
-
if (id) {
|
|
6473
|
-
const idLC = id.toLowerCase();
|
|
6474
|
-
const out = {
|
|
6475
|
-
isIE: false,
|
|
6476
|
-
isSafari: idLC.indexOf("safari") > -1,
|
|
6477
|
-
isFirefox: idLC.indexOf("firefox") > -1,
|
|
6478
|
-
isChrome: idLC.indexOf("google") > -1,
|
|
6479
|
-
isChromium: idLC.indexOf("chromium") > -1,
|
|
6480
|
-
// untested
|
|
6481
|
-
isOpera: idLC.indexOf("opera") > -1,
|
|
6482
|
-
identity: id
|
|
6483
|
-
};
|
|
6484
|
-
out.isBlink = out.isChrome || out.isChromium || out.isOpera;
|
|
6485
|
-
out.isWebkit = out.isSafari || out.isBlink;
|
|
6486
|
-
out.commonName = require_common_name()(out);
|
|
6487
|
-
callback(null, out);
|
|
6488
|
-
} else {
|
|
6489
|
-
callback("Unable to retrieve default browser");
|
|
6490
|
-
}
|
|
6491
|
-
};
|
|
6492
|
-
}
|
|
6493
|
-
});
|
|
6494
|
-
|
|
6495
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/detect-linux.js
|
|
6496
|
-
var require_detect_linux = __commonJS({
|
|
6497
|
-
"../node_modules/@aw-web-design/x-default-browser/src/detect-linux.js"(exports, module) {
|
|
6498
|
-
var exec = __require("child_process").exec;
|
|
6499
|
-
module.exports = function(callback) {
|
|
6500
|
-
var command = "xdg-mime query default x-scheme-handler/http";
|
|
6501
|
-
exec(command, function(err, stdout, stderr) {
|
|
6502
|
-
if (err) {
|
|
6503
|
-
callback("Unable to execute the query: " + err + "\n" + stderr);
|
|
6504
|
-
return;
|
|
6505
|
-
}
|
|
6506
|
-
var value = stdout;
|
|
6507
|
-
var out = {
|
|
6508
|
-
isIE: false,
|
|
6509
|
-
isSafari: false,
|
|
6510
|
-
isFirefox: value.indexOf("firefox") > -1,
|
|
6511
|
-
isChrome: value.indexOf("google") > -1,
|
|
6512
|
-
isChromium: value.indexOf("chromium") > -1,
|
|
6513
|
-
isOpera: value.indexOf("opera") > -1,
|
|
6514
|
-
identity: value
|
|
6515
|
-
};
|
|
6516
|
-
out.isWebkit = out.isBlink = out.isChrome || out.isChromium || out.isOpera;
|
|
6517
|
-
out.commonName = require_common_name()(out);
|
|
6518
|
-
callback(null, out);
|
|
6519
|
-
});
|
|
6520
|
-
};
|
|
6521
|
-
}
|
|
6522
|
-
});
|
|
6523
|
-
|
|
6524
|
-
// ../node_modules/@aw-web-design/x-default-browser/src/detect-stub.js
|
|
6525
|
-
var require_detect_stub = __commonJS({
|
|
6526
|
-
"../node_modules/@aw-web-design/x-default-browser/src/detect-stub.js"(exports, module) {
|
|
6527
|
-
module.exports = function(callback) {
|
|
6528
|
-
callback("Your platform is not supported, sorry. Patches welcome.");
|
|
6529
|
-
};
|
|
6530
|
-
}
|
|
6531
|
-
});
|
|
6532
|
-
|
|
6533
|
-
// ../node_modules/@aw-web-design/x-default-browser/index.js
|
|
6534
|
-
var require_x_default_browser = __commonJS({
|
|
6535
|
-
"../node_modules/@aw-web-design/x-default-browser/index.js"(exports, module) {
|
|
6536
|
-
var detect;
|
|
6537
|
-
var os2 = __require("os");
|
|
6538
|
-
if (os2.platform() == "win32") {
|
|
6539
|
-
if (os2.release().indexOf("10.") == 0)
|
|
6540
|
-
detect = require_detect_windows10();
|
|
6541
|
-
else
|
|
6542
|
-
detect = require_detect_windows();
|
|
6543
|
-
} else if (os2.platform() == "darwin") {
|
|
6544
|
-
detect = require_detect_mac();
|
|
6545
|
-
} else if (os2.platform() == "linux" || os2.platform() == "freebsd") {
|
|
6546
|
-
detect = require_detect_linux();
|
|
6547
|
-
} else {
|
|
6548
|
-
detect = require_detect_stub();
|
|
6549
|
-
}
|
|
6550
|
-
module.exports = detect;
|
|
6551
|
-
}
|
|
6552
|
-
});
|
|
6553
|
-
|
|
6554
|
-
// ../node_modules/is-docker/index.js
|
|
6555
|
-
var require_is_docker = __commonJS({
|
|
6556
|
-
"../node_modules/is-docker/index.js"(exports, module) {
|
|
6557
|
-
"use strict";
|
|
6558
|
-
var fs = __require("fs");
|
|
6559
|
-
var isDocker;
|
|
6560
|
-
function hasDockerEnv() {
|
|
6561
|
-
try {
|
|
6562
|
-
fs.statSync("/.dockerenv");
|
|
6563
|
-
return true;
|
|
6564
|
-
} catch (_) {
|
|
6565
|
-
return false;
|
|
6566
|
-
}
|
|
6567
|
-
}
|
|
6568
|
-
__name(hasDockerEnv, "hasDockerEnv");
|
|
6569
|
-
function hasDockerCGroup() {
|
|
6570
|
-
try {
|
|
6571
|
-
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
6572
|
-
} catch (_) {
|
|
6573
|
-
return false;
|
|
6574
|
-
}
|
|
6575
|
-
}
|
|
6576
|
-
__name(hasDockerCGroup, "hasDockerCGroup");
|
|
6577
|
-
module.exports = () => {
|
|
6578
|
-
if (isDocker === void 0) {
|
|
6579
|
-
isDocker = hasDockerEnv() || hasDockerCGroup();
|
|
6580
|
-
}
|
|
6581
|
-
return isDocker;
|
|
6582
|
-
};
|
|
6583
|
-
}
|
|
6584
|
-
});
|
|
6585
|
-
|
|
6586
|
-
// ../node_modules/open/node_modules/is-wsl/index.js
|
|
6587
|
-
var require_is_wsl = __commonJS({
|
|
6588
|
-
"../node_modules/open/node_modules/is-wsl/index.js"(exports, module) {
|
|
6589
|
-
"use strict";
|
|
6590
|
-
var os2 = __require("os");
|
|
6591
|
-
var fs = __require("fs");
|
|
6592
|
-
var isDocker = require_is_docker();
|
|
6593
|
-
var isWsl = /* @__PURE__ */ __name(() => {
|
|
6594
|
-
if (process.platform !== "linux") {
|
|
6595
|
-
return false;
|
|
6596
|
-
}
|
|
6597
|
-
if (os2.release().toLowerCase().includes("microsoft")) {
|
|
6598
|
-
if (isDocker()) {
|
|
6599
|
-
return false;
|
|
6600
|
-
}
|
|
6601
|
-
return true;
|
|
6602
|
-
}
|
|
6603
|
-
try {
|
|
6604
|
-
return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
6605
|
-
} catch (_) {
|
|
6606
|
-
return false;
|
|
6607
|
-
}
|
|
6608
|
-
}, "isWsl");
|
|
6609
|
-
if (process.env.__IS_WSL_TEST__) {
|
|
6610
|
-
module.exports = isWsl;
|
|
6611
|
-
} else {
|
|
6612
|
-
module.exports = isWsl();
|
|
6613
|
-
}
|
|
6614
|
-
}
|
|
6615
|
-
});
|
|
6616
|
-
|
|
6617
|
-
// ../node_modules/open/node_modules/define-lazy-prop/index.js
|
|
6618
|
-
var require_define_lazy_prop = __commonJS({
|
|
6619
|
-
"../node_modules/open/node_modules/define-lazy-prop/index.js"(exports, module) {
|
|
6620
|
-
"use strict";
|
|
6621
|
-
module.exports = (object, propertyName, fn) => {
|
|
6622
|
-
const define = /* @__PURE__ */ __name((value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true }), "define");
|
|
6623
|
-
Object.defineProperty(object, propertyName, {
|
|
6624
|
-
configurable: true,
|
|
6625
|
-
enumerable: true,
|
|
6626
|
-
get() {
|
|
6627
|
-
const result2 = fn();
|
|
6628
|
-
define(result2);
|
|
6629
|
-
return result2;
|
|
6630
|
-
},
|
|
6631
|
-
set(value) {
|
|
6632
|
-
define(value);
|
|
6633
|
-
}
|
|
6634
|
-
});
|
|
6635
|
-
return object;
|
|
6636
|
-
};
|
|
6637
|
-
}
|
|
6638
|
-
});
|
|
6639
|
-
|
|
6640
|
-
// ../node_modules/open/index.js
|
|
6641
|
-
var require_open = __commonJS({
|
|
6642
|
-
"../node_modules/open/index.js"(exports, module) {
|
|
6643
|
-
var path = __require("path");
|
|
6644
|
-
var childProcess = __require("child_process");
|
|
6645
|
-
var { promises: fs, constants: fsConstants } = __require("fs");
|
|
6646
|
-
var isWsl = require_is_wsl();
|
|
6647
|
-
var isDocker = require_is_docker();
|
|
6648
|
-
var defineLazyProperty = require_define_lazy_prop();
|
|
6649
|
-
var localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
6650
|
-
var { platform, arch } = process;
|
|
6651
|
-
var hasContainerEnv = /* @__PURE__ */ __name(() => {
|
|
6652
|
-
try {
|
|
6653
|
-
fs.statSync("/run/.containerenv");
|
|
6654
|
-
return true;
|
|
6655
|
-
} catch {
|
|
6656
|
-
return false;
|
|
6657
|
-
}
|
|
6658
|
-
}, "hasContainerEnv");
|
|
6659
|
-
var cachedResult;
|
|
6660
|
-
function isInsideContainer() {
|
|
6661
|
-
if (cachedResult === void 0) {
|
|
6662
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
6663
|
-
}
|
|
6664
|
-
return cachedResult;
|
|
6665
|
-
}
|
|
6666
|
-
__name(isInsideContainer, "isInsideContainer");
|
|
6667
|
-
var getWslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
6668
|
-
const defaultMountPoint = "/mnt/";
|
|
6669
|
-
let mountPoint;
|
|
6670
|
-
return async function() {
|
|
6671
|
-
if (mountPoint) {
|
|
6672
|
-
return mountPoint;
|
|
6673
|
-
}
|
|
6674
|
-
const configFilePath = "/etc/wsl.conf";
|
|
6675
|
-
let isConfigFileExists = false;
|
|
6676
|
-
try {
|
|
6677
|
-
await fs.access(configFilePath, fsConstants.F_OK);
|
|
6678
|
-
isConfigFileExists = true;
|
|
6679
|
-
} catch {
|
|
6680
|
-
}
|
|
6681
|
-
if (!isConfigFileExists) {
|
|
6682
|
-
return defaultMountPoint;
|
|
6683
|
-
}
|
|
6684
|
-
const configContent = await fs.readFile(configFilePath, { encoding: "utf8" });
|
|
6685
|
-
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
6686
|
-
if (!configMountPoint) {
|
|
6687
|
-
return defaultMountPoint;
|
|
6688
|
-
}
|
|
6689
|
-
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
6690
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
6691
|
-
return mountPoint;
|
|
6692
|
-
};
|
|
6693
|
-
})();
|
|
6694
|
-
var pTryEach = /* @__PURE__ */ __name(async (array, mapper) => {
|
|
6695
|
-
let latestError;
|
|
6696
|
-
for (const item of array) {
|
|
6697
|
-
try {
|
|
6698
|
-
return await mapper(item);
|
|
6699
|
-
} catch (error) {
|
|
6700
|
-
latestError = error;
|
|
6701
|
-
}
|
|
6702
|
-
}
|
|
6703
|
-
throw latestError;
|
|
6704
|
-
}, "pTryEach");
|
|
6705
|
-
var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
6706
|
-
options = {
|
|
6707
|
-
wait: false,
|
|
6708
|
-
background: false,
|
|
6709
|
-
newInstance: false,
|
|
6710
|
-
allowNonzeroExitCode: false,
|
|
6711
|
-
...options
|
|
6712
|
-
};
|
|
6713
|
-
if (Array.isArray(options.app)) {
|
|
6714
|
-
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
6715
|
-
...options,
|
|
6716
|
-
app: singleApp
|
|
6717
|
-
}));
|
|
6718
|
-
}
|
|
6719
|
-
let { name: app, arguments: appArguments = [] } = options.app || {};
|
|
6720
|
-
appArguments = [...appArguments];
|
|
6721
|
-
if (Array.isArray(app)) {
|
|
6722
|
-
return pTryEach(app, (appName) => baseOpen({
|
|
6723
|
-
...options,
|
|
6724
|
-
app: {
|
|
6725
|
-
name: appName,
|
|
6726
|
-
arguments: appArguments
|
|
6727
|
-
}
|
|
6728
|
-
}));
|
|
6729
|
-
}
|
|
6730
|
-
let command;
|
|
6731
|
-
const cliArguments = [];
|
|
6732
|
-
const childProcessOptions = {};
|
|
6733
|
-
if (platform === "darwin") {
|
|
6734
|
-
command = "open";
|
|
6735
|
-
if (options.wait) {
|
|
6736
|
-
cliArguments.push("--wait-apps");
|
|
6737
|
-
}
|
|
6738
|
-
if (options.background) {
|
|
6739
|
-
cliArguments.push("--background");
|
|
6740
|
-
}
|
|
6741
|
-
if (options.newInstance) {
|
|
6742
|
-
cliArguments.push("--new");
|
|
6743
|
-
}
|
|
6744
|
-
if (app) {
|
|
6745
|
-
cliArguments.push("-a", app);
|
|
6746
|
-
}
|
|
6747
|
-
} else if (platform === "win32" || isWsl && !isInsideContainer() && !app) {
|
|
6748
|
-
const mountPoint = await getWslDrivesMountPoint();
|
|
6749
|
-
command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
6750
|
-
cliArguments.push(
|
|
6751
|
-
"-NoProfile",
|
|
6752
|
-
"-NonInteractive",
|
|
6753
|
-
"\u2013ExecutionPolicy",
|
|
6754
|
-
"Bypass",
|
|
6755
|
-
"-EncodedCommand"
|
|
6756
|
-
);
|
|
6757
|
-
if (!isWsl) {
|
|
6758
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
6759
|
-
}
|
|
6760
|
-
const encodedArguments = ["Start"];
|
|
6761
|
-
if (options.wait) {
|
|
6762
|
-
encodedArguments.push("-Wait");
|
|
6763
|
-
}
|
|
6764
|
-
if (app) {
|
|
6765
|
-
encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
|
|
6766
|
-
if (options.target) {
|
|
6767
|
-
appArguments.unshift(options.target);
|
|
6768
|
-
}
|
|
6769
|
-
} else if (options.target) {
|
|
6770
|
-
encodedArguments.push(`"${options.target}"`);
|
|
6771
|
-
}
|
|
6772
|
-
if (appArguments.length > 0) {
|
|
6773
|
-
appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
|
|
6774
|
-
encodedArguments.push(appArguments.join(","));
|
|
6775
|
-
}
|
|
6776
|
-
options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
6777
|
-
} else {
|
|
6778
|
-
if (app) {
|
|
6779
|
-
command = app;
|
|
6780
|
-
} else {
|
|
6781
|
-
const isBundled = !__dirname || __dirname === "/";
|
|
6782
|
-
let exeLocalXdgOpen = false;
|
|
6783
|
-
try {
|
|
6784
|
-
await fs.access(localXdgOpenPath, fsConstants.X_OK);
|
|
6785
|
-
exeLocalXdgOpen = true;
|
|
6786
|
-
} catch {
|
|
6787
|
-
}
|
|
6788
|
-
const useSystemXdgOpen = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen;
|
|
6789
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
6790
|
-
}
|
|
6791
|
-
if (appArguments.length > 0) {
|
|
6792
|
-
cliArguments.push(...appArguments);
|
|
6793
|
-
}
|
|
6794
|
-
if (!options.wait) {
|
|
6795
|
-
childProcessOptions.stdio = "ignore";
|
|
6796
|
-
childProcessOptions.detached = true;
|
|
6797
|
-
}
|
|
6798
|
-
}
|
|
6799
|
-
if (options.target) {
|
|
6800
|
-
cliArguments.push(options.target);
|
|
6801
|
-
}
|
|
6802
|
-
if (platform === "darwin" && appArguments.length > 0) {
|
|
6803
|
-
cliArguments.push("--args", ...appArguments);
|
|
6804
|
-
}
|
|
6805
|
-
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
6806
|
-
if (options.wait) {
|
|
6807
|
-
return new Promise((resolve7, reject2) => {
|
|
6808
|
-
subprocess.once("error", reject2);
|
|
6809
|
-
subprocess.once("close", (exitCode) => {
|
|
6810
|
-
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
6811
|
-
reject2(new Error(`Exited with code ${exitCode}`));
|
|
6812
|
-
return;
|
|
6813
|
-
}
|
|
6814
|
-
resolve7(subprocess);
|
|
6815
|
-
});
|
|
6816
|
-
});
|
|
6817
|
-
}
|
|
6818
|
-
subprocess.unref();
|
|
6819
|
-
return subprocess;
|
|
6820
|
-
}, "baseOpen");
|
|
6821
|
-
var open2 = /* @__PURE__ */ __name((target, options) => {
|
|
6822
|
-
if (typeof target !== "string") {
|
|
6823
|
-
throw new TypeError("Expected a `target`");
|
|
6824
|
-
}
|
|
6825
|
-
return baseOpen({
|
|
6826
|
-
...options,
|
|
6827
|
-
target
|
|
6828
|
-
});
|
|
6829
|
-
}, "open");
|
|
6830
|
-
var openApp = /* @__PURE__ */ __name((name, options) => {
|
|
6831
|
-
if (typeof name !== "string") {
|
|
6832
|
-
throw new TypeError("Expected a `name`");
|
|
6833
|
-
}
|
|
6834
|
-
const { arguments: appArguments = [] } = options || {};
|
|
6835
|
-
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
6836
|
-
throw new TypeError("Expected `appArguments` as Array type");
|
|
6837
|
-
}
|
|
6838
|
-
return baseOpen({
|
|
6839
|
-
...options,
|
|
6840
|
-
app: {
|
|
6841
|
-
name,
|
|
6842
|
-
arguments: appArguments
|
|
6843
|
-
}
|
|
6844
|
-
});
|
|
6845
|
-
}, "openApp");
|
|
6846
|
-
function detectArchBinary(binary) {
|
|
6847
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
6848
|
-
return binary;
|
|
6849
|
-
}
|
|
6850
|
-
const { [arch]: archBinary } = binary;
|
|
6851
|
-
if (!archBinary) {
|
|
6852
|
-
throw new Error(`${arch} is not supported`);
|
|
6853
|
-
}
|
|
6854
|
-
return archBinary;
|
|
6855
|
-
}
|
|
6856
|
-
__name(detectArchBinary, "detectArchBinary");
|
|
6857
|
-
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
6858
|
-
if (wsl && isWsl) {
|
|
6859
|
-
return detectArchBinary(wsl);
|
|
6860
|
-
}
|
|
6861
|
-
if (!platformBinary) {
|
|
6862
|
-
throw new Error(`${platform} is not supported`);
|
|
6863
|
-
}
|
|
6864
|
-
return detectArchBinary(platformBinary);
|
|
6865
|
-
}
|
|
6866
|
-
__name(detectPlatformBinary, "detectPlatformBinary");
|
|
6867
|
-
var apps = {};
|
|
6868
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
6869
|
-
darwin: "google chrome",
|
|
6870
|
-
win32: "chrome",
|
|
6871
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
6872
|
-
}, {
|
|
6873
|
-
wsl: {
|
|
6874
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
6875
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
6876
|
-
}
|
|
6877
|
-
}));
|
|
6878
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
6879
|
-
darwin: "firefox",
|
|
6880
|
-
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
6881
|
-
linux: "firefox"
|
|
6882
|
-
}, {
|
|
6883
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
6884
|
-
}));
|
|
6885
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
6886
|
-
darwin: "microsoft edge",
|
|
6887
|
-
win32: "msedge",
|
|
6888
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
6889
|
-
}, {
|
|
6890
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
6891
|
-
}));
|
|
6892
|
-
open2.apps = apps;
|
|
6893
|
-
open2.openApp = openApp;
|
|
6894
|
-
module.exports = open2;
|
|
6895
|
-
}
|
|
6896
|
-
});
|
|
6897
|
-
|
|
6898
6365
|
// ../node_modules/address/lib/address.js
|
|
6899
6366
|
var require_address = __commonJS({
|
|
6900
6367
|
"../node_modules/address/lib/address.js"(exports, module) {
|
|
6901
6368
|
"use strict";
|
|
6902
|
-
var
|
|
6903
|
-
var
|
|
6369
|
+
var os3 = __require("os");
|
|
6370
|
+
var fs6 = __require("fs");
|
|
6904
6371
|
var child = __require("child_process");
|
|
6905
6372
|
var DEFAULT_RESOLV_FILE = "/etc/resolv.conf";
|
|
6906
6373
|
function getInterfaceName() {
|
|
6907
6374
|
var val = "eth";
|
|
6908
|
-
var
|
|
6909
|
-
if (
|
|
6375
|
+
var platform2 = os3.platform();
|
|
6376
|
+
if (platform2 === "darwin") {
|
|
6910
6377
|
val = "en";
|
|
6911
|
-
} else if (
|
|
6378
|
+
} else if (platform2 === "win32") {
|
|
6912
6379
|
val = null;
|
|
6913
6380
|
}
|
|
6914
6381
|
return val;
|
|
6915
6382
|
}
|
|
6916
6383
|
__name(getInterfaceName, "getInterfaceName");
|
|
6917
6384
|
function getIfconfigCMD() {
|
|
6918
|
-
if (
|
|
6385
|
+
if (os3.platform() === "win32") {
|
|
6919
6386
|
return "ipconfig/all";
|
|
6920
6387
|
}
|
|
6921
6388
|
return "/sbin/ifconfig";
|
|
@@ -6950,7 +6417,7 @@ var require_address = __commonJS({
|
|
|
6950
6417
|
}
|
|
6951
6418
|
__name(address, "address");
|
|
6952
6419
|
address.interface = function(family, name) {
|
|
6953
|
-
var interfaces =
|
|
6420
|
+
var interfaces = os3.networkInterfaces();
|
|
6954
6421
|
var noName = !name;
|
|
6955
6422
|
name = name || getInterfaceName();
|
|
6956
6423
|
family = family || "IPv4";
|
|
@@ -7067,7 +6534,7 @@ var require_address = __commonJS({
|
|
|
7067
6534
|
filepath = null;
|
|
7068
6535
|
}
|
|
7069
6536
|
filepath = filepath || DEFAULT_RESOLV_FILE;
|
|
7070
|
-
|
|
6537
|
+
fs6.readFile(filepath, "utf8", function(err, content) {
|
|
7071
6538
|
if (err) {
|
|
7072
6539
|
return callback(err);
|
|
7073
6540
|
}
|
|
@@ -7670,7 +7137,7 @@ var require_has_flag = __commonJS({
|
|
|
7670
7137
|
var require_supports_colors = __commonJS({
|
|
7671
7138
|
"../node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module) {
|
|
7672
7139
|
"use strict";
|
|
7673
|
-
var
|
|
7140
|
+
var os3 = __require("os");
|
|
7674
7141
|
var hasFlag = require_has_flag();
|
|
7675
7142
|
var env = process.env;
|
|
7676
7143
|
var forceColor = void 0;
|
|
@@ -7709,7 +7176,7 @@ var require_supports_colors = __commonJS({
|
|
|
7709
7176
|
}
|
|
7710
7177
|
var min2 = forceColor ? 1 : 0;
|
|
7711
7178
|
if (process.platform === "win32") {
|
|
7712
|
-
var osRelease =
|
|
7179
|
+
var osRelease = os3.release().split(".");
|
|
7713
7180
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
7714
7181
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
7715
7182
|
}
|
|
@@ -9121,7 +8588,7 @@ var sortStoriesV7 = /* @__PURE__ */ __name((stories, storySortParameter, fileNam
|
|
|
9121
8588
|
Error sorting stories with sort parameter ${storySortParameter}:
|
|
9122
8589
|
|
|
9123
8590
|
> ${err.message}
|
|
9124
|
-
|
|
8591
|
+
|
|
9125
8592
|
Are you using a V6-style sort function in V7 mode?
|
|
9126
8593
|
|
|
9127
8594
|
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#v7-style-story-sort
|
|
@@ -9209,6 +8676,7 @@ var AUTODOCS_TAG = "autodocs";
|
|
|
9209
8676
|
var ATTACHED_MDX_TAG = "attached-mdx";
|
|
9210
8677
|
var UNATTACHED_MDX_TAG = "unattached-mdx";
|
|
9211
8678
|
var PLAY_FN_TAG = "play-fn";
|
|
8679
|
+
var TEST_FN_TAG = "test-fn";
|
|
9212
8680
|
function isMdxEntry({ tags }) {
|
|
9213
8681
|
return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
|
|
9214
8682
|
}
|
|
@@ -9248,7 +8716,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9248
8716
|
}
|
|
9249
8717
|
const pathToSubIndex = {};
|
|
9250
8718
|
const fullGlob = slash(join(specifier.directory, specifier.files));
|
|
9251
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
8719
|
+
const { globby } = await import("../_node-chunks/globby-HXB6X43W.js");
|
|
9252
8720
|
const files = await globby(fullGlob, {
|
|
9253
8721
|
absolute: true,
|
|
9254
8722
|
cwd: workingDir,
|
|
@@ -9436,36 +8904,41 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9436
8904
|
"main"
|
|
9437
8905
|
]);
|
|
9438
8906
|
}
|
|
9439
|
-
const
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
8907
|
+
const storyEntries = indexInputs.map(
|
|
8908
|
+
(input) => {
|
|
8909
|
+
const name = input.name ?? storyNameFromExport(input.exportName);
|
|
8910
|
+
const componentPath = input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath);
|
|
8911
|
+
const title = input.title ?? defaultMakeTitle();
|
|
8912
|
+
const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName));
|
|
8913
|
+
const tags = combineTags(...projectTags, ...input.tags ?? []);
|
|
8914
|
+
return {
|
|
8915
|
+
type: "story",
|
|
8916
|
+
subtype: input.type === "story" ? input.subtype : "story",
|
|
8917
|
+
id,
|
|
8918
|
+
extra: {
|
|
8919
|
+
metaId: input.metaId,
|
|
8920
|
+
stats: input.__stats ?? {}
|
|
8921
|
+
},
|
|
8922
|
+
name,
|
|
8923
|
+
title,
|
|
8924
|
+
importPath,
|
|
8925
|
+
componentPath,
|
|
8926
|
+
tags,
|
|
8927
|
+
...input.type === "story" && input.subtype === "test" ? { parent: input.parent, parentName: input.parentName } : {},
|
|
8928
|
+
...input.exportName ? { exportName: input.exportName } : {}
|
|
8929
|
+
};
|
|
8930
|
+
}
|
|
8931
|
+
);
|
|
8932
|
+
const hasAutodocsTag = storyEntries.some((entry) => entry.tags.includes(AUTODOCS_TAG));
|
|
9460
8933
|
const createDocEntry = hasAutodocsTag && !!this.options.docs;
|
|
9461
8934
|
if (createDocEntry && this.options.build?.test?.disableAutoDocs !== true) {
|
|
9462
8935
|
const docsName = this.options.docs?.defaultName ?? "Docs";
|
|
9463
8936
|
const name = docsName;
|
|
9464
8937
|
const { metaId } = indexInputs[0];
|
|
9465
|
-
const { title } =
|
|
8938
|
+
const { title } = storyEntries[0];
|
|
9466
8939
|
const id = toId(metaId ?? title, name);
|
|
9467
8940
|
const tags = combineTags(...projectTags, ...indexInputs[0].tags ?? []);
|
|
9468
|
-
|
|
8941
|
+
const docsEntry = {
|
|
9469
8942
|
id,
|
|
9470
8943
|
title,
|
|
9471
8944
|
name,
|
|
@@ -9473,10 +8946,15 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9473
8946
|
type: "docs",
|
|
9474
8947
|
tags,
|
|
9475
8948
|
storiesImports: []
|
|
9476
|
-
}
|
|
8949
|
+
};
|
|
8950
|
+
return {
|
|
8951
|
+
entries: [docsEntry, ...storyEntries],
|
|
8952
|
+
dependents: [],
|
|
8953
|
+
type: "stories"
|
|
8954
|
+
};
|
|
9477
8955
|
}
|
|
9478
8956
|
return {
|
|
9479
|
-
entries,
|
|
8957
|
+
entries: storyEntries,
|
|
9480
8958
|
dependents: [],
|
|
9481
8959
|
type: "stories"
|
|
9482
8960
|
};
|
|
@@ -9487,7 +8965,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9487
8965
|
const normalizedPath = normalizeStoryPath(relativePath);
|
|
9488
8966
|
const importPath = slash(normalizedPath);
|
|
9489
8967
|
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
9490
|
-
const { analyze } = await import("../_node-chunks/dist-
|
|
8968
|
+
const { analyze } = await import("../_node-chunks/dist-PG4I7ZDU.js");
|
|
9491
8969
|
const result2 = await analyze(content);
|
|
9492
8970
|
if (result2.isTemplate) {
|
|
9493
8971
|
return false;
|
|
@@ -9830,7 +9308,7 @@ __name(print, "print");
|
|
|
9830
9308
|
// src/core-server/utils/get-builders.ts
|
|
9831
9309
|
import { MissingBuilderError } from "storybook/internal/server-errors";
|
|
9832
9310
|
async function getManagerBuilder() {
|
|
9833
|
-
return await import("../_node-chunks/builder-manager-
|
|
9311
|
+
return await import("../_node-chunks/builder-manager-VFP7HSCF.js");
|
|
9834
9312
|
}
|
|
9835
9313
|
__name(getManagerBuilder, "getManagerBuilder");
|
|
9836
9314
|
async function getPreviewBuilder(resolvedPreviewBuilder) {
|
|
@@ -10096,19 +9574,19 @@ function toPath(deepKey) {
|
|
|
10096
9574
|
__name(toPath, "toPath");
|
|
10097
9575
|
|
|
10098
9576
|
// ../node_modules/es-toolkit/dist/compat/object/get.mjs
|
|
10099
|
-
function get(object,
|
|
9577
|
+
function get(object, path2, defaultValue) {
|
|
10100
9578
|
if (object == null) {
|
|
10101
9579
|
return defaultValue;
|
|
10102
9580
|
}
|
|
10103
|
-
switch (typeof
|
|
9581
|
+
switch (typeof path2) {
|
|
10104
9582
|
case "string": {
|
|
10105
|
-
if (isUnsafeProperty(
|
|
9583
|
+
if (isUnsafeProperty(path2)) {
|
|
10106
9584
|
return defaultValue;
|
|
10107
9585
|
}
|
|
10108
|
-
const result2 = object[
|
|
9586
|
+
const result2 = object[path2];
|
|
10109
9587
|
if (result2 === void 0) {
|
|
10110
|
-
if (isDeepKey(
|
|
10111
|
-
return get(object, toPath(
|
|
9588
|
+
if (isDeepKey(path2)) {
|
|
9589
|
+
return get(object, toPath(path2), defaultValue);
|
|
10112
9590
|
} else {
|
|
10113
9591
|
return defaultValue;
|
|
10114
9592
|
}
|
|
@@ -10117,28 +9595,28 @@ function get(object, path, defaultValue) {
|
|
|
10117
9595
|
}
|
|
10118
9596
|
case "number":
|
|
10119
9597
|
case "symbol": {
|
|
10120
|
-
if (typeof
|
|
10121
|
-
|
|
9598
|
+
if (typeof path2 === "number") {
|
|
9599
|
+
path2 = toKey(path2);
|
|
10122
9600
|
}
|
|
10123
|
-
const result2 = object[
|
|
9601
|
+
const result2 = object[path2];
|
|
10124
9602
|
if (result2 === void 0) {
|
|
10125
9603
|
return defaultValue;
|
|
10126
9604
|
}
|
|
10127
9605
|
return result2;
|
|
10128
9606
|
}
|
|
10129
9607
|
default: {
|
|
10130
|
-
if (Array.isArray(
|
|
10131
|
-
return getWithPath(object,
|
|
9608
|
+
if (Array.isArray(path2)) {
|
|
9609
|
+
return getWithPath(object, path2, defaultValue);
|
|
10132
9610
|
}
|
|
10133
|
-
if (Object.is(
|
|
10134
|
-
|
|
9611
|
+
if (Object.is(path2?.valueOf(), -0)) {
|
|
9612
|
+
path2 = "-0";
|
|
10135
9613
|
} else {
|
|
10136
|
-
|
|
9614
|
+
path2 = String(path2);
|
|
10137
9615
|
}
|
|
10138
|
-
if (isUnsafeProperty(
|
|
9616
|
+
if (isUnsafeProperty(path2)) {
|
|
10139
9617
|
return defaultValue;
|
|
10140
9618
|
}
|
|
10141
|
-
const result2 = object[
|
|
9619
|
+
const result2 = object[path2];
|
|
10142
9620
|
if (result2 === void 0) {
|
|
10143
9621
|
return defaultValue;
|
|
10144
9622
|
}
|
|
@@ -10147,19 +9625,19 @@ function get(object, path, defaultValue) {
|
|
|
10147
9625
|
}
|
|
10148
9626
|
}
|
|
10149
9627
|
__name(get, "get");
|
|
10150
|
-
function getWithPath(object,
|
|
10151
|
-
if (
|
|
9628
|
+
function getWithPath(object, path2, defaultValue) {
|
|
9629
|
+
if (path2.length === 0) {
|
|
10152
9630
|
return defaultValue;
|
|
10153
9631
|
}
|
|
10154
9632
|
let current = object;
|
|
10155
|
-
for (let index = 0; index <
|
|
9633
|
+
for (let index = 0; index < path2.length; index++) {
|
|
10156
9634
|
if (current == null) {
|
|
10157
9635
|
return defaultValue;
|
|
10158
9636
|
}
|
|
10159
|
-
if (isUnsafeProperty(
|
|
9637
|
+
if (isUnsafeProperty(path2[index])) {
|
|
10160
9638
|
return defaultValue;
|
|
10161
9639
|
}
|
|
10162
|
-
current = current[
|
|
9640
|
+
current = current[path2[index]];
|
|
10163
9641
|
}
|
|
10164
9642
|
if (current === void 0) {
|
|
10165
9643
|
return defaultValue;
|
|
@@ -10169,9 +9647,9 @@ function getWithPath(object, path, defaultValue) {
|
|
|
10169
9647
|
__name(getWithPath, "getWithPath");
|
|
10170
9648
|
|
|
10171
9649
|
// ../node_modules/es-toolkit/dist/compat/object/property.mjs
|
|
10172
|
-
function property(
|
|
9650
|
+
function property(path2) {
|
|
10173
9651
|
return function(object) {
|
|
10174
|
-
return get(object,
|
|
9652
|
+
return get(object, path2);
|
|
10175
9653
|
};
|
|
10176
9654
|
}
|
|
10177
9655
|
__name(property, "property");
|
|
@@ -10632,14 +10110,14 @@ function isArguments(value) {
|
|
|
10632
10110
|
__name(isArguments, "isArguments");
|
|
10633
10111
|
|
|
10634
10112
|
// ../node_modules/es-toolkit/dist/compat/object/has.mjs
|
|
10635
|
-
function has(object,
|
|
10113
|
+
function has(object, path2) {
|
|
10636
10114
|
let resolvedPath;
|
|
10637
|
-
if (Array.isArray(
|
|
10638
|
-
resolvedPath =
|
|
10639
|
-
} else if (typeof
|
|
10640
|
-
resolvedPath = toPath(
|
|
10115
|
+
if (Array.isArray(path2)) {
|
|
10116
|
+
resolvedPath = path2;
|
|
10117
|
+
} else if (typeof path2 === "string" && isDeepKey(path2) && object?.[path2] == null) {
|
|
10118
|
+
resolvedPath = toPath(path2);
|
|
10641
10119
|
} else {
|
|
10642
|
-
resolvedPath = [
|
|
10120
|
+
resolvedPath = [path2];
|
|
10643
10121
|
}
|
|
10644
10122
|
if (resolvedPath.length === 0) {
|
|
10645
10123
|
return false;
|
|
@@ -11645,7 +11123,7 @@ function isFunction(value) {
|
|
|
11645
11123
|
__name(isFunction, "isFunction");
|
|
11646
11124
|
|
|
11647
11125
|
// ../node_modules/es-toolkit/dist/compat/array/invokeMap.mjs
|
|
11648
|
-
function invokeMap(collection,
|
|
11126
|
+
function invokeMap(collection, path2, ...args) {
|
|
11649
11127
|
if (isNil(collection)) {
|
|
11650
11128
|
return [];
|
|
11651
11129
|
}
|
|
@@ -11653,19 +11131,19 @@ function invokeMap(collection, path, ...args) {
|
|
|
11653
11131
|
const result2 = [];
|
|
11654
11132
|
for (let i = 0; i < values2.length; i++) {
|
|
11655
11133
|
const value = values2[i];
|
|
11656
|
-
if (isFunction(
|
|
11657
|
-
result2.push(
|
|
11134
|
+
if (isFunction(path2)) {
|
|
11135
|
+
result2.push(path2.apply(value, args));
|
|
11658
11136
|
continue;
|
|
11659
11137
|
}
|
|
11660
|
-
const method2 = get(value,
|
|
11138
|
+
const method2 = get(value, path2);
|
|
11661
11139
|
let thisContext = value;
|
|
11662
|
-
if (Array.isArray(
|
|
11663
|
-
const pathExceptLast =
|
|
11140
|
+
if (Array.isArray(path2)) {
|
|
11141
|
+
const pathExceptLast = path2.slice(0, -1);
|
|
11664
11142
|
if (pathExceptLast.length > 0) {
|
|
11665
11143
|
thisContext = get(value, pathExceptLast);
|
|
11666
11144
|
}
|
|
11667
|
-
} else if (typeof
|
|
11668
|
-
const parts =
|
|
11145
|
+
} else if (typeof path2 === "string" && path2.includes(".")) {
|
|
11146
|
+
const parts = path2.split(".");
|
|
11669
11147
|
const pathExceptLast = parts.slice(0, -1).join(".");
|
|
11670
11148
|
thisContext = get(value, pathExceptLast);
|
|
11671
11149
|
}
|
|
@@ -11828,10 +11306,10 @@ function orderBy(collection, criteria, orders, guard) {
|
|
|
11828
11306
|
orders = orders == null ? [] : [orders];
|
|
11829
11307
|
}
|
|
11830
11308
|
orders = orders.map((order) => String(order));
|
|
11831
|
-
const getValueByNestedPath = /* @__PURE__ */ __name((object,
|
|
11309
|
+
const getValueByNestedPath = /* @__PURE__ */ __name((object, path2) => {
|
|
11832
11310
|
let target = object;
|
|
11833
|
-
for (let i = 0; i <
|
|
11834
|
-
target = target[
|
|
11311
|
+
for (let i = 0; i < path2.length && target != null; ++i) {
|
|
11312
|
+
target = target[path2[i]];
|
|
11835
11313
|
}
|
|
11836
11314
|
return target;
|
|
11837
11315
|
}, "getValueByNestedPath");
|
|
@@ -12005,13 +11483,13 @@ function at(object, ...paths) {
|
|
|
12005
11483
|
}
|
|
12006
11484
|
const allPaths = [];
|
|
12007
11485
|
for (let i = 0; i < paths.length; i++) {
|
|
12008
|
-
const
|
|
12009
|
-
if (!isArrayLike(
|
|
12010
|
-
allPaths.push(
|
|
11486
|
+
const path2 = paths[i];
|
|
11487
|
+
if (!isArrayLike(path2) || isString(path2)) {
|
|
11488
|
+
allPaths.push(path2);
|
|
12011
11489
|
continue;
|
|
12012
11490
|
}
|
|
12013
|
-
for (let j = 0; j <
|
|
12014
|
-
allPaths.push(
|
|
11491
|
+
for (let j = 0; j < path2.length; j++) {
|
|
11492
|
+
allPaths.push(path2[j]);
|
|
12015
11493
|
}
|
|
12016
11494
|
}
|
|
12017
11495
|
const result2 = [];
|
|
@@ -12023,48 +11501,48 @@ function at(object, ...paths) {
|
|
|
12023
11501
|
__name(at, "at");
|
|
12024
11502
|
|
|
12025
11503
|
// ../node_modules/es-toolkit/dist/compat/object/unset.mjs
|
|
12026
|
-
function unset(obj,
|
|
11504
|
+
function unset(obj, path2) {
|
|
12027
11505
|
if (obj == null) {
|
|
12028
11506
|
return true;
|
|
12029
11507
|
}
|
|
12030
|
-
switch (typeof
|
|
11508
|
+
switch (typeof path2) {
|
|
12031
11509
|
case "symbol":
|
|
12032
11510
|
case "number":
|
|
12033
11511
|
case "object": {
|
|
12034
|
-
if (Array.isArray(
|
|
12035
|
-
return unsetWithPath(obj,
|
|
12036
|
-
}
|
|
12037
|
-
if (typeof
|
|
12038
|
-
|
|
12039
|
-
} else if (typeof
|
|
12040
|
-
if (Object.is(
|
|
12041
|
-
|
|
11512
|
+
if (Array.isArray(path2)) {
|
|
11513
|
+
return unsetWithPath(obj, path2);
|
|
11514
|
+
}
|
|
11515
|
+
if (typeof path2 === "number") {
|
|
11516
|
+
path2 = toKey(path2);
|
|
11517
|
+
} else if (typeof path2 === "object") {
|
|
11518
|
+
if (Object.is(path2?.valueOf(), -0)) {
|
|
11519
|
+
path2 = "-0";
|
|
12042
11520
|
} else {
|
|
12043
|
-
|
|
11521
|
+
path2 = String(path2);
|
|
12044
11522
|
}
|
|
12045
11523
|
}
|
|
12046
|
-
if (isUnsafeProperty(
|
|
11524
|
+
if (isUnsafeProperty(path2)) {
|
|
12047
11525
|
return false;
|
|
12048
11526
|
}
|
|
12049
|
-
if (obj?.[
|
|
11527
|
+
if (obj?.[path2] === void 0) {
|
|
12050
11528
|
return true;
|
|
12051
11529
|
}
|
|
12052
11530
|
try {
|
|
12053
|
-
delete obj[
|
|
11531
|
+
delete obj[path2];
|
|
12054
11532
|
return true;
|
|
12055
11533
|
} catch {
|
|
12056
11534
|
return false;
|
|
12057
11535
|
}
|
|
12058
11536
|
}
|
|
12059
11537
|
case "string": {
|
|
12060
|
-
if (obj?.[
|
|
12061
|
-
return unsetWithPath(obj, toPath(
|
|
11538
|
+
if (obj?.[path2] === void 0 && isDeepKey(path2)) {
|
|
11539
|
+
return unsetWithPath(obj, toPath(path2));
|
|
12062
11540
|
}
|
|
12063
|
-
if (isUnsafeProperty(
|
|
11541
|
+
if (isUnsafeProperty(path2)) {
|
|
12064
11542
|
return false;
|
|
12065
11543
|
}
|
|
12066
11544
|
try {
|
|
12067
|
-
delete obj[
|
|
11545
|
+
delete obj[path2];
|
|
12068
11546
|
return true;
|
|
12069
11547
|
} catch {
|
|
12070
11548
|
return false;
|
|
@@ -12073,9 +11551,9 @@ function unset(obj, path) {
|
|
|
12073
11551
|
}
|
|
12074
11552
|
}
|
|
12075
11553
|
__name(unset, "unset");
|
|
12076
|
-
function unsetWithPath(obj,
|
|
12077
|
-
const parent = get(obj,
|
|
12078
|
-
const lastKey =
|
|
11554
|
+
function unsetWithPath(obj, path2) {
|
|
11555
|
+
const parent = get(obj, path2.slice(0, -1), obj);
|
|
11556
|
+
const lastKey = path2[path2.length - 1];
|
|
12079
11557
|
if (parent?.[lastKey] === void 0) {
|
|
12080
11558
|
return true;
|
|
12081
11559
|
}
|
|
@@ -12114,8 +11592,8 @@ function pullAt(array, ..._indices) {
|
|
|
12114
11592
|
delete array[toKey(index)];
|
|
12115
11593
|
continue;
|
|
12116
11594
|
}
|
|
12117
|
-
const
|
|
12118
|
-
unset(array,
|
|
11595
|
+
const path2 = isArray(index) ? index : toPath(index);
|
|
11596
|
+
unset(array, path2);
|
|
12119
11597
|
}
|
|
12120
11598
|
return result2;
|
|
12121
11599
|
}
|
|
@@ -13007,11 +12485,11 @@ function zipObject(keys2 = [], values2 = []) {
|
|
|
13007
12485
|
__name(zipObject, "zipObject");
|
|
13008
12486
|
|
|
13009
12487
|
// ../node_modules/es-toolkit/dist/compat/object/updateWith.mjs
|
|
13010
|
-
function updateWith(obj,
|
|
12488
|
+
function updateWith(obj, path2, updater, customizer) {
|
|
13011
12489
|
if (obj == null && !isObject(obj)) {
|
|
13012
12490
|
return obj;
|
|
13013
12491
|
}
|
|
13014
|
-
const resolvedPath = isKey(
|
|
12492
|
+
const resolvedPath = isKey(path2, obj) ? [path2] : Array.isArray(path2) ? path2 : typeof path2 === "string" ? toPath(path2) : [path2];
|
|
13015
12493
|
let current = obj;
|
|
13016
12494
|
for (let i = 0; i < resolvedPath.length && current != null; i++) {
|
|
13017
12495
|
const key = toKey(resolvedPath[i]);
|
|
@@ -13034,8 +12512,8 @@ function updateWith(obj, path, updater, customizer) {
|
|
|
13034
12512
|
__name(updateWith, "updateWith");
|
|
13035
12513
|
|
|
13036
12514
|
// ../node_modules/es-toolkit/dist/compat/object/set.mjs
|
|
13037
|
-
function set(obj,
|
|
13038
|
-
return updateWith(obj,
|
|
12515
|
+
function set(obj, path2, value) {
|
|
12516
|
+
return updateWith(obj, path2, () => value, () => void 0);
|
|
13039
12517
|
}
|
|
13040
12518
|
__name(set, "set");
|
|
13041
12519
|
|
|
@@ -15009,17 +14487,17 @@ function functionsIn(object) {
|
|
|
15009
14487
|
__name(functionsIn, "functionsIn");
|
|
15010
14488
|
|
|
15011
14489
|
// ../node_modules/es-toolkit/dist/compat/object/hasIn.mjs
|
|
15012
|
-
function hasIn(object,
|
|
14490
|
+
function hasIn(object, path2) {
|
|
15013
14491
|
if (object == null) {
|
|
15014
14492
|
return false;
|
|
15015
14493
|
}
|
|
15016
14494
|
let resolvedPath;
|
|
15017
|
-
if (Array.isArray(
|
|
15018
|
-
resolvedPath =
|
|
15019
|
-
} else if (typeof
|
|
15020
|
-
resolvedPath = toPath(
|
|
14495
|
+
if (Array.isArray(path2)) {
|
|
14496
|
+
resolvedPath = path2;
|
|
14497
|
+
} else if (typeof path2 === "string" && isDeepKey(path2) && object[path2] == null) {
|
|
14498
|
+
resolvedPath = toPath(path2);
|
|
15021
14499
|
} else {
|
|
15022
|
-
resolvedPath = [
|
|
14500
|
+
resolvedPath = [path2];
|
|
15023
14501
|
}
|
|
15024
14502
|
if (resolvedPath.length === 0) {
|
|
15025
14503
|
return false;
|
|
@@ -15375,22 +14853,22 @@ __name(pickBy, "pickBy");
|
|
|
15375
14853
|
|
|
15376
14854
|
// ../node_modules/es-toolkit/dist/compat/object/propertyOf.mjs
|
|
15377
14855
|
function propertyOf(object) {
|
|
15378
|
-
return function(
|
|
15379
|
-
return get(object,
|
|
14856
|
+
return function(path2) {
|
|
14857
|
+
return get(object, path2);
|
|
15380
14858
|
};
|
|
15381
14859
|
}
|
|
15382
14860
|
__name(propertyOf, "propertyOf");
|
|
15383
14861
|
|
|
15384
14862
|
// ../node_modules/es-toolkit/dist/compat/object/result.mjs
|
|
15385
|
-
function result(object,
|
|
15386
|
-
if (isKey(
|
|
15387
|
-
|
|
15388
|
-
} else if (!Array.isArray(
|
|
15389
|
-
|
|
14863
|
+
function result(object, path2, defaultValue) {
|
|
14864
|
+
if (isKey(path2, object)) {
|
|
14865
|
+
path2 = [path2];
|
|
14866
|
+
} else if (!Array.isArray(path2)) {
|
|
14867
|
+
path2 = toPath(toString(path2));
|
|
15390
14868
|
}
|
|
15391
|
-
const pathLength = Math.max(
|
|
14869
|
+
const pathLength = Math.max(path2.length, 1);
|
|
15392
14870
|
for (let index = 0; index < pathLength; index++) {
|
|
15393
|
-
const value = object == null ? void 0 : object[toKey(
|
|
14871
|
+
const value = object == null ? void 0 : object[toKey(path2[index])];
|
|
15394
14872
|
if (value === void 0) {
|
|
15395
14873
|
return typeof defaultValue === "function" ? defaultValue.call(object) : defaultValue;
|
|
15396
14874
|
}
|
|
@@ -15401,14 +14879,14 @@ function result(object, path, defaultValue) {
|
|
|
15401
14879
|
__name(result, "result");
|
|
15402
14880
|
|
|
15403
14881
|
// ../node_modules/es-toolkit/dist/compat/object/setWith.mjs
|
|
15404
|
-
function setWith(obj,
|
|
14882
|
+
function setWith(obj, path2, value, customizer) {
|
|
15405
14883
|
let customizerFn;
|
|
15406
14884
|
if (typeof customizer === "function") {
|
|
15407
14885
|
customizerFn = customizer;
|
|
15408
14886
|
} else {
|
|
15409
14887
|
customizerFn = /* @__PURE__ */ __name(() => void 0, "customizerFn");
|
|
15410
14888
|
}
|
|
15411
|
-
return updateWith(obj,
|
|
14889
|
+
return updateWith(obj, path2, () => value, customizerFn);
|
|
15412
14890
|
}
|
|
15413
14891
|
__name(setWith, "setWith");
|
|
15414
14892
|
|
|
@@ -15515,8 +14993,8 @@ function transform(object, iteratee$1 = identity, accumulator) {
|
|
|
15515
14993
|
__name(transform, "transform");
|
|
15516
14994
|
|
|
15517
14995
|
// ../node_modules/es-toolkit/dist/compat/object/update.mjs
|
|
15518
|
-
function update(obj,
|
|
15519
|
-
return updateWith(obj,
|
|
14996
|
+
function update(obj, path2, updater) {
|
|
14997
|
+
return updateWith(obj, path2, updater, () => void 0);
|
|
15520
14998
|
}
|
|
15521
14999
|
__name(update, "update");
|
|
15522
15000
|
|
|
@@ -16477,38 +15955,38 @@ function gte(value, other) {
|
|
|
16477
15955
|
__name(gte, "gte");
|
|
16478
15956
|
|
|
16479
15957
|
// ../node_modules/es-toolkit/dist/compat/util/invoke.mjs
|
|
16480
|
-
function invoke(object,
|
|
15958
|
+
function invoke(object, path2, ...args) {
|
|
16481
15959
|
args = args.flat(1);
|
|
16482
15960
|
if (object == null) {
|
|
16483
15961
|
return;
|
|
16484
15962
|
}
|
|
16485
|
-
switch (typeof
|
|
15963
|
+
switch (typeof path2) {
|
|
16486
15964
|
case "string": {
|
|
16487
|
-
if (typeof object === "object" && Object.hasOwn(object,
|
|
16488
|
-
return invokeImpl(object, [
|
|
15965
|
+
if (typeof object === "object" && Object.hasOwn(object, path2)) {
|
|
15966
|
+
return invokeImpl(object, [path2], args);
|
|
16489
15967
|
}
|
|
16490
|
-
return invokeImpl(object, toPath(
|
|
15968
|
+
return invokeImpl(object, toPath(path2), args);
|
|
16491
15969
|
}
|
|
16492
15970
|
case "number":
|
|
16493
15971
|
case "symbol": {
|
|
16494
|
-
return invokeImpl(object, [
|
|
15972
|
+
return invokeImpl(object, [path2], args);
|
|
16495
15973
|
}
|
|
16496
15974
|
default: {
|
|
16497
|
-
if (Array.isArray(
|
|
16498
|
-
return invokeImpl(object,
|
|
15975
|
+
if (Array.isArray(path2)) {
|
|
15976
|
+
return invokeImpl(object, path2, args);
|
|
16499
15977
|
} else {
|
|
16500
|
-
return invokeImpl(object, [
|
|
15978
|
+
return invokeImpl(object, [path2], args);
|
|
16501
15979
|
}
|
|
16502
15980
|
}
|
|
16503
15981
|
}
|
|
16504
15982
|
}
|
|
16505
15983
|
__name(invoke, "invoke");
|
|
16506
|
-
function invokeImpl(object,
|
|
16507
|
-
const parent = get(object,
|
|
15984
|
+
function invokeImpl(object, path2, args) {
|
|
15985
|
+
const parent = get(object, path2.slice(0, -1), object);
|
|
16508
15986
|
if (parent == null) {
|
|
16509
15987
|
return void 0;
|
|
16510
15988
|
}
|
|
16511
|
-
let lastKey = last2(
|
|
15989
|
+
let lastKey = last2(path2);
|
|
16512
15990
|
const lastValue = lastKey?.valueOf();
|
|
16513
15991
|
if (typeof lastValue === "number") {
|
|
16514
15992
|
lastKey = toKey(lastValue);
|
|
@@ -16539,17 +16017,17 @@ function lte(value, other) {
|
|
|
16539
16017
|
__name(lte, "lte");
|
|
16540
16018
|
|
|
16541
16019
|
// ../node_modules/es-toolkit/dist/compat/util/method.mjs
|
|
16542
|
-
function method(
|
|
16020
|
+
function method(path2, ...args) {
|
|
16543
16021
|
return function(object) {
|
|
16544
|
-
return invoke(object,
|
|
16022
|
+
return invoke(object, path2, args);
|
|
16545
16023
|
};
|
|
16546
16024
|
}
|
|
16547
16025
|
__name(method, "method");
|
|
16548
16026
|
|
|
16549
16027
|
// ../node_modules/es-toolkit/dist/compat/util/methodOf.mjs
|
|
16550
16028
|
function methodOf(object, ...args) {
|
|
16551
|
-
return function(
|
|
16552
|
-
return invoke(object,
|
|
16029
|
+
return function(path2) {
|
|
16030
|
+
return invoke(object, path2, args);
|
|
16553
16031
|
};
|
|
16554
16032
|
}
|
|
16555
16033
|
__name(methodOf, "methodOf");
|
|
@@ -17074,7 +16552,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
17074
16552
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
17075
16553
|
basename2(specifier.files)
|
|
17076
16554
|
);
|
|
17077
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
16555
|
+
const { globby } = await import("../_node-chunks/globby-HXB6X43W.js");
|
|
17078
16556
|
const addedFiles = await globby(slash(dirGlob), commonGlobOptions2(dirGlob));
|
|
17079
16557
|
addedFiles.forEach((filePath) => {
|
|
17080
16558
|
const fileImportPath = toImportPath(filePath);
|
|
@@ -17138,9 +16616,9 @@ function useStoriesJson({
|
|
|
17138
16616
|
const maybeInvalidate = debounce2(() => serverChannel.emit(STORY_INDEX_INVALIDATED), DEBOUNCE, {
|
|
17139
16617
|
leading: true
|
|
17140
16618
|
});
|
|
17141
|
-
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier,
|
|
16619
|
+
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path2, removed) => {
|
|
17142
16620
|
const generator = await initializedStoryIndexGenerator;
|
|
17143
|
-
generator.invalidate(specifier,
|
|
16621
|
+
generator.invalidate(specifier, path2, removed);
|
|
17144
16622
|
maybeInvalidate();
|
|
17145
16623
|
});
|
|
17146
16624
|
if (configDir) {
|
|
@@ -17193,10 +16671,12 @@ function summarizeIndex(storyIndex) {
|
|
|
17193
16671
|
let exampleDocsCount = 0;
|
|
17194
16672
|
let pageStoryCount = 0;
|
|
17195
16673
|
let playStoryCount = 0;
|
|
16674
|
+
let testStoryCount = 0;
|
|
17196
16675
|
let autodocsCount = 0;
|
|
17197
16676
|
let mdxCount = 0;
|
|
17198
16677
|
let svelteCsfV4Count = 0;
|
|
17199
16678
|
let svelteCsfV5Count = 0;
|
|
16679
|
+
const testsPerParentStory = /* @__PURE__ */ new Map();
|
|
17200
16680
|
Object.values(storyIndex.entries).forEach((entry) => {
|
|
17201
16681
|
if (isCLIExampleEntry(entry)) {
|
|
17202
16682
|
if (entry.type === "story") {
|
|
@@ -17221,6 +16701,10 @@ function summarizeIndex(storyIndex) {
|
|
|
17221
16701
|
if (entry.tags?.includes(PLAY_FN_TAG)) {
|
|
17222
16702
|
playStoryCount += 1;
|
|
17223
16703
|
}
|
|
16704
|
+
if (entry.tags?.includes(TEST_FN_TAG) && entry.parent) {
|
|
16705
|
+
testStoryCount += 1;
|
|
16706
|
+
testsPerParentStory.set(entry.parent, (testsPerParentStory.get(entry.parent) ?? 0) + 1);
|
|
16707
|
+
}
|
|
17224
16708
|
if (entry.tags?.includes("svelte-csf-v4")) {
|
|
17225
16709
|
svelteCsfV4Count += 1;
|
|
17226
16710
|
} else if (entry.tags?.includes("svelte-csf-v5")) {
|
|
@@ -17235,11 +16719,24 @@ function summarizeIndex(storyIndex) {
|
|
|
17235
16719
|
}
|
|
17236
16720
|
});
|
|
17237
16721
|
const componentCount = componentTitles.size;
|
|
16722
|
+
let maxTestsPerStory = 0;
|
|
16723
|
+
let singleTestStoryCount = 0;
|
|
16724
|
+
testsPerParentStory.forEach((count) => {
|
|
16725
|
+
if (count > maxTestsPerStory) {
|
|
16726
|
+
maxTestsPerStory = count;
|
|
16727
|
+
}
|
|
16728
|
+
if (count === 1) {
|
|
16729
|
+
singleTestStoryCount += 1;
|
|
16730
|
+
}
|
|
16731
|
+
});
|
|
17238
16732
|
return {
|
|
17239
16733
|
storyCount,
|
|
17240
16734
|
componentCount,
|
|
17241
16735
|
pageStoryCount,
|
|
17242
16736
|
playStoryCount,
|
|
16737
|
+
testStoryCount,
|
|
16738
|
+
maxTestsPerStory,
|
|
16739
|
+
singleTestStoryCount,
|
|
17243
16740
|
autodocsCount,
|
|
17244
16741
|
mdxCount,
|
|
17245
16742
|
exampleStoryCount,
|
|
@@ -17420,7 +16917,7 @@ __name(buildStaticStandalone, "buildStaticStandalone");
|
|
|
17420
16917
|
// src/core-server/build-dev.ts
|
|
17421
16918
|
var import_prompts = __toESM(require_prompts(), 1);
|
|
17422
16919
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
17423
|
-
import { join as
|
|
16920
|
+
import { join as join8, relative as relative5, resolve as resolve5 } from "node:path";
|
|
17424
16921
|
import {
|
|
17425
16922
|
JsPackageManagerFactory,
|
|
17426
16923
|
getConfigInfo,
|
|
@@ -17720,14 +17217,14 @@ var Polka = class _Polka extends Trouter {
|
|
|
17720
17217
|
return this;
|
|
17721
17218
|
}
|
|
17722
17219
|
handler(req, res, next) {
|
|
17723
|
-
let info = this.parse(req),
|
|
17724
|
-
let obj = this.find(req.method, req.path =
|
|
17725
|
-
req.url =
|
|
17220
|
+
let info = this.parse(req), path2 = info.pathname;
|
|
17221
|
+
let obj = this.find(req.method, req.path = path2);
|
|
17222
|
+
req.url = path2 + info.search;
|
|
17726
17223
|
req.originalUrl = req.originalUrl || req.url;
|
|
17727
17224
|
req.query = info.query || {};
|
|
17728
17225
|
req.search = info.search;
|
|
17729
17226
|
req.params = obj.params;
|
|
17730
|
-
if (
|
|
17227
|
+
if (path2.length > 1 && path2.indexOf("%", 1) !== -1) {
|
|
17731
17228
|
for (let k in req.params) {
|
|
17732
17229
|
try {
|
|
17733
17230
|
req.params[k] = decodeURIComponent(req.params[k]);
|
|
@@ -18425,37 +17922,671 @@ async function getMiddleware(configDir) {
|
|
|
18425
17922
|
}
|
|
18426
17923
|
__name(getMiddleware, "getMiddleware");
|
|
18427
17924
|
|
|
18428
|
-
// src/core-server/utils/open-in-browser.ts
|
|
18429
|
-
var import_x_default_browser = __toESM(require_x_default_browser(), 1);
|
|
18430
|
-
var import_open = __toESM(require_open(), 1);
|
|
18431
|
-
var import_ts_dedent4 = __toESM(require_dist(), 1);
|
|
17925
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18432
17926
|
import { logger as logger5 } from "storybook/internal/node-logger";
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
|
|
17927
|
+
|
|
17928
|
+
// ../node_modules/open/index.js
|
|
17929
|
+
import process7 from "node:process";
|
|
17930
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
17931
|
+
import path from "node:path";
|
|
17932
|
+
import { fileURLToPath } from "node:url";
|
|
17933
|
+
import { promisify as promisify5 } from "node:util";
|
|
17934
|
+
import childProcess from "node:child_process";
|
|
17935
|
+
import fs5, { constants as fsConstants2 } from "node:fs/promises";
|
|
17936
|
+
|
|
17937
|
+
// ../node_modules/wsl-utils/index.js
|
|
17938
|
+
import process3 from "node:process";
|
|
17939
|
+
import fs4, { constants as fsConstants } from "node:fs/promises";
|
|
17940
|
+
|
|
17941
|
+
// ../node_modules/is-wsl/index.js
|
|
17942
|
+
import process2 from "node:process";
|
|
17943
|
+
import os from "node:os";
|
|
17944
|
+
import fs3 from "node:fs";
|
|
17945
|
+
|
|
17946
|
+
// ../node_modules/is-inside-container/index.js
|
|
17947
|
+
import fs2 from "node:fs";
|
|
17948
|
+
|
|
17949
|
+
// ../node_modules/is-inside-container/node_modules/is-docker/index.js
|
|
17950
|
+
import fs from "node:fs";
|
|
17951
|
+
var isDockerCached;
|
|
17952
|
+
function hasDockerEnv() {
|
|
17953
|
+
try {
|
|
17954
|
+
fs.statSync("/.dockerenv");
|
|
17955
|
+
return true;
|
|
17956
|
+
} catch {
|
|
17957
|
+
return false;
|
|
17958
|
+
}
|
|
17959
|
+
}
|
|
17960
|
+
__name(hasDockerEnv, "hasDockerEnv");
|
|
17961
|
+
function hasDockerCGroup() {
|
|
17962
|
+
try {
|
|
17963
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
17964
|
+
} catch {
|
|
17965
|
+
return false;
|
|
17966
|
+
}
|
|
17967
|
+
}
|
|
17968
|
+
__name(hasDockerCGroup, "hasDockerCGroup");
|
|
17969
|
+
function isDocker() {
|
|
17970
|
+
if (isDockerCached === void 0) {
|
|
17971
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
17972
|
+
}
|
|
17973
|
+
return isDockerCached;
|
|
17974
|
+
}
|
|
17975
|
+
__name(isDocker, "isDocker");
|
|
17976
|
+
|
|
17977
|
+
// ../node_modules/is-inside-container/index.js
|
|
17978
|
+
var cachedResult;
|
|
17979
|
+
var hasContainerEnv = /* @__PURE__ */ __name(() => {
|
|
17980
|
+
try {
|
|
17981
|
+
fs2.statSync("/run/.containerenv");
|
|
17982
|
+
return true;
|
|
17983
|
+
} catch {
|
|
17984
|
+
return false;
|
|
17985
|
+
}
|
|
17986
|
+
}, "hasContainerEnv");
|
|
17987
|
+
function isInsideContainer() {
|
|
17988
|
+
if (cachedResult === void 0) {
|
|
17989
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
17990
|
+
}
|
|
17991
|
+
return cachedResult;
|
|
17992
|
+
}
|
|
17993
|
+
__name(isInsideContainer, "isInsideContainer");
|
|
17994
|
+
|
|
17995
|
+
// ../node_modules/is-wsl/index.js
|
|
17996
|
+
var isWsl = /* @__PURE__ */ __name(() => {
|
|
17997
|
+
if (process2.platform !== "linux") {
|
|
17998
|
+
return false;
|
|
17999
|
+
}
|
|
18000
|
+
if (os.release().toLowerCase().includes("microsoft")) {
|
|
18001
|
+
if (isInsideContainer()) {
|
|
18002
|
+
return false;
|
|
18003
|
+
}
|
|
18004
|
+
return true;
|
|
18005
|
+
}
|
|
18006
|
+
try {
|
|
18007
|
+
return fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
18008
|
+
} catch {
|
|
18009
|
+
return false;
|
|
18010
|
+
}
|
|
18011
|
+
}, "isWsl");
|
|
18012
|
+
var is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
18013
|
+
|
|
18014
|
+
// ../node_modules/wsl-utils/index.js
|
|
18015
|
+
var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
18016
|
+
const defaultMountPoint = "/mnt/";
|
|
18017
|
+
let mountPoint;
|
|
18018
|
+
return async function() {
|
|
18019
|
+
if (mountPoint) {
|
|
18020
|
+
return mountPoint;
|
|
18021
|
+
}
|
|
18022
|
+
const configFilePath = "/etc/wsl.conf";
|
|
18023
|
+
let isConfigFileExists = false;
|
|
18439
18024
|
try {
|
|
18440
|
-
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
|
|
18025
|
+
await fs4.access(configFilePath, fsConstants.F_OK);
|
|
18026
|
+
isConfigFileExists = true;
|
|
18027
|
+
} catch {
|
|
18028
|
+
}
|
|
18029
|
+
if (!isConfigFileExists) {
|
|
18030
|
+
return defaultMountPoint;
|
|
18031
|
+
}
|
|
18032
|
+
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
|
|
18033
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
18034
|
+
if (!configMountPoint) {
|
|
18035
|
+
return defaultMountPoint;
|
|
18036
|
+
}
|
|
18037
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
18038
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
18039
|
+
return mountPoint;
|
|
18040
|
+
};
|
|
18041
|
+
})();
|
|
18042
|
+
var powerShellPathFromWsl = /* @__PURE__ */ __name(async () => {
|
|
18043
|
+
const mountPoint = await wslDrivesMountPoint();
|
|
18044
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
18045
|
+
}, "powerShellPathFromWsl");
|
|
18046
|
+
var powerShellPath = /* @__PURE__ */ __name(async () => {
|
|
18047
|
+
if (is_wsl_default) {
|
|
18048
|
+
return powerShellPathFromWsl();
|
|
18049
|
+
}
|
|
18050
|
+
return `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
18051
|
+
}, "powerShellPath");
|
|
18052
|
+
|
|
18053
|
+
// ../node_modules/define-lazy-prop/index.js
|
|
18054
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
18055
|
+
const define = /* @__PURE__ */ __name((value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true }), "define");
|
|
18056
|
+
Object.defineProperty(object, propertyName, {
|
|
18057
|
+
configurable: true,
|
|
18058
|
+
enumerable: true,
|
|
18059
|
+
get() {
|
|
18060
|
+
const result2 = valueGetter();
|
|
18061
|
+
define(result2);
|
|
18062
|
+
return result2;
|
|
18063
|
+
},
|
|
18064
|
+
set(value) {
|
|
18065
|
+
define(value);
|
|
18066
|
+
}
|
|
18067
|
+
});
|
|
18068
|
+
return object;
|
|
18069
|
+
}
|
|
18070
|
+
__name(defineLazyProperty, "defineLazyProperty");
|
|
18071
|
+
|
|
18072
|
+
// ../node_modules/default-browser/index.js
|
|
18073
|
+
import { promisify as promisify4 } from "node:util";
|
|
18074
|
+
import process6 from "node:process";
|
|
18075
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
18076
|
+
|
|
18077
|
+
// ../node_modules/default-browser-id/index.js
|
|
18078
|
+
import { promisify } from "node:util";
|
|
18079
|
+
import process4 from "node:process";
|
|
18080
|
+
import { execFile } from "node:child_process";
|
|
18081
|
+
var execFileAsync = promisify(execFile);
|
|
18082
|
+
async function defaultBrowserId() {
|
|
18083
|
+
if (process4.platform !== "darwin") {
|
|
18084
|
+
throw new Error("macOS only");
|
|
18085
|
+
}
|
|
18086
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
18087
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
18088
|
+
return match?.groups.id ?? "com.apple.Safari";
|
|
18089
|
+
}
|
|
18090
|
+
__name(defaultBrowserId, "defaultBrowserId");
|
|
18091
|
+
|
|
18092
|
+
// ../node_modules/run-applescript/index.js
|
|
18093
|
+
import process5 from "node:process";
|
|
18094
|
+
import { promisify as promisify2 } from "node:util";
|
|
18095
|
+
import { execFile as execFile2, execFileSync } from "node:child_process";
|
|
18096
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
18097
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
18098
|
+
if (process5.platform !== "darwin") {
|
|
18099
|
+
throw new Error("macOS only");
|
|
18100
|
+
}
|
|
18101
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
18102
|
+
const execOptions = {};
|
|
18103
|
+
if (signal) {
|
|
18104
|
+
execOptions.signal = signal;
|
|
18105
|
+
}
|
|
18106
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
18107
|
+
return stdout.trim();
|
|
18108
|
+
}
|
|
18109
|
+
__name(runAppleScript, "runAppleScript");
|
|
18110
|
+
|
|
18111
|
+
// ../node_modules/bundle-name/index.js
|
|
18112
|
+
async function bundleName(bundleId) {
|
|
18113
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
18114
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
18115
|
+
}
|
|
18116
|
+
__name(bundleName, "bundleName");
|
|
18117
|
+
|
|
18118
|
+
// ../node_modules/default-browser/windows.js
|
|
18119
|
+
import { promisify as promisify3 } from "node:util";
|
|
18120
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
18121
|
+
var execFileAsync3 = promisify3(execFile3);
|
|
18122
|
+
var windowsBrowserProgIds = {
|
|
18123
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
18124
|
+
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
18125
|
+
// On macOS, it's "com.microsoft.edgemac"
|
|
18126
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
18127
|
+
// Newer Edge/Win10 releases
|
|
18128
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
18129
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
18130
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
18131
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
18132
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
18133
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
18134
|
+
};
|
|
18135
|
+
var UnknownBrowserError = class extends Error {
|
|
18136
|
+
static {
|
|
18137
|
+
__name(this, "UnknownBrowserError");
|
|
18138
|
+
}
|
|
18139
|
+
};
|
|
18140
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
18141
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
18142
|
+
"QUERY",
|
|
18143
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
18144
|
+
"/v",
|
|
18145
|
+
"ProgId"
|
|
18146
|
+
]);
|
|
18147
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
18148
|
+
if (!match) {
|
|
18149
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
18150
|
+
}
|
|
18151
|
+
const { id } = match.groups;
|
|
18152
|
+
const browser = windowsBrowserProgIds[id];
|
|
18153
|
+
if (!browser) {
|
|
18154
|
+
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
18155
|
+
}
|
|
18156
|
+
return browser;
|
|
18157
|
+
}
|
|
18158
|
+
__name(defaultBrowser, "defaultBrowser");
|
|
18159
|
+
|
|
18160
|
+
// ../node_modules/default-browser/index.js
|
|
18161
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
18162
|
+
var titleize = /* @__PURE__ */ __name((string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase()), "titleize");
|
|
18163
|
+
async function defaultBrowser2() {
|
|
18164
|
+
if (process6.platform === "darwin") {
|
|
18165
|
+
const id = await defaultBrowserId();
|
|
18166
|
+
const name = await bundleName(id);
|
|
18167
|
+
return { name, id };
|
|
18168
|
+
}
|
|
18169
|
+
if (process6.platform === "linux") {
|
|
18170
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
18171
|
+
const id = stdout.trim();
|
|
18172
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
18173
|
+
return { name, id };
|
|
18174
|
+
}
|
|
18175
|
+
if (process6.platform === "win32") {
|
|
18176
|
+
return defaultBrowser();
|
|
18177
|
+
}
|
|
18178
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
18179
|
+
}
|
|
18180
|
+
__name(defaultBrowser2, "defaultBrowser");
|
|
18181
|
+
|
|
18182
|
+
// ../node_modules/open/index.js
|
|
18183
|
+
var execFile5 = promisify5(childProcess.execFile);
|
|
18184
|
+
var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
18185
|
+
var localXdgOpenPath = path.join(__dirname2, "xdg-open");
|
|
18186
|
+
var { platform, arch } = process7;
|
|
18187
|
+
async function getWindowsDefaultBrowserFromWsl() {
|
|
18188
|
+
const powershellPath = await powerShellPath();
|
|
18189
|
+
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
18190
|
+
const encodedCommand = Buffer2.from(rawCommand, "utf16le").toString("base64");
|
|
18191
|
+
const { stdout } = await execFile5(
|
|
18192
|
+
powershellPath,
|
|
18193
|
+
[
|
|
18194
|
+
"-NoProfile",
|
|
18195
|
+
"-NonInteractive",
|
|
18196
|
+
"-ExecutionPolicy",
|
|
18197
|
+
"Bypass",
|
|
18198
|
+
"-EncodedCommand",
|
|
18199
|
+
encodedCommand
|
|
18200
|
+
],
|
|
18201
|
+
{ encoding: "utf8" }
|
|
18202
|
+
);
|
|
18203
|
+
const progId = stdout.trim();
|
|
18204
|
+
const browserMap = {
|
|
18205
|
+
ChromeHTML: "com.google.chrome",
|
|
18206
|
+
BraveHTML: "com.brave.Browser",
|
|
18207
|
+
MSEdgeHTM: "com.microsoft.edge",
|
|
18208
|
+
FirefoxURL: "org.mozilla.firefox"
|
|
18209
|
+
};
|
|
18210
|
+
return browserMap[progId] ? { id: browserMap[progId] } : {};
|
|
18211
|
+
}
|
|
18212
|
+
__name(getWindowsDefaultBrowserFromWsl, "getWindowsDefaultBrowserFromWsl");
|
|
18213
|
+
var pTryEach = /* @__PURE__ */ __name(async (array, mapper) => {
|
|
18214
|
+
let latestError;
|
|
18215
|
+
for (const item of array) {
|
|
18216
|
+
try {
|
|
18217
|
+
return await mapper(item);
|
|
18445
18218
|
} catch (error) {
|
|
18446
|
-
|
|
18219
|
+
latestError = error;
|
|
18220
|
+
}
|
|
18221
|
+
}
|
|
18222
|
+
throw latestError;
|
|
18223
|
+
}, "pTryEach");
|
|
18224
|
+
var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
18225
|
+
options = {
|
|
18226
|
+
wait: false,
|
|
18227
|
+
background: false,
|
|
18228
|
+
newInstance: false,
|
|
18229
|
+
allowNonzeroExitCode: false,
|
|
18230
|
+
...options
|
|
18231
|
+
};
|
|
18232
|
+
if (Array.isArray(options.app)) {
|
|
18233
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
18234
|
+
...options,
|
|
18235
|
+
app: singleApp
|
|
18236
|
+
}));
|
|
18237
|
+
}
|
|
18238
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
18239
|
+
appArguments = [...appArguments];
|
|
18240
|
+
if (Array.isArray(app)) {
|
|
18241
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
18242
|
+
...options,
|
|
18243
|
+
app: {
|
|
18244
|
+
name: appName,
|
|
18245
|
+
arguments: appArguments
|
|
18246
|
+
}
|
|
18247
|
+
}));
|
|
18248
|
+
}
|
|
18249
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
18250
|
+
const ids = {
|
|
18251
|
+
"com.google.chrome": "chrome",
|
|
18252
|
+
"google-chrome.desktop": "chrome",
|
|
18253
|
+
"com.brave.Browser": "brave",
|
|
18254
|
+
"org.mozilla.firefox": "firefox",
|
|
18255
|
+
"firefox.desktop": "firefox",
|
|
18256
|
+
"com.microsoft.msedge": "edge",
|
|
18257
|
+
"com.microsoft.edge": "edge",
|
|
18258
|
+
"com.microsoft.edgemac": "edge",
|
|
18259
|
+
"microsoft-edge.desktop": "edge"
|
|
18260
|
+
};
|
|
18261
|
+
const flags = {
|
|
18262
|
+
chrome: "--incognito",
|
|
18263
|
+
brave: "--incognito",
|
|
18264
|
+
firefox: "--private-window",
|
|
18265
|
+
edge: "--inPrivate"
|
|
18266
|
+
};
|
|
18267
|
+
const browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser2();
|
|
18268
|
+
if (browser.id in ids) {
|
|
18269
|
+
const browserName = ids[browser.id];
|
|
18270
|
+
if (app === "browserPrivate") {
|
|
18271
|
+
appArguments.push(flags[browserName]);
|
|
18272
|
+
}
|
|
18273
|
+
return baseOpen({
|
|
18274
|
+
...options,
|
|
18275
|
+
app: {
|
|
18276
|
+
name: apps[browserName],
|
|
18277
|
+
arguments: appArguments
|
|
18278
|
+
}
|
|
18279
|
+
});
|
|
18280
|
+
}
|
|
18281
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
18282
|
+
}
|
|
18283
|
+
let command;
|
|
18284
|
+
const cliArguments = [];
|
|
18285
|
+
const childProcessOptions = {};
|
|
18286
|
+
if (platform === "darwin") {
|
|
18287
|
+
command = "open";
|
|
18288
|
+
if (options.wait) {
|
|
18289
|
+
cliArguments.push("--wait-apps");
|
|
18290
|
+
}
|
|
18291
|
+
if (options.background) {
|
|
18292
|
+
cliArguments.push("--background");
|
|
18293
|
+
}
|
|
18294
|
+
if (options.newInstance) {
|
|
18295
|
+
cliArguments.push("--new");
|
|
18296
|
+
}
|
|
18297
|
+
if (app) {
|
|
18298
|
+
cliArguments.push("-a", app);
|
|
18299
|
+
}
|
|
18300
|
+
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
18301
|
+
command = await powerShellPath();
|
|
18302
|
+
cliArguments.push(
|
|
18303
|
+
"-NoProfile",
|
|
18304
|
+
"-NonInteractive",
|
|
18305
|
+
"-ExecutionPolicy",
|
|
18306
|
+
"Bypass",
|
|
18307
|
+
"-EncodedCommand"
|
|
18308
|
+
);
|
|
18309
|
+
if (!is_wsl_default) {
|
|
18310
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
18311
|
+
}
|
|
18312
|
+
const encodedArguments = ["Start"];
|
|
18313
|
+
if (options.wait) {
|
|
18314
|
+
encodedArguments.push("-Wait");
|
|
18315
|
+
}
|
|
18316
|
+
if (app) {
|
|
18317
|
+
encodedArguments.push(`"\`"${app}\`""`);
|
|
18318
|
+
if (options.target) {
|
|
18319
|
+
appArguments.push(options.target);
|
|
18320
|
+
}
|
|
18321
|
+
} else if (options.target) {
|
|
18322
|
+
encodedArguments.push(`"${options.target}"`);
|
|
18323
|
+
}
|
|
18324
|
+
if (appArguments.length > 0) {
|
|
18325
|
+
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
18326
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
18327
|
+
}
|
|
18328
|
+
options.target = Buffer2.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
18329
|
+
} else {
|
|
18330
|
+
if (app) {
|
|
18331
|
+
command = app;
|
|
18332
|
+
} else {
|
|
18333
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
18334
|
+
let exeLocalXdgOpen = false;
|
|
18335
|
+
try {
|
|
18336
|
+
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
18337
|
+
exeLocalXdgOpen = true;
|
|
18338
|
+
} catch {
|
|
18339
|
+
}
|
|
18340
|
+
const useSystemXdgOpen = process7.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
18341
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
18342
|
+
}
|
|
18343
|
+
if (appArguments.length > 0) {
|
|
18344
|
+
cliArguments.push(...appArguments);
|
|
18345
|
+
}
|
|
18346
|
+
if (!options.wait) {
|
|
18347
|
+
childProcessOptions.stdio = "ignore";
|
|
18348
|
+
childProcessOptions.detached = true;
|
|
18349
|
+
}
|
|
18350
|
+
}
|
|
18351
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
18352
|
+
cliArguments.push("--args", ...appArguments);
|
|
18353
|
+
}
|
|
18354
|
+
if (options.target) {
|
|
18355
|
+
cliArguments.push(options.target);
|
|
18356
|
+
}
|
|
18357
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
18358
|
+
if (options.wait) {
|
|
18359
|
+
return new Promise((resolve7, reject2) => {
|
|
18360
|
+
subprocess.once("error", reject2);
|
|
18361
|
+
subprocess.once("close", (exitCode) => {
|
|
18362
|
+
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
18363
|
+
reject2(new Error(`Exited with code ${exitCode}`));
|
|
18364
|
+
return;
|
|
18365
|
+
}
|
|
18366
|
+
resolve7(subprocess);
|
|
18367
|
+
});
|
|
18368
|
+
});
|
|
18369
|
+
}
|
|
18370
|
+
subprocess.unref();
|
|
18371
|
+
return subprocess;
|
|
18372
|
+
}, "baseOpen");
|
|
18373
|
+
var open = /* @__PURE__ */ __name((target, options) => {
|
|
18374
|
+
if (typeof target !== "string") {
|
|
18375
|
+
throw new TypeError("Expected a `target`");
|
|
18376
|
+
}
|
|
18377
|
+
return baseOpen({
|
|
18378
|
+
...options,
|
|
18379
|
+
target
|
|
18380
|
+
});
|
|
18381
|
+
}, "open");
|
|
18382
|
+
function detectArchBinary(binary) {
|
|
18383
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
18384
|
+
return binary;
|
|
18385
|
+
}
|
|
18386
|
+
const { [arch]: archBinary } = binary;
|
|
18387
|
+
if (!archBinary) {
|
|
18388
|
+
throw new Error(`${arch} is not supported`);
|
|
18389
|
+
}
|
|
18390
|
+
return archBinary;
|
|
18391
|
+
}
|
|
18392
|
+
__name(detectArchBinary, "detectArchBinary");
|
|
18393
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
18394
|
+
if (wsl && is_wsl_default) {
|
|
18395
|
+
return detectArchBinary(wsl);
|
|
18396
|
+
}
|
|
18397
|
+
if (!platformBinary) {
|
|
18398
|
+
throw new Error(`${platform} is not supported`);
|
|
18399
|
+
}
|
|
18400
|
+
return detectArchBinary(platformBinary);
|
|
18401
|
+
}
|
|
18402
|
+
__name(detectPlatformBinary, "detectPlatformBinary");
|
|
18403
|
+
var apps = {};
|
|
18404
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
18405
|
+
darwin: "google chrome",
|
|
18406
|
+
win32: "chrome",
|
|
18407
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
18408
|
+
}, {
|
|
18409
|
+
wsl: {
|
|
18410
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
18411
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
18412
|
+
}
|
|
18413
|
+
}));
|
|
18414
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
18415
|
+
darwin: "brave browser",
|
|
18416
|
+
win32: "brave",
|
|
18417
|
+
linux: ["brave-browser", "brave"]
|
|
18418
|
+
}, {
|
|
18419
|
+
wsl: {
|
|
18420
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
18421
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
18422
|
+
}
|
|
18423
|
+
}));
|
|
18424
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
18425
|
+
darwin: "firefox",
|
|
18426
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
18427
|
+
linux: "firefox"
|
|
18428
|
+
}, {
|
|
18429
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
18430
|
+
}));
|
|
18431
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
18432
|
+
darwin: "microsoft edge",
|
|
18433
|
+
win32: "msedge",
|
|
18434
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
18435
|
+
}, {
|
|
18436
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
18437
|
+
}));
|
|
18438
|
+
defineLazyProperty(apps, "browser", () => "browser");
|
|
18439
|
+
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
18440
|
+
var open_default = open;
|
|
18441
|
+
|
|
18442
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18443
|
+
var import_ts_dedent4 = __toESM(require_dist(), 1);
|
|
18444
|
+
|
|
18445
|
+
// src/core-server/utils/open-browser/opener.ts
|
|
18446
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
18447
|
+
import { execSync } from "node:child_process";
|
|
18448
|
+
import { join as join7 } from "node:path";
|
|
18449
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
18450
|
+
var OSX_CHROME = "google chrome";
|
|
18451
|
+
var Actions = Object.freeze({
|
|
18452
|
+
NONE: 0,
|
|
18453
|
+
BROWSER: 1,
|
|
18454
|
+
SCRIPT: 2
|
|
18455
|
+
});
|
|
18456
|
+
function getBrowserEnv() {
|
|
18457
|
+
const value = process.env.BROWSER;
|
|
18458
|
+
const args = process.env.BROWSER_ARGS ? process.env.BROWSER_ARGS.split(" ") : [];
|
|
18459
|
+
let action;
|
|
18460
|
+
if (!value) {
|
|
18461
|
+
action = Actions.BROWSER;
|
|
18462
|
+
} else if (value.toLowerCase().endsWith(".js")) {
|
|
18463
|
+
action = Actions.SCRIPT;
|
|
18464
|
+
} else if (value.toLowerCase() === "none") {
|
|
18465
|
+
action = Actions.NONE;
|
|
18466
|
+
} else {
|
|
18467
|
+
action = Actions.BROWSER;
|
|
18468
|
+
}
|
|
18469
|
+
return { action, value, args };
|
|
18470
|
+
}
|
|
18471
|
+
__name(getBrowserEnv, "getBrowserEnv");
|
|
18472
|
+
function executeNodeScript(scriptPath, url) {
|
|
18473
|
+
const extraArgs = process.argv.slice(2);
|
|
18474
|
+
const child = (0, import_cross_spawn.default)(process.execPath, [scriptPath, ...extraArgs, url], {
|
|
18475
|
+
stdio: "inherit"
|
|
18476
|
+
});
|
|
18477
|
+
child.on("close", (code) => {
|
|
18478
|
+
if (code !== 0) {
|
|
18479
|
+
console.log();
|
|
18480
|
+
console.log(import_picocolors5.default.red("The script specified as BROWSER environment variable failed."));
|
|
18481
|
+
console.log(`${import_picocolors5.default.cyan(scriptPath)} exited with code ${code}.`);
|
|
18482
|
+
console.log();
|
|
18483
|
+
return;
|
|
18484
|
+
}
|
|
18485
|
+
});
|
|
18486
|
+
return true;
|
|
18487
|
+
}
|
|
18488
|
+
__name(executeNodeScript, "executeNodeScript");
|
|
18489
|
+
function startBrowserProcess(browser, url, args) {
|
|
18490
|
+
const shouldTryOpenChromiumWithAppleScript = process.platform === "darwin" && (typeof browser !== "string" || browser === OSX_CHROME);
|
|
18491
|
+
if (shouldTryOpenChromiumWithAppleScript) {
|
|
18492
|
+
const supportedChromiumBrowsers = [
|
|
18493
|
+
"Google Chrome Canary",
|
|
18494
|
+
"Google Chrome Dev",
|
|
18495
|
+
"Google Chrome Beta",
|
|
18496
|
+
"Google Chrome",
|
|
18497
|
+
"Microsoft Edge",
|
|
18498
|
+
"Brave Browser",
|
|
18499
|
+
"Vivaldi",
|
|
18500
|
+
"Chromium"
|
|
18501
|
+
];
|
|
18502
|
+
for (const chromiumBrowser of supportedChromiumBrowsers) {
|
|
18503
|
+
try {
|
|
18504
|
+
execSync(`ps cax | grep "${chromiumBrowser}"`);
|
|
18505
|
+
const pathToApplescript = join7(
|
|
18506
|
+
resolvePackageDir("storybook"),
|
|
18507
|
+
"assets",
|
|
18508
|
+
"server",
|
|
18509
|
+
"openBrowser.applescript"
|
|
18510
|
+
);
|
|
18511
|
+
const command = `osascript "${pathToApplescript}" "`.concat(encodeURI(url), '" "').concat(
|
|
18512
|
+
process.env.OPEN_MATCH_HOST_ONLY === "true" ? encodeURI(new URL(url).origin) : encodeURI(url),
|
|
18513
|
+
'" "'
|
|
18514
|
+
).concat(chromiumBrowser, '"');
|
|
18515
|
+
execSync(command, {
|
|
18516
|
+
cwd: __dirname
|
|
18517
|
+
});
|
|
18518
|
+
return true;
|
|
18519
|
+
} catch (err) {
|
|
18520
|
+
}
|
|
18521
|
+
}
|
|
18522
|
+
}
|
|
18523
|
+
if (process.platform === "darwin" && browser === "open") {
|
|
18524
|
+
browser = void 0;
|
|
18525
|
+
}
|
|
18526
|
+
if (typeof browser === "string" && args.length > 0) {
|
|
18527
|
+
browser = [browser].concat(args);
|
|
18528
|
+
}
|
|
18529
|
+
try {
|
|
18530
|
+
const options = { app: browser, wait: false, url: true };
|
|
18531
|
+
open_default(url, options).catch(() => {
|
|
18532
|
+
});
|
|
18533
|
+
return true;
|
|
18534
|
+
} catch (err) {
|
|
18535
|
+
return false;
|
|
18536
|
+
}
|
|
18537
|
+
}
|
|
18538
|
+
__name(startBrowserProcess, "startBrowserProcess");
|
|
18539
|
+
function openBrowser(url) {
|
|
18540
|
+
const { action, value, args } = getBrowserEnv();
|
|
18541
|
+
switch (action) {
|
|
18542
|
+
case Actions.NONE: {
|
|
18543
|
+
return false;
|
|
18544
|
+
}
|
|
18545
|
+
case Actions.SCRIPT: {
|
|
18546
|
+
if (!value) {
|
|
18547
|
+
throw new Error("BROWSER environment variable is not set.");
|
|
18548
|
+
}
|
|
18549
|
+
return executeNodeScript(value, url);
|
|
18550
|
+
}
|
|
18551
|
+
case Actions.BROWSER: {
|
|
18552
|
+
return startBrowserProcess(value, url, args);
|
|
18553
|
+
}
|
|
18554
|
+
default: {
|
|
18555
|
+
throw new Error("Not implemented.");
|
|
18556
|
+
}
|
|
18557
|
+
}
|
|
18558
|
+
}
|
|
18559
|
+
__name(openBrowser, "openBrowser");
|
|
18560
|
+
|
|
18561
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18562
|
+
async function openInBrowser(address) {
|
|
18563
|
+
let errorOccured = false;
|
|
18564
|
+
try {
|
|
18565
|
+
await openBrowser(address);
|
|
18566
|
+
} catch (error) {
|
|
18567
|
+
errorOccured = true;
|
|
18568
|
+
}
|
|
18569
|
+
try {
|
|
18570
|
+
if (errorOccured) {
|
|
18571
|
+
await open_default(address);
|
|
18572
|
+
errorOccured = false;
|
|
18573
|
+
}
|
|
18574
|
+
} catch (error) {
|
|
18575
|
+
errorOccured = true;
|
|
18576
|
+
}
|
|
18577
|
+
if (errorOccured) {
|
|
18578
|
+
logger5.error(import_ts_dedent4.dedent`
|
|
18447
18579
|
Could not open ${address} inside a browser. If you're running this command inside a
|
|
18448
18580
|
docker container or on a CI, you need to pass the '--ci' flag to prevent opening a
|
|
18449
18581
|
browser by default.
|
|
18450
18582
|
`);
|
|
18451
|
-
|
|
18452
|
-
});
|
|
18583
|
+
}
|
|
18453
18584
|
}
|
|
18454
18585
|
__name(openInBrowser, "openInBrowser");
|
|
18455
18586
|
|
|
18456
18587
|
// src/core-server/utils/server-address.ts
|
|
18457
18588
|
var import_detect_port = __toESM(require_detect_port2(), 1);
|
|
18458
|
-
import
|
|
18589
|
+
import os2 from "node:os";
|
|
18459
18590
|
import { logger as logger6 } from "storybook/internal/node-logger";
|
|
18460
18591
|
function getServerAddresses(port, host, proto, initialPath) {
|
|
18461
18592
|
const address = new URL(`${proto}://localhost:${port}/`);
|
|
@@ -18486,7 +18617,7 @@ var getServerChannelUrl = /* @__PURE__ */ __name((port, { https: https2 }) => {
|
|
|
18486
18617
|
return `${https2 ? "wss" : "ws"}://localhost:${port}/storybook-server-channel`;
|
|
18487
18618
|
}, "getServerChannelUrl");
|
|
18488
18619
|
var getLocalIp = /* @__PURE__ */ __name(() => {
|
|
18489
|
-
const allIps = Object.values(
|
|
18620
|
+
const allIps = Object.values(os2.networkInterfaces()).flat();
|
|
18490
18621
|
const allFilteredIps = allIps.filter((ip) => ip && ip.family === "IPv4" && !ip.internal);
|
|
18491
18622
|
return allFilteredIps.length ? allFilteredIps[0]?.address : "0.0.0.0";
|
|
18492
18623
|
}, "getLocalIp");
|
|
@@ -18541,6 +18672,7 @@ async function storybookDevServer(options) {
|
|
|
18541
18672
|
invariant(port, "expected options to have a port");
|
|
18542
18673
|
const proto = options.https ? "https" : "http";
|
|
18543
18674
|
const { address, networkAddress } = getServerAddresses(port, host, proto, initialPath);
|
|
18675
|
+
options.networkAddress = networkAddress;
|
|
18544
18676
|
if (!core2?.builder) {
|
|
18545
18677
|
throw new MissingBuilderError2();
|
|
18546
18678
|
}
|
|
@@ -18586,7 +18718,8 @@ async function storybookDevServer(options) {
|
|
|
18586
18718
|
await Promise.all([initializedStoryIndexGenerator, listening]).then(async ([indexGenerator]) => {
|
|
18587
18719
|
if (indexGenerator && !options.ci && !options.smokeTest && options.open) {
|
|
18588
18720
|
const url = host ? networkAddress : address;
|
|
18589
|
-
openInBrowser(options.previewOnly ? `${url}iframe.html?navigator=true` : url)
|
|
18721
|
+
openInBrowser(options.previewOnly ? `${url}iframe.html?navigator=true` : url).catch(() => {
|
|
18722
|
+
});
|
|
18590
18723
|
}
|
|
18591
18724
|
});
|
|
18592
18725
|
if (indexError) {
|
|
@@ -18623,12 +18756,12 @@ __name(storybookDevServer, "storybookDevServer");
|
|
|
18623
18756
|
// src/core-server/utils/output-startup-information.ts
|
|
18624
18757
|
import { colors as colors2 } from "storybook/internal/node-logger";
|
|
18625
18758
|
var import_cli_table3 = __toESM(require_cli_table3(), 1);
|
|
18626
|
-
var
|
|
18759
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
18627
18760
|
var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
|
|
18628
18761
|
var import_ts_dedent6 = __toESM(require_dist(), 1);
|
|
18629
18762
|
|
|
18630
18763
|
// src/core-server/utils/update-check.ts
|
|
18631
|
-
var
|
|
18764
|
+
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
18632
18765
|
var import_ts_dedent5 = __toESM(require_dist(), 1);
|
|
18633
18766
|
import { cache } from "storybook/internal/common";
|
|
18634
18767
|
import { colors } from "storybook/internal/node-logger";
|
|
@@ -18663,13 +18796,13 @@ function createUpdateMessage(updateInfo, version) {
|
|
|
18663
18796
|
const upgradeCommand = `npx storybook@${isPrerelease ? "next" : "latest"} upgrade`;
|
|
18664
18797
|
updateMessage = updateInfo.success && semver.lt(version, updateInfo.data.latest.version) ? import_ts_dedent5.dedent`
|
|
18665
18798
|
${colors.orange(
|
|
18666
|
-
`A new version (${
|
|
18799
|
+
`A new version (${import_picocolors6.default.bold(updateInfo.data.latest.version)}) is available!`
|
|
18667
18800
|
)}
|
|
18668
18801
|
|
|
18669
|
-
${
|
|
18802
|
+
${import_picocolors6.default.gray("Upgrade now:")} ${colors.green(upgradeCommand)}
|
|
18670
18803
|
|
|
18671
|
-
${
|
|
18672
|
-
|
|
18804
|
+
${import_picocolors6.default.gray("Read full changelog:")} ${import_picocolors6.default.gray(
|
|
18805
|
+
import_picocolors6.default.underline("https://github.com/storybookjs/storybook/blob/main/CHANGELOG.md")
|
|
18673
18806
|
)}
|
|
18674
18807
|
` : "";
|
|
18675
18808
|
} catch (e) {
|
|
@@ -18708,20 +18841,20 @@ function outputStartupInformation(options) {
|
|
|
18708
18841
|
paddingBottom: 0
|
|
18709
18842
|
});
|
|
18710
18843
|
serveMessage.push(
|
|
18711
|
-
["Local:",
|
|
18712
|
-
["On your network:",
|
|
18844
|
+
["Local:", import_picocolors7.default.cyan(address)],
|
|
18845
|
+
["On your network:", import_picocolors7.default.cyan(networkAddress)]
|
|
18713
18846
|
);
|
|
18714
18847
|
const timeStatement = [
|
|
18715
|
-
managerTotalTime && `${
|
|
18716
|
-
previewTotalTime && `${
|
|
18848
|
+
managerTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(managerTotalTime))} for manager`,
|
|
18849
|
+
previewTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(previewTotalTime))} for preview`
|
|
18717
18850
|
].filter(Boolean).join(" and ");
|
|
18718
18851
|
console.log(
|
|
18719
18852
|
boxen(
|
|
18720
18853
|
import_ts_dedent6.dedent`
|
|
18721
18854
|
${colors2.green(
|
|
18722
|
-
`Storybook ${
|
|
18855
|
+
`Storybook ${import_picocolors7.default.bold(version)} for ${import_picocolors7.default.bold(name)} started`
|
|
18723
18856
|
)}
|
|
18724
|
-
${
|
|
18857
|
+
${import_picocolors7.default.gray(timeStatement)}
|
|
18725
18858
|
|
|
18726
18859
|
${serveMessage.toString()}${updateMessage ? `
|
|
18727
18860
|
|
|
@@ -18737,7 +18870,7 @@ __name(outputStartupInformation, "outputStartupInformation");
|
|
|
18737
18870
|
import { logger as logger10 } from "storybook/internal/node-logger";
|
|
18738
18871
|
|
|
18739
18872
|
// ../lib/cli-storybook/src/doctor/getIncompatibleStorybookPackages.ts
|
|
18740
|
-
var
|
|
18873
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
18741
18874
|
import { versions as storybookCorePackages } from "storybook/internal/common";
|
|
18742
18875
|
import { logger as logger9 } from "storybook/internal/node-logger";
|
|
18743
18876
|
import semver2 from "semver";
|
|
@@ -18841,7 +18974,7 @@ var getIncompatiblePackagesSummary = /* @__PURE__ */ __name((dependencyAnalysis,
|
|
|
18841
18974
|
);
|
|
18842
18975
|
if (incompatiblePackages.length > 0) {
|
|
18843
18976
|
summaryMessage.push(
|
|
18844
|
-
`You are currently using Storybook ${
|
|
18977
|
+
`You are currently using Storybook ${import_picocolors8.default.bold(
|
|
18845
18978
|
currentStorybookVersion
|
|
18846
18979
|
)} but you have packages which are incompatible with it:
|
|
18847
18980
|
`
|
|
@@ -18872,13 +19005,13 @@ var getIncompatiblePackagesSummary = /* @__PURE__ */ __name((dependencyAnalysis,
|
|
|
18872
19005
|
if (incompatiblePackages.some((dep) => dep.availableCoreUpdate)) {
|
|
18873
19006
|
summaryMessage.push(
|
|
18874
19007
|
"\n",
|
|
18875
|
-
`The version of ${
|
|
19008
|
+
`The version of ${import_picocolors8.default.blue(`storybook@${currentStorybookVersion}`)} is behind the following core packages:`,
|
|
18876
19009
|
`${incompatiblePackages.filter((dep) => dep.availableCoreUpdate).map(
|
|
18877
|
-
({ packageName, packageVersion }) => `- ${
|
|
19010
|
+
({ packageName, packageVersion }) => `- ${import_picocolors8.default.blue(`${packageName}@${packageVersion}`)}`
|
|
18878
19011
|
).join("\n")}`,
|
|
18879
19012
|
"\n",
|
|
18880
19013
|
`Upgrade Storybook with:`,
|
|
18881
|
-
|
|
19014
|
+
import_picocolors8.default.blue("npx storybook@latest upgrade")
|
|
18882
19015
|
);
|
|
18883
19016
|
}
|
|
18884
19017
|
}
|
|
@@ -18903,7 +19036,7 @@ var warnOnIncompatibleAddons = /* @__PURE__ */ __name(async (currentStorybookVer
|
|
|
18903
19036
|
}, "warnOnIncompatibleAddons");
|
|
18904
19037
|
|
|
18905
19038
|
// src/core-server/utils/warnWhenUsingArgTypesRegex.ts
|
|
18906
|
-
var
|
|
19039
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
18907
19040
|
var import_ts_dedent7 = __toESM(require_dist(), 1);
|
|
18908
19041
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
18909
19042
|
import { core } from "storybook/internal/babel";
|
|
@@ -18919,20 +19052,20 @@ async function warnWhenUsingArgTypesRegex(previewConfigPath, config) {
|
|
|
18919
19052
|
{ code: previewContent, ast: babelParse(previewContent) }
|
|
18920
19053
|
);
|
|
18921
19054
|
file.path.traverse({
|
|
18922
|
-
Identifier: /* @__PURE__ */ __name((
|
|
18923
|
-
if (
|
|
19055
|
+
Identifier: /* @__PURE__ */ __name((path2) => {
|
|
19056
|
+
if (path2.node.name === "argTypesRegex") {
|
|
18924
19057
|
const message = import_ts_dedent7.dedent`
|
|
18925
|
-
${
|
|
19058
|
+
${import_picocolors9.default.bold("Attention")}: We've detected that you're using ${import_picocolors9.default.cyan(
|
|
18926
19059
|
"actions.argTypesRegex"
|
|
18927
19060
|
)} together with the visual test addon:
|
|
18928
19061
|
|
|
18929
|
-
${
|
|
19062
|
+
${path2.buildCodeFrameError(previewConfigPath).message}
|
|
18930
19063
|
|
|
18931
|
-
We recommend removing the ${
|
|
19064
|
+
We recommend removing the ${import_picocolors9.default.cyan(
|
|
18932
19065
|
"argTypesRegex"
|
|
18933
|
-
)} and assigning explicit action with the ${
|
|
19066
|
+
)} and assigning explicit action with the ${import_picocolors9.default.cyan(
|
|
18934
19067
|
"fn"
|
|
18935
|
-
)} function from ${
|
|
19068
|
+
)} function from ${import_picocolors9.default.cyan("storybook/test")} instead:
|
|
18936
19069
|
https://storybook.js.org/docs/essentials/actions#via-storybooktest-fn-spy-function
|
|
18937
19070
|
|
|
18938
19071
|
The build used by the addon for snapshot testing doesn't take the regex into account, which can cause hard to debug problems when a snapshot depends on the presence of action props.
|
|
@@ -18998,7 +19131,7 @@ async function buildDevStandalone(options) {
|
|
|
18998
19131
|
validateFrameworkName(frameworkName);
|
|
18999
19132
|
}
|
|
19000
19133
|
if (frameworkName) {
|
|
19001
|
-
corePresets.push(
|
|
19134
|
+
corePresets.push(join8(frameworkName, "preset"));
|
|
19002
19135
|
}
|
|
19003
19136
|
frameworkName = frameworkName || "custom";
|
|
19004
19137
|
const packageManager = JsPackageManagerFactory.getPackageManager({
|
|
@@ -19054,7 +19187,7 @@ async function buildDevStandalone(options) {
|
|
|
19054
19187
|
const resolvedRenderer = renderer && resolveAddonName2(options.configDir, renderer, options);
|
|
19055
19188
|
presets = await loadAllPresets2({
|
|
19056
19189
|
corePresets: [
|
|
19057
|
-
|
|
19190
|
+
join8(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
19058
19191
|
...managerBuilder.corePresets || [],
|
|
19059
19192
|
...previewBuilder.corePresets || [],
|
|
19060
19193
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
@@ -19125,7 +19258,7 @@ import { normalizeStories as normalizeStories3 } from "storybook/internal/common
|
|
|
19125
19258
|
import { logger as logger12 } from "storybook/internal/node-logger";
|
|
19126
19259
|
|
|
19127
19260
|
// src/core-server/load.ts
|
|
19128
|
-
import { join as
|
|
19261
|
+
import { join as join9, relative as relative6, resolve as resolve6 } from "node:path";
|
|
19129
19262
|
import {
|
|
19130
19263
|
getProjectRoot as getProjectRoot3,
|
|
19131
19264
|
loadAllPresets as loadAllPresets3,
|
|
@@ -19149,7 +19282,7 @@ async function loadStorybook(options) {
|
|
|
19149
19282
|
validateFrameworkName2(frameworkName);
|
|
19150
19283
|
}
|
|
19151
19284
|
if (frameworkName) {
|
|
19152
|
-
corePresets.push(
|
|
19285
|
+
corePresets.push(join9(frameworkName, "preset"));
|
|
19153
19286
|
}
|
|
19154
19287
|
frameworkName = frameworkName || "custom";
|
|
19155
19288
|
let presets = await loadAllPresets3({
|
|
@@ -19164,7 +19297,7 @@ async function loadStorybook(options) {
|
|
|
19164
19297
|
const resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options);
|
|
19165
19298
|
presets = await loadAllPresets3({
|
|
19166
19299
|
corePresets: [
|
|
19167
|
-
|
|
19300
|
+
join9(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
19168
19301
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
19169
19302
|
...corePresets
|
|
19170
19303
|
],
|