@wix/cli-app 1.1.81 → 1.1.83
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/build/{AddPermissionCommand-SFC44F4N.js → AddPermissionCommand-5X3K4KUG.js} +2 -2
- package/build/{CreateVersionCommand-DMS7UHEW.js → CreateVersionCommand-XWWXAFOX.js} +3 -3
- package/build/{DevCommand-IMACMU76.js → DevCommand-EOEGQX2B.js} +14 -14
- package/build/{GenerateCommand-BXBYWPR6.js → GenerateCommand-IOFKL3RC.js} +1009 -868
- package/build/GenerateCommand-IOFKL3RC.js.map +1 -0
- package/build/{LogsCommand-DXPP2Y63.js → LogsCommand-23QQRT3D.js} +3 -3
- package/build/PreviewCommand-FBODGF7Y.js +19 -0
- package/build/ReleaseCommand-SNCMQQXK.js +28 -0
- package/build/{ReleaseCommand-ZZFTWS7J.js.map → ReleaseCommand-SNCMQQXK.js.map} +1 -1
- package/build/ServeCommand-SGREOUDA.js +43 -0
- package/build/ServeCommand-SGREOUDA.js.map +1 -0
- package/build/{build-5B2A76I7.js → build-PYB5PAZO.js} +8 -8
- package/build/{chunk-GCHPKOS2.js → chunk-3X2VYRBF.js} +13 -7
- package/build/chunk-3X2VYRBF.js.map +1 -0
- package/build/{chunk-R3BD56LW.js → chunk-4PXJSX4C.js} +2 -2
- package/build/{chunk-32DDGTGH.js → chunk-5TP6T6QK.js} +84 -17
- package/build/chunk-5TP6T6QK.js.map +1 -0
- package/build/{chunk-PJJ6F4A3.js → chunk-63VDDLLQ.js} +2 -2
- package/build/{chunk-6GF7ZOLW.js → chunk-AN77SZN2.js} +9 -11
- package/build/{chunk-6GF7ZOLW.js.map → chunk-AN77SZN2.js.map} +1 -1
- package/build/{chunk-RZHKF2FT.js → chunk-E4UNGBQY.js} +2 -2
- package/build/{chunk-JYPZQDKR.js → chunk-GGDJQXOX.js} +3 -3
- package/build/{chunk-3BX4VLQC.js → chunk-KLBXSZ6R.js} +3 -3
- package/build/{chunk-ZVADFZDF.js → chunk-QREADZZF.js} +5 -5
- package/build/{chunk-DBASREIW.js → chunk-SIJDKP2Q.js} +1312 -534
- package/build/chunk-SIJDKP2Q.js.map +1 -0
- package/build/{chunk-D7ONS7OD.js → chunk-TJFERWU7.js} +5 -5
- package/build/{chunk-VV2OOBF3.js → chunk-VB3AXXRP.js} +2 -2
- package/build/{chunk-OPFPQV74.js → chunk-VLQG5SQF.js} +79 -4
- package/build/{chunk-OPFPQV74.js.map → chunk-VLQG5SQF.js.map} +1 -1
- package/build/{chunk-LNBDMMJU.js → chunk-WNR36YTI.js} +2 -2
- package/build/{chunk-42T5NHSS.js → chunk-Y4GJ3NS4.js} +2 -2
- package/build/{chunk-S426UONM.js → chunk-ZCUJ356B.js} +2 -2
- package/build/{chunk-2Y6DEXNR.js → chunk-ZLLXHWZF.js} +957 -375
- package/build/{chunk-2Y6DEXNR.js.map → chunk-ZLLXHWZF.js.map} +1 -1
- package/build/{chunk-CYJERK24.js → chunk-ZOZ5LJV7.js} +7 -7
- package/build/{chunk-CYJERK24.js.map → chunk-ZOZ5LJV7.js.map} +1 -1
- package/build/cloudflare-runtime/entry.js +33 -9
- package/build/cloudflare-runtime/getRegisteredExtensions.js +33 -9
- package/build/index.js +34 -31
- package/build/index.js.map +1 -1
- package/build/platform-sdk/chunk-MM2KVUBI.js +2 -0
- package/build/platform-sdk/chunk-MM2KVUBI.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/editor.js +1 -1
- package/build/platform-sdk/site.js +1 -1
- package/build/{preview-XTPTMI6C.js → preview-PIFWQKW3.js} +13 -14
- package/build/{preview-XTPTMI6C.js.map → preview-PIFWQKW3.js.map} +1 -1
- package/build/{release-MNTPIKSG.js → release-6Z6LMTRW.js} +15 -16
- package/build/{release-MNTPIKSG.js.map → release-6Z6LMTRW.js.map} +1 -1
- package/build/{render-command-HQXTOVW5.js → render-command-3G25G5MU.js} +6 -6
- package/build/src-MHMTXBSY.js +1120 -0
- package/build/src-MHMTXBSY.js.map +1 -0
- package/package.json +8 -7
- package/build/GenerateCommand-BXBYWPR6.js.map +0 -1
- package/build/PreviewCommand-IKMUVCVS.js +0 -20
- package/build/ReleaseCommand-ZZFTWS7J.js +0 -29
- package/build/ServeCommand-2ESXE2E2.js +0 -169
- package/build/ServeCommand-2ESXE2E2.js.map +0 -1
- package/build/chunk-32DDGTGH.js.map +0 -1
- package/build/chunk-3FL4P2SD.js +0 -92
- package/build/chunk-3FL4P2SD.js.map +0 -1
- package/build/chunk-DBASREIW.js.map +0 -1
- package/build/chunk-GCHPKOS2.js.map +0 -1
- package/build/platform-sdk/chunk-BGEA2LRQ.js +0 -2
- package/build/platform-sdk/chunk-BGEA2LRQ.js.map +0 -1
- /package/build/{AddPermissionCommand-SFC44F4N.js.map → AddPermissionCommand-5X3K4KUG.js.map} +0 -0
- /package/build/{CreateVersionCommand-DMS7UHEW.js.map → CreateVersionCommand-XWWXAFOX.js.map} +0 -0
- /package/build/{DevCommand-IMACMU76.js.map → DevCommand-EOEGQX2B.js.map} +0 -0
- /package/build/{LogsCommand-DXPP2Y63.js.map → LogsCommand-23QQRT3D.js.map} +0 -0
- /package/build/{PreviewCommand-IKMUVCVS.js.map → PreviewCommand-FBODGF7Y.js.map} +0 -0
- /package/build/{build-5B2A76I7.js.map → build-PYB5PAZO.js.map} +0 -0
- /package/build/{chunk-R3BD56LW.js.map → chunk-4PXJSX4C.js.map} +0 -0
- /package/build/{chunk-PJJ6F4A3.js.map → chunk-63VDDLLQ.js.map} +0 -0
- /package/build/{chunk-RZHKF2FT.js.map → chunk-E4UNGBQY.js.map} +0 -0
- /package/build/{chunk-JYPZQDKR.js.map → chunk-GGDJQXOX.js.map} +0 -0
- /package/build/{chunk-3BX4VLQC.js.map → chunk-KLBXSZ6R.js.map} +0 -0
- /package/build/{chunk-ZVADFZDF.js.map → chunk-QREADZZF.js.map} +0 -0
- /package/build/{chunk-D7ONS7OD.js.map → chunk-TJFERWU7.js.map} +0 -0
- /package/build/{chunk-VV2OOBF3.js.map → chunk-VB3AXXRP.js.map} +0 -0
- /package/build/{chunk-LNBDMMJU.js.map → chunk-WNR36YTI.js.map} +0 -0
- /package/build/{chunk-42T5NHSS.js.map → chunk-Y4GJ3NS4.js.map} +0 -0
- /package/build/{chunk-S426UONM.js.map → chunk-ZCUJ356B.js.map} +0 -0
- /package/build/{render-command-HQXTOVW5.js.map → render-command-3G25G5MU.js.map} +0 -0
|
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getBackendEventSlug,
|
|
5
5
|
require_baseUniq
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VLQG5SQF.js";
|
|
7
7
|
import {
|
|
8
8
|
BLOCKS_WIDGETS_PANELS_PATTERN,
|
|
9
9
|
BLOCKS_WIDGETS_PATTERN,
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
RELATIVE_ASSET_PATH_REGEX,
|
|
30
30
|
RegionType,
|
|
31
31
|
SERVICE_PLUGINS_PATTERN,
|
|
32
|
+
SITE_COMPONENTS_PATTERN,
|
|
32
33
|
SITE_PLUGINS_PANEL_PATTERN,
|
|
33
34
|
SITE_PLUGINS_PLUGIN_PATTERN,
|
|
34
35
|
SITE_WIDGETS_ELEMENT_PATTERN,
|
|
@@ -50,6 +51,7 @@ import {
|
|
|
50
51
|
require_build,
|
|
51
52
|
require_lib,
|
|
52
53
|
require_picomatch,
|
|
54
|
+
require_src,
|
|
53
55
|
virtualBlocksWidgetPanelScriptAssets,
|
|
54
56
|
virtualBlocksWidgetScriptAssets,
|
|
55
57
|
virtualCustomElementPanelHTMLAssets,
|
|
@@ -61,10 +63,12 @@ import {
|
|
|
61
63
|
virtualModuleIdForCustomElementPanelScriptAsset,
|
|
62
64
|
virtualModuleIdForCustomElementScriptAsset,
|
|
63
65
|
virtualModuleIdForScriptAsset,
|
|
66
|
+
virtualModuleIdForSiteComponentScriptAsset,
|
|
64
67
|
virtualPathForCustomElementPanelHTMLAsset,
|
|
65
68
|
virtualPathForHTMLAsset,
|
|
69
|
+
virtualSiteComponentScriptAssets,
|
|
66
70
|
z
|
|
67
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-ZLLXHWZF.js";
|
|
68
72
|
import {
|
|
69
73
|
__commonJS,
|
|
70
74
|
__esm,
|
|
@@ -75,6 +79,233 @@ import {
|
|
|
75
79
|
init_esm_shims
|
|
76
80
|
} from "./chunk-PYIAC2GK.js";
|
|
77
81
|
|
|
82
|
+
// ../../node_modules/globrex/index.js
|
|
83
|
+
var require_globrex = __commonJS({
|
|
84
|
+
"../../node_modules/globrex/index.js"(exports, module) {
|
|
85
|
+
"use strict";
|
|
86
|
+
init_esm_shims();
|
|
87
|
+
var isWin = process.platform === "win32";
|
|
88
|
+
var SEP = isWin ? `\\\\+` : `\\/`;
|
|
89
|
+
var SEP_ESC = isWin ? `\\\\` : `/`;
|
|
90
|
+
var GLOBSTAR2 = `((?:[^/]*(?:/|$))*)`;
|
|
91
|
+
var WILDCARD = `([^/]*)`;
|
|
92
|
+
var GLOBSTAR_SEGMENT = `((?:[^${SEP_ESC}]*(?:${SEP_ESC}|$))*)`;
|
|
93
|
+
var WILDCARD_SEGMENT = `([^${SEP_ESC}]*)`;
|
|
94
|
+
function globrex(glob, { extended = false, globstar = false, strict = false, filepath = false, flags = "" } = {}) {
|
|
95
|
+
let regex = "";
|
|
96
|
+
let segment = "";
|
|
97
|
+
let path9 = { regex: "", segments: [] };
|
|
98
|
+
let inGroup = false;
|
|
99
|
+
let inRange = false;
|
|
100
|
+
const ext2 = [];
|
|
101
|
+
function add2(str, { split: split2, last, only } = {}) {
|
|
102
|
+
if (only !== "path") regex += str;
|
|
103
|
+
if (filepath && only !== "regex") {
|
|
104
|
+
path9.regex += str === "\\/" ? SEP : str;
|
|
105
|
+
if (split2) {
|
|
106
|
+
if (last) segment += str;
|
|
107
|
+
if (segment !== "") {
|
|
108
|
+
if (!flags.includes("g")) segment = `^${segment}$`;
|
|
109
|
+
path9.segments.push(new RegExp(segment, flags));
|
|
110
|
+
}
|
|
111
|
+
segment = "";
|
|
112
|
+
} else {
|
|
113
|
+
segment += str;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
let c, n3;
|
|
118
|
+
for (let i = 0; i < glob.length; i++) {
|
|
119
|
+
c = glob[i];
|
|
120
|
+
n3 = glob[i + 1];
|
|
121
|
+
if (["\\", "$", "^", ".", "="].includes(c)) {
|
|
122
|
+
add2(`\\${c}`);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (c === "/") {
|
|
126
|
+
add2(`\\${c}`, { split: true });
|
|
127
|
+
if (n3 === "/" && !strict) regex += "?";
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (c === "(") {
|
|
131
|
+
if (ext2.length) {
|
|
132
|
+
add2(c);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
add2(`\\${c}`);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (c === ")") {
|
|
139
|
+
if (ext2.length) {
|
|
140
|
+
add2(c);
|
|
141
|
+
let type = ext2.pop();
|
|
142
|
+
if (type === "@") {
|
|
143
|
+
add2("{1}");
|
|
144
|
+
} else if (type === "!") {
|
|
145
|
+
add2("([^/]*)");
|
|
146
|
+
} else {
|
|
147
|
+
add2(type);
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
add2(`\\${c}`);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (c === "|") {
|
|
155
|
+
if (ext2.length) {
|
|
156
|
+
add2(c);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
add2(`\\${c}`);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (c === "+") {
|
|
163
|
+
if (n3 === "(" && extended) {
|
|
164
|
+
ext2.push(c);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
add2(`\\${c}`);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (c === "@" && extended) {
|
|
171
|
+
if (n3 === "(") {
|
|
172
|
+
ext2.push(c);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (c === "!") {
|
|
177
|
+
if (extended) {
|
|
178
|
+
if (inRange) {
|
|
179
|
+
add2("^");
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (n3 === "(") {
|
|
183
|
+
ext2.push(c);
|
|
184
|
+
add2("(?!");
|
|
185
|
+
i++;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
add2(`\\${c}`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
add2(`\\${c}`);
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (c === "?") {
|
|
195
|
+
if (extended) {
|
|
196
|
+
if (n3 === "(") {
|
|
197
|
+
ext2.push(c);
|
|
198
|
+
} else {
|
|
199
|
+
add2(".");
|
|
200
|
+
}
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
add2(`\\${c}`);
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (c === "[") {
|
|
207
|
+
if (inRange && n3 === ":") {
|
|
208
|
+
i++;
|
|
209
|
+
let value = "";
|
|
210
|
+
while (glob[++i] !== ":") value += glob[i];
|
|
211
|
+
if (value === "alnum") add2("(\\w|\\d)");
|
|
212
|
+
else if (value === "space") add2("\\s");
|
|
213
|
+
else if (value === "digit") add2("\\d");
|
|
214
|
+
i++;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (extended) {
|
|
218
|
+
inRange = true;
|
|
219
|
+
add2(c);
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
add2(`\\${c}`);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (c === "]") {
|
|
226
|
+
if (extended) {
|
|
227
|
+
inRange = false;
|
|
228
|
+
add2(c);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
add2(`\\${c}`);
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (c === "{") {
|
|
235
|
+
if (extended) {
|
|
236
|
+
inGroup = true;
|
|
237
|
+
add2("(");
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
add2(`\\${c}`);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (c === "}") {
|
|
244
|
+
if (extended) {
|
|
245
|
+
inGroup = false;
|
|
246
|
+
add2(")");
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
add2(`\\${c}`);
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (c === ",") {
|
|
253
|
+
if (inGroup) {
|
|
254
|
+
add2("|");
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
add2(`\\${c}`);
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (c === "*") {
|
|
261
|
+
if (n3 === "(" && extended) {
|
|
262
|
+
ext2.push(c);
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
let prevChar = glob[i - 1];
|
|
266
|
+
let starCount = 1;
|
|
267
|
+
while (glob[i + 1] === "*") {
|
|
268
|
+
starCount++;
|
|
269
|
+
i++;
|
|
270
|
+
}
|
|
271
|
+
let nextChar = glob[i + 1];
|
|
272
|
+
if (!globstar) {
|
|
273
|
+
add2(".*");
|
|
274
|
+
} else {
|
|
275
|
+
let isGlobstar = starCount > 1 && // multiple "*"'s
|
|
276
|
+
(prevChar === "/" || prevChar === void 0) && // from the start of the segment
|
|
277
|
+
(nextChar === "/" || nextChar === void 0);
|
|
278
|
+
if (isGlobstar) {
|
|
279
|
+
add2(GLOBSTAR2, { only: "regex" });
|
|
280
|
+
add2(GLOBSTAR_SEGMENT, { only: "path", last: true, split: true });
|
|
281
|
+
i++;
|
|
282
|
+
} else {
|
|
283
|
+
add2(WILDCARD, { only: "regex" });
|
|
284
|
+
add2(WILDCARD_SEGMENT, { only: "path" });
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
add2(c);
|
|
290
|
+
}
|
|
291
|
+
if (!flags.includes("g")) {
|
|
292
|
+
regex = `^${regex}$`;
|
|
293
|
+
segment = `^${segment}$`;
|
|
294
|
+
if (filepath) path9.regex = `^${path9.regex}$`;
|
|
295
|
+
}
|
|
296
|
+
const result = { regex: new RegExp(regex, flags) };
|
|
297
|
+
if (filepath) {
|
|
298
|
+
path9.segments.push(new RegExp(segment, flags));
|
|
299
|
+
path9.regex = new RegExp(path9.regex, flags);
|
|
300
|
+
path9.globstar = new RegExp(!flags.includes("g") ? `^${GLOBSTAR_SEGMENT}$` : GLOBSTAR_SEGMENT, flags);
|
|
301
|
+
result.path = path9;
|
|
302
|
+
}
|
|
303
|
+
return result;
|
|
304
|
+
}
|
|
305
|
+
module.exports = globrex;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
78
309
|
// ../../node_modules/picocolors/picocolors.js
|
|
79
310
|
var require_picocolors = __commonJS({
|
|
80
311
|
"../../node_modules/picocolors/picocolors.js"(exports, module) {
|
|
@@ -158,11 +389,11 @@ var require_universalify = __commonJS({
|
|
|
158
389
|
return Object.defineProperty(function(...args) {
|
|
159
390
|
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
|
160
391
|
else {
|
|
161
|
-
return new Promise((
|
|
392
|
+
return new Promise((resolve6, reject) => {
|
|
162
393
|
fn.call(
|
|
163
394
|
this,
|
|
164
395
|
...args,
|
|
165
|
-
(err, res) => err != null ? reject(err) :
|
|
396
|
+
(err, res) => err != null ? reject(err) : resolve6(res)
|
|
166
397
|
);
|
|
167
398
|
});
|
|
168
399
|
}
|
|
@@ -186,7 +417,7 @@ var require_polyfills = __commonJS({
|
|
|
186
417
|
var constants = __require("constants");
|
|
187
418
|
var origCwd = process.cwd;
|
|
188
419
|
var cwd = null;
|
|
189
|
-
var
|
|
420
|
+
var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
190
421
|
process.cwd = function() {
|
|
191
422
|
if (!cwd)
|
|
192
423
|
cwd = origCwd.call(process);
|
|
@@ -206,54 +437,54 @@ var require_polyfills = __commonJS({
|
|
|
206
437
|
}
|
|
207
438
|
var chdir;
|
|
208
439
|
module.exports = patch;
|
|
209
|
-
function patch(
|
|
440
|
+
function patch(fs3) {
|
|
210
441
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
211
|
-
patchLchmod(
|
|
212
|
-
}
|
|
213
|
-
if (!
|
|
214
|
-
patchLutimes(
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
|
|
442
|
+
patchLchmod(fs3);
|
|
443
|
+
}
|
|
444
|
+
if (!fs3.lutimes) {
|
|
445
|
+
patchLutimes(fs3);
|
|
446
|
+
}
|
|
447
|
+
fs3.chown = chownFix(fs3.chown);
|
|
448
|
+
fs3.fchown = chownFix(fs3.fchown);
|
|
449
|
+
fs3.lchown = chownFix(fs3.lchown);
|
|
450
|
+
fs3.chmod = chmodFix(fs3.chmod);
|
|
451
|
+
fs3.fchmod = chmodFix(fs3.fchmod);
|
|
452
|
+
fs3.lchmod = chmodFix(fs3.lchmod);
|
|
453
|
+
fs3.chownSync = chownFixSync(fs3.chownSync);
|
|
454
|
+
fs3.fchownSync = chownFixSync(fs3.fchownSync);
|
|
455
|
+
fs3.lchownSync = chownFixSync(fs3.lchownSync);
|
|
456
|
+
fs3.chmodSync = chmodFixSync(fs3.chmodSync);
|
|
457
|
+
fs3.fchmodSync = chmodFixSync(fs3.fchmodSync);
|
|
458
|
+
fs3.lchmodSync = chmodFixSync(fs3.lchmodSync);
|
|
459
|
+
fs3.stat = statFix(fs3.stat);
|
|
460
|
+
fs3.fstat = statFix(fs3.fstat);
|
|
461
|
+
fs3.lstat = statFix(fs3.lstat);
|
|
462
|
+
fs3.statSync = statFixSync(fs3.statSync);
|
|
463
|
+
fs3.fstatSync = statFixSync(fs3.fstatSync);
|
|
464
|
+
fs3.lstatSync = statFixSync(fs3.lstatSync);
|
|
465
|
+
if (fs3.chmod && !fs3.lchmod) {
|
|
466
|
+
fs3.lchmod = function(path9, mode, cb) {
|
|
236
467
|
if (cb) process.nextTick(cb);
|
|
237
468
|
};
|
|
238
|
-
|
|
469
|
+
fs3.lchmodSync = function() {
|
|
239
470
|
};
|
|
240
471
|
}
|
|
241
|
-
if (
|
|
242
|
-
|
|
472
|
+
if (fs3.chown && !fs3.lchown) {
|
|
473
|
+
fs3.lchown = function(path9, uid, gid, cb) {
|
|
243
474
|
if (cb) process.nextTick(cb);
|
|
244
475
|
};
|
|
245
|
-
|
|
476
|
+
fs3.lchownSync = function() {
|
|
246
477
|
};
|
|
247
478
|
}
|
|
248
|
-
if (
|
|
249
|
-
|
|
479
|
+
if (platform2 === "win32") {
|
|
480
|
+
fs3.rename = typeof fs3.rename !== "function" ? fs3.rename : function(fs$rename) {
|
|
250
481
|
function rename(from, to, cb) {
|
|
251
482
|
var start = Date.now();
|
|
252
483
|
var backoff = 0;
|
|
253
484
|
fs$rename(from, to, function CB(er) {
|
|
254
485
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
255
486
|
setTimeout(function() {
|
|
256
|
-
|
|
487
|
+
fs3.stat(to, function(stater, st) {
|
|
257
488
|
if (stater && stater.code === "ENOENT")
|
|
258
489
|
fs$rename(from, to, CB);
|
|
259
490
|
else
|
|
@@ -269,9 +500,9 @@ var require_polyfills = __commonJS({
|
|
|
269
500
|
}
|
|
270
501
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
271
502
|
return rename;
|
|
272
|
-
}(
|
|
503
|
+
}(fs3.rename);
|
|
273
504
|
}
|
|
274
|
-
|
|
505
|
+
fs3.read = typeof fs3.read !== "function" ? fs3.read : function(fs$read) {
|
|
275
506
|
function read(fd, buffer, offset2, length3, position, callback_) {
|
|
276
507
|
var callback;
|
|
277
508
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -279,22 +510,22 @@ var require_polyfills = __commonJS({
|
|
|
279
510
|
callback = function(er, _, __) {
|
|
280
511
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
281
512
|
eagCounter++;
|
|
282
|
-
return fs$read.call(
|
|
513
|
+
return fs$read.call(fs3, fd, buffer, offset2, length3, position, callback);
|
|
283
514
|
}
|
|
284
515
|
callback_.apply(this, arguments);
|
|
285
516
|
};
|
|
286
517
|
}
|
|
287
|
-
return fs$read.call(
|
|
518
|
+
return fs$read.call(fs3, fd, buffer, offset2, length3, position, callback);
|
|
288
519
|
}
|
|
289
520
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
290
521
|
return read;
|
|
291
|
-
}(
|
|
292
|
-
|
|
522
|
+
}(fs3.read);
|
|
523
|
+
fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
|
|
293
524
|
return function(fd, buffer, offset2, length3, position) {
|
|
294
525
|
var eagCounter = 0;
|
|
295
526
|
while (true) {
|
|
296
527
|
try {
|
|
297
|
-
return fs$readSync.call(
|
|
528
|
+
return fs$readSync.call(fs3, fd, buffer, offset2, length3, position);
|
|
298
529
|
} catch (er) {
|
|
299
530
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
300
531
|
eagCounter++;
|
|
@@ -304,11 +535,11 @@ var require_polyfills = __commonJS({
|
|
|
304
535
|
}
|
|
305
536
|
}
|
|
306
537
|
};
|
|
307
|
-
}(
|
|
308
|
-
function patchLchmod(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
538
|
+
}(fs3.readSync);
|
|
539
|
+
function patchLchmod(fs4) {
|
|
540
|
+
fs4.lchmod = function(path9, mode, callback) {
|
|
541
|
+
fs4.open(
|
|
542
|
+
path9,
|
|
312
543
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
313
544
|
mode,
|
|
314
545
|
function(err, fd) {
|
|
@@ -316,80 +547,80 @@ var require_polyfills = __commonJS({
|
|
|
316
547
|
if (callback) callback(err);
|
|
317
548
|
return;
|
|
318
549
|
}
|
|
319
|
-
|
|
320
|
-
|
|
550
|
+
fs4.fchmod(fd, mode, function(err2) {
|
|
551
|
+
fs4.close(fd, function(err22) {
|
|
321
552
|
if (callback) callback(err2 || err22);
|
|
322
553
|
});
|
|
323
554
|
});
|
|
324
555
|
}
|
|
325
556
|
);
|
|
326
557
|
};
|
|
327
|
-
|
|
328
|
-
var fd =
|
|
558
|
+
fs4.lchmodSync = function(path9, mode) {
|
|
559
|
+
var fd = fs4.openSync(path9, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
329
560
|
var threw = true;
|
|
330
561
|
var ret;
|
|
331
562
|
try {
|
|
332
|
-
ret =
|
|
563
|
+
ret = fs4.fchmodSync(fd, mode);
|
|
333
564
|
threw = false;
|
|
334
565
|
} finally {
|
|
335
566
|
if (threw) {
|
|
336
567
|
try {
|
|
337
|
-
|
|
568
|
+
fs4.closeSync(fd);
|
|
338
569
|
} catch (er) {
|
|
339
570
|
}
|
|
340
571
|
} else {
|
|
341
|
-
|
|
572
|
+
fs4.closeSync(fd);
|
|
342
573
|
}
|
|
343
574
|
}
|
|
344
575
|
return ret;
|
|
345
576
|
};
|
|
346
577
|
}
|
|
347
|
-
function patchLutimes(
|
|
348
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
349
|
-
|
|
350
|
-
|
|
578
|
+
function patchLutimes(fs4) {
|
|
579
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
580
|
+
fs4.lutimes = function(path9, at2, mt, cb) {
|
|
581
|
+
fs4.open(path9, constants.O_SYMLINK, function(er, fd) {
|
|
351
582
|
if (er) {
|
|
352
583
|
if (cb) cb(er);
|
|
353
584
|
return;
|
|
354
585
|
}
|
|
355
|
-
|
|
356
|
-
|
|
586
|
+
fs4.futimes(fd, at2, mt, function(er2) {
|
|
587
|
+
fs4.close(fd, function(er22) {
|
|
357
588
|
if (cb) cb(er2 || er22);
|
|
358
589
|
});
|
|
359
590
|
});
|
|
360
591
|
});
|
|
361
592
|
};
|
|
362
|
-
|
|
363
|
-
var fd =
|
|
593
|
+
fs4.lutimesSync = function(path9, at2, mt) {
|
|
594
|
+
var fd = fs4.openSync(path9, constants.O_SYMLINK);
|
|
364
595
|
var ret;
|
|
365
596
|
var threw = true;
|
|
366
597
|
try {
|
|
367
|
-
ret =
|
|
598
|
+
ret = fs4.futimesSync(fd, at2, mt);
|
|
368
599
|
threw = false;
|
|
369
600
|
} finally {
|
|
370
601
|
if (threw) {
|
|
371
602
|
try {
|
|
372
|
-
|
|
603
|
+
fs4.closeSync(fd);
|
|
373
604
|
} catch (er) {
|
|
374
605
|
}
|
|
375
606
|
} else {
|
|
376
|
-
|
|
607
|
+
fs4.closeSync(fd);
|
|
377
608
|
}
|
|
378
609
|
}
|
|
379
610
|
return ret;
|
|
380
611
|
};
|
|
381
|
-
} else if (
|
|
382
|
-
|
|
612
|
+
} else if (fs4.futimes) {
|
|
613
|
+
fs4.lutimes = function(_a, _b, _c, cb) {
|
|
383
614
|
if (cb) process.nextTick(cb);
|
|
384
615
|
};
|
|
385
|
-
|
|
616
|
+
fs4.lutimesSync = function() {
|
|
386
617
|
};
|
|
387
618
|
}
|
|
388
619
|
}
|
|
389
620
|
function chmodFix(orig) {
|
|
390
621
|
if (!orig) return orig;
|
|
391
622
|
return function(target, mode, cb) {
|
|
392
|
-
return orig.call(
|
|
623
|
+
return orig.call(fs3, target, mode, function(er) {
|
|
393
624
|
if (chownErOk(er)) er = null;
|
|
394
625
|
if (cb) cb.apply(this, arguments);
|
|
395
626
|
});
|
|
@@ -399,7 +630,7 @@ var require_polyfills = __commonJS({
|
|
|
399
630
|
if (!orig) return orig;
|
|
400
631
|
return function(target, mode) {
|
|
401
632
|
try {
|
|
402
|
-
return orig.call(
|
|
633
|
+
return orig.call(fs3, target, mode);
|
|
403
634
|
} catch (er) {
|
|
404
635
|
if (!chownErOk(er)) throw er;
|
|
405
636
|
}
|
|
@@ -408,7 +639,7 @@ var require_polyfills = __commonJS({
|
|
|
408
639
|
function chownFix(orig) {
|
|
409
640
|
if (!orig) return orig;
|
|
410
641
|
return function(target, uid, gid, cb) {
|
|
411
|
-
return orig.call(
|
|
642
|
+
return orig.call(fs3, target, uid, gid, function(er) {
|
|
412
643
|
if (chownErOk(er)) er = null;
|
|
413
644
|
if (cb) cb.apply(this, arguments);
|
|
414
645
|
});
|
|
@@ -418,7 +649,7 @@ var require_polyfills = __commonJS({
|
|
|
418
649
|
if (!orig) return orig;
|
|
419
650
|
return function(target, uid, gid) {
|
|
420
651
|
try {
|
|
421
|
-
return orig.call(
|
|
652
|
+
return orig.call(fs3, target, uid, gid);
|
|
422
653
|
} catch (er) {
|
|
423
654
|
if (!chownErOk(er)) throw er;
|
|
424
655
|
}
|
|
@@ -438,13 +669,13 @@ var require_polyfills = __commonJS({
|
|
|
438
669
|
}
|
|
439
670
|
if (cb) cb.apply(this, arguments);
|
|
440
671
|
}
|
|
441
|
-
return options ? orig.call(
|
|
672
|
+
return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback);
|
|
442
673
|
};
|
|
443
674
|
}
|
|
444
675
|
function statFixSync(orig) {
|
|
445
676
|
if (!orig) return orig;
|
|
446
677
|
return function(target, options) {
|
|
447
|
-
var stats = options ? orig.call(
|
|
678
|
+
var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target);
|
|
448
679
|
if (stats) {
|
|
449
680
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
450
681
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -475,16 +706,16 @@ var require_legacy_streams = __commonJS({
|
|
|
475
706
|
init_esm_shims();
|
|
476
707
|
var Stream = __require("stream").Stream;
|
|
477
708
|
module.exports = legacy;
|
|
478
|
-
function legacy(
|
|
709
|
+
function legacy(fs3) {
|
|
479
710
|
return {
|
|
480
711
|
ReadStream,
|
|
481
712
|
WriteStream
|
|
482
713
|
};
|
|
483
|
-
function ReadStream(
|
|
484
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
714
|
+
function ReadStream(path9, options) {
|
|
715
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path9, options);
|
|
485
716
|
Stream.call(this);
|
|
486
717
|
var self2 = this;
|
|
487
|
-
this.path =
|
|
718
|
+
this.path = path9;
|
|
488
719
|
this.fd = null;
|
|
489
720
|
this.readable = true;
|
|
490
721
|
this.paused = false;
|
|
@@ -518,7 +749,7 @@ var require_legacy_streams = __commonJS({
|
|
|
518
749
|
});
|
|
519
750
|
return;
|
|
520
751
|
}
|
|
521
|
-
|
|
752
|
+
fs3.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
522
753
|
if (err) {
|
|
523
754
|
self2.emit("error", err);
|
|
524
755
|
self2.readable = false;
|
|
@@ -529,10 +760,10 @@ var require_legacy_streams = __commonJS({
|
|
|
529
760
|
self2._read();
|
|
530
761
|
});
|
|
531
762
|
}
|
|
532
|
-
function WriteStream(
|
|
533
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
763
|
+
function WriteStream(path9, options) {
|
|
764
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path9, options);
|
|
534
765
|
Stream.call(this);
|
|
535
|
-
this.path =
|
|
766
|
+
this.path = path9;
|
|
536
767
|
this.fd = null;
|
|
537
768
|
this.writable = true;
|
|
538
769
|
this.flags = "w";
|
|
@@ -557,7 +788,7 @@ var require_legacy_streams = __commonJS({
|
|
|
557
788
|
this.busy = false;
|
|
558
789
|
this._queue = [];
|
|
559
790
|
if (this.fd === null) {
|
|
560
|
-
this._open =
|
|
791
|
+
this._open = fs3.open;
|
|
561
792
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
562
793
|
this.flush();
|
|
563
794
|
}
|
|
@@ -595,7 +826,7 @@ var require_graceful_fs = __commonJS({
|
|
|
595
826
|
"../../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
596
827
|
"use strict";
|
|
597
828
|
init_esm_shims();
|
|
598
|
-
var
|
|
829
|
+
var fs3 = __require("fs");
|
|
599
830
|
var polyfills = require_polyfills();
|
|
600
831
|
var legacy = require_legacy_streams();
|
|
601
832
|
var clone4 = require_clone();
|
|
@@ -618,21 +849,21 @@ var require_graceful_fs = __commonJS({
|
|
|
618
849
|
}
|
|
619
850
|
});
|
|
620
851
|
}
|
|
621
|
-
var
|
|
852
|
+
var debug2 = noop;
|
|
622
853
|
if (util.debuglog)
|
|
623
|
-
|
|
854
|
+
debug2 = util.debuglog("gfs4");
|
|
624
855
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
625
|
-
|
|
856
|
+
debug2 = function() {
|
|
626
857
|
var m = util.format.apply(util, arguments);
|
|
627
858
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
628
859
|
console.error(m);
|
|
629
860
|
};
|
|
630
|
-
if (!
|
|
861
|
+
if (!fs3[gracefulQueue]) {
|
|
631
862
|
queue = global[gracefulQueue] || [];
|
|
632
|
-
publishQueue(
|
|
633
|
-
|
|
863
|
+
publishQueue(fs3, queue);
|
|
864
|
+
fs3.close = function(fs$close) {
|
|
634
865
|
function close(fd, cb) {
|
|
635
|
-
return fs$close.call(
|
|
866
|
+
return fs$close.call(fs3, fd, function(err) {
|
|
636
867
|
if (!err) {
|
|
637
868
|
resetQueue();
|
|
638
869
|
}
|
|
@@ -644,48 +875,48 @@ var require_graceful_fs = __commonJS({
|
|
|
644
875
|
value: fs$close
|
|
645
876
|
});
|
|
646
877
|
return close;
|
|
647
|
-
}(
|
|
648
|
-
|
|
878
|
+
}(fs3.close);
|
|
879
|
+
fs3.closeSync = function(fs$closeSync) {
|
|
649
880
|
function closeSync(fd) {
|
|
650
|
-
fs$closeSync.apply(
|
|
881
|
+
fs$closeSync.apply(fs3, arguments);
|
|
651
882
|
resetQueue();
|
|
652
883
|
}
|
|
653
884
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
654
885
|
value: fs$closeSync
|
|
655
886
|
});
|
|
656
887
|
return closeSync;
|
|
657
|
-
}(
|
|
888
|
+
}(fs3.closeSync);
|
|
658
889
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
659
890
|
process.on("exit", function() {
|
|
660
|
-
|
|
661
|
-
__require("assert").equal(
|
|
891
|
+
debug2(fs3[gracefulQueue]);
|
|
892
|
+
__require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
662
893
|
});
|
|
663
894
|
}
|
|
664
895
|
}
|
|
665
896
|
var queue;
|
|
666
897
|
if (!global[gracefulQueue]) {
|
|
667
|
-
publishQueue(global,
|
|
668
|
-
}
|
|
669
|
-
module.exports = patch(clone4(
|
|
670
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
671
|
-
module.exports = patch(
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
function patch(
|
|
675
|
-
polyfills(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
var fs$readFile =
|
|
680
|
-
|
|
681
|
-
function readFile5(
|
|
898
|
+
publishQueue(global, fs3[gracefulQueue]);
|
|
899
|
+
}
|
|
900
|
+
module.exports = patch(clone4(fs3));
|
|
901
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) {
|
|
902
|
+
module.exports = patch(fs3);
|
|
903
|
+
fs3.__patched = true;
|
|
904
|
+
}
|
|
905
|
+
function patch(fs4) {
|
|
906
|
+
polyfills(fs4);
|
|
907
|
+
fs4.gracefulify = patch;
|
|
908
|
+
fs4.createReadStream = createReadStream;
|
|
909
|
+
fs4.createWriteStream = createWriteStream;
|
|
910
|
+
var fs$readFile = fs4.readFile;
|
|
911
|
+
fs4.readFile = readFile5;
|
|
912
|
+
function readFile5(path9, options, cb) {
|
|
682
913
|
if (typeof options === "function")
|
|
683
914
|
cb = options, options = null;
|
|
684
|
-
return go$readFile(
|
|
685
|
-
function go$readFile(
|
|
686
|
-
return fs$readFile(
|
|
915
|
+
return go$readFile(path9, options, cb);
|
|
916
|
+
function go$readFile(path10, options2, cb2, startTime) {
|
|
917
|
+
return fs$readFile(path10, options2, function(err) {
|
|
687
918
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
688
|
-
enqueue([go$readFile, [
|
|
919
|
+
enqueue([go$readFile, [path10, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
689
920
|
else {
|
|
690
921
|
if (typeof cb2 === "function")
|
|
691
922
|
cb2.apply(this, arguments);
|
|
@@ -693,16 +924,16 @@ var require_graceful_fs = __commonJS({
|
|
|
693
924
|
});
|
|
694
925
|
}
|
|
695
926
|
}
|
|
696
|
-
var fs$writeFile =
|
|
697
|
-
|
|
698
|
-
function writeFile3(
|
|
927
|
+
var fs$writeFile = fs4.writeFile;
|
|
928
|
+
fs4.writeFile = writeFile3;
|
|
929
|
+
function writeFile3(path9, data2, options, cb) {
|
|
699
930
|
if (typeof options === "function")
|
|
700
931
|
cb = options, options = null;
|
|
701
|
-
return go$writeFile(
|
|
702
|
-
function go$writeFile(
|
|
703
|
-
return fs$writeFile(
|
|
932
|
+
return go$writeFile(path9, data2, options, cb);
|
|
933
|
+
function go$writeFile(path10, data3, options2, cb2, startTime) {
|
|
934
|
+
return fs$writeFile(path10, data3, options2, function(err) {
|
|
704
935
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
705
|
-
enqueue([go$writeFile, [
|
|
936
|
+
enqueue([go$writeFile, [path10, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
706
937
|
else {
|
|
707
938
|
if (typeof cb2 === "function")
|
|
708
939
|
cb2.apply(this, arguments);
|
|
@@ -710,17 +941,17 @@ var require_graceful_fs = __commonJS({
|
|
|
710
941
|
});
|
|
711
942
|
}
|
|
712
943
|
}
|
|
713
|
-
var fs$appendFile =
|
|
944
|
+
var fs$appendFile = fs4.appendFile;
|
|
714
945
|
if (fs$appendFile)
|
|
715
|
-
|
|
716
|
-
function appendFile(
|
|
946
|
+
fs4.appendFile = appendFile;
|
|
947
|
+
function appendFile(path9, data2, options, cb) {
|
|
717
948
|
if (typeof options === "function")
|
|
718
949
|
cb = options, options = null;
|
|
719
|
-
return go$appendFile(
|
|
720
|
-
function go$appendFile(
|
|
721
|
-
return fs$appendFile(
|
|
950
|
+
return go$appendFile(path9, data2, options, cb);
|
|
951
|
+
function go$appendFile(path10, data3, options2, cb2, startTime) {
|
|
952
|
+
return fs$appendFile(path10, data3, options2, function(err) {
|
|
722
953
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
723
|
-
enqueue([go$appendFile, [
|
|
954
|
+
enqueue([go$appendFile, [path10, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
724
955
|
else {
|
|
725
956
|
if (typeof cb2 === "function")
|
|
726
957
|
cb2.apply(this, arguments);
|
|
@@ -728,9 +959,9 @@ var require_graceful_fs = __commonJS({
|
|
|
728
959
|
});
|
|
729
960
|
}
|
|
730
961
|
}
|
|
731
|
-
var fs$copyFile =
|
|
962
|
+
var fs$copyFile = fs4.copyFile;
|
|
732
963
|
if (fs$copyFile)
|
|
733
|
-
|
|
964
|
+
fs4.copyFile = copyFile;
|
|
734
965
|
function copyFile(src, dest, flags, cb) {
|
|
735
966
|
if (typeof flags === "function") {
|
|
736
967
|
cb = flags;
|
|
@@ -748,34 +979,34 @@ var require_graceful_fs = __commonJS({
|
|
|
748
979
|
});
|
|
749
980
|
}
|
|
750
981
|
}
|
|
751
|
-
var fs$readdir =
|
|
752
|
-
|
|
982
|
+
var fs$readdir = fs4.readdir;
|
|
983
|
+
fs4.readdir = readdir;
|
|
753
984
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
754
|
-
function readdir(
|
|
985
|
+
function readdir(path9, options, cb) {
|
|
755
986
|
if (typeof options === "function")
|
|
756
987
|
cb = options, options = null;
|
|
757
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
758
|
-
return fs$readdir(
|
|
759
|
-
|
|
988
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path10, options2, cb2, startTime) {
|
|
989
|
+
return fs$readdir(path10, fs$readdirCallback(
|
|
990
|
+
path10,
|
|
760
991
|
options2,
|
|
761
992
|
cb2,
|
|
762
993
|
startTime
|
|
763
994
|
));
|
|
764
|
-
} : function go$readdir2(
|
|
765
|
-
return fs$readdir(
|
|
766
|
-
|
|
995
|
+
} : function go$readdir2(path10, options2, cb2, startTime) {
|
|
996
|
+
return fs$readdir(path10, options2, fs$readdirCallback(
|
|
997
|
+
path10,
|
|
767
998
|
options2,
|
|
768
999
|
cb2,
|
|
769
1000
|
startTime
|
|
770
1001
|
));
|
|
771
1002
|
};
|
|
772
|
-
return go$readdir(
|
|
773
|
-
function fs$readdirCallback(
|
|
1003
|
+
return go$readdir(path9, options, cb);
|
|
1004
|
+
function fs$readdirCallback(path10, options2, cb2, startTime) {
|
|
774
1005
|
return function(err, files) {
|
|
775
1006
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
776
1007
|
enqueue([
|
|
777
1008
|
go$readdir,
|
|
778
|
-
[
|
|
1009
|
+
[path10, options2, cb2],
|
|
779
1010
|
err,
|
|
780
1011
|
startTime || Date.now(),
|
|
781
1012
|
Date.now()
|
|
@@ -790,21 +1021,21 @@ var require_graceful_fs = __commonJS({
|
|
|
790
1021
|
}
|
|
791
1022
|
}
|
|
792
1023
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
793
|
-
var legStreams = legacy(
|
|
1024
|
+
var legStreams = legacy(fs4);
|
|
794
1025
|
ReadStream = legStreams.ReadStream;
|
|
795
1026
|
WriteStream = legStreams.WriteStream;
|
|
796
1027
|
}
|
|
797
|
-
var fs$ReadStream =
|
|
1028
|
+
var fs$ReadStream = fs4.ReadStream;
|
|
798
1029
|
if (fs$ReadStream) {
|
|
799
1030
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
800
1031
|
ReadStream.prototype.open = ReadStream$open;
|
|
801
1032
|
}
|
|
802
|
-
var fs$WriteStream =
|
|
1033
|
+
var fs$WriteStream = fs4.WriteStream;
|
|
803
1034
|
if (fs$WriteStream) {
|
|
804
1035
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
805
1036
|
WriteStream.prototype.open = WriteStream$open;
|
|
806
1037
|
}
|
|
807
|
-
Object.defineProperty(
|
|
1038
|
+
Object.defineProperty(fs4, "ReadStream", {
|
|
808
1039
|
get: function() {
|
|
809
1040
|
return ReadStream;
|
|
810
1041
|
},
|
|
@@ -814,7 +1045,7 @@ var require_graceful_fs = __commonJS({
|
|
|
814
1045
|
enumerable: true,
|
|
815
1046
|
configurable: true
|
|
816
1047
|
});
|
|
817
|
-
Object.defineProperty(
|
|
1048
|
+
Object.defineProperty(fs4, "WriteStream", {
|
|
818
1049
|
get: function() {
|
|
819
1050
|
return WriteStream;
|
|
820
1051
|
},
|
|
@@ -825,7 +1056,7 @@ var require_graceful_fs = __commonJS({
|
|
|
825
1056
|
configurable: true
|
|
826
1057
|
});
|
|
827
1058
|
var FileReadStream = ReadStream;
|
|
828
|
-
Object.defineProperty(
|
|
1059
|
+
Object.defineProperty(fs4, "FileReadStream", {
|
|
829
1060
|
get: function() {
|
|
830
1061
|
return FileReadStream;
|
|
831
1062
|
},
|
|
@@ -836,7 +1067,7 @@ var require_graceful_fs = __commonJS({
|
|
|
836
1067
|
configurable: true
|
|
837
1068
|
});
|
|
838
1069
|
var FileWriteStream = WriteStream;
|
|
839
|
-
Object.defineProperty(
|
|
1070
|
+
Object.defineProperty(fs4, "FileWriteStream", {
|
|
840
1071
|
get: function() {
|
|
841
1072
|
return FileWriteStream;
|
|
842
1073
|
},
|
|
@@ -846,7 +1077,7 @@ var require_graceful_fs = __commonJS({
|
|
|
846
1077
|
enumerable: true,
|
|
847
1078
|
configurable: true
|
|
848
1079
|
});
|
|
849
|
-
function ReadStream(
|
|
1080
|
+
function ReadStream(path9, options) {
|
|
850
1081
|
if (this instanceof ReadStream)
|
|
851
1082
|
return fs$ReadStream.apply(this, arguments), this;
|
|
852
1083
|
else
|
|
@@ -866,7 +1097,7 @@ var require_graceful_fs = __commonJS({
|
|
|
866
1097
|
}
|
|
867
1098
|
});
|
|
868
1099
|
}
|
|
869
|
-
function WriteStream(
|
|
1100
|
+
function WriteStream(path9, options) {
|
|
870
1101
|
if (this instanceof WriteStream)
|
|
871
1102
|
return fs$WriteStream.apply(this, arguments), this;
|
|
872
1103
|
else
|
|
@@ -884,22 +1115,22 @@ var require_graceful_fs = __commonJS({
|
|
|
884
1115
|
}
|
|
885
1116
|
});
|
|
886
1117
|
}
|
|
887
|
-
function createReadStream(
|
|
888
|
-
return new
|
|
1118
|
+
function createReadStream(path9, options) {
|
|
1119
|
+
return new fs4.ReadStream(path9, options);
|
|
889
1120
|
}
|
|
890
|
-
function createWriteStream(
|
|
891
|
-
return new
|
|
1121
|
+
function createWriteStream(path9, options) {
|
|
1122
|
+
return new fs4.WriteStream(path9, options);
|
|
892
1123
|
}
|
|
893
|
-
var fs$open =
|
|
894
|
-
|
|
895
|
-
function open(
|
|
1124
|
+
var fs$open = fs4.open;
|
|
1125
|
+
fs4.open = open;
|
|
1126
|
+
function open(path9, flags, mode, cb) {
|
|
896
1127
|
if (typeof mode === "function")
|
|
897
1128
|
cb = mode, mode = null;
|
|
898
|
-
return go$open(
|
|
899
|
-
function go$open(
|
|
900
|
-
return fs$open(
|
|
1129
|
+
return go$open(path9, flags, mode, cb);
|
|
1130
|
+
function go$open(path10, flags2, mode2, cb2, startTime) {
|
|
1131
|
+
return fs$open(path10, flags2, mode2, function(err, fd) {
|
|
901
1132
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
902
|
-
enqueue([go$open, [
|
|
1133
|
+
enqueue([go$open, [path10, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
903
1134
|
else {
|
|
904
1135
|
if (typeof cb2 === "function")
|
|
905
1136
|
cb2.apply(this, arguments);
|
|
@@ -907,20 +1138,20 @@ var require_graceful_fs = __commonJS({
|
|
|
907
1138
|
});
|
|
908
1139
|
}
|
|
909
1140
|
}
|
|
910
|
-
return
|
|
1141
|
+
return fs4;
|
|
911
1142
|
}
|
|
912
1143
|
function enqueue(elem) {
|
|
913
|
-
|
|
914
|
-
|
|
1144
|
+
debug2("ENQUEUE", elem[0].name, elem[1]);
|
|
1145
|
+
fs3[gracefulQueue].push(elem);
|
|
915
1146
|
retry();
|
|
916
1147
|
}
|
|
917
1148
|
var retryTimer;
|
|
918
1149
|
function resetQueue() {
|
|
919
1150
|
var now = Date.now();
|
|
920
|
-
for (var i = 0; i <
|
|
921
|
-
if (
|
|
922
|
-
|
|
923
|
-
|
|
1151
|
+
for (var i = 0; i < fs3[gracefulQueue].length; ++i) {
|
|
1152
|
+
if (fs3[gracefulQueue][i].length > 2) {
|
|
1153
|
+
fs3[gracefulQueue][i][3] = now;
|
|
1154
|
+
fs3[gracefulQueue][i][4] = now;
|
|
924
1155
|
}
|
|
925
1156
|
}
|
|
926
1157
|
retry();
|
|
@@ -928,19 +1159,19 @@ var require_graceful_fs = __commonJS({
|
|
|
928
1159
|
function retry() {
|
|
929
1160
|
clearTimeout(retryTimer);
|
|
930
1161
|
retryTimer = void 0;
|
|
931
|
-
if (
|
|
1162
|
+
if (fs3[gracefulQueue].length === 0)
|
|
932
1163
|
return;
|
|
933
|
-
var elem =
|
|
1164
|
+
var elem = fs3[gracefulQueue].shift();
|
|
934
1165
|
var fn = elem[0];
|
|
935
1166
|
var args = elem[1];
|
|
936
1167
|
var err = elem[2];
|
|
937
1168
|
var startTime = elem[3];
|
|
938
1169
|
var lastTime = elem[4];
|
|
939
1170
|
if (startTime === void 0) {
|
|
940
|
-
|
|
1171
|
+
debug2("RETRY", fn.name, args);
|
|
941
1172
|
fn.apply(null, args);
|
|
942
1173
|
} else if (Date.now() - startTime >= 6e4) {
|
|
943
|
-
|
|
1174
|
+
debug2("TIMEOUT", fn.name, args);
|
|
944
1175
|
var cb = args.pop();
|
|
945
1176
|
if (typeof cb === "function")
|
|
946
1177
|
cb.call(null, err);
|
|
@@ -949,10 +1180,10 @@ var require_graceful_fs = __commonJS({
|
|
|
949
1180
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
950
1181
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
951
1182
|
if (sinceAttempt >= desiredDelay) {
|
|
952
|
-
|
|
1183
|
+
debug2("RETRY", fn.name, args);
|
|
953
1184
|
fn.apply(null, args.concat([startTime]));
|
|
954
1185
|
} else {
|
|
955
|
-
|
|
1186
|
+
fs3[gracefulQueue].push(elem);
|
|
956
1187
|
}
|
|
957
1188
|
}
|
|
958
1189
|
if (retryTimer === void 0) {
|
|
@@ -968,7 +1199,7 @@ var require_fs = __commonJS({
|
|
|
968
1199
|
"use strict";
|
|
969
1200
|
init_esm_shims();
|
|
970
1201
|
var u = require_universalify().fromCallback;
|
|
971
|
-
var
|
|
1202
|
+
var fs3 = require_graceful_fs();
|
|
972
1203
|
var api = [
|
|
973
1204
|
"access",
|
|
974
1205
|
"appendFile",
|
|
@@ -1005,57 +1236,57 @@ var require_fs = __commonJS({
|
|
|
1005
1236
|
"utimes",
|
|
1006
1237
|
"writeFile"
|
|
1007
1238
|
].filter((key) => {
|
|
1008
|
-
return typeof
|
|
1239
|
+
return typeof fs3[key] === "function";
|
|
1009
1240
|
});
|
|
1010
|
-
Object.assign(exports,
|
|
1241
|
+
Object.assign(exports, fs3);
|
|
1011
1242
|
api.forEach((method) => {
|
|
1012
|
-
exports[method] = u(
|
|
1243
|
+
exports[method] = u(fs3[method]);
|
|
1013
1244
|
});
|
|
1014
1245
|
exports.exists = function(filename, callback) {
|
|
1015
1246
|
if (typeof callback === "function") {
|
|
1016
|
-
return
|
|
1247
|
+
return fs3.exists(filename, callback);
|
|
1017
1248
|
}
|
|
1018
|
-
return new Promise((
|
|
1019
|
-
return
|
|
1249
|
+
return new Promise((resolve6) => {
|
|
1250
|
+
return fs3.exists(filename, resolve6);
|
|
1020
1251
|
});
|
|
1021
1252
|
};
|
|
1022
1253
|
exports.read = function(fd, buffer, offset2, length3, position, callback) {
|
|
1023
1254
|
if (typeof callback === "function") {
|
|
1024
|
-
return
|
|
1255
|
+
return fs3.read(fd, buffer, offset2, length3, position, callback);
|
|
1025
1256
|
}
|
|
1026
|
-
return new Promise((
|
|
1027
|
-
|
|
1257
|
+
return new Promise((resolve6, reject) => {
|
|
1258
|
+
fs3.read(fd, buffer, offset2, length3, position, (err, bytesRead, buffer2) => {
|
|
1028
1259
|
if (err) return reject(err);
|
|
1029
|
-
|
|
1260
|
+
resolve6({ bytesRead, buffer: buffer2 });
|
|
1030
1261
|
});
|
|
1031
1262
|
});
|
|
1032
1263
|
};
|
|
1033
1264
|
exports.write = function(fd, buffer, ...args) {
|
|
1034
1265
|
if (typeof args[args.length - 1] === "function") {
|
|
1035
|
-
return
|
|
1266
|
+
return fs3.write(fd, buffer, ...args);
|
|
1036
1267
|
}
|
|
1037
|
-
return new Promise((
|
|
1038
|
-
|
|
1268
|
+
return new Promise((resolve6, reject) => {
|
|
1269
|
+
fs3.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
1039
1270
|
if (err) return reject(err);
|
|
1040
|
-
|
|
1271
|
+
resolve6({ bytesWritten, buffer: buffer2 });
|
|
1041
1272
|
});
|
|
1042
1273
|
});
|
|
1043
1274
|
};
|
|
1044
|
-
if (typeof
|
|
1275
|
+
if (typeof fs3.writev === "function") {
|
|
1045
1276
|
exports.writev = function(fd, buffers, ...args) {
|
|
1046
1277
|
if (typeof args[args.length - 1] === "function") {
|
|
1047
|
-
return
|
|
1278
|
+
return fs3.writev(fd, buffers, ...args);
|
|
1048
1279
|
}
|
|
1049
|
-
return new Promise((
|
|
1050
|
-
|
|
1280
|
+
return new Promise((resolve6, reject) => {
|
|
1281
|
+
fs3.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
1051
1282
|
if (err) return reject(err);
|
|
1052
|
-
|
|
1283
|
+
resolve6({ bytesWritten, buffers: buffers2 });
|
|
1053
1284
|
});
|
|
1054
1285
|
});
|
|
1055
1286
|
};
|
|
1056
1287
|
}
|
|
1057
|
-
if (typeof
|
|
1058
|
-
exports.realpath.native = u(
|
|
1288
|
+
if (typeof fs3.realpath.native === "function") {
|
|
1289
|
+
exports.realpath.native = u(fs3.realpath.native);
|
|
1059
1290
|
} else {
|
|
1060
1291
|
process.emitWarning(
|
|
1061
1292
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -1071,10 +1302,10 @@ var require_utils = __commonJS({
|
|
|
1071
1302
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
|
|
1072
1303
|
"use strict";
|
|
1073
1304
|
init_esm_shims();
|
|
1074
|
-
var
|
|
1305
|
+
var path9 = __require("path");
|
|
1075
1306
|
module.exports.checkPath = function checkPath(pth) {
|
|
1076
1307
|
if (process.platform === "win32") {
|
|
1077
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
1308
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path9.parse(pth).root, ""));
|
|
1078
1309
|
if (pathHasInvalidWinCharacters) {
|
|
1079
1310
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1080
1311
|
error.code = "EINVAL";
|
|
@@ -1090,7 +1321,7 @@ var require_make_dir = __commonJS({
|
|
|
1090
1321
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
|
|
1091
1322
|
"use strict";
|
|
1092
1323
|
init_esm_shims();
|
|
1093
|
-
var
|
|
1324
|
+
var fs3 = require_fs();
|
|
1094
1325
|
var { checkPath } = require_utils();
|
|
1095
1326
|
var getMode = (options) => {
|
|
1096
1327
|
const defaults2 = { mode: 511 };
|
|
@@ -1099,14 +1330,14 @@ var require_make_dir = __commonJS({
|
|
|
1099
1330
|
};
|
|
1100
1331
|
module.exports.makeDir = async (dir, options) => {
|
|
1101
1332
|
checkPath(dir);
|
|
1102
|
-
return
|
|
1333
|
+
return fs3.mkdir(dir, {
|
|
1103
1334
|
mode: getMode(options),
|
|
1104
1335
|
recursive: true
|
|
1105
1336
|
});
|
|
1106
1337
|
};
|
|
1107
1338
|
module.exports.makeDirSync = (dir, options) => {
|
|
1108
1339
|
checkPath(dir);
|
|
1109
|
-
return
|
|
1340
|
+
return fs3.mkdirSync(dir, {
|
|
1110
1341
|
mode: getMode(options),
|
|
1111
1342
|
recursive: true
|
|
1112
1343
|
});
|
|
@@ -1140,13 +1371,13 @@ var require_path_exists = __commonJS({
|
|
|
1140
1371
|
"use strict";
|
|
1141
1372
|
init_esm_shims();
|
|
1142
1373
|
var u = require_universalify().fromPromise;
|
|
1143
|
-
var
|
|
1144
|
-
function pathExists(
|
|
1145
|
-
return
|
|
1374
|
+
var fs3 = require_fs();
|
|
1375
|
+
function pathExists(path9) {
|
|
1376
|
+
return fs3.access(path9).then(() => true).catch(() => false);
|
|
1146
1377
|
}
|
|
1147
1378
|
module.exports = {
|
|
1148
1379
|
pathExists: u(pathExists),
|
|
1149
|
-
pathExistsSync:
|
|
1380
|
+
pathExistsSync: fs3.existsSync
|
|
1150
1381
|
};
|
|
1151
1382
|
}
|
|
1152
1383
|
});
|
|
@@ -1156,21 +1387,21 @@ var require_utimes = __commonJS({
|
|
|
1156
1387
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
1157
1388
|
"use strict";
|
|
1158
1389
|
init_esm_shims();
|
|
1159
|
-
var
|
|
1160
|
-
function utimesMillis(
|
|
1161
|
-
|
|
1390
|
+
var fs3 = require_graceful_fs();
|
|
1391
|
+
function utimesMillis(path9, atime, mtime, callback) {
|
|
1392
|
+
fs3.open(path9, "r+", (err, fd) => {
|
|
1162
1393
|
if (err) return callback(err);
|
|
1163
|
-
|
|
1164
|
-
|
|
1394
|
+
fs3.futimes(fd, atime, mtime, (futimesErr) => {
|
|
1395
|
+
fs3.close(fd, (closeErr) => {
|
|
1165
1396
|
if (callback) callback(futimesErr || closeErr);
|
|
1166
1397
|
});
|
|
1167
1398
|
});
|
|
1168
1399
|
});
|
|
1169
1400
|
}
|
|
1170
|
-
function utimesMillisSync(
|
|
1171
|
-
const fd =
|
|
1172
|
-
|
|
1173
|
-
return
|
|
1401
|
+
function utimesMillisSync(path9, atime, mtime) {
|
|
1402
|
+
const fd = fs3.openSync(path9, "r+");
|
|
1403
|
+
fs3.futimesSync(fd, atime, mtime);
|
|
1404
|
+
return fs3.closeSync(fd);
|
|
1174
1405
|
}
|
|
1175
1406
|
module.exports = {
|
|
1176
1407
|
utimesMillis,
|
|
@@ -1184,11 +1415,11 @@ var require_stat = __commonJS({
|
|
|
1184
1415
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
|
|
1185
1416
|
"use strict";
|
|
1186
1417
|
init_esm_shims();
|
|
1187
|
-
var
|
|
1188
|
-
var
|
|
1418
|
+
var fs3 = require_fs();
|
|
1419
|
+
var path9 = __require("path");
|
|
1189
1420
|
var util = __require("util");
|
|
1190
1421
|
function getStats(src, dest, opts) {
|
|
1191
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1422
|
+
const statFunc = opts.dereference ? (file) => fs3.stat(file, { bigint: true }) : (file) => fs3.lstat(file, { bigint: true });
|
|
1192
1423
|
return Promise.all([
|
|
1193
1424
|
statFunc(src),
|
|
1194
1425
|
statFunc(dest).catch((err) => {
|
|
@@ -1199,7 +1430,7 @@ var require_stat = __commonJS({
|
|
|
1199
1430
|
}
|
|
1200
1431
|
function getStatsSync(src, dest, opts) {
|
|
1201
1432
|
let destStat;
|
|
1202
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1433
|
+
const statFunc = opts.dereference ? (file) => fs3.statSync(file, { bigint: true }) : (file) => fs3.lstatSync(file, { bigint: true });
|
|
1203
1434
|
const srcStat = statFunc(src);
|
|
1204
1435
|
try {
|
|
1205
1436
|
destStat = statFunc(dest);
|
|
@@ -1215,8 +1446,8 @@ var require_stat = __commonJS({
|
|
|
1215
1446
|
const { srcStat, destStat } = stats;
|
|
1216
1447
|
if (destStat) {
|
|
1217
1448
|
if (areIdentical(srcStat, destStat)) {
|
|
1218
|
-
const srcBaseName =
|
|
1219
|
-
const destBaseName =
|
|
1449
|
+
const srcBaseName = path9.basename(src);
|
|
1450
|
+
const destBaseName = path9.basename(dest);
|
|
1220
1451
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1221
1452
|
return cb(null, { srcStat, destStat, isChangingCase: true });
|
|
1222
1453
|
}
|
|
@@ -1239,8 +1470,8 @@ var require_stat = __commonJS({
|
|
|
1239
1470
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1240
1471
|
if (destStat) {
|
|
1241
1472
|
if (areIdentical(srcStat, destStat)) {
|
|
1242
|
-
const srcBaseName =
|
|
1243
|
-
const destBaseName =
|
|
1473
|
+
const srcBaseName = path9.basename(src);
|
|
1474
|
+
const destBaseName = path9.basename(dest);
|
|
1244
1475
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1245
1476
|
return { srcStat, destStat, isChangingCase: true };
|
|
1246
1477
|
}
|
|
@@ -1259,10 +1490,10 @@ var require_stat = __commonJS({
|
|
|
1259
1490
|
return { srcStat, destStat };
|
|
1260
1491
|
}
|
|
1261
1492
|
function checkParentPaths(src, srcStat, dest, funcName, cb) {
|
|
1262
|
-
const srcParent =
|
|
1263
|
-
const destParent =
|
|
1264
|
-
if (destParent === srcParent || destParent ===
|
|
1265
|
-
|
|
1493
|
+
const srcParent = path9.resolve(path9.dirname(src));
|
|
1494
|
+
const destParent = path9.resolve(path9.dirname(dest));
|
|
1495
|
+
if (destParent === srcParent || destParent === path9.parse(destParent).root) return cb();
|
|
1496
|
+
fs3.stat(destParent, { bigint: true }, (err, destStat) => {
|
|
1266
1497
|
if (err) {
|
|
1267
1498
|
if (err.code === "ENOENT") return cb();
|
|
1268
1499
|
return cb(err);
|
|
@@ -1274,12 +1505,12 @@ var require_stat = __commonJS({
|
|
|
1274
1505
|
});
|
|
1275
1506
|
}
|
|
1276
1507
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1277
|
-
const srcParent =
|
|
1278
|
-
const destParent =
|
|
1279
|
-
if (destParent === srcParent || destParent ===
|
|
1508
|
+
const srcParent = path9.resolve(path9.dirname(src));
|
|
1509
|
+
const destParent = path9.resolve(path9.dirname(dest));
|
|
1510
|
+
if (destParent === srcParent || destParent === path9.parse(destParent).root) return;
|
|
1280
1511
|
let destStat;
|
|
1281
1512
|
try {
|
|
1282
|
-
destStat =
|
|
1513
|
+
destStat = fs3.statSync(destParent, { bigint: true });
|
|
1283
1514
|
} catch (err) {
|
|
1284
1515
|
if (err.code === "ENOENT") return;
|
|
1285
1516
|
throw err;
|
|
@@ -1293,8 +1524,8 @@ var require_stat = __commonJS({
|
|
|
1293
1524
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1294
1525
|
}
|
|
1295
1526
|
function isSrcSubdir(src, dest) {
|
|
1296
|
-
const srcArr =
|
|
1297
|
-
const destArr =
|
|
1527
|
+
const srcArr = path9.resolve(src).split(path9.sep).filter((i) => i);
|
|
1528
|
+
const destArr = path9.resolve(dest).split(path9.sep).filter((i) => i);
|
|
1298
1529
|
return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
|
|
1299
1530
|
}
|
|
1300
1531
|
function errMsg(src, dest, funcName) {
|
|
@@ -1316,8 +1547,8 @@ var require_copy = __commonJS({
|
|
|
1316
1547
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
|
|
1317
1548
|
"use strict";
|
|
1318
1549
|
init_esm_shims();
|
|
1319
|
-
var
|
|
1320
|
-
var
|
|
1550
|
+
var fs3 = require_graceful_fs();
|
|
1551
|
+
var path9 = __require("path");
|
|
1321
1552
|
var mkdirs = require_mkdirs().mkdirs;
|
|
1322
1553
|
var pathExists = require_path_exists().pathExists;
|
|
1323
1554
|
var utimesMillis = require_utimes().utimesMillis;
|
|
@@ -1352,7 +1583,7 @@ var require_copy = __commonJS({
|
|
|
1352
1583
|
});
|
|
1353
1584
|
}
|
|
1354
1585
|
function checkParentDir(destStat, src, dest, opts, cb) {
|
|
1355
|
-
const destParent =
|
|
1586
|
+
const destParent = path9.dirname(dest);
|
|
1356
1587
|
pathExists(destParent, (err, dirExists) => {
|
|
1357
1588
|
if (err) return cb(err);
|
|
1358
1589
|
if (dirExists) return getStats(destStat, src, dest, opts, cb);
|
|
@@ -1373,7 +1604,7 @@ var require_copy = __commonJS({
|
|
|
1373
1604
|
return getStats(destStat, src, dest, opts, cb);
|
|
1374
1605
|
}
|
|
1375
1606
|
function getStats(destStat, src, dest, opts, cb) {
|
|
1376
|
-
const stat3 = opts.dereference ?
|
|
1607
|
+
const stat3 = opts.dereference ? fs3.stat : fs3.lstat;
|
|
1377
1608
|
stat3(src, (err, srcStat) => {
|
|
1378
1609
|
if (err) return cb(err);
|
|
1379
1610
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb);
|
|
@@ -1390,7 +1621,7 @@ var require_copy = __commonJS({
|
|
|
1390
1621
|
}
|
|
1391
1622
|
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
1392
1623
|
if (opts.overwrite) {
|
|
1393
|
-
|
|
1624
|
+
fs3.unlink(dest, (err) => {
|
|
1394
1625
|
if (err) return cb(err);
|
|
1395
1626
|
return copyFile(srcStat, src, dest, opts, cb);
|
|
1396
1627
|
});
|
|
@@ -1399,7 +1630,7 @@ var require_copy = __commonJS({
|
|
|
1399
1630
|
} else return cb();
|
|
1400
1631
|
}
|
|
1401
1632
|
function copyFile(srcStat, src, dest, opts, cb) {
|
|
1402
|
-
|
|
1633
|
+
fs3.copyFile(src, dest, (err) => {
|
|
1403
1634
|
if (err) return cb(err);
|
|
1404
1635
|
if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
|
|
1405
1636
|
return setDestMode(dest, srcStat.mode, cb);
|
|
@@ -1427,10 +1658,10 @@ var require_copy = __commonJS({
|
|
|
1427
1658
|
});
|
|
1428
1659
|
}
|
|
1429
1660
|
function setDestMode(dest, srcMode, cb) {
|
|
1430
|
-
return
|
|
1661
|
+
return fs3.chmod(dest, srcMode, cb);
|
|
1431
1662
|
}
|
|
1432
1663
|
function setDestTimestamps(src, dest, cb) {
|
|
1433
|
-
|
|
1664
|
+
fs3.stat(src, (err, updatedSrcStat) => {
|
|
1434
1665
|
if (err) return cb(err);
|
|
1435
1666
|
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
|
|
1436
1667
|
});
|
|
@@ -1440,7 +1671,7 @@ var require_copy = __commonJS({
|
|
|
1440
1671
|
return copyDir(src, dest, opts, cb);
|
|
1441
1672
|
}
|
|
1442
1673
|
function mkDirAndCopy(srcMode, src, dest, opts, cb) {
|
|
1443
|
-
|
|
1674
|
+
fs3.mkdir(dest, (err) => {
|
|
1444
1675
|
if (err) return cb(err);
|
|
1445
1676
|
copyDir(src, dest, opts, (err2) => {
|
|
1446
1677
|
if (err2) return cb(err2);
|
|
@@ -1449,7 +1680,7 @@ var require_copy = __commonJS({
|
|
|
1449
1680
|
});
|
|
1450
1681
|
}
|
|
1451
1682
|
function copyDir(src, dest, opts, cb) {
|
|
1452
|
-
|
|
1683
|
+
fs3.readdir(src, (err, items) => {
|
|
1453
1684
|
if (err) return cb(err);
|
|
1454
1685
|
return copyDirItems(items, src, dest, opts, cb);
|
|
1455
1686
|
});
|
|
@@ -1460,8 +1691,8 @@ var require_copy = __commonJS({
|
|
|
1460
1691
|
return copyDirItem(items, item, src, dest, opts, cb);
|
|
1461
1692
|
}
|
|
1462
1693
|
function copyDirItem(items, item, src, dest, opts, cb) {
|
|
1463
|
-
const srcItem =
|
|
1464
|
-
const destItem =
|
|
1694
|
+
const srcItem = path9.join(src, item);
|
|
1695
|
+
const destItem = path9.join(dest, item);
|
|
1465
1696
|
stat2.checkPaths(srcItem, destItem, "copy", opts, (err, stats) => {
|
|
1466
1697
|
if (err) return cb(err);
|
|
1467
1698
|
const { destStat } = stats;
|
|
@@ -1472,21 +1703,21 @@ var require_copy = __commonJS({
|
|
|
1472
1703
|
});
|
|
1473
1704
|
}
|
|
1474
1705
|
function onLink(destStat, src, dest, opts, cb) {
|
|
1475
|
-
|
|
1706
|
+
fs3.readlink(src, (err, resolvedSrc) => {
|
|
1476
1707
|
if (err) return cb(err);
|
|
1477
1708
|
if (opts.dereference) {
|
|
1478
|
-
resolvedSrc =
|
|
1709
|
+
resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
|
|
1479
1710
|
}
|
|
1480
1711
|
if (!destStat) {
|
|
1481
|
-
return
|
|
1712
|
+
return fs3.symlink(resolvedSrc, dest, cb);
|
|
1482
1713
|
} else {
|
|
1483
|
-
|
|
1714
|
+
fs3.readlink(dest, (err2, resolvedDest) => {
|
|
1484
1715
|
if (err2) {
|
|
1485
|
-
if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return
|
|
1716
|
+
if (err2.code === "EINVAL" || err2.code === "UNKNOWN") return fs3.symlink(resolvedSrc, dest, cb);
|
|
1486
1717
|
return cb(err2);
|
|
1487
1718
|
}
|
|
1488
1719
|
if (opts.dereference) {
|
|
1489
|
-
resolvedDest =
|
|
1720
|
+
resolvedDest = path9.resolve(process.cwd(), resolvedDest);
|
|
1490
1721
|
}
|
|
1491
1722
|
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1492
1723
|
return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
|
|
@@ -1500,9 +1731,9 @@ var require_copy = __commonJS({
|
|
|
1500
1731
|
});
|
|
1501
1732
|
}
|
|
1502
1733
|
function copyLink(resolvedSrc, dest, cb) {
|
|
1503
|
-
|
|
1734
|
+
fs3.unlink(dest, (err) => {
|
|
1504
1735
|
if (err) return cb(err);
|
|
1505
|
-
return
|
|
1736
|
+
return fs3.symlink(resolvedSrc, dest, cb);
|
|
1506
1737
|
});
|
|
1507
1738
|
}
|
|
1508
1739
|
module.exports = copy;
|
|
@@ -1514,8 +1745,8 @@ var require_copy_sync = __commonJS({
|
|
|
1514
1745
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
|
|
1515
1746
|
"use strict";
|
|
1516
1747
|
init_esm_shims();
|
|
1517
|
-
var
|
|
1518
|
-
var
|
|
1748
|
+
var fs3 = require_graceful_fs();
|
|
1749
|
+
var path9 = __require("path");
|
|
1519
1750
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1520
1751
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1521
1752
|
var stat2 = require_stat();
|
|
@@ -1539,8 +1770,8 @@ var require_copy_sync = __commonJS({
|
|
|
1539
1770
|
}
|
|
1540
1771
|
function handleFilterAndCopy(destStat, src, dest, opts) {
|
|
1541
1772
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1542
|
-
const destParent =
|
|
1543
|
-
if (!
|
|
1773
|
+
const destParent = path9.dirname(dest);
|
|
1774
|
+
if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
|
|
1544
1775
|
return getStats(destStat, src, dest, opts);
|
|
1545
1776
|
}
|
|
1546
1777
|
function startCopy(destStat, src, dest, opts) {
|
|
@@ -1548,7 +1779,7 @@ var require_copy_sync = __commonJS({
|
|
|
1548
1779
|
return getStats(destStat, src, dest, opts);
|
|
1549
1780
|
}
|
|
1550
1781
|
function getStats(destStat, src, dest, opts) {
|
|
1551
|
-
const statSync = opts.dereference ?
|
|
1782
|
+
const statSync = opts.dereference ? fs3.statSync : fs3.lstatSync;
|
|
1552
1783
|
const srcStat = statSync(src);
|
|
1553
1784
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1554
1785
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1563,14 +1794,14 @@ var require_copy_sync = __commonJS({
|
|
|
1563
1794
|
}
|
|
1564
1795
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1565
1796
|
if (opts.overwrite) {
|
|
1566
|
-
|
|
1797
|
+
fs3.unlinkSync(dest);
|
|
1567
1798
|
return copyFile(srcStat, src, dest, opts);
|
|
1568
1799
|
} else if (opts.errorOnExist) {
|
|
1569
1800
|
throw new Error(`'${dest}' already exists`);
|
|
1570
1801
|
}
|
|
1571
1802
|
}
|
|
1572
1803
|
function copyFile(srcStat, src, dest, opts) {
|
|
1573
|
-
|
|
1804
|
+
fs3.copyFileSync(src, dest);
|
|
1574
1805
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1575
1806
|
return setDestMode(dest, srcStat.mode);
|
|
1576
1807
|
}
|
|
@@ -1585,10 +1816,10 @@ var require_copy_sync = __commonJS({
|
|
|
1585
1816
|
return setDestMode(dest, srcMode | 128);
|
|
1586
1817
|
}
|
|
1587
1818
|
function setDestMode(dest, srcMode) {
|
|
1588
|
-
return
|
|
1819
|
+
return fs3.chmodSync(dest, srcMode);
|
|
1589
1820
|
}
|
|
1590
1821
|
function setDestTimestamps(src, dest) {
|
|
1591
|
-
const updatedSrcStat =
|
|
1822
|
+
const updatedSrcStat = fs3.statSync(src);
|
|
1592
1823
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1593
1824
|
}
|
|
1594
1825
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -1596,49 +1827,49 @@ var require_copy_sync = __commonJS({
|
|
|
1596
1827
|
return copyDir(src, dest, opts);
|
|
1597
1828
|
}
|
|
1598
1829
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1599
|
-
|
|
1830
|
+
fs3.mkdirSync(dest);
|
|
1600
1831
|
copyDir(src, dest, opts);
|
|
1601
1832
|
return setDestMode(dest, srcMode);
|
|
1602
1833
|
}
|
|
1603
1834
|
function copyDir(src, dest, opts) {
|
|
1604
|
-
|
|
1835
|
+
fs3.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
1605
1836
|
}
|
|
1606
1837
|
function copyDirItem(item, src, dest, opts) {
|
|
1607
|
-
const srcItem =
|
|
1608
|
-
const destItem =
|
|
1838
|
+
const srcItem = path9.join(src, item);
|
|
1839
|
+
const destItem = path9.join(dest, item);
|
|
1609
1840
|
const { destStat } = stat2.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1610
1841
|
return startCopy(destStat, srcItem, destItem, opts);
|
|
1611
1842
|
}
|
|
1612
1843
|
function onLink(destStat, src, dest, opts) {
|
|
1613
|
-
let resolvedSrc =
|
|
1844
|
+
let resolvedSrc = fs3.readlinkSync(src);
|
|
1614
1845
|
if (opts.dereference) {
|
|
1615
|
-
resolvedSrc =
|
|
1846
|
+
resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
|
|
1616
1847
|
}
|
|
1617
1848
|
if (!destStat) {
|
|
1618
|
-
return
|
|
1849
|
+
return fs3.symlinkSync(resolvedSrc, dest);
|
|
1619
1850
|
} else {
|
|
1620
1851
|
let resolvedDest;
|
|
1621
1852
|
try {
|
|
1622
|
-
resolvedDest =
|
|
1853
|
+
resolvedDest = fs3.readlinkSync(dest);
|
|
1623
1854
|
} catch (err) {
|
|
1624
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
1855
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs3.symlinkSync(resolvedSrc, dest);
|
|
1625
1856
|
throw err;
|
|
1626
1857
|
}
|
|
1627
1858
|
if (opts.dereference) {
|
|
1628
|
-
resolvedDest =
|
|
1859
|
+
resolvedDest = path9.resolve(process.cwd(), resolvedDest);
|
|
1629
1860
|
}
|
|
1630
1861
|
if (stat2.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1631
1862
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
1632
1863
|
}
|
|
1633
|
-
if (
|
|
1864
|
+
if (fs3.statSync(dest).isDirectory() && stat2.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1634
1865
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1635
1866
|
}
|
|
1636
1867
|
return copyLink(resolvedSrc, dest);
|
|
1637
1868
|
}
|
|
1638
1869
|
}
|
|
1639
1870
|
function copyLink(resolvedSrc, dest) {
|
|
1640
|
-
|
|
1641
|
-
return
|
|
1871
|
+
fs3.unlinkSync(dest);
|
|
1872
|
+
return fs3.symlinkSync(resolvedSrc, dest);
|
|
1642
1873
|
}
|
|
1643
1874
|
module.exports = copySync;
|
|
1644
1875
|
}
|
|
@@ -1662,10 +1893,10 @@ var require_rimraf = __commonJS({
|
|
|
1662
1893
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/remove/rimraf.js"(exports, module) {
|
|
1663
1894
|
"use strict";
|
|
1664
1895
|
init_esm_shims();
|
|
1665
|
-
var
|
|
1666
|
-
var
|
|
1896
|
+
var fs3 = require_graceful_fs();
|
|
1897
|
+
var path9 = __require("path");
|
|
1667
1898
|
var assert = __require("assert");
|
|
1668
|
-
var
|
|
1899
|
+
var isWindows2 = process.platform === "win32";
|
|
1669
1900
|
function defaults2(options) {
|
|
1670
1901
|
const methods = [
|
|
1671
1902
|
"unlink",
|
|
@@ -1676,9 +1907,9 @@ var require_rimraf = __commonJS({
|
|
|
1676
1907
|
"readdir"
|
|
1677
1908
|
];
|
|
1678
1909
|
methods.forEach((m) => {
|
|
1679
|
-
options[m] = options[m] ||
|
|
1910
|
+
options[m] = options[m] || fs3[m];
|
|
1680
1911
|
m = m + "Sync";
|
|
1681
|
-
options[m] = options[m] ||
|
|
1912
|
+
options[m] = options[m] || fs3[m];
|
|
1682
1913
|
});
|
|
1683
1914
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
1684
1915
|
}
|
|
@@ -1714,7 +1945,7 @@ var require_rimraf = __commonJS({
|
|
|
1714
1945
|
if (er && er.code === "ENOENT") {
|
|
1715
1946
|
return cb(null);
|
|
1716
1947
|
}
|
|
1717
|
-
if (er && er.code === "EPERM" &&
|
|
1948
|
+
if (er && er.code === "EPERM" && isWindows2) {
|
|
1718
1949
|
return fixWinEPERM(p, options, er, cb);
|
|
1719
1950
|
}
|
|
1720
1951
|
if (st && st.isDirectory()) {
|
|
@@ -1726,7 +1957,7 @@ var require_rimraf = __commonJS({
|
|
|
1726
1957
|
return cb(null);
|
|
1727
1958
|
}
|
|
1728
1959
|
if (er2.code === "EPERM") {
|
|
1729
|
-
return
|
|
1960
|
+
return isWindows2 ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
|
|
1730
1961
|
}
|
|
1731
1962
|
if (er2.code === "EISDIR") {
|
|
1732
1963
|
return rmdir(p, options, er2, cb);
|
|
@@ -1808,7 +2039,7 @@ var require_rimraf = __commonJS({
|
|
|
1808
2039
|
let errState;
|
|
1809
2040
|
if (n3 === 0) return options.rmdir(p, cb);
|
|
1810
2041
|
files.forEach((f) => {
|
|
1811
|
-
rimraf(
|
|
2042
|
+
rimraf(path9.join(p, f), options, (er2) => {
|
|
1812
2043
|
if (errState) {
|
|
1813
2044
|
return;
|
|
1814
2045
|
}
|
|
@@ -1834,7 +2065,7 @@ var require_rimraf = __commonJS({
|
|
|
1834
2065
|
if (er.code === "ENOENT") {
|
|
1835
2066
|
return;
|
|
1836
2067
|
}
|
|
1837
|
-
if (er.code === "EPERM" &&
|
|
2068
|
+
if (er.code === "EPERM" && isWindows2) {
|
|
1838
2069
|
fixWinEPERMSync(p, options, er);
|
|
1839
2070
|
}
|
|
1840
2071
|
}
|
|
@@ -1848,7 +2079,7 @@ var require_rimraf = __commonJS({
|
|
|
1848
2079
|
if (er.code === "ENOENT") {
|
|
1849
2080
|
return;
|
|
1850
2081
|
} else if (er.code === "EPERM") {
|
|
1851
|
-
return
|
|
2082
|
+
return isWindows2 ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
|
|
1852
2083
|
} else if (er.code !== "EISDIR") {
|
|
1853
2084
|
throw er;
|
|
1854
2085
|
}
|
|
@@ -1873,8 +2104,8 @@ var require_rimraf = __commonJS({
|
|
|
1873
2104
|
function rmkidsSync(p, options) {
|
|
1874
2105
|
assert(p);
|
|
1875
2106
|
assert(options);
|
|
1876
|
-
options.readdirSync(p).forEach((f) => rimrafSync(
|
|
1877
|
-
if (
|
|
2107
|
+
options.readdirSync(p).forEach((f) => rimrafSync(path9.join(p, f), options));
|
|
2108
|
+
if (isWindows2) {
|
|
1878
2109
|
const startTime = Date.now();
|
|
1879
2110
|
do {
|
|
1880
2111
|
try {
|
|
@@ -1898,16 +2129,16 @@ var require_remove = __commonJS({
|
|
|
1898
2129
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
|
|
1899
2130
|
"use strict";
|
|
1900
2131
|
init_esm_shims();
|
|
1901
|
-
var
|
|
2132
|
+
var fs3 = require_graceful_fs();
|
|
1902
2133
|
var u = require_universalify().fromCallback;
|
|
1903
2134
|
var rimraf = require_rimraf();
|
|
1904
|
-
function remove2(
|
|
1905
|
-
if (
|
|
1906
|
-
rimraf(
|
|
2135
|
+
function remove2(path9, callback) {
|
|
2136
|
+
if (fs3.rm) return fs3.rm(path9, { recursive: true, force: true }, callback);
|
|
2137
|
+
rimraf(path9, callback);
|
|
1907
2138
|
}
|
|
1908
|
-
function removeSync(
|
|
1909
|
-
if (
|
|
1910
|
-
rimraf.sync(
|
|
2139
|
+
function removeSync(path9) {
|
|
2140
|
+
if (fs3.rmSync) return fs3.rmSync(path9, { recursive: true, force: true });
|
|
2141
|
+
rimraf.sync(path9);
|
|
1911
2142
|
}
|
|
1912
2143
|
module.exports = {
|
|
1913
2144
|
remove: u(remove2),
|
|
@@ -1922,28 +2153,28 @@ var require_empty = __commonJS({
|
|
|
1922
2153
|
"use strict";
|
|
1923
2154
|
init_esm_shims();
|
|
1924
2155
|
var u = require_universalify().fromPromise;
|
|
1925
|
-
var
|
|
1926
|
-
var
|
|
2156
|
+
var fs3 = require_fs();
|
|
2157
|
+
var path9 = __require("path");
|
|
1927
2158
|
var mkdir = require_mkdirs();
|
|
1928
2159
|
var remove2 = require_remove();
|
|
1929
2160
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
1930
2161
|
let items;
|
|
1931
2162
|
try {
|
|
1932
|
-
items = await
|
|
2163
|
+
items = await fs3.readdir(dir);
|
|
1933
2164
|
} catch {
|
|
1934
2165
|
return mkdir.mkdirs(dir);
|
|
1935
2166
|
}
|
|
1936
|
-
return Promise.all(items.map((item) => remove2.remove(
|
|
2167
|
+
return Promise.all(items.map((item) => remove2.remove(path9.join(dir, item))));
|
|
1937
2168
|
});
|
|
1938
2169
|
function emptyDirSync2(dir) {
|
|
1939
2170
|
let items;
|
|
1940
2171
|
try {
|
|
1941
|
-
items =
|
|
2172
|
+
items = fs3.readdirSync(dir);
|
|
1942
2173
|
} catch {
|
|
1943
2174
|
return mkdir.mkdirsSync(dir);
|
|
1944
2175
|
}
|
|
1945
2176
|
items.forEach((item) => {
|
|
1946
|
-
item =
|
|
2177
|
+
item = path9.join(dir, item);
|
|
1947
2178
|
remove2.removeSync(item);
|
|
1948
2179
|
});
|
|
1949
2180
|
}
|
|
@@ -1962,20 +2193,20 @@ var require_file = __commonJS({
|
|
|
1962
2193
|
"use strict";
|
|
1963
2194
|
init_esm_shims();
|
|
1964
2195
|
var u = require_universalify().fromCallback;
|
|
1965
|
-
var
|
|
1966
|
-
var
|
|
2196
|
+
var path9 = __require("path");
|
|
2197
|
+
var fs3 = require_graceful_fs();
|
|
1967
2198
|
var mkdir = require_mkdirs();
|
|
1968
2199
|
function createFile(file, callback) {
|
|
1969
2200
|
function makeFile() {
|
|
1970
|
-
|
|
2201
|
+
fs3.writeFile(file, "", (err) => {
|
|
1971
2202
|
if (err) return callback(err);
|
|
1972
2203
|
callback();
|
|
1973
2204
|
});
|
|
1974
2205
|
}
|
|
1975
|
-
|
|
2206
|
+
fs3.stat(file, (err, stats) => {
|
|
1976
2207
|
if (!err && stats.isFile()) return callback();
|
|
1977
|
-
const dir =
|
|
1978
|
-
|
|
2208
|
+
const dir = path9.dirname(file);
|
|
2209
|
+
fs3.stat(dir, (err2, stats2) => {
|
|
1979
2210
|
if (err2) {
|
|
1980
2211
|
if (err2.code === "ENOENT") {
|
|
1981
2212
|
return mkdir.mkdirs(dir, (err3) => {
|
|
@@ -1987,7 +2218,7 @@ var require_file = __commonJS({
|
|
|
1987
2218
|
}
|
|
1988
2219
|
if (stats2.isDirectory()) makeFile();
|
|
1989
2220
|
else {
|
|
1990
|
-
|
|
2221
|
+
fs3.readdir(dir, (err3) => {
|
|
1991
2222
|
if (err3) return callback(err3);
|
|
1992
2223
|
});
|
|
1993
2224
|
}
|
|
@@ -1997,20 +2228,20 @@ var require_file = __commonJS({
|
|
|
1997
2228
|
function createFileSync(file) {
|
|
1998
2229
|
let stats;
|
|
1999
2230
|
try {
|
|
2000
|
-
stats =
|
|
2231
|
+
stats = fs3.statSync(file);
|
|
2001
2232
|
} catch {
|
|
2002
2233
|
}
|
|
2003
2234
|
if (stats && stats.isFile()) return;
|
|
2004
|
-
const dir =
|
|
2235
|
+
const dir = path9.dirname(file);
|
|
2005
2236
|
try {
|
|
2006
|
-
if (!
|
|
2007
|
-
|
|
2237
|
+
if (!fs3.statSync(dir).isDirectory()) {
|
|
2238
|
+
fs3.readdirSync(dir);
|
|
2008
2239
|
}
|
|
2009
2240
|
} catch (err) {
|
|
2010
2241
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
2011
2242
|
else throw err;
|
|
2012
2243
|
}
|
|
2013
|
-
|
|
2244
|
+
fs3.writeFileSync(file, "");
|
|
2014
2245
|
}
|
|
2015
2246
|
module.exports = {
|
|
2016
2247
|
createFile: u(createFile),
|
|
@@ -2025,26 +2256,26 @@ var require_link = __commonJS({
|
|
|
2025
2256
|
"use strict";
|
|
2026
2257
|
init_esm_shims();
|
|
2027
2258
|
var u = require_universalify().fromCallback;
|
|
2028
|
-
var
|
|
2029
|
-
var
|
|
2259
|
+
var path9 = __require("path");
|
|
2260
|
+
var fs3 = require_graceful_fs();
|
|
2030
2261
|
var mkdir = require_mkdirs();
|
|
2031
2262
|
var pathExists = require_path_exists().pathExists;
|
|
2032
2263
|
var { areIdentical } = require_stat();
|
|
2033
2264
|
function createLink(srcpath, dstpath, callback) {
|
|
2034
2265
|
function makeLink(srcpath2, dstpath2) {
|
|
2035
|
-
|
|
2266
|
+
fs3.link(srcpath2, dstpath2, (err) => {
|
|
2036
2267
|
if (err) return callback(err);
|
|
2037
2268
|
callback(null);
|
|
2038
2269
|
});
|
|
2039
2270
|
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2271
|
+
fs3.lstat(dstpath, (_, dstStat) => {
|
|
2272
|
+
fs3.lstat(srcpath, (err, srcStat) => {
|
|
2042
2273
|
if (err) {
|
|
2043
2274
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
2044
2275
|
return callback(err);
|
|
2045
2276
|
}
|
|
2046
2277
|
if (dstStat && areIdentical(srcStat, dstStat)) return callback(null);
|
|
2047
|
-
const dir =
|
|
2278
|
+
const dir = path9.dirname(dstpath);
|
|
2048
2279
|
pathExists(dir, (err2, dirExists) => {
|
|
2049
2280
|
if (err2) return callback(err2);
|
|
2050
2281
|
if (dirExists) return makeLink(srcpath, dstpath);
|
|
@@ -2059,21 +2290,21 @@ var require_link = __commonJS({
|
|
|
2059
2290
|
function createLinkSync(srcpath, dstpath) {
|
|
2060
2291
|
let dstStat;
|
|
2061
2292
|
try {
|
|
2062
|
-
dstStat =
|
|
2293
|
+
dstStat = fs3.lstatSync(dstpath);
|
|
2063
2294
|
} catch {
|
|
2064
2295
|
}
|
|
2065
2296
|
try {
|
|
2066
|
-
const srcStat =
|
|
2297
|
+
const srcStat = fs3.lstatSync(srcpath);
|
|
2067
2298
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
2068
2299
|
} catch (err) {
|
|
2069
2300
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
2070
2301
|
throw err;
|
|
2071
2302
|
}
|
|
2072
|
-
const dir =
|
|
2073
|
-
const dirExists =
|
|
2074
|
-
if (dirExists) return
|
|
2303
|
+
const dir = path9.dirname(dstpath);
|
|
2304
|
+
const dirExists = fs3.existsSync(dir);
|
|
2305
|
+
if (dirExists) return fs3.linkSync(srcpath, dstpath);
|
|
2075
2306
|
mkdir.mkdirsSync(dir);
|
|
2076
|
-
return
|
|
2307
|
+
return fs3.linkSync(srcpath, dstpath);
|
|
2077
2308
|
}
|
|
2078
2309
|
module.exports = {
|
|
2079
2310
|
createLink: u(createLink),
|
|
@@ -2087,12 +2318,12 @@ var require_symlink_paths = __commonJS({
|
|
|
2087
2318
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
|
|
2088
2319
|
"use strict";
|
|
2089
2320
|
init_esm_shims();
|
|
2090
|
-
var
|
|
2091
|
-
var
|
|
2321
|
+
var path9 = __require("path");
|
|
2322
|
+
var fs3 = require_graceful_fs();
|
|
2092
2323
|
var pathExists = require_path_exists().pathExists;
|
|
2093
2324
|
function symlinkPaths(srcpath, dstpath, callback) {
|
|
2094
|
-
if (
|
|
2095
|
-
return
|
|
2325
|
+
if (path9.isAbsolute(srcpath)) {
|
|
2326
|
+
return fs3.lstat(srcpath, (err) => {
|
|
2096
2327
|
if (err) {
|
|
2097
2328
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
2098
2329
|
return callback(err);
|
|
@@ -2103,8 +2334,8 @@ var require_symlink_paths = __commonJS({
|
|
|
2103
2334
|
});
|
|
2104
2335
|
});
|
|
2105
2336
|
} else {
|
|
2106
|
-
const dstdir =
|
|
2107
|
-
const relativeToDst =
|
|
2337
|
+
const dstdir = path9.dirname(dstpath);
|
|
2338
|
+
const relativeToDst = path9.join(dstdir, srcpath);
|
|
2108
2339
|
return pathExists(relativeToDst, (err, exists) => {
|
|
2109
2340
|
if (err) return callback(err);
|
|
2110
2341
|
if (exists) {
|
|
@@ -2113,14 +2344,14 @@ var require_symlink_paths = __commonJS({
|
|
|
2113
2344
|
toDst: srcpath
|
|
2114
2345
|
});
|
|
2115
2346
|
} else {
|
|
2116
|
-
return
|
|
2347
|
+
return fs3.lstat(srcpath, (err2) => {
|
|
2117
2348
|
if (err2) {
|
|
2118
2349
|
err2.message = err2.message.replace("lstat", "ensureSymlink");
|
|
2119
2350
|
return callback(err2);
|
|
2120
2351
|
}
|
|
2121
2352
|
return callback(null, {
|
|
2122
2353
|
toCwd: srcpath,
|
|
2123
|
-
toDst:
|
|
2354
|
+
toDst: path9.relative(dstdir, srcpath)
|
|
2124
2355
|
});
|
|
2125
2356
|
});
|
|
2126
2357
|
}
|
|
@@ -2129,28 +2360,28 @@ var require_symlink_paths = __commonJS({
|
|
|
2129
2360
|
}
|
|
2130
2361
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
2131
2362
|
let exists;
|
|
2132
|
-
if (
|
|
2133
|
-
exists =
|
|
2363
|
+
if (path9.isAbsolute(srcpath)) {
|
|
2364
|
+
exists = fs3.existsSync(srcpath);
|
|
2134
2365
|
if (!exists) throw new Error("absolute srcpath does not exist");
|
|
2135
2366
|
return {
|
|
2136
2367
|
toCwd: srcpath,
|
|
2137
2368
|
toDst: srcpath
|
|
2138
2369
|
};
|
|
2139
2370
|
} else {
|
|
2140
|
-
const dstdir =
|
|
2141
|
-
const relativeToDst =
|
|
2142
|
-
exists =
|
|
2371
|
+
const dstdir = path9.dirname(dstpath);
|
|
2372
|
+
const relativeToDst = path9.join(dstdir, srcpath);
|
|
2373
|
+
exists = fs3.existsSync(relativeToDst);
|
|
2143
2374
|
if (exists) {
|
|
2144
2375
|
return {
|
|
2145
2376
|
toCwd: relativeToDst,
|
|
2146
2377
|
toDst: srcpath
|
|
2147
2378
|
};
|
|
2148
2379
|
} else {
|
|
2149
|
-
exists =
|
|
2380
|
+
exists = fs3.existsSync(srcpath);
|
|
2150
2381
|
if (!exists) throw new Error("relative srcpath does not exist");
|
|
2151
2382
|
return {
|
|
2152
2383
|
toCwd: srcpath,
|
|
2153
|
-
toDst:
|
|
2384
|
+
toDst: path9.relative(dstdir, srcpath)
|
|
2154
2385
|
};
|
|
2155
2386
|
}
|
|
2156
2387
|
}
|
|
@@ -2167,12 +2398,12 @@ var require_symlink_type = __commonJS({
|
|
|
2167
2398
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
|
|
2168
2399
|
"use strict";
|
|
2169
2400
|
init_esm_shims();
|
|
2170
|
-
var
|
|
2401
|
+
var fs3 = require_graceful_fs();
|
|
2171
2402
|
function symlinkType(srcpath, type, callback) {
|
|
2172
2403
|
callback = typeof type === "function" ? type : callback;
|
|
2173
2404
|
type = typeof type === "function" ? false : type;
|
|
2174
2405
|
if (type) return callback(null, type);
|
|
2175
|
-
|
|
2406
|
+
fs3.lstat(srcpath, (err, stats) => {
|
|
2176
2407
|
if (err) return callback(null, "file");
|
|
2177
2408
|
type = stats && stats.isDirectory() ? "dir" : "file";
|
|
2178
2409
|
callback(null, type);
|
|
@@ -2182,7 +2413,7 @@ var require_symlink_type = __commonJS({
|
|
|
2182
2413
|
let stats;
|
|
2183
2414
|
if (type) return type;
|
|
2184
2415
|
try {
|
|
2185
|
-
stats =
|
|
2416
|
+
stats = fs3.lstatSync(srcpath);
|
|
2186
2417
|
} catch {
|
|
2187
2418
|
return "file";
|
|
2188
2419
|
}
|
|
@@ -2201,8 +2432,8 @@ var require_symlink = __commonJS({
|
|
|
2201
2432
|
"use strict";
|
|
2202
2433
|
init_esm_shims();
|
|
2203
2434
|
var u = require_universalify().fromCallback;
|
|
2204
|
-
var
|
|
2205
|
-
var
|
|
2435
|
+
var path9 = __require("path");
|
|
2436
|
+
var fs3 = require_fs();
|
|
2206
2437
|
var _mkdirs = require_mkdirs();
|
|
2207
2438
|
var mkdirs = _mkdirs.mkdirs;
|
|
2208
2439
|
var mkdirsSync = _mkdirs.mkdirsSync;
|
|
@@ -2217,11 +2448,11 @@ var require_symlink = __commonJS({
|
|
|
2217
2448
|
function createSymlink(srcpath, dstpath, type, callback) {
|
|
2218
2449
|
callback = typeof type === "function" ? type : callback;
|
|
2219
2450
|
type = typeof type === "function" ? false : type;
|
|
2220
|
-
|
|
2451
|
+
fs3.lstat(dstpath, (err, stats) => {
|
|
2221
2452
|
if (!err && stats.isSymbolicLink()) {
|
|
2222
2453
|
Promise.all([
|
|
2223
|
-
|
|
2224
|
-
|
|
2454
|
+
fs3.stat(srcpath),
|
|
2455
|
+
fs3.stat(dstpath)
|
|
2225
2456
|
]).then(([srcStat, dstStat]) => {
|
|
2226
2457
|
if (areIdentical(srcStat, dstStat)) return callback(null);
|
|
2227
2458
|
_createSymlink(srcpath, dstpath, type, callback);
|
|
@@ -2230,18 +2461,18 @@ var require_symlink = __commonJS({
|
|
|
2230
2461
|
});
|
|
2231
2462
|
}
|
|
2232
2463
|
function _createSymlink(srcpath, dstpath, type, callback) {
|
|
2233
|
-
symlinkPaths(srcpath, dstpath, (err,
|
|
2464
|
+
symlinkPaths(srcpath, dstpath, (err, relative2) => {
|
|
2234
2465
|
if (err) return callback(err);
|
|
2235
|
-
srcpath =
|
|
2236
|
-
symlinkType(
|
|
2466
|
+
srcpath = relative2.toDst;
|
|
2467
|
+
symlinkType(relative2.toCwd, type, (err2, type2) => {
|
|
2237
2468
|
if (err2) return callback(err2);
|
|
2238
|
-
const dir =
|
|
2469
|
+
const dir = path9.dirname(dstpath);
|
|
2239
2470
|
pathExists(dir, (err3, dirExists) => {
|
|
2240
2471
|
if (err3) return callback(err3);
|
|
2241
|
-
if (dirExists) return
|
|
2472
|
+
if (dirExists) return fs3.symlink(srcpath, dstpath, type2, callback);
|
|
2242
2473
|
mkdirs(dir, (err4) => {
|
|
2243
2474
|
if (err4) return callback(err4);
|
|
2244
|
-
|
|
2475
|
+
fs3.symlink(srcpath, dstpath, type2, callback);
|
|
2245
2476
|
});
|
|
2246
2477
|
});
|
|
2247
2478
|
});
|
|
@@ -2250,22 +2481,22 @@ var require_symlink = __commonJS({
|
|
|
2250
2481
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
2251
2482
|
let stats;
|
|
2252
2483
|
try {
|
|
2253
|
-
stats =
|
|
2484
|
+
stats = fs3.lstatSync(dstpath);
|
|
2254
2485
|
} catch {
|
|
2255
2486
|
}
|
|
2256
2487
|
if (stats && stats.isSymbolicLink()) {
|
|
2257
|
-
const srcStat =
|
|
2258
|
-
const dstStat =
|
|
2488
|
+
const srcStat = fs3.statSync(srcpath);
|
|
2489
|
+
const dstStat = fs3.statSync(dstpath);
|
|
2259
2490
|
if (areIdentical(srcStat, dstStat)) return;
|
|
2260
2491
|
}
|
|
2261
|
-
const
|
|
2262
|
-
srcpath =
|
|
2263
|
-
type = symlinkTypeSync(
|
|
2264
|
-
const dir =
|
|
2265
|
-
const exists =
|
|
2266
|
-
if (exists) return
|
|
2492
|
+
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
2493
|
+
srcpath = relative2.toDst;
|
|
2494
|
+
type = symlinkTypeSync(relative2.toCwd, type);
|
|
2495
|
+
const dir = path9.dirname(dstpath);
|
|
2496
|
+
const exists = fs3.existsSync(dir);
|
|
2497
|
+
if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
|
|
2267
2498
|
mkdirsSync(dir);
|
|
2268
|
-
return
|
|
2499
|
+
return fs3.symlinkSync(srcpath, dstpath, type);
|
|
2269
2500
|
}
|
|
2270
2501
|
module.exports = {
|
|
2271
2502
|
createSymlink: u(createSymlink),
|
|
@@ -2337,9 +2568,9 @@ var require_jsonfile = __commonJS({
|
|
|
2337
2568
|
if (typeof options === "string") {
|
|
2338
2569
|
options = { encoding: options };
|
|
2339
2570
|
}
|
|
2340
|
-
const
|
|
2571
|
+
const fs3 = options.fs || _fs;
|
|
2341
2572
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2342
|
-
let data2 = await universalify.fromCallback(
|
|
2573
|
+
let data2 = await universalify.fromCallback(fs3.readFile)(file, options);
|
|
2343
2574
|
data2 = stripBom(data2);
|
|
2344
2575
|
let obj;
|
|
2345
2576
|
try {
|
|
@@ -2355,14 +2586,14 @@ var require_jsonfile = __commonJS({
|
|
|
2355
2586
|
return obj;
|
|
2356
2587
|
}
|
|
2357
2588
|
var readFile5 = universalify.fromPromise(_readFile);
|
|
2358
|
-
function
|
|
2589
|
+
function readFileSync2(file, options = {}) {
|
|
2359
2590
|
if (typeof options === "string") {
|
|
2360
2591
|
options = { encoding: options };
|
|
2361
2592
|
}
|
|
2362
|
-
const
|
|
2593
|
+
const fs3 = options.fs || _fs;
|
|
2363
2594
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2364
2595
|
try {
|
|
2365
|
-
let content =
|
|
2596
|
+
let content = fs3.readFileSync(file, options);
|
|
2366
2597
|
content = stripBom(content);
|
|
2367
2598
|
return JSON.parse(content, options.reviver);
|
|
2368
2599
|
} catch (err) {
|
|
@@ -2375,19 +2606,19 @@ var require_jsonfile = __commonJS({
|
|
|
2375
2606
|
}
|
|
2376
2607
|
}
|
|
2377
2608
|
async function _writeFile(file, obj, options = {}) {
|
|
2378
|
-
const
|
|
2609
|
+
const fs3 = options.fs || _fs;
|
|
2379
2610
|
const str = stringify2(obj, options);
|
|
2380
|
-
await universalify.fromCallback(
|
|
2611
|
+
await universalify.fromCallback(fs3.writeFile)(file, str, options);
|
|
2381
2612
|
}
|
|
2382
2613
|
var writeFile3 = universalify.fromPromise(_writeFile);
|
|
2383
2614
|
function writeFileSync(file, obj, options = {}) {
|
|
2384
|
-
const
|
|
2615
|
+
const fs3 = options.fs || _fs;
|
|
2385
2616
|
const str = stringify2(obj, options);
|
|
2386
|
-
return
|
|
2617
|
+
return fs3.writeFileSync(file, str, options);
|
|
2387
2618
|
}
|
|
2388
2619
|
var jsonfile = {
|
|
2389
2620
|
readFile: readFile5,
|
|
2390
|
-
readFileSync,
|
|
2621
|
+
readFileSync: readFileSync2,
|
|
2391
2622
|
writeFile: writeFile3,
|
|
2392
2623
|
writeFileSync
|
|
2393
2624
|
};
|
|
@@ -2417,8 +2648,8 @@ var require_output_file = __commonJS({
|
|
|
2417
2648
|
"use strict";
|
|
2418
2649
|
init_esm_shims();
|
|
2419
2650
|
var u = require_universalify().fromCallback;
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2651
|
+
var fs3 = require_graceful_fs();
|
|
2652
|
+
var path9 = __require("path");
|
|
2422
2653
|
var mkdir = require_mkdirs();
|
|
2423
2654
|
var pathExists = require_path_exists().pathExists;
|
|
2424
2655
|
function outputFile(file, data2, encoding, callback) {
|
|
@@ -2426,23 +2657,23 @@ var require_output_file = __commonJS({
|
|
|
2426
2657
|
callback = encoding;
|
|
2427
2658
|
encoding = "utf8";
|
|
2428
2659
|
}
|
|
2429
|
-
const dir =
|
|
2660
|
+
const dir = path9.dirname(file);
|
|
2430
2661
|
pathExists(dir, (err, itDoes) => {
|
|
2431
2662
|
if (err) return callback(err);
|
|
2432
|
-
if (itDoes) return
|
|
2663
|
+
if (itDoes) return fs3.writeFile(file, data2, encoding, callback);
|
|
2433
2664
|
mkdir.mkdirs(dir, (err2) => {
|
|
2434
2665
|
if (err2) return callback(err2);
|
|
2435
|
-
|
|
2666
|
+
fs3.writeFile(file, data2, encoding, callback);
|
|
2436
2667
|
});
|
|
2437
2668
|
});
|
|
2438
2669
|
}
|
|
2439
2670
|
function outputFileSync(file, ...args) {
|
|
2440
|
-
const dir =
|
|
2441
|
-
if (
|
|
2442
|
-
return
|
|
2671
|
+
const dir = path9.dirname(file);
|
|
2672
|
+
if (fs3.existsSync(dir)) {
|
|
2673
|
+
return fs3.writeFileSync(file, ...args);
|
|
2443
2674
|
}
|
|
2444
2675
|
mkdir.mkdirsSync(dir);
|
|
2445
|
-
|
|
2676
|
+
fs3.writeFileSync(file, ...args);
|
|
2446
2677
|
}
|
|
2447
2678
|
module.exports = {
|
|
2448
2679
|
outputFile: u(outputFile),
|
|
@@ -2505,8 +2736,8 @@ var require_move = __commonJS({
|
|
|
2505
2736
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/move/move.js"(exports, module) {
|
|
2506
2737
|
"use strict";
|
|
2507
2738
|
init_esm_shims();
|
|
2508
|
-
var
|
|
2509
|
-
var
|
|
2739
|
+
var fs3 = require_graceful_fs();
|
|
2740
|
+
var path9 = __require("path");
|
|
2510
2741
|
var copy = require_copy2().copy;
|
|
2511
2742
|
var remove2 = require_remove().remove;
|
|
2512
2743
|
var mkdirp = require_mkdirs().mkdirp;
|
|
@@ -2525,7 +2756,7 @@ var require_move = __commonJS({
|
|
|
2525
2756
|
stat2.checkParentPaths(src, srcStat, dest, "move", (err2) => {
|
|
2526
2757
|
if (err2) return cb(err2);
|
|
2527
2758
|
if (isParentRoot(dest)) return doRename(src, dest, overwrite2, isChangingCase, cb);
|
|
2528
|
-
mkdirp(
|
|
2759
|
+
mkdirp(path9.dirname(dest), (err3) => {
|
|
2529
2760
|
if (err3) return cb(err3);
|
|
2530
2761
|
return doRename(src, dest, overwrite2, isChangingCase, cb);
|
|
2531
2762
|
});
|
|
@@ -2533,8 +2764,8 @@ var require_move = __commonJS({
|
|
|
2533
2764
|
});
|
|
2534
2765
|
}
|
|
2535
2766
|
function isParentRoot(dest) {
|
|
2536
|
-
const parent =
|
|
2537
|
-
const parsedPath =
|
|
2767
|
+
const parent = path9.dirname(dest);
|
|
2768
|
+
const parsedPath = path9.parse(parent);
|
|
2538
2769
|
return parsedPath.root === parent;
|
|
2539
2770
|
}
|
|
2540
2771
|
function doRename(src, dest, overwrite2, isChangingCase, cb) {
|
|
@@ -2552,7 +2783,7 @@ var require_move = __commonJS({
|
|
|
2552
2783
|
});
|
|
2553
2784
|
}
|
|
2554
2785
|
function rename(src, dest, overwrite2, cb) {
|
|
2555
|
-
|
|
2786
|
+
fs3.rename(src, dest, (err) => {
|
|
2556
2787
|
if (!err) return cb();
|
|
2557
2788
|
if (err.code !== "EXDEV") return cb(err);
|
|
2558
2789
|
return moveAcrossDevice(src, dest, overwrite2, cb);
|
|
@@ -2577,8 +2808,8 @@ var require_move_sync = __commonJS({
|
|
|
2577
2808
|
"../../node_modules/vite-plugin-externals/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
|
|
2578
2809
|
"use strict";
|
|
2579
2810
|
init_esm_shims();
|
|
2580
|
-
var
|
|
2581
|
-
var
|
|
2811
|
+
var fs3 = require_graceful_fs();
|
|
2812
|
+
var path9 = __require("path");
|
|
2582
2813
|
var copySync = require_copy2().copySync;
|
|
2583
2814
|
var removeSync = require_remove().removeSync;
|
|
2584
2815
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2588,12 +2819,12 @@ var require_move_sync = __commonJS({
|
|
|
2588
2819
|
const overwrite2 = opts.overwrite || opts.clobber || false;
|
|
2589
2820
|
const { srcStat, isChangingCase = false } = stat2.checkPathsSync(src, dest, "move", opts);
|
|
2590
2821
|
stat2.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2591
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2822
|
+
if (!isParentRoot(dest)) mkdirpSync(path9.dirname(dest));
|
|
2592
2823
|
return doRename(src, dest, overwrite2, isChangingCase);
|
|
2593
2824
|
}
|
|
2594
2825
|
function isParentRoot(dest) {
|
|
2595
|
-
const parent =
|
|
2596
|
-
const parsedPath =
|
|
2826
|
+
const parent = path9.dirname(dest);
|
|
2827
|
+
const parsedPath = path9.parse(parent);
|
|
2597
2828
|
return parsedPath.root === parent;
|
|
2598
2829
|
}
|
|
2599
2830
|
function doRename(src, dest, overwrite2, isChangingCase) {
|
|
@@ -2602,12 +2833,12 @@ var require_move_sync = __commonJS({
|
|
|
2602
2833
|
removeSync(dest);
|
|
2603
2834
|
return rename(src, dest, overwrite2);
|
|
2604
2835
|
}
|
|
2605
|
-
if (
|
|
2836
|
+
if (fs3.existsSync(dest)) throw new Error("dest already exists.");
|
|
2606
2837
|
return rename(src, dest, overwrite2);
|
|
2607
2838
|
}
|
|
2608
2839
|
function rename(src, dest, overwrite2) {
|
|
2609
2840
|
try {
|
|
2610
|
-
|
|
2841
|
+
fs3.renameSync(src, dest);
|
|
2611
2842
|
} catch (err) {
|
|
2612
2843
|
if (err.code !== "EXDEV") throw err;
|
|
2613
2844
|
return moveAcrossDevice(src, dest, overwrite2);
|
|
@@ -5252,10 +5483,10 @@ var require_helpers = __commonJS({
|
|
|
5252
5483
|
return !arr.includes(node, i + 1);
|
|
5253
5484
|
});
|
|
5254
5485
|
nodes.sort(function(a, b) {
|
|
5255
|
-
var
|
|
5256
|
-
if (
|
|
5486
|
+
var relative2 = compareDocumentPosition(a, b);
|
|
5487
|
+
if (relative2 & DocumentPosition.PRECEDING) {
|
|
5257
5488
|
return -1;
|
|
5258
|
-
} else if (
|
|
5489
|
+
} else if (relative2 & DocumentPosition.FOLLOWING) {
|
|
5259
5490
|
return 1;
|
|
5260
5491
|
}
|
|
5261
5492
|
return 0;
|
|
@@ -27134,6 +27365,383 @@ var require_rfdc = __commonJS({
|
|
|
27134
27365
|
// src/vite/configs/backend.ts
|
|
27135
27366
|
init_esm_shims();
|
|
27136
27367
|
|
|
27368
|
+
// ../../node_modules/vite-tsconfig-paths/dist/index.js
|
|
27369
|
+
init_esm_shims();
|
|
27370
|
+
var import_globrex = __toESM(require_globrex(), 1);
|
|
27371
|
+
var import_debug = __toESM(require_src(), 1);
|
|
27372
|
+
import * as fs from "fs";
|
|
27373
|
+
import { resolve as resolve3 } from "path";
|
|
27374
|
+
import { inspect } from "util";
|
|
27375
|
+
import { normalizePath as normalizePath2, searchForWorkspaceRoot } from "vite";
|
|
27376
|
+
import { resolve } from "path";
|
|
27377
|
+
import * as os from "os";
|
|
27378
|
+
import * as path from "path";
|
|
27379
|
+
import { normalizePath } from "vite";
|
|
27380
|
+
import { dirname } from "path";
|
|
27381
|
+
function resolvePathMappings(paths, base) {
|
|
27382
|
+
const sortedPatterns = Object.keys(paths).sort(
|
|
27383
|
+
(a, b) => getPrefixLength(b) - getPrefixLength(a)
|
|
27384
|
+
);
|
|
27385
|
+
const resolved = [];
|
|
27386
|
+
for (let pattern of sortedPatterns) {
|
|
27387
|
+
const relativePaths = paths[pattern];
|
|
27388
|
+
pattern = escapeStringRegexp(pattern).replace(/\*/g, "(.+)");
|
|
27389
|
+
resolved.push({
|
|
27390
|
+
pattern: new RegExp("^" + pattern + "$"),
|
|
27391
|
+
paths: relativePaths.map((relativePath) => resolve(base, relativePath))
|
|
27392
|
+
});
|
|
27393
|
+
}
|
|
27394
|
+
return resolved;
|
|
27395
|
+
}
|
|
27396
|
+
function getPrefixLength(pattern) {
|
|
27397
|
+
const prefixLength = pattern.indexOf("*");
|
|
27398
|
+
return pattern.substr(0, prefixLength).length;
|
|
27399
|
+
}
|
|
27400
|
+
function escapeStringRegexp(string) {
|
|
27401
|
+
return string.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
27402
|
+
}
|
|
27403
|
+
var isWindows = os.platform() == "win32";
|
|
27404
|
+
var resolve2 = isWindows ? (...paths) => normalizePath(path.win32.resolve(...paths)) : path.posix.resolve;
|
|
27405
|
+
var isAbsolute = isWindows ? path.win32.isAbsolute : path.posix.isAbsolute;
|
|
27406
|
+
var join = path.posix.join;
|
|
27407
|
+
var relative = path.posix.relative;
|
|
27408
|
+
var basename = path.posix.basename;
|
|
27409
|
+
var debug = (0, import_debug.default)("vite-tsconfig-paths");
|
|
27410
|
+
var debugResolve = (0, import_debug.default)("vite-tsconfig-paths:resolve");
|
|
27411
|
+
if (process.env.TEST) {
|
|
27412
|
+
import_debug.default.log = console.log.bind(console);
|
|
27413
|
+
}
|
|
27414
|
+
var notApplicable = [void 0, false];
|
|
27415
|
+
var notFound = [void 0, true];
|
|
27416
|
+
var src_default = (opts = {}) => {
|
|
27417
|
+
let resolversByDir;
|
|
27418
|
+
return {
|
|
27419
|
+
name: "vite-tsconfig-paths",
|
|
27420
|
+
enforce: "pre",
|
|
27421
|
+
async configResolved(config) {
|
|
27422
|
+
let projectRoot = config.root;
|
|
27423
|
+
let workspaceRoot;
|
|
27424
|
+
let { root } = opts;
|
|
27425
|
+
if (root) {
|
|
27426
|
+
root = resolve3(projectRoot, root);
|
|
27427
|
+
} else {
|
|
27428
|
+
workspaceRoot = searchForWorkspaceRoot(projectRoot);
|
|
27429
|
+
}
|
|
27430
|
+
debug("options.root ==", root);
|
|
27431
|
+
debug("project root ==", projectRoot);
|
|
27432
|
+
debug("workspace root ==", workspaceRoot);
|
|
27433
|
+
if (root) {
|
|
27434
|
+
projectRoot = root;
|
|
27435
|
+
workspaceRoot = root;
|
|
27436
|
+
}
|
|
27437
|
+
const tsconfck = await import("./src-MHMTXBSY.js");
|
|
27438
|
+
const projects = opts.projects ? opts.projects.map((file) => {
|
|
27439
|
+
if (!file.endsWith(".json")) {
|
|
27440
|
+
file = join(file, "tsconfig.json");
|
|
27441
|
+
}
|
|
27442
|
+
return resolve3(projectRoot, file);
|
|
27443
|
+
}) : await tsconfck.findAll(workspaceRoot, {
|
|
27444
|
+
configNames: opts.configNames || ["tsconfig.json", "jsconfig.json"],
|
|
27445
|
+
skip(dir) {
|
|
27446
|
+
if (dir === ".git" || dir === "node_modules") {
|
|
27447
|
+
return true;
|
|
27448
|
+
}
|
|
27449
|
+
if (typeof opts.skip === "function") {
|
|
27450
|
+
return opts.skip(dir);
|
|
27451
|
+
}
|
|
27452
|
+
return false;
|
|
27453
|
+
}
|
|
27454
|
+
});
|
|
27455
|
+
debug("projects:", projects);
|
|
27456
|
+
let hasTypeScriptDep = false;
|
|
27457
|
+
if (opts.parseNative) {
|
|
27458
|
+
try {
|
|
27459
|
+
const pkgJson = fs.readFileSync(
|
|
27460
|
+
join(workspaceRoot, "package.json"),
|
|
27461
|
+
"utf8"
|
|
27462
|
+
);
|
|
27463
|
+
const pkg = JSON.parse(pkgJson);
|
|
27464
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
27465
|
+
hasTypeScriptDep = "typescript" in deps;
|
|
27466
|
+
} catch (e) {
|
|
27467
|
+
if (e.code != "ENOENT") {
|
|
27468
|
+
throw e;
|
|
27469
|
+
}
|
|
27470
|
+
}
|
|
27471
|
+
}
|
|
27472
|
+
let firstError;
|
|
27473
|
+
const parseOptions = {
|
|
27474
|
+
cache: new tsconfck.TSConfckCache()
|
|
27475
|
+
};
|
|
27476
|
+
const parsedProjects = new Set(
|
|
27477
|
+
await Promise.all(
|
|
27478
|
+
projects.map((tsconfigFile) => {
|
|
27479
|
+
if (tsconfigFile === null) {
|
|
27480
|
+
debug("tsconfig file not found:", tsconfigFile);
|
|
27481
|
+
return null;
|
|
27482
|
+
}
|
|
27483
|
+
return (hasTypeScriptDep ? tsconfck.parseNative(tsconfigFile, parseOptions) : tsconfck.parse(tsconfigFile, parseOptions)).catch((error) => {
|
|
27484
|
+
if (opts.ignoreConfigErrors) {
|
|
27485
|
+
debug("tsconfig file caused a parsing error:", tsconfigFile);
|
|
27486
|
+
} else {
|
|
27487
|
+
config.logger.error(
|
|
27488
|
+
'[tsconfig-paths] An error occurred while parsing "' + tsconfigFile + '". See below for details.' + (firstError ? "" : " To disable this message, set the `ignoreConfigErrors` option to true."),
|
|
27489
|
+
{ error }
|
|
27490
|
+
);
|
|
27491
|
+
if (config.logger.hasErrorLogged(error)) {
|
|
27492
|
+
console.error(error);
|
|
27493
|
+
}
|
|
27494
|
+
firstError = error;
|
|
27495
|
+
}
|
|
27496
|
+
return null;
|
|
27497
|
+
});
|
|
27498
|
+
})
|
|
27499
|
+
)
|
|
27500
|
+
);
|
|
27501
|
+
resolversByDir = {};
|
|
27502
|
+
parsedProjects.forEach((project) => {
|
|
27503
|
+
if (!project) {
|
|
27504
|
+
return;
|
|
27505
|
+
}
|
|
27506
|
+
if (project.referenced) {
|
|
27507
|
+
project.referenced.forEach((projectRef) => {
|
|
27508
|
+
parsedProjects.add(projectRef);
|
|
27509
|
+
});
|
|
27510
|
+
parsedProjects.delete(project);
|
|
27511
|
+
parsedProjects.add(project);
|
|
27512
|
+
project.referenced = void 0;
|
|
27513
|
+
} else {
|
|
27514
|
+
const resolver = createResolver(project);
|
|
27515
|
+
if (resolver) {
|
|
27516
|
+
const projectDir = normalizePath2(dirname(project.tsconfigFile));
|
|
27517
|
+
const resolvers = resolversByDir[projectDir] || (resolversByDir[projectDir] = []);
|
|
27518
|
+
resolvers.push(resolver);
|
|
27519
|
+
}
|
|
27520
|
+
}
|
|
27521
|
+
});
|
|
27522
|
+
},
|
|
27523
|
+
async resolveId(id, importer, options) {
|
|
27524
|
+
if (debugResolve.enabled) {
|
|
27525
|
+
debugResolve("resolving:", { id, importer });
|
|
27526
|
+
}
|
|
27527
|
+
if (!importer) {
|
|
27528
|
+
debugResolve("importer is empty or undefined. skipping...");
|
|
27529
|
+
return;
|
|
27530
|
+
}
|
|
27531
|
+
if (relativeImportRE.test(id)) {
|
|
27532
|
+
debugResolve("id is a relative import. skipping...");
|
|
27533
|
+
return;
|
|
27534
|
+
}
|
|
27535
|
+
if (isAbsolute(id)) {
|
|
27536
|
+
debugResolve("id is an absolute path. skipping...");
|
|
27537
|
+
return;
|
|
27538
|
+
}
|
|
27539
|
+
if (id.includes("\0")) {
|
|
27540
|
+
debugResolve("id is a virtual module. skipping...");
|
|
27541
|
+
return;
|
|
27542
|
+
}
|
|
27543
|
+
const resolveOptions2 = { ...options, skipSelf: true };
|
|
27544
|
+
const viteResolve = async (id2, importer2) => {
|
|
27545
|
+
var _a;
|
|
27546
|
+
return (_a = await this.resolve(id2, importer2, resolveOptions2)) == null ? void 0 : _a.id;
|
|
27547
|
+
};
|
|
27548
|
+
let prevProjectDir;
|
|
27549
|
+
let projectDir = normalizePath2(dirname(importer));
|
|
27550
|
+
loop:
|
|
27551
|
+
while (projectDir && projectDir != prevProjectDir) {
|
|
27552
|
+
const resolvers = resolversByDir[projectDir];
|
|
27553
|
+
if (resolvers) {
|
|
27554
|
+
for (const resolve42 of resolvers) {
|
|
27555
|
+
const [resolved, matched] = await resolve42(viteResolve, id, importer);
|
|
27556
|
+
if (resolved) {
|
|
27557
|
+
return resolved;
|
|
27558
|
+
}
|
|
27559
|
+
if (matched) {
|
|
27560
|
+
break loop;
|
|
27561
|
+
}
|
|
27562
|
+
}
|
|
27563
|
+
}
|
|
27564
|
+
prevProjectDir = projectDir;
|
|
27565
|
+
projectDir = dirname(prevProjectDir);
|
|
27566
|
+
}
|
|
27567
|
+
}
|
|
27568
|
+
};
|
|
27569
|
+
function resolvePathsRootDir(project) {
|
|
27570
|
+
var _a, _b, _c, _d;
|
|
27571
|
+
if ("result" in project) {
|
|
27572
|
+
return (_b = (_a = project.result.options) == null ? void 0 : _a.pathsBasePath) != null ? _b : dirname(project.tsconfigFile);
|
|
27573
|
+
}
|
|
27574
|
+
const baseUrl = (_c = project.tsconfig.compilerOptions) == null ? void 0 : _c.baseUrl;
|
|
27575
|
+
if (baseUrl) {
|
|
27576
|
+
return baseUrl;
|
|
27577
|
+
}
|
|
27578
|
+
const projectWithPaths = (_d = project.extended) == null ? void 0 : _d.find(
|
|
27579
|
+
(p) => {
|
|
27580
|
+
var _a2;
|
|
27581
|
+
return (_a2 = p.tsconfig.compilerOptions) == null ? void 0 : _a2.paths;
|
|
27582
|
+
}
|
|
27583
|
+
);
|
|
27584
|
+
return dirname((projectWithPaths != null ? projectWithPaths : project).tsconfigFile);
|
|
27585
|
+
}
|
|
27586
|
+
function createResolver(project) {
|
|
27587
|
+
var _a, _b, _c, _d;
|
|
27588
|
+
const configPath = normalizePath2(project.tsconfigFile);
|
|
27589
|
+
const config = project.tsconfig;
|
|
27590
|
+
debug("config loaded:", inspect({ configPath, config }, false, 10, true));
|
|
27591
|
+
if (((_a = config.files) == null ? void 0 : _a.length) == 0 && !((_b = config.include) == null ? void 0 : _b.length)) {
|
|
27592
|
+
debug(
|
|
27593
|
+
`[!] skipping "${configPath}" as no files can be matched since "files" is empty and "include" is missing or empty`
|
|
27594
|
+
);
|
|
27595
|
+
return null;
|
|
27596
|
+
}
|
|
27597
|
+
const options = config.compilerOptions || {};
|
|
27598
|
+
const { baseUrl, paths } = options;
|
|
27599
|
+
if (!baseUrl && !paths) {
|
|
27600
|
+
debug(`[!] missing baseUrl and paths: "${configPath}"`);
|
|
27601
|
+
return null;
|
|
27602
|
+
}
|
|
27603
|
+
const resolveWithBaseUrl = baseUrl ? (viteResolve, id, importer) => {
|
|
27604
|
+
const absoluteId = join(baseUrl, id);
|
|
27605
|
+
debugResolve("trying with baseUrl:", absoluteId);
|
|
27606
|
+
return viteResolve(absoluteId, importer);
|
|
27607
|
+
} : void 0;
|
|
27608
|
+
let resolveId;
|
|
27609
|
+
if (paths) {
|
|
27610
|
+
const pathsRootDir = resolvePathsRootDir(project);
|
|
27611
|
+
const pathMappings = resolvePathMappings(paths, pathsRootDir);
|
|
27612
|
+
const resolveWithPaths = async (viteResolve, id, importer) => {
|
|
27613
|
+
for (const mapping of pathMappings) {
|
|
27614
|
+
const match5 = id.match(mapping.pattern);
|
|
27615
|
+
if (!match5) {
|
|
27616
|
+
continue;
|
|
27617
|
+
}
|
|
27618
|
+
for (let pathTemplate of mapping.paths) {
|
|
27619
|
+
let starCount = 0;
|
|
27620
|
+
const mappedId = pathTemplate.replace(/\*/g, () => {
|
|
27621
|
+
const matchIndex = Math.min(++starCount, match5.length - 1);
|
|
27622
|
+
return match5[matchIndex];
|
|
27623
|
+
});
|
|
27624
|
+
debugResolve("found match, trying to resolve:", mappedId);
|
|
27625
|
+
const resolved = await viteResolve(mappedId, importer);
|
|
27626
|
+
if (resolved) {
|
|
27627
|
+
return resolved;
|
|
27628
|
+
}
|
|
27629
|
+
}
|
|
27630
|
+
}
|
|
27631
|
+
};
|
|
27632
|
+
if (resolveWithBaseUrl) {
|
|
27633
|
+
resolveId = (viteResolve, id, importer) => resolveWithPaths(viteResolve, id, importer).then((resolved) => {
|
|
27634
|
+
return resolved != null ? resolved : resolveWithBaseUrl(viteResolve, id, importer);
|
|
27635
|
+
});
|
|
27636
|
+
} else {
|
|
27637
|
+
resolveId = resolveWithPaths;
|
|
27638
|
+
}
|
|
27639
|
+
} else {
|
|
27640
|
+
resolveId = resolveWithBaseUrl;
|
|
27641
|
+
}
|
|
27642
|
+
const configDir = dirname(configPath);
|
|
27643
|
+
let { outDir } = options;
|
|
27644
|
+
if (outDir && isAbsolute(outDir)) {
|
|
27645
|
+
outDir = relative(configDir, outDir);
|
|
27646
|
+
}
|
|
27647
|
+
const isIncludedRelative = getIncluder(
|
|
27648
|
+
(_c = config.include) == null ? void 0 : _c.map((p) => ensureRelative(configDir, p)),
|
|
27649
|
+
(_d = config.exclude) == null ? void 0 : _d.map((p) => ensureRelative(configDir, p)),
|
|
27650
|
+
outDir
|
|
27651
|
+
);
|
|
27652
|
+
const importerExtRE = opts.loose ? /./ : options.allowJs || basename(configPath).startsWith("jsconfig.") ? jsLikeRE : /\.[mc]?tsx?$/;
|
|
27653
|
+
const resolutionCache = /* @__PURE__ */ new Map();
|
|
27654
|
+
return async (viteResolve, id, importer) => {
|
|
27655
|
+
var _a2;
|
|
27656
|
+
importer = normalizePath2(importer);
|
|
27657
|
+
const importerFile = importer.replace(/[#?].+$/, "");
|
|
27658
|
+
if (!importerExtRE.test(importerFile)) {
|
|
27659
|
+
debugResolve("importer has unsupported extension. skipping...");
|
|
27660
|
+
return notApplicable;
|
|
27661
|
+
}
|
|
27662
|
+
const relativeImporterFile = relative(configDir, importerFile);
|
|
27663
|
+
if (!isIncludedRelative(relativeImporterFile)) {
|
|
27664
|
+
debugResolve("importer is not included. skipping...");
|
|
27665
|
+
return notApplicable;
|
|
27666
|
+
}
|
|
27667
|
+
const suffix = (_a2 = /\?.+$/.exec(id)) == null ? void 0 : _a2[0];
|
|
27668
|
+
if (suffix) {
|
|
27669
|
+
id = id.slice(0, -suffix.length);
|
|
27670
|
+
}
|
|
27671
|
+
let resolvedId = resolutionCache.get(id);
|
|
27672
|
+
if (!resolvedId) {
|
|
27673
|
+
resolvedId = await resolveId(viteResolve, id, importer);
|
|
27674
|
+
if (!resolvedId) {
|
|
27675
|
+
return notFound;
|
|
27676
|
+
}
|
|
27677
|
+
resolutionCache.set(id, resolvedId);
|
|
27678
|
+
if (debugResolve.enabled) {
|
|
27679
|
+
debugResolve("resolved without error:", {
|
|
27680
|
+
id,
|
|
27681
|
+
importer,
|
|
27682
|
+
resolvedId,
|
|
27683
|
+
configPath
|
|
27684
|
+
});
|
|
27685
|
+
}
|
|
27686
|
+
}
|
|
27687
|
+
if (suffix) {
|
|
27688
|
+
resolvedId += suffix;
|
|
27689
|
+
}
|
|
27690
|
+
return [resolvedId, true];
|
|
27691
|
+
};
|
|
27692
|
+
}
|
|
27693
|
+
};
|
|
27694
|
+
var jsLikeRE = /\.(vue|svelte|mdx|[mc]?[jt]sx?)$/;
|
|
27695
|
+
var relativeImportRE = /^\.\.?(\/|$)/;
|
|
27696
|
+
var defaultInclude = ["**/*"];
|
|
27697
|
+
var defaultExclude = [
|
|
27698
|
+
"**/node_modules",
|
|
27699
|
+
"**/bower_components",
|
|
27700
|
+
"**/jspm_packages"
|
|
27701
|
+
];
|
|
27702
|
+
function getIncluder(includePaths = defaultInclude, excludePaths = defaultExclude, outDir) {
|
|
27703
|
+
if (outDir) {
|
|
27704
|
+
excludePaths = excludePaths.concat(outDir);
|
|
27705
|
+
}
|
|
27706
|
+
if (includePaths.length || excludePaths.length) {
|
|
27707
|
+
const includers = [];
|
|
27708
|
+
const excluders = [];
|
|
27709
|
+
includePaths.forEach(addCompiledGlob, includers);
|
|
27710
|
+
excludePaths.forEach(addCompiledGlob, excluders);
|
|
27711
|
+
debug(`compiled globs:`, { includers, excluders });
|
|
27712
|
+
return (path22) => {
|
|
27713
|
+
path22 = path22.replace(/\?.+$/, "");
|
|
27714
|
+
if (!relativeImportRE.test(path22)) {
|
|
27715
|
+
path22 = "./" + path22;
|
|
27716
|
+
}
|
|
27717
|
+
const test = (glob) => glob.test(path22);
|
|
27718
|
+
return includers.some(test) && !excluders.some(test);
|
|
27719
|
+
};
|
|
27720
|
+
}
|
|
27721
|
+
return () => true;
|
|
27722
|
+
}
|
|
27723
|
+
function addCompiledGlob(glob) {
|
|
27724
|
+
const endsWithGlob = glob.split("/").pop().includes("*");
|
|
27725
|
+
const relativeGlob = relativeImportRE.test(glob) ? glob : "./" + glob;
|
|
27726
|
+
if (endsWithGlob) {
|
|
27727
|
+
this.push(compileGlob(relativeGlob));
|
|
27728
|
+
} else {
|
|
27729
|
+
this.push(compileGlob(relativeGlob + "/**"));
|
|
27730
|
+
if (/\.\w+$/.test(glob)) {
|
|
27731
|
+
this.push(compileGlob(relativeGlob));
|
|
27732
|
+
}
|
|
27733
|
+
}
|
|
27734
|
+
}
|
|
27735
|
+
function compileGlob(glob) {
|
|
27736
|
+
return (0, import_globrex.default)(glob, {
|
|
27737
|
+
extended: true,
|
|
27738
|
+
globstar: true
|
|
27739
|
+
}).regex;
|
|
27740
|
+
}
|
|
27741
|
+
function ensureRelative(dir, path22) {
|
|
27742
|
+
return isAbsolute(path22) ? relative(dir, path22) : path22;
|
|
27743
|
+
}
|
|
27744
|
+
|
|
27137
27745
|
// ../cli-miniflare/src/index.ts
|
|
27138
27746
|
init_esm_shims();
|
|
27139
27747
|
|
|
@@ -27150,7 +27758,7 @@ import { fetchModule } from "vite";
|
|
|
27150
27758
|
// ../../node_modules/get-port/index.js
|
|
27151
27759
|
init_esm_shims();
|
|
27152
27760
|
import net from "node:net";
|
|
27153
|
-
import
|
|
27761
|
+
import os2 from "node:os";
|
|
27154
27762
|
var Locked = class extends Error {
|
|
27155
27763
|
constructor(port) {
|
|
27156
27764
|
super(`${port} is locked`);
|
|
@@ -27163,7 +27771,7 @@ var lockedPorts = {
|
|
|
27163
27771
|
var releaseOldLockedPortsIntervalMs = 1e3 * 15;
|
|
27164
27772
|
var timeout;
|
|
27165
27773
|
var getLocalHosts = () => {
|
|
27166
|
-
const interfaces =
|
|
27774
|
+
const interfaces = os2.networkInterfaces();
|
|
27167
27775
|
const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
|
|
27168
27776
|
for (const _interface of Object.values(interfaces)) {
|
|
27169
27777
|
for (const config of _interface) {
|
|
@@ -27172,14 +27780,14 @@ var getLocalHosts = () => {
|
|
|
27172
27780
|
}
|
|
27173
27781
|
return results;
|
|
27174
27782
|
};
|
|
27175
|
-
var checkAvailablePort = (options) => new Promise((
|
|
27783
|
+
var checkAvailablePort = (options) => new Promise((resolve6, reject) => {
|
|
27176
27784
|
const server = net.createServer();
|
|
27177
27785
|
server.unref();
|
|
27178
27786
|
server.on("error", reject);
|
|
27179
27787
|
server.listen(options, () => {
|
|
27180
27788
|
const { port } = server.address();
|
|
27181
27789
|
server.close(() => {
|
|
27182
|
-
|
|
27790
|
+
resolve6(port);
|
|
27183
27791
|
});
|
|
27184
27792
|
});
|
|
27185
27793
|
});
|
|
@@ -27449,8 +28057,8 @@ for (let i = 0; i < chars.length; i++) {
|
|
|
27449
28057
|
intToChar[i] = c;
|
|
27450
28058
|
charToInt[c] = i;
|
|
27451
28059
|
}
|
|
27452
|
-
function encodeInteger(builder, num,
|
|
27453
|
-
let delta = num -
|
|
28060
|
+
function encodeInteger(builder, num, relative2) {
|
|
28061
|
+
let delta = num - relative2;
|
|
27454
28062
|
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
27455
28063
|
do {
|
|
27456
28064
|
let clamped = delta & 31;
|
|
@@ -28543,7 +29151,7 @@ var E;
|
|
|
28543
29151
|
|
|
28544
29152
|
// ../vite-optimize-backend-dependencies/src/utils.ts
|
|
28545
29153
|
init_esm_shims();
|
|
28546
|
-
import { join } from "node:path";
|
|
29154
|
+
import { join as join2 } from "node:path";
|
|
28547
29155
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
28548
29156
|
var postfixRE = /[?#].*$/;
|
|
28549
29157
|
var OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
|
|
@@ -28555,7 +29163,7 @@ function cleanUrl(url) {
|
|
|
28555
29163
|
return url.replace(postfixRE, "");
|
|
28556
29164
|
}
|
|
28557
29165
|
function isViteOptimized(id, projectFolder) {
|
|
28558
|
-
return id.startsWith(
|
|
29166
|
+
return id.startsWith(join2(projectFolder, "node_modules/.vite/deps_ssr"));
|
|
28559
29167
|
}
|
|
28560
29168
|
async function shouldOptimizeDependency(url) {
|
|
28561
29169
|
return url.includes("node_modules") && OPTIMIZABLE_ENTRY_RE.test(url) && !await fileHasModuleSyntax(url);
|
|
@@ -28572,7 +29180,7 @@ async function fileHasModuleSyntax(filePath) {
|
|
|
28572
29180
|
init_esm_shims();
|
|
28573
29181
|
import esbuild from "esbuild";
|
|
28574
29182
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
28575
|
-
import
|
|
29183
|
+
import path2, { join as join3 } from "node:path";
|
|
28576
29184
|
async function optimizeCjsDependency({
|
|
28577
29185
|
url,
|
|
28578
29186
|
projectFolder
|
|
@@ -28599,7 +29207,7 @@ async function optimizeCjsDependency({
|
|
|
28599
29207
|
});
|
|
28600
29208
|
});
|
|
28601
29209
|
const [output] = Object.entries(metafile.outputs).find(
|
|
28602
|
-
([, output2]) => output2.entryPoint &&
|
|
29210
|
+
([, output2]) => output2.entryPoint && path2.resolve(projectFolder, output2.entryPoint) === path2.resolve(url)
|
|
28603
29211
|
) ?? [];
|
|
28604
29212
|
if (!output) {
|
|
28605
29213
|
throw new CliError({
|
|
@@ -28607,7 +29215,7 @@ async function optimizeCjsDependency({
|
|
|
28607
29215
|
cause: null
|
|
28608
29216
|
});
|
|
28609
29217
|
}
|
|
28610
|
-
return readFile3(
|
|
29218
|
+
return readFile3(join3(projectFolder, output), "utf-8").catch(
|
|
28611
29219
|
(error) => {
|
|
28612
29220
|
throw new CliError({
|
|
28613
29221
|
code: CliErrorCode.FailedReadingEsbuildOutputFile(),
|
|
@@ -28884,6 +29492,10 @@ async function getViteConfig(model, options, { appSecret, webhookPublicKey }) {
|
|
|
28884
29492
|
),
|
|
28885
29493
|
customLogger: options.customLogger,
|
|
28886
29494
|
invalidateGlobPatterns: [EVENTS_PATTERN, SERVICE_PLUGINS_PATTERN]
|
|
29495
|
+
}),
|
|
29496
|
+
src_default({
|
|
29497
|
+
ignoreConfigErrors: true,
|
|
29498
|
+
root: model.projectFolder
|
|
28887
29499
|
})
|
|
28888
29500
|
]
|
|
28889
29501
|
};
|
|
@@ -30141,7 +30753,7 @@ function isObject3(o) {
|
|
|
30141
30753
|
|
|
30142
30754
|
// ../../node_modules/vite-plugin-externals/dist/es/src/index.js
|
|
30143
30755
|
var import_fs_extra = __toESM(require_lib2());
|
|
30144
|
-
import
|
|
30756
|
+
import path3 from "path";
|
|
30145
30757
|
|
|
30146
30758
|
// ../../node_modules/vite-plugin-externals/dist/es/src/options.js
|
|
30147
30759
|
init_esm_shims();
|
|
@@ -35728,14 +36340,14 @@ var __asyncValues = function(o) {
|
|
|
35728
36340
|
}, i);
|
|
35729
36341
|
function verb(n3) {
|
|
35730
36342
|
i[n3] = o[n3] && function(v) {
|
|
35731
|
-
return new Promise(function(
|
|
35732
|
-
v = o[n3](v), settle(
|
|
36343
|
+
return new Promise(function(resolve6, reject) {
|
|
36344
|
+
v = o[n3](v), settle(resolve6, reject, v.done, v.value);
|
|
35733
36345
|
});
|
|
35734
36346
|
};
|
|
35735
36347
|
}
|
|
35736
|
-
function settle(
|
|
36348
|
+
function settle(resolve6, reject, d, v) {
|
|
35737
36349
|
Promise.resolve(v).then(function(v2) {
|
|
35738
|
-
|
|
36350
|
+
resolve6({ value: v2, done: d });
|
|
35739
36351
|
}, reject);
|
|
35740
36352
|
}
|
|
35741
36353
|
};
|
|
@@ -35784,13 +36396,13 @@ function viteExternalsPlugin(externals = {}, userOptions = {}) {
|
|
|
35784
36396
|
} else if (Array.isArray(alias)) {
|
|
35785
36397
|
newAlias.push(...alias);
|
|
35786
36398
|
}
|
|
35787
|
-
const cachePath =
|
|
36399
|
+
const cachePath = path3.join(process.cwd(), NODE_MODULES_FLAG, CACHE_DIR);
|
|
35788
36400
|
await (0, import_fs_extra.ensureDir)(cachePath);
|
|
35789
36401
|
await (0, import_fs_extra.emptyDirSync)(cachePath);
|
|
35790
36402
|
try {
|
|
35791
36403
|
for (var externalsKeys_1 = __asyncValues(externalsKeys), externalsKeys_1_1; externalsKeys_1_1 = await externalsKeys_1.next(), !externalsKeys_1_1.done; ) {
|
|
35792
36404
|
const externalKey = externalsKeys_1_1.value;
|
|
35793
|
-
const externalCachePath =
|
|
36405
|
+
const externalCachePath = path3.join(cachePath, `${externalKey}.js`);
|
|
35794
36406
|
newAlias.push({ find: new RegExp(`^${externalKey}$`), replacement: externalCachePath });
|
|
35795
36407
|
await (0, import_fs_extra.ensureFile)(externalCachePath);
|
|
35796
36408
|
await (0, import_fs_extra.writeFile)(externalCachePath, `module.exports = ${transformModuleName(externals[externalKey])};`);
|
|
@@ -35880,7 +36492,7 @@ function compatSsrInOptions(options) {
|
|
|
35880
36492
|
// src/vite/configs/build-command/browser.ts
|
|
35881
36493
|
var import_monitoring_buildtime2 = __toESM(require_build(), 1);
|
|
35882
36494
|
var import_variant2 = __toESM(require_lib(), 1);
|
|
35883
|
-
import { resolve } from "node:path";
|
|
36495
|
+
import { resolve as resolve4 } from "node:path";
|
|
35884
36496
|
|
|
35885
36497
|
// src/vite/plugins/inline-html.ts
|
|
35886
36498
|
init_esm_shims();
|
|
@@ -36396,7 +37008,7 @@ var getDashboardComponentBuildTemplate = (appId, dashboardComponent) => {
|
|
|
36396
37008
|
|
|
36397
37009
|
// src/vite/plugins/module-bundle/custom-elements.ts
|
|
36398
37010
|
init_esm_shims();
|
|
36399
|
-
var getCustomElementBaseTemplate = (
|
|
37011
|
+
var getCustomElementBaseTemplate = (path9, tagName, appId) => (
|
|
36400
37012
|
// In UsersCustomElementClass we have class that will be registered in customElements registry
|
|
36401
37013
|
// Then this class will be used to create instances for each of elements of our CustomElement
|
|
36402
37014
|
// That's why we patching it's proto with accessTokenListener (in case user do not have it), so then platform could call it on each of instances
|
|
@@ -36407,7 +37019,7 @@ var getCustomElementBaseTemplate = (path8, tagName, appId) => (
|
|
|
36407
37019
|
await import('https://unpkg.com/react@16.14.0/umd/react.production.min.js');
|
|
36408
37020
|
await import('https://unpkg.com/react-dom@16.14.0/umd/react-dom.production.min.js');
|
|
36409
37021
|
}
|
|
36410
|
-
const { default: UsersCustomElementClass } = await import('${
|
|
37022
|
+
const { default: UsersCustomElementClass } = await import('${path9}');
|
|
36411
37023
|
|
|
36412
37024
|
let accessTokenListenerFn = UsersCustomElementClass.prototype.accessTokenListener;
|
|
36413
37025
|
if (!accessTokenListenerFn) {
|
|
@@ -36458,6 +37070,15 @@ var getCustomElementPanelBuildTemplate = (customElementPanelComponent) => {
|
|
|
36458
37070
|
`;
|
|
36459
37071
|
};
|
|
36460
37072
|
|
|
37073
|
+
// src/vite/plugins/module-bundle/site-components.ts
|
|
37074
|
+
init_esm_shims();
|
|
37075
|
+
var getSiteComponentDevTemplate = (component) => {
|
|
37076
|
+
return `export { default } from '${getComponentPathWithHMR(component.relativePath)}';`;
|
|
37077
|
+
};
|
|
37078
|
+
var getSiteComponentBuildTemplate = (component) => {
|
|
37079
|
+
return `export { default } from '/${component.relativePath}';`;
|
|
37080
|
+
};
|
|
37081
|
+
|
|
36461
37082
|
// src/vite/plugins/module-bundle/plugin.ts
|
|
36462
37083
|
var postfixRE2 = /[?#].*$/s;
|
|
36463
37084
|
var cleanId = (url) => url.replace(postfixRE2, "");
|
|
@@ -36471,13 +37092,14 @@ var moduleBundleDev = ({
|
|
|
36471
37092
|
let virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
|
|
36472
37093
|
let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
|
|
36473
37094
|
let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
|
|
37095
|
+
let virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
|
|
36474
37096
|
let serverInstance;
|
|
36475
37097
|
return {
|
|
36476
37098
|
name: "wix:module-bundle",
|
|
36477
37099
|
apply: "serve",
|
|
36478
37100
|
resolveId(rawId) {
|
|
36479
37101
|
const id = cleanId(rawId);
|
|
36480
|
-
if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id)) {
|
|
37102
|
+
if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualBlocksWidgetAssets.has(id) || virtualBlocksWidgetPanelAssets.has(id) || virtualSiteComponentAssets.has(id)) {
|
|
36481
37103
|
return id;
|
|
36482
37104
|
}
|
|
36483
37105
|
return null;
|
|
@@ -36520,6 +37142,13 @@ var moduleBundleDev = ({
|
|
|
36520
37142
|
server.moduleGraph.invalidateModule(moduleBundle);
|
|
36521
37143
|
}
|
|
36522
37144
|
}
|
|
37145
|
+
virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
|
|
37146
|
+
for (const scriptId of virtualSiteComponentAssets.keys()) {
|
|
37147
|
+
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
37148
|
+
if (moduleBundle) {
|
|
37149
|
+
server.moduleGraph.invalidateModule(moduleBundle);
|
|
37150
|
+
}
|
|
37151
|
+
}
|
|
36523
37152
|
});
|
|
36524
37153
|
},
|
|
36525
37154
|
load(rawId) {
|
|
@@ -36548,6 +37177,10 @@ var moduleBundleDev = ({
|
|
|
36548
37177
|
if (blocksPanelComponent) {
|
|
36549
37178
|
return getBlocksPanelDevTemplate(blocksPanelComponent);
|
|
36550
37179
|
}
|
|
37180
|
+
const siteComponent = virtualSiteComponentAssets.get(id);
|
|
37181
|
+
if (siteComponent) {
|
|
37182
|
+
return getSiteComponentDevTemplate(siteComponent);
|
|
37183
|
+
}
|
|
36551
37184
|
return null;
|
|
36552
37185
|
}
|
|
36553
37186
|
};
|
|
@@ -36559,12 +37192,13 @@ var moduleBundleBuildBrowser = ({
|
|
|
36559
37192
|
const virtualDashboardAssets = virtualDashboardScriptAssets(initialModel);
|
|
36560
37193
|
const virtualCustomElementAssets = virtualCustomElementScriptAssets(initialModel);
|
|
36561
37194
|
const virtualCustomElementPanelAssets = virtualCustomElementPanelScriptAssets(initialModel);
|
|
37195
|
+
const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
|
|
36562
37196
|
return {
|
|
36563
37197
|
name: "wix:module-bundle",
|
|
36564
37198
|
apply: "build",
|
|
36565
37199
|
resolveId(rawId) {
|
|
36566
37200
|
const id = cleanId(rawId);
|
|
36567
|
-
if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id)) {
|
|
37201
|
+
if (virtualDashboardAssets.has(id) || virtualCustomElementAssets.has(id) || virtualCustomElementPanelAssets.has(id) || virtualSiteComponentAssets.has(id)) {
|
|
36568
37202
|
return id;
|
|
36569
37203
|
}
|
|
36570
37204
|
return null;
|
|
@@ -36583,6 +37217,10 @@ var moduleBundleBuildBrowser = ({
|
|
|
36583
37217
|
if (customElementPanelComponent) {
|
|
36584
37218
|
return getCustomElementPanelBuildTemplate(customElementPanelComponent);
|
|
36585
37219
|
}
|
|
37220
|
+
const siteComponent = virtualSiteComponentAssets.get(id);
|
|
37221
|
+
if (siteComponent) {
|
|
37222
|
+
return getSiteComponentBuildTemplate(siteComponent);
|
|
37223
|
+
}
|
|
36586
37224
|
return null;
|
|
36587
37225
|
}
|
|
36588
37226
|
};
|
|
@@ -36638,10 +37276,10 @@ function draftJs() {
|
|
|
36638
37276
|
// src/vite/plugins/embedded-script-sdk-support.ts
|
|
36639
37277
|
init_esm_shims();
|
|
36640
37278
|
var import_variant = __toESM(require_lib(), 1);
|
|
36641
|
-
import { join as
|
|
37279
|
+
import { join as join4 } from "node:path";
|
|
36642
37280
|
var import_node_html_parser = __toESM(require_dist(), 1);
|
|
36643
37281
|
function getEmbeddedScriptEntries(model) {
|
|
36644
|
-
const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) =>
|
|
37282
|
+
const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => join4(model.projectFolder, comp.relativePath));
|
|
36645
37283
|
return new Set(entries);
|
|
36646
37284
|
}
|
|
36647
37285
|
function getEmbeddedScriptHtmlUrl(filename) {
|
|
@@ -36830,7 +37468,7 @@ function fbjsHotfixPlugin() {
|
|
|
36830
37468
|
|
|
36831
37469
|
// src/vite/plugins/config-extensions-file-emitter.ts
|
|
36832
37470
|
init_esm_shims();
|
|
36833
|
-
import
|
|
37471
|
+
import path4 from "node:path";
|
|
36834
37472
|
function configExtensionsFileEmitter(model) {
|
|
36835
37473
|
return {
|
|
36836
37474
|
name: "config-extensions-file-emitter",
|
|
@@ -36843,7 +37481,7 @@ function configExtensionsFileEmitter(model) {
|
|
|
36843
37481
|
const content = new Uint8Array(await readFile(resolved.id));
|
|
36844
37482
|
const fileName = this.emitFile({
|
|
36845
37483
|
type: "asset",
|
|
36846
|
-
name:
|
|
37484
|
+
name: path4.basename(resolved.id),
|
|
36847
37485
|
originalFileName: assetUrl,
|
|
36848
37486
|
source: content
|
|
36849
37487
|
});
|
|
@@ -36875,7 +37513,7 @@ function configExtensionsFileEmitter(model) {
|
|
|
36875
37513
|
|
|
36876
37514
|
// src/vite/plugins/web-methods-plugin.ts
|
|
36877
37515
|
init_esm_shims();
|
|
36878
|
-
import
|
|
37516
|
+
import path6 from "node:path";
|
|
36879
37517
|
|
|
36880
37518
|
// ../../node_modules/minimatch/dist/esm/index.js
|
|
36881
37519
|
init_esm_shims();
|
|
@@ -37556,11 +38194,11 @@ var qmarksTestNoExtDot = ([$0]) => {
|
|
|
37556
38194
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
37557
38195
|
};
|
|
37558
38196
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
37559
|
-
var
|
|
38197
|
+
var path5 = {
|
|
37560
38198
|
win32: { sep: "\\" },
|
|
37561
38199
|
posix: { sep: "/" }
|
|
37562
38200
|
};
|
|
37563
|
-
var sep = defaultPlatform === "win32" ?
|
|
38201
|
+
var sep = defaultPlatform === "win32" ? path5.win32.sep : path5.posix.sep;
|
|
37564
38202
|
minimatch.sep = sep;
|
|
37565
38203
|
var GLOBSTAR = Symbol("globstar **");
|
|
37566
38204
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -38232,7 +38870,7 @@ function webMethodsPlugin({
|
|
|
38232
38870
|
return;
|
|
38233
38871
|
}
|
|
38234
38872
|
const relativeId = normalizeGlobbyPattern(
|
|
38235
|
-
|
|
38873
|
+
path6.relative(projectFolder, id)
|
|
38236
38874
|
);
|
|
38237
38875
|
if (!minimatch(relativeId, normalizedWebMethodPattern)) {
|
|
38238
38876
|
throw new CliError({
|
|
@@ -38244,12 +38882,15 @@ function webMethodsPlugin({
|
|
|
38244
38882
|
}
|
|
38245
38883
|
await init;
|
|
38246
38884
|
const [, exports] = parse(code);
|
|
38885
|
+
const pathToFile = normalizeGlobbyPattern(
|
|
38886
|
+
path6.relative(projectFolder, url)
|
|
38887
|
+
);
|
|
38247
38888
|
const mappedExports = exports.map(
|
|
38248
38889
|
({ ln: method }) => defaultOutdent`
|
|
38249
38890
|
export const ${method} = async (...args) => {
|
|
38250
38891
|
return await callWebMethod({
|
|
38251
38892
|
args,
|
|
38252
|
-
filename: '${
|
|
38893
|
+
filename: '${pathToFile}',
|
|
38253
38894
|
method: '${method}',
|
|
38254
38895
|
baseURL: __webMethodsBaseUrl,
|
|
38255
38896
|
});
|
|
@@ -38296,6 +38937,78 @@ function hashHtmlFiles() {
|
|
|
38296
38937
|
};
|
|
38297
38938
|
}
|
|
38298
38939
|
|
|
38940
|
+
// src/vite/plugins/exports-custodian.ts
|
|
38941
|
+
init_esm_shims();
|
|
38942
|
+
var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
|
|
38943
|
+
var exportsCustodian = ({
|
|
38944
|
+
initialModel,
|
|
38945
|
+
type,
|
|
38946
|
+
projectModelWatcher
|
|
38947
|
+
}) => {
|
|
38948
|
+
let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
|
|
38949
|
+
let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
|
|
38950
|
+
let virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
|
|
38951
|
+
return {
|
|
38952
|
+
name: "wix:exports-custodian",
|
|
38953
|
+
resolveId(id) {
|
|
38954
|
+
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
38955
|
+
return id;
|
|
38956
|
+
}
|
|
38957
|
+
return null;
|
|
38958
|
+
},
|
|
38959
|
+
configureServer(server) {
|
|
38960
|
+
if (type === "dev" /* dev */) {
|
|
38961
|
+
projectModelWatcher.onChange((model) => {
|
|
38962
|
+
virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(model);
|
|
38963
|
+
for (const scriptId of virtualBlocksWidgetAssets.keys()) {
|
|
38964
|
+
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
38965
|
+
if (moduleBundle) {
|
|
38966
|
+
server.moduleGraph.invalidateModule(moduleBundle);
|
|
38967
|
+
}
|
|
38968
|
+
}
|
|
38969
|
+
virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(model);
|
|
38970
|
+
for (const scriptId of virtualBlocksWidgetPanelAssets.keys()) {
|
|
38971
|
+
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
38972
|
+
if (moduleBundle) {
|
|
38973
|
+
server.moduleGraph.invalidateModule(moduleBundle);
|
|
38974
|
+
}
|
|
38975
|
+
}
|
|
38976
|
+
virtualSiteComponentAssets = virtualSiteComponentScriptAssets(model);
|
|
38977
|
+
for (const scriptId of virtualSiteComponentAssets.keys()) {
|
|
38978
|
+
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
38979
|
+
if (moduleBundle) {
|
|
38980
|
+
server.moduleGraph.invalidateModule(moduleBundle);
|
|
38981
|
+
}
|
|
38982
|
+
}
|
|
38983
|
+
});
|
|
38984
|
+
}
|
|
38985
|
+
},
|
|
38986
|
+
load(id) {
|
|
38987
|
+
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
38988
|
+
return [
|
|
38989
|
+
...Array.from(virtualBlocksWidgetAssets.keys()).map(
|
|
38990
|
+
(path9, index) => `
|
|
38991
|
+
import { init as init${index}, api as api${index} } from '${path9}';
|
|
38992
|
+
init${index}();
|
|
38993
|
+
api${index}();
|
|
38994
|
+
`
|
|
38995
|
+
),
|
|
38996
|
+
...Array.from(virtualBlocksWidgetPanelAssets.keys()).map(
|
|
38997
|
+
(path9, index) => `
|
|
38998
|
+
import { init as initPanel${index} } from '${path9}';
|
|
38999
|
+
initPanel${index}();
|
|
39000
|
+
`
|
|
39001
|
+
),
|
|
39002
|
+
...Array.from(virtualSiteComponentAssets.keys()).map(
|
|
39003
|
+
(path9) => `import('${path9}');`
|
|
39004
|
+
)
|
|
39005
|
+
].join("\n");
|
|
39006
|
+
}
|
|
39007
|
+
return null;
|
|
39008
|
+
}
|
|
39009
|
+
};
|
|
39010
|
+
};
|
|
39011
|
+
|
|
38299
39012
|
// src/vite/configs/build-command/browser.ts
|
|
38300
39013
|
async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
38301
39014
|
const virtualDashboardHTMLEntries = [
|
|
@@ -38304,13 +39017,16 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
|
38304
39017
|
const virtualDashboardScriptEntries = [
|
|
38305
39018
|
...virtualDashboardScriptAssets(model)
|
|
38306
39019
|
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
38307
|
-
const embeddedScriptEntries = model.components.filter((0, import_variant2.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => [comp.id,
|
|
39020
|
+
const embeddedScriptEntries = model.components.filter((0, import_variant2.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => [comp.id, resolve4(model.projectFolder, comp.relativePath)]);
|
|
38308
39021
|
const virtualCustomElementHTMLEntries = [
|
|
38309
39022
|
...virtualCustomElementPanelHTMLAssets(model)
|
|
38310
39023
|
].map(([assetId, component]) => [`html-asset-${component.id}`, assetId]);
|
|
38311
39024
|
const virtualCustomElementScriptEntries = [
|
|
38312
39025
|
...virtualCustomElementScriptAssets(model)
|
|
38313
39026
|
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
39027
|
+
const virtualSiteComponentScriptEntries = [
|
|
39028
|
+
...virtualSiteComponentScriptAssets(model)
|
|
39029
|
+
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
38314
39030
|
const { monitoring } = model.config;
|
|
38315
39031
|
const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
|
|
38316
39032
|
appId: model.config.appId,
|
|
@@ -38338,7 +39054,8 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
|
38338
39054
|
SITE_WIDGETS_ELEMENT_PATTERN,
|
|
38339
39055
|
SITE_WIDGETS_PANEL_PATTERN,
|
|
38340
39056
|
SITE_PLUGINS_PLUGIN_PATTERN,
|
|
38341
|
-
SITE_PLUGINS_PANEL_PATTERN
|
|
39057
|
+
SITE_PLUGINS_PANEL_PATTERN,
|
|
39058
|
+
SITE_COMPONENTS_PATTERN
|
|
38342
39059
|
]
|
|
38343
39060
|
},
|
|
38344
39061
|
server: {},
|
|
@@ -38352,8 +39069,10 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
|
38352
39069
|
...virtualDashboardScriptEntries,
|
|
38353
39070
|
...embeddedScriptEntries,
|
|
38354
39071
|
...virtualCustomElementHTMLEntries,
|
|
38355
|
-
...virtualCustomElementScriptEntries
|
|
38356
|
-
|
|
39072
|
+
...virtualCustomElementScriptEntries,
|
|
39073
|
+
...virtualSiteComponentScriptEntries
|
|
39074
|
+
]),
|
|
39075
|
+
...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
|
|
38357
39076
|
},
|
|
38358
39077
|
output: {
|
|
38359
39078
|
assetFileNames: "assets/[name].ch.[hash][extname]",
|
|
@@ -38395,8 +39114,16 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
|
38395
39114
|
initialModel: model,
|
|
38396
39115
|
...options
|
|
38397
39116
|
}),
|
|
39117
|
+
exportsCustodian({
|
|
39118
|
+
initialModel: model,
|
|
39119
|
+
...options
|
|
39120
|
+
}),
|
|
38398
39121
|
configExtensionsFileEmitter(model),
|
|
38399
|
-
...monitoringPlugins ?? []
|
|
39122
|
+
...monitoringPlugins ?? [],
|
|
39123
|
+
src_default({
|
|
39124
|
+
ignoreConfigErrors: true,
|
|
39125
|
+
root: model.projectFolder
|
|
39126
|
+
})
|
|
38400
39127
|
],
|
|
38401
39128
|
experimental: {
|
|
38402
39129
|
/*
|
|
@@ -38434,69 +39161,6 @@ async function getViteConfig2(model, options, { baseBackendUrl } = {}) {
|
|
|
38434
39161
|
// src/vite/configs/build-command/worker.ts
|
|
38435
39162
|
init_esm_shims();
|
|
38436
39163
|
var import_monitoring_buildtime3 = __toESM(require_build(), 1);
|
|
38437
|
-
|
|
38438
|
-
// src/vite/plugins/exports-custodian.ts
|
|
38439
|
-
init_esm_shims();
|
|
38440
|
-
var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
|
|
38441
|
-
var exportsCustodian = ({
|
|
38442
|
-
initialModel,
|
|
38443
|
-
type,
|
|
38444
|
-
projectModelWatcher
|
|
38445
|
-
}) => {
|
|
38446
|
-
let virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(initialModel);
|
|
38447
|
-
let virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(initialModel);
|
|
38448
|
-
return {
|
|
38449
|
-
name: "wix:exports-custodian",
|
|
38450
|
-
resolveId(id) {
|
|
38451
|
-
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
38452
|
-
return id;
|
|
38453
|
-
}
|
|
38454
|
-
return null;
|
|
38455
|
-
},
|
|
38456
|
-
configureServer(server) {
|
|
38457
|
-
if (type === "dev" /* dev */) {
|
|
38458
|
-
projectModelWatcher.onChange((model) => {
|
|
38459
|
-
virtualBlocksWidgetAssets = virtualBlocksWidgetScriptAssets(model);
|
|
38460
|
-
for (const scriptId of virtualBlocksWidgetAssets.keys()) {
|
|
38461
|
-
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
38462
|
-
if (moduleBundle) {
|
|
38463
|
-
server.moduleGraph.invalidateModule(moduleBundle);
|
|
38464
|
-
}
|
|
38465
|
-
}
|
|
38466
|
-
virtualBlocksWidgetPanelAssets = virtualBlocksWidgetPanelScriptAssets(model);
|
|
38467
|
-
for (const scriptId of virtualBlocksWidgetPanelAssets.keys()) {
|
|
38468
|
-
const moduleBundle = server.moduleGraph.getModuleById(scriptId);
|
|
38469
|
-
if (moduleBundle) {
|
|
38470
|
-
server.moduleGraph.invalidateModule(moduleBundle);
|
|
38471
|
-
}
|
|
38472
|
-
}
|
|
38473
|
-
});
|
|
38474
|
-
}
|
|
38475
|
-
},
|
|
38476
|
-
load(id) {
|
|
38477
|
-
if (id === EXPORTS_CUSTODIAN_ENTRY) {
|
|
38478
|
-
return [
|
|
38479
|
-
...Array.from(virtualBlocksWidgetAssets.keys()).map(
|
|
38480
|
-
(path8, index) => `
|
|
38481
|
-
import { init as init${index}, api as api${index} } from '${path8}';
|
|
38482
|
-
init${index}();
|
|
38483
|
-
api${index}();
|
|
38484
|
-
`
|
|
38485
|
-
),
|
|
38486
|
-
...Array.from(virtualBlocksWidgetPanelAssets.keys()).map(
|
|
38487
|
-
(path8, index) => `
|
|
38488
|
-
import { init as initPanel${index} } from '${path8}';
|
|
38489
|
-
initPanel${index}();
|
|
38490
|
-
`
|
|
38491
|
-
)
|
|
38492
|
-
].join("\n");
|
|
38493
|
-
}
|
|
38494
|
-
return null;
|
|
38495
|
-
}
|
|
38496
|
-
};
|
|
38497
|
-
};
|
|
38498
|
-
|
|
38499
|
-
// src/vite/configs/build-command/worker.ts
|
|
38500
39164
|
async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
|
|
38501
39165
|
const virtualBlocksScriptEntries = [
|
|
38502
39166
|
...virtualBlocksWidgetScriptAssets(model),
|
|
@@ -38570,7 +39234,11 @@ async function getViteConfig3(model, options, { baseBackendUrl } = {}) {
|
|
|
38570
39234
|
initialModel: model,
|
|
38571
39235
|
...options
|
|
38572
39236
|
}),
|
|
38573
|
-
...monitoringPlugins ?? []
|
|
39237
|
+
...monitoringPlugins ?? [],
|
|
39238
|
+
src_default({
|
|
39239
|
+
ignoreConfigErrors: true,
|
|
39240
|
+
root: model.projectFolder
|
|
39241
|
+
})
|
|
38574
39242
|
]
|
|
38575
39243
|
};
|
|
38576
39244
|
}
|
|
@@ -38582,7 +39250,7 @@ init_esm_shims();
|
|
|
38582
39250
|
init_esm_shims();
|
|
38583
39251
|
var import_monitoring_buildtime4 = __toESM(require_build(), 1);
|
|
38584
39252
|
var import_variant3 = __toESM(require_lib(), 1);
|
|
38585
|
-
import { resolve as
|
|
39253
|
+
import { resolve as resolve5 } from "node:path";
|
|
38586
39254
|
|
|
38587
39255
|
// src/vite/plugins/ssl.ts
|
|
38588
39256
|
init_esm_shims();
|
|
@@ -38591,7 +39259,7 @@ init_esm_shims();
|
|
|
38591
39259
|
init_esm_shims();
|
|
38592
39260
|
var import_selfsigned = __toESM(require_selfsigned(), 1);
|
|
38593
39261
|
import { readFile as readFile4, writeFile as writeFile2, stat } from "node:fs/promises";
|
|
38594
|
-
import
|
|
39262
|
+
import path7 from "node:path";
|
|
38595
39263
|
var PEM_FILENAME = "wix-cli.pem";
|
|
38596
39264
|
var PEM_MAX_DAYS = 30;
|
|
38597
39265
|
var attrs = [
|
|
@@ -38634,7 +39302,7 @@ var shouldRecreatePem = async (wixCliPemPath) => {
|
|
|
38634
39302
|
};
|
|
38635
39303
|
var generateHostCert = async () => {
|
|
38636
39304
|
const wixDataDir = getDataDirPath();
|
|
38637
|
-
const wixCliPemPath =
|
|
39305
|
+
const wixCliPemPath = path7.join(wixDataDir, PEM_FILENAME);
|
|
38638
39306
|
const recreatePem = await shouldRecreatePem(wixCliPemPath);
|
|
38639
39307
|
if (!recreatePem) {
|
|
38640
39308
|
const cachedCert = await readFile4(wixCliPemPath, {
|
|
@@ -38731,15 +39399,15 @@ function autoOrigin() {
|
|
|
38731
39399
|
|
|
38732
39400
|
// src/vite/plugins/absolute-html-url.ts
|
|
38733
39401
|
init_esm_shims();
|
|
38734
|
-
import { dirname, isAbsolute, join as
|
|
39402
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, join as join5 } from "node:path";
|
|
38735
39403
|
import { URL as URL2 } from "node:url";
|
|
38736
39404
|
function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
|
|
38737
39405
|
let url = new URL2(assetUrl, viteAddress).href;
|
|
38738
39406
|
if (assetUrl.startsWith("/@vite")) {
|
|
38739
39407
|
return url;
|
|
38740
39408
|
}
|
|
38741
|
-
if (!
|
|
38742
|
-
const assetPath =
|
|
39409
|
+
if (!isAbsolute2(assetUrl)) {
|
|
39410
|
+
const assetPath = join5(dirname2(originalUrl), assetUrl);
|
|
38743
39411
|
url = new URL2(assetPath, viteAddress).href;
|
|
38744
39412
|
}
|
|
38745
39413
|
return url;
|
|
@@ -38784,7 +39452,7 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
|
|
|
38784
39452
|
const virtualDashboardScriptEntries = [
|
|
38785
39453
|
...virtualDashboardScriptAssets(model)
|
|
38786
39454
|
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
38787
|
-
const embeddedScriptEntries = model.components.filter((0, import_variant3.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => [comp.id,
|
|
39455
|
+
const embeddedScriptEntries = model.components.filter((0, import_variant3.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => [comp.id, resolve5(model.projectFolder, comp.relativePath)]);
|
|
38788
39456
|
const virtualCustomElementHTMLEntries = [
|
|
38789
39457
|
...virtualCustomElementPanelHTMLAssets(model)
|
|
38790
39458
|
].map(([assetId, component]) => [`html-asset-${component.id}`, assetId]);
|
|
@@ -38795,6 +39463,9 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
|
|
|
38795
39463
|
...virtualBlocksWidgetScriptAssets(model),
|
|
38796
39464
|
...virtualBlocksWidgetPanelScriptAssets(model)
|
|
38797
39465
|
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
39466
|
+
const virtualSiteComponentScriptEntries = [
|
|
39467
|
+
...virtualSiteComponentScriptAssets(model)
|
|
39468
|
+
].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
|
|
38798
39469
|
const { monitoring } = model.config;
|
|
38799
39470
|
const monitoringPlugins = monitoring?.sentry && (0, import_monitoring_buildtime4.getMonitoringVitePlugins)({
|
|
38800
39471
|
appId: model.config.appId,
|
|
@@ -38823,7 +39494,8 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
|
|
|
38823
39494
|
SITE_PLUGINS_PLUGIN_PATTERN,
|
|
38824
39495
|
SITE_PLUGINS_PANEL_PATTERN,
|
|
38825
39496
|
BLOCKS_WIDGETS_PATTERN,
|
|
38826
|
-
BLOCKS_WIDGETS_PANELS_PATTERN
|
|
39497
|
+
BLOCKS_WIDGETS_PANELS_PATTERN,
|
|
39498
|
+
SITE_COMPONENTS_PATTERN
|
|
38827
39499
|
]
|
|
38828
39500
|
},
|
|
38829
39501
|
server: {},
|
|
@@ -38838,7 +39510,8 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
|
|
|
38838
39510
|
...embeddedScriptEntries,
|
|
38839
39511
|
...virtualCustomElementHTMLEntries,
|
|
38840
39512
|
...virtualCustomElementScriptEntries,
|
|
38841
|
-
...virtualBlocksScriptEntries
|
|
39513
|
+
...virtualBlocksScriptEntries,
|
|
39514
|
+
...virtualSiteComponentScriptEntries
|
|
38842
39515
|
]),
|
|
38843
39516
|
...virtualBlocksScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
|
|
38844
39517
|
},
|
|
@@ -38891,7 +39564,11 @@ async function getViteConfig4(model, options, { baseBackendUrl } = {}) {
|
|
|
38891
39564
|
...options
|
|
38892
39565
|
}),
|
|
38893
39566
|
configExtensionsFileEmitter(model),
|
|
38894
|
-
...monitoringPlugins ?? []
|
|
39567
|
+
...monitoringPlugins ?? [],
|
|
39568
|
+
src_default({
|
|
39569
|
+
ignoreConfigErrors: true,
|
|
39570
|
+
root: model.projectFolder
|
|
39571
|
+
})
|
|
38895
39572
|
],
|
|
38896
39573
|
experimental: {
|
|
38897
39574
|
/*
|
|
@@ -39008,6 +39685,11 @@ var validateComponents = (components) => {
|
|
|
39008
39685
|
name: marketData.name,
|
|
39009
39686
|
type: "site-plugin",
|
|
39010
39687
|
path: replaceExtension(relativePath, "json")
|
|
39688
|
+
}),
|
|
39689
|
+
SiteComponent: ({ relativePath }) => ({
|
|
39690
|
+
name: relativePath,
|
|
39691
|
+
type: "site-component",
|
|
39692
|
+
path: replaceExtension(relativePath, "json")
|
|
39011
39693
|
})
|
|
39012
39694
|
})
|
|
39013
39695
|
).sort((a, b) => a.name.localeCompare(b.name)),
|
|
@@ -39026,13 +39708,13 @@ init_esm_shims();
|
|
|
39026
39708
|
var import_variant5 = __toESM(require_lib(), 1);
|
|
39027
39709
|
var import_uniqWith = __toESM(require_uniqWith(), 1);
|
|
39028
39710
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
39029
|
-
import { dirname as
|
|
39711
|
+
import { dirname as dirname3, join as join6 } from "node:path";
|
|
39030
39712
|
function isTruthy(x) {
|
|
39031
39713
|
return x != null && x !== false;
|
|
39032
39714
|
}
|
|
39033
39715
|
function parseImageField(asset, relativePath) {
|
|
39034
39716
|
if (RELATIVE_ASSET_PATH_REGEX.test(asset)) {
|
|
39035
|
-
return
|
|
39717
|
+
return join6(dirname3(`/${relativePath}`), asset);
|
|
39036
39718
|
}
|
|
39037
39719
|
return asset;
|
|
39038
39720
|
}
|
|
@@ -39446,6 +40128,20 @@ async function createAppManifest({
|
|
|
39446
40128
|
}
|
|
39447
40129
|
}
|
|
39448
40130
|
};
|
|
40131
|
+
},
|
|
40132
|
+
SiteComponent: async (component) => {
|
|
40133
|
+
return {
|
|
40134
|
+
compId: component.id,
|
|
40135
|
+
compType: ComponentType.EDITOR_REACT_COMPONENT,
|
|
40136
|
+
compData: {
|
|
40137
|
+
editorReactComponent: {
|
|
40138
|
+
type: `platform.builder.${appId}_${component.id}`,
|
|
40139
|
+
description: component.description,
|
|
40140
|
+
editorElement: component.editorElement,
|
|
40141
|
+
resources: { ...await componentSourceBuilder(component) }
|
|
40142
|
+
}
|
|
40143
|
+
}
|
|
40144
|
+
};
|
|
39449
40145
|
}
|
|
39450
40146
|
})
|
|
39451
40147
|
)
|
|
@@ -39462,7 +40158,7 @@ async function createAppManifest({
|
|
|
39462
40158
|
// src/app-manifest/component-source.ts
|
|
39463
40159
|
init_esm_shims();
|
|
39464
40160
|
var import_variant6 = __toESM(require_lib(), 1);
|
|
39465
|
-
import
|
|
40161
|
+
import path8, { join as join7 } from "node:path";
|
|
39466
40162
|
import { pathToFileURL } from "node:url";
|
|
39467
40163
|
|
|
39468
40164
|
// src/app-manifest/build-output-data-extractor.ts
|
|
@@ -39496,18 +40192,24 @@ function extractBundleAssetFileName(buildOutput, fileName) {
|
|
|
39496
40192
|
}
|
|
39497
40193
|
return output.fileName;
|
|
39498
40194
|
}
|
|
39499
|
-
function
|
|
40195
|
+
function extractModuleBundleChunk(buildOutput, moduleId) {
|
|
39500
40196
|
const outputs = extractBuildOutputs(buildOutput);
|
|
39501
|
-
const output = outputs.find(
|
|
39502
|
-
(output2) => output2.type === "chunk" && output2.facadeModuleId === moduleId
|
|
39503
|
-
);
|
|
40197
|
+
const output = outputs.filter((output2) => output2.type === "chunk").find((output2) => output2.facadeModuleId === moduleId);
|
|
39504
40198
|
if (!output) {
|
|
39505
40199
|
throw new CliError({
|
|
39506
40200
|
code: CliErrorCode.ViteModuleBundleNotFound(),
|
|
39507
40201
|
cause: null
|
|
39508
40202
|
});
|
|
39509
40203
|
}
|
|
39510
|
-
return output
|
|
40204
|
+
return output;
|
|
40205
|
+
}
|
|
40206
|
+
function extractModuleBundleName(buildOutput, moduleId) {
|
|
40207
|
+
return extractModuleBundleChunk(buildOutput, moduleId).fileName;
|
|
40208
|
+
}
|
|
40209
|
+
function extractModuleBundleCss(buildOutput, moduleId) {
|
|
40210
|
+
const output = extractModuleBundleChunk(buildOutput, moduleId);
|
|
40211
|
+
const importedCss = output.viteMetadata?.importedCss;
|
|
40212
|
+
return importedCss?.values().next().value;
|
|
39511
40213
|
}
|
|
39512
40214
|
function extractModuleBundleContent(buildOutput, fileName) {
|
|
39513
40215
|
const output = extractAssetOutput(buildOutput, fileName);
|
|
@@ -39548,7 +40250,7 @@ async function getEventDevSlugs(component, backendDevServerUrl) {
|
|
|
39548
40250
|
}
|
|
39549
40251
|
async function getRegisteredExtensions(model) {
|
|
39550
40252
|
const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);
|
|
39551
|
-
const outputFilepath =
|
|
40253
|
+
const outputFilepath = join7(
|
|
39552
40254
|
backendBuildFolder,
|
|
39553
40255
|
"getRegisteredExtensions.mjs"
|
|
39554
40256
|
);
|
|
@@ -39627,7 +40329,7 @@ var embeddedScriptBuilder = async (model, component, source) => {
|
|
|
39627
40329
|
return {
|
|
39628
40330
|
template: source.buildSource ? extractModuleBundleContent(
|
|
39629
40331
|
source.buildSource.browserBuildOutput,
|
|
39630
|
-
|
|
40332
|
+
path8.resolve(model.projectFolder, component.relativePath)
|
|
39631
40333
|
) : await getEmbeddedScriptDevTemplate(
|
|
39632
40334
|
component,
|
|
39633
40335
|
source.devSource.devServerUrl
|
|
@@ -39679,6 +40381,34 @@ var blocksPanelBuilder = (component, source) => {
|
|
|
39679
40381
|
componentUrl
|
|
39680
40382
|
};
|
|
39681
40383
|
};
|
|
40384
|
+
var siteComponentBuilder = (component, source) => {
|
|
40385
|
+
const moduleId = virtualModuleIdForSiteComponentScriptAsset(component.id);
|
|
40386
|
+
if (source.buildSource == null) {
|
|
40387
|
+
return {
|
|
40388
|
+
client: {
|
|
40389
|
+
componentUrl: `/@id/${moduleId}?import`
|
|
40390
|
+
},
|
|
40391
|
+
server: {
|
|
40392
|
+
url: ""
|
|
40393
|
+
}
|
|
40394
|
+
};
|
|
40395
|
+
}
|
|
40396
|
+
return {
|
|
40397
|
+
client: {
|
|
40398
|
+
componentUrl: extractModuleBundleName(
|
|
40399
|
+
source.buildSource.browserBuildOutput,
|
|
40400
|
+
moduleId
|
|
40401
|
+
),
|
|
40402
|
+
cssUrl: extractModuleBundleCss(
|
|
40403
|
+
source.buildSource.browserBuildOutput,
|
|
40404
|
+
moduleId
|
|
40405
|
+
)
|
|
40406
|
+
},
|
|
40407
|
+
server: {
|
|
40408
|
+
url: "https://wix.com/"
|
|
40409
|
+
}
|
|
40410
|
+
};
|
|
40411
|
+
};
|
|
39682
40412
|
function getComponentDevSourceBuilder(model, devSource, backendSource) {
|
|
39683
40413
|
return async (component) => {
|
|
39684
40414
|
const source = (0, import_variant6.match)(component, {
|
|
@@ -39705,7 +40435,8 @@ function getComponentDevSourceBuilder(model, devSource, backendSource) {
|
|
|
39705
40435
|
Event: (component2) => eventSourceBuilder(component2, model, backendSource),
|
|
39706
40436
|
ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
|
|
39707
40437
|
Monitoring: () => {
|
|
39708
|
-
}
|
|
40438
|
+
},
|
|
40439
|
+
SiteComponent: (component2) => siteComponentBuilder(component2, { devSource })
|
|
39709
40440
|
});
|
|
39710
40441
|
return source;
|
|
39711
40442
|
};
|
|
@@ -39752,7 +40483,10 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
|
|
|
39752
40483
|
Event: (component2) => eventSourceBuilder(component2, model, backendSource),
|
|
39753
40484
|
ServicePlugin: (component2) => servicePluginSourceBuilder(component2, model, backendSource),
|
|
39754
40485
|
Monitoring: () => {
|
|
39755
|
-
}
|
|
40486
|
+
},
|
|
40487
|
+
SiteComponent: (component2) => siteComponentBuilder(component2, {
|
|
40488
|
+
buildSource: browserBuildSource
|
|
40489
|
+
})
|
|
39756
40490
|
});
|
|
39757
40491
|
return source;
|
|
39758
40492
|
};
|
|
@@ -39760,7 +40494,7 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
|
|
|
39760
40494
|
|
|
39761
40495
|
// ../cli-app-manifest/build/index.js
|
|
39762
40496
|
init_esm_shims();
|
|
39763
|
-
import
|
|
40497
|
+
import fs2 from "node:fs/promises";
|
|
39764
40498
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
39765
40499
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
39766
40500
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -40217,6 +40951,28 @@ var monitoringSchema = z.object({
|
|
|
40217
40951
|
])
|
|
40218
40952
|
})
|
|
40219
40953
|
});
|
|
40954
|
+
var siteComponentSourceSchema = z.object({
|
|
40955
|
+
client: z.object({
|
|
40956
|
+
componentUrl: z.string(),
|
|
40957
|
+
cssUrl: z.string().optional()
|
|
40958
|
+
}),
|
|
40959
|
+
server: z.object({
|
|
40960
|
+
url: z.string()
|
|
40961
|
+
})
|
|
40962
|
+
});
|
|
40963
|
+
var siteComponentSchema = z.object({
|
|
40964
|
+
compType: z.literal(ComponentType.EDITOR_REACT_COMPONENT),
|
|
40965
|
+
compId: z.string(),
|
|
40966
|
+
compName: z.string().optional(),
|
|
40967
|
+
compData: z.object({
|
|
40968
|
+
editorReactComponent: z.object({
|
|
40969
|
+
type: z.string().min(5),
|
|
40970
|
+
description: z.string().min(5),
|
|
40971
|
+
resources: siteComponentSourceSchema,
|
|
40972
|
+
editorElement: z.unknown()
|
|
40973
|
+
})
|
|
40974
|
+
})
|
|
40975
|
+
});
|
|
40220
40976
|
var componentSchema = z.discriminatedUnion("compType", [
|
|
40221
40977
|
backofficePageSchema,
|
|
40222
40978
|
backofficeExtensionSchema,
|
|
@@ -40241,7 +40997,8 @@ var componentSchema = z.discriminatedUnion("compType", [
|
|
|
40241
40997
|
ecomPaymentSettingsSchema,
|
|
40242
40998
|
ecomGiftCardsProviderSchema,
|
|
40243
40999
|
topologySchema,
|
|
40244
|
-
monitoringSchema
|
|
41000
|
+
monitoringSchema,
|
|
41001
|
+
siteComponentSchema
|
|
40245
41002
|
]);
|
|
40246
41003
|
var appManifestSchema = z.object({
|
|
40247
41004
|
appId: z.string(),
|
|
@@ -40249,7 +41006,7 @@ var appManifestSchema = z.object({
|
|
|
40249
41006
|
});
|
|
40250
41007
|
async function readAppManifest(filePath) {
|
|
40251
41008
|
try {
|
|
40252
|
-
const configData = await
|
|
41009
|
+
const configData = await fs2.readFile(filePath, "utf-8");
|
|
40253
41010
|
return appManifestSchema.parse(JSON.parse(configData));
|
|
40254
41011
|
} catch (e) {
|
|
40255
41012
|
const causeMessage = e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
@@ -40260,8 +41017,8 @@ async function readAppManifest(filePath) {
|
|
|
40260
41017
|
}
|
|
40261
41018
|
var cloneDeep = (0, import_rfdc.default)();
|
|
40262
41019
|
var cloneDeep2 = (0, import_rfdc2.default)();
|
|
40263
|
-
var normalizeUrl = (url,
|
|
40264
|
-
return new URL(url,
|
|
41020
|
+
var normalizeUrl = (url, normalizedBaseUrl) => {
|
|
41021
|
+
return new URL(url.startsWith("/") ? `.${url}` : url, normalizedBaseUrl).href;
|
|
40265
41022
|
};
|
|
40266
41023
|
var overrideComponentSourceWithNormalizedUrls = (componentSource, normalizedBaseUrl) => {
|
|
40267
41024
|
const { scriptAsset, iframeUrl } = componentSource;
|
|
@@ -40394,6 +41151,29 @@ var updateBrowserComponentsWithBaseUrl = (appManifest, baseUrl) => {
|
|
|
40394
41151
|
)
|
|
40395
41152
|
};
|
|
40396
41153
|
}
|
|
41154
|
+
if (compType === ComponentType.EDITOR_REACT_COMPONENT) {
|
|
41155
|
+
compData.editorReactComponent = {
|
|
41156
|
+
...compData.editorReactComponent,
|
|
41157
|
+
resources: {
|
|
41158
|
+
client: {
|
|
41159
|
+
componentUrl: normalizeUrl(
|
|
41160
|
+
compData.editorReactComponent.resources.client.componentUrl,
|
|
41161
|
+
normalizedBaseUrl
|
|
41162
|
+
),
|
|
41163
|
+
cssUrl: compData.editorReactComponent.resources.client.cssUrl && normalizeUrl(
|
|
41164
|
+
compData.editorReactComponent.resources.client.cssUrl,
|
|
41165
|
+
normalizedBaseUrl
|
|
41166
|
+
)
|
|
41167
|
+
},
|
|
41168
|
+
server: {
|
|
41169
|
+
url: normalizeUrl(
|
|
41170
|
+
compData.editorReactComponent.resources.server.url,
|
|
41171
|
+
normalizedBaseUrl
|
|
41172
|
+
)
|
|
41173
|
+
}
|
|
41174
|
+
}
|
|
41175
|
+
};
|
|
41176
|
+
}
|
|
40397
41177
|
}
|
|
40398
41178
|
return clonedManifest;
|
|
40399
41179
|
};
|
|
@@ -40619,10 +41399,8 @@ export {
|
|
|
40619
41399
|
getViteConfig2 as getViteConfig3,
|
|
40620
41400
|
getViteConfig3 as getViteConfig4,
|
|
40621
41401
|
readAppManifest,
|
|
40622
|
-
updateBrowserComponentsWithBaseUrl,
|
|
40623
41402
|
updateMonitoring,
|
|
40624
41403
|
updateTopology,
|
|
40625
|
-
updateBlocksComponents,
|
|
40626
41404
|
updateAppManifestComponents,
|
|
40627
41405
|
validateComponents,
|
|
40628
41406
|
createCustomElementConfig,
|
|
@@ -40635,4 +41413,4 @@ export {
|
|
|
40635
41413
|
he/he.js:
|
|
40636
41414
|
(*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
|
|
40637
41415
|
*/
|
|
40638
|
-
//# sourceMappingURL=chunk-
|
|
41416
|
+
//# sourceMappingURL=chunk-SIJDKP2Q.js.map
|