storybook 10.0.0-beta.5 → 10.0.0-beta.6
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/_node-chunks/{builder-manager-ZTS4EIKQ.js → builder-manager-V33CQT2M.js} +21 -151
- package/dist/_node-chunks/camelcase-BZ55OCHI.js +18 -0
- package/dist/_node-chunks/{chunk-WCSHG2QT.js → chunk-2DMFI367.js} +7 -7
- package/dist/_node-chunks/{chunk-VQN4WAIA.js → chunk-4TOI4VSK.js} +7 -7
- package/dist/_node-chunks/{chunk-TBWOUVTA.js → chunk-55VWKF63.js} +709 -935
- package/dist/_node-chunks/{chunk-P3TWEOO5.js → chunk-5IEY46LQ.js} +7 -7
- package/dist/_node-chunks/{chunk-EIHJ5J3O.js → chunk-6PTV7XGR.js} +8 -8
- package/dist/_node-chunks/{chunk-D7SDB4XE.js → chunk-7NJGTQ3W.js} +8 -8
- package/dist/_node-chunks/{chunk-4VDRH7SM.js → chunk-7WH7AGOR.js} +7 -7
- package/dist/_node-chunks/{chunk-AK5PHLUA.js → chunk-A7CUP23N.js} +7 -7
- package/dist/_node-chunks/{chunk-K4YETNYJ.js → chunk-B3AMFGAL.js} +7 -7
- package/dist/_node-chunks/{chunk-PIKDGR3O.js → chunk-BNOZ3EKF.js} +7 -7
- package/dist/_node-chunks/{chunk-F7YW5W6B.js → chunk-DC7OWBHB.js} +12 -12
- package/dist/_node-chunks/{chunk-VX5P3IYA.js → chunk-E6TLN2J2.js} +7 -7
- package/dist/_node-chunks/{chunk-TVKUJ3SE.js → chunk-EAOPWIKA.js} +8 -8
- package/dist/_node-chunks/{chunk-TKN5TEZV.js → chunk-EY5PTUZL.js} +13 -13
- package/dist/_node-chunks/{chunk-DZJNLBBL.js → chunk-F3PO67U3.js} +7 -7
- package/dist/_node-chunks/chunk-FDDJHDCE.js +62 -0
- package/dist/_node-chunks/{chunk-KZB7ELL6.js → chunk-HEBHWRWL.js} +7 -7
- package/dist/_node-chunks/{chunk-VWSUFVUF.js → chunk-HPFXREVG.js} +7 -7
- package/dist/_node-chunks/{chunk-OC3TVLYU.js → chunk-IINJT47N.js} +7 -7
- package/dist/_node-chunks/{chunk-J3DQMIO4.js → chunk-JNHUDBJL.js} +7 -7
- package/dist/_node-chunks/{chunk-SW3VZAH7.js → chunk-JOXYGIZK.js} +9 -9
- package/dist/_node-chunks/{chunk-P7YMEOXF.js → chunk-MLBTKECD.js} +7 -7
- package/dist/_node-chunks/{chunk-UTCFHTQH.js → chunk-NJXBURX7.js} +7 -7
- package/dist/_node-chunks/{chunk-H52PBBSK.js → chunk-NKZ4UPPV.js} +7 -7
- package/dist/_node-chunks/{chunk-F3WE3456.js → chunk-NUVGSFQI.js} +7 -7
- package/dist/_node-chunks/chunk-R5DIBOM6.js +18 -0
- package/dist/_node-chunks/{chunk-ACUNHBEO.js → chunk-RIPA4LFD.js} +22 -22
- package/dist/_node-chunks/{chunk-KU3JBNPY.js → chunk-TJIMCNYJ.js} +8 -8
- package/dist/_node-chunks/{chunk-4KRR46V2.js → chunk-UYKQJMQY.js} +15 -15
- package/dist/_node-chunks/{chunk-3VVGIILJ.js → chunk-VQH4ZFTS.js} +8 -8
- package/dist/_node-chunks/{chunk-QHIU5I7C.js → chunk-VSC6LSCQ.js} +6 -6
- package/dist/_node-chunks/{chunk-2VMDKLSW.js → chunk-XZTBG2TG.js} +6 -6
- package/dist/_node-chunks/{dist-OGRBL76N.js → dist-CGGAYWME.js} +9 -9
- package/dist/_node-chunks/{globby-65LOULA6.js → globby-3IFB7BJC.js} +17 -13
- package/dist/_node-chunks/{lib-TF7JCT3A.js → lib-IT6OBSID.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-6ZJEUZMZ.js → mdx-N42X6CFJ-WM36SSZ6.js} +8 -8
- package/dist/_node-chunks/{p-limit-PF7JSPDT.js → p-limit-3V5XIKA7.js} +7 -7
- package/dist/_node-chunks/{plugin-LGHGAC6J.js → plugin-3YREMMJJ.js} +10 -10
- package/dist/_node-chunks/{plugin-A6XAWMXN.js → plugin-GJUBUKCT.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js → webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-ZJJVMJUS.js → webpack-mock-plugin-XJNFAHBI.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 +3 -3
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +1104 -999
- package/dist/core-server/presets/common-manager.js +67 -27
- 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-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1250 -972
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +1724 -464
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +284 -48
- package/dist/node-logger/index.js +14 -14
- package/dist/preview/runtime.js +7 -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 +4 -0
- 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_0v1evul49qdo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.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-NUVGSFQI.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-EAOPWIKA.js";
|
|
19
|
+
import "../_node-chunks/chunk-A7CUP23N.js";
|
|
20
20
|
import {
|
|
21
21
|
StatusTypeIdMismatchError,
|
|
22
22
|
StorybookError
|
|
23
|
-
} from "../_node-chunks/chunk-
|
|
23
|
+
} from "../_node-chunks/chunk-JOXYGIZK.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-DC7OWBHB.js";
|
|
32
|
+
import "../_node-chunks/chunk-4TOI4VSK.js";
|
|
33
33
|
import {
|
|
34
34
|
telemetry
|
|
35
|
-
} from "../_node-chunks/chunk-
|
|
36
|
-
import "../_node-chunks/chunk-
|
|
35
|
+
} from "../_node-chunks/chunk-UYKQJMQY.js";
|
|
36
|
+
import "../_node-chunks/chunk-R5DIBOM6.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-RIPA4LFD.js";
|
|
40
|
+
import "../_node-chunks/chunk-IINJT47N.js";
|
|
41
|
+
import "../_node-chunks/chunk-2DMFI367.js";
|
|
42
|
+
import "../_node-chunks/chunk-FDDJHDCE.js";
|
|
43
|
+
import "../_node-chunks/chunk-7NJGTQ3W.js";
|
|
44
44
|
import {
|
|
45
|
-
optionalEnvToBoolean
|
|
46
|
-
|
|
45
|
+
optionalEnvToBoolean,
|
|
46
|
+
require_cross_spawn
|
|
47
|
+
} from "../_node-chunks/chunk-55VWKF63.js";
|
|
47
48
|
import {
|
|
48
49
|
up2 as up
|
|
49
|
-
} from "../_node-chunks/chunk-
|
|
50
|
+
} from "../_node-chunks/chunk-F3PO67U3.js";
|
|
50
51
|
import {
|
|
51
52
|
invariant
|
|
52
|
-
} from "../_node-chunks/chunk-
|
|
53
|
+
} from "../_node-chunks/chunk-HPFXREVG.js";
|
|
53
54
|
import {
|
|
54
55
|
importModule,
|
|
55
56
|
resolvePackageDir
|
|
56
|
-
} from "../_node-chunks/chunk-
|
|
57
|
+
} from "../_node-chunks/chunk-TJIMCNYJ.js";
|
|
57
58
|
import {
|
|
58
59
|
resolve
|
|
59
|
-
} from "../_node-chunks/chunk-
|
|
60
|
+
} from "../_node-chunks/chunk-7WH7AGOR.js";
|
|
60
61
|
import {
|
|
61
62
|
require_prompts
|
|
62
|
-
} from "../_node-chunks/chunk-
|
|
63
|
-
import "../_node-chunks/chunk-
|
|
63
|
+
} from "../_node-chunks/chunk-E6TLN2J2.js";
|
|
64
|
+
import "../_node-chunks/chunk-NJXBURX7.js";
|
|
64
65
|
import {
|
|
65
66
|
slash
|
|
66
|
-
} from "../_node-chunks/chunk-
|
|
67
|
+
} from "../_node-chunks/chunk-JNHUDBJL.js";
|
|
67
68
|
import {
|
|
68
69
|
require_dist
|
|
69
|
-
} from "../_node-chunks/chunk-
|
|
70
|
+
} from "../_node-chunks/chunk-MLBTKECD.js";
|
|
70
71
|
import {
|
|
71
72
|
require_lib,
|
|
72
73
|
require_src
|
|
73
|
-
} from "../_node-chunks/chunk-
|
|
74
|
+
} from "../_node-chunks/chunk-NKZ4UPPV.js";
|
|
74
75
|
import {
|
|
75
76
|
require_picocolors
|
|
76
|
-
} from "../_node-chunks/chunk-
|
|
77
|
+
} from "../_node-chunks/chunk-5IEY46LQ.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-XZTBG2TG.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
|
}
|
|
@@ -9248,7 +8715,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9248
8715
|
}
|
|
9249
8716
|
const pathToSubIndex = {};
|
|
9250
8717
|
const fullGlob = slash(join(specifier.directory, specifier.files));
|
|
9251
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
8718
|
+
const { globby } = await import("../_node-chunks/globby-3IFB7BJC.js");
|
|
9252
8719
|
const files = await globby(fullGlob, {
|
|
9253
8720
|
absolute: true,
|
|
9254
8721
|
cwd: workingDir,
|
|
@@ -9453,7 +8920,8 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9453
8920
|
title,
|
|
9454
8921
|
importPath,
|
|
9455
8922
|
componentPath,
|
|
9456
|
-
tags
|
|
8923
|
+
tags,
|
|
8924
|
+
...input.exportName ? { exportName: input.exportName } : {}
|
|
9457
8925
|
};
|
|
9458
8926
|
});
|
|
9459
8927
|
const hasAutodocsTag = entries.some((entry) => entry.tags.includes(AUTODOCS_TAG));
|
|
@@ -9487,7 +8955,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
|
|
|
9487
8955
|
const normalizedPath = normalizeStoryPath(relativePath);
|
|
9488
8956
|
const importPath = slash(normalizedPath);
|
|
9489
8957
|
const content = await readFile(absolutePath, { encoding: "utf8" });
|
|
9490
|
-
const { analyze } = await import("../_node-chunks/dist-
|
|
8958
|
+
const { analyze } = await import("../_node-chunks/dist-CGGAYWME.js");
|
|
9491
8959
|
const result2 = await analyze(content);
|
|
9492
8960
|
if (result2.isTemplate) {
|
|
9493
8961
|
return false;
|
|
@@ -9830,7 +9298,7 @@ __name(print, "print");
|
|
|
9830
9298
|
// src/core-server/utils/get-builders.ts
|
|
9831
9299
|
import { MissingBuilderError } from "storybook/internal/server-errors";
|
|
9832
9300
|
async function getManagerBuilder() {
|
|
9833
|
-
return await import("../_node-chunks/builder-manager-
|
|
9301
|
+
return await import("../_node-chunks/builder-manager-V33CQT2M.js");
|
|
9834
9302
|
}
|
|
9835
9303
|
__name(getManagerBuilder, "getManagerBuilder");
|
|
9836
9304
|
async function getPreviewBuilder(resolvedPreviewBuilder) {
|
|
@@ -10096,19 +9564,19 @@ function toPath(deepKey) {
|
|
|
10096
9564
|
__name(toPath, "toPath");
|
|
10097
9565
|
|
|
10098
9566
|
// ../node_modules/es-toolkit/dist/compat/object/get.mjs
|
|
10099
|
-
function get(object,
|
|
9567
|
+
function get(object, path2, defaultValue) {
|
|
10100
9568
|
if (object == null) {
|
|
10101
9569
|
return defaultValue;
|
|
10102
9570
|
}
|
|
10103
|
-
switch (typeof
|
|
9571
|
+
switch (typeof path2) {
|
|
10104
9572
|
case "string": {
|
|
10105
|
-
if (isUnsafeProperty(
|
|
9573
|
+
if (isUnsafeProperty(path2)) {
|
|
10106
9574
|
return defaultValue;
|
|
10107
9575
|
}
|
|
10108
|
-
const result2 = object[
|
|
9576
|
+
const result2 = object[path2];
|
|
10109
9577
|
if (result2 === void 0) {
|
|
10110
|
-
if (isDeepKey(
|
|
10111
|
-
return get(object, toPath(
|
|
9578
|
+
if (isDeepKey(path2)) {
|
|
9579
|
+
return get(object, toPath(path2), defaultValue);
|
|
10112
9580
|
} else {
|
|
10113
9581
|
return defaultValue;
|
|
10114
9582
|
}
|
|
@@ -10117,28 +9585,28 @@ function get(object, path, defaultValue) {
|
|
|
10117
9585
|
}
|
|
10118
9586
|
case "number":
|
|
10119
9587
|
case "symbol": {
|
|
10120
|
-
if (typeof
|
|
10121
|
-
|
|
9588
|
+
if (typeof path2 === "number") {
|
|
9589
|
+
path2 = toKey(path2);
|
|
10122
9590
|
}
|
|
10123
|
-
const result2 = object[
|
|
9591
|
+
const result2 = object[path2];
|
|
10124
9592
|
if (result2 === void 0) {
|
|
10125
9593
|
return defaultValue;
|
|
10126
9594
|
}
|
|
10127
9595
|
return result2;
|
|
10128
9596
|
}
|
|
10129
9597
|
default: {
|
|
10130
|
-
if (Array.isArray(
|
|
10131
|
-
return getWithPath(object,
|
|
9598
|
+
if (Array.isArray(path2)) {
|
|
9599
|
+
return getWithPath(object, path2, defaultValue);
|
|
10132
9600
|
}
|
|
10133
|
-
if (Object.is(
|
|
10134
|
-
|
|
9601
|
+
if (Object.is(path2?.valueOf(), -0)) {
|
|
9602
|
+
path2 = "-0";
|
|
10135
9603
|
} else {
|
|
10136
|
-
|
|
9604
|
+
path2 = String(path2);
|
|
10137
9605
|
}
|
|
10138
|
-
if (isUnsafeProperty(
|
|
9606
|
+
if (isUnsafeProperty(path2)) {
|
|
10139
9607
|
return defaultValue;
|
|
10140
9608
|
}
|
|
10141
|
-
const result2 = object[
|
|
9609
|
+
const result2 = object[path2];
|
|
10142
9610
|
if (result2 === void 0) {
|
|
10143
9611
|
return defaultValue;
|
|
10144
9612
|
}
|
|
@@ -10147,19 +9615,19 @@ function get(object, path, defaultValue) {
|
|
|
10147
9615
|
}
|
|
10148
9616
|
}
|
|
10149
9617
|
__name(get, "get");
|
|
10150
|
-
function getWithPath(object,
|
|
10151
|
-
if (
|
|
9618
|
+
function getWithPath(object, path2, defaultValue) {
|
|
9619
|
+
if (path2.length === 0) {
|
|
10152
9620
|
return defaultValue;
|
|
10153
9621
|
}
|
|
10154
9622
|
let current = object;
|
|
10155
|
-
for (let index = 0; index <
|
|
9623
|
+
for (let index = 0; index < path2.length; index++) {
|
|
10156
9624
|
if (current == null) {
|
|
10157
9625
|
return defaultValue;
|
|
10158
9626
|
}
|
|
10159
|
-
if (isUnsafeProperty(
|
|
9627
|
+
if (isUnsafeProperty(path2[index])) {
|
|
10160
9628
|
return defaultValue;
|
|
10161
9629
|
}
|
|
10162
|
-
current = current[
|
|
9630
|
+
current = current[path2[index]];
|
|
10163
9631
|
}
|
|
10164
9632
|
if (current === void 0) {
|
|
10165
9633
|
return defaultValue;
|
|
@@ -10169,9 +9637,9 @@ function getWithPath(object, path, defaultValue) {
|
|
|
10169
9637
|
__name(getWithPath, "getWithPath");
|
|
10170
9638
|
|
|
10171
9639
|
// ../node_modules/es-toolkit/dist/compat/object/property.mjs
|
|
10172
|
-
function property(
|
|
9640
|
+
function property(path2) {
|
|
10173
9641
|
return function(object) {
|
|
10174
|
-
return get(object,
|
|
9642
|
+
return get(object, path2);
|
|
10175
9643
|
};
|
|
10176
9644
|
}
|
|
10177
9645
|
__name(property, "property");
|
|
@@ -10632,14 +10100,14 @@ function isArguments(value) {
|
|
|
10632
10100
|
__name(isArguments, "isArguments");
|
|
10633
10101
|
|
|
10634
10102
|
// ../node_modules/es-toolkit/dist/compat/object/has.mjs
|
|
10635
|
-
function has(object,
|
|
10103
|
+
function has(object, path2) {
|
|
10636
10104
|
let resolvedPath;
|
|
10637
|
-
if (Array.isArray(
|
|
10638
|
-
resolvedPath =
|
|
10639
|
-
} else if (typeof
|
|
10640
|
-
resolvedPath = toPath(
|
|
10105
|
+
if (Array.isArray(path2)) {
|
|
10106
|
+
resolvedPath = path2;
|
|
10107
|
+
} else if (typeof path2 === "string" && isDeepKey(path2) && object?.[path2] == null) {
|
|
10108
|
+
resolvedPath = toPath(path2);
|
|
10641
10109
|
} else {
|
|
10642
|
-
resolvedPath = [
|
|
10110
|
+
resolvedPath = [path2];
|
|
10643
10111
|
}
|
|
10644
10112
|
if (resolvedPath.length === 0) {
|
|
10645
10113
|
return false;
|
|
@@ -11645,7 +11113,7 @@ function isFunction(value) {
|
|
|
11645
11113
|
__name(isFunction, "isFunction");
|
|
11646
11114
|
|
|
11647
11115
|
// ../node_modules/es-toolkit/dist/compat/array/invokeMap.mjs
|
|
11648
|
-
function invokeMap(collection,
|
|
11116
|
+
function invokeMap(collection, path2, ...args) {
|
|
11649
11117
|
if (isNil(collection)) {
|
|
11650
11118
|
return [];
|
|
11651
11119
|
}
|
|
@@ -11653,19 +11121,19 @@ function invokeMap(collection, path, ...args) {
|
|
|
11653
11121
|
const result2 = [];
|
|
11654
11122
|
for (let i = 0; i < values2.length; i++) {
|
|
11655
11123
|
const value = values2[i];
|
|
11656
|
-
if (isFunction(
|
|
11657
|
-
result2.push(
|
|
11124
|
+
if (isFunction(path2)) {
|
|
11125
|
+
result2.push(path2.apply(value, args));
|
|
11658
11126
|
continue;
|
|
11659
11127
|
}
|
|
11660
|
-
const method2 = get(value,
|
|
11128
|
+
const method2 = get(value, path2);
|
|
11661
11129
|
let thisContext = value;
|
|
11662
|
-
if (Array.isArray(
|
|
11663
|
-
const pathExceptLast =
|
|
11130
|
+
if (Array.isArray(path2)) {
|
|
11131
|
+
const pathExceptLast = path2.slice(0, -1);
|
|
11664
11132
|
if (pathExceptLast.length > 0) {
|
|
11665
11133
|
thisContext = get(value, pathExceptLast);
|
|
11666
11134
|
}
|
|
11667
|
-
} else if (typeof
|
|
11668
|
-
const parts =
|
|
11135
|
+
} else if (typeof path2 === "string" && path2.includes(".")) {
|
|
11136
|
+
const parts = path2.split(".");
|
|
11669
11137
|
const pathExceptLast = parts.slice(0, -1).join(".");
|
|
11670
11138
|
thisContext = get(value, pathExceptLast);
|
|
11671
11139
|
}
|
|
@@ -11828,10 +11296,10 @@ function orderBy(collection, criteria, orders, guard) {
|
|
|
11828
11296
|
orders = orders == null ? [] : [orders];
|
|
11829
11297
|
}
|
|
11830
11298
|
orders = orders.map((order) => String(order));
|
|
11831
|
-
const getValueByNestedPath = /* @__PURE__ */ __name((object,
|
|
11299
|
+
const getValueByNestedPath = /* @__PURE__ */ __name((object, path2) => {
|
|
11832
11300
|
let target = object;
|
|
11833
|
-
for (let i = 0; i <
|
|
11834
|
-
target = target[
|
|
11301
|
+
for (let i = 0; i < path2.length && target != null; ++i) {
|
|
11302
|
+
target = target[path2[i]];
|
|
11835
11303
|
}
|
|
11836
11304
|
return target;
|
|
11837
11305
|
}, "getValueByNestedPath");
|
|
@@ -12005,13 +11473,13 @@ function at(object, ...paths) {
|
|
|
12005
11473
|
}
|
|
12006
11474
|
const allPaths = [];
|
|
12007
11475
|
for (let i = 0; i < paths.length; i++) {
|
|
12008
|
-
const
|
|
12009
|
-
if (!isArrayLike(
|
|
12010
|
-
allPaths.push(
|
|
11476
|
+
const path2 = paths[i];
|
|
11477
|
+
if (!isArrayLike(path2) || isString(path2)) {
|
|
11478
|
+
allPaths.push(path2);
|
|
12011
11479
|
continue;
|
|
12012
11480
|
}
|
|
12013
|
-
for (let j = 0; j <
|
|
12014
|
-
allPaths.push(
|
|
11481
|
+
for (let j = 0; j < path2.length; j++) {
|
|
11482
|
+
allPaths.push(path2[j]);
|
|
12015
11483
|
}
|
|
12016
11484
|
}
|
|
12017
11485
|
const result2 = [];
|
|
@@ -12023,48 +11491,48 @@ function at(object, ...paths) {
|
|
|
12023
11491
|
__name(at, "at");
|
|
12024
11492
|
|
|
12025
11493
|
// ../node_modules/es-toolkit/dist/compat/object/unset.mjs
|
|
12026
|
-
function unset(obj,
|
|
11494
|
+
function unset(obj, path2) {
|
|
12027
11495
|
if (obj == null) {
|
|
12028
11496
|
return true;
|
|
12029
11497
|
}
|
|
12030
|
-
switch (typeof
|
|
11498
|
+
switch (typeof path2) {
|
|
12031
11499
|
case "symbol":
|
|
12032
11500
|
case "number":
|
|
12033
11501
|
case "object": {
|
|
12034
|
-
if (Array.isArray(
|
|
12035
|
-
return unsetWithPath(obj,
|
|
12036
|
-
}
|
|
12037
|
-
if (typeof
|
|
12038
|
-
|
|
12039
|
-
} else if (typeof
|
|
12040
|
-
if (Object.is(
|
|
12041
|
-
|
|
11502
|
+
if (Array.isArray(path2)) {
|
|
11503
|
+
return unsetWithPath(obj, path2);
|
|
11504
|
+
}
|
|
11505
|
+
if (typeof path2 === "number") {
|
|
11506
|
+
path2 = toKey(path2);
|
|
11507
|
+
} else if (typeof path2 === "object") {
|
|
11508
|
+
if (Object.is(path2?.valueOf(), -0)) {
|
|
11509
|
+
path2 = "-0";
|
|
12042
11510
|
} else {
|
|
12043
|
-
|
|
11511
|
+
path2 = String(path2);
|
|
12044
11512
|
}
|
|
12045
11513
|
}
|
|
12046
|
-
if (isUnsafeProperty(
|
|
11514
|
+
if (isUnsafeProperty(path2)) {
|
|
12047
11515
|
return false;
|
|
12048
11516
|
}
|
|
12049
|
-
if (obj?.[
|
|
11517
|
+
if (obj?.[path2] === void 0) {
|
|
12050
11518
|
return true;
|
|
12051
11519
|
}
|
|
12052
11520
|
try {
|
|
12053
|
-
delete obj[
|
|
11521
|
+
delete obj[path2];
|
|
12054
11522
|
return true;
|
|
12055
11523
|
} catch {
|
|
12056
11524
|
return false;
|
|
12057
11525
|
}
|
|
12058
11526
|
}
|
|
12059
11527
|
case "string": {
|
|
12060
|
-
if (obj?.[
|
|
12061
|
-
return unsetWithPath(obj, toPath(
|
|
11528
|
+
if (obj?.[path2] === void 0 && isDeepKey(path2)) {
|
|
11529
|
+
return unsetWithPath(obj, toPath(path2));
|
|
12062
11530
|
}
|
|
12063
|
-
if (isUnsafeProperty(
|
|
11531
|
+
if (isUnsafeProperty(path2)) {
|
|
12064
11532
|
return false;
|
|
12065
11533
|
}
|
|
12066
11534
|
try {
|
|
12067
|
-
delete obj[
|
|
11535
|
+
delete obj[path2];
|
|
12068
11536
|
return true;
|
|
12069
11537
|
} catch {
|
|
12070
11538
|
return false;
|
|
@@ -12073,9 +11541,9 @@ function unset(obj, path) {
|
|
|
12073
11541
|
}
|
|
12074
11542
|
}
|
|
12075
11543
|
__name(unset, "unset");
|
|
12076
|
-
function unsetWithPath(obj,
|
|
12077
|
-
const parent = get(obj,
|
|
12078
|
-
const lastKey =
|
|
11544
|
+
function unsetWithPath(obj, path2) {
|
|
11545
|
+
const parent = get(obj, path2.slice(0, -1), obj);
|
|
11546
|
+
const lastKey = path2[path2.length - 1];
|
|
12079
11547
|
if (parent?.[lastKey] === void 0) {
|
|
12080
11548
|
return true;
|
|
12081
11549
|
}
|
|
@@ -12114,8 +11582,8 @@ function pullAt(array, ..._indices) {
|
|
|
12114
11582
|
delete array[toKey(index)];
|
|
12115
11583
|
continue;
|
|
12116
11584
|
}
|
|
12117
|
-
const
|
|
12118
|
-
unset(array,
|
|
11585
|
+
const path2 = isArray(index) ? index : toPath(index);
|
|
11586
|
+
unset(array, path2);
|
|
12119
11587
|
}
|
|
12120
11588
|
return result2;
|
|
12121
11589
|
}
|
|
@@ -13007,11 +12475,11 @@ function zipObject(keys2 = [], values2 = []) {
|
|
|
13007
12475
|
__name(zipObject, "zipObject");
|
|
13008
12476
|
|
|
13009
12477
|
// ../node_modules/es-toolkit/dist/compat/object/updateWith.mjs
|
|
13010
|
-
function updateWith(obj,
|
|
12478
|
+
function updateWith(obj, path2, updater, customizer) {
|
|
13011
12479
|
if (obj == null && !isObject(obj)) {
|
|
13012
12480
|
return obj;
|
|
13013
12481
|
}
|
|
13014
|
-
const resolvedPath = isKey(
|
|
12482
|
+
const resolvedPath = isKey(path2, obj) ? [path2] : Array.isArray(path2) ? path2 : typeof path2 === "string" ? toPath(path2) : [path2];
|
|
13015
12483
|
let current = obj;
|
|
13016
12484
|
for (let i = 0; i < resolvedPath.length && current != null; i++) {
|
|
13017
12485
|
const key = toKey(resolvedPath[i]);
|
|
@@ -13034,8 +12502,8 @@ function updateWith(obj, path, updater, customizer) {
|
|
|
13034
12502
|
__name(updateWith, "updateWith");
|
|
13035
12503
|
|
|
13036
12504
|
// ../node_modules/es-toolkit/dist/compat/object/set.mjs
|
|
13037
|
-
function set(obj,
|
|
13038
|
-
return updateWith(obj,
|
|
12505
|
+
function set(obj, path2, value) {
|
|
12506
|
+
return updateWith(obj, path2, () => value, () => void 0);
|
|
13039
12507
|
}
|
|
13040
12508
|
__name(set, "set");
|
|
13041
12509
|
|
|
@@ -15009,17 +14477,17 @@ function functionsIn(object) {
|
|
|
15009
14477
|
__name(functionsIn, "functionsIn");
|
|
15010
14478
|
|
|
15011
14479
|
// ../node_modules/es-toolkit/dist/compat/object/hasIn.mjs
|
|
15012
|
-
function hasIn(object,
|
|
14480
|
+
function hasIn(object, path2) {
|
|
15013
14481
|
if (object == null) {
|
|
15014
14482
|
return false;
|
|
15015
14483
|
}
|
|
15016
14484
|
let resolvedPath;
|
|
15017
|
-
if (Array.isArray(
|
|
15018
|
-
resolvedPath =
|
|
15019
|
-
} else if (typeof
|
|
15020
|
-
resolvedPath = toPath(
|
|
14485
|
+
if (Array.isArray(path2)) {
|
|
14486
|
+
resolvedPath = path2;
|
|
14487
|
+
} else if (typeof path2 === "string" && isDeepKey(path2) && object[path2] == null) {
|
|
14488
|
+
resolvedPath = toPath(path2);
|
|
15021
14489
|
} else {
|
|
15022
|
-
resolvedPath = [
|
|
14490
|
+
resolvedPath = [path2];
|
|
15023
14491
|
}
|
|
15024
14492
|
if (resolvedPath.length === 0) {
|
|
15025
14493
|
return false;
|
|
@@ -15375,22 +14843,22 @@ __name(pickBy, "pickBy");
|
|
|
15375
14843
|
|
|
15376
14844
|
// ../node_modules/es-toolkit/dist/compat/object/propertyOf.mjs
|
|
15377
14845
|
function propertyOf(object) {
|
|
15378
|
-
return function(
|
|
15379
|
-
return get(object,
|
|
14846
|
+
return function(path2) {
|
|
14847
|
+
return get(object, path2);
|
|
15380
14848
|
};
|
|
15381
14849
|
}
|
|
15382
14850
|
__name(propertyOf, "propertyOf");
|
|
15383
14851
|
|
|
15384
14852
|
// ../node_modules/es-toolkit/dist/compat/object/result.mjs
|
|
15385
|
-
function result(object,
|
|
15386
|
-
if (isKey(
|
|
15387
|
-
|
|
15388
|
-
} else if (!Array.isArray(
|
|
15389
|
-
|
|
14853
|
+
function result(object, path2, defaultValue) {
|
|
14854
|
+
if (isKey(path2, object)) {
|
|
14855
|
+
path2 = [path2];
|
|
14856
|
+
} else if (!Array.isArray(path2)) {
|
|
14857
|
+
path2 = toPath(toString(path2));
|
|
15390
14858
|
}
|
|
15391
|
-
const pathLength = Math.max(
|
|
14859
|
+
const pathLength = Math.max(path2.length, 1);
|
|
15392
14860
|
for (let index = 0; index < pathLength; index++) {
|
|
15393
|
-
const value = object == null ? void 0 : object[toKey(
|
|
14861
|
+
const value = object == null ? void 0 : object[toKey(path2[index])];
|
|
15394
14862
|
if (value === void 0) {
|
|
15395
14863
|
return typeof defaultValue === "function" ? defaultValue.call(object) : defaultValue;
|
|
15396
14864
|
}
|
|
@@ -15401,14 +14869,14 @@ function result(object, path, defaultValue) {
|
|
|
15401
14869
|
__name(result, "result");
|
|
15402
14870
|
|
|
15403
14871
|
// ../node_modules/es-toolkit/dist/compat/object/setWith.mjs
|
|
15404
|
-
function setWith(obj,
|
|
14872
|
+
function setWith(obj, path2, value, customizer) {
|
|
15405
14873
|
let customizerFn;
|
|
15406
14874
|
if (typeof customizer === "function") {
|
|
15407
14875
|
customizerFn = customizer;
|
|
15408
14876
|
} else {
|
|
15409
14877
|
customizerFn = /* @__PURE__ */ __name(() => void 0, "customizerFn");
|
|
15410
14878
|
}
|
|
15411
|
-
return updateWith(obj,
|
|
14879
|
+
return updateWith(obj, path2, () => value, customizerFn);
|
|
15412
14880
|
}
|
|
15413
14881
|
__name(setWith, "setWith");
|
|
15414
14882
|
|
|
@@ -15515,8 +14983,8 @@ function transform(object, iteratee$1 = identity, accumulator) {
|
|
|
15515
14983
|
__name(transform, "transform");
|
|
15516
14984
|
|
|
15517
14985
|
// ../node_modules/es-toolkit/dist/compat/object/update.mjs
|
|
15518
|
-
function update(obj,
|
|
15519
|
-
return updateWith(obj,
|
|
14986
|
+
function update(obj, path2, updater) {
|
|
14987
|
+
return updateWith(obj, path2, updater, () => void 0);
|
|
15520
14988
|
}
|
|
15521
14989
|
__name(update, "update");
|
|
15522
14990
|
|
|
@@ -16477,38 +15945,38 @@ function gte(value, other) {
|
|
|
16477
15945
|
__name(gte, "gte");
|
|
16478
15946
|
|
|
16479
15947
|
// ../node_modules/es-toolkit/dist/compat/util/invoke.mjs
|
|
16480
|
-
function invoke(object,
|
|
15948
|
+
function invoke(object, path2, ...args) {
|
|
16481
15949
|
args = args.flat(1);
|
|
16482
15950
|
if (object == null) {
|
|
16483
15951
|
return;
|
|
16484
15952
|
}
|
|
16485
|
-
switch (typeof
|
|
15953
|
+
switch (typeof path2) {
|
|
16486
15954
|
case "string": {
|
|
16487
|
-
if (typeof object === "object" && Object.hasOwn(object,
|
|
16488
|
-
return invokeImpl(object, [
|
|
15955
|
+
if (typeof object === "object" && Object.hasOwn(object, path2)) {
|
|
15956
|
+
return invokeImpl(object, [path2], args);
|
|
16489
15957
|
}
|
|
16490
|
-
return invokeImpl(object, toPath(
|
|
15958
|
+
return invokeImpl(object, toPath(path2), args);
|
|
16491
15959
|
}
|
|
16492
15960
|
case "number":
|
|
16493
15961
|
case "symbol": {
|
|
16494
|
-
return invokeImpl(object, [
|
|
15962
|
+
return invokeImpl(object, [path2], args);
|
|
16495
15963
|
}
|
|
16496
15964
|
default: {
|
|
16497
|
-
if (Array.isArray(
|
|
16498
|
-
return invokeImpl(object,
|
|
15965
|
+
if (Array.isArray(path2)) {
|
|
15966
|
+
return invokeImpl(object, path2, args);
|
|
16499
15967
|
} else {
|
|
16500
|
-
return invokeImpl(object, [
|
|
15968
|
+
return invokeImpl(object, [path2], args);
|
|
16501
15969
|
}
|
|
16502
15970
|
}
|
|
16503
15971
|
}
|
|
16504
15972
|
}
|
|
16505
15973
|
__name(invoke, "invoke");
|
|
16506
|
-
function invokeImpl(object,
|
|
16507
|
-
const parent = get(object,
|
|
15974
|
+
function invokeImpl(object, path2, args) {
|
|
15975
|
+
const parent = get(object, path2.slice(0, -1), object);
|
|
16508
15976
|
if (parent == null) {
|
|
16509
15977
|
return void 0;
|
|
16510
15978
|
}
|
|
16511
|
-
let lastKey = last2(
|
|
15979
|
+
let lastKey = last2(path2);
|
|
16512
15980
|
const lastValue = lastKey?.valueOf();
|
|
16513
15981
|
if (typeof lastValue === "number") {
|
|
16514
15982
|
lastKey = toKey(lastValue);
|
|
@@ -16539,17 +16007,17 @@ function lte(value, other) {
|
|
|
16539
16007
|
__name(lte, "lte");
|
|
16540
16008
|
|
|
16541
16009
|
// ../node_modules/es-toolkit/dist/compat/util/method.mjs
|
|
16542
|
-
function method(
|
|
16010
|
+
function method(path2, ...args) {
|
|
16543
16011
|
return function(object) {
|
|
16544
|
-
return invoke(object,
|
|
16012
|
+
return invoke(object, path2, args);
|
|
16545
16013
|
};
|
|
16546
16014
|
}
|
|
16547
16015
|
__name(method, "method");
|
|
16548
16016
|
|
|
16549
16017
|
// ../node_modules/es-toolkit/dist/compat/util/methodOf.mjs
|
|
16550
16018
|
function methodOf(object, ...args) {
|
|
16551
|
-
return function(
|
|
16552
|
-
return invoke(object,
|
|
16019
|
+
return function(path2) {
|
|
16020
|
+
return invoke(object, path2, args);
|
|
16553
16021
|
};
|
|
16554
16022
|
}
|
|
16555
16023
|
__name(methodOf, "methodOf");
|
|
@@ -17074,7 +16542,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
|
|
|
17074
16542
|
// because the directory could already be within the files part (e.g. './x/foo/bar')
|
|
17075
16543
|
basename2(specifier.files)
|
|
17076
16544
|
);
|
|
17077
|
-
const { globby } = await import("../_node-chunks/globby-
|
|
16545
|
+
const { globby } = await import("../_node-chunks/globby-3IFB7BJC.js");
|
|
17078
16546
|
const addedFiles = await globby(slash(dirGlob), commonGlobOptions2(dirGlob));
|
|
17079
16547
|
addedFiles.forEach((filePath) => {
|
|
17080
16548
|
const fileImportPath = toImportPath(filePath);
|
|
@@ -17138,9 +16606,9 @@ function useStoriesJson({
|
|
|
17138
16606
|
const maybeInvalidate = debounce2(() => serverChannel.emit(STORY_INDEX_INVALIDATED), DEBOUNCE, {
|
|
17139
16607
|
leading: true
|
|
17140
16608
|
});
|
|
17141
|
-
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier,
|
|
16609
|
+
watchStorySpecifiers(normalizedStories, { workingDir }, async (specifier, path2, removed) => {
|
|
17142
16610
|
const generator = await initializedStoryIndexGenerator;
|
|
17143
|
-
generator.invalidate(specifier,
|
|
16611
|
+
generator.invalidate(specifier, path2, removed);
|
|
17144
16612
|
maybeInvalidate();
|
|
17145
16613
|
});
|
|
17146
16614
|
if (configDir) {
|
|
@@ -17420,7 +16888,7 @@ __name(buildStaticStandalone, "buildStaticStandalone");
|
|
|
17420
16888
|
// src/core-server/build-dev.ts
|
|
17421
16889
|
var import_prompts = __toESM(require_prompts(), 1);
|
|
17422
16890
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
17423
|
-
import { join as
|
|
16891
|
+
import { join as join8, relative as relative5, resolve as resolve5 } from "node:path";
|
|
17424
16892
|
import {
|
|
17425
16893
|
JsPackageManagerFactory,
|
|
17426
16894
|
getConfigInfo,
|
|
@@ -17720,14 +17188,14 @@ var Polka = class _Polka extends Trouter {
|
|
|
17720
17188
|
return this;
|
|
17721
17189
|
}
|
|
17722
17190
|
handler(req, res, next) {
|
|
17723
|
-
let info = this.parse(req),
|
|
17724
|
-
let obj = this.find(req.method, req.path =
|
|
17725
|
-
req.url =
|
|
17191
|
+
let info = this.parse(req), path2 = info.pathname;
|
|
17192
|
+
let obj = this.find(req.method, req.path = path2);
|
|
17193
|
+
req.url = path2 + info.search;
|
|
17726
17194
|
req.originalUrl = req.originalUrl || req.url;
|
|
17727
17195
|
req.query = info.query || {};
|
|
17728
17196
|
req.search = info.search;
|
|
17729
17197
|
req.params = obj.params;
|
|
17730
|
-
if (
|
|
17198
|
+
if (path2.length > 1 && path2.indexOf("%", 1) !== -1) {
|
|
17731
17199
|
for (let k in req.params) {
|
|
17732
17200
|
try {
|
|
17733
17201
|
req.params[k] = decodeURIComponent(req.params[k]);
|
|
@@ -18425,37 +17893,672 @@ async function getMiddleware(configDir) {
|
|
|
18425
17893
|
}
|
|
18426
17894
|
__name(getMiddleware, "getMiddleware");
|
|
18427
17895
|
|
|
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);
|
|
17896
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18432
17897
|
import { logger as logger5 } from "storybook/internal/node-logger";
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
|
|
17898
|
+
|
|
17899
|
+
// ../node_modules/open/index.js
|
|
17900
|
+
import process7 from "node:process";
|
|
17901
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
17902
|
+
import path from "node:path";
|
|
17903
|
+
import { fileURLToPath } from "node:url";
|
|
17904
|
+
import { promisify as promisify5 } from "node:util";
|
|
17905
|
+
import childProcess from "node:child_process";
|
|
17906
|
+
import fs5, { constants as fsConstants2 } from "node:fs/promises";
|
|
17907
|
+
|
|
17908
|
+
// ../node_modules/wsl-utils/index.js
|
|
17909
|
+
import process3 from "node:process";
|
|
17910
|
+
import fs4, { constants as fsConstants } from "node:fs/promises";
|
|
17911
|
+
|
|
17912
|
+
// ../node_modules/is-wsl/index.js
|
|
17913
|
+
import process2 from "node:process";
|
|
17914
|
+
import os from "node:os";
|
|
17915
|
+
import fs3 from "node:fs";
|
|
17916
|
+
|
|
17917
|
+
// ../node_modules/is-inside-container/index.js
|
|
17918
|
+
import fs2 from "node:fs";
|
|
17919
|
+
|
|
17920
|
+
// ../node_modules/is-inside-container/node_modules/is-docker/index.js
|
|
17921
|
+
import fs from "node:fs";
|
|
17922
|
+
var isDockerCached;
|
|
17923
|
+
function hasDockerEnv() {
|
|
17924
|
+
try {
|
|
17925
|
+
fs.statSync("/.dockerenv");
|
|
17926
|
+
return true;
|
|
17927
|
+
} catch {
|
|
17928
|
+
return false;
|
|
17929
|
+
}
|
|
17930
|
+
}
|
|
17931
|
+
__name(hasDockerEnv, "hasDockerEnv");
|
|
17932
|
+
function hasDockerCGroup() {
|
|
17933
|
+
try {
|
|
17934
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
17935
|
+
} catch {
|
|
17936
|
+
return false;
|
|
17937
|
+
}
|
|
17938
|
+
}
|
|
17939
|
+
__name(hasDockerCGroup, "hasDockerCGroup");
|
|
17940
|
+
function isDocker() {
|
|
17941
|
+
if (isDockerCached === void 0) {
|
|
17942
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
17943
|
+
}
|
|
17944
|
+
return isDockerCached;
|
|
17945
|
+
}
|
|
17946
|
+
__name(isDocker, "isDocker");
|
|
17947
|
+
|
|
17948
|
+
// ../node_modules/is-inside-container/index.js
|
|
17949
|
+
var cachedResult;
|
|
17950
|
+
var hasContainerEnv = /* @__PURE__ */ __name(() => {
|
|
17951
|
+
try {
|
|
17952
|
+
fs2.statSync("/run/.containerenv");
|
|
17953
|
+
return true;
|
|
17954
|
+
} catch {
|
|
17955
|
+
return false;
|
|
17956
|
+
}
|
|
17957
|
+
}, "hasContainerEnv");
|
|
17958
|
+
function isInsideContainer() {
|
|
17959
|
+
if (cachedResult === void 0) {
|
|
17960
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
17961
|
+
}
|
|
17962
|
+
return cachedResult;
|
|
17963
|
+
}
|
|
17964
|
+
__name(isInsideContainer, "isInsideContainer");
|
|
17965
|
+
|
|
17966
|
+
// ../node_modules/is-wsl/index.js
|
|
17967
|
+
var isWsl = /* @__PURE__ */ __name(() => {
|
|
17968
|
+
if (process2.platform !== "linux") {
|
|
17969
|
+
return false;
|
|
17970
|
+
}
|
|
17971
|
+
if (os.release().toLowerCase().includes("microsoft")) {
|
|
17972
|
+
if (isInsideContainer()) {
|
|
17973
|
+
return false;
|
|
17974
|
+
}
|
|
17975
|
+
return true;
|
|
17976
|
+
}
|
|
17977
|
+
try {
|
|
17978
|
+
return fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
17979
|
+
} catch {
|
|
17980
|
+
return false;
|
|
17981
|
+
}
|
|
17982
|
+
}, "isWsl");
|
|
17983
|
+
var is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
17984
|
+
|
|
17985
|
+
// ../node_modules/wsl-utils/index.js
|
|
17986
|
+
var wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
17987
|
+
const defaultMountPoint = "/mnt/";
|
|
17988
|
+
let mountPoint;
|
|
17989
|
+
return async function() {
|
|
17990
|
+
if (mountPoint) {
|
|
17991
|
+
return mountPoint;
|
|
17992
|
+
}
|
|
17993
|
+
const configFilePath = "/etc/wsl.conf";
|
|
17994
|
+
let isConfigFileExists = false;
|
|
18439
17995
|
try {
|
|
18440
|
-
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
|
|
17996
|
+
await fs4.access(configFilePath, fsConstants.F_OK);
|
|
17997
|
+
isConfigFileExists = true;
|
|
17998
|
+
} catch {
|
|
17999
|
+
}
|
|
18000
|
+
if (!isConfigFileExists) {
|
|
18001
|
+
return defaultMountPoint;
|
|
18002
|
+
}
|
|
18003
|
+
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
|
|
18004
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
18005
|
+
if (!configMountPoint) {
|
|
18006
|
+
return defaultMountPoint;
|
|
18007
|
+
}
|
|
18008
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
18009
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
18010
|
+
return mountPoint;
|
|
18011
|
+
};
|
|
18012
|
+
})();
|
|
18013
|
+
var powerShellPathFromWsl = /* @__PURE__ */ __name(async () => {
|
|
18014
|
+
const mountPoint = await wslDrivesMountPoint();
|
|
18015
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
18016
|
+
}, "powerShellPathFromWsl");
|
|
18017
|
+
var powerShellPath = /* @__PURE__ */ __name(async () => {
|
|
18018
|
+
if (is_wsl_default) {
|
|
18019
|
+
return powerShellPathFromWsl();
|
|
18020
|
+
}
|
|
18021
|
+
return `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
18022
|
+
}, "powerShellPath");
|
|
18023
|
+
|
|
18024
|
+
// ../node_modules/define-lazy-prop/index.js
|
|
18025
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
18026
|
+
const define = /* @__PURE__ */ __name((value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true }), "define");
|
|
18027
|
+
Object.defineProperty(object, propertyName, {
|
|
18028
|
+
configurable: true,
|
|
18029
|
+
enumerable: true,
|
|
18030
|
+
get() {
|
|
18031
|
+
const result2 = valueGetter();
|
|
18032
|
+
define(result2);
|
|
18033
|
+
return result2;
|
|
18034
|
+
},
|
|
18035
|
+
set(value) {
|
|
18036
|
+
define(value);
|
|
18037
|
+
}
|
|
18038
|
+
});
|
|
18039
|
+
return object;
|
|
18040
|
+
}
|
|
18041
|
+
__name(defineLazyProperty, "defineLazyProperty");
|
|
18042
|
+
|
|
18043
|
+
// ../node_modules/default-browser/index.js
|
|
18044
|
+
import { promisify as promisify4 } from "node:util";
|
|
18045
|
+
import process6 from "node:process";
|
|
18046
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
18047
|
+
|
|
18048
|
+
// ../node_modules/default-browser-id/index.js
|
|
18049
|
+
import { promisify } from "node:util";
|
|
18050
|
+
import process4 from "node:process";
|
|
18051
|
+
import { execFile } from "node:child_process";
|
|
18052
|
+
var execFileAsync = promisify(execFile);
|
|
18053
|
+
async function defaultBrowserId() {
|
|
18054
|
+
if (process4.platform !== "darwin") {
|
|
18055
|
+
throw new Error("macOS only");
|
|
18056
|
+
}
|
|
18057
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
18058
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
18059
|
+
return match?.groups.id ?? "com.apple.Safari";
|
|
18060
|
+
}
|
|
18061
|
+
__name(defaultBrowserId, "defaultBrowserId");
|
|
18062
|
+
|
|
18063
|
+
// ../node_modules/run-applescript/index.js
|
|
18064
|
+
import process5 from "node:process";
|
|
18065
|
+
import { promisify as promisify2 } from "node:util";
|
|
18066
|
+
import { execFile as execFile2, execFileSync } from "node:child_process";
|
|
18067
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
18068
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
18069
|
+
if (process5.platform !== "darwin") {
|
|
18070
|
+
throw new Error("macOS only");
|
|
18071
|
+
}
|
|
18072
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
18073
|
+
const execOptions = {};
|
|
18074
|
+
if (signal) {
|
|
18075
|
+
execOptions.signal = signal;
|
|
18076
|
+
}
|
|
18077
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
18078
|
+
return stdout.trim();
|
|
18079
|
+
}
|
|
18080
|
+
__name(runAppleScript, "runAppleScript");
|
|
18081
|
+
|
|
18082
|
+
// ../node_modules/bundle-name/index.js
|
|
18083
|
+
async function bundleName(bundleId) {
|
|
18084
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
18085
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
18086
|
+
}
|
|
18087
|
+
__name(bundleName, "bundleName");
|
|
18088
|
+
|
|
18089
|
+
// ../node_modules/default-browser/windows.js
|
|
18090
|
+
import { promisify as promisify3 } from "node:util";
|
|
18091
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
18092
|
+
var execFileAsync3 = promisify3(execFile3);
|
|
18093
|
+
var windowsBrowserProgIds = {
|
|
18094
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
18095
|
+
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
18096
|
+
// On macOS, it's "com.microsoft.edgemac"
|
|
18097
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
18098
|
+
// Newer Edge/Win10 releases
|
|
18099
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
18100
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
18101
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
18102
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
18103
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
18104
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
18105
|
+
};
|
|
18106
|
+
var UnknownBrowserError = class extends Error {
|
|
18107
|
+
static {
|
|
18108
|
+
__name(this, "UnknownBrowserError");
|
|
18109
|
+
}
|
|
18110
|
+
};
|
|
18111
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
18112
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
18113
|
+
"QUERY",
|
|
18114
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
18115
|
+
"/v",
|
|
18116
|
+
"ProgId"
|
|
18117
|
+
]);
|
|
18118
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
18119
|
+
if (!match) {
|
|
18120
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
18121
|
+
}
|
|
18122
|
+
const { id } = match.groups;
|
|
18123
|
+
const browser = windowsBrowserProgIds[id];
|
|
18124
|
+
if (!browser) {
|
|
18125
|
+
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
18126
|
+
}
|
|
18127
|
+
return browser;
|
|
18128
|
+
}
|
|
18129
|
+
__name(defaultBrowser, "defaultBrowser");
|
|
18130
|
+
|
|
18131
|
+
// ../node_modules/default-browser/index.js
|
|
18132
|
+
var execFileAsync4 = promisify4(execFile4);
|
|
18133
|
+
var titleize = /* @__PURE__ */ __name((string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase()), "titleize");
|
|
18134
|
+
async function defaultBrowser2() {
|
|
18135
|
+
if (process6.platform === "darwin") {
|
|
18136
|
+
const id = await defaultBrowserId();
|
|
18137
|
+
const name = await bundleName(id);
|
|
18138
|
+
return { name, id };
|
|
18139
|
+
}
|
|
18140
|
+
if (process6.platform === "linux") {
|
|
18141
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
18142
|
+
const id = stdout.trim();
|
|
18143
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
18144
|
+
return { name, id };
|
|
18145
|
+
}
|
|
18146
|
+
if (process6.platform === "win32") {
|
|
18147
|
+
return defaultBrowser();
|
|
18148
|
+
}
|
|
18149
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
18150
|
+
}
|
|
18151
|
+
__name(defaultBrowser2, "defaultBrowser");
|
|
18152
|
+
|
|
18153
|
+
// ../node_modules/open/index.js
|
|
18154
|
+
var execFile5 = promisify5(childProcess.execFile);
|
|
18155
|
+
var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
18156
|
+
var localXdgOpenPath = path.join(__dirname2, "xdg-open");
|
|
18157
|
+
var { platform, arch } = process7;
|
|
18158
|
+
async function getWindowsDefaultBrowserFromWsl() {
|
|
18159
|
+
const powershellPath = await powerShellPath();
|
|
18160
|
+
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
18161
|
+
const encodedCommand = Buffer2.from(rawCommand, "utf16le").toString("base64");
|
|
18162
|
+
const { stdout } = await execFile5(
|
|
18163
|
+
powershellPath,
|
|
18164
|
+
[
|
|
18165
|
+
"-NoProfile",
|
|
18166
|
+
"-NonInteractive",
|
|
18167
|
+
"-ExecutionPolicy",
|
|
18168
|
+
"Bypass",
|
|
18169
|
+
"-EncodedCommand",
|
|
18170
|
+
encodedCommand
|
|
18171
|
+
],
|
|
18172
|
+
{ encoding: "utf8" }
|
|
18173
|
+
);
|
|
18174
|
+
const progId = stdout.trim();
|
|
18175
|
+
const browserMap = {
|
|
18176
|
+
ChromeHTML: "com.google.chrome",
|
|
18177
|
+
BraveHTML: "com.brave.Browser",
|
|
18178
|
+
MSEdgeHTM: "com.microsoft.edge",
|
|
18179
|
+
FirefoxURL: "org.mozilla.firefox"
|
|
18180
|
+
};
|
|
18181
|
+
return browserMap[progId] ? { id: browserMap[progId] } : {};
|
|
18182
|
+
}
|
|
18183
|
+
__name(getWindowsDefaultBrowserFromWsl, "getWindowsDefaultBrowserFromWsl");
|
|
18184
|
+
var pTryEach = /* @__PURE__ */ __name(async (array, mapper) => {
|
|
18185
|
+
let latestError;
|
|
18186
|
+
for (const item of array) {
|
|
18187
|
+
try {
|
|
18188
|
+
return await mapper(item);
|
|
18445
18189
|
} catch (error) {
|
|
18446
|
-
|
|
18190
|
+
latestError = error;
|
|
18191
|
+
}
|
|
18192
|
+
}
|
|
18193
|
+
throw latestError;
|
|
18194
|
+
}, "pTryEach");
|
|
18195
|
+
var baseOpen = /* @__PURE__ */ __name(async (options) => {
|
|
18196
|
+
options = {
|
|
18197
|
+
wait: false,
|
|
18198
|
+
background: false,
|
|
18199
|
+
newInstance: false,
|
|
18200
|
+
allowNonzeroExitCode: false,
|
|
18201
|
+
...options
|
|
18202
|
+
};
|
|
18203
|
+
if (Array.isArray(options.app)) {
|
|
18204
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
18205
|
+
...options,
|
|
18206
|
+
app: singleApp
|
|
18207
|
+
}));
|
|
18208
|
+
}
|
|
18209
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
18210
|
+
appArguments = [...appArguments];
|
|
18211
|
+
if (Array.isArray(app)) {
|
|
18212
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
18213
|
+
...options,
|
|
18214
|
+
app: {
|
|
18215
|
+
name: appName,
|
|
18216
|
+
arguments: appArguments
|
|
18217
|
+
}
|
|
18218
|
+
}));
|
|
18219
|
+
}
|
|
18220
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
18221
|
+
const ids = {
|
|
18222
|
+
"com.google.chrome": "chrome",
|
|
18223
|
+
"google-chrome.desktop": "chrome",
|
|
18224
|
+
"com.brave.Browser": "brave",
|
|
18225
|
+
"org.mozilla.firefox": "firefox",
|
|
18226
|
+
"firefox.desktop": "firefox",
|
|
18227
|
+
"com.microsoft.msedge": "edge",
|
|
18228
|
+
"com.microsoft.edge": "edge",
|
|
18229
|
+
"com.microsoft.edgemac": "edge",
|
|
18230
|
+
"microsoft-edge.desktop": "edge"
|
|
18231
|
+
};
|
|
18232
|
+
const flags = {
|
|
18233
|
+
chrome: "--incognito",
|
|
18234
|
+
brave: "--incognito",
|
|
18235
|
+
firefox: "--private-window",
|
|
18236
|
+
edge: "--inPrivate"
|
|
18237
|
+
};
|
|
18238
|
+
const browser = is_wsl_default ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser2();
|
|
18239
|
+
if (browser.id in ids) {
|
|
18240
|
+
const browserName = ids[browser.id];
|
|
18241
|
+
if (app === "browserPrivate") {
|
|
18242
|
+
appArguments.push(flags[browserName]);
|
|
18243
|
+
}
|
|
18244
|
+
return baseOpen({
|
|
18245
|
+
...options,
|
|
18246
|
+
app: {
|
|
18247
|
+
name: apps[browserName],
|
|
18248
|
+
arguments: appArguments
|
|
18249
|
+
}
|
|
18250
|
+
});
|
|
18251
|
+
}
|
|
18252
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
18253
|
+
}
|
|
18254
|
+
let command;
|
|
18255
|
+
const cliArguments = [];
|
|
18256
|
+
const childProcessOptions = {};
|
|
18257
|
+
if (platform === "darwin") {
|
|
18258
|
+
command = "open";
|
|
18259
|
+
if (options.wait) {
|
|
18260
|
+
cliArguments.push("--wait-apps");
|
|
18261
|
+
}
|
|
18262
|
+
if (options.background) {
|
|
18263
|
+
cliArguments.push("--background");
|
|
18264
|
+
}
|
|
18265
|
+
if (options.newInstance) {
|
|
18266
|
+
cliArguments.push("--new");
|
|
18267
|
+
}
|
|
18268
|
+
if (app) {
|
|
18269
|
+
cliArguments.push("-a", app);
|
|
18270
|
+
}
|
|
18271
|
+
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app) {
|
|
18272
|
+
command = await powerShellPath();
|
|
18273
|
+
cliArguments.push(
|
|
18274
|
+
"-NoProfile",
|
|
18275
|
+
"-NonInteractive",
|
|
18276
|
+
"-ExecutionPolicy",
|
|
18277
|
+
"Bypass",
|
|
18278
|
+
"-EncodedCommand"
|
|
18279
|
+
);
|
|
18280
|
+
if (!is_wsl_default) {
|
|
18281
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
18282
|
+
}
|
|
18283
|
+
const encodedArguments = ["Start"];
|
|
18284
|
+
if (options.wait) {
|
|
18285
|
+
encodedArguments.push("-Wait");
|
|
18286
|
+
}
|
|
18287
|
+
if (app) {
|
|
18288
|
+
encodedArguments.push(`"\`"${app}\`""`);
|
|
18289
|
+
if (options.target) {
|
|
18290
|
+
appArguments.push(options.target);
|
|
18291
|
+
}
|
|
18292
|
+
} else if (options.target) {
|
|
18293
|
+
encodedArguments.push(`"${options.target}"`);
|
|
18294
|
+
}
|
|
18295
|
+
if (appArguments.length > 0) {
|
|
18296
|
+
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
18297
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
18298
|
+
}
|
|
18299
|
+
options.target = Buffer2.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
18300
|
+
} else {
|
|
18301
|
+
if (app) {
|
|
18302
|
+
command = app;
|
|
18303
|
+
} else {
|
|
18304
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
18305
|
+
let exeLocalXdgOpen = false;
|
|
18306
|
+
try {
|
|
18307
|
+
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
18308
|
+
exeLocalXdgOpen = true;
|
|
18309
|
+
} catch {
|
|
18310
|
+
}
|
|
18311
|
+
const useSystemXdgOpen = process7.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
18312
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
18313
|
+
}
|
|
18314
|
+
if (appArguments.length > 0) {
|
|
18315
|
+
cliArguments.push(...appArguments);
|
|
18316
|
+
}
|
|
18317
|
+
if (!options.wait) {
|
|
18318
|
+
childProcessOptions.stdio = "ignore";
|
|
18319
|
+
childProcessOptions.detached = true;
|
|
18320
|
+
}
|
|
18321
|
+
}
|
|
18322
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
18323
|
+
cliArguments.push("--args", ...appArguments);
|
|
18324
|
+
}
|
|
18325
|
+
if (options.target) {
|
|
18326
|
+
cliArguments.push(options.target);
|
|
18327
|
+
}
|
|
18328
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
18329
|
+
if (options.wait) {
|
|
18330
|
+
return new Promise((resolve7, reject2) => {
|
|
18331
|
+
subprocess.once("error", reject2);
|
|
18332
|
+
subprocess.once("close", (exitCode) => {
|
|
18333
|
+
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
18334
|
+
reject2(new Error(`Exited with code ${exitCode}`));
|
|
18335
|
+
return;
|
|
18336
|
+
}
|
|
18337
|
+
resolve7(subprocess);
|
|
18338
|
+
});
|
|
18339
|
+
});
|
|
18340
|
+
}
|
|
18341
|
+
subprocess.unref();
|
|
18342
|
+
return subprocess;
|
|
18343
|
+
}, "baseOpen");
|
|
18344
|
+
var open = /* @__PURE__ */ __name((target, options) => {
|
|
18345
|
+
if (typeof target !== "string") {
|
|
18346
|
+
throw new TypeError("Expected a `target`");
|
|
18347
|
+
}
|
|
18348
|
+
return baseOpen({
|
|
18349
|
+
...options,
|
|
18350
|
+
target
|
|
18351
|
+
});
|
|
18352
|
+
}, "open");
|
|
18353
|
+
function detectArchBinary(binary) {
|
|
18354
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
18355
|
+
return binary;
|
|
18356
|
+
}
|
|
18357
|
+
const { [arch]: archBinary } = binary;
|
|
18358
|
+
if (!archBinary) {
|
|
18359
|
+
throw new Error(`${arch} is not supported`);
|
|
18360
|
+
}
|
|
18361
|
+
return archBinary;
|
|
18362
|
+
}
|
|
18363
|
+
__name(detectArchBinary, "detectArchBinary");
|
|
18364
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
18365
|
+
if (wsl && is_wsl_default) {
|
|
18366
|
+
return detectArchBinary(wsl);
|
|
18367
|
+
}
|
|
18368
|
+
if (!platformBinary) {
|
|
18369
|
+
throw new Error(`${platform} is not supported`);
|
|
18370
|
+
}
|
|
18371
|
+
return detectArchBinary(platformBinary);
|
|
18372
|
+
}
|
|
18373
|
+
__name(detectPlatformBinary, "detectPlatformBinary");
|
|
18374
|
+
var apps = {};
|
|
18375
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
18376
|
+
darwin: "google chrome",
|
|
18377
|
+
win32: "chrome",
|
|
18378
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
18379
|
+
}, {
|
|
18380
|
+
wsl: {
|
|
18381
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
18382
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
18383
|
+
}
|
|
18384
|
+
}));
|
|
18385
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
18386
|
+
darwin: "brave browser",
|
|
18387
|
+
win32: "brave",
|
|
18388
|
+
linux: ["brave-browser", "brave"]
|
|
18389
|
+
}, {
|
|
18390
|
+
wsl: {
|
|
18391
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
18392
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
18393
|
+
}
|
|
18394
|
+
}));
|
|
18395
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
18396
|
+
darwin: "firefox",
|
|
18397
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
18398
|
+
linux: "firefox"
|
|
18399
|
+
}, {
|
|
18400
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
18401
|
+
}));
|
|
18402
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
18403
|
+
darwin: "microsoft edge",
|
|
18404
|
+
win32: "msedge",
|
|
18405
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
18406
|
+
}, {
|
|
18407
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
18408
|
+
}));
|
|
18409
|
+
defineLazyProperty(apps, "browser", () => "browser");
|
|
18410
|
+
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
18411
|
+
var open_default = open;
|
|
18412
|
+
|
|
18413
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18414
|
+
var import_ts_dedent4 = __toESM(require_dist(), 1);
|
|
18415
|
+
|
|
18416
|
+
// src/core-server/utils/open-browser/opener.ts
|
|
18417
|
+
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
18418
|
+
import { execSync } from "node:child_process";
|
|
18419
|
+
import { join as join7 } from "node:path";
|
|
18420
|
+
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
18421
|
+
var OSX_CHROME = "google chrome";
|
|
18422
|
+
var Actions = Object.freeze({
|
|
18423
|
+
NONE: 0,
|
|
18424
|
+
BROWSER: 1,
|
|
18425
|
+
SCRIPT: 2
|
|
18426
|
+
});
|
|
18427
|
+
function getBrowserEnv() {
|
|
18428
|
+
const value = process.env.BROWSER;
|
|
18429
|
+
const args = process.env.BROWSER_ARGS ? process.env.BROWSER_ARGS.split(" ") : [];
|
|
18430
|
+
let action;
|
|
18431
|
+
if (!value) {
|
|
18432
|
+
action = Actions.BROWSER;
|
|
18433
|
+
} else if (value.toLowerCase().endsWith(".js")) {
|
|
18434
|
+
action = Actions.SCRIPT;
|
|
18435
|
+
} else if (value.toLowerCase() === "none") {
|
|
18436
|
+
action = Actions.NONE;
|
|
18437
|
+
} else {
|
|
18438
|
+
action = Actions.BROWSER;
|
|
18439
|
+
}
|
|
18440
|
+
return { action, value, args };
|
|
18441
|
+
}
|
|
18442
|
+
__name(getBrowserEnv, "getBrowserEnv");
|
|
18443
|
+
function executeNodeScript(scriptPath, url) {
|
|
18444
|
+
const extraArgs = process.argv.slice(2);
|
|
18445
|
+
const child = (0, import_cross_spawn.default)(process.execPath, [scriptPath, ...extraArgs, url], {
|
|
18446
|
+
stdio: "inherit"
|
|
18447
|
+
});
|
|
18448
|
+
child.on("close", (code) => {
|
|
18449
|
+
if (code !== 0) {
|
|
18450
|
+
console.log();
|
|
18451
|
+
console.log(import_picocolors5.default.red("The script specified as BROWSER environment variable failed."));
|
|
18452
|
+
console.log(`${import_picocolors5.default.cyan(scriptPath)} exited with code ${code}.`);
|
|
18453
|
+
console.log();
|
|
18454
|
+
return;
|
|
18455
|
+
}
|
|
18456
|
+
});
|
|
18457
|
+
return true;
|
|
18458
|
+
}
|
|
18459
|
+
__name(executeNodeScript, "executeNodeScript");
|
|
18460
|
+
function startBrowserProcess(browser, url, args) {
|
|
18461
|
+
const shouldTryOpenChromiumWithAppleScript = process.platform === "darwin" && (typeof browser !== "string" || browser === OSX_CHROME);
|
|
18462
|
+
if (shouldTryOpenChromiumWithAppleScript) {
|
|
18463
|
+
const supportedChromiumBrowsers = [
|
|
18464
|
+
"Google Chrome Canary",
|
|
18465
|
+
"Google Chrome Dev",
|
|
18466
|
+
"Google Chrome Beta",
|
|
18467
|
+
"Google Chrome",
|
|
18468
|
+
"Microsoft Edge",
|
|
18469
|
+
"Brave Browser",
|
|
18470
|
+
"Arc",
|
|
18471
|
+
"Vivaldi",
|
|
18472
|
+
"Chromium"
|
|
18473
|
+
];
|
|
18474
|
+
for (const chromiumBrowser of supportedChromiumBrowsers) {
|
|
18475
|
+
try {
|
|
18476
|
+
execSync(`ps cax | grep "${chromiumBrowser}"`);
|
|
18477
|
+
const pathToApplescript = join7(
|
|
18478
|
+
resolvePackageDir("storybook"),
|
|
18479
|
+
"assets",
|
|
18480
|
+
"server",
|
|
18481
|
+
"openBrowser.applescript"
|
|
18482
|
+
);
|
|
18483
|
+
const command = `osascript "${pathToApplescript}" "`.concat(encodeURI(url), '" "').concat(
|
|
18484
|
+
process.env.OPEN_MATCH_HOST_ONLY === "true" ? encodeURI(new URL(url).origin) : encodeURI(url),
|
|
18485
|
+
'" "'
|
|
18486
|
+
).concat(chromiumBrowser, '"');
|
|
18487
|
+
execSync(command, {
|
|
18488
|
+
cwd: __dirname
|
|
18489
|
+
});
|
|
18490
|
+
return true;
|
|
18491
|
+
} catch (err) {
|
|
18492
|
+
}
|
|
18493
|
+
}
|
|
18494
|
+
}
|
|
18495
|
+
if (process.platform === "darwin" && browser === "open") {
|
|
18496
|
+
browser = void 0;
|
|
18497
|
+
}
|
|
18498
|
+
if (typeof browser === "string" && args.length > 0) {
|
|
18499
|
+
browser = [browser].concat(args);
|
|
18500
|
+
}
|
|
18501
|
+
try {
|
|
18502
|
+
const options = { app: browser, wait: false, url: true };
|
|
18503
|
+
open_default(url, options).catch(() => {
|
|
18504
|
+
});
|
|
18505
|
+
return true;
|
|
18506
|
+
} catch (err) {
|
|
18507
|
+
return false;
|
|
18508
|
+
}
|
|
18509
|
+
}
|
|
18510
|
+
__name(startBrowserProcess, "startBrowserProcess");
|
|
18511
|
+
function openBrowser(url) {
|
|
18512
|
+
const { action, value, args } = getBrowserEnv();
|
|
18513
|
+
switch (action) {
|
|
18514
|
+
case Actions.NONE: {
|
|
18515
|
+
return false;
|
|
18516
|
+
}
|
|
18517
|
+
case Actions.SCRIPT: {
|
|
18518
|
+
if (!value) {
|
|
18519
|
+
throw new Error("BROWSER environment variable is not set.");
|
|
18520
|
+
}
|
|
18521
|
+
return executeNodeScript(value, url);
|
|
18522
|
+
}
|
|
18523
|
+
case Actions.BROWSER: {
|
|
18524
|
+
return startBrowserProcess(value, url, args);
|
|
18525
|
+
}
|
|
18526
|
+
default: {
|
|
18527
|
+
throw new Error("Not implemented.");
|
|
18528
|
+
}
|
|
18529
|
+
}
|
|
18530
|
+
}
|
|
18531
|
+
__name(openBrowser, "openBrowser");
|
|
18532
|
+
|
|
18533
|
+
// src/core-server/utils/open-browser/open-in-browser.ts
|
|
18534
|
+
async function openInBrowser(address) {
|
|
18535
|
+
let errorOccured = false;
|
|
18536
|
+
try {
|
|
18537
|
+
await openBrowser(address);
|
|
18538
|
+
} catch (error) {
|
|
18539
|
+
errorOccured = true;
|
|
18540
|
+
}
|
|
18541
|
+
try {
|
|
18542
|
+
if (errorOccured) {
|
|
18543
|
+
await open_default(address);
|
|
18544
|
+
errorOccured = false;
|
|
18545
|
+
}
|
|
18546
|
+
} catch (error) {
|
|
18547
|
+
errorOccured = true;
|
|
18548
|
+
}
|
|
18549
|
+
if (errorOccured) {
|
|
18550
|
+
logger5.error(import_ts_dedent4.dedent`
|
|
18447
18551
|
Could not open ${address} inside a browser. If you're running this command inside a
|
|
18448
18552
|
docker container or on a CI, you need to pass the '--ci' flag to prevent opening a
|
|
18449
18553
|
browser by default.
|
|
18450
18554
|
`);
|
|
18451
|
-
|
|
18452
|
-
});
|
|
18555
|
+
}
|
|
18453
18556
|
}
|
|
18454
18557
|
__name(openInBrowser, "openInBrowser");
|
|
18455
18558
|
|
|
18456
18559
|
// src/core-server/utils/server-address.ts
|
|
18457
18560
|
var import_detect_port = __toESM(require_detect_port2(), 1);
|
|
18458
|
-
import
|
|
18561
|
+
import os2 from "node:os";
|
|
18459
18562
|
import { logger as logger6 } from "storybook/internal/node-logger";
|
|
18460
18563
|
function getServerAddresses(port, host, proto, initialPath) {
|
|
18461
18564
|
const address = new URL(`${proto}://localhost:${port}/`);
|
|
@@ -18486,7 +18589,7 @@ var getServerChannelUrl = /* @__PURE__ */ __name((port, { https: https2 }) => {
|
|
|
18486
18589
|
return `${https2 ? "wss" : "ws"}://localhost:${port}/storybook-server-channel`;
|
|
18487
18590
|
}, "getServerChannelUrl");
|
|
18488
18591
|
var getLocalIp = /* @__PURE__ */ __name(() => {
|
|
18489
|
-
const allIps = Object.values(
|
|
18592
|
+
const allIps = Object.values(os2.networkInterfaces()).flat();
|
|
18490
18593
|
const allFilteredIps = allIps.filter((ip) => ip && ip.family === "IPv4" && !ip.internal);
|
|
18491
18594
|
return allFilteredIps.length ? allFilteredIps[0]?.address : "0.0.0.0";
|
|
18492
18595
|
}, "getLocalIp");
|
|
@@ -18541,6 +18644,7 @@ async function storybookDevServer(options) {
|
|
|
18541
18644
|
invariant(port, "expected options to have a port");
|
|
18542
18645
|
const proto = options.https ? "https" : "http";
|
|
18543
18646
|
const { address, networkAddress } = getServerAddresses(port, host, proto, initialPath);
|
|
18647
|
+
options.networkAddress = networkAddress;
|
|
18544
18648
|
if (!core2?.builder) {
|
|
18545
18649
|
throw new MissingBuilderError2();
|
|
18546
18650
|
}
|
|
@@ -18586,7 +18690,8 @@ async function storybookDevServer(options) {
|
|
|
18586
18690
|
await Promise.all([initializedStoryIndexGenerator, listening]).then(async ([indexGenerator]) => {
|
|
18587
18691
|
if (indexGenerator && !options.ci && !options.smokeTest && options.open) {
|
|
18588
18692
|
const url = host ? networkAddress : address;
|
|
18589
|
-
openInBrowser(options.previewOnly ? `${url}iframe.html?navigator=true` : url)
|
|
18693
|
+
openInBrowser(options.previewOnly ? `${url}iframe.html?navigator=true` : url).catch(() => {
|
|
18694
|
+
});
|
|
18590
18695
|
}
|
|
18591
18696
|
});
|
|
18592
18697
|
if (indexError) {
|
|
@@ -18623,12 +18728,12 @@ __name(storybookDevServer, "storybookDevServer");
|
|
|
18623
18728
|
// src/core-server/utils/output-startup-information.ts
|
|
18624
18729
|
import { colors as colors2 } from "storybook/internal/node-logger";
|
|
18625
18730
|
var import_cli_table3 = __toESM(require_cli_table3(), 1);
|
|
18626
|
-
var
|
|
18731
|
+
var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
18627
18732
|
var import_pretty_hrtime = __toESM(require_pretty_hrtime(), 1);
|
|
18628
18733
|
var import_ts_dedent6 = __toESM(require_dist(), 1);
|
|
18629
18734
|
|
|
18630
18735
|
// src/core-server/utils/update-check.ts
|
|
18631
|
-
var
|
|
18736
|
+
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
18632
18737
|
var import_ts_dedent5 = __toESM(require_dist(), 1);
|
|
18633
18738
|
import { cache } from "storybook/internal/common";
|
|
18634
18739
|
import { colors } from "storybook/internal/node-logger";
|
|
@@ -18663,13 +18768,13 @@ function createUpdateMessage(updateInfo, version) {
|
|
|
18663
18768
|
const upgradeCommand = `npx storybook@${isPrerelease ? "next" : "latest"} upgrade`;
|
|
18664
18769
|
updateMessage = updateInfo.success && semver.lt(version, updateInfo.data.latest.version) ? import_ts_dedent5.dedent`
|
|
18665
18770
|
${colors.orange(
|
|
18666
|
-
`A new version (${
|
|
18771
|
+
`A new version (${import_picocolors6.default.bold(updateInfo.data.latest.version)}) is available!`
|
|
18667
18772
|
)}
|
|
18668
18773
|
|
|
18669
|
-
${
|
|
18774
|
+
${import_picocolors6.default.gray("Upgrade now:")} ${colors.green(upgradeCommand)}
|
|
18670
18775
|
|
|
18671
|
-
${
|
|
18672
|
-
|
|
18776
|
+
${import_picocolors6.default.gray("Read full changelog:")} ${import_picocolors6.default.gray(
|
|
18777
|
+
import_picocolors6.default.underline("https://github.com/storybookjs/storybook/blob/main/CHANGELOG.md")
|
|
18673
18778
|
)}
|
|
18674
18779
|
` : "";
|
|
18675
18780
|
} catch (e) {
|
|
@@ -18708,20 +18813,20 @@ function outputStartupInformation(options) {
|
|
|
18708
18813
|
paddingBottom: 0
|
|
18709
18814
|
});
|
|
18710
18815
|
serveMessage.push(
|
|
18711
|
-
["Local:",
|
|
18712
|
-
["On your network:",
|
|
18816
|
+
["Local:", import_picocolors7.default.cyan(address)],
|
|
18817
|
+
["On your network:", import_picocolors7.default.cyan(networkAddress)]
|
|
18713
18818
|
);
|
|
18714
18819
|
const timeStatement = [
|
|
18715
|
-
managerTotalTime && `${
|
|
18716
|
-
previewTotalTime && `${
|
|
18820
|
+
managerTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(managerTotalTime))} for manager`,
|
|
18821
|
+
previewTotalTime && `${import_picocolors7.default.underline((0, import_pretty_hrtime.default)(previewTotalTime))} for preview`
|
|
18717
18822
|
].filter(Boolean).join(" and ");
|
|
18718
18823
|
console.log(
|
|
18719
18824
|
boxen(
|
|
18720
18825
|
import_ts_dedent6.dedent`
|
|
18721
18826
|
${colors2.green(
|
|
18722
|
-
`Storybook ${
|
|
18827
|
+
`Storybook ${import_picocolors7.default.bold(version)} for ${import_picocolors7.default.bold(name)} started`
|
|
18723
18828
|
)}
|
|
18724
|
-
${
|
|
18829
|
+
${import_picocolors7.default.gray(timeStatement)}
|
|
18725
18830
|
|
|
18726
18831
|
${serveMessage.toString()}${updateMessage ? `
|
|
18727
18832
|
|
|
@@ -18737,7 +18842,7 @@ __name(outputStartupInformation, "outputStartupInformation");
|
|
|
18737
18842
|
import { logger as logger10 } from "storybook/internal/node-logger";
|
|
18738
18843
|
|
|
18739
18844
|
// ../lib/cli-storybook/src/doctor/getIncompatibleStorybookPackages.ts
|
|
18740
|
-
var
|
|
18845
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
18741
18846
|
import { versions as storybookCorePackages } from "storybook/internal/common";
|
|
18742
18847
|
import { logger as logger9 } from "storybook/internal/node-logger";
|
|
18743
18848
|
import semver2 from "semver";
|
|
@@ -18841,7 +18946,7 @@ var getIncompatiblePackagesSummary = /* @__PURE__ */ __name((dependencyAnalysis,
|
|
|
18841
18946
|
);
|
|
18842
18947
|
if (incompatiblePackages.length > 0) {
|
|
18843
18948
|
summaryMessage.push(
|
|
18844
|
-
`You are currently using Storybook ${
|
|
18949
|
+
`You are currently using Storybook ${import_picocolors8.default.bold(
|
|
18845
18950
|
currentStorybookVersion
|
|
18846
18951
|
)} but you have packages which are incompatible with it:
|
|
18847
18952
|
`
|
|
@@ -18872,13 +18977,13 @@ var getIncompatiblePackagesSummary = /* @__PURE__ */ __name((dependencyAnalysis,
|
|
|
18872
18977
|
if (incompatiblePackages.some((dep) => dep.availableCoreUpdate)) {
|
|
18873
18978
|
summaryMessage.push(
|
|
18874
18979
|
"\n",
|
|
18875
|
-
`The version of ${
|
|
18980
|
+
`The version of ${import_picocolors8.default.blue(`storybook@${currentStorybookVersion}`)} is behind the following core packages:`,
|
|
18876
18981
|
`${incompatiblePackages.filter((dep) => dep.availableCoreUpdate).map(
|
|
18877
|
-
({ packageName, packageVersion }) => `- ${
|
|
18982
|
+
({ packageName, packageVersion }) => `- ${import_picocolors8.default.blue(`${packageName}@${packageVersion}`)}`
|
|
18878
18983
|
).join("\n")}`,
|
|
18879
18984
|
"\n",
|
|
18880
18985
|
`Upgrade Storybook with:`,
|
|
18881
|
-
|
|
18986
|
+
import_picocolors8.default.blue("npx storybook@latest upgrade")
|
|
18882
18987
|
);
|
|
18883
18988
|
}
|
|
18884
18989
|
}
|
|
@@ -18903,7 +19008,7 @@ var warnOnIncompatibleAddons = /* @__PURE__ */ __name(async (currentStorybookVer
|
|
|
18903
19008
|
}, "warnOnIncompatibleAddons");
|
|
18904
19009
|
|
|
18905
19010
|
// src/core-server/utils/warnWhenUsingArgTypesRegex.ts
|
|
18906
|
-
var
|
|
19011
|
+
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
18907
19012
|
var import_ts_dedent7 = __toESM(require_dist(), 1);
|
|
18908
19013
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
18909
19014
|
import { core } from "storybook/internal/babel";
|
|
@@ -18919,20 +19024,20 @@ async function warnWhenUsingArgTypesRegex(previewConfigPath, config) {
|
|
|
18919
19024
|
{ code: previewContent, ast: babelParse(previewContent) }
|
|
18920
19025
|
);
|
|
18921
19026
|
file.path.traverse({
|
|
18922
|
-
Identifier: /* @__PURE__ */ __name((
|
|
18923
|
-
if (
|
|
19027
|
+
Identifier: /* @__PURE__ */ __name((path2) => {
|
|
19028
|
+
if (path2.node.name === "argTypesRegex") {
|
|
18924
19029
|
const message = import_ts_dedent7.dedent`
|
|
18925
|
-
${
|
|
19030
|
+
${import_picocolors9.default.bold("Attention")}: We've detected that you're using ${import_picocolors9.default.cyan(
|
|
18926
19031
|
"actions.argTypesRegex"
|
|
18927
19032
|
)} together with the visual test addon:
|
|
18928
19033
|
|
|
18929
|
-
${
|
|
19034
|
+
${path2.buildCodeFrameError(previewConfigPath).message}
|
|
18930
19035
|
|
|
18931
|
-
We recommend removing the ${
|
|
19036
|
+
We recommend removing the ${import_picocolors9.default.cyan(
|
|
18932
19037
|
"argTypesRegex"
|
|
18933
|
-
)} and assigning explicit action with the ${
|
|
19038
|
+
)} and assigning explicit action with the ${import_picocolors9.default.cyan(
|
|
18934
19039
|
"fn"
|
|
18935
|
-
)} function from ${
|
|
19040
|
+
)} function from ${import_picocolors9.default.cyan("storybook/test")} instead:
|
|
18936
19041
|
https://storybook.js.org/docs/essentials/actions#via-storybooktest-fn-spy-function
|
|
18937
19042
|
|
|
18938
19043
|
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 +19103,7 @@ async function buildDevStandalone(options) {
|
|
|
18998
19103
|
validateFrameworkName(frameworkName);
|
|
18999
19104
|
}
|
|
19000
19105
|
if (frameworkName) {
|
|
19001
|
-
corePresets.push(
|
|
19106
|
+
corePresets.push(join8(frameworkName, "preset"));
|
|
19002
19107
|
}
|
|
19003
19108
|
frameworkName = frameworkName || "custom";
|
|
19004
19109
|
const packageManager = JsPackageManagerFactory.getPackageManager({
|
|
@@ -19054,7 +19159,7 @@ async function buildDevStandalone(options) {
|
|
|
19054
19159
|
const resolvedRenderer = renderer && resolveAddonName2(options.configDir, renderer, options);
|
|
19055
19160
|
presets = await loadAllPresets2({
|
|
19056
19161
|
corePresets: [
|
|
19057
|
-
|
|
19162
|
+
join8(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
19058
19163
|
...managerBuilder.corePresets || [],
|
|
19059
19164
|
...previewBuilder.corePresets || [],
|
|
19060
19165
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
@@ -19125,7 +19230,7 @@ import { normalizeStories as normalizeStories3 } from "storybook/internal/common
|
|
|
19125
19230
|
import { logger as logger12 } from "storybook/internal/node-logger";
|
|
19126
19231
|
|
|
19127
19232
|
// src/core-server/load.ts
|
|
19128
|
-
import { join as
|
|
19233
|
+
import { join as join9, relative as relative6, resolve as resolve6 } from "node:path";
|
|
19129
19234
|
import {
|
|
19130
19235
|
getProjectRoot as getProjectRoot3,
|
|
19131
19236
|
loadAllPresets as loadAllPresets3,
|
|
@@ -19149,7 +19254,7 @@ async function loadStorybook(options) {
|
|
|
19149
19254
|
validateFrameworkName2(frameworkName);
|
|
19150
19255
|
}
|
|
19151
19256
|
if (frameworkName) {
|
|
19152
|
-
corePresets.push(
|
|
19257
|
+
corePresets.push(join9(frameworkName, "preset"));
|
|
19153
19258
|
}
|
|
19154
19259
|
frameworkName = frameworkName || "custom";
|
|
19155
19260
|
let presets = await loadAllPresets3({
|
|
@@ -19164,7 +19269,7 @@ async function loadStorybook(options) {
|
|
|
19164
19269
|
const resolvedRenderer = renderer && resolveAddonName3(options.configDir, renderer, options);
|
|
19165
19270
|
presets = await loadAllPresets3({
|
|
19166
19271
|
corePresets: [
|
|
19167
|
-
|
|
19272
|
+
join9(resolvePackageDir("storybook"), "dist/core-server/presets/common-preset.js"),
|
|
19168
19273
|
...resolvedRenderer ? [resolvedRenderer] : [],
|
|
19169
19274
|
...corePresets
|
|
19170
19275
|
],
|