@unpackjs/core 4.6.1 → 4.7.0
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/compiled/css-loader/index.js +20 -20
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/sass-loader/index.js +8 -8
- package/dist/index.js +1309 -180
- package/dist/index.js.LICENSE.txt +20 -0
- package/dist/rslib-runtime.js +12 -2
- package/dist/transformLoader.js +3 -1
- package/dist-types/cli/injectFramework.d.ts.map +1 -1
- package/dist-types/global.d.ts +2 -0
- package/dist-types/global.d.ts.map +1 -1
- package/dist-types/plugin.d.ts +5 -4
- package/dist-types/plugin.d.ts.map +1 -1
- package/dist-types/plugins/browserLogs.d.ts.map +1 -1
- package/dist-types/plugins/prebundle.d.ts.map +1 -1
- package/dist-types/plugins/svgIcons.d.ts +2 -2
- package/dist-types/plugins/svgIcons.d.ts.map +1 -1
- package/dist-types/plugins/unocss.d.ts +2 -2
- package/dist-types/plugins/unocss.d.ts.map +1 -1
- package/dist-types/rspack-config/helpers.d.ts +2 -2
- package/dist-types/rspack-config/index.d.ts.map +1 -1
- package/dist-types/rspack-config/loaders/transformLoader.d.ts +2 -2
- package/dist-types/rspack-config/loaders/transformLoader.d.ts.map +1 -1
- package/dist-types/rspack-config/plugins/registerHooks.d.ts.map +1 -1
- package/dist-types/run/dev.d.ts +1 -1
- package/dist-types/run/dev.d.ts.map +1 -1
- package/dist-types/types/config.d.ts +1 -1
- package/dist-types/types/config.d.ts.map +1 -1
- package/dist-types/types/plugin.d.ts +33 -14
- package/dist-types/types/plugin.d.ts.map +1 -1
- package/dist-types/types/thirdParty.d.ts +2 -0
- package/dist-types/types/thirdParty.d.ts.map +1 -1
- package/dist-types/utils.d.ts +2 -2
- package/dist-types/utils.d.ts.map +1 -1
- package/package.json +3 -3
- package/compiled/launch-editor/index.d.ts +0 -16
- package/compiled/launch-editor/index.js +0 -761
- package/compiled/launch-editor/license +0 -21
- package/compiled/launch-editor/package.json +0 -1
- package/compiled/webpack-merge/index.d.ts +0 -31
- package/compiled/webpack-merge/index.js +0 -1200
- package/compiled/webpack-merge/license +0 -20
- package/compiled/webpack-merge/package.json +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
let lastTrackTime, devServerPort, lastFileInfo, logger;
|
|
2
3
|
import __rslib_shim_module__ from "node:module";
|
|
3
4
|
let require = __rslib_shim_module__.createRequire(import.meta.url);
|
|
4
5
|
import { fileURLToPath as __rspack_fileURLToPath, pathToFileURL } from "node:url";
|
|
5
6
|
import node_path, { dirname as __rspack_dirname, join, sep } from "node:path";
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
7
|
+
import * as __rspack_external_child_process from "child_process";
|
|
8
|
+
import * as __rspack_external_fs from "fs";
|
|
9
|
+
import * as __rspack_external_os from "os";
|
|
10
|
+
import * as __rspack_external_path from "path";
|
|
11
|
+
import * as __rspack_external_url from "url";
|
|
8
12
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
9
13
|
import { Compilation, rspack } from "@rspack/core";
|
|
10
14
|
import cac from "cac";
|
|
@@ -24,11 +28,1105 @@ import { RspackDevServer } from "@rspack/dev-server";
|
|
|
24
28
|
import { exec, spawn } from "node:child_process";
|
|
25
29
|
import chokidar from "chokidar";
|
|
26
30
|
__webpack_require__.add({
|
|
27
|
-
"
|
|
28
|
-
|
|
31
|
+
"../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
32
|
+
let clone = __webpack_require__("../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js"), typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"), isPlainObject = __webpack_require__("../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js");
|
|
33
|
+
module.exports = function cloneDeep(val, instanceClone) {
|
|
34
|
+
switch(typeOf(val)){
|
|
35
|
+
case 'object':
|
|
36
|
+
var val1 = val, instanceClone1 = instanceClone;
|
|
37
|
+
if ('function' == typeof instanceClone1) return instanceClone1(val1);
|
|
38
|
+
if (instanceClone1 || isPlainObject(val1)) {
|
|
39
|
+
let res = new val1.constructor();
|
|
40
|
+
for(let key in val1)res[key] = cloneDeep(val1[key], instanceClone1);
|
|
41
|
+
return res;
|
|
42
|
+
}
|
|
43
|
+
return val1;
|
|
44
|
+
case 'array':
|
|
45
|
+
var val2 = val, instanceClone2 = instanceClone;
|
|
46
|
+
let res = new val2.constructor(val2.length);
|
|
47
|
+
for(let i = 0; i < val2.length; i++)res[i] = cloneDeep(val2[i], instanceClone2);
|
|
48
|
+
return res;
|
|
49
|
+
default:
|
|
50
|
+
return clone(val);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
"../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js" (module) {
|
|
55
|
+
function isBuffer(obj) {
|
|
56
|
+
return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
|
|
57
|
+
}
|
|
58
|
+
function keyIdentity(key) {
|
|
59
|
+
return key;
|
|
60
|
+
}
|
|
61
|
+
function flatten(target, opts) {
|
|
62
|
+
let delimiter = (opts = opts || {}).delimiter || '.', maxDepth = opts.maxDepth, transformKey = opts.transformKey || keyIdentity, output = {};
|
|
63
|
+
return !function step(object, prev, currentDepth) {
|
|
64
|
+
currentDepth = currentDepth || 1, Object.keys(object).forEach(function(key) {
|
|
65
|
+
let value = object[key], isarray = opts.safe && Array.isArray(value), type = Object.prototype.toString.call(value), isbuffer = isBuffer(value), newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
|
|
66
|
+
if (!isarray && !isbuffer && ('[object Object]' === type || '[object Array]' === type) && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
|
|
67
|
+
output[newKey] = value;
|
|
68
|
+
});
|
|
69
|
+
}(target), output;
|
|
70
|
+
}
|
|
71
|
+
module.exports = flatten, flatten.flatten = flatten, flatten.unflatten = function unflatten(target, opts) {
|
|
72
|
+
let delimiter = (opts = opts || {}).delimiter || '.', overwrite = opts.overwrite || !1, transformKey = opts.transformKey || keyIdentity, result = {};
|
|
73
|
+
if (isBuffer(target) || '[object Object]' !== Object.prototype.toString.call(target)) return target;
|
|
74
|
+
function getkey(key) {
|
|
75
|
+
let parsedKey = Number(key);
|
|
76
|
+
return isNaN(parsedKey) || -1 !== key.indexOf('.') || opts.object ? key : parsedKey;
|
|
77
|
+
}
|
|
78
|
+
return Object.keys(target = Object.keys(target).reduce(function(result, key) {
|
|
79
|
+
var target1, val;
|
|
80
|
+
let type, type1 = Object.prototype.toString.call(target[key]);
|
|
81
|
+
return ('[object Object]' === type1 || '[object Array]' === type1) && (val = target[key], type = Object.prototype.toString.call(val), val && ('[object Array]' === type ? val.length : '[object Object]' === type ? Object.keys(val).length : !void 0)) ? Object.keys(target1 = flatten(target[key], opts)).reduce(function(result, key1) {
|
|
82
|
+
return result[key + delimiter + key1] = target1[key1], result;
|
|
83
|
+
}, result) : (result[key] = target[key], result);
|
|
84
|
+
}, {})).forEach(function(key) {
|
|
85
|
+
let split = key.split(delimiter).map(transformKey), key1 = getkey(split.shift()), key2 = getkey(split[0]), recipient = result;
|
|
86
|
+
for(; void 0 !== key2;){
|
|
87
|
+
if ('__proto__' === key1) return;
|
|
88
|
+
let type = Object.prototype.toString.call(recipient[key1]), isobject = '[object Object]' === type || '[object Array]' === type;
|
|
89
|
+
if (!overwrite && !isobject && void 0 !== recipient[key1]) return;
|
|
90
|
+
(!overwrite || isobject) && (overwrite || null != recipient[key1]) || (recipient[key1] = 'number' != typeof key2 || opts.object ? {} : []), recipient = recipient[key1], split.length > 0 && (key1 = getkey(split.shift()), key2 = getkey(split[0]));
|
|
91
|
+
}
|
|
92
|
+
recipient[key1] = unflatten(target[key], opts);
|
|
93
|
+
}), result;
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
97
|
+
var isObject = __webpack_require__("../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js");
|
|
98
|
+
function isObjectObject(o) {
|
|
99
|
+
return !0 === isObject(o) && '[object Object]' === Object.prototype.toString.call(o);
|
|
100
|
+
}
|
|
101
|
+
module.exports = function(o) {
|
|
102
|
+
var ctor, prot;
|
|
103
|
+
return !1 !== isObjectObject(o) && 'function' == typeof (ctor = o.constructor) && !1 !== isObjectObject(prot = ctor.prototype) && !1 !== prot.hasOwnProperty('isPrototypeOf');
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js" (module) {
|
|
107
|
+
module.exports = function(val) {
|
|
108
|
+
return null != val && 'object' == typeof val && !1 === Array.isArray(val);
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
"../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js" (module) {
|
|
112
|
+
var toString = Object.prototype.toString;
|
|
113
|
+
function ctorName(val) {
|
|
114
|
+
return 'function' == typeof val.constructor ? val.constructor.name : null;
|
|
115
|
+
}
|
|
116
|
+
module.exports = function(val) {
|
|
117
|
+
if (void 0 === val) return 'undefined';
|
|
118
|
+
if (null === val) return 'null';
|
|
119
|
+
var val1, val2, val3, val4, val5, val6, type = typeof val;
|
|
120
|
+
if ('boolean' === type) return 'boolean';
|
|
121
|
+
if ('string' === type) return 'string';
|
|
122
|
+
if ('number' === type) return 'number';
|
|
123
|
+
if ('symbol' === type) return 'symbol';
|
|
124
|
+
if ('function' === type) return 'GeneratorFunction' === ctorName(val) ? 'generatorfunction' : 'function';
|
|
125
|
+
if (val1 = val, Array.isArray ? Array.isArray(val1) : val1 instanceof Array) return 'array';
|
|
126
|
+
if ((val2 = val).constructor && 'function' == typeof val2.constructor.isBuffer && val2.constructor.isBuffer(val2)) return 'buffer';
|
|
127
|
+
if (function(val) {
|
|
128
|
+
try {
|
|
129
|
+
if ('number' == typeof val.length && 'function' == typeof val.callee) return !0;
|
|
130
|
+
} catch (err) {
|
|
131
|
+
if (-1 !== err.message.indexOf('callee')) return !0;
|
|
132
|
+
}
|
|
133
|
+
return !1;
|
|
134
|
+
}(val)) return 'arguments';
|
|
135
|
+
if ((val3 = val) instanceof Date || 'function' == typeof val3.toDateString && 'function' == typeof val3.getDate && 'function' == typeof val3.setDate) return 'date';
|
|
136
|
+
if ((val4 = val) instanceof Error || 'string' == typeof val4.message && val4.constructor && 'number' == typeof val4.constructor.stackTraceLimit) return 'error';
|
|
137
|
+
if ((val5 = val) instanceof RegExp || 'string' == typeof val5.flags && 'boolean' == typeof val5.ignoreCase && 'boolean' == typeof val5.multiline && 'boolean' == typeof val5.global) return 'regexp';
|
|
138
|
+
switch(ctorName(val)){
|
|
139
|
+
case 'Symbol':
|
|
140
|
+
return 'symbol';
|
|
141
|
+
case 'Promise':
|
|
142
|
+
return 'promise';
|
|
143
|
+
case 'WeakMap':
|
|
144
|
+
return 'weakmap';
|
|
145
|
+
case 'WeakSet':
|
|
146
|
+
return 'weakset';
|
|
147
|
+
case 'Map':
|
|
148
|
+
return 'map';
|
|
149
|
+
case 'Set':
|
|
150
|
+
return 'set';
|
|
151
|
+
case 'Int8Array':
|
|
152
|
+
return 'int8array';
|
|
153
|
+
case 'Uint8Array':
|
|
154
|
+
return 'uint8array';
|
|
155
|
+
case 'Uint8ClampedArray':
|
|
156
|
+
return 'uint8clampedarray';
|
|
157
|
+
case 'Int16Array':
|
|
158
|
+
return 'int16array';
|
|
159
|
+
case 'Uint16Array':
|
|
160
|
+
return 'uint16array';
|
|
161
|
+
case 'Int32Array':
|
|
162
|
+
return 'int32array';
|
|
163
|
+
case 'Uint32Array':
|
|
164
|
+
return 'uint32array';
|
|
165
|
+
case 'Float32Array':
|
|
166
|
+
return 'float32array';
|
|
167
|
+
case 'Float64Array':
|
|
168
|
+
return 'float64array';
|
|
169
|
+
}
|
|
170
|
+
if ('function' == typeof (val6 = val).throw && 'function' == typeof val6.return && 'function' == typeof val6.next) return 'generator';
|
|
171
|
+
switch(type = toString.call(val)){
|
|
172
|
+
case '[object Object]':
|
|
173
|
+
return 'object';
|
|
174
|
+
case '[object Map Iterator]':
|
|
175
|
+
return 'mapiterator';
|
|
176
|
+
case '[object Set Iterator]':
|
|
177
|
+
return 'setiterator';
|
|
178
|
+
case '[object String Iterator]':
|
|
179
|
+
return 'stringiterator';
|
|
180
|
+
case '[object Array Iterator]':
|
|
181
|
+
return 'arrayiterator';
|
|
182
|
+
}
|
|
183
|
+
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js" (module) {
|
|
187
|
+
module.exports = {
|
|
188
|
+
atom: 'atom',
|
|
189
|
+
Brackets: 'brackets',
|
|
190
|
+
'code-insiders': 'code-insiders',
|
|
191
|
+
code: 'code',
|
|
192
|
+
vscodium: 'vscodium',
|
|
193
|
+
codium: 'codium',
|
|
194
|
+
cursor: 'cursor',
|
|
195
|
+
trae: 'trae',
|
|
196
|
+
antigravity: 'antigravity',
|
|
197
|
+
emacs: 'emacs',
|
|
198
|
+
gvim: 'gvim',
|
|
199
|
+
idea: 'idea',
|
|
200
|
+
'idea.sh': 'idea',
|
|
201
|
+
phpstorm: 'phpstorm',
|
|
202
|
+
'phpstorm.sh': 'phpstorm',
|
|
203
|
+
pycharm: 'pycharm',
|
|
204
|
+
'pycharm.sh': 'pycharm',
|
|
205
|
+
rubymine: 'rubymine',
|
|
206
|
+
'rubymine.sh': 'rubymine',
|
|
207
|
+
sublime_text: 'subl',
|
|
208
|
+
vim: 'vim',
|
|
209
|
+
webstorm: 'webstorm',
|
|
210
|
+
'webstorm.sh': 'webstorm',
|
|
211
|
+
goland: 'goland',
|
|
212
|
+
'goland.sh': 'goland',
|
|
213
|
+
rider: 'rider',
|
|
214
|
+
'rider.sh': 'rider',
|
|
215
|
+
zed: 'zed'
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js" (module) {
|
|
219
|
+
module.exports = {
|
|
220
|
+
'/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
|
|
221
|
+
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
222
|
+
'/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
|
|
223
|
+
'/Applications/Sublime Text.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
|
|
224
|
+
'/Applications/Sublime Text.app/Contents/MacOS/sublime_text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
|
|
225
|
+
'/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2': '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
|
|
226
|
+
'/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
|
|
227
|
+
'/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
|
|
228
|
+
'/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders': 'code-insiders',
|
|
229
|
+
'/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron': 'code-insiders',
|
|
230
|
+
'/Applications/VSCodium.app/Contents/MacOS/Electron': 'codium',
|
|
231
|
+
'/Applications/Cursor.app/Contents/MacOS/Cursor': 'cursor',
|
|
232
|
+
'/Applications/Trae.app/Contents/MacOS/Electron': 'trae',
|
|
233
|
+
'/Applications/Antigravity.app/Contents/MacOS/Electron': 'antigravity',
|
|
234
|
+
'/Applications/AppCode.app/Contents/MacOS/appcode': '/Applications/AppCode.app/Contents/MacOS/appcode',
|
|
235
|
+
'/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion',
|
|
236
|
+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
|
|
237
|
+
'/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea',
|
|
238
|
+
'/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea',
|
|
239
|
+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
|
|
240
|
+
'/Applications/PyCharm.app/Contents/MacOS/pycharm': '/Applications/PyCharm.app/Contents/MacOS/pycharm',
|
|
241
|
+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm': '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
|
|
242
|
+
'/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine',
|
|
243
|
+
'/Applications/WebStorm.app/Contents/MacOS/webstorm': '/Applications/WebStorm.app/Contents/MacOS/webstorm',
|
|
244
|
+
'/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
|
|
245
|
+
'/Applications/GoLand.app/Contents/MacOS/goland': '/Applications/GoLand.app/Contents/MacOS/goland',
|
|
246
|
+
'/Applications/Rider.app/Contents/MacOS/rider': '/Applications/Rider.app/Contents/MacOS/rider',
|
|
247
|
+
'/Applications/Zed.app/Contents/MacOS/zed': 'zed'
|
|
248
|
+
};
|
|
29
249
|
},
|
|
30
|
-
"
|
|
31
|
-
module.exports =
|
|
250
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js" (module) {
|
|
251
|
+
module.exports = [
|
|
252
|
+
'Brackets.exe',
|
|
253
|
+
'Code.exe',
|
|
254
|
+
'Code - Insiders.exe',
|
|
255
|
+
'VSCodium.exe',
|
|
256
|
+
'Cursor.exe',
|
|
257
|
+
'atom.exe',
|
|
258
|
+
'sublime_text.exe',
|
|
259
|
+
'notepad++.exe',
|
|
260
|
+
'clion.exe',
|
|
261
|
+
'clion64.exe',
|
|
262
|
+
'idea.exe',
|
|
263
|
+
'idea64.exe',
|
|
264
|
+
'phpstorm.exe',
|
|
265
|
+
'phpstorm64.exe',
|
|
266
|
+
'pycharm.exe',
|
|
267
|
+
'pycharm64.exe',
|
|
268
|
+
'rubymine.exe',
|
|
269
|
+
'rubymine64.exe',
|
|
270
|
+
'webstorm.exe',
|
|
271
|
+
'webstorm64.exe',
|
|
272
|
+
'goland.exe',
|
|
273
|
+
'goland64.exe',
|
|
274
|
+
'rider.exe',
|
|
275
|
+
'rider64.exe',
|
|
276
|
+
'trae.exe',
|
|
277
|
+
'zed.exe',
|
|
278
|
+
'Antigravity.exe'
|
|
279
|
+
];
|
|
280
|
+
},
|
|
281
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
282
|
+
let path = __webpack_require__("path");
|
|
283
|
+
module.exports = function(editor, fileName, lineNumber, columnNumber = 1) {
|
|
284
|
+
switch(path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')){
|
|
285
|
+
case 'atom':
|
|
286
|
+
case 'Atom':
|
|
287
|
+
case 'Atom Beta':
|
|
288
|
+
case 'subl':
|
|
289
|
+
case 'sublime':
|
|
290
|
+
case 'sublime_text':
|
|
291
|
+
case 'wstorm':
|
|
292
|
+
case 'charm':
|
|
293
|
+
case 'zed':
|
|
294
|
+
return [
|
|
295
|
+
`${fileName}:${lineNumber}:${columnNumber}`
|
|
296
|
+
];
|
|
297
|
+
case 'notepad++':
|
|
298
|
+
return [
|
|
299
|
+
'-n' + lineNumber,
|
|
300
|
+
'-c' + columnNumber,
|
|
301
|
+
fileName
|
|
302
|
+
];
|
|
303
|
+
case 'vim':
|
|
304
|
+
case 'mvim':
|
|
305
|
+
return [
|
|
306
|
+
`+call cursor(${lineNumber}, ${columnNumber})`,
|
|
307
|
+
fileName
|
|
308
|
+
];
|
|
309
|
+
case 'joe':
|
|
310
|
+
case 'gvim':
|
|
311
|
+
return [
|
|
312
|
+
`+${lineNumber}`,
|
|
313
|
+
fileName
|
|
314
|
+
];
|
|
315
|
+
case 'emacs':
|
|
316
|
+
case 'emacsclient':
|
|
317
|
+
return [
|
|
318
|
+
`+${lineNumber}:${columnNumber}`,
|
|
319
|
+
fileName
|
|
320
|
+
];
|
|
321
|
+
case 'rmate':
|
|
322
|
+
case 'mate':
|
|
323
|
+
case 'mine':
|
|
324
|
+
return [
|
|
325
|
+
'--line',
|
|
326
|
+
lineNumber,
|
|
327
|
+
fileName
|
|
328
|
+
];
|
|
329
|
+
case 'code':
|
|
330
|
+
case 'Code':
|
|
331
|
+
case 'code-insiders':
|
|
332
|
+
case 'Code - Insiders':
|
|
333
|
+
case 'codium':
|
|
334
|
+
case 'trae':
|
|
335
|
+
case 'antigravity':
|
|
336
|
+
case 'cursor':
|
|
337
|
+
case 'vscodium':
|
|
338
|
+
case 'VSCodium':
|
|
339
|
+
return [
|
|
340
|
+
'-r',
|
|
341
|
+
'-g',
|
|
342
|
+
`${fileName}:${lineNumber}:${columnNumber}`
|
|
343
|
+
];
|
|
344
|
+
case 'appcode':
|
|
345
|
+
case 'clion':
|
|
346
|
+
case 'clion64':
|
|
347
|
+
case 'idea':
|
|
348
|
+
case 'idea64':
|
|
349
|
+
case 'phpstorm':
|
|
350
|
+
case 'phpstorm64':
|
|
351
|
+
case 'pycharm':
|
|
352
|
+
case 'pycharm64':
|
|
353
|
+
case 'rubymine':
|
|
354
|
+
case 'rubymine64':
|
|
355
|
+
case 'webstorm':
|
|
356
|
+
case 'webstorm64':
|
|
357
|
+
case 'goland':
|
|
358
|
+
case 'goland64':
|
|
359
|
+
case 'rider':
|
|
360
|
+
case 'rider64':
|
|
361
|
+
return [
|
|
362
|
+
'--line',
|
|
363
|
+
lineNumber,
|
|
364
|
+
'--column',
|
|
365
|
+
columnNumber,
|
|
366
|
+
fileName
|
|
367
|
+
];
|
|
368
|
+
}
|
|
369
|
+
return process.env.LAUNCH_EDITOR ? [
|
|
370
|
+
fileName,
|
|
371
|
+
lineNumber,
|
|
372
|
+
columnNumber
|
|
373
|
+
] : [
|
|
374
|
+
fileName
|
|
375
|
+
];
|
|
376
|
+
};
|
|
377
|
+
},
|
|
378
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
379
|
+
let path = __webpack_require__("path"), shellQuote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js"), childProcess = __webpack_require__("child_process"), COMMON_EDITORS_MACOS = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js"), COMMON_EDITORS_LINUX = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js"), COMMON_EDITORS_WIN = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js");
|
|
380
|
+
module.exports = function(specifiedEditor) {
|
|
381
|
+
if (specifiedEditor) return shellQuote.parse(specifiedEditor);
|
|
382
|
+
if (process.env.LAUNCH_EDITOR) return [
|
|
383
|
+
process.env.LAUNCH_EDITOR
|
|
384
|
+
];
|
|
385
|
+
if (process.versions.webcontainer) return [
|
|
386
|
+
process.env.EDITOR || 'code'
|
|
387
|
+
];
|
|
388
|
+
try {
|
|
389
|
+
if ('darwin' === process.platform) {
|
|
390
|
+
let output = childProcess.execSync('ps x -o comm=', {
|
|
391
|
+
stdio: [
|
|
392
|
+
'pipe',
|
|
393
|
+
'pipe',
|
|
394
|
+
'ignore'
|
|
395
|
+
]
|
|
396
|
+
}).toString(), processNames = Object.keys(COMMON_EDITORS_MACOS), processList = output.split('\n');
|
|
397
|
+
for(let i = 0; i < processNames.length; i++){
|
|
398
|
+
let processName = processNames[i];
|
|
399
|
+
if (processList.includes(processName)) return [
|
|
400
|
+
COMMON_EDITORS_MACOS[processName]
|
|
401
|
+
];
|
|
402
|
+
let processNameWithoutApplications = processName.replace('/Applications', '');
|
|
403
|
+
if (-1 !== output.indexOf(processNameWithoutApplications)) {
|
|
404
|
+
if (processName !== COMMON_EDITORS_MACOS[processName]) return [
|
|
405
|
+
COMMON_EDITORS_MACOS[processName]
|
|
406
|
+
];
|
|
407
|
+
let runningProcess = processList.find((procName)=>procName.endsWith(processNameWithoutApplications));
|
|
408
|
+
if (void 0 !== runningProcess) return [
|
|
409
|
+
runningProcess
|
|
410
|
+
];
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} else if ('win32' === process.platform) {
|
|
414
|
+
let runningProcesses = childProcess.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"', {
|
|
415
|
+
stdio: [
|
|
416
|
+
'pipe',
|
|
417
|
+
'pipe',
|
|
418
|
+
'ignore'
|
|
419
|
+
]
|
|
420
|
+
}).toString().split('\r\n');
|
|
421
|
+
for(let i = 0; i < runningProcesses.length; i++){
|
|
422
|
+
let fullProcessPath = runningProcesses[i].trim(), shortProcessName = path.basename(fullProcessPath);
|
|
423
|
+
if (-1 !== COMMON_EDITORS_WIN.indexOf(shortProcessName)) return [
|
|
424
|
+
fullProcessPath
|
|
425
|
+
];
|
|
426
|
+
}
|
|
427
|
+
} else if ('linux' === process.platform) {
|
|
428
|
+
let output = childProcess.execSync('ps x --no-heading -o comm --sort=comm', {
|
|
429
|
+
stdio: [
|
|
430
|
+
'pipe',
|
|
431
|
+
'pipe',
|
|
432
|
+
'ignore'
|
|
433
|
+
]
|
|
434
|
+
}).toString(), processNames = Object.keys(COMMON_EDITORS_LINUX);
|
|
435
|
+
for(let i = 0; i < processNames.length; i++){
|
|
436
|
+
let processName = processNames[i];
|
|
437
|
+
if (-1 !== output.indexOf(processName)) return [
|
|
438
|
+
COMMON_EDITORS_LINUX[processName]
|
|
439
|
+
];
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
} catch (ignoreError) {}
|
|
443
|
+
return process.env.VISUAL ? [
|
|
444
|
+
process.env.VISUAL
|
|
445
|
+
] : process.env.EDITOR ? [
|
|
446
|
+
process.env.EDITOR
|
|
447
|
+
] : [
|
|
448
|
+
null
|
|
449
|
+
];
|
|
450
|
+
};
|
|
451
|
+
},
|
|
452
|
+
"../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
453
|
+
let fs = __webpack_require__("fs"), os = __webpack_require__("os"), path = __webpack_require__("path"), colors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"), childProcess = __webpack_require__("child_process"), guessEditor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/guess.js"), getArgumentsForPosition = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js"), positionRE = /:(\d+)(:(\d+))?$/, _childProcess = null;
|
|
454
|
+
module.exports = function(file, specifiedEditor, onErrorCallback) {
|
|
455
|
+
var file1, cb;
|
|
456
|
+
let fileName, match, parsed = ((file1 = file).startsWith('file://') && (file1 = __webpack_require__("url").fileURLToPath(file1)), fileName = file1.replace(positionRE, ''), {
|
|
457
|
+
fileName,
|
|
458
|
+
lineNumber: (match = file1.match(positionRE)) && match[1],
|
|
459
|
+
columnNumber: match && match[3]
|
|
460
|
+
}), { fileName: fileName1 } = parsed, { lineNumber, columnNumber } = parsed;
|
|
461
|
+
if (!fs.existsSync(fileName1)) return;
|
|
462
|
+
'function' == typeof specifiedEditor && (onErrorCallback = specifiedEditor, specifiedEditor = void 0), cb = onErrorCallback, onErrorCallback = (fileName, errorMessage)=>{
|
|
463
|
+
console.log(), console.log(colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')), errorMessage && ('.' !== errorMessage[errorMessage.length - 1] && (errorMessage += '.'), console.log(colors.red('The editor process exited with an error: ' + errorMessage))), console.log(), cb && cb(fileName, errorMessage);
|
|
464
|
+
};
|
|
465
|
+
let [editor, ...args] = guessEditor(specifiedEditor);
|
|
466
|
+
if (!editor) return void onErrorCallback(fileName1, null);
|
|
467
|
+
if ('linux' === process.platform && fileName1.startsWith('/mnt/') && /Microsoft/i.test(os.release()) && (fileName1 = path.relative('', fileName1)), lineNumber) {
|
|
468
|
+
let extraArgs = getArgumentsForPosition(editor, fileName1, lineNumber, columnNumber);
|
|
469
|
+
args.push.apply(args, extraArgs);
|
|
470
|
+
} else args.push(fileName1);
|
|
471
|
+
if (_childProcess && function(editor) {
|
|
472
|
+
switch(editor){
|
|
473
|
+
case 'vim':
|
|
474
|
+
case 'emacs':
|
|
475
|
+
case 'nano':
|
|
476
|
+
return !0;
|
|
477
|
+
}
|
|
478
|
+
return !1;
|
|
479
|
+
}(editor) && _childProcess.kill('SIGKILL'), 'win32' === process.platform) {
|
|
480
|
+
let launchCommand = [
|
|
481
|
+
editor,
|
|
482
|
+
...args.map(function(cmdArgs) {
|
|
483
|
+
return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
|
|
484
|
+
})
|
|
485
|
+
].map(function(str) {
|
|
486
|
+
return str.includes('^') ? `^"${str}^"` : str.includes(' ') ? `"${str}"` : str;
|
|
487
|
+
}).join(' ');
|
|
488
|
+
_childProcess = childProcess.exec(launchCommand, {
|
|
489
|
+
stdio: 'inherit',
|
|
490
|
+
shell: !0
|
|
491
|
+
});
|
|
492
|
+
} else _childProcess = childProcess.spawn(editor, args, {
|
|
493
|
+
stdio: 'inherit'
|
|
494
|
+
});
|
|
495
|
+
_childProcess.on('exit', function(errorCode) {
|
|
496
|
+
_childProcess = null, errorCode && onErrorCallback(fileName1, '(code ' + errorCode + ')');
|
|
497
|
+
}), _childProcess.on('error', function(error) {
|
|
498
|
+
let { code, message } = error;
|
|
499
|
+
'ENOENT' === code && (message = `${message} ('${editor}' command does not exist in 'PATH')`), onErrorCallback(fileName1, message);
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
},
|
|
503
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
504
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {}, isColorSupported = !(env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI), formatter = (open, close, replace = open)=>(input)=>{
|
|
505
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
506
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
507
|
+
}, replaceClose = (string, close, replace, index)=>{
|
|
508
|
+
let result = "", cursor = 0;
|
|
509
|
+
do result += string.substring(cursor, index) + replace, cursor = index + close.length, index = string.indexOf(close, cursor);
|
|
510
|
+
while (~index);
|
|
511
|
+
return result + string.substring(cursor);
|
|
512
|
+
}, createColors = (enabled = isColorSupported)=>{
|
|
513
|
+
let f = enabled ? formatter : ()=>String;
|
|
514
|
+
return {
|
|
515
|
+
isColorSupported: enabled,
|
|
516
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
517
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
518
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
519
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
520
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
521
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
522
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
523
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
524
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
525
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
526
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
527
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
528
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
529
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
530
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
531
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
532
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
533
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
534
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
535
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
536
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
537
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
538
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
539
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
540
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
541
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
542
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
543
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
544
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
545
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
546
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
547
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
548
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
549
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
550
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
551
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
552
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
553
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
554
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
555
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
556
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
module.exports = createColors(), module.exports.createColors = createColors;
|
|
560
|
+
},
|
|
561
|
+
"../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
562
|
+
let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
|
|
563
|
+
module.exports = function(val, deep) {
|
|
564
|
+
var val1, val2, val3, val4, val5;
|
|
565
|
+
switch(typeOf(val)){
|
|
566
|
+
case 'array':
|
|
567
|
+
return val.slice();
|
|
568
|
+
case 'object':
|
|
569
|
+
return Object.assign({}, val);
|
|
570
|
+
case 'date':
|
|
571
|
+
return new val.constructor(Number(val));
|
|
572
|
+
case 'map':
|
|
573
|
+
return new Map(val);
|
|
574
|
+
case 'set':
|
|
575
|
+
return new Set(val);
|
|
576
|
+
case 'buffer':
|
|
577
|
+
let len, buf;
|
|
578
|
+
return len = (val1 = val).length, buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len), val1.copy(buf), buf;
|
|
579
|
+
case 'symbol':
|
|
580
|
+
return val2 = val, valueOf ? Object(valueOf.call(val2)) : {};
|
|
581
|
+
case 'arraybuffer':
|
|
582
|
+
let res;
|
|
583
|
+
return new Uint8Array(res = new (val3 = val).constructor(val3.byteLength)).set(new Uint8Array(val3)), res;
|
|
584
|
+
case 'float32array':
|
|
585
|
+
case 'float64array':
|
|
586
|
+
case 'int16array':
|
|
587
|
+
case 'int32array':
|
|
588
|
+
case 'int8array':
|
|
589
|
+
case 'uint16array':
|
|
590
|
+
case 'uint32array':
|
|
591
|
+
case 'uint8clampedarray':
|
|
592
|
+
case 'uint8array':
|
|
593
|
+
return new (val4 = val).constructor(val4.buffer, val4.byteOffset, val4.length);
|
|
594
|
+
case 'regexp':
|
|
595
|
+
let flags, re;
|
|
596
|
+
return flags = void 0 !== (val5 = val).flags ? val5.flags : /\w+$/.exec(val5) || void 0, (re = new val5.constructor(val5.source, flags)).lastIndex = val5.lastIndex, re;
|
|
597
|
+
case 'error':
|
|
598
|
+
return Object.create(val);
|
|
599
|
+
default:
|
|
600
|
+
return val;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
},
|
|
604
|
+
"../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
605
|
+
exports.quote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js"), exports.parse = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
|
|
606
|
+
},
|
|
607
|
+
"../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js" (module) {
|
|
608
|
+
for(var CONTROL = "(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])", controlRE = RegExp('^' + CONTROL + '$'), META = '|&;()<> \\t', hash = /^#$/, TOKEN = '', i = 0; i < 4; i++)TOKEN += (0x100000000 * Math.random()).toString(16);
|
|
609
|
+
var startsWithToken = RegExp('^' + TOKEN);
|
|
610
|
+
module.exports = function(s, env, opts) {
|
|
611
|
+
var mapped = function(string, env, opts) {
|
|
612
|
+
opts || (opts = {});
|
|
613
|
+
var BS = opts.escape || '\\', matches = function(s, r) {
|
|
614
|
+
for(var matchObj, origIndex = r.lastIndex, matches = []; matchObj = r.exec(s);)matches.push(matchObj), r.lastIndex === matchObj.index && (r.lastIndex += 1);
|
|
615
|
+
return r.lastIndex = origIndex, matches;
|
|
616
|
+
}(string, RegExp([
|
|
617
|
+
'(' + CONTROL + ')',
|
|
618
|
+
'(' + ('(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META) + "])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')+"
|
|
619
|
+
].join('|'), 'g'));
|
|
620
|
+
if (0 === matches.length) return [];
|
|
621
|
+
env || (env = {});
|
|
622
|
+
var commented = !1;
|
|
623
|
+
return matches.map(function(match) {
|
|
624
|
+
var i, s = match[0];
|
|
625
|
+
if (s && !commented) {
|
|
626
|
+
if (controlRE.test(s)) return {
|
|
627
|
+
op: s
|
|
628
|
+
};
|
|
629
|
+
var quote = !1, esc = !1, out = '', isGlob = !1;
|
|
630
|
+
for(i = 0; i < s.length; i++){
|
|
631
|
+
var c = s.charAt(i);
|
|
632
|
+
if (isGlob = isGlob || !quote && ('*' === c || '?' === c), esc) out += c, esc = !1;
|
|
633
|
+
else if (quote) c === quote ? quote = !1 : "'" == quote ? out += c : c === BS ? (i += 1, '"' === (c = s.charAt(i)) || c === BS || '$' === c ? out += c : out += BS + c) : '$' === c ? out += parseEnvVar() : out += c;
|
|
634
|
+
else if ('"' === c || "'" === c) quote = c;
|
|
635
|
+
else if (controlRE.test(c)) return {
|
|
636
|
+
op: s
|
|
637
|
+
};
|
|
638
|
+
else if (hash.test(c)) {
|
|
639
|
+
commented = !0;
|
|
640
|
+
var commentObj = {
|
|
641
|
+
comment: string.slice(match.index + i + 1)
|
|
642
|
+
};
|
|
643
|
+
if (out.length) return [
|
|
644
|
+
out,
|
|
645
|
+
commentObj
|
|
646
|
+
];
|
|
647
|
+
return [
|
|
648
|
+
commentObj
|
|
649
|
+
];
|
|
650
|
+
} else c === BS ? esc = !0 : '$' === c ? out += parseEnvVar() : out += c;
|
|
651
|
+
}
|
|
652
|
+
return isGlob ? {
|
|
653
|
+
op: 'glob',
|
|
654
|
+
pattern: out
|
|
655
|
+
} : out;
|
|
656
|
+
}
|
|
657
|
+
function parseEnvVar() {
|
|
658
|
+
i += 1;
|
|
659
|
+
var env1, key, r, varend, varname, char = s.charAt(i);
|
|
660
|
+
if ('{' === char) {
|
|
661
|
+
if (i += 1, '}' === s.charAt(i)) throw Error('Bad substitution: ' + s.slice(i - 2, i + 1));
|
|
662
|
+
if ((varend = s.indexOf('}', i)) < 0) throw Error('Bad substitution: ' + s.slice(i));
|
|
663
|
+
varname = s.slice(i, varend), i = varend;
|
|
664
|
+
} else if (/[*@#?$!_-]/.test(char)) varname = char, i += 1;
|
|
665
|
+
else {
|
|
666
|
+
var slicedFromI = s.slice(i);
|
|
667
|
+
(varend = slicedFromI.match(/[^\w\d_]/)) ? (varname = slicedFromI.slice(0, varend.index), i += varend.index - 1) : (varname = slicedFromI, i = s.length);
|
|
668
|
+
}
|
|
669
|
+
return env1 = env, key = varname, (void 0 === (r = 'function' == typeof env1 ? env1(key) : env1[key]) && '' != key ? r = '' : void 0 === r && (r = '$'), 'object' == typeof r) ? '' + TOKEN + JSON.stringify(r) + TOKEN : '' + r;
|
|
670
|
+
}
|
|
671
|
+
}).reduce(function(prev, arg) {
|
|
672
|
+
return void 0 === arg ? prev : prev.concat(arg);
|
|
673
|
+
}, []);
|
|
674
|
+
}(s, env, opts);
|
|
675
|
+
return 'function' != typeof env ? mapped : mapped.reduce(function(acc, s) {
|
|
676
|
+
if ('object' == typeof s) return acc.concat(s);
|
|
677
|
+
var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
|
|
678
|
+
return 1 === xs.length ? acc.concat(xs[0]) : acc.concat(xs.filter(Boolean).map(function(x) {
|
|
679
|
+
return startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
|
|
680
|
+
}));
|
|
681
|
+
}, []);
|
|
682
|
+
};
|
|
683
|
+
},
|
|
684
|
+
"../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js" (module) {
|
|
685
|
+
module.exports = function(xs) {
|
|
686
|
+
return xs.map(function(s) {
|
|
687
|
+
return '' === s ? '\'\'' : s && 'object' == typeof s ? s.op.replace(/(.)/g, '\\$1') : /["\s\\]/.test(s) && !/'/.test(s) ? "'" + s.replace(/(['])/g, '\\$1') + "'" : /["'\s]/.test(s) ? '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"' : String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
|
|
688
|
+
}).join(' ');
|
|
689
|
+
};
|
|
690
|
+
},
|
|
691
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
692
|
+
var __read = this && this.__read || function(o, n) {
|
|
693
|
+
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
694
|
+
if (!m) return o;
|
|
695
|
+
var r, e, i = m.call(o), ar = [];
|
|
696
|
+
try {
|
|
697
|
+
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
698
|
+
} catch (error) {
|
|
699
|
+
e = {
|
|
700
|
+
error: error
|
|
701
|
+
};
|
|
702
|
+
} finally{
|
|
703
|
+
try {
|
|
704
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
705
|
+
} finally{
|
|
706
|
+
if (e) throw e.error;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
return ar;
|
|
710
|
+
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
711
|
+
if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
|
|
712
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
713
|
+
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
714
|
+
return mod && mod.__esModule ? mod : {
|
|
715
|
+
default: mod
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
Object.defineProperty(exports, "__esModule", {
|
|
719
|
+
value: !0
|
|
720
|
+
}), exports.unique = exports.mergeWithRules = exports.mergeWithCustomize = exports.default = exports.merge = exports.CustomizeRule = exports.customizeObject = exports.customizeArray = void 0;
|
|
721
|
+
var wildcard_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js")), merge_with_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js")), join_arrays_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js"));
|
|
722
|
+
exports.unique = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js")).default;
|
|
723
|
+
var types_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js");
|
|
724
|
+
Object.defineProperty(exports, "CustomizeRule", {
|
|
725
|
+
enumerable: !0,
|
|
726
|
+
get: function() {
|
|
727
|
+
return types_1.CustomizeRule;
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
var utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js");
|
|
731
|
+
function merge(firstConfiguration) {
|
|
732
|
+
for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
|
|
733
|
+
return mergeWithCustomize({}).apply(void 0, __spreadArray([
|
|
734
|
+
firstConfiguration
|
|
735
|
+
], __read(configurations), !1));
|
|
736
|
+
}
|
|
737
|
+
function mergeWithCustomize(options) {
|
|
738
|
+
return function(firstConfiguration) {
|
|
739
|
+
for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
|
|
740
|
+
if ((0, utils_1.isUndefined)(firstConfiguration) || configurations.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
|
|
741
|
+
if (firstConfiguration.then) throw TypeError("Promises are not supported");
|
|
742
|
+
if (!firstConfiguration) return {};
|
|
743
|
+
if (0 === configurations.length) {
|
|
744
|
+
if (Array.isArray(firstConfiguration)) {
|
|
745
|
+
if (0 === firstConfiguration.length) return {};
|
|
746
|
+
if (firstConfiguration.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
|
|
747
|
+
if (firstConfiguration[0].then) throw TypeError("Promises are not supported");
|
|
748
|
+
return (0, merge_with_1.default)(firstConfiguration, (0, join_arrays_1.default)(options));
|
|
749
|
+
}
|
|
750
|
+
return firstConfiguration;
|
|
751
|
+
}
|
|
752
|
+
return (0, merge_with_1.default)([
|
|
753
|
+
firstConfiguration
|
|
754
|
+
].concat(configurations), (0, join_arrays_1.default)(options));
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
exports.merge = merge, exports.default = merge, exports.mergeWithCustomize = mergeWithCustomize, exports.customizeArray = function(rules) {
|
|
758
|
+
return function(a, b, key) {
|
|
759
|
+
var matchedRule = Object.keys(rules).find(function(rule) {
|
|
760
|
+
return (0, wildcard_1.default)(rule, key);
|
|
761
|
+
}) || "";
|
|
762
|
+
if (matchedRule) switch(rules[matchedRule]){
|
|
763
|
+
case types_1.CustomizeRule.Prepend:
|
|
764
|
+
return __spreadArray(__spreadArray([], __read(b), !1), __read(a), !1);
|
|
765
|
+
case types_1.CustomizeRule.Replace:
|
|
766
|
+
return b;
|
|
767
|
+
case types_1.CustomizeRule.Append:
|
|
768
|
+
default:
|
|
769
|
+
return __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
}, exports.mergeWithRules = function(rules) {
|
|
773
|
+
return mergeWithCustomize({
|
|
774
|
+
customizeArray: function(a, b, key) {
|
|
775
|
+
var currentRule = rules;
|
|
776
|
+
return (key.split(".").forEach(function(k) {
|
|
777
|
+
currentRule && (currentRule = currentRule[k]);
|
|
778
|
+
}), (0, utils_1.isPlainObject)(currentRule)) ? function mergeWithRule(_a) {
|
|
779
|
+
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
|
780
|
+
if (!isArray(a)) return a;
|
|
781
|
+
var bAllMatches = [];
|
|
782
|
+
return a.map(function(ao) {
|
|
783
|
+
if (!(0, utils_1.isPlainObject)(currentRule)) return ao;
|
|
784
|
+
var ret = {}, rulesToMatch = [], operations = {};
|
|
785
|
+
Object.entries(currentRule).forEach(function(_a) {
|
|
786
|
+
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
787
|
+
v === types_1.CustomizeRule.Match ? rulesToMatch.push(k) : operations[k] = v;
|
|
788
|
+
});
|
|
789
|
+
var bMatches = b.filter(function(o) {
|
|
790
|
+
var matches = rulesToMatch.every(function(rule) {
|
|
791
|
+
return (0, utils_1.isSameCondition)(ao[rule], o[rule]);
|
|
792
|
+
});
|
|
793
|
+
return matches && bAllMatches.push(o), matches;
|
|
794
|
+
});
|
|
795
|
+
return (0, utils_1.isPlainObject)(ao) ? (Object.entries(ao).forEach(function(_a) {
|
|
796
|
+
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
797
|
+
switch(currentRule[k]){
|
|
798
|
+
case types_1.CustomizeRule.Match:
|
|
799
|
+
ret[k] = v, Object.entries(currentRule).forEach(function(_a) {
|
|
800
|
+
var _b = __read(_a, 2), k = _b[0];
|
|
801
|
+
if (_b[1] === types_1.CustomizeRule.Replace && bMatches.length > 0) {
|
|
802
|
+
var val = last(bMatches)[k];
|
|
803
|
+
void 0 !== val && (ret[k] = val);
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
break;
|
|
807
|
+
case types_1.CustomizeRule.Append:
|
|
808
|
+
if (!bMatches.length) {
|
|
809
|
+
ret[k] = v;
|
|
810
|
+
break;
|
|
811
|
+
}
|
|
812
|
+
var appendValue = last(bMatches)[k];
|
|
813
|
+
if (!isArray(v) || !isArray(appendValue)) throw TypeError("Trying to append non-arrays");
|
|
814
|
+
ret[k] = v.concat(appendValue);
|
|
815
|
+
break;
|
|
816
|
+
case types_1.CustomizeRule.Merge:
|
|
817
|
+
if (!bMatches.length) {
|
|
818
|
+
ret[k] = v;
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
var lastValue = last(bMatches)[k];
|
|
822
|
+
if (!(0, utils_1.isPlainObject)(v) || !(0, utils_1.isPlainObject)(lastValue)) throw TypeError("Trying to merge non-objects");
|
|
823
|
+
ret[k] = merge(v, lastValue);
|
|
824
|
+
break;
|
|
825
|
+
case types_1.CustomizeRule.Prepend:
|
|
826
|
+
if (!bMatches.length) {
|
|
827
|
+
ret[k] = v;
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
var prependValue = last(bMatches)[k];
|
|
831
|
+
if (!isArray(v) || !isArray(prependValue)) throw TypeError("Trying to prepend non-arrays");
|
|
832
|
+
ret[k] = prependValue.concat(v);
|
|
833
|
+
break;
|
|
834
|
+
case types_1.CustomizeRule.Replace:
|
|
835
|
+
ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
|
|
836
|
+
break;
|
|
837
|
+
default:
|
|
838
|
+
var currentRule_1 = operations[k], b_1 = bMatches.map(function(o) {
|
|
839
|
+
return o[k];
|
|
840
|
+
}).reduce(function(acc, val) {
|
|
841
|
+
return isArray(acc) && isArray(val) ? __spreadArray(__spreadArray([], __read(acc), !1), __read(val), !1) : acc;
|
|
842
|
+
}, []);
|
|
843
|
+
ret[k] = mergeWithRule({
|
|
844
|
+
currentRule: currentRule_1,
|
|
845
|
+
a: v,
|
|
846
|
+
b: b_1
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
}), ret) : ao;
|
|
850
|
+
}).concat(b.filter(function(o) {
|
|
851
|
+
return !bAllMatches.includes(o);
|
|
852
|
+
}));
|
|
853
|
+
}({
|
|
854
|
+
currentRule: currentRule,
|
|
855
|
+
a: a,
|
|
856
|
+
b: b
|
|
857
|
+
}) : "string" == typeof currentRule ? function(_a) {
|
|
858
|
+
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
|
859
|
+
switch(currentRule){
|
|
860
|
+
case types_1.CustomizeRule.Append:
|
|
861
|
+
return a.concat(b);
|
|
862
|
+
case types_1.CustomizeRule.Prepend:
|
|
863
|
+
return b.concat(a);
|
|
864
|
+
case types_1.CustomizeRule.Replace:
|
|
865
|
+
return b;
|
|
866
|
+
}
|
|
867
|
+
return a;
|
|
868
|
+
}({
|
|
869
|
+
currentRule: currentRule,
|
|
870
|
+
a: a,
|
|
871
|
+
b: b
|
|
872
|
+
}) : void 0;
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
};
|
|
876
|
+
var isArray = Array.isArray;
|
|
877
|
+
function last(arr) {
|
|
878
|
+
return arr[arr.length - 1];
|
|
879
|
+
}
|
|
880
|
+
exports.customizeObject = function(rules) {
|
|
881
|
+
return function(a, b, key) {
|
|
882
|
+
switch(rules[key]){
|
|
883
|
+
case types_1.CustomizeRule.Prepend:
|
|
884
|
+
return (0, merge_with_1.default)([
|
|
885
|
+
b,
|
|
886
|
+
a
|
|
887
|
+
], (0, join_arrays_1.default)());
|
|
888
|
+
case types_1.CustomizeRule.Replace:
|
|
889
|
+
return b;
|
|
890
|
+
case types_1.CustomizeRule.Append:
|
|
891
|
+
return (0, merge_with_1.default)([
|
|
892
|
+
a,
|
|
893
|
+
b
|
|
894
|
+
], (0, join_arrays_1.default)());
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
},
|
|
899
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
900
|
+
var __read = this && this.__read || function(o, n) {
|
|
901
|
+
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
902
|
+
if (!m) return o;
|
|
903
|
+
var r, e, i = m.call(o), ar = [];
|
|
904
|
+
try {
|
|
905
|
+
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
906
|
+
} catch (error) {
|
|
907
|
+
e = {
|
|
908
|
+
error: error
|
|
909
|
+
};
|
|
910
|
+
} finally{
|
|
911
|
+
try {
|
|
912
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
913
|
+
} finally{
|
|
914
|
+
if (e) throw e.error;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
return ar;
|
|
918
|
+
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
919
|
+
if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
|
|
920
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
921
|
+
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
922
|
+
return mod && mod.__esModule ? mod : {
|
|
923
|
+
default: mod
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
Object.defineProperty(exports, "__esModule", {
|
|
927
|
+
value: !0
|
|
928
|
+
});
|
|
929
|
+
var clone_deep_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js")), merge_with_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js")), utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js"), isArray = Array.isArray;
|
|
930
|
+
exports.default = function joinArrays(_a) {
|
|
931
|
+
var _b = void 0 === _a ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
|
|
932
|
+
return function _joinArrays(a, b, k) {
|
|
933
|
+
var newKey = key ? "".concat(key, ".").concat(k) : k;
|
|
934
|
+
if ((0, utils_1.isFunction)(a) && (0, utils_1.isFunction)(b)) return function() {
|
|
935
|
+
for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
|
|
936
|
+
return _joinArrays(a.apply(void 0, __spreadArray([], __read(args), !1)), b.apply(void 0, __spreadArray([], __read(args), !1)), k);
|
|
937
|
+
};
|
|
938
|
+
if (isArray(a) && isArray(b)) {
|
|
939
|
+
var customResult = customizeArray && customizeArray(a, b, newKey);
|
|
940
|
+
return customResult || __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
|
|
941
|
+
}
|
|
942
|
+
if ((0, utils_1.isRegex)(b)) return b;
|
|
943
|
+
if ((0, utils_1.isPlainObject)(a) && (0, utils_1.isPlainObject)(b)) {
|
|
944
|
+
var customResult = customizeObject && customizeObject(a, b, newKey);
|
|
945
|
+
return customResult || (0, merge_with_1.default)([
|
|
946
|
+
a,
|
|
947
|
+
b
|
|
948
|
+
], joinArrays({
|
|
949
|
+
customizeArray: customizeArray,
|
|
950
|
+
customizeObject: customizeObject,
|
|
951
|
+
key: newKey
|
|
952
|
+
}));
|
|
953
|
+
}
|
|
954
|
+
return (0, utils_1.isPlainObject)(b) ? (0, clone_deep_1.default)(b) : isArray(b) ? __spreadArray([], __read(b), !1) : b;
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
},
|
|
958
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js" (__unused_rspack_module, exports) {
|
|
959
|
+
var __read = this && this.__read || function(o, n) {
|
|
960
|
+
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
961
|
+
if (!m) return o;
|
|
962
|
+
var r, e, i = m.call(o), ar = [];
|
|
963
|
+
try {
|
|
964
|
+
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
965
|
+
} catch (error) {
|
|
966
|
+
e = {
|
|
967
|
+
error: error
|
|
968
|
+
};
|
|
969
|
+
} finally{
|
|
970
|
+
try {
|
|
971
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
972
|
+
} finally{
|
|
973
|
+
if (e) throw e.error;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
return ar;
|
|
977
|
+
};
|
|
978
|
+
Object.defineProperty(exports, "__esModule", {
|
|
979
|
+
value: !0
|
|
980
|
+
}), exports.default = function(objects, customizer) {
|
|
981
|
+
var _a = __read(objects), first = _a[0], rest = _a.slice(1), ret = first;
|
|
982
|
+
return rest.forEach(function(a) {
|
|
983
|
+
var a1, b, customizer1, ret1;
|
|
984
|
+
a1 = ret, b = a, customizer1 = customizer, ret1 = {}, Object.keys(a1).concat(Object.keys(b)).forEach(function(k) {
|
|
985
|
+
var v = customizer1(a1[k], b[k], k);
|
|
986
|
+
ret1[k] = void 0 === v ? a1[k] : v;
|
|
987
|
+
}), ret = ret1;
|
|
988
|
+
}), ret;
|
|
989
|
+
};
|
|
990
|
+
},
|
|
991
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js" (__unused_rspack_module, exports) {
|
|
992
|
+
var CustomizeRule, CustomizeRule1;
|
|
993
|
+
Object.defineProperty(exports, "__esModule", {
|
|
994
|
+
value: !0
|
|
995
|
+
}), exports.CustomizeRule = void 0, (CustomizeRule1 = CustomizeRule || (exports.CustomizeRule = CustomizeRule = {})).Match = "match", CustomizeRule1.Merge = "merge", CustomizeRule1.Append = "append", CustomizeRule1.Prepend = "prepend", CustomizeRule1.Replace = "replace";
|
|
996
|
+
},
|
|
997
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js" (__unused_rspack_module, exports) {
|
|
998
|
+
var __read = this && this.__read || function(o, n) {
|
|
999
|
+
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1000
|
+
if (!m) return o;
|
|
1001
|
+
var r, e, i = m.call(o), ar = [];
|
|
1002
|
+
try {
|
|
1003
|
+
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1004
|
+
} catch (error) {
|
|
1005
|
+
e = {
|
|
1006
|
+
error: error
|
|
1007
|
+
};
|
|
1008
|
+
} finally{
|
|
1009
|
+
try {
|
|
1010
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
1011
|
+
} finally{
|
|
1012
|
+
if (e) throw e.error;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return ar;
|
|
1016
|
+
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
1017
|
+
if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
|
|
1018
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1019
|
+
};
|
|
1020
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1021
|
+
value: !0
|
|
1022
|
+
}), exports.default = function(key, uniques, getter) {
|
|
1023
|
+
var uniquesSet = new Set(uniques);
|
|
1024
|
+
return function(a, b, k) {
|
|
1025
|
+
return k === key && Array.from(__spreadArray(__spreadArray([], __read(a), !1), __read(b), !1).map(function(it) {
|
|
1026
|
+
return {
|
|
1027
|
+
key: getter(it),
|
|
1028
|
+
value: it
|
|
1029
|
+
};
|
|
1030
|
+
}).map(function(_a) {
|
|
1031
|
+
var key = _a.key, value = _a.value;
|
|
1032
|
+
return {
|
|
1033
|
+
key: uniquesSet.has(key) ? key : value,
|
|
1034
|
+
value: value
|
|
1035
|
+
};
|
|
1036
|
+
}).reduce(function(m, _a) {
|
|
1037
|
+
var key = _a.key, value = _a.value;
|
|
1038
|
+
return m.delete(key), m.set(key, value);
|
|
1039
|
+
}, new Map()).values());
|
|
1040
|
+
};
|
|
1041
|
+
};
|
|
1042
|
+
},
|
|
1043
|
+
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1044
|
+
var __read = this && this.__read || function(o, n) {
|
|
1045
|
+
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1046
|
+
if (!m) return o;
|
|
1047
|
+
var r, e, i = m.call(o), ar = [];
|
|
1048
|
+
try {
|
|
1049
|
+
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1050
|
+
} catch (error) {
|
|
1051
|
+
e = {
|
|
1052
|
+
error: error
|
|
1053
|
+
};
|
|
1054
|
+
} finally{
|
|
1055
|
+
try {
|
|
1056
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
1057
|
+
} finally{
|
|
1058
|
+
if (e) throw e.error;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
return ar;
|
|
1062
|
+
};
|
|
1063
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1064
|
+
value: !0
|
|
1065
|
+
}), exports.isSameCondition = exports.isUndefined = exports.isPlainObject = exports.isFunction = exports.isRegex = void 0;
|
|
1066
|
+
var flat_1 = __webpack_require__("../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js");
|
|
1067
|
+
function isRegex(o) {
|
|
1068
|
+
return o instanceof RegExp;
|
|
1069
|
+
}
|
|
1070
|
+
function isFunction(functionToCheck) {
|
|
1071
|
+
return functionToCheck && "[object Function]" === ({}).toString.call(functionToCheck);
|
|
1072
|
+
}
|
|
1073
|
+
exports.isRegex = isRegex, exports.isFunction = isFunction, exports.isPlainObject = function(a) {
|
|
1074
|
+
return !(null === a || Array.isArray(a)) && "object" == typeof a;
|
|
1075
|
+
}, exports.isUndefined = function(a) {
|
|
1076
|
+
return void 0 === a;
|
|
1077
|
+
}, exports.isSameCondition = function(a, b) {
|
|
1078
|
+
if (!a || !b) return a === b;
|
|
1079
|
+
if ("string" == typeof a || "string" == typeof b || isRegex(a) || isRegex(b) || isFunction(a) || isFunction(b)) return a.toString() === b.toString();
|
|
1080
|
+
var _a, _b, entriesA = Object.entries((0, flat_1.flatten)(a)), entriesB = Object.entries((0, flat_1.flatten)(b));
|
|
1081
|
+
if (entriesA.length !== entriesB.length) return !1;
|
|
1082
|
+
for(var i = 0; i < entriesA.length; i++)entriesA[i][0] = entriesA[i][0].replace(/\b\d+\b/g, "[]"), entriesB[i][0] = entriesB[i][0].replace(/\b\d+\b/g, "[]");
|
|
1083
|
+
function cmp(_a, _b) {
|
|
1084
|
+
var _c = __read(_a, 2), k1 = _c[0], v1 = _c[1], _d = __read(_b, 2), k2 = _d[0], v2 = _d[1];
|
|
1085
|
+
return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
|
|
1086
|
+
}
|
|
1087
|
+
if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
|
|
1088
|
+
for(var i = 0; i < entriesA.length; i++)if (entriesA[i][0] !== entriesB[i][0] || (null == (_a = entriesA[i][1]) ? void 0 : _a.toString()) !== (null == (_b = entriesB[i][1]) ? void 0 : _b.toString())) return !1;
|
|
1089
|
+
return !0;
|
|
1090
|
+
};
|
|
1091
|
+
},
|
|
1092
|
+
"../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js" (module) {
|
|
1093
|
+
var REGEXP_PARTS = /(\*|\?)/g;
|
|
1094
|
+
function WildcardMatcher(text, separator) {
|
|
1095
|
+
this.text = text = text || '', this.hasWild = text.indexOf('*') >= 0, this.separator = separator, this.parts = text.split(separator).map(this.classifyPart.bind(this));
|
|
1096
|
+
}
|
|
1097
|
+
WildcardMatcher.prototype.match = function(input) {
|
|
1098
|
+
var ii, testParts, matches = !0, parts = this.parts, partsCount = parts.length;
|
|
1099
|
+
if ('string' == typeof input || input instanceof String) if (this.hasWild || this.text == input) {
|
|
1100
|
+
for(ii = 0, testParts = (input || '').split(this.separator); matches && ii < partsCount; ii++)if ('*' === parts[ii]) continue;
|
|
1101
|
+
else matches = ii < testParts.length && (parts[ii] instanceof RegExp ? parts[ii].test(testParts[ii]) : parts[ii] === testParts[ii]);
|
|
1102
|
+
matches = matches && testParts;
|
|
1103
|
+
} else matches = !1;
|
|
1104
|
+
else if ('function' == typeof input.splice) for(matches = [], ii = input.length; ii--;)this.match(input[ii]) && (matches[matches.length] = input[ii]);
|
|
1105
|
+
else if ('object' == typeof input) for(var key in matches = {}, input)this.match(key) && (matches[key] = input[key]);
|
|
1106
|
+
return matches;
|
|
1107
|
+
}, WildcardMatcher.prototype.classifyPart = function(part) {
|
|
1108
|
+
if ('*' === part) ;
|
|
1109
|
+
else if (part.indexOf('*') >= 0 || part.indexOf('?') >= 0) return new RegExp(part.replace(REGEXP_PARTS, '\.$1'));
|
|
1110
|
+
return part;
|
|
1111
|
+
}, module.exports = function(text, test, separator) {
|
|
1112
|
+
var matcher = new WildcardMatcher(text, separator || /[\/\.]/);
|
|
1113
|
+
return void 0 !== test ? matcher.match(test) : matcher;
|
|
1114
|
+
};
|
|
1115
|
+
},
|
|
1116
|
+
child_process (module) {
|
|
1117
|
+
module.exports = __rspack_external_child_process;
|
|
1118
|
+
},
|
|
1119
|
+
fs (module) {
|
|
1120
|
+
module.exports = __rspack_external_fs;
|
|
1121
|
+
},
|
|
1122
|
+
os (module) {
|
|
1123
|
+
module.exports = __rspack_external_os;
|
|
1124
|
+
},
|
|
1125
|
+
path (module) {
|
|
1126
|
+
module.exports = __rspack_external_path;
|
|
1127
|
+
},
|
|
1128
|
+
url (module) {
|
|
1129
|
+
module.exports = __rspack_external_url;
|
|
32
1130
|
}
|
|
33
1131
|
});
|
|
34
1132
|
let isCI = !!process.env.CI, isTTY = !!process.stdout?.isTTY, noColor = !!process.env.NO_COLOR, forceColor = !!process.env.FORCE_COLOR, disableColor = !1;
|
|
@@ -121,7 +1219,7 @@ let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULE
|
|
|
121
1219
|
</body>
|
|
122
1220
|
</html>`, JS_REGEX = /\.[jt]s$/, JSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx?$/;
|
|
123
1221
|
var utils_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
124
|
-
let
|
|
1222
|
+
let getNodeEnv = ()=>process.env.NODE_ENV, setNodeEnv = (env)=>{
|
|
125
1223
|
process.env.NODE_ENV = env;
|
|
126
1224
|
}, setDevServer = (isDevServer)=>{
|
|
127
1225
|
process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
|
|
@@ -540,6 +1638,8 @@ let removeDir = (dir)=>{
|
|
|
540
1638
|
currentUnpackConfig = config;
|
|
541
1639
|
}, unpackStartTime = 0, getUnpackStartTime = ()=>unpackStartTime, setUnpackStartTime = (time)=>{
|
|
542
1640
|
unpackStartTime = time;
|
|
1641
|
+
}, getDevServerPort = ()=>devServerPort, setDevServerPort = (port)=>{
|
|
1642
|
+
devServerPort = port;
|
|
543
1643
|
}, STYLE_IMPORT_RE = /import\s+((?:(?!\nimport\s)[\s\S])*?)\s+from\s+(['"])([^'"]+?\.(?:css|less|scss|sass)(?:\?[^'"]+)?(?:#[^'"]+)?)\2/g, TYPE_IMPORT_CLAUSE_RE = /^\s*type\b/, STYLE_EXT_HINTS = [
|
|
544
1644
|
'.css',
|
|
545
1645
|
'.less',
|
|
@@ -657,7 +1757,9 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
|
|
|
657
1757
|
if ('function' == typeof symbolId) return symbolId(name, filePath);
|
|
658
1758
|
let id = (symbolId || 'icon-[dir]-[name]').replace(/\[name\]/g, name).replace(/\[dir\]/g, dir);
|
|
659
1759
|
return id.replace(/--+/g, '-').replace(/^-+|-+$/g, '');
|
|
660
|
-
},
|
|
1760
|
+
}, dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
|
|
1761
|
+
var dist_default = __webpack_require__.n(dist), dist_default_0 = dist_default();
|
|
1762
|
+
let UNOCSS_CONFIG_FILES = [
|
|
661
1763
|
'unocss.config.mjs',
|
|
662
1764
|
'unocss.config.ts',
|
|
663
1765
|
'unocss.config.js',
|
|
@@ -670,10 +1772,10 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
|
|
|
670
1772
|
if (!view) return (css)=>css;
|
|
671
1773
|
let prefix = {};
|
|
672
1774
|
return view.trim().replace(/(\\*)\\(["'`\\])/g, (_, bs, char)=>(prefix[char] = bs.replace(/\\\\/g, '\\'), '')), (css)=>css.replace(/["'`\\]/g, (v)=>(prefix[v] || '') + v);
|
|
673
|
-
}, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
|
|
1775
|
+
}, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm, TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis, flattenUnpackPlugins = ()=>getCurrentUnpackConfig().plugins?.flat(1 / 0) || [];
|
|
674
1776
|
function getNormalizedPluginsByHook(hook) {
|
|
675
1777
|
let pluginMap = new Map();
|
|
676
|
-
(
|
|
1778
|
+
flattenUnpackPlugins().forEach((plugin)=>{
|
|
677
1779
|
plugin && ((plugin, hook)=>{
|
|
678
1780
|
if (!plugin[hook]) return !1;
|
|
679
1781
|
let apply = plugin.apply;
|
|
@@ -682,7 +1784,9 @@ function getNormalizedPluginsByHook(hook) {
|
|
|
682
1784
|
mode: getNodeEnv(),
|
|
683
1785
|
command: utils_isDevServer() ? 'dev' : 'build'
|
|
684
1786
|
};
|
|
685
|
-
|
|
1787
|
+
if ('string' == typeof apply) return apply === env.command;
|
|
1788
|
+
let config = getCurrentUnpackConfig(), context = createPluginContext(plugin);
|
|
1789
|
+
return !!apply.call(context, config, env);
|
|
686
1790
|
})(plugin, hook) && pluginMap.set(plugin.name, plugin);
|
|
687
1791
|
});
|
|
688
1792
|
let normalizedPlugins = Array.from(pluginMap.values()), enforceOrder = (plugin)=>'pre' === plugin.enforce ? 0 : 'post' === plugin.enforce ? 2 : 1;
|
|
@@ -694,7 +1798,7 @@ function getNormalizedPluginsByHook(hook) {
|
|
|
694
1798
|
return 0 !== diff ? diff : a.index - b.index;
|
|
695
1799
|
}).map((item)=>item.plugin);
|
|
696
1800
|
}
|
|
697
|
-
let createPluginHookTimer = (
|
|
1801
|
+
let createPluginHookTimer = (pluginName, hook)=>{
|
|
698
1802
|
let startTime = 0;
|
|
699
1803
|
return {
|
|
700
1804
|
start: ()=>{
|
|
@@ -702,22 +1806,44 @@ let createPluginHookTimer = (plugin, hook)=>{
|
|
|
702
1806
|
},
|
|
703
1807
|
end: ()=>{
|
|
704
1808
|
let duration = performance.now() - startTime;
|
|
705
|
-
logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(
|
|
1809
|
+
logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue(hook)} ${colors.dim('in')} ${colors.yellow(`${duration.toFixed(2)}ms`)}`);
|
|
706
1810
|
}
|
|
707
1811
|
};
|
|
708
|
-
},
|
|
1812
|
+
}, transformTimingMap = globalScope[TRANSFORM_TIMING_STORE] ?? new WeakMap();
|
|
1813
|
+
globalScope[TRANSFORM_TIMING_STORE] = transformTimingMap;
|
|
1814
|
+
let pluginContextStore = globalScope[PLUGIN_CONTEXT_STORE] ?? new WeakMap();
|
|
1815
|
+
globalScope[PLUGIN_CONTEXT_STORE] = pluginContextStore;
|
|
1816
|
+
let createPluginContext = (plugin)=>{
|
|
1817
|
+
let cached = pluginContextStore.get(plugin);
|
|
1818
|
+
if (cached) return cached;
|
|
1819
|
+
let context = {
|
|
1820
|
+
name: plugin.name,
|
|
1821
|
+
get port () {
|
|
1822
|
+
return getDevServerPort();
|
|
1823
|
+
},
|
|
1824
|
+
get cachePath () {
|
|
1825
|
+
return getCurrentUnpackConfig()._context.cachePath;
|
|
1826
|
+
},
|
|
1827
|
+
info: (msg)=>logger_logger.info(msg),
|
|
1828
|
+
warn: (msg)=>logger_logger.warn(msg),
|
|
1829
|
+
error: (msg)=>logger_logger.error(msg),
|
|
1830
|
+
debug: (msg)=>logger_logger.debug(msg),
|
|
1831
|
+
isPluginExists: (name)=>flattenUnpackPlugins().some((item)=>item && item.name === name)
|
|
1832
|
+
};
|
|
1833
|
+
return pluginContextStore.set(plugin, context), context;
|
|
1834
|
+
};
|
|
709
1835
|
async function applyPluginsByHook(hook, runner) {
|
|
710
1836
|
let shouldMeasure = 'processAssets' !== hook && 'transform' !== hook;
|
|
711
1837
|
for (let plugin of getNormalizedPluginsByHook(hook)){
|
|
712
|
-
let impl = plugin[hook];
|
|
1838
|
+
let impl = plugin[hook], context = createPluginContext(plugin);
|
|
713
1839
|
if (!shouldMeasure) {
|
|
714
|
-
await runner(impl,
|
|
1840
|
+
await runner(impl, context);
|
|
715
1841
|
continue;
|
|
716
1842
|
}
|
|
717
|
-
let timer = createPluginHookTimer(plugin, hook);
|
|
1843
|
+
let timer = createPluginHookTimer(plugin.name, hook);
|
|
718
1844
|
timer.start();
|
|
719
1845
|
try {
|
|
720
|
-
await runner(impl,
|
|
1846
|
+
await runner(impl, context);
|
|
721
1847
|
} finally{
|
|
722
1848
|
timer.end();
|
|
723
1849
|
}
|
|
@@ -726,15 +1852,15 @@ async function applyPluginsByHook(hook, runner) {
|
|
|
726
1852
|
function applyPluginsByHookSync(hook, runner) {
|
|
727
1853
|
let shouldMeasure = 'processAssets' !== hook && 'transform' !== hook;
|
|
728
1854
|
for (let plugin of getNormalizedPluginsByHook(hook)){
|
|
729
|
-
let impl = plugin[hook];
|
|
1855
|
+
let impl = plugin[hook], context = createPluginContext(plugin);
|
|
730
1856
|
if (!shouldMeasure) {
|
|
731
|
-
runner(impl,
|
|
1857
|
+
runner(impl, context);
|
|
732
1858
|
continue;
|
|
733
1859
|
}
|
|
734
|
-
let timer = createPluginHookTimer(plugin, hook);
|
|
1860
|
+
let timer = createPluginHookTimer(plugin.name, hook);
|
|
735
1861
|
timer.start();
|
|
736
1862
|
try {
|
|
737
|
-
runner(impl,
|
|
1863
|
+
runner(impl, context);
|
|
738
1864
|
} finally{
|
|
739
1865
|
timer.end();
|
|
740
1866
|
}
|
|
@@ -782,7 +1908,7 @@ async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
|
|
|
782
1908
|
let cacheConfig = isPlainObject(unpackConfig.performance.cache) ? unpackConfig.performance.cache : {}, buildDependencies = await getBuildDependencies(unpackConfig.root);
|
|
783
1909
|
buildDependencies.userBuildDependencies = cacheConfig.buildDependencies || [], buildDependencies.envFilePaths = envFilePaths;
|
|
784
1910
|
let cacheDirectory = node_path.resolve(unpackConfig.root, cacheConfig.cacheDirectory || `${unpackConfig._context.cachePath}/cache`, utils_isDevServer() ? 'dev' : 'build');
|
|
785
|
-
return
|
|
1911
|
+
return dist_default()(config, {
|
|
786
1912
|
cache: {
|
|
787
1913
|
type: 'persistent',
|
|
788
1914
|
buildDependencies: Object.values(buildDependencies).flat(),
|
|
@@ -801,7 +1927,6 @@ async function getEntry(root, customEntry) {
|
|
|
801
1927
|
}))[0], !node_fs.existsSync(entry)) throw Error('could not find entry file');
|
|
802
1928
|
return entry;
|
|
803
1929
|
}
|
|
804
|
-
globalScope[TRANSFORM_TIMING_STORE] = transformTimingMap;
|
|
805
1930
|
let getOutputFilename = ({ type, hash, async })=>{
|
|
806
1931
|
let FILENAME = utils_isProd() && !1 !== hash ? PROD_DEFAULT_FILENAME : DEV_DEFAULT_FILENAME;
|
|
807
1932
|
return async ? 'js' === type ? FILENAME.jsAsync : FILENAME.cssAsync : FILENAME[type];
|
|
@@ -830,7 +1955,7 @@ let getOutputFilename = ({ type, hash, async })=>{
|
|
|
830
1955
|
}
|
|
831
1956
|
}), getLessLoader = (unpackConfig)=>({
|
|
832
1957
|
loader: getCompiledPkgPath('less-loader'),
|
|
833
|
-
options:
|
|
1958
|
+
options: dist_default()({
|
|
834
1959
|
lessOptions: {
|
|
835
1960
|
javascriptEnabled: !0
|
|
836
1961
|
},
|
|
@@ -870,7 +1995,7 @@ class JsMinifyPlugin {
|
|
|
870
1995
|
apply(compiler) {
|
|
871
1996
|
let meta = JSON.stringify({
|
|
872
1997
|
name: jsMinify_PLUGIN_NAME,
|
|
873
|
-
version: "4.
|
|
1998
|
+
version: "4.7.0",
|
|
874
1999
|
options: this.minifyOptions
|
|
875
2000
|
});
|
|
876
2001
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -997,13 +2122,13 @@ class RegisterHooksPlugin {
|
|
|
997
2122
|
virtualModulesPlugin.apply(compiler);
|
|
998
2123
|
let resolveIdPlugins = getNormalizedPluginsByHook('resolveId'), loadPlugins = getNormalizedPluginsByHook('load'), resolveId = async (id, importer)=>{
|
|
999
2124
|
for (let plugin of resolveIdPlugins){
|
|
1000
|
-
let start = performance.now(), result = await plugin.resolveId(id, importer), duration = performance.now() - start;
|
|
2125
|
+
let context = createPluginContext(plugin), start = performance.now(), result = await plugin.resolveId.call(context, id, importer), duration = performance.now() - start;
|
|
1001
2126
|
if (this.resolveIdTimings.set(plugin.name, (this.resolveIdTimings.get(plugin.name) || 0) + duration), 'string' == typeof result && result) return result;
|
|
1002
2127
|
}
|
|
1003
2128
|
return null;
|
|
1004
2129
|
}, load = async (id)=>{
|
|
1005
2130
|
for (let plugin of loadPlugins){
|
|
1006
|
-
let start = performance.now(), result = await plugin.load(id), duration = performance.now() - start;
|
|
2131
|
+
let context = createPluginContext(plugin), start = performance.now(), result = await plugin.load.call(context, id), duration = performance.now() - start;
|
|
1007
2132
|
if (this.loadTimings.set(plugin.name, (this.loadTimings.get(plugin.name) || 0) + duration), 'string' == typeof result) return result;
|
|
1008
2133
|
}
|
|
1009
2134
|
return null;
|
|
@@ -1019,8 +2144,8 @@ class RegisterHooksPlugin {
|
|
|
1019
2144
|
null !== loaded && this.lastLoadedModules.get(resolvedId) !== loaded && (this.lastLoadedModules.set(resolvedId, loaded), virtualModulesPlugin.writeModule(resolvedId, loaded));
|
|
1020
2145
|
});
|
|
1021
2146
|
}), compiler.hooks.compile.tap(registerHooks_PLUGIN_NAME, ()=>{
|
|
1022
|
-
this.isCompiling = !0, this.resolveIdTimings.clear(), this.loadTimings.clear(), applyPluginsByHookSync('buildStart', (impl)=>{
|
|
1023
|
-
impl({
|
|
2147
|
+
this.isCompiling = !0, this.resolveIdTimings.clear(), this.loadTimings.clear(), applyPluginsByHookSync('buildStart', (impl, context)=>{
|
|
2148
|
+
impl.call(context, {
|
|
1024
2149
|
compiler,
|
|
1025
2150
|
isFirstCompile: this.isFirstCompile,
|
|
1026
2151
|
isWatch: isDev()
|
|
@@ -1034,16 +2159,16 @@ class RegisterHooksPlugin {
|
|
|
1034
2159
|
}
|
|
1035
2160
|
};
|
|
1036
2161
|
compiler.hooks.thisCompilation.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
|
|
1037
|
-
applyPluginsByHookSync('processAssets', (impl,
|
|
2162
|
+
applyPluginsByHookSync('processAssets', (impl, context)=>{
|
|
1038
2163
|
let { stage, handler } = impl;
|
|
1039
2164
|
compilation.hooks.processAssets.tapPromise({
|
|
1040
2165
|
name: registerHooks_PLUGIN_NAME,
|
|
1041
2166
|
stage
|
|
1042
2167
|
}, async (assets)=>{
|
|
1043
|
-
let timer = createPluginHookTimer(
|
|
2168
|
+
let timer = createPluginHookTimer(context.name, 'processAssets');
|
|
1044
2169
|
timer.start();
|
|
1045
2170
|
try {
|
|
1046
|
-
await handler({
|
|
2171
|
+
await handler.call(context, {
|
|
1047
2172
|
assets,
|
|
1048
2173
|
compilation,
|
|
1049
2174
|
sources: rspack.sources,
|
|
@@ -1055,8 +2180,8 @@ class RegisterHooksPlugin {
|
|
|
1055
2180
|
});
|
|
1056
2181
|
});
|
|
1057
2182
|
}), compiler.hooks.compilation.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
|
|
1058
|
-
rspack.HtmlRspackPlugin.getCompilationHooks(compilation).beforeEmit.tapPromise(registerHooks_PLUGIN_NAME, async (data)=>(await applyPluginsByHook('transformHtml', async (impl)=>{
|
|
1059
|
-
let result = await impl(data.html);
|
|
2183
|
+
rspack.HtmlRspackPlugin.getCompilationHooks(compilation).beforeEmit.tapPromise(registerHooks_PLUGIN_NAME, async (data)=>(await applyPluginsByHook('transformHtml', async (impl, context)=>{
|
|
2184
|
+
let result = await impl.call(context, data.html);
|
|
1060
2185
|
data.html = 'string' == typeof result ? result : applyHtmlTagDescriptors(data.html, result);
|
|
1061
2186
|
}), data));
|
|
1062
2187
|
}), compiler.hooks.finishMake.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
|
|
@@ -1068,8 +2193,8 @@ class RegisterHooksPlugin {
|
|
|
1068
2193
|
transformTimingMap.delete(compilation);
|
|
1069
2194
|
}
|
|
1070
2195
|
}), compiler.hooks.done.tapPromise(registerHooks_PLUGIN_NAME, async (stats)=>{
|
|
1071
|
-
await applyPluginsByHook('buildEnd', async (impl)=>{
|
|
1072
|
-
await impl({
|
|
2196
|
+
await applyPluginsByHook('buildEnd', async (impl, context)=>{
|
|
2197
|
+
await impl.call(context, {
|
|
1073
2198
|
compiler,
|
|
1074
2199
|
isFirstCompile: this.isFirstCompile,
|
|
1075
2200
|
isWatch: isDev(),
|
|
@@ -1116,10 +2241,9 @@ var rspack_config_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.
|
|
|
1116
2241
|
async function getRspackConfig(originalUnpackConfig) {
|
|
1117
2242
|
setCurrentUnpackConfig(originalUnpackConfig);
|
|
1118
2243
|
let { plugins, rspack: rspackConfig, ...rest } = originalUnpackConfig;
|
|
1119
|
-
await applyPluginsByHook('config', async (impl)=>{
|
|
1120
|
-
rest = await impl(rest, {
|
|
1121
|
-
|
|
1122
|
-
mergeConfig: utils_mergeConfig
|
|
2244
|
+
await applyPluginsByHook('config', async (impl, context)=>{
|
|
2245
|
+
rest = await impl.call(context, rest, {
|
|
2246
|
+
mergeConfig: dist_default()
|
|
1123
2247
|
});
|
|
1124
2248
|
});
|
|
1125
2249
|
let unpackConfig = {
|
|
@@ -1127,10 +2251,16 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1127
2251
|
plugins,
|
|
1128
2252
|
rspack: rspackConfig
|
|
1129
2253
|
};
|
|
1130
|
-
setCurrentUnpackConfig(unpackConfig), await applyPluginsByHook('configResolved', async (impl)=>{
|
|
1131
|
-
await impl(
|
|
2254
|
+
setCurrentUnpackConfig(unpackConfig), utils_isDevServer() && setDevServerPort(await getPort(unpackConfig.server?.port)), await applyPluginsByHook('configResolved', async (impl, context)=>{
|
|
2255
|
+
await impl.call(context, unpackConfig);
|
|
1132
2256
|
});
|
|
1133
|
-
let tsconfigPath = node_path.resolve(unpackConfig.root, 'tsconfig.json'), isTS = node_fs.existsSync(tsconfigPath), minifyOptions = isPlainObject(unpackConfig.build?.minify) ? unpackConfig.build?.minify : {},
|
|
2257
|
+
let tsconfigPath = node_path.resolve(unpackConfig.root, 'tsconfig.json'), isTS = node_fs.existsSync(tsconfigPath), minifyOptions = isPlainObject(unpackConfig.build?.minify) ? unpackConfig.build?.minify : {}, publicDir = node_path.resolve(unpackConfig.root, 'public'), shouldCopyPublic = node_fs.existsSync(publicDir) && node_fs.statSync(publicDir).isDirectory() && node_fs.readdirSync(publicDir).length > 0, copyPatterns = [
|
|
2258
|
+
...unpackConfig.build?.copy || []
|
|
2259
|
+
];
|
|
2260
|
+
shouldCopyPublic && copyPatterns.unshift({
|
|
2261
|
+
from: publicDir
|
|
2262
|
+
});
|
|
2263
|
+
let { publicVars, filePaths: envFilePaths } = function({ cwd = process.cwd(), mode = getNodeEnv(), prefixes = [
|
|
1134
2264
|
'PUBLIC_'
|
|
1135
2265
|
], processEnv = process.env } = {}) {
|
|
1136
2266
|
if ('local' === mode) throw Error(`${colors.yellow('local')} cannot be used as a value for env mode, because ${colors.yellow('.env.local')} represents a temporary local file. Please use another value.`);
|
|
@@ -1240,8 +2370,8 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1240
2370
|
...publicVars,
|
|
1241
2371
|
...unpackConfig.define
|
|
1242
2372
|
}),
|
|
1243
|
-
|
|
1244
|
-
patterns:
|
|
2373
|
+
copyPatterns.length > 0 && new rspack.CopyRspackPlugin({
|
|
2374
|
+
patterns: copyPatterns
|
|
1245
2375
|
}),
|
|
1246
2376
|
new RegisterHooksPlugin(),
|
|
1247
2377
|
unpackConfig.build?.progressBar ? new ProgressPlugin() : new ProgressLitePlugin()
|
|
@@ -1286,12 +2416,12 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1286
2416
|
moduleIds: isDev() ? 'named' : 'deterministic',
|
|
1287
2417
|
minimize: !!unpackConfig.build?.minify && utils_isProd(),
|
|
1288
2418
|
minimizer: [
|
|
1289
|
-
new JsMinifyPlugin(
|
|
2419
|
+
new JsMinifyPlugin(dist_default()({
|
|
1290
2420
|
compress: {
|
|
1291
2421
|
target: unpackConfig.build.target
|
|
1292
2422
|
}
|
|
1293
2423
|
}, minifyOptions.oxc || {})),
|
|
1294
|
-
new rspack.LightningCssMinimizerRspackPlugin(
|
|
2424
|
+
new rspack.LightningCssMinimizerRspackPlugin(dist_default()({
|
|
1295
2425
|
minimizerOptions: {
|
|
1296
2426
|
targets: esVersionToBrowserslist(unpackConfig.build.target)
|
|
1297
2427
|
}
|
|
@@ -1305,7 +2435,7 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1305
2435
|
hints: !1
|
|
1306
2436
|
}
|
|
1307
2437
|
};
|
|
1308
|
-
return applyPluginsByHookSync('transform', (impl,
|
|
2438
|
+
return applyPluginsByHookSync('transform', (impl, context)=>{
|
|
1309
2439
|
let { filter, handler } = impl;
|
|
1310
2440
|
config.module.rules.unshift({
|
|
1311
2441
|
exclude: NODE_MODULES_REGEX,
|
|
@@ -1315,8 +2445,8 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1315
2445
|
{
|
|
1316
2446
|
loader: node_path.resolve(rspack_config_dirname, './transformLoader.js'),
|
|
1317
2447
|
options: {
|
|
1318
|
-
handler,
|
|
1319
|
-
pluginName:
|
|
2448
|
+
handler: (code, id)=>handler.call(context, code, id),
|
|
2449
|
+
pluginName: context.name
|
|
1320
2450
|
}
|
|
1321
2451
|
}
|
|
1322
2452
|
]
|
|
@@ -1499,15 +2629,14 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
1499
2629
|
}({
|
|
1500
2630
|
config,
|
|
1501
2631
|
unpackConfig
|
|
1502
|
-
})), await applyPluginsByHook('rspackConfig', async (impl)=>{
|
|
1503
|
-
config = await impl(config, {
|
|
1504
|
-
...originalUnpackConfig._context,
|
|
2632
|
+
})), await applyPluginsByHook('rspackConfig', async (impl, context)=>{
|
|
2633
|
+
config = await impl.call(context, config, {
|
|
1505
2634
|
unpackConfig,
|
|
1506
|
-
mergeConfig:
|
|
2635
|
+
mergeConfig: dist_default()
|
|
1507
2636
|
});
|
|
1508
2637
|
}), unpackConfig.rspack && (config = isFunction(unpackConfig.rspack) ? await unpackConfig.rspack(config, {
|
|
1509
|
-
mergeConfig:
|
|
1510
|
-
}) :
|
|
2638
|
+
mergeConfig: dist_default()
|
|
2639
|
+
}) : dist_default()(config, unpackConfig.rspack)), config;
|
|
1511
2640
|
}
|
|
1512
2641
|
async function unpackBuild(unpackConfig) {
|
|
1513
2642
|
let compiler = rspack(await getRspackConfig(unpackConfig)), handler = (err, stats)=>{
|
|
@@ -1585,8 +2714,8 @@ function execAsync(command, options) {
|
|
|
1585
2714
|
});
|
|
1586
2715
|
});
|
|
1587
2716
|
}
|
|
1588
|
-
async function unpackDev(
|
|
1589
|
-
let
|
|
2717
|
+
async function unpackDev(originalConfig) {
|
|
2718
|
+
let config = await getRspackConfig(originalConfig), unpackConfig = getCurrentUnpackConfig(), compiler = rspack(config), port = getDevServerPort(), proxyConfig = unpackConfig.server?.proxy;
|
|
1590
2719
|
isPlainObject(proxyConfig) && (proxyConfig = Object.entries(proxyConfig).map(([contextStr, target])=>{
|
|
1591
2720
|
let baseConfig = {
|
|
1592
2721
|
context: contextStr.split(','),
|
|
@@ -1614,8 +2743,8 @@ async function unpackDev(unpackConfig) {
|
|
|
1614
2743
|
},
|
|
1615
2744
|
host: unpackConfig.server?.host ? ALL_INTERFACES_IPV4 : LOCALHOST
|
|
1616
2745
|
}, pluginMiddlewares = [];
|
|
1617
|
-
await applyPluginsByHook('setupMiddlewares', async (impl)=>{
|
|
1618
|
-
pluginMiddlewares = await impl(pluginMiddlewares);
|
|
2746
|
+
await applyPluginsByHook('setupMiddlewares', async (impl, context)=>{
|
|
2747
|
+
pluginMiddlewares = await impl.call(context, pluginMiddlewares);
|
|
1619
2748
|
}), devServerOptions.setupMiddlewares = (middlewares)=>(middlewares.unshift((req, _, next)=>{
|
|
1620
2749
|
let accept = req.headers.accept;
|
|
1621
2750
|
if ('string' == typeof accept && accept.includes('html')) {
|
|
@@ -1628,7 +2757,7 @@ async function unpackDev(unpackConfig) {
|
|
|
1628
2757
|
...middlewares
|
|
1629
2758
|
]);
|
|
1630
2759
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
1631
|
-
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.
|
|
2760
|
+
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.0`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
|
|
1632
2761
|
port,
|
|
1633
2762
|
host: unpackConfig.server.host,
|
|
1634
2763
|
base: unpackConfig.base
|
|
@@ -1642,10 +2771,10 @@ async function unpackDev(unpackConfig) {
|
|
|
1642
2771
|
function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
|
|
1643
2772
|
let _context = {
|
|
1644
2773
|
callerName,
|
|
1645
|
-
version: "4.
|
|
2774
|
+
version: "4.7.0",
|
|
1646
2775
|
cachePath: 'node_modules/.unpack'
|
|
1647
2776
|
}, resolveConfig = (mode)=>{
|
|
1648
|
-
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root1, uno, generated,
|
|
2777
|
+
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root1, uno, generated, configOrPath, defaults, VIRTUAL_UNO_CSS_ID, rootDir, isMpa, unoConfig, configFilePath, unpackConfigPath, tokens, requestedLayers, tasks, unocssCacheDir, tokensCachePath, layersCachePath, timeCachePath, configHashCachePath, generatedCachePath, bundlerCacheDir, cachedTokensSize, cachedLayersSize, isCompiling, resolveUnocssConfig, flushTasks, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers, options, rootPath1, registerCode, namesCode, defaultConfig = {
|
|
1649
2778
|
root: cwd,
|
|
1650
2779
|
base: '/',
|
|
1651
2780
|
sourceMap: 'production' !== mode && 'cheap-module-source-map',
|
|
@@ -1878,79 +3007,76 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
1878
3007
|
`
|
|
1879
3008
|
}
|
|
1880
3009
|
],
|
|
1881
|
-
setupMiddlewares: (middlewares)=>
|
|
1882
|
-
(req
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
3010
|
+
setupMiddlewares: (middlewares)=>(middlewares.unshift((req, res, next)=>{
|
|
3011
|
+
if ('POST' !== req.method || !req.url?.startsWith(BROWSER_LOGS_ENDPOINT)) return next();
|
|
3012
|
+
let raw = '';
|
|
3013
|
+
req.on('data', (chunk)=>{
|
|
3014
|
+
raw += chunk.toString();
|
|
3015
|
+
}), req.on('end', async ()=>{
|
|
3016
|
+
try {
|
|
3017
|
+
let { level, time, args = [] } = JSON.parse(raw || '{}'), formattedArgs = await Promise.all(args.map(async (item)=>{
|
|
3018
|
+
if (!item) return '';
|
|
3019
|
+
if ('error' === item.type) {
|
|
3020
|
+
let { locationSuffix, stackString } = await resolveErrorLocationAndStack(item), msg = item.message || '', suffix = locationSuffix ? msg ? ` ${locationSuffix}` : locationSuffix : '';
|
|
3021
|
+
return `${msg}${suffix}${stackString}`;
|
|
3022
|
+
}
|
|
3023
|
+
switch(item.type){
|
|
3024
|
+
case 'string':
|
|
3025
|
+
let trimmed;
|
|
3026
|
+
return (trimmed = item.message.trim()) ? trimmed.split(/\r?\n/g).filter((line)=>{
|
|
3027
|
+
let normalized = line.trim().replace(/`/g, '');
|
|
3028
|
+
return !!normalized && !/^at\s+/.test(normalized);
|
|
3029
|
+
}).join('\n').trim() : '';
|
|
3030
|
+
case 'null':
|
|
3031
|
+
return null;
|
|
3032
|
+
case 'undefined':
|
|
3033
|
+
return;
|
|
3034
|
+
case 'object':
|
|
3035
|
+
return JSON.parse(item.message || '');
|
|
3036
|
+
default:
|
|
3037
|
+
return item.message;
|
|
3038
|
+
}
|
|
3039
|
+
})), outputArgs = ((args)=>{
|
|
3040
|
+
if (args.length < 2 || 'string' != typeof args[0]) return args;
|
|
3041
|
+
let template = args[0];
|
|
3042
|
+
if (!/%[sdifoOj%c%]/.test(template)) return args;
|
|
3043
|
+
let rest = args.slice(1), cleanedTemplate = '';
|
|
3044
|
+
for(let i = 0; i < template.length; i++){
|
|
3045
|
+
let ch = template[i];
|
|
3046
|
+
if ('%' !== ch || i + 1 >= template.length) {
|
|
3047
|
+
cleanedTemplate += ch;
|
|
3048
|
+
continue;
|
|
1894
3049
|
}
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
let normalized = line.trim().replace(/`/g, '');
|
|
1900
|
-
return !!normalized && !/^at\s+/.test(normalized);
|
|
1901
|
-
}).join('\n').trim() : '';
|
|
1902
|
-
case 'null':
|
|
1903
|
-
return null;
|
|
1904
|
-
case 'undefined':
|
|
1905
|
-
return;
|
|
1906
|
-
case 'object':
|
|
1907
|
-
return JSON.parse(item.message || '');
|
|
1908
|
-
default:
|
|
1909
|
-
return item.message;
|
|
3050
|
+
let next = template[i + 1];
|
|
3051
|
+
if ('%' === next) {
|
|
3052
|
+
cleanedTemplate += '%%', i++;
|
|
3053
|
+
continue;
|
|
1910
3054
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
if (!/%[sdifoOj%c%]/.test(template)) return args;
|
|
1915
|
-
let rest = args.slice(1), cleanedTemplate = '';
|
|
1916
|
-
for(let i = 0; i < template.length; i++){
|
|
1917
|
-
let ch = template[i];
|
|
1918
|
-
if ('%' !== ch || i + 1 >= template.length) {
|
|
1919
|
-
cleanedTemplate += ch;
|
|
1920
|
-
continue;
|
|
1921
|
-
}
|
|
1922
|
-
let next = template[i + 1];
|
|
1923
|
-
if ('%' === next) {
|
|
1924
|
-
cleanedTemplate += '%%', i++;
|
|
1925
|
-
continue;
|
|
1926
|
-
}
|
|
1927
|
-
if ('c' === next) {
|
|
1928
|
-
rest.length > 0 && rest.shift(), i++;
|
|
1929
|
-
continue;
|
|
1930
|
-
}
|
|
1931
|
-
cleanedTemplate += `%${next}`, i++;
|
|
3055
|
+
if ('c' === next) {
|
|
3056
|
+
rest.length > 0 && rest.shift(), i++;
|
|
3057
|
+
continue;
|
|
1932
3058
|
}
|
|
1933
|
-
|
|
1934
|
-
format(cleanedTemplate, ...rest)
|
|
1935
|
-
];
|
|
1936
|
-
})(formattedArgs), prefix = colors.dim(`[browser ${time}]`);
|
|
1937
|
-
switch(level){
|
|
1938
|
-
case 'error':
|
|
1939
|
-
console.log(colors.red(`${prefix} ${format(...outputArgs)}`));
|
|
1940
|
-
break;
|
|
1941
|
-
case 'warn':
|
|
1942
|
-
console.log(colors.yellow(`${prefix} ${format(...outputArgs)}`));
|
|
1943
|
-
break;
|
|
1944
|
-
case 'debug':
|
|
1945
|
-
console.log(prefix, ...outputArgs);
|
|
3059
|
+
cleanedTemplate += `%${next}`, i++;
|
|
1946
3060
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
3061
|
+
return [
|
|
3062
|
+
format(cleanedTemplate, ...rest)
|
|
3063
|
+
];
|
|
3064
|
+
})(formattedArgs), prefix = colors.dim(`[browser ${time}]`);
|
|
3065
|
+
switch(level){
|
|
3066
|
+
case 'error':
|
|
3067
|
+
console.log(colors.red(`${prefix} ${format(...outputArgs)}`));
|
|
3068
|
+
break;
|
|
3069
|
+
case 'warn':
|
|
3070
|
+
console.log(colors.yellow(`${prefix} ${format(...outputArgs)}`));
|
|
3071
|
+
break;
|
|
3072
|
+
case 'debug':
|
|
3073
|
+
console.log(prefix, ...outputArgs);
|
|
1949
3074
|
}
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
3075
|
+
} finally{
|
|
3076
|
+
res.statusCode = 204, res.end();
|
|
3077
|
+
}
|
|
3078
|
+
});
|
|
3079
|
+
}), middlewares)
|
|
1954
3080
|
}),
|
|
1955
3081
|
(root = '', alias = {}, {
|
|
1956
3082
|
name: 'unpack:glob',
|
|
@@ -2040,14 +3166,14 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2040
3166
|
].sort((a, b)=>b.length - a.length).map((name)=>name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), deepImportRegex = RegExp(`import\\s+([a-zA-Z0-9_$]+)\\s+from\\s+['"]((${deepImportPkgPattern})/[^'"]+)['"]`, 'g'), plugin = {
|
|
2041
3167
|
name: 'unpack:prebundle',
|
|
2042
3168
|
apply: (config, { command })=>'dev' === command && !!config.dev?.prebundle,
|
|
2043
|
-
config
|
|
3169
|
+
async config (config) {
|
|
2044
3170
|
var externals;
|
|
2045
3171
|
let existExternals, root = config.root;
|
|
2046
|
-
bundledDepsCachePath = node_path.resolve(root,
|
|
3172
|
+
bundledDepsCachePath = node_path.resolve(root, this.cachePath, 'umd');
|
|
2047
3173
|
let count = {
|
|
2048
3174
|
total: 0,
|
|
2049
3175
|
bundled: 0
|
|
2050
|
-
}, failedDepsJsonPath = node_path.resolve(root,
|
|
3176
|
+
}, failedDepsJsonPath = node_path.resolve(root, this.cachePath, 'failed-deps.json'), failedDeps = [], failedCache = node_fs.existsSync(failedDepsJsonPath) ? JSON.parse(node_fs.readFileSync(failedDepsJsonPath, 'utf-8')) : {}, updateProgress = ()=>{
|
|
2051
3177
|
let errMsg = failedDeps.length > 0 ? ` failed: ${failedDeps.join(', ')}` : '';
|
|
2052
3178
|
logUpdate(`${colors.magenta('»')} optimizing dependencies (${count.bundled}/${count.total})${errMsg}`), count.total === count.bundled + failedDeps.length && console.log();
|
|
2053
3179
|
}, userOptions = isPlainObject(config.dev?.prebundle) ? config.dev.prebundle : {}, ignoreCSSDeps = userOptions.ignoreCSS || [], packageJson = JSON.parse(node_fs.readFileSync(node_path.resolve(root, 'package.json'), 'utf-8')), excludeDeps = [
|
|
@@ -2281,29 +3407,26 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2281
3407
|
src
|
|
2282
3408
|
}
|
|
2283
3409
|
})),
|
|
2284
|
-
setupMiddlewares: (middlewares)=>
|
|
2285
|
-
(req
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
},
|
|
2305
|
-
...middlewares
|
|
2306
|
-
],
|
|
3410
|
+
setupMiddlewares: (middlewares)=>(middlewares.unshift((req, res, next)=>{
|
|
3411
|
+
if ('string' != typeof req.url) return void next();
|
|
3412
|
+
let url = new URL(req.url, 'http://localhost');
|
|
3413
|
+
if (!url.pathname.startsWith("/umd/")) return void next();
|
|
3414
|
+
let relativePath = url.pathname.replace("/umd/", '');
|
|
3415
|
+
if (relativePath.includes('..')) {
|
|
3416
|
+
res.statusCode = 403, res.end();
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
let filePath = node_path.join(bundledDepsCachePath, relativePath);
|
|
3420
|
+
if (!node_fs.existsSync(filePath)) return void next();
|
|
3421
|
+
let stat = node_fs.statSync(filePath);
|
|
3422
|
+
if (!stat.isFile()) return void next();
|
|
3423
|
+
let mtime = stat.mtime.toUTCString(), ext = node_path.extname(filePath);
|
|
3424
|
+
if (res.setHeader('Cache-Control', 'no-cache'), res.setHeader('Last-Modified', mtime), '.js' === ext && res.setHeader('Content-Type', "application/javascript"), '.css' === ext && res.setHeader('Content-Type', 'text/css'), req.headers['if-modified-since'] === mtime) {
|
|
3425
|
+
res.statusCode = 304, res.end();
|
|
3426
|
+
return;
|
|
3427
|
+
}
|
|
3428
|
+
res.statusCode = 200, node_fs.createReadStream(filePath).pipe(res);
|
|
3429
|
+
}), middlewares),
|
|
2307
3430
|
rspackConfig: (config)=>{
|
|
2308
3431
|
let PLUGIN_NAME = 'InjectAssetsPlugin';
|
|
2309
3432
|
return config.plugins.push({
|
|
@@ -2390,8 +3513,8 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2390
3513
|
(VIRTUAL_UNO_CSS_ID = 'uno.css', rootDir = process.cwd(), isMpa = !1, unoConfig = {}, configFilePath = '', unpackConfigPath = '', tokens = new Set(), requestedLayers = new Set([
|
|
2391
3514
|
LAYER_MARK_ALL
|
|
2392
3515
|
]), tasks = [], unocssCacheDir = '', tokensCachePath = '', layersCachePath = '', timeCachePath = '', configHashCachePath = '', generatedCachePath = '', bundlerCacheDir = '', cachedTokensSize = 0, cachedLayersSize = 0, isCompiling = !0, resolveUnocssConfig = async ()=>{
|
|
2393
|
-
let
|
|
2394
|
-
|
|
3516
|
+
let configFromOption = {};
|
|
3517
|
+
isPlainObject(configOrPath) ? configFromOption = configOrPath : isString(configOrPath) && (configFilePath = node_path.isAbsolute(configOrPath) ? configOrPath : node_path.resolve(rootDir, configOrPath)), configFilePath = ((root, customConfig)=>{
|
|
2395
3518
|
if (customConfig) {
|
|
2396
3519
|
let absPath = node_path.isAbsolute(customConfig) ? customConfig : node_path.resolve(root, customConfig);
|
|
2397
3520
|
if (node_fs.existsSync(absPath)) return absPath;
|
|
@@ -2400,7 +3523,9 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2400
3523
|
let configFile = node_path.join(root, file);
|
|
2401
3524
|
if (node_fs.existsSync(configFile)) return configFile;
|
|
2402
3525
|
}
|
|
2403
|
-
})(rootDir, configFilePath)
|
|
3526
|
+
})(rootDir, configFilePath);
|
|
3527
|
+
let loaded = await loadConfigFromFile(configFilePath);
|
|
3528
|
+
return configFromOption = dist_default()(configFromOption, loaded), defaults && (configFromOption = dist_default()(defaults, configFromOption)), configFromOption;
|
|
2404
3529
|
}, flushTasks = async ()=>{
|
|
2405
3530
|
if (!tasks.length) return;
|
|
2406
3531
|
logger_logger.debug(colors.yellow(`[unocss] Extract token from ${tasks.length} modules.`));
|
|
@@ -2438,10 +3563,10 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2438
3563
|
}, {
|
|
2439
3564
|
name: 'unpack:unocss',
|
|
2440
3565
|
apply: (config)=>!!config.css?.unocss,
|
|
2441
|
-
configResolved
|
|
2442
|
-
if (rootDir = config.root, isMpa = !!config.mpa, unpackConfigPath = resolveConfigPath(rootDir), bundlerCacheDir = node_path.resolve(rootDir, cachePath, 'cache'), unocssCacheDir = node_path.resolve(rootDir, cachePath, 'unocss'), tokensCachePath = node_path.resolve(unocssCacheDir, 'tokens'), layersCachePath = node_path.resolve(unocssCacheDir, 'layers'), timeCachePath = node_path.resolve(unocssCacheDir, 'created_at'), configHashCachePath = node_path.resolve(unocssCacheDir, 'config_hash'), generatedCachePath = node_path.resolve(unocssCacheDir, 'generated'), Array.isArray(config.css?.unocss)) {
|
|
3566
|
+
async configResolved (config) {
|
|
3567
|
+
if (rootDir = config.root, isMpa = !!config.mpa, unpackConfigPath = resolveConfigPath(rootDir), bundlerCacheDir = node_path.resolve(rootDir, this.cachePath, 'cache'), unocssCacheDir = node_path.resolve(rootDir, this.cachePath, 'unocss'), tokensCachePath = node_path.resolve(unocssCacheDir, 'tokens'), layersCachePath = node_path.resolve(unocssCacheDir, 'layers'), timeCachePath = node_path.resolve(unocssCacheDir, 'created_at'), configHashCachePath = node_path.resolve(unocssCacheDir, 'config_hash'), generatedCachePath = node_path.resolve(unocssCacheDir, 'generated'), Array.isArray(config.css?.unocss)) {
|
|
2443
3568
|
let [configOrPathValue, defaultsValue] = config.css.unocss;
|
|
2444
|
-
|
|
3569
|
+
configOrPath = configOrPathValue, defaults = defaultsValue;
|
|
2445
3570
|
}
|
|
2446
3571
|
unoConfig = await resolveUnocssConfig();
|
|
2447
3572
|
let core = await import("@unocss/core");
|
|
@@ -2549,8 +3674,8 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2549
3674
|
name: 'unpack:svg-icons',
|
|
2550
3675
|
apply: (config)=>!!config.svgIcons,
|
|
2551
3676
|
configResolved: (config)=>{
|
|
2552
|
-
rootPath1 = config.root || process.cwd(),
|
|
2553
|
-
let root,
|
|
3677
|
+
rootPath1 = config.root || process.cwd(), options = config.svgIcons, (()=>{
|
|
3678
|
+
let root, inject = options.inject || 'body-last', domId = options.customDomId || '__svg__icons__dom__', { svg, names } = ((iconDirs, symbolId, customDomId)=>{
|
|
2554
3679
|
let symbols = [], names = [], idSet = new Set();
|
|
2555
3680
|
for (let dir of iconDirs)for (let file of readSvgFiles(dir)){
|
|
2556
3681
|
let { inner, viewBox } = extractSvgContent(normalizeSvg(node_fs.readFileSync(file, 'utf-8'))), id = toSymbolId(file, dir, symbolId);
|
|
@@ -2560,7 +3685,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2560
3685
|
svg: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="${customDomId}" style="position: absolute; width: 0; height: 0" aria-hidden="true">${symbols.join('')}</svg>`,
|
|
2561
3686
|
names
|
|
2562
3687
|
};
|
|
2563
|
-
})((root = rootPath1, (
|
|
3688
|
+
})((root = rootPath1, (options.iconDirs || []).map((dir)=>node_path.isAbsolute(dir) ? dir : node_path.resolve(root, dir))), options.symbolId, domId);
|
|
2564
3689
|
registerCode = `const svgDomId = ${JSON.stringify(domId)}\nconst svgHtml = ${JSON.stringify(svg)}\nconst inject = (position) => {\n if (typeof document === 'undefined') return\n if (document.getElementById(svgDomId)) return\n const div = document.createElement('div')\n div.innerHTML = svgHtml\n const svgEl = div.firstElementChild\n if (!svgEl) return\n if (position === 'head' && document.head) {\n document.head.prepend(svgEl)\n return\n }\n const body = document.body\n if (!body) return\n if (position === 'body-first' && body.firstChild) {\n body.insertBefore(svgEl, body.firstChild)\n } else {\n body.appendChild(svgEl)\n }\n}\nconst mount = () => inject(${JSON.stringify(inject)})\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', mount)\n } else {\n mount()\n }\n}\nexport default mount`, namesCode = `export const svgIconNames = ${JSON.stringify(names)}\nexport default svgIconNames`;
|
|
2565
3690
|
})();
|
|
2566
3691
|
},
|
|
@@ -2626,7 +3751,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2626
3751
|
]
|
|
2627
3752
|
};
|
|
2628
3753
|
return {
|
|
2629
|
-
...
|
|
3754
|
+
...dist_default()(defaultConfig, userConfig),
|
|
2630
3755
|
_context
|
|
2631
3756
|
};
|
|
2632
3757
|
};
|
|
@@ -2635,7 +3760,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2635
3760
|
let mode = watch ? 'development' : 'production';
|
|
2636
3761
|
setNodeEnv(mode);
|
|
2637
3762
|
let config = resolveConfig(mode);
|
|
2638
|
-
console.log(colors.brand(`${callerName} v4.
|
|
3763
|
+
console.log(colors.brand(`${callerName} v4.7.0`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
|
|
2639
3764
|
},
|
|
2640
3765
|
dev: async ()=>{
|
|
2641
3766
|
setUnpackStartTime(performance.now());
|
|
@@ -2664,14 +3789,17 @@ async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
|
|
|
2664
3789
|
});
|
|
2665
3790
|
}
|
|
2666
3791
|
var injectFramework_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
let framework = process.env.FRAMEWORK?.trim();
|
|
2670
|
-
if (!framework) return;
|
|
2671
|
-
let pluginPath = node_path.resolve(injectFramework_dirname, `../../plugin-${framework}/dist/index.js`);
|
|
2672
|
-
node_fs.existsSync(pluginPath) && (plugin = (0, (await import(pluginPath))[`plugin${framework.charAt(0).toUpperCase() + framework.slice(1)}`])(), userConfig.plugins ? userConfig.plugins.unshift(plugin) : userConfig.plugins = [
|
|
3792
|
+
let injectPlugin = (userConfig, plugin)=>{
|
|
3793
|
+
userConfig.plugins ? userConfig.plugins.unshift(plugin) : userConfig.plugins = [
|
|
2673
3794
|
plugin
|
|
2674
|
-
]
|
|
3795
|
+
];
|
|
3796
|
+
};
|
|
3797
|
+
async function injectFrameworkPluginForDebug(userConfig) {
|
|
3798
|
+
let frameworkEnv = process.env.FRAMEWORK?.trim();
|
|
3799
|
+
if (frameworkEnv) for (let framework of frameworkEnv.split(',').map((item)=>item.trim()).filter(Boolean)){
|
|
3800
|
+
let pluginPath = node_path.resolve(injectFramework_dirname, `../../plugin-${framework}/dist/index.js`);
|
|
3801
|
+
if (node_fs.existsSync(pluginPath)) injectPlugin(userConfig, (0, (await import(pluginPath))[`plugin${framework.charAt(0).toUpperCase() + framework.slice(1)}`])());
|
|
3802
|
+
}
|
|
2675
3803
|
}
|
|
2676
3804
|
async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls, restartServer }) {
|
|
2677
3805
|
let shortcuts = [
|
|
@@ -2786,7 +3914,8 @@ function runCLI() {
|
|
|
2786
3914
|
logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
|
|
2787
3915
|
});
|
|
2788
3916
|
});
|
|
2789
|
-
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.
|
|
3917
|
+
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.7.0"), cli.parse();
|
|
2790
3918
|
}
|
|
2791
|
-
|
|
2792
|
-
|
|
3919
|
+
let launch_editor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
|
|
3920
|
+
var launch_editor_default_0 = __webpack_require__.n(launch_editor)(), src_CSS_MODULES_NAMED_EXPORT = !1;
|
|
3921
|
+
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, emptyDir, ensureDir, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getDevServerPort, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isString, isUndefined, isWin, launch_editor_default_0 as launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathExists, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, set, setCurrentUnpackConfig, setDevServer, setDevServerPort, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd };
|