devframe 0.7.14 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/build.d.mts +8 -1
- package/dist/adapters/build.mjs +4 -2
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +1 -1
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +1 -1
- package/dist/adapters/dev.d.mts +18 -3
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +5 -3
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/{build-server-CBAxmnC8.mjs → build-server-C7vTKjiQ.mjs} +16 -5
- package/dist/{cac-Drj5sjnU.mjs → cac-CPaOy3LD.mjs} +2 -2
- package/dist/client/index.d.mts +42 -6
- package/dist/client/index.mjs +179 -92
- package/dist/constants.d.mts +7 -1
- package/dist/constants.mjs +7 -1
- package/dist/{context-FonV8enL.d.mts → context-CzqPrJSz.d.mts} +1 -1
- package/dist/{context-C1Gr2BGB.mjs → context-DY72brRI.mjs} +1 -1
- package/dist/{dev-BdegDQKt.mjs → dev-BCeaQuGE.mjs} +28 -5
- package/dist/{devframe-DfzYvlKI.d.mts → devframe-Ckhf3kFw.d.mts} +16 -1
- package/dist/helpers/vite.d.mts +14 -1
- package/dist/helpers/vite.mjs +7 -4
- package/dist/{host-h3-SjwRTwkE.mjs → host-h3-CgOetlNE.mjs} +1 -1
- package/dist/{http-BaCZYhIR.mjs → http-_pPbryTQ.mjs} +1 -1
- package/dist/{index-CxpC1ItQ.d.mts → index-8dndvIxR.d.mts} +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +1 -1
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.mjs +3 -3
- package/dist/recipes/common-rpc-functions.d.mts +118 -0
- package/dist/recipes/common-rpc-functions.mjs +105 -0
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +1 -1
- package/dist/recipes/open-helpers.d.mts +3 -101
- package/dist/recipes/open-helpers.mjs +3 -63
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{server-Bf27EWpv.d.mts → server-B0wiP_Oi.d.mts} +2 -2
- package/dist/{server-BFsuZI9e.mjs → server-DykHCza_.mjs} +2 -2
- package/dist/{storage-D_Xy9v1l.mjs → storage-gEnj9ASQ.mjs} +4 -0
- package/dist/{structured-clone-XpHLZ8nr.mjs → structured-clone-CbAV5rFI.mjs} +32 -3
- package/dist/{structured-clone-CeZOHvkd.mjs → structured-clone-CgtQ61SA.mjs} +32 -3
- package/dist/types/index.d.mts +1 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/launch-editor.mjs +745 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.mjs +1 -1
- package/package.json +5 -31
- package/skills/devframe/SKILL.md +1 -1
- package/dist/launch-editor-C_xuzLnF.mjs +0 -746
|
@@ -1,746 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
value: mod,
|
|
22
|
-
enumerable: true
|
|
23
|
-
}) : target, mod));
|
|
24
|
-
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
27
|
-
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28
|
-
let p = process || {};
|
|
29
|
-
let argv = p.argv || [];
|
|
30
|
-
let env = p.env || {};
|
|
31
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
32
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
33
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
34
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
35
|
-
};
|
|
36
|
-
let replaceClose = (string, close, replace, index) => {
|
|
37
|
-
let result = "", cursor = 0;
|
|
38
|
-
do {
|
|
39
|
-
result += string.substring(cursor, index) + replace;
|
|
40
|
-
cursor = index + close.length;
|
|
41
|
-
index = string.indexOf(close, cursor);
|
|
42
|
-
} while (~index);
|
|
43
|
-
return result + string.substring(cursor);
|
|
44
|
-
};
|
|
45
|
-
let createColors = (enabled = isColorSupported) => {
|
|
46
|
-
let f = enabled ? formatter : () => String;
|
|
47
|
-
return {
|
|
48
|
-
isColorSupported: enabled,
|
|
49
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
50
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
51
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
52
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
53
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
54
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
55
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
56
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
57
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
58
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
59
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
60
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
61
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
62
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
63
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
64
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
65
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
66
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
67
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
68
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
69
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
70
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
71
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
72
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
73
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
74
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
75
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
76
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
77
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
78
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
79
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
80
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
81
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
82
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
83
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
84
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
85
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
86
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
87
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
88
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
89
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
module.exports = createColors();
|
|
93
|
-
module.exports.createColors = createColors;
|
|
94
|
-
}));
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/quote.js
|
|
97
|
-
var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
98
|
-
/** @import { ControlOperator } from './parse' */
|
|
99
|
-
/** @type {ControlOperator['op'][]} */
|
|
100
|
-
var OPS = [
|
|
101
|
-
"||",
|
|
102
|
-
"&&",
|
|
103
|
-
";;",
|
|
104
|
-
"|&",
|
|
105
|
-
"<(",
|
|
106
|
-
"<<<",
|
|
107
|
-
">>",
|
|
108
|
-
">&",
|
|
109
|
-
"<&",
|
|
110
|
-
"&",
|
|
111
|
-
";",
|
|
112
|
-
"(",
|
|
113
|
-
")",
|
|
114
|
-
"|",
|
|
115
|
-
"<",
|
|
116
|
-
">"
|
|
117
|
-
];
|
|
118
|
-
var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
|
|
119
|
-
var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
|
|
120
|
-
/** @type {typeof import('./quote')} */
|
|
121
|
-
module.exports = function quote(xs) {
|
|
122
|
-
return xs.map(function(s) {
|
|
123
|
-
if (s === "") return "''";
|
|
124
|
-
if (s && typeof s === "object") {
|
|
125
|
-
if ("op" in s && s.op === "glob") {
|
|
126
|
-
if (typeof s.pattern !== "string") throw new TypeError("glob token requires a string `pattern`");
|
|
127
|
-
if (LINE_TERMINATORS.test(s.pattern)) throw new TypeError("glob `pattern` must not contain line terminators");
|
|
128
|
-
return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
|
|
129
|
-
}
|
|
130
|
-
if ("op" in s && typeof s.op === "string") {
|
|
131
|
-
if (OPS.indexOf(s.op) < 0) throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
|
|
132
|
-
return s.op.replace(/[\s\S]/g, "\\$&");
|
|
133
|
-
}
|
|
134
|
-
if ("comment" in s && typeof s.comment === "string") {
|
|
135
|
-
if (LINE_TERMINATORS.test(s.comment)) throw new TypeError("`comment` must not contain line terminators");
|
|
136
|
-
return "#" + s.comment;
|
|
137
|
-
}
|
|
138
|
-
throw new TypeError("unrecognized object token shape");
|
|
139
|
-
}
|
|
140
|
-
if (/["\s\\]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
|
141
|
-
if (/["'\s]/.test(s)) return "\"" + s.replace(/(["\\$`!])/g, "\\$1") + "\"";
|
|
142
|
-
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g, "$1\\$2");
|
|
143
|
-
}).join(" ");
|
|
144
|
-
};
|
|
145
|
-
}));
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/parse.js
|
|
148
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
149
|
-
/**
|
|
150
|
-
* @import {
|
|
151
|
-
* ControlOperator,
|
|
152
|
-
* Env,
|
|
153
|
-
* GlobPattern,
|
|
154
|
-
* ParseEntry,
|
|
155
|
-
* } from './parse' */
|
|
156
|
-
var CONTROL = "(?:" + [
|
|
157
|
-
"\\|\\|",
|
|
158
|
-
"\\&\\&",
|
|
159
|
-
";;",
|
|
160
|
-
"\\|\\&",
|
|
161
|
-
"\\<\\(",
|
|
162
|
-
"\\<\\<\\<",
|
|
163
|
-
">>",
|
|
164
|
-
">\\&",
|
|
165
|
-
"<\\&",
|
|
166
|
-
"[&;()|<>]"
|
|
167
|
-
].join("|") + ")";
|
|
168
|
-
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
169
|
-
var META = "|&;()<> \\t";
|
|
170
|
-
var SINGLE_QUOTE = "'([^']*?)'";
|
|
171
|
-
var DOUBLE_QUOTE = "\"((\\\\\"|[^\"])*?)\"";
|
|
172
|
-
var hash = /^#$/;
|
|
173
|
-
var SQ = "'";
|
|
174
|
-
var DQ = "\"";
|
|
175
|
-
var DS = "$";
|
|
176
|
-
var TOKEN = "";
|
|
177
|
-
var mult = 4294967296;
|
|
178
|
-
for (var i = 0; i < 4; i++) TOKEN += (mult * Math.random()).toString(16);
|
|
179
|
-
var startsWithToken = new RegExp("^" + TOKEN);
|
|
180
|
-
/**
|
|
181
|
-
* @param {string} s
|
|
182
|
-
* @param {RegExp} r
|
|
183
|
-
*/
|
|
184
|
-
function matchAll(s, r) {
|
|
185
|
-
var origIndex = r.lastIndex;
|
|
186
|
-
var matches = [];
|
|
187
|
-
var matchObj;
|
|
188
|
-
while (matchObj = r.exec(s)) {
|
|
189
|
-
matches[matches.length] = matchObj;
|
|
190
|
-
if (r.lastIndex === matchObj.index) r.lastIndex += 1;
|
|
191
|
-
}
|
|
192
|
-
r.lastIndex = origIndex;
|
|
193
|
-
return matches;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* @param {Env} env
|
|
197
|
-
* @param {string} pre
|
|
198
|
-
* @param {string} key
|
|
199
|
-
*/
|
|
200
|
-
function getVar(env, pre, key) {
|
|
201
|
-
var r = typeof env === "function" ? env(key) : env[key];
|
|
202
|
-
if (typeof r === "undefined" && key != "") r = "";
|
|
203
|
-
else if (typeof r === "undefined") r = "$";
|
|
204
|
-
if (typeof r === "object") return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
205
|
-
return pre + r;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* @param {string} string
|
|
209
|
-
* @param {Env} [env]
|
|
210
|
-
* @param {{ escape?: string, splitUnquoted?: boolean | string }} [opts]
|
|
211
|
-
* @returns {ParseEntry[]}
|
|
212
|
-
*/
|
|
213
|
-
function parseInternal(string, env, opts) {
|
|
214
|
-
if (!opts) opts = {};
|
|
215
|
-
var BS = opts.escape || "\\";
|
|
216
|
-
var ifs = opts.splitUnquoted === true ? " \n" : typeof opts.splitUnquoted === "string" ? opts.splitUnquoted : "";
|
|
217
|
-
var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
|
|
218
|
-
var matches = matchAll(string, new RegExp(["(" + CONTROL + ")", "(" + BAREWORD + "|" + DOUBLE_QUOTE + "|" + SINGLE_QUOTE + ")+"].join("|"), "g"));
|
|
219
|
-
if (matches.length === 0) return [];
|
|
220
|
-
if (!env) env = {};
|
|
221
|
-
var commented = false;
|
|
222
|
-
return matches.map(function(match) {
|
|
223
|
-
var s = match[0];
|
|
224
|
-
if (!s || commented) return;
|
|
225
|
-
if (controlRE.test(s)) return { op: s };
|
|
226
|
-
/** @type {string | boolean} */
|
|
227
|
-
var quote = false;
|
|
228
|
-
var esc = false;
|
|
229
|
-
var out = "";
|
|
230
|
-
/** @type {string[]} */
|
|
231
|
-
var words = [];
|
|
232
|
-
var sawQuote = false;
|
|
233
|
-
/** @type {number | null} */
|
|
234
|
-
var pendingNw = null;
|
|
235
|
-
var isGlob = false;
|
|
236
|
-
/** @type {number} */
|
|
237
|
-
var i;
|
|
238
|
-
function parseEnvVar() {
|
|
239
|
-
i += 1;
|
|
240
|
-
/** @type {number | RegExpMatchArray | null} */
|
|
241
|
-
var varend;
|
|
242
|
-
/** @type {string} */
|
|
243
|
-
var varname;
|
|
244
|
-
var char = s.charAt(i);
|
|
245
|
-
if (char === "{") {
|
|
246
|
-
i += 1;
|
|
247
|
-
if (s.charAt(i) === "}") throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
|
|
248
|
-
var depth = 1;
|
|
249
|
-
varend = i;
|
|
250
|
-
while (depth > 0 && varend < s.length) {
|
|
251
|
-
if (s.charAt(varend) === "{" && s.charAt(varend - 1) === "$") depth += 1;
|
|
252
|
-
else if (s.charAt(varend) === "}") depth -= 1;
|
|
253
|
-
varend += 1;
|
|
254
|
-
}
|
|
255
|
-
if (depth !== 0) throw new Error("Bad substitution: " + s.slice(i));
|
|
256
|
-
varend -= 1;
|
|
257
|
-
varname = s.slice(i, varend);
|
|
258
|
-
i = varend;
|
|
259
|
-
} else if (/[*@#?$!_-]/.test(char)) {
|
|
260
|
-
varname = char;
|
|
261
|
-
i += 1;
|
|
262
|
-
} else {
|
|
263
|
-
var slicedFromI = s.slice(i);
|
|
264
|
-
varend = slicedFromI.match(/[^\w\d_]/);
|
|
265
|
-
if (!varend) {
|
|
266
|
-
varname = slicedFromI;
|
|
267
|
-
i = s.length;
|
|
268
|
-
} else {
|
|
269
|
-
varname = slicedFromI.slice(0, varend.index);
|
|
270
|
-
i += varend.index - 1;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return getVar(env, "", varname);
|
|
274
|
-
}
|
|
275
|
-
function flushRun() {
|
|
276
|
-
if (pendingNw === null) return;
|
|
277
|
-
if (pendingNw === 0) {
|
|
278
|
-
if (out !== "") {
|
|
279
|
-
words[words.length] = out;
|
|
280
|
-
out = "";
|
|
281
|
-
}
|
|
282
|
-
} else {
|
|
283
|
-
words[words.length] = out;
|
|
284
|
-
out = "";
|
|
285
|
-
for (var fe = 1; fe < pendingNw; fe += 1) words[words.length] = "";
|
|
286
|
-
}
|
|
287
|
-
pendingNw = null;
|
|
288
|
-
}
|
|
289
|
-
for (i = 0; i < s.length; i++) {
|
|
290
|
-
var c = s.charAt(i);
|
|
291
|
-
if (ifs && c !== DS) flushRun();
|
|
292
|
-
isGlob = isGlob || !quote && (c === "*" || c === "?");
|
|
293
|
-
if (esc) {
|
|
294
|
-
out += c;
|
|
295
|
-
esc = false;
|
|
296
|
-
} else if (quote) if (c === quote) quote = false;
|
|
297
|
-
else if (quote == SQ) out += c;
|
|
298
|
-
else if (c === BS) {
|
|
299
|
-
i += 1;
|
|
300
|
-
c = s.charAt(i);
|
|
301
|
-
if (c === DQ || c === BS || c === DS) out += c;
|
|
302
|
-
else out += BS + c;
|
|
303
|
-
} else if (c === DS) out += parseEnvVar();
|
|
304
|
-
else out += c;
|
|
305
|
-
else if (c === DQ || c === SQ) {
|
|
306
|
-
quote = c;
|
|
307
|
-
sawQuote = true;
|
|
308
|
-
} else if (controlRE.test(c)) return { op: s };
|
|
309
|
-
else if (hash.test(c)) {
|
|
310
|
-
commented = true;
|
|
311
|
-
var commentObj = { comment: string.slice(match.index + i + 1) };
|
|
312
|
-
if (out.length) return [out, commentObj];
|
|
313
|
-
return [commentObj];
|
|
314
|
-
} else if (c === BS) esc = true;
|
|
315
|
-
else if (c === DS) {
|
|
316
|
-
var value = parseEnvVar();
|
|
317
|
-
if (!ifs) out += value;
|
|
318
|
-
else for (var vi = 0; vi < value.length; vi += 1) {
|
|
319
|
-
var vc = value.charAt(vi);
|
|
320
|
-
if (ifs.indexOf(vc) < 0) {
|
|
321
|
-
flushRun();
|
|
322
|
-
out += vc;
|
|
323
|
-
} else if (pendingNw === null) pendingNw = vc === " " || vc === " " || vc === "\n" ? 0 : 1;
|
|
324
|
-
else if (vc !== " " && vc !== " " && vc !== "\n") pendingNw += 1;
|
|
325
|
-
}
|
|
326
|
-
} else out += c;
|
|
327
|
-
}
|
|
328
|
-
if (isGlob) return {
|
|
329
|
-
op: "glob",
|
|
330
|
-
pattern: out
|
|
331
|
-
};
|
|
332
|
-
if (ifs) {
|
|
333
|
-
if (pendingNw !== null && pendingNw > 0) {
|
|
334
|
-
words[words.length] = out;
|
|
335
|
-
out = "";
|
|
336
|
-
for (var te = 1; te < pendingNw; te += 1) words[words.length] = "";
|
|
337
|
-
}
|
|
338
|
-
if (out !== "" || sawQuote && words.length === 0) words[words.length] = out;
|
|
339
|
-
return words;
|
|
340
|
-
}
|
|
341
|
-
return out;
|
|
342
|
-
}).reduce(function(prev, arg) {
|
|
343
|
-
if (typeof arg === "undefined") return prev;
|
|
344
|
-
/** @type {ParseEntry[]} */ [].concat(arg).forEach(function(entry) {
|
|
345
|
-
prev[prev.length] = entry;
|
|
346
|
-
});
|
|
347
|
-
return prev;
|
|
348
|
-
}, []);
|
|
349
|
-
}
|
|
350
|
-
/** @type {typeof import('./parse')} */
|
|
351
|
-
module.exports = function parse(s, env, opts) {
|
|
352
|
-
var mapped = parseInternal(s, env, opts);
|
|
353
|
-
if (typeof env !== "function") return mapped;
|
|
354
|
-
return mapped.reduce(function(acc, s) {
|
|
355
|
-
if (typeof s === "object") {
|
|
356
|
-
acc[acc.length] = s;
|
|
357
|
-
return acc;
|
|
358
|
-
}
|
|
359
|
-
var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
360
|
-
if (xs.length === 1) {
|
|
361
|
-
acc[acc.length] = xs[0];
|
|
362
|
-
return acc;
|
|
363
|
-
}
|
|
364
|
-
xs.filter(Boolean).forEach(function(x) {
|
|
365
|
-
acc[acc.length] = startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
|
|
366
|
-
});
|
|
367
|
-
return acc;
|
|
368
|
-
}, []);
|
|
369
|
-
};
|
|
370
|
-
}));
|
|
371
|
-
//#endregion
|
|
372
|
-
//#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/index.js
|
|
373
|
-
var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
374
|
-
exports.quote = require_quote();
|
|
375
|
-
exports.parse = require_parse();
|
|
376
|
-
}));
|
|
377
|
-
//#endregion
|
|
378
|
-
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js
|
|
379
|
-
var require_macos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
380
|
-
module.exports = {
|
|
381
|
-
"/Applications/Atom.app/Contents/MacOS/Atom": "atom",
|
|
382
|
-
"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta": "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
|
|
383
|
-
"/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
|
|
384
|
-
"/Applications/Sublime Text.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
|
|
385
|
-
"/Applications/Sublime Text.app/Contents/MacOS/sublime_text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
|
|
386
|
-
"/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2": "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
|
|
387
|
-
"/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
|
|
388
|
-
"/Applications/Visual Studio Code.app/Contents/MacOS/Code": "code",
|
|
389
|
-
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
|
|
390
|
-
"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders": "code-insiders",
|
|
391
|
-
"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron": "code-insiders",
|
|
392
|
-
"/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
|
|
393
|
-
"/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
|
|
394
|
-
"/Applications/Trae.app/Contents/MacOS/Electron": "trae",
|
|
395
|
-
"/Applications/Antigravity.app/Contents/MacOS/Electron": "antigravity",
|
|
396
|
-
"/Applications/AppCode.app/Contents/MacOS/appcode": "/Applications/AppCode.app/Contents/MacOS/appcode",
|
|
397
|
-
"/Applications/CLion.app/Contents/MacOS/clion": "/Applications/CLion.app/Contents/MacOS/clion",
|
|
398
|
-
"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
|
|
399
|
-
"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
|
|
400
|
-
"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
|
|
401
|
-
"/Applications/PhpStorm.app/Contents/MacOS/phpstorm": "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
|
|
402
|
-
"/Applications/PyCharm.app/Contents/MacOS/pycharm": "/Applications/PyCharm.app/Contents/MacOS/pycharm",
|
|
403
|
-
"/Applications/PyCharm CE.app/Contents/MacOS/pycharm": "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
|
|
404
|
-
"/Applications/RubyMine.app/Contents/MacOS/rubymine": "/Applications/RubyMine.app/Contents/MacOS/rubymine",
|
|
405
|
-
"/Applications/WebStorm.app/Contents/MacOS/webstorm": "/Applications/WebStorm.app/Contents/MacOS/webstorm",
|
|
406
|
-
"/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
|
|
407
|
-
"/Applications/GoLand.app/Contents/MacOS/goland": "/Applications/GoLand.app/Contents/MacOS/goland",
|
|
408
|
-
"/Applications/Rider.app/Contents/MacOS/rider": "/Applications/Rider.app/Contents/MacOS/rider",
|
|
409
|
-
"/Applications/Zed.app/Contents/MacOS/zed": "zed"
|
|
410
|
-
};
|
|
411
|
-
}));
|
|
412
|
-
//#endregion
|
|
413
|
-
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js
|
|
414
|
-
var require_linux = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
415
|
-
module.exports = {
|
|
416
|
-
atom: "atom",
|
|
417
|
-
Brackets: "brackets",
|
|
418
|
-
"code-insiders": "code-insiders",
|
|
419
|
-
code: "code",
|
|
420
|
-
vscodium: "vscodium",
|
|
421
|
-
codium: "codium",
|
|
422
|
-
cursor: "cursor",
|
|
423
|
-
trae: "trae",
|
|
424
|
-
antigravity: "antigravity",
|
|
425
|
-
emacs: "emacs",
|
|
426
|
-
gvim: "gvim",
|
|
427
|
-
idea: "idea",
|
|
428
|
-
"idea.sh": "idea",
|
|
429
|
-
phpstorm: "phpstorm",
|
|
430
|
-
"phpstorm.sh": "phpstorm",
|
|
431
|
-
pycharm: "pycharm",
|
|
432
|
-
"pycharm.sh": "pycharm",
|
|
433
|
-
rubymine: "rubymine",
|
|
434
|
-
"rubymine.sh": "rubymine",
|
|
435
|
-
sublime_text: "subl",
|
|
436
|
-
vim: "vim",
|
|
437
|
-
webstorm: "webstorm",
|
|
438
|
-
"webstorm.sh": "webstorm",
|
|
439
|
-
goland: "goland",
|
|
440
|
-
"goland.sh": "goland",
|
|
441
|
-
rider: "rider",
|
|
442
|
-
"rider.sh": "rider",
|
|
443
|
-
zed: "zed"
|
|
444
|
-
};
|
|
445
|
-
}));
|
|
446
|
-
//#endregion
|
|
447
|
-
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js
|
|
448
|
-
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
449
|
-
module.exports = [
|
|
450
|
-
"Brackets.exe",
|
|
451
|
-
"Code.exe",
|
|
452
|
-
"Code - Insiders.exe",
|
|
453
|
-
"VSCodium.exe",
|
|
454
|
-
"Cursor.exe",
|
|
455
|
-
"atom.exe",
|
|
456
|
-
"sublime_text.exe",
|
|
457
|
-
"notepad++.exe",
|
|
458
|
-
"clion.exe",
|
|
459
|
-
"clion64.exe",
|
|
460
|
-
"idea.exe",
|
|
461
|
-
"idea64.exe",
|
|
462
|
-
"phpstorm.exe",
|
|
463
|
-
"phpstorm64.exe",
|
|
464
|
-
"pycharm.exe",
|
|
465
|
-
"pycharm64.exe",
|
|
466
|
-
"rubymine.exe",
|
|
467
|
-
"rubymine64.exe",
|
|
468
|
-
"webstorm.exe",
|
|
469
|
-
"webstorm64.exe",
|
|
470
|
-
"goland.exe",
|
|
471
|
-
"goland64.exe",
|
|
472
|
-
"rider.exe",
|
|
473
|
-
"rider64.exe",
|
|
474
|
-
"Trae.exe",
|
|
475
|
-
"zed.exe",
|
|
476
|
-
"Antigravity.exe"
|
|
477
|
-
];
|
|
478
|
-
}));
|
|
479
|
-
//#endregion
|
|
480
|
-
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js
|
|
481
|
-
var require_guess = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
482
|
-
const path$2 = __require("path");
|
|
483
|
-
const shellQuote = require_shell_quote();
|
|
484
|
-
const childProcess$1 = __require("child_process");
|
|
485
|
-
const COMMON_EDITORS_MACOS = require_macos();
|
|
486
|
-
const COMMON_EDITORS_LINUX = require_linux();
|
|
487
|
-
const COMMON_EDITORS_WIN = require_windows();
|
|
488
|
-
function getEditorFromMacProcesses(output) {
|
|
489
|
-
const processNames = Object.keys(COMMON_EDITORS_MACOS);
|
|
490
|
-
const processList = output.split("\n");
|
|
491
|
-
for (let i = 0; i < processNames.length; i++) {
|
|
492
|
-
const processName = processNames[i];
|
|
493
|
-
if (processList.includes(processName)) return COMMON_EDITORS_MACOS[processName];
|
|
494
|
-
const processNameWithoutApplications = processName.replace("/Applications", "");
|
|
495
|
-
if (output.indexOf(processNameWithoutApplications) !== -1) {
|
|
496
|
-
if (processName !== COMMON_EDITORS_MACOS[processName]) return COMMON_EDITORS_MACOS[processName];
|
|
497
|
-
const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
|
|
498
|
-
if (runningProcess !== void 0) return runningProcess;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
function getEditorFromWindowsProcesses(output) {
|
|
503
|
-
const runningProcesses = output.split("\r\n");
|
|
504
|
-
for (let i = 0; i < runningProcesses.length; i++) {
|
|
505
|
-
const fullProcessPath = runningProcesses[i].trim();
|
|
506
|
-
const shortProcessName = path$2.win32.basename(fullProcessPath);
|
|
507
|
-
if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) return fullProcessPath;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
function getEditorFromLinuxProcesses(output) {
|
|
511
|
-
const processNames = Object.keys(COMMON_EDITORS_LINUX);
|
|
512
|
-
for (let i = 0; i < processNames.length; i++) {
|
|
513
|
-
const processName = processNames[i];
|
|
514
|
-
if (output.indexOf(processName) !== -1) return COMMON_EDITORS_LINUX[processName];
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
function guessEditor(specifiedEditor) {
|
|
518
|
-
if (specifiedEditor) return shellQuote.parse(specifiedEditor);
|
|
519
|
-
if (process.env.LAUNCH_EDITOR) return [process.env.LAUNCH_EDITOR];
|
|
520
|
-
if (process.versions.webcontainer) return [process.env.EDITOR || "code"];
|
|
521
|
-
try {
|
|
522
|
-
if (process.platform === "darwin") {
|
|
523
|
-
const editor = getEditorFromMacProcesses(childProcess$1.execSync("ps x -o comm=", { stdio: [
|
|
524
|
-
"pipe",
|
|
525
|
-
"pipe",
|
|
526
|
-
"ignore"
|
|
527
|
-
] }).toString());
|
|
528
|
-
if (editor !== void 0) return [editor];
|
|
529
|
-
} else if (process.platform === "win32") {
|
|
530
|
-
const editor = getEditorFromWindowsProcesses(childProcess$1.execSync("powershell -NoProfile -Command \"[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\\"select executablepath from win32_process where executablepath is not null\\\" | % { $_.ExecutablePath }\"", { stdio: [
|
|
531
|
-
"pipe",
|
|
532
|
-
"pipe",
|
|
533
|
-
"ignore"
|
|
534
|
-
] }).toString());
|
|
535
|
-
if (editor !== void 0) return [editor];
|
|
536
|
-
} else if (process.platform === "linux") {
|
|
537
|
-
const editor = getEditorFromLinuxProcesses(childProcess$1.execSync("ps x --no-heading -o comm --sort=comm", { stdio: [
|
|
538
|
-
"pipe",
|
|
539
|
-
"pipe",
|
|
540
|
-
"ignore"
|
|
541
|
-
] }).toString());
|
|
542
|
-
if (editor !== void 0) return [editor];
|
|
543
|
-
}
|
|
544
|
-
} catch (ignoreError) {}
|
|
545
|
-
if (process.env.VISUAL) return [process.env.VISUAL];
|
|
546
|
-
else if (process.env.EDITOR) return [process.env.EDITOR];
|
|
547
|
-
return [null];
|
|
548
|
-
}
|
|
549
|
-
module.exports = guessEditor;
|
|
550
|
-
module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses;
|
|
551
|
-
module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses;
|
|
552
|
-
module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
|
|
553
|
-
}));
|
|
554
|
-
//#endregion
|
|
555
|
-
//#region ../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js
|
|
556
|
-
var require_get_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
557
|
-
const path$1 = __require("path");
|
|
558
|
-
module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
|
|
559
|
-
switch (path$1.basename(editor).replace(/\.(exe|cmd|bat)$/i, "")) {
|
|
560
|
-
case "atom":
|
|
561
|
-
case "Atom":
|
|
562
|
-
case "Atom Beta":
|
|
563
|
-
case "subl":
|
|
564
|
-
case "sublime":
|
|
565
|
-
case "sublime_text":
|
|
566
|
-
case "wstorm":
|
|
567
|
-
case "charm":
|
|
568
|
-
case "zed": return [`${fileName}:${lineNumber}:${columnNumber}`];
|
|
569
|
-
case "notepad++": return [
|
|
570
|
-
"-n" + lineNumber,
|
|
571
|
-
"-c" + columnNumber,
|
|
572
|
-
fileName
|
|
573
|
-
];
|
|
574
|
-
case "vim":
|
|
575
|
-
case "mvim": return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
|
|
576
|
-
case "joe":
|
|
577
|
-
case "gvim": return [`+${lineNumber}`, fileName];
|
|
578
|
-
case "emacs":
|
|
579
|
-
case "emacsclient": return [`+${lineNumber}:${columnNumber}`, fileName];
|
|
580
|
-
case "rmate":
|
|
581
|
-
case "mate":
|
|
582
|
-
case "mine": return [
|
|
583
|
-
"--line",
|
|
584
|
-
lineNumber,
|
|
585
|
-
fileName
|
|
586
|
-
];
|
|
587
|
-
case "code":
|
|
588
|
-
case "Code":
|
|
589
|
-
case "code-insiders":
|
|
590
|
-
case "Code - Insiders":
|
|
591
|
-
case "codium":
|
|
592
|
-
case "trae":
|
|
593
|
-
case "antigravity":
|
|
594
|
-
case "cursor":
|
|
595
|
-
case "vscodium":
|
|
596
|
-
case "VSCodium": return [
|
|
597
|
-
"-r",
|
|
598
|
-
"-g",
|
|
599
|
-
`${fileName}:${lineNumber}:${columnNumber}`
|
|
600
|
-
];
|
|
601
|
-
case "appcode":
|
|
602
|
-
case "clion":
|
|
603
|
-
case "clion64":
|
|
604
|
-
case "idea":
|
|
605
|
-
case "idea64":
|
|
606
|
-
case "phpstorm":
|
|
607
|
-
case "phpstorm64":
|
|
608
|
-
case "pycharm":
|
|
609
|
-
case "pycharm64":
|
|
610
|
-
case "rubymine":
|
|
611
|
-
case "rubymine64":
|
|
612
|
-
case "webstorm":
|
|
613
|
-
case "webstorm64":
|
|
614
|
-
case "goland":
|
|
615
|
-
case "goland64":
|
|
616
|
-
case "rider":
|
|
617
|
-
case "rider64": return [
|
|
618
|
-
"--line",
|
|
619
|
-
lineNumber,
|
|
620
|
-
"--column",
|
|
621
|
-
columnNumber,
|
|
622
|
-
fileName
|
|
623
|
-
];
|
|
624
|
-
}
|
|
625
|
-
if (process.env.LAUNCH_EDITOR) return [
|
|
626
|
-
fileName,
|
|
627
|
-
lineNumber,
|
|
628
|
-
columnNumber
|
|
629
|
-
];
|
|
630
|
-
return [fileName];
|
|
631
|
-
};
|
|
632
|
-
}));
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/utils/launch-editor.ts
|
|
635
|
-
var import_launch_editor = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
636
|
-
/**
|
|
637
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
638
|
-
*
|
|
639
|
-
* This source code is licensed under the MIT license found in the
|
|
640
|
-
* LICENSE file at
|
|
641
|
-
* https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
|
|
642
|
-
*
|
|
643
|
-
* Modified by Yuxi Evan You
|
|
644
|
-
*/
|
|
645
|
-
const fs = __require("fs");
|
|
646
|
-
const os = __require("os");
|
|
647
|
-
const path = __require("path");
|
|
648
|
-
const colors = require_picocolors();
|
|
649
|
-
const childProcess = __require("child_process");
|
|
650
|
-
const guessEditor = require_guess();
|
|
651
|
-
const getArgumentsForPosition = require_get_args();
|
|
652
|
-
function wrapErrorCallback(cb) {
|
|
653
|
-
return (fileName, errorMessage) => {
|
|
654
|
-
console.log();
|
|
655
|
-
console.log(colors.red("Could not open " + path.basename(fileName) + " in the editor."));
|
|
656
|
-
if (errorMessage) {
|
|
657
|
-
if (errorMessage[errorMessage.length - 1] !== ".") errorMessage += ".";
|
|
658
|
-
console.log(colors.red("The editor process exited with an error: " + errorMessage));
|
|
659
|
-
}
|
|
660
|
-
console.log();
|
|
661
|
-
if (cb) cb(fileName, errorMessage);
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
function isTerminalEditor(editor) {
|
|
665
|
-
switch (editor) {
|
|
666
|
-
case "vim":
|
|
667
|
-
case "emacs":
|
|
668
|
-
case "nano": return true;
|
|
669
|
-
}
|
|
670
|
-
return false;
|
|
671
|
-
}
|
|
672
|
-
const positionRE = /:(\d+)(:(\d+))?$/;
|
|
673
|
-
function parseFile(file) {
|
|
674
|
-
if (file.startsWith("file://")) file = __require("url").fileURLToPath(file);
|
|
675
|
-
const fileName = file.replace(positionRE, "");
|
|
676
|
-
const match = file.match(positionRE);
|
|
677
|
-
return {
|
|
678
|
-
fileName,
|
|
679
|
-
lineNumber: match && match[1],
|
|
680
|
-
columnNumber: match && match[3]
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
let currentChildProcess = null;
|
|
684
|
-
function launchEditor(file, specifiedEditor, onErrorCallback) {
|
|
685
|
-
const parsed = parseFile(file);
|
|
686
|
-
let { fileName } = parsed;
|
|
687
|
-
const { lineNumber, columnNumber } = parsed;
|
|
688
|
-
if (process.platform === "win32" && path.resolve(fileName).startsWith("\\\\")) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
|
|
689
|
-
if (!fs.existsSync(fileName)) return;
|
|
690
|
-
if (typeof specifiedEditor === "function") {
|
|
691
|
-
onErrorCallback = specifiedEditor;
|
|
692
|
-
specifiedEditor = void 0;
|
|
693
|
-
}
|
|
694
|
-
onErrorCallback = wrapErrorCallback(onErrorCallback);
|
|
695
|
-
const [editor, ...args] = guessEditor(specifiedEditor);
|
|
696
|
-
if (!editor) {
|
|
697
|
-
onErrorCallback(fileName, null);
|
|
698
|
-
return;
|
|
699
|
-
}
|
|
700
|
-
if (process.platform === "linux" && fileName.startsWith("/mnt/") && /Microsoft/i.test(os.release())) fileName = path.relative("", fileName);
|
|
701
|
-
if (lineNumber) {
|
|
702
|
-
const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
|
|
703
|
-
args.push.apply(args, extraArgs);
|
|
704
|
-
} else args.push(fileName);
|
|
705
|
-
if (currentChildProcess && isTerminalEditor(editor)) currentChildProcess.kill("SIGKILL");
|
|
706
|
-
if (process.platform === "win32") {
|
|
707
|
-
function escapeCmdArgs(cmdArgs) {
|
|
708
|
-
return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
|
|
709
|
-
}
|
|
710
|
-
function doubleQuoteIfNeeded(str) {
|
|
711
|
-
if (str.includes("^")) return `^"${str}^"`;
|
|
712
|
-
else if (str.includes(" ")) return `"${str}"`;
|
|
713
|
-
return str;
|
|
714
|
-
}
|
|
715
|
-
const launchCommand = [editor, ...args.map(escapeCmdArgs)].map(doubleQuoteIfNeeded).join(" ");
|
|
716
|
-
currentChildProcess = childProcess.exec(launchCommand, {
|
|
717
|
-
stdio: "inherit",
|
|
718
|
-
shell: true
|
|
719
|
-
});
|
|
720
|
-
} else currentChildProcess = childProcess.spawn(editor, args, { stdio: "inherit" });
|
|
721
|
-
currentChildProcess.on("exit", function(errorCode) {
|
|
722
|
-
currentChildProcess = null;
|
|
723
|
-
if (errorCode) onErrorCallback(fileName, "(code " + errorCode + ")");
|
|
724
|
-
});
|
|
725
|
-
currentChildProcess.on("error", function(error) {
|
|
726
|
-
let { code, message } = error;
|
|
727
|
-
if ("ENOENT" === code) message = `${message} ('${editor}' command does not exist in 'PATH')`;
|
|
728
|
-
onErrorCallback(fileName, message);
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
module.exports = launchEditor;
|
|
732
|
-
})))(), 1);
|
|
733
|
-
/**
|
|
734
|
-
* Open a file in the user's editor.
|
|
735
|
-
*
|
|
736
|
-
* `target` may be a plain path, `file:line`, or `file:line:column`.
|
|
737
|
-
*
|
|
738
|
-
* If `editor` is provided, it is used as the editor command (e.g. `'code'`,
|
|
739
|
-
* `'subl'`) or absolute binary path. Otherwise the editor is auto-detected
|
|
740
|
-
* via the `LAUNCH_EDITOR` env var with a fallback to common defaults.
|
|
741
|
-
*/
|
|
742
|
-
function launchEditor(target, editor) {
|
|
743
|
-
(0, import_launch_editor.default)(target, editor);
|
|
744
|
-
}
|
|
745
|
-
//#endregion
|
|
746
|
-
export { launchEditor as t };
|