storybook 10.0.0-beta.1 → 10.0.0-beta.11
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/Color-KPLIACXP.js +1569 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-YY5GICNT.js → chunk-6E2SHJSL.js} +175 -32
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YWDKX534.js → chunk-FA42P6MO.js} +49 -4
- package/dist/_browser-chunks/chunk-G33S6YM3.js +521 -0
- package/dist/_browser-chunks/{chunk-MZNYTCNT.js → chunk-HMIIJ6UD.js} +6 -6
- package/dist/_browser-chunks/{chunk-4QPX7WIQ.js → chunk-JJZMHC3A.js} +57 -166
- package/dist/_browser-chunks/{chunk-MD2FTHCZ.js → chunk-JVSKG4YS.js} +3 -16
- package/dist/_browser-chunks/{chunk-E7VLET3C.js → chunk-KSCAWCCE.js} +3947 -4291
- package/dist/_browser-chunks/{chunk-PYK5ZTFK.js → chunk-PS3AOQI4.js} +48 -25
- package/dist/_browser-chunks/chunk-QK3L5AXO.js +372 -0
- package/dist/_browser-chunks/chunk-SHR3NNR3.js +5810 -0
- package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +20 -0
- package/dist/_browser-chunks/{chunk-T7RCAJIX.js → chunk-Y3M7TW6K.js} +43 -47
- package/dist/_browser-chunks/{syntaxhighlighter-YYAA4CS4.js → syntaxhighlighter-R46XOLMC.js} +1 -1
- package/dist/_node-chunks/{builder-manager-EXW4ETLN.js → builder-manager-VLFDK43H.js} +45 -155
- package/dist/_node-chunks/camelcase-RENSEFK6.js +18 -0
- package/dist/_node-chunks/{chunk-5ZX5SJOP.js → chunk-4SPBIDJV.js} +162 -103
- package/dist/_node-chunks/{chunk-PMEEE3UE.js → chunk-4WZFG35Z.js} +30 -21
- package/dist/_node-chunks/{chunk-WP7DV5JT.js → chunk-5K7G6NFK.js} +583 -180
- package/dist/_node-chunks/{chunk-FZP2YGG3.js → chunk-5NSMDC6F.js} +7 -7
- package/dist/_node-chunks/{chunk-6CCUFDHU.js → chunk-5THWZTEL.js} +7 -7
- package/dist/_node-chunks/chunk-7MUMULSR.js +79 -0
- package/dist/_node-chunks/chunk-7QAAJL75.js +1540 -0
- package/dist/_node-chunks/{chunk-EO4S3VXL.js → chunk-DVY3VWHZ.js} +653 -775
- package/dist/_node-chunks/{chunk-WDKWVNL2.js → chunk-EBLOP2C5.js} +7 -7
- package/dist/_node-chunks/{chunk-EDBXIJN5.js → chunk-EF56ZUQY.js} +7 -7
- package/dist/_node-chunks/{chunk-F5J33SXQ.js → chunk-ER2UQBIA.js} +7 -7
- package/dist/_node-chunks/chunk-GHICGP2P.js +18 -0
- package/dist/_node-chunks/{chunk-4WNZYNQY.js → chunk-GYBN5GXT.js} +623 -750
- package/dist/_node-chunks/{chunk-2G5THETV.js → chunk-H2YBWE3T.js} +12 -12
- package/dist/_node-chunks/{camelcase-VZZFWA2L.js → chunk-HYMBYTGJ.js} +9 -8
- package/dist/_node-chunks/{chunk-SUMFFLGF.js → chunk-Q5IJJX3T.js} +6 -6
- package/dist/_node-chunks/{chunk-U45F2NP6.js → chunk-QLRMR54O.js} +7 -7
- package/dist/_node-chunks/{chunk-XTSBFCVE.js → chunk-QSNDRP62.js} +7 -7
- package/dist/_node-chunks/chunk-S2RQAF7K.js +4741 -0
- package/dist/_node-chunks/{chunk-2QZOLZDJ.js → chunk-SDZVOIZI.js} +9 -9
- package/dist/_node-chunks/{chunk-VNLBDN2Z.js → chunk-SGJZDMJW.js} +6 -6
- package/dist/_node-chunks/{chunk-PL2PKDRO.js → chunk-TJOIDMXP.js} +60 -102
- package/dist/_node-chunks/{chunk-ICPKUV5G.js → chunk-U2UIPLJI.js} +7 -7
- package/dist/_node-chunks/{chunk-3SGKBLOL.js → chunk-UAMXREF3.js} +8 -8
- package/dist/_node-chunks/{chunk-GVCXNIAA.js → chunk-UC6O5PNX.js} +399 -116
- package/dist/_node-chunks/{chunk-CM3UGTR5.js → chunk-VFUP6Z4J.js} +7 -7
- package/dist/_node-chunks/{chunk-3ZKQWDCG.js → chunk-XKPJCSPD.js} +223 -243
- package/dist/_node-chunks/{chunk-24TGL6EX.js → chunk-XWCQWB3R.js} +8 -8
- package/dist/_node-chunks/{chunk-QC5FE2D7.js → chunk-XYFEBEHY.js} +7 -7
- package/dist/_node-chunks/chunk-YAEIMHFX.js +62 -0
- package/dist/_node-chunks/{chunk-5V6QH7WC.js → chunk-ZHBCPKYD.js} +7 -7
- package/dist/_node-chunks/{dist-VZL6D6Y3.js → dist-A2RPEHEC.js} +9 -9
- package/dist/_node-chunks/{globby-GZXJJ4W6.js → globby-3TWPXGQS.js} +17 -13
- package/dist/_node-chunks/{lib-PHT5GCV2.js → lib-MUNM6ZJ6.js} +40 -16
- package/dist/_node-chunks/{mdx-N42X6CFJ-EPDIV4A2.js → mdx-N42X6CFJ-QQDHJZQ3.js} +8 -8
- package/dist/_node-chunks/{p-limit-AJIFSZTI.js → p-limit-FEN55OV6.js} +76 -10
- package/dist/_node-chunks/{plugin-3VI56CEF.js → plugin-ESAYNJ5V.js} +11 -11
- package/dist/_node-chunks/{plugin-AV4OEKYM.js → plugin-GDMP3JPR.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-E7J5FKLA.js → webpack-inject-mocker-runtime-plugin-5AKTLYIV.js} +1307 -847
- package/dist/_node-chunks/{webpack-mock-plugin-VTYGW7HO.js → webpack-mock-plugin-AWGZ65AQ.js} +9 -9
- package/dist/babel/index.d.ts +1 -1
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +638 -187
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +77 -12
- package/dist/cli/index.d.ts +62 -75
- package/dist/cli/index.js +67 -55
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.js +22 -22
- package/dist/components/index.d.ts +228 -1
- package/dist/components/index.js +74 -5738
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.d.ts +515 -14
- package/dist/core-server/index.js +4647 -4182
- package/dist/core-server/presets/common-manager.js +1570 -1272
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -38
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.d.ts +9 -4
- package/dist/csf/index.js +50 -15
- package/dist/csf-tools/index.d.ts +47 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +4 -4
- package/dist/instrumenter/index.js +1 -1
- package/dist/manager/globals-runtime.js +9230 -18109
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +13194 -11367
- package/dist/manager-api/index.d.ts +513 -5
- package/dist/manager-api/index.js +364 -90
- package/dist/manager-errors.d.ts +501 -0
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +1136 -662
- package/dist/preview/globals.js +1 -1
- package/dist/preview/runtime.js +12103 -21579
- package/dist/preview-api/index.d.ts +70 -71
- package/dist/preview-api/index.js +10 -10
- package/dist/preview-errors.d.ts +501 -0
- package/dist/router/index.d.ts +668 -10
- package/dist/router/index.js +2 -2
- package/dist/server-errors.d.ts +501 -0
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +23 -25
- package/dist/test/index.js +1874 -4024
- package/dist/theming/index.d.ts +2 -2
- package/dist/theming/index.js +6 -6
- package/dist/types/index.d.ts +553 -16
- package/dist/viewport/index.d.ts +36 -4
- package/dist/viewport/index.js +1 -1
- package/package.json +9 -46
- package/dist/_browser-chunks/Color-SFYJJKWL.js +0 -605
- package/dist/_browser-chunks/chunk-DHO2SA6L.js +0 -12
- package/dist/_browser-chunks/chunk-WPHPDNUA.js +0 -974
- package/dist/_node-chunks/chunk-32JYCD74.js +0 -80
- package/dist/_node-chunks/chunk-GE6I3YYG.js +0 -62
- package/dist/_node-chunks/chunk-KXCNXWXI.js +0 -18
- package/dist/_node-chunks/chunk-LAUOYAOX.js +0 -87
- package/dist/_node-chunks/chunk-QJTT4OC2.js +0 -266
- package/dist/_node-chunks/chunk-V2ZF4DUD.js +0 -2377
- package/dist/_node-chunks/chunk-ZMV3WY6R.js +0 -9845
- package/dist/_node-chunks/default-browser-id-JNATP42X.js +0 -1719
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_91hxho9jtpf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_91hxho9jtpf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_91hxho9jtpf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_91hxho9jtpf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_91hxho9jtpf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_91hxho9jtpf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,29 +12,644 @@ var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
parseStaticDir,
|
|
14
14
|
sendTelemetryError
|
|
15
|
-
} from "../../_node-chunks/chunk-
|
|
16
|
-
import "../../_node-chunks/chunk-
|
|
15
|
+
} from "../../_node-chunks/chunk-H2YBWE3T.js";
|
|
16
|
+
import "../../_node-chunks/chunk-XYFEBEHY.js";
|
|
17
17
|
import {
|
|
18
18
|
invariant
|
|
19
|
-
} from "../../_node-chunks/chunk-
|
|
19
|
+
} from "../../_node-chunks/chunk-VFUP6Z4J.js";
|
|
20
20
|
import {
|
|
21
21
|
resolvePackageDir
|
|
22
|
-
} from "../../_node-chunks/chunk-
|
|
22
|
+
} from "../../_node-chunks/chunk-7QAAJL75.js";
|
|
23
23
|
import {
|
|
24
24
|
join
|
|
25
|
-
} from "../../_node-chunks/chunk-
|
|
26
|
-
import "../../_node-chunks/chunk-
|
|
25
|
+
} from "../../_node-chunks/chunk-U2UIPLJI.js";
|
|
26
|
+
import "../../_node-chunks/chunk-QSNDRP62.js";
|
|
27
27
|
import {
|
|
28
28
|
loadConfig
|
|
29
|
-
} from "../../_node-chunks/chunk-
|
|
29
|
+
} from "../../_node-chunks/chunk-UC6O5PNX.js";
|
|
30
30
|
import {
|
|
31
31
|
require_dist
|
|
32
|
-
} from "../../_node-chunks/chunk-
|
|
33
|
-
import "../../_node-chunks/chunk-5V6QH7WC.js";
|
|
32
|
+
} from "../../_node-chunks/chunk-EBLOP2C5.js";
|
|
34
33
|
import {
|
|
34
|
+
require_picocolors
|
|
35
|
+
} from "../../_node-chunks/chunk-ZHBCPKYD.js";
|
|
36
|
+
import {
|
|
37
|
+
__commonJS,
|
|
35
38
|
__name,
|
|
39
|
+
__require,
|
|
36
40
|
__toESM
|
|
37
|
-
} from "../../_node-chunks/chunk-
|
|
41
|
+
} from "../../_node-chunks/chunk-Q5IJJX3T.js";
|
|
42
|
+
|
|
43
|
+
// ../node_modules/shell-quote/quote.js
|
|
44
|
+
var require_quote = __commonJS({
|
|
45
|
+
"../node_modules/shell-quote/quote.js"(exports, module) {
|
|
46
|
+
"use strict";
|
|
47
|
+
module.exports = /* @__PURE__ */ __name(function quote(xs) {
|
|
48
|
+
return xs.map(function(s) {
|
|
49
|
+
if (s === "") {
|
|
50
|
+
return "''";
|
|
51
|
+
}
|
|
52
|
+
if (s && typeof s === "object") {
|
|
53
|
+
return s.op.replace(/(.)/g, "\\$1");
|
|
54
|
+
}
|
|
55
|
+
if (/["\s\\]/.test(s) && !/'/.test(s)) {
|
|
56
|
+
return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
|
57
|
+
}
|
|
58
|
+
if (/["'\s]/.test(s)) {
|
|
59
|
+
return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
|
|
60
|
+
}
|
|
61
|
+
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
|
|
62
|
+
}).join(" ");
|
|
63
|
+
}, "quote");
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// ../node_modules/shell-quote/parse.js
|
|
68
|
+
var require_parse = __commonJS({
|
|
69
|
+
"../node_modules/shell-quote/parse.js"(exports, module) {
|
|
70
|
+
"use strict";
|
|
71
|
+
var CONTROL = "(?:" + [
|
|
72
|
+
"\\|\\|",
|
|
73
|
+
"\\&\\&",
|
|
74
|
+
";;",
|
|
75
|
+
"\\|\\&",
|
|
76
|
+
"\\<\\(",
|
|
77
|
+
"\\<\\<\\<",
|
|
78
|
+
">>",
|
|
79
|
+
">\\&",
|
|
80
|
+
"<\\&",
|
|
81
|
+
"[&;()|<>]"
|
|
82
|
+
].join("|") + ")";
|
|
83
|
+
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
84
|
+
var META = "|&;()<> \\t";
|
|
85
|
+
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
|
|
86
|
+
var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
|
|
87
|
+
var hash = /^#$/;
|
|
88
|
+
var SQ = "'";
|
|
89
|
+
var DQ = '"';
|
|
90
|
+
var DS = "$";
|
|
91
|
+
var TOKEN = "";
|
|
92
|
+
var mult = 4294967296;
|
|
93
|
+
for (i = 0; i < 4; i++) {
|
|
94
|
+
TOKEN += (mult * Math.random()).toString(16);
|
|
95
|
+
}
|
|
96
|
+
var i;
|
|
97
|
+
var startsWithToken = new RegExp("^" + TOKEN);
|
|
98
|
+
function matchAll(s, r) {
|
|
99
|
+
var origIndex = r.lastIndex;
|
|
100
|
+
var matches = [];
|
|
101
|
+
var matchObj;
|
|
102
|
+
while (matchObj = r.exec(s)) {
|
|
103
|
+
matches.push(matchObj);
|
|
104
|
+
if (r.lastIndex === matchObj.index) {
|
|
105
|
+
r.lastIndex += 1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
r.lastIndex = origIndex;
|
|
109
|
+
return matches;
|
|
110
|
+
}
|
|
111
|
+
__name(matchAll, "matchAll");
|
|
112
|
+
function getVar(env2, pre, key) {
|
|
113
|
+
var r = typeof env2 === "function" ? env2(key) : env2[key];
|
|
114
|
+
if (typeof r === "undefined" && key != "") {
|
|
115
|
+
r = "";
|
|
116
|
+
} else if (typeof r === "undefined") {
|
|
117
|
+
r = "$";
|
|
118
|
+
}
|
|
119
|
+
if (typeof r === "object") {
|
|
120
|
+
return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
121
|
+
}
|
|
122
|
+
return pre + r;
|
|
123
|
+
}
|
|
124
|
+
__name(getVar, "getVar");
|
|
125
|
+
function parseInternal(string, env2, opts) {
|
|
126
|
+
if (!opts) {
|
|
127
|
+
opts = {};
|
|
128
|
+
}
|
|
129
|
+
var BS = opts.escape || "\\";
|
|
130
|
+
var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
|
|
131
|
+
var chunker = new RegExp([
|
|
132
|
+
"(" + CONTROL + ")",
|
|
133
|
+
// control chars
|
|
134
|
+
"(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
|
|
135
|
+
].join("|"), "g");
|
|
136
|
+
var matches = matchAll(string, chunker);
|
|
137
|
+
if (matches.length === 0) {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
if (!env2) {
|
|
141
|
+
env2 = {};
|
|
142
|
+
}
|
|
143
|
+
var commented = false;
|
|
144
|
+
return matches.map(function(match) {
|
|
145
|
+
var s = match[0];
|
|
146
|
+
if (!s || commented) {
|
|
147
|
+
return void 0;
|
|
148
|
+
}
|
|
149
|
+
if (controlRE.test(s)) {
|
|
150
|
+
return { op: s };
|
|
151
|
+
}
|
|
152
|
+
var quote = false;
|
|
153
|
+
var esc = false;
|
|
154
|
+
var out = "";
|
|
155
|
+
var isGlob = false;
|
|
156
|
+
var i2;
|
|
157
|
+
function parseEnvVar() {
|
|
158
|
+
i2 += 1;
|
|
159
|
+
var varend;
|
|
160
|
+
var varname;
|
|
161
|
+
var char = s.charAt(i2);
|
|
162
|
+
if (char === "{") {
|
|
163
|
+
i2 += 1;
|
|
164
|
+
if (s.charAt(i2) === "}") {
|
|
165
|
+
throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
|
|
166
|
+
}
|
|
167
|
+
varend = s.indexOf("}", i2);
|
|
168
|
+
if (varend < 0) {
|
|
169
|
+
throw new Error("Bad substitution: " + s.slice(i2));
|
|
170
|
+
}
|
|
171
|
+
varname = s.slice(i2, varend);
|
|
172
|
+
i2 = varend;
|
|
173
|
+
} else if (/[*@#?$!_-]/.test(char)) {
|
|
174
|
+
varname = char;
|
|
175
|
+
i2 += 1;
|
|
176
|
+
} else {
|
|
177
|
+
var slicedFromI = s.slice(i2);
|
|
178
|
+
varend = slicedFromI.match(/[^\w\d_]/);
|
|
179
|
+
if (!varend) {
|
|
180
|
+
varname = slicedFromI;
|
|
181
|
+
i2 = s.length;
|
|
182
|
+
} else {
|
|
183
|
+
varname = slicedFromI.slice(0, varend.index);
|
|
184
|
+
i2 += varend.index - 1;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return getVar(env2, "", varname);
|
|
188
|
+
}
|
|
189
|
+
__name(parseEnvVar, "parseEnvVar");
|
|
190
|
+
for (i2 = 0; i2 < s.length; i2++) {
|
|
191
|
+
var c = s.charAt(i2);
|
|
192
|
+
isGlob = isGlob || !quote && (c === "*" || c === "?");
|
|
193
|
+
if (esc) {
|
|
194
|
+
out += c;
|
|
195
|
+
esc = false;
|
|
196
|
+
} else if (quote) {
|
|
197
|
+
if (c === quote) {
|
|
198
|
+
quote = false;
|
|
199
|
+
} else if (quote == SQ) {
|
|
200
|
+
out += c;
|
|
201
|
+
} else {
|
|
202
|
+
if (c === BS) {
|
|
203
|
+
i2 += 1;
|
|
204
|
+
c = s.charAt(i2);
|
|
205
|
+
if (c === DQ || c === BS || c === DS) {
|
|
206
|
+
out += c;
|
|
207
|
+
} else {
|
|
208
|
+
out += BS + c;
|
|
209
|
+
}
|
|
210
|
+
} else if (c === DS) {
|
|
211
|
+
out += parseEnvVar();
|
|
212
|
+
} else {
|
|
213
|
+
out += c;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
} else if (c === DQ || c === SQ) {
|
|
217
|
+
quote = c;
|
|
218
|
+
} else if (controlRE.test(c)) {
|
|
219
|
+
return { op: s };
|
|
220
|
+
} else if (hash.test(c)) {
|
|
221
|
+
commented = true;
|
|
222
|
+
var commentObj = { comment: string.slice(match.index + i2 + 1) };
|
|
223
|
+
if (out.length) {
|
|
224
|
+
return [out, commentObj];
|
|
225
|
+
}
|
|
226
|
+
return [commentObj];
|
|
227
|
+
} else if (c === BS) {
|
|
228
|
+
esc = true;
|
|
229
|
+
} else if (c === DS) {
|
|
230
|
+
out += parseEnvVar();
|
|
231
|
+
} else {
|
|
232
|
+
out += c;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (isGlob) {
|
|
236
|
+
return { op: "glob", pattern: out };
|
|
237
|
+
}
|
|
238
|
+
return out;
|
|
239
|
+
}).reduce(function(prev, arg) {
|
|
240
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
241
|
+
}, []);
|
|
242
|
+
}
|
|
243
|
+
__name(parseInternal, "parseInternal");
|
|
244
|
+
module.exports = /* @__PURE__ */ __name(function parse(s, env2, opts) {
|
|
245
|
+
var mapped = parseInternal(s, env2, opts);
|
|
246
|
+
if (typeof env2 !== "function") {
|
|
247
|
+
return mapped;
|
|
248
|
+
}
|
|
249
|
+
return mapped.reduce(function(acc, s2) {
|
|
250
|
+
if (typeof s2 === "object") {
|
|
251
|
+
return acc.concat(s2);
|
|
252
|
+
}
|
|
253
|
+
var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
254
|
+
if (xs.length === 1) {
|
|
255
|
+
return acc.concat(xs[0]);
|
|
256
|
+
}
|
|
257
|
+
return acc.concat(xs.filter(Boolean).map(function(x) {
|
|
258
|
+
if (startsWithToken.test(x)) {
|
|
259
|
+
return JSON.parse(x.split(TOKEN)[1]);
|
|
260
|
+
}
|
|
261
|
+
return x;
|
|
262
|
+
}));
|
|
263
|
+
}, []);
|
|
264
|
+
}, "parse");
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// ../node_modules/shell-quote/index.js
|
|
269
|
+
var require_shell_quote = __commonJS({
|
|
270
|
+
"../node_modules/shell-quote/index.js"(exports) {
|
|
271
|
+
"use strict";
|
|
272
|
+
exports.quote = require_quote();
|
|
273
|
+
exports.parse = require_parse();
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// ../node_modules/launch-editor/editor-info/macos.js
|
|
278
|
+
var require_macos = __commonJS({
|
|
279
|
+
"../node_modules/launch-editor/editor-info/macos.js"(exports, module) {
|
|
280
|
+
module.exports = {
|
|
281
|
+
"/Applications/Atom.app/Contents/MacOS/Atom": "atom",
|
|
282
|
+
"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta": "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
|
|
283
|
+
"/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
|
|
284
|
+
"/Applications/Sublime Text.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
|
|
285
|
+
"/Applications/Sublime Text.app/Contents/MacOS/sublime_text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
|
|
286
|
+
"/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2": "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
|
|
287
|
+
"/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
|
|
288
|
+
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
|
|
289
|
+
"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron": "code-insiders",
|
|
290
|
+
"/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
|
|
291
|
+
"/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
|
|
292
|
+
"/Applications/Trae.app/Contents/MacOS/Electron": "trae",
|
|
293
|
+
"/Applications/AppCode.app/Contents/MacOS/appcode": "/Applications/AppCode.app/Contents/MacOS/appcode",
|
|
294
|
+
"/Applications/CLion.app/Contents/MacOS/clion": "/Applications/CLion.app/Contents/MacOS/clion",
|
|
295
|
+
"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
|
|
296
|
+
"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
|
|
297
|
+
"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
|
|
298
|
+
"/Applications/PhpStorm.app/Contents/MacOS/phpstorm": "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
|
|
299
|
+
"/Applications/PyCharm.app/Contents/MacOS/pycharm": "/Applications/PyCharm.app/Contents/MacOS/pycharm",
|
|
300
|
+
"/Applications/PyCharm CE.app/Contents/MacOS/pycharm": "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
|
|
301
|
+
"/Applications/RubyMine.app/Contents/MacOS/rubymine": "/Applications/RubyMine.app/Contents/MacOS/rubymine",
|
|
302
|
+
"/Applications/WebStorm.app/Contents/MacOS/webstorm": "/Applications/WebStorm.app/Contents/MacOS/webstorm",
|
|
303
|
+
"/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
|
|
304
|
+
"/Applications/GoLand.app/Contents/MacOS/goland": "/Applications/GoLand.app/Contents/MacOS/goland",
|
|
305
|
+
"/Applications/Rider.app/Contents/MacOS/rider": "/Applications/Rider.app/Contents/MacOS/rider",
|
|
306
|
+
"/Applications/Zed.app/Contents/MacOS/zed": "zed"
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// ../node_modules/launch-editor/editor-info/linux.js
|
|
312
|
+
var require_linux = __commonJS({
|
|
313
|
+
"../node_modules/launch-editor/editor-info/linux.js"(exports, module) {
|
|
314
|
+
module.exports = {
|
|
315
|
+
atom: "atom",
|
|
316
|
+
Brackets: "brackets",
|
|
317
|
+
"code-insiders": "code-insiders",
|
|
318
|
+
code: "code",
|
|
319
|
+
vscodium: "vscodium",
|
|
320
|
+
codium: "codium",
|
|
321
|
+
trae: "trae",
|
|
322
|
+
emacs: "emacs",
|
|
323
|
+
gvim: "gvim",
|
|
324
|
+
idea: "idea",
|
|
325
|
+
"idea.sh": "idea",
|
|
326
|
+
phpstorm: "phpstorm",
|
|
327
|
+
"phpstorm.sh": "phpstorm",
|
|
328
|
+
pycharm: "pycharm",
|
|
329
|
+
"pycharm.sh": "pycharm",
|
|
330
|
+
rubymine: "rubymine",
|
|
331
|
+
"rubymine.sh": "rubymine",
|
|
332
|
+
sublime_text: "subl",
|
|
333
|
+
vim: "vim",
|
|
334
|
+
webstorm: "webstorm",
|
|
335
|
+
"webstorm.sh": "webstorm",
|
|
336
|
+
goland: "goland",
|
|
337
|
+
"goland.sh": "goland",
|
|
338
|
+
rider: "rider",
|
|
339
|
+
"rider.sh": "rider",
|
|
340
|
+
zed: "zed"
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// ../node_modules/launch-editor/editor-info/windows.js
|
|
346
|
+
var require_windows = __commonJS({
|
|
347
|
+
"../node_modules/launch-editor/editor-info/windows.js"(exports, module) {
|
|
348
|
+
module.exports = [
|
|
349
|
+
"Brackets.exe",
|
|
350
|
+
"Code.exe",
|
|
351
|
+
"Code - Insiders.exe",
|
|
352
|
+
"VSCodium.exe",
|
|
353
|
+
"Cursor.exe",
|
|
354
|
+
"atom.exe",
|
|
355
|
+
"sublime_text.exe",
|
|
356
|
+
"notepad++.exe",
|
|
357
|
+
"clion.exe",
|
|
358
|
+
"clion64.exe",
|
|
359
|
+
"idea.exe",
|
|
360
|
+
"idea64.exe",
|
|
361
|
+
"phpstorm.exe",
|
|
362
|
+
"phpstorm64.exe",
|
|
363
|
+
"pycharm.exe",
|
|
364
|
+
"pycharm64.exe",
|
|
365
|
+
"rubymine.exe",
|
|
366
|
+
"rubymine64.exe",
|
|
367
|
+
"webstorm.exe",
|
|
368
|
+
"webstorm64.exe",
|
|
369
|
+
"goland.exe",
|
|
370
|
+
"goland64.exe",
|
|
371
|
+
"rider.exe",
|
|
372
|
+
"rider64.exe",
|
|
373
|
+
"trae.exe"
|
|
374
|
+
];
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// ../node_modules/launch-editor/guess.js
|
|
379
|
+
var require_guess = __commonJS({
|
|
380
|
+
"../node_modules/launch-editor/guess.js"(exports, module) {
|
|
381
|
+
var path = __require("path");
|
|
382
|
+
var shellQuote = require_shell_quote();
|
|
383
|
+
var childProcess = __require("child_process");
|
|
384
|
+
var COMMON_EDITORS_MACOS = require_macos();
|
|
385
|
+
var COMMON_EDITORS_LINUX = require_linux();
|
|
386
|
+
var COMMON_EDITORS_WIN = require_windows();
|
|
387
|
+
module.exports = /* @__PURE__ */ __name(function guessEditor(specifiedEditor) {
|
|
388
|
+
if (specifiedEditor) {
|
|
389
|
+
return shellQuote.parse(specifiedEditor);
|
|
390
|
+
}
|
|
391
|
+
if (process.env.LAUNCH_EDITOR) {
|
|
392
|
+
return [process.env.LAUNCH_EDITOR];
|
|
393
|
+
}
|
|
394
|
+
if (process.versions.webcontainer) {
|
|
395
|
+
return [process.env.EDITOR || "code"];
|
|
396
|
+
}
|
|
397
|
+
try {
|
|
398
|
+
if (process.platform === "darwin") {
|
|
399
|
+
const output = childProcess.execSync("ps x -o comm=", {
|
|
400
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
401
|
+
}).toString();
|
|
402
|
+
const processNames = Object.keys(COMMON_EDITORS_MACOS);
|
|
403
|
+
const processList = output.split("\n");
|
|
404
|
+
for (let i = 0; i < processNames.length; i++) {
|
|
405
|
+
const processName = processNames[i];
|
|
406
|
+
if (processList.includes(processName)) {
|
|
407
|
+
return [COMMON_EDITORS_MACOS[processName]];
|
|
408
|
+
}
|
|
409
|
+
const processNameWithoutApplications = processName.replace("/Applications", "");
|
|
410
|
+
if (output.indexOf(processNameWithoutApplications) !== -1) {
|
|
411
|
+
if (processName !== COMMON_EDITORS_MACOS[processName]) {
|
|
412
|
+
return [COMMON_EDITORS_MACOS[processName]];
|
|
413
|
+
}
|
|
414
|
+
const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
|
|
415
|
+
if (runningProcess !== void 0) {
|
|
416
|
+
return [runningProcess];
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
} else if (process.platform === "win32") {
|
|
421
|
+
const output = childProcess.execSync(
|
|
422
|
+
'powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',
|
|
423
|
+
{
|
|
424
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
425
|
+
}
|
|
426
|
+
).toString();
|
|
427
|
+
const runningProcesses = output.split("\r\n");
|
|
428
|
+
for (let i = 0; i < runningProcesses.length; i++) {
|
|
429
|
+
const fullProcessPath = runningProcesses[i].trim();
|
|
430
|
+
const shortProcessName = path.basename(fullProcessPath);
|
|
431
|
+
if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) {
|
|
432
|
+
return [fullProcessPath];
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
} else if (process.platform === "linux") {
|
|
436
|
+
const output = childProcess.execSync("ps x --no-heading -o comm --sort=comm", {
|
|
437
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
438
|
+
}).toString();
|
|
439
|
+
const processNames = Object.keys(COMMON_EDITORS_LINUX);
|
|
440
|
+
for (let i = 0; i < processNames.length; i++) {
|
|
441
|
+
const processName = processNames[i];
|
|
442
|
+
if (output.indexOf(processName) !== -1) {
|
|
443
|
+
return [COMMON_EDITORS_LINUX[processName]];
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
} catch (ignoreError) {
|
|
448
|
+
}
|
|
449
|
+
if (process.env.VISUAL) {
|
|
450
|
+
return [process.env.VISUAL];
|
|
451
|
+
} else if (process.env.EDITOR) {
|
|
452
|
+
return [process.env.EDITOR];
|
|
453
|
+
}
|
|
454
|
+
return [null];
|
|
455
|
+
}, "guessEditor");
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// ../node_modules/launch-editor/get-args.js
|
|
460
|
+
var require_get_args = __commonJS({
|
|
461
|
+
"../node_modules/launch-editor/get-args.js"(exports, module) {
|
|
462
|
+
var path = __require("path");
|
|
463
|
+
module.exports = /* @__PURE__ */ __name(function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
|
|
464
|
+
const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, "");
|
|
465
|
+
switch (editorBasename) {
|
|
466
|
+
case "atom":
|
|
467
|
+
case "Atom":
|
|
468
|
+
case "Atom Beta":
|
|
469
|
+
case "subl":
|
|
470
|
+
case "sublime":
|
|
471
|
+
case "sublime_text":
|
|
472
|
+
case "wstorm":
|
|
473
|
+
case "charm":
|
|
474
|
+
case "zed":
|
|
475
|
+
return [`${fileName}:${lineNumber}:${columnNumber}`];
|
|
476
|
+
case "notepad++":
|
|
477
|
+
return ["-n" + lineNumber, "-c" + columnNumber, fileName];
|
|
478
|
+
case "vim":
|
|
479
|
+
case "mvim":
|
|
480
|
+
return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
|
|
481
|
+
case "joe":
|
|
482
|
+
case "gvim":
|
|
483
|
+
return [`+${lineNumber}`, fileName];
|
|
484
|
+
case "emacs":
|
|
485
|
+
case "emacsclient":
|
|
486
|
+
return [`+${lineNumber}:${columnNumber}`, fileName];
|
|
487
|
+
case "rmate":
|
|
488
|
+
case "mate":
|
|
489
|
+
case "mine":
|
|
490
|
+
return ["--line", lineNumber, fileName];
|
|
491
|
+
case "code":
|
|
492
|
+
case "Code":
|
|
493
|
+
case "code-insiders":
|
|
494
|
+
case "Code - Insiders":
|
|
495
|
+
case "codium":
|
|
496
|
+
case "trae":
|
|
497
|
+
case "cursor":
|
|
498
|
+
case "vscodium":
|
|
499
|
+
case "VSCodium":
|
|
500
|
+
return ["-r", "-g", `${fileName}:${lineNumber}:${columnNumber}`];
|
|
501
|
+
case "appcode":
|
|
502
|
+
case "clion":
|
|
503
|
+
case "clion64":
|
|
504
|
+
case "idea":
|
|
505
|
+
case "idea64":
|
|
506
|
+
case "phpstorm":
|
|
507
|
+
case "phpstorm64":
|
|
508
|
+
case "pycharm":
|
|
509
|
+
case "pycharm64":
|
|
510
|
+
case "rubymine":
|
|
511
|
+
case "rubymine64":
|
|
512
|
+
case "webstorm":
|
|
513
|
+
case "webstorm64":
|
|
514
|
+
case "goland":
|
|
515
|
+
case "goland64":
|
|
516
|
+
case "rider":
|
|
517
|
+
case "rider64":
|
|
518
|
+
return ["--line", lineNumber, "--column", columnNumber, fileName];
|
|
519
|
+
}
|
|
520
|
+
if (process.env.LAUNCH_EDITOR) {
|
|
521
|
+
return [fileName, lineNumber, columnNumber];
|
|
522
|
+
}
|
|
523
|
+
return [fileName];
|
|
524
|
+
}, "getArgumentsForPosition");
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// ../node_modules/launch-editor/index.js
|
|
529
|
+
var require_launch_editor = __commonJS({
|
|
530
|
+
"../node_modules/launch-editor/index.js"(exports, module) {
|
|
531
|
+
var fs = __require("fs");
|
|
532
|
+
var os = __require("os");
|
|
533
|
+
var path = __require("path");
|
|
534
|
+
var colors = require_picocolors();
|
|
535
|
+
var childProcess = __require("child_process");
|
|
536
|
+
var guessEditor = require_guess();
|
|
537
|
+
var getArgumentsForPosition = require_get_args();
|
|
538
|
+
function wrapErrorCallback(cb) {
|
|
539
|
+
return (fileName, errorMessage) => {
|
|
540
|
+
console.log();
|
|
541
|
+
console.log(
|
|
542
|
+
colors.red("Could not open " + path.basename(fileName) + " in the editor.")
|
|
543
|
+
);
|
|
544
|
+
if (errorMessage) {
|
|
545
|
+
if (errorMessage[errorMessage.length - 1] !== ".") {
|
|
546
|
+
errorMessage += ".";
|
|
547
|
+
}
|
|
548
|
+
console.log(
|
|
549
|
+
colors.red("The editor process exited with an error: " + errorMessage)
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
console.log();
|
|
553
|
+
if (cb) cb(fileName, errorMessage);
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
__name(wrapErrorCallback, "wrapErrorCallback");
|
|
557
|
+
function isTerminalEditor(editor) {
|
|
558
|
+
switch (editor) {
|
|
559
|
+
case "vim":
|
|
560
|
+
case "emacs":
|
|
561
|
+
case "nano":
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
564
|
+
return false;
|
|
565
|
+
}
|
|
566
|
+
__name(isTerminalEditor, "isTerminalEditor");
|
|
567
|
+
var positionRE = /:(\d+)(:(\d+))?$/;
|
|
568
|
+
function parseFile(file) {
|
|
569
|
+
if (file.startsWith("file://")) {
|
|
570
|
+
file = __require("url").fileURLToPath(file);
|
|
571
|
+
}
|
|
572
|
+
const fileName = file.replace(positionRE, "");
|
|
573
|
+
const match = file.match(positionRE);
|
|
574
|
+
const lineNumber = match && match[1];
|
|
575
|
+
const columnNumber = match && match[3];
|
|
576
|
+
return {
|
|
577
|
+
fileName,
|
|
578
|
+
lineNumber,
|
|
579
|
+
columnNumber
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
__name(parseFile, "parseFile");
|
|
583
|
+
var _childProcess = null;
|
|
584
|
+
function launchEditor(file, specifiedEditor, onErrorCallback) {
|
|
585
|
+
const parsed = parseFile(file);
|
|
586
|
+
let { fileName } = parsed;
|
|
587
|
+
const { lineNumber, columnNumber } = parsed;
|
|
588
|
+
if (!fs.existsSync(fileName)) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
if (typeof specifiedEditor === "function") {
|
|
592
|
+
onErrorCallback = specifiedEditor;
|
|
593
|
+
specifiedEditor = void 0;
|
|
594
|
+
}
|
|
595
|
+
onErrorCallback = wrapErrorCallback(onErrorCallback);
|
|
596
|
+
const [editor, ...args] = guessEditor(specifiedEditor);
|
|
597
|
+
if (!editor) {
|
|
598
|
+
onErrorCallback(fileName, null);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
if (process.platform === "linux" && fileName.startsWith("/mnt/") && /Microsoft/i.test(os.release())) {
|
|
602
|
+
fileName = path.relative("", fileName);
|
|
603
|
+
}
|
|
604
|
+
if (lineNumber) {
|
|
605
|
+
const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
|
|
606
|
+
args.push.apply(args, extraArgs);
|
|
607
|
+
} else {
|
|
608
|
+
args.push(fileName);
|
|
609
|
+
}
|
|
610
|
+
if (_childProcess && isTerminalEditor(editor)) {
|
|
611
|
+
_childProcess.kill("SIGKILL");
|
|
612
|
+
}
|
|
613
|
+
if (process.platform === "win32") {
|
|
614
|
+
let escapeCmdArgs2 = function(cmdArgs) {
|
|
615
|
+
return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
|
|
616
|
+
}, doubleQuoteIfNeeded2 = function(str) {
|
|
617
|
+
if (str.includes("^")) {
|
|
618
|
+
return `^"${str}^"`;
|
|
619
|
+
} else if (str.includes(" ")) {
|
|
620
|
+
return `"${str}"`;
|
|
621
|
+
}
|
|
622
|
+
return str;
|
|
623
|
+
};
|
|
624
|
+
var escapeCmdArgs = escapeCmdArgs2, doubleQuoteIfNeeded = doubleQuoteIfNeeded2;
|
|
625
|
+
__name(escapeCmdArgs2, "escapeCmdArgs");
|
|
626
|
+
__name(doubleQuoteIfNeeded2, "doubleQuoteIfNeeded");
|
|
627
|
+
const launchCommand = [editor, ...args.map(escapeCmdArgs2)].map(doubleQuoteIfNeeded2).join(" ");
|
|
628
|
+
_childProcess = childProcess.exec(launchCommand, {
|
|
629
|
+
stdio: "inherit",
|
|
630
|
+
shell: true
|
|
631
|
+
});
|
|
632
|
+
} else {
|
|
633
|
+
_childProcess = childProcess.spawn(editor, args, { stdio: "inherit" });
|
|
634
|
+
}
|
|
635
|
+
_childProcess.on("exit", function(errorCode) {
|
|
636
|
+
_childProcess = null;
|
|
637
|
+
if (errorCode) {
|
|
638
|
+
onErrorCallback(fileName, "(code " + errorCode + ")");
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
_childProcess.on("error", function(error) {
|
|
642
|
+
let { code, message } = error;
|
|
643
|
+
if ("ENOENT" === code) {
|
|
644
|
+
message = `${message} ('${editor}' command does not exist in 'PATH')`;
|
|
645
|
+
}
|
|
646
|
+
onErrorCallback(fileName, message);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
__name(launchEditor, "launchEditor");
|
|
650
|
+
module.exports = launchEditor;
|
|
651
|
+
}
|
|
652
|
+
});
|
|
38
653
|
|
|
39
654
|
// src/core-server/presets/common-preset.ts
|
|
40
655
|
import { existsSync as existsSync3 } from "node:fs";
|
|
@@ -53,7 +668,7 @@ import {
|
|
|
53
668
|
} from "storybook/internal/common";
|
|
54
669
|
import { readCsf as readCsf2 } from "storybook/internal/csf-tools";
|
|
55
670
|
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
56
|
-
import { telemetry as
|
|
671
|
+
import { telemetry as telemetry6 } from "storybook/internal/telemetry";
|
|
57
672
|
var import_ts_dedent4 = __toESM(require_dist(), 1);
|
|
58
673
|
|
|
59
674
|
// src/core-server/server-channel/create-new-story-channel.ts
|
|
@@ -84,7 +699,7 @@ var import_ts_dedent = __toESM(require_dist(), 1);
|
|
|
84
699
|
|
|
85
700
|
// src/core-server/utils/get-component-variable-name.ts
|
|
86
701
|
var getComponentVariableName = /* @__PURE__ */ __name(async (name) => {
|
|
87
|
-
const camelCase = await import("../../_node-chunks/camelcase-
|
|
702
|
+
const camelCase = await import("../../_node-chunks/camelcase-RENSEFK6.js");
|
|
88
703
|
const camelCased = camelCase.default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: true });
|
|
89
704
|
const sanitized = camelCased.replace(/[^a-zA-Z_$]+/, "");
|
|
90
705
|
return sanitized;
|
|
@@ -431,7 +1046,7 @@ async function searchFiles({
|
|
|
431
1046
|
ignoredFiles = IGNORED_FILES,
|
|
432
1047
|
fileExtensions = FILE_EXTENSIONS
|
|
433
1048
|
}) {
|
|
434
|
-
const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-
|
|
1049
|
+
const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-3TWPXGQS.js");
|
|
435
1050
|
const hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd });
|
|
436
1051
|
const hasFileExtensionRegex = /(\.[a-z]+)$/i;
|
|
437
1052
|
const searchQueryHasExtension = hasFileExtensionRegex.test(searchQuery);
|
|
@@ -532,6 +1147,52 @@ ${e?.message}`
|
|
|
532
1147
|
}
|
|
533
1148
|
__name(initFileSearchChannel, "initFileSearchChannel");
|
|
534
1149
|
|
|
1150
|
+
// src/core-server/server-channel/open-in-editor-channel.ts
|
|
1151
|
+
var import_launch_editor = __toESM(require_launch_editor(), 1);
|
|
1152
|
+
import { OPEN_IN_EDITOR_REQUEST, OPEN_IN_EDITOR_RESPONSE } from "storybook/internal/core-events";
|
|
1153
|
+
import { telemetry as telemetry3 } from "storybook/internal/telemetry";
|
|
1154
|
+
async function initOpenInEditorChannel(channel, _options, coreOptions) {
|
|
1155
|
+
channel.on(OPEN_IN_EDITOR_REQUEST, async (payload) => {
|
|
1156
|
+
const sendTelemetry = /* @__PURE__ */ __name((data) => {
|
|
1157
|
+
if (!coreOptions.disableTelemetry) {
|
|
1158
|
+
telemetry3("open-in-editor", data);
|
|
1159
|
+
}
|
|
1160
|
+
}, "sendTelemetry");
|
|
1161
|
+
try {
|
|
1162
|
+
const { file: targetFile, line, column } = payload;
|
|
1163
|
+
if (!targetFile) {
|
|
1164
|
+
throw new Error("No file was provided to open");
|
|
1165
|
+
}
|
|
1166
|
+
const location = typeof line === "number" ? `${targetFile}:${line}${typeof column === "number" ? `:${column}` : ""}` : targetFile;
|
|
1167
|
+
await new Promise((resolve, reject) => {
|
|
1168
|
+
(0, import_launch_editor.default)(location, void 0, (_fileName, errorMessage) => {
|
|
1169
|
+
if (errorMessage) {
|
|
1170
|
+
reject(new Error(errorMessage));
|
|
1171
|
+
} else {
|
|
1172
|
+
resolve();
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
});
|
|
1176
|
+
channel.emit(OPEN_IN_EDITOR_RESPONSE, {
|
|
1177
|
+
file: targetFile,
|
|
1178
|
+
line,
|
|
1179
|
+
column,
|
|
1180
|
+
error: null
|
|
1181
|
+
});
|
|
1182
|
+
sendTelemetry({ success: true });
|
|
1183
|
+
} catch (e) {
|
|
1184
|
+
const error = e?.message || "Failed to open in editor";
|
|
1185
|
+
channel.emit(OPEN_IN_EDITOR_RESPONSE, {
|
|
1186
|
+
error,
|
|
1187
|
+
...payload
|
|
1188
|
+
});
|
|
1189
|
+
sendTelemetry({ success: false, error });
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
return channel;
|
|
1193
|
+
}
|
|
1194
|
+
__name(initOpenInEditorChannel, "initOpenInEditorChannel");
|
|
1195
|
+
|
|
535
1196
|
// src/core-server/utils/constants.ts
|
|
536
1197
|
var defaultStaticDirs = [
|
|
537
1198
|
{
|
|
@@ -553,7 +1214,7 @@ import {
|
|
|
553
1214
|
import { storyNameFromExport, toId } from "storybook/internal/csf";
|
|
554
1215
|
import { printCsf, readCsf } from "storybook/internal/csf-tools";
|
|
555
1216
|
import { logger } from "storybook/internal/node-logger";
|
|
556
|
-
import { isExampleStoryId, telemetry as
|
|
1217
|
+
import { isExampleStoryId, telemetry as telemetry4 } from "storybook/internal/telemetry";
|
|
557
1218
|
|
|
558
1219
|
// src/core-server/utils/save-story/duplicate-story-with-new-name.ts
|
|
559
1220
|
import { types as t2, traverse } from "storybook/internal/babel";
|
|
@@ -832,7 +1493,7 @@ function initializeSaveStory(channel, options, coreConfig) {
|
|
|
832
1493
|
});
|
|
833
1494
|
const isCLIExample = isExampleStoryId(newStoryId ?? csfId);
|
|
834
1495
|
if (!coreConfig.disableTelemetry && !isCLIExample) {
|
|
835
|
-
await
|
|
1496
|
+
await telemetry4("save-story", {
|
|
836
1497
|
action: name ? "createStory" : "updateStory",
|
|
837
1498
|
success: true
|
|
838
1499
|
});
|
|
@@ -848,7 +1509,7 @@ function initializeSaveStory(channel, options, coreConfig) {
|
|
|
848
1509
|
${error.stack || error.message || error.toString()}`
|
|
849
1510
|
);
|
|
850
1511
|
if (!coreConfig.disableTelemetry && !(error instanceof SaveStoryError)) {
|
|
851
|
-
await
|
|
1512
|
+
await telemetry4("save-story", {
|
|
852
1513
|
action: name ? "createStory" : "updateStory",
|
|
853
1514
|
success: false,
|
|
854
1515
|
error
|
|
@@ -871,7 +1532,7 @@ import {
|
|
|
871
1532
|
} from "storybook/internal/core-events";
|
|
872
1533
|
import { printConfig, readConfig } from "storybook/internal/csf-tools";
|
|
873
1534
|
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
874
|
-
import { telemetry as
|
|
1535
|
+
import { telemetry as telemetry5 } from "storybook/internal/telemetry";
|
|
875
1536
|
var WHATS_NEW_CACHE = "whats-new-cache";
|
|
876
1537
|
var WHATS_NEW_URL = "https://storybook.js.org/whats-new/v1";
|
|
877
1538
|
function initializeWhatsNew(channel, options, coreOptions) {
|
|
@@ -924,7 +1585,7 @@ function initializeWhatsNew(channel, options, coreOptions) {
|
|
|
924
1585
|
main.setFieldValue(["core", "disableWhatsNewNotifications"], disableWhatsNewNotifications);
|
|
925
1586
|
await writeFile3(mainPath, printConfig(main).code);
|
|
926
1587
|
if (isTelemetryEnabled) {
|
|
927
|
-
await
|
|
1588
|
+
await telemetry5("core-config", { disableWhatsNewNotifications });
|
|
928
1589
|
}
|
|
929
1590
|
} catch (error) {
|
|
930
1591
|
invariant(error instanceof Error);
|
|
@@ -1052,7 +1713,7 @@ var experimental_serverAPI = /* @__PURE__ */ __name((extension, options) => {
|
|
|
1052
1713
|
});
|
|
1053
1714
|
if (!options.disableTelemetry) {
|
|
1054
1715
|
removeAddon = /* @__PURE__ */ __name(async (id, opts) => {
|
|
1055
|
-
await
|
|
1716
|
+
await telemetry6("remove", { addon: id, source: "api" });
|
|
1056
1717
|
return removeAddonBase(id, { ...opts, packageManager });
|
|
1057
1718
|
}, "removeAddon");
|
|
1058
1719
|
}
|
|
@@ -1107,6 +1768,7 @@ var experimental_serverChannel = /* @__PURE__ */ __name(async (channel, options)
|
|
|
1107
1768
|
initializeSaveStory(channel, options, coreOptions);
|
|
1108
1769
|
initFileSearchChannel(channel, options, coreOptions);
|
|
1109
1770
|
initCreateNewStoryChannel(channel, options, coreOptions);
|
|
1771
|
+
initOpenInEditorChannel(channel, options, coreOptions);
|
|
1110
1772
|
return channel;
|
|
1111
1773
|
}, "experimental_serverChannel");
|
|
1112
1774
|
var resolvedReact = /* @__PURE__ */ __name(async (existing) => {
|
|
@@ -1120,14 +1782,6 @@ var resolvedReact = /* @__PURE__ */ __name(async (existing) => {
|
|
|
1120
1782
|
return existing;
|
|
1121
1783
|
}
|
|
1122
1784
|
}, "resolvedReact");
|
|
1123
|
-
var tags = /* @__PURE__ */ __name(async (existing) => {
|
|
1124
|
-
return {
|
|
1125
|
-
...existing,
|
|
1126
|
-
"dev-only": { excludeFromDocsStories: true },
|
|
1127
|
-
"docs-only": { excludeFromSidebar: true },
|
|
1128
|
-
"test-only": { excludeFromSidebar: true, excludeFromDocsStories: true }
|
|
1129
|
-
};
|
|
1130
|
-
}, "tags");
|
|
1131
1785
|
var managerEntries = /* @__PURE__ */ __name(async (existing) => {
|
|
1132
1786
|
return [
|
|
1133
1787
|
join(resolvePackageDir("storybook"), "dist/core-server/presets/common-manager.js"),
|
|
@@ -1139,8 +1793,8 @@ var viteFinal = /* @__PURE__ */ __name(async (existing, options) => {
|
|
|
1139
1793
|
if (!previewConfigPath) {
|
|
1140
1794
|
return existing;
|
|
1141
1795
|
}
|
|
1142
|
-
const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-
|
|
1143
|
-
const { viteMockPlugin } = await import("../../_node-chunks/plugin-
|
|
1796
|
+
const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-ESAYNJ5V.js");
|
|
1797
|
+
const { viteMockPlugin } = await import("../../_node-chunks/plugin-GDMP3JPR.js");
|
|
1144
1798
|
const coreOptions = await options.presets.apply("core");
|
|
1145
1799
|
return {
|
|
1146
1800
|
...existing,
|
|
@@ -1158,8 +1812,8 @@ var webpackFinal = /* @__PURE__ */ __name(async (config, options) => {
|
|
|
1158
1812
|
if (!previewConfigPath) {
|
|
1159
1813
|
return config;
|
|
1160
1814
|
}
|
|
1161
|
-
const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-
|
|
1162
|
-
const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-
|
|
1815
|
+
const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-AWGZ65AQ.js");
|
|
1816
|
+
const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-5AKTLYIV.js");
|
|
1163
1817
|
config.plugins = config.plugins || [];
|
|
1164
1818
|
config.module.rules.push({
|
|
1165
1819
|
test: /preview\.(t|j)sx?$/,
|
|
@@ -1193,7 +1847,6 @@ export {
|
|
|
1193
1847
|
previewHead,
|
|
1194
1848
|
resolvedReact,
|
|
1195
1849
|
staticDirs,
|
|
1196
|
-
tags,
|
|
1197
1850
|
title,
|
|
1198
1851
|
typescript,
|
|
1199
1852
|
viteFinal,
|