vite 3.2.0-beta.2 → 3.2.0-beta.4
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/LICENSE.md +82 -29
- package/bin/openChrome.applescript +32 -23
- package/dist/node/chunks/{dep-0726141c.js → dep-06c4efef.js} +1 -1
- package/dist/node/chunks/{dep-0856a44a.js → dep-0e9c6c9f.js} +1931 -195
- package/dist/node/chunks/{dep-39e6741e.js → dep-9deb2354.js} +0 -0
- package/dist/node/cli.js +19 -7
- package/dist/node/constants.js +1 -1
- package/dist/node/index.js +4 -3
- package/dist/node-cjs/publicUtils.cjs +1 -1
- package/package.json +10 -9
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import fs$l, { promises as promises$2 } from 'node:fs';
|
|
2
|
-
import path$n, { posix as posix$2, isAbsolute as isAbsolute$2, resolve as resolve$
|
|
3
|
-
import { URL as URL$3, pathToFileURL, URLSearchParams, parse as parse$k } from 'node:url';
|
|
1
|
+
import fs$l, { realpathSync as realpathSync$1, statSync as statSync$1, Stats as Stats$1, promises as promises$2 } from 'node:fs';
|
|
2
|
+
import path$n, { posix as posix$2, isAbsolute as isAbsolute$2, resolve as resolve$7, join as join$2, relative as relative$2, dirname as dirname$2, basename as basename$2, extname as extname$1 } from 'node:path';
|
|
3
|
+
import { fileURLToPath, URL as URL$3, pathToFileURL, URLSearchParams, parse as parse$k } from 'node:url';
|
|
4
4
|
import { performance } from 'node:perf_hooks';
|
|
5
|
-
import { createRequire as createRequire$1
|
|
5
|
+
import { builtinModules, createRequire as createRequire$1 } from 'node:module';
|
|
6
6
|
import require$$0$3 from 'tty';
|
|
7
7
|
import { transform as transform$2, build as build$3, formatMessages } from 'esbuild';
|
|
8
|
-
import
|
|
8
|
+
import assert$1 from 'node:assert';
|
|
9
|
+
import process$1 from 'node:process';
|
|
10
|
+
import { format as format$2, inspect, promisify as promisify$4 } from 'node:util';
|
|
11
|
+
import require$$0$4, { sep, resolve as resolve$5, posix as posix$1, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join as join$1, win32 as win32$1, isAbsolute as isAbsolute$1, normalize } from 'path';
|
|
9
12
|
import * as require$$0$2 from 'fs';
|
|
10
|
-
import require$$0__default, { existsSync, readFileSync, statSync as statSync$
|
|
13
|
+
import require$$0__default, { existsSync, readFileSync, statSync as statSync$2, promises as promises$1, readdirSync } from 'fs';
|
|
11
14
|
import require$$0$5 from 'events';
|
|
12
|
-
import assert$
|
|
13
|
-
import require$$0$6, { format as format$
|
|
15
|
+
import assert$2 from 'assert';
|
|
16
|
+
import require$$0$6, { format as format$3, inspect as inspect$1 } from 'util';
|
|
14
17
|
import require$$3$1 from 'net';
|
|
15
18
|
import require$$0$9, { pathToFileURL as pathToFileURL$1 } from 'url';
|
|
16
19
|
import require$$1$2 from 'http';
|
|
@@ -19,16 +22,14 @@ import require$$1 from 'os';
|
|
|
19
22
|
import require$$2 from 'child_process';
|
|
20
23
|
import os$3 from 'node:os';
|
|
21
24
|
import { createHash as createHash$2 } from 'node:crypto';
|
|
22
|
-
import { promisify as promisify$4 } from 'node:util';
|
|
23
25
|
import { promises } from 'node:dns';
|
|
24
|
-
import resolve$
|
|
25
|
-
import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEFAULT_MAIN_FIELDS, SPECIAL_QUERY_RE,
|
|
26
|
+
import resolve$6 from 'resolve';
|
|
27
|
+
import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, DEFAULT_EXTENSIONS as DEFAULT_EXTENSIONS$1, wildcardHosts, loopbackHosts, VALID_ID_PREFIX, NULL_BYTE_PLACEHOLDER, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, ENV_ENTRY, DEP_VERSION_RE, DEFAULT_MAIN_FIELDS, SPECIAL_QUERY_RE, KNOWN_ASSET_TYPES, CLIENT_DIR, JS_TYPES_RE, ESBUILD_MODULES_TARGET, VERSION, VITE_PACKAGE_DIR, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js';
|
|
26
28
|
import require$$5 from 'crypto';
|
|
27
|
-
import require$$0$a from 'buffer';
|
|
28
29
|
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
29
30
|
import require$$0$8, { createRequire as createRequire$2 } from 'module';
|
|
30
31
|
import require$$1$1 from 'worker_threads';
|
|
31
|
-
import require$$0$
|
|
32
|
+
import require$$0$a from 'zlib';
|
|
32
33
|
import require$$1$3 from 'https';
|
|
33
34
|
import require$$4 from 'tls';
|
|
34
35
|
import { STATUS_CODES } from 'node:http';
|
|
@@ -214,6 +215,1761 @@ function alias$1(options = {}) {
|
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
217
|
|
|
218
|
+
// Manually “tree shaken” from:
|
|
219
|
+
|
|
220
|
+
const reader$2 = {read: read$5};
|
|
221
|
+
var packageJsonReader = reader$2;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* @param {string} jsonPath
|
|
225
|
+
* @returns {{string: string|undefined}}
|
|
226
|
+
*/
|
|
227
|
+
function read$5(jsonPath) {
|
|
228
|
+
try {
|
|
229
|
+
const string = fs$l.readFileSync(
|
|
230
|
+
path$n.toNamespacedPath(path$n.join(path$n.dirname(jsonPath), 'package.json')),
|
|
231
|
+
'utf8'
|
|
232
|
+
);
|
|
233
|
+
return {string}
|
|
234
|
+
} catch (error) {
|
|
235
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
236
|
+
|
|
237
|
+
if (exception.code === 'ENOENT') {
|
|
238
|
+
return {string: undefined}
|
|
239
|
+
// Throw all other errors.
|
|
240
|
+
/* c8 ignore next 4 */
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
throw exception
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @typedef ErrnoExceptionFields
|
|
249
|
+
* @property {number|undefined} [errnode]
|
|
250
|
+
* @property {string|undefined} [code]
|
|
251
|
+
* @property {string|undefined} [path]
|
|
252
|
+
* @property {string|undefined} [syscall]
|
|
253
|
+
* @property {string|undefined} [url]
|
|
254
|
+
*
|
|
255
|
+
* @typedef {Error & ErrnoExceptionFields} ErrnoException
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
const isWindows$6 = process$1.platform === 'win32';
|
|
259
|
+
|
|
260
|
+
const own$2 = {}.hasOwnProperty;
|
|
261
|
+
|
|
262
|
+
const codes$1 = {};
|
|
263
|
+
|
|
264
|
+
/** @type {Map<string, MessageFunction|string>} */
|
|
265
|
+
const messages$1 = new Map();
|
|
266
|
+
const nodeInternalPrefix$1 = '__node_internal_';
|
|
267
|
+
/** @type {number} */
|
|
268
|
+
let userStackTraceLimit$1;
|
|
269
|
+
|
|
270
|
+
codes$1.ERR_INVALID_MODULE_SPECIFIER = createError$1(
|
|
271
|
+
'ERR_INVALID_MODULE_SPECIFIER',
|
|
272
|
+
/**
|
|
273
|
+
* @param {string} request
|
|
274
|
+
* @param {string} reason
|
|
275
|
+
* @param {string} [base]
|
|
276
|
+
*/
|
|
277
|
+
(request, reason, base = undefined) => {
|
|
278
|
+
return `Invalid module "${request}" ${reason}${
|
|
279
|
+
base ? ` imported from ${base}` : ''
|
|
280
|
+
}`
|
|
281
|
+
},
|
|
282
|
+
TypeError
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
codes$1.ERR_INVALID_PACKAGE_CONFIG = createError$1(
|
|
286
|
+
'ERR_INVALID_PACKAGE_CONFIG',
|
|
287
|
+
/**
|
|
288
|
+
* @param {string} path
|
|
289
|
+
* @param {string} [base]
|
|
290
|
+
* @param {string} [message]
|
|
291
|
+
*/
|
|
292
|
+
(path, base, message) => {
|
|
293
|
+
return `Invalid package config ${path}${
|
|
294
|
+
base ? ` while importing ${base}` : ''
|
|
295
|
+
}${message ? `. ${message}` : ''}`
|
|
296
|
+
},
|
|
297
|
+
Error
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
codes$1.ERR_INVALID_PACKAGE_TARGET = createError$1(
|
|
301
|
+
'ERR_INVALID_PACKAGE_TARGET',
|
|
302
|
+
/**
|
|
303
|
+
* @param {string} pkgPath
|
|
304
|
+
* @param {string} key
|
|
305
|
+
* @param {unknown} target
|
|
306
|
+
* @param {boolean} [isImport=false]
|
|
307
|
+
* @param {string} [base]
|
|
308
|
+
*/
|
|
309
|
+
(pkgPath, key, target, isImport = false, base = undefined) => {
|
|
310
|
+
const relError =
|
|
311
|
+
typeof target === 'string' &&
|
|
312
|
+
!isImport &&
|
|
313
|
+
target.length > 0 &&
|
|
314
|
+
!target.startsWith('./');
|
|
315
|
+
if (key === '.') {
|
|
316
|
+
assert$1(isImport === false);
|
|
317
|
+
return (
|
|
318
|
+
`Invalid "exports" main target ${JSON.stringify(target)} defined ` +
|
|
319
|
+
`in the package config ${pkgPath}package.json${
|
|
320
|
+
base ? ` imported from ${base}` : ''
|
|
321
|
+
}${relError ? '; targets must start with "./"' : ''}`
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return `Invalid "${
|
|
326
|
+
isImport ? 'imports' : 'exports'
|
|
327
|
+
}" target ${JSON.stringify(
|
|
328
|
+
target
|
|
329
|
+
)} defined for '${key}' in the package config ${pkgPath}package.json${
|
|
330
|
+
base ? ` imported from ${base}` : ''
|
|
331
|
+
}${relError ? '; targets must start with "./"' : ''}`
|
|
332
|
+
},
|
|
333
|
+
Error
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
codes$1.ERR_MODULE_NOT_FOUND = createError$1(
|
|
337
|
+
'ERR_MODULE_NOT_FOUND',
|
|
338
|
+
/**
|
|
339
|
+
* @param {string} path
|
|
340
|
+
* @param {string} base
|
|
341
|
+
* @param {string} [type]
|
|
342
|
+
*/
|
|
343
|
+
(path, base, type = 'package') => {
|
|
344
|
+
return `Cannot find ${type} '${path}' imported from ${base}`
|
|
345
|
+
},
|
|
346
|
+
Error
|
|
347
|
+
);
|
|
348
|
+
|
|
349
|
+
codes$1.ERR_NETWORK_IMPORT_DISALLOWED = createError$1(
|
|
350
|
+
'ERR_NETWORK_IMPORT_DISALLOWED',
|
|
351
|
+
"import of '%s' by %s is not supported: %s",
|
|
352
|
+
Error
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
codes$1.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError$1(
|
|
356
|
+
'ERR_PACKAGE_IMPORT_NOT_DEFINED',
|
|
357
|
+
/**
|
|
358
|
+
* @param {string} specifier
|
|
359
|
+
* @param {string} packagePath
|
|
360
|
+
* @param {string} base
|
|
361
|
+
*/
|
|
362
|
+
(specifier, packagePath, base) => {
|
|
363
|
+
return `Package import specifier "${specifier}" is not defined${
|
|
364
|
+
packagePath ? ` in package ${packagePath}package.json` : ''
|
|
365
|
+
} imported from ${base}`
|
|
366
|
+
},
|
|
367
|
+
TypeError
|
|
368
|
+
);
|
|
369
|
+
|
|
370
|
+
codes$1.ERR_PACKAGE_PATH_NOT_EXPORTED = createError$1(
|
|
371
|
+
'ERR_PACKAGE_PATH_NOT_EXPORTED',
|
|
372
|
+
/**
|
|
373
|
+
* @param {string} pkgPath
|
|
374
|
+
* @param {string} subpath
|
|
375
|
+
* @param {string} [base]
|
|
376
|
+
*/
|
|
377
|
+
(pkgPath, subpath, base = undefined) => {
|
|
378
|
+
if (subpath === '.')
|
|
379
|
+
return `No "exports" main defined in ${pkgPath}package.json${
|
|
380
|
+
base ? ` imported from ${base}` : ''
|
|
381
|
+
}`
|
|
382
|
+
return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${
|
|
383
|
+
base ? ` imported from ${base}` : ''
|
|
384
|
+
}`
|
|
385
|
+
},
|
|
386
|
+
Error
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
codes$1.ERR_UNSUPPORTED_DIR_IMPORT = createError$1(
|
|
390
|
+
'ERR_UNSUPPORTED_DIR_IMPORT',
|
|
391
|
+
"Directory import '%s' is not supported " +
|
|
392
|
+
'resolving ES modules imported from %s',
|
|
393
|
+
Error
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
codes$1.ERR_UNKNOWN_FILE_EXTENSION = createError$1(
|
|
397
|
+
'ERR_UNKNOWN_FILE_EXTENSION',
|
|
398
|
+
/**
|
|
399
|
+
* @param {string} ext
|
|
400
|
+
* @param {string} path
|
|
401
|
+
*/
|
|
402
|
+
(ext, path) => {
|
|
403
|
+
return `Unknown file extension "${ext}" for ${path}`
|
|
404
|
+
},
|
|
405
|
+
TypeError
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
codes$1.ERR_INVALID_ARG_VALUE = createError$1(
|
|
409
|
+
'ERR_INVALID_ARG_VALUE',
|
|
410
|
+
/**
|
|
411
|
+
* @param {string} name
|
|
412
|
+
* @param {unknown} value
|
|
413
|
+
* @param {string} [reason='is invalid']
|
|
414
|
+
*/
|
|
415
|
+
(name, value, reason = 'is invalid') => {
|
|
416
|
+
let inspected = inspect(value);
|
|
417
|
+
|
|
418
|
+
if (inspected.length > 128) {
|
|
419
|
+
inspected = `${inspected.slice(0, 128)}...`;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const type = name.includes('.') ? 'property' : 'argument';
|
|
423
|
+
|
|
424
|
+
return `The ${type} '${name}' ${reason}. Received ${inspected}`
|
|
425
|
+
},
|
|
426
|
+
TypeError
|
|
427
|
+
// Note: extra classes have been shaken out.
|
|
428
|
+
// , RangeError
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
codes$1.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError$1(
|
|
432
|
+
'ERR_UNSUPPORTED_ESM_URL_SCHEME',
|
|
433
|
+
/**
|
|
434
|
+
* @param {URL} url
|
|
435
|
+
* @param {Array<string>} supported
|
|
436
|
+
*/
|
|
437
|
+
(url, supported) => {
|
|
438
|
+
let message = `Only URLs with a scheme in: ${supported.join(
|
|
439
|
+
', '
|
|
440
|
+
)} are supported by the default ESM loader`;
|
|
441
|
+
// Let message =
|
|
442
|
+
// 'Only file and data URLs are supported by the default ESM loader'
|
|
443
|
+
|
|
444
|
+
if (isWindows$6 && url.protocol.length === 2) {
|
|
445
|
+
message += '. On Windows, absolute paths must be valid file:// URLs';
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
message += `. Received protocol '${url.protocol}'`;
|
|
449
|
+
return message
|
|
450
|
+
},
|
|
451
|
+
Error
|
|
452
|
+
);
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Utility function for registering the error codes. Only used here. Exported
|
|
456
|
+
* *only* to allow for testing.
|
|
457
|
+
* @param {string} sym
|
|
458
|
+
* @param {MessageFunction|string} value
|
|
459
|
+
* @param {ErrorConstructor} def
|
|
460
|
+
* @returns {new (...args: Array<any>) => Error}
|
|
461
|
+
*/
|
|
462
|
+
function createError$1(sym, value, def) {
|
|
463
|
+
// Special case for SystemError that formats the error message differently
|
|
464
|
+
// The SystemErrors only have SystemError as their base classes.
|
|
465
|
+
messages$1.set(sym, value);
|
|
466
|
+
|
|
467
|
+
return makeNodeErrorWithCode$1(def, sym)
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* @param {ErrorConstructor} Base
|
|
472
|
+
* @param {string} key
|
|
473
|
+
* @returns {ErrorConstructor}
|
|
474
|
+
*/
|
|
475
|
+
function makeNodeErrorWithCode$1(Base, key) {
|
|
476
|
+
// @ts-expect-error It’s a Node error.
|
|
477
|
+
return NodeError
|
|
478
|
+
/**
|
|
479
|
+
* @param {Array<unknown>} args
|
|
480
|
+
*/
|
|
481
|
+
function NodeError(...args) {
|
|
482
|
+
const limit = Error.stackTraceLimit;
|
|
483
|
+
if (isErrorStackTraceLimitWritable$1()) Error.stackTraceLimit = 0;
|
|
484
|
+
const error = new Base();
|
|
485
|
+
// Reset the limit and setting the name property.
|
|
486
|
+
if (isErrorStackTraceLimitWritable$1()) Error.stackTraceLimit = limit;
|
|
487
|
+
const message = getMessage$1(key, args, error);
|
|
488
|
+
Object.defineProperties(error, {
|
|
489
|
+
// Note: no need to implement `kIsNodeError` symbol, would be hard,
|
|
490
|
+
// probably.
|
|
491
|
+
message: {
|
|
492
|
+
value: message,
|
|
493
|
+
enumerable: false,
|
|
494
|
+
writable: true,
|
|
495
|
+
configurable: true
|
|
496
|
+
},
|
|
497
|
+
toString: {
|
|
498
|
+
/** @this {Error} */
|
|
499
|
+
value() {
|
|
500
|
+
return `${this.name} [${key}]: ${this.message}`
|
|
501
|
+
},
|
|
502
|
+
enumerable: false,
|
|
503
|
+
writable: true,
|
|
504
|
+
configurable: true
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
captureLargerStackTrace$1(error);
|
|
509
|
+
// @ts-expect-error It’s a Node error.
|
|
510
|
+
error.code = key;
|
|
511
|
+
return error
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* @returns {boolean}
|
|
517
|
+
*/
|
|
518
|
+
function isErrorStackTraceLimitWritable$1() {
|
|
519
|
+
const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit');
|
|
520
|
+
if (desc === undefined) {
|
|
521
|
+
return Object.isExtensible(Error)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return own$2.call(desc, 'writable') && desc.writable !== undefined
|
|
525
|
+
? desc.writable
|
|
526
|
+
: desc.set !== undefined
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* This function removes unnecessary frames from Node.js core errors.
|
|
531
|
+
* @template {(...args: Array<any>) => unknown} T
|
|
532
|
+
* @type {(fn: T) => T}
|
|
533
|
+
*/
|
|
534
|
+
function hideStackFrames$1(fn) {
|
|
535
|
+
// We rename the functions that will be hidden to cut off the stacktrace
|
|
536
|
+
// at the outermost one
|
|
537
|
+
const hidden = nodeInternalPrefix$1 + fn.name;
|
|
538
|
+
Object.defineProperty(fn, 'name', {value: hidden});
|
|
539
|
+
return fn
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const captureLargerStackTrace$1 = hideStackFrames$1(
|
|
543
|
+
/**
|
|
544
|
+
* @param {Error} error
|
|
545
|
+
* @returns {Error}
|
|
546
|
+
*/
|
|
547
|
+
function (error) {
|
|
548
|
+
const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable$1();
|
|
549
|
+
if (stackTraceLimitIsWritable) {
|
|
550
|
+
userStackTraceLimit$1 = Error.stackTraceLimit;
|
|
551
|
+
Error.stackTraceLimit = Number.POSITIVE_INFINITY;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
Error.captureStackTrace(error);
|
|
555
|
+
|
|
556
|
+
// Reset the limit
|
|
557
|
+
if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit$1;
|
|
558
|
+
|
|
559
|
+
return error
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @param {string} key
|
|
565
|
+
* @param {Array<unknown>} args
|
|
566
|
+
* @param {Error} self
|
|
567
|
+
* @returns {string}
|
|
568
|
+
*/
|
|
569
|
+
function getMessage$1(key, args, self) {
|
|
570
|
+
const message = messages$1.get(key);
|
|
571
|
+
assert$1(typeof message !== 'undefined', 'expected `message` to be found');
|
|
572
|
+
|
|
573
|
+
if (typeof message === 'function') {
|
|
574
|
+
assert$1(
|
|
575
|
+
message.length <= args.length, // Default options do not count.
|
|
576
|
+
`Code: ${key}; The provided arguments length (${args.length}) does not ` +
|
|
577
|
+
`match the required ones (${message.length}).`
|
|
578
|
+
);
|
|
579
|
+
return Reflect.apply(message, self, args)
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const expectedLength = (message.match(/%[dfijoOs]/g) || []).length;
|
|
583
|
+
assert$1(
|
|
584
|
+
expectedLength === args.length,
|
|
585
|
+
`Code: ${key}; The provided arguments length (${args.length}) does not ` +
|
|
586
|
+
`match the required ones (${expectedLength}).`
|
|
587
|
+
);
|
|
588
|
+
if (args.length === 0) return message
|
|
589
|
+
|
|
590
|
+
args.unshift(message);
|
|
591
|
+
return Reflect.apply(format$2, null, args)
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// Manually “tree shaken” from:
|
|
595
|
+
|
|
596
|
+
const {ERR_UNKNOWN_FILE_EXTENSION} = codes$1;
|
|
597
|
+
|
|
598
|
+
const hasOwnProperty$2 = {}.hasOwnProperty;
|
|
599
|
+
|
|
600
|
+
/** @type {Record<string, string>} */
|
|
601
|
+
const extensionFormatMap = {
|
|
602
|
+
// @ts-expect-error: hush.
|
|
603
|
+
__proto__: null,
|
|
604
|
+
'.cjs': 'commonjs',
|
|
605
|
+
'.js': 'module',
|
|
606
|
+
'.json': 'json',
|
|
607
|
+
'.mjs': 'module'
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* @param {string|null} mime
|
|
612
|
+
* @returns {string | null}
|
|
613
|
+
*/
|
|
614
|
+
function mimeToFormat(mime) {
|
|
615
|
+
if (
|
|
616
|
+
mime &&
|
|
617
|
+
/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)
|
|
618
|
+
)
|
|
619
|
+
return 'module'
|
|
620
|
+
if (mime === 'application/json') return 'json'
|
|
621
|
+
return null
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* @callback ProtocolHandler
|
|
626
|
+
* @param {URL} parsed
|
|
627
|
+
* @param {{parentURL: string}} context
|
|
628
|
+
* @param {boolean} ignoreErrors
|
|
629
|
+
* @returns {string|null}
|
|
630
|
+
*/
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* @type {Record<string, ProtocolHandler>}
|
|
634
|
+
*/
|
|
635
|
+
const protocolHandlers = Object.assign(Object.create(null), {
|
|
636
|
+
'data:': getDataProtocolModuleFormat,
|
|
637
|
+
'file:': getFileProtocolModuleFormat,
|
|
638
|
+
'http:': getHttpProtocolModuleFormat,
|
|
639
|
+
'https:': getHttpProtocolModuleFormat,
|
|
640
|
+
'node:'() {
|
|
641
|
+
return 'builtin'
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* @param {URL} parsed
|
|
647
|
+
*/
|
|
648
|
+
function getDataProtocolModuleFormat(parsed) {
|
|
649
|
+
const {1: mime} = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(
|
|
650
|
+
parsed.pathname
|
|
651
|
+
) || [null, null, null];
|
|
652
|
+
return mimeToFormat(mime)
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* @type {ProtocolHandler}
|
|
657
|
+
*/
|
|
658
|
+
function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
659
|
+
const filepath = fileURLToPath(url);
|
|
660
|
+
const ext = path$n.extname(filepath);
|
|
661
|
+
if (ext === '.js') {
|
|
662
|
+
return getPackageType(url) === 'module' ? 'module' : 'commonjs'
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
const format = extensionFormatMap[ext];
|
|
666
|
+
if (format) return format
|
|
667
|
+
if (ignoreErrors) return null
|
|
668
|
+
|
|
669
|
+
throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath)
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function getHttpProtocolModuleFormat() {
|
|
673
|
+
// To do: HTTPS imports.
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* @param {URL} url
|
|
678
|
+
* @param {{parentURL: string}} context
|
|
679
|
+
* @returns {string|null}
|
|
680
|
+
*/
|
|
681
|
+
function defaultGetFormatWithoutErrors(url, context) {
|
|
682
|
+
if (!hasOwnProperty$2.call(protocolHandlers, url.protocol)) {
|
|
683
|
+
return null
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
return protocolHandlers[url.protocol](url, context, true)
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// Manually “tree shaken” from:
|
|
690
|
+
|
|
691
|
+
const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
692
|
+
|
|
693
|
+
// To do: potentially enable?
|
|
694
|
+
const experimentalNetworkImports = false;
|
|
695
|
+
|
|
696
|
+
const {
|
|
697
|
+
ERR_NETWORK_IMPORT_DISALLOWED,
|
|
698
|
+
ERR_INVALID_MODULE_SPECIFIER,
|
|
699
|
+
ERR_INVALID_PACKAGE_CONFIG,
|
|
700
|
+
ERR_INVALID_PACKAGE_TARGET,
|
|
701
|
+
ERR_MODULE_NOT_FOUND,
|
|
702
|
+
ERR_PACKAGE_IMPORT_NOT_DEFINED,
|
|
703
|
+
ERR_PACKAGE_PATH_NOT_EXPORTED,
|
|
704
|
+
ERR_UNSUPPORTED_DIR_IMPORT,
|
|
705
|
+
ERR_UNSUPPORTED_ESM_URL_SCHEME,
|
|
706
|
+
ERR_INVALID_ARG_VALUE
|
|
707
|
+
} = codes$1;
|
|
708
|
+
|
|
709
|
+
const own = {}.hasOwnProperty;
|
|
710
|
+
|
|
711
|
+
const DEFAULT_CONDITIONS = Object.freeze(['node', 'import']);
|
|
712
|
+
const DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);
|
|
713
|
+
|
|
714
|
+
const invalidSegmentRegEx =
|
|
715
|
+
/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i;
|
|
716
|
+
const invalidPackageNameRegEx = /^\.|%|\\/;
|
|
717
|
+
const patternRegEx = /\*/g;
|
|
718
|
+
const encodedSepRegEx = /%2f|%5c/i;
|
|
719
|
+
/** @type {Set<string>} */
|
|
720
|
+
const emittedPackageWarnings = new Set();
|
|
721
|
+
/** @type {Map<string, PackageConfig>} */
|
|
722
|
+
const packageJsonCache = new Map();
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* @param {URL} url
|
|
726
|
+
* @param {URL} packageJsonUrl
|
|
727
|
+
* @param {URL} base
|
|
728
|
+
* @param {unknown} [main]
|
|
729
|
+
* @returns {void}
|
|
730
|
+
*/
|
|
731
|
+
function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
732
|
+
const format = defaultGetFormatWithoutErrors(url, {parentURL: base.href});
|
|
733
|
+
if (format !== 'module') return
|
|
734
|
+
const path = fileURLToPath(url.href);
|
|
735
|
+
const pkgPath = fileURLToPath(new URL$3('.', packageJsonUrl));
|
|
736
|
+
const basePath = fileURLToPath(base);
|
|
737
|
+
if (main)
|
|
738
|
+
process$1.emitWarning(
|
|
739
|
+
`Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, ` +
|
|
740
|
+
`excluding the full filename and extension to the resolved file at "${path.slice(
|
|
741
|
+
pkgPath.length
|
|
742
|
+
)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is` +
|
|
743
|
+
'deprecated for ES modules.',
|
|
744
|
+
'DeprecationWarning',
|
|
745
|
+
'DEP0151'
|
|
746
|
+
);
|
|
747
|
+
else
|
|
748
|
+
process$1.emitWarning(
|
|
749
|
+
`No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path.slice(
|
|
750
|
+
pkgPath.length
|
|
751
|
+
)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`,
|
|
752
|
+
'DeprecationWarning',
|
|
753
|
+
'DEP0151'
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* @param {Array<string>} [conditions]
|
|
759
|
+
* @returns {Set<string>}
|
|
760
|
+
*/
|
|
761
|
+
function getConditionsSet(conditions) {
|
|
762
|
+
if (conditions !== undefined && conditions !== DEFAULT_CONDITIONS) {
|
|
763
|
+
if (!Array.isArray(conditions)) {
|
|
764
|
+
throw new ERR_INVALID_ARG_VALUE(
|
|
765
|
+
'conditions',
|
|
766
|
+
conditions,
|
|
767
|
+
'expected an array'
|
|
768
|
+
)
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
return new Set(conditions)
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
return DEFAULT_CONDITIONS_SET
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* @param {string} path
|
|
779
|
+
* @returns {Stats}
|
|
780
|
+
*/
|
|
781
|
+
function tryStatSync(path) {
|
|
782
|
+
// Note: from Node 15 onwards we can use `throwIfNoEntry: false` instead.
|
|
783
|
+
try {
|
|
784
|
+
return statSync$1(path)
|
|
785
|
+
} catch {
|
|
786
|
+
return new Stats$1()
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* @param {string} path
|
|
792
|
+
* @param {string|URL} specifier Note: `specifier` is actually optional, not base.
|
|
793
|
+
* @param {URL} [base]
|
|
794
|
+
* @returns {PackageConfig}
|
|
795
|
+
*/
|
|
796
|
+
function getPackageConfig(path, specifier, base) {
|
|
797
|
+
const existing = packageJsonCache.get(path);
|
|
798
|
+
if (existing !== undefined) {
|
|
799
|
+
return existing
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
const source = packageJsonReader.read(path).string;
|
|
803
|
+
|
|
804
|
+
if (source === undefined) {
|
|
805
|
+
/** @type {PackageConfig} */
|
|
806
|
+
const packageConfig = {
|
|
807
|
+
pjsonPath: path,
|
|
808
|
+
exists: false,
|
|
809
|
+
main: undefined,
|
|
810
|
+
name: undefined,
|
|
811
|
+
type: 'none',
|
|
812
|
+
exports: undefined,
|
|
813
|
+
imports: undefined
|
|
814
|
+
};
|
|
815
|
+
packageJsonCache.set(path, packageConfig);
|
|
816
|
+
return packageConfig
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/** @type {Record<string, unknown>} */
|
|
820
|
+
let packageJson;
|
|
821
|
+
try {
|
|
822
|
+
packageJson = JSON.parse(source);
|
|
823
|
+
} catch (error) {
|
|
824
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
825
|
+
|
|
826
|
+
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
827
|
+
path,
|
|
828
|
+
(base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier),
|
|
829
|
+
exception.message
|
|
830
|
+
)
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
const {exports, imports, main, name, type} = packageJson;
|
|
834
|
+
|
|
835
|
+
/** @type {PackageConfig} */
|
|
836
|
+
const packageConfig = {
|
|
837
|
+
pjsonPath: path,
|
|
838
|
+
exists: true,
|
|
839
|
+
main: typeof main === 'string' ? main : undefined,
|
|
840
|
+
name: typeof name === 'string' ? name : undefined,
|
|
841
|
+
type: type === 'module' || type === 'commonjs' ? type : 'none',
|
|
842
|
+
// @ts-expect-error Assume `Record<string, unknown>`.
|
|
843
|
+
exports,
|
|
844
|
+
// @ts-expect-error Assume `Record<string, unknown>`.
|
|
845
|
+
imports: imports && typeof imports === 'object' ? imports : undefined
|
|
846
|
+
};
|
|
847
|
+
packageJsonCache.set(path, packageConfig);
|
|
848
|
+
return packageConfig
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* @param {URL} resolved
|
|
853
|
+
* @returns {PackageConfig}
|
|
854
|
+
*/
|
|
855
|
+
function getPackageScopeConfig(resolved) {
|
|
856
|
+
let packageJsonUrl = new URL$3('package.json', resolved);
|
|
857
|
+
|
|
858
|
+
while (true) {
|
|
859
|
+
const packageJsonPath = packageJsonUrl.pathname;
|
|
860
|
+
|
|
861
|
+
if (packageJsonPath.endsWith('node_modules/package.json')) break
|
|
862
|
+
|
|
863
|
+
const packageConfig = getPackageConfig(
|
|
864
|
+
fileURLToPath(packageJsonUrl),
|
|
865
|
+
resolved
|
|
866
|
+
);
|
|
867
|
+
if (packageConfig.exists) return packageConfig
|
|
868
|
+
|
|
869
|
+
const lastPackageJsonUrl = packageJsonUrl;
|
|
870
|
+
packageJsonUrl = new URL$3('../package.json', packageJsonUrl);
|
|
871
|
+
|
|
872
|
+
// Terminates at root where ../package.json equals ../../package.json
|
|
873
|
+
// (can't just check "/package.json" for Windows support).
|
|
874
|
+
if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname) break
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
const packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
878
|
+
/** @type {PackageConfig} */
|
|
879
|
+
const packageConfig = {
|
|
880
|
+
pjsonPath: packageJsonPath,
|
|
881
|
+
exists: false,
|
|
882
|
+
main: undefined,
|
|
883
|
+
name: undefined,
|
|
884
|
+
type: 'none',
|
|
885
|
+
exports: undefined,
|
|
886
|
+
imports: undefined
|
|
887
|
+
};
|
|
888
|
+
packageJsonCache.set(packageJsonPath, packageConfig);
|
|
889
|
+
return packageConfig
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Legacy CommonJS main resolution:
|
|
894
|
+
* 1. let M = pkg_url + (json main field)
|
|
895
|
+
* 2. TRY(M, M.js, M.json, M.node)
|
|
896
|
+
* 3. TRY(M/index.js, M/index.json, M/index.node)
|
|
897
|
+
* 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)
|
|
898
|
+
* 5. NOT_FOUND
|
|
899
|
+
*
|
|
900
|
+
* @param {URL} url
|
|
901
|
+
* @returns {boolean}
|
|
902
|
+
*/
|
|
903
|
+
function fileExists(url) {
|
|
904
|
+
const stats = statSync$1(url, {throwIfNoEntry: false});
|
|
905
|
+
const isFile = stats ? stats.isFile() : undefined;
|
|
906
|
+
return isFile === null || isFile === undefined ? false : isFile
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* @param {URL} packageJsonUrl
|
|
911
|
+
* @param {PackageConfig} packageConfig
|
|
912
|
+
* @param {URL} base
|
|
913
|
+
* @returns {URL}
|
|
914
|
+
*/
|
|
915
|
+
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
916
|
+
/** @type {URL|undefined} */
|
|
917
|
+
let guess;
|
|
918
|
+
if (packageConfig.main !== undefined) {
|
|
919
|
+
guess = new URL$3(packageConfig.main, packageJsonUrl);
|
|
920
|
+
// Note: fs check redundances will be handled by Descriptor cache here.
|
|
921
|
+
if (fileExists(guess)) return guess
|
|
922
|
+
|
|
923
|
+
const tries = [
|
|
924
|
+
`./${packageConfig.main}.js`,
|
|
925
|
+
`./${packageConfig.main}.json`,
|
|
926
|
+
`./${packageConfig.main}.node`,
|
|
927
|
+
`./${packageConfig.main}/index.js`,
|
|
928
|
+
`./${packageConfig.main}/index.json`,
|
|
929
|
+
`./${packageConfig.main}/index.node`
|
|
930
|
+
];
|
|
931
|
+
let i = -1;
|
|
932
|
+
|
|
933
|
+
while (++i < tries.length) {
|
|
934
|
+
guess = new URL$3(tries[i], packageJsonUrl);
|
|
935
|
+
if (fileExists(guess)) break
|
|
936
|
+
guess = undefined;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (guess) {
|
|
940
|
+
emitLegacyIndexDeprecation(
|
|
941
|
+
guess,
|
|
942
|
+
packageJsonUrl,
|
|
943
|
+
base,
|
|
944
|
+
packageConfig.main
|
|
945
|
+
);
|
|
946
|
+
return guess
|
|
947
|
+
}
|
|
948
|
+
// Fallthrough.
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
const tries = ['./index.js', './index.json', './index.node'];
|
|
952
|
+
let i = -1;
|
|
953
|
+
|
|
954
|
+
while (++i < tries.length) {
|
|
955
|
+
guess = new URL$3(tries[i], packageJsonUrl);
|
|
956
|
+
if (fileExists(guess)) break
|
|
957
|
+
guess = undefined;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (guess) {
|
|
961
|
+
emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);
|
|
962
|
+
return guess
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
// Not found.
|
|
966
|
+
throw new ERR_MODULE_NOT_FOUND(
|
|
967
|
+
fileURLToPath(new URL$3('.', packageJsonUrl)),
|
|
968
|
+
fileURLToPath(base)
|
|
969
|
+
)
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* @param {URL} resolved
|
|
974
|
+
* @param {URL} base
|
|
975
|
+
* @param {boolean} [preserveSymlinks]
|
|
976
|
+
* @returns {URL}
|
|
977
|
+
*/
|
|
978
|
+
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
979
|
+
if (encodedSepRegEx.test(resolved.pathname))
|
|
980
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
981
|
+
resolved.pathname,
|
|
982
|
+
'must not include encoded "/" or "\\" characters',
|
|
983
|
+
fileURLToPath(base)
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
const filePath = fileURLToPath(resolved);
|
|
987
|
+
|
|
988
|
+
const stats = tryStatSync(
|
|
989
|
+
filePath.endsWith('/') ? filePath.slice(-1) : filePath
|
|
990
|
+
);
|
|
991
|
+
|
|
992
|
+
if (stats.isDirectory()) {
|
|
993
|
+
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base));
|
|
994
|
+
// @ts-expect-error Add this for `import.meta.resolve`.
|
|
995
|
+
error.url = String(resolved);
|
|
996
|
+
throw error
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
if (!stats.isFile()) {
|
|
1000
|
+
throw new ERR_MODULE_NOT_FOUND(
|
|
1001
|
+
filePath || resolved.pathname,
|
|
1002
|
+
base && fileURLToPath(base),
|
|
1003
|
+
'module'
|
|
1004
|
+
)
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (!preserveSymlinks) {
|
|
1008
|
+
const real = realpathSync$1(filePath);
|
|
1009
|
+
const {search, hash} = resolved;
|
|
1010
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path$n.sep) ? '/' : ''));
|
|
1011
|
+
resolved.search = search;
|
|
1012
|
+
resolved.hash = hash;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
return resolved
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* @param {string} specifier
|
|
1020
|
+
* @param {URL|undefined} packageJsonUrl
|
|
1021
|
+
* @param {URL} base
|
|
1022
|
+
* @returns {never}
|
|
1023
|
+
*/
|
|
1024
|
+
function throwImportNotDefined(specifier, packageJsonUrl, base) {
|
|
1025
|
+
throw new ERR_PACKAGE_IMPORT_NOT_DEFINED(
|
|
1026
|
+
specifier,
|
|
1027
|
+
packageJsonUrl && fileURLToPath(new URL$3('.', packageJsonUrl)),
|
|
1028
|
+
fileURLToPath(base)
|
|
1029
|
+
)
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* @param {string} subpath
|
|
1034
|
+
* @param {URL} packageJsonUrl
|
|
1035
|
+
* @param {URL} base
|
|
1036
|
+
* @returns {never}
|
|
1037
|
+
*/
|
|
1038
|
+
function throwExportsNotFound(subpath, packageJsonUrl, base) {
|
|
1039
|
+
throw new ERR_PACKAGE_PATH_NOT_EXPORTED(
|
|
1040
|
+
fileURLToPath(new URL$3('.', packageJsonUrl)),
|
|
1041
|
+
subpath,
|
|
1042
|
+
base && fileURLToPath(base)
|
|
1043
|
+
)
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* @param {string} subpath
|
|
1048
|
+
* @param {URL} packageJsonUrl
|
|
1049
|
+
* @param {boolean} internal
|
|
1050
|
+
* @param {URL} [base]
|
|
1051
|
+
* @returns {never}
|
|
1052
|
+
*/
|
|
1053
|
+
function throwInvalidSubpath(subpath, packageJsonUrl, internal, base) {
|
|
1054
|
+
const reason = `request is not a valid subpath for the "${
|
|
1055
|
+
internal ? 'imports' : 'exports'
|
|
1056
|
+
}" resolution of ${fileURLToPath(packageJsonUrl)}`;
|
|
1057
|
+
|
|
1058
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
1059
|
+
subpath,
|
|
1060
|
+
reason,
|
|
1061
|
+
base && fileURLToPath(base)
|
|
1062
|
+
)
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* @param {string} subpath
|
|
1067
|
+
* @param {unknown} target
|
|
1068
|
+
* @param {URL} packageJsonUrl
|
|
1069
|
+
* @param {boolean} internal
|
|
1070
|
+
* @param {URL} [base]
|
|
1071
|
+
* @returns {never}
|
|
1072
|
+
*/
|
|
1073
|
+
function throwInvalidPackageTarget(
|
|
1074
|
+
subpath,
|
|
1075
|
+
target,
|
|
1076
|
+
packageJsonUrl,
|
|
1077
|
+
internal,
|
|
1078
|
+
base
|
|
1079
|
+
) {
|
|
1080
|
+
target =
|
|
1081
|
+
typeof target === 'object' && target !== null
|
|
1082
|
+
? JSON.stringify(target, null, '')
|
|
1083
|
+
: `${target}`;
|
|
1084
|
+
|
|
1085
|
+
throw new ERR_INVALID_PACKAGE_TARGET(
|
|
1086
|
+
fileURLToPath(new URL$3('.', packageJsonUrl)),
|
|
1087
|
+
subpath,
|
|
1088
|
+
target,
|
|
1089
|
+
internal,
|
|
1090
|
+
base && fileURLToPath(base)
|
|
1091
|
+
)
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* @param {string} target
|
|
1096
|
+
* @param {string} subpath
|
|
1097
|
+
* @param {string} match
|
|
1098
|
+
* @param {URL} packageJsonUrl
|
|
1099
|
+
* @param {URL} base
|
|
1100
|
+
* @param {boolean} pattern
|
|
1101
|
+
* @param {boolean} internal
|
|
1102
|
+
* @param {Set<string>|undefined} conditions
|
|
1103
|
+
* @returns {URL}
|
|
1104
|
+
*/
|
|
1105
|
+
function resolvePackageTargetString(
|
|
1106
|
+
target,
|
|
1107
|
+
subpath,
|
|
1108
|
+
match,
|
|
1109
|
+
packageJsonUrl,
|
|
1110
|
+
base,
|
|
1111
|
+
pattern,
|
|
1112
|
+
internal,
|
|
1113
|
+
conditions
|
|
1114
|
+
) {
|
|
1115
|
+
if (subpath !== '' && !pattern && target[target.length - 1] !== '/')
|
|
1116
|
+
throwInvalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
1117
|
+
|
|
1118
|
+
if (!target.startsWith('./')) {
|
|
1119
|
+
if (internal && !target.startsWith('../') && !target.startsWith('/')) {
|
|
1120
|
+
let isURL = false;
|
|
1121
|
+
|
|
1122
|
+
try {
|
|
1123
|
+
new URL$3(target);
|
|
1124
|
+
isURL = true;
|
|
1125
|
+
} catch {
|
|
1126
|
+
// Continue regardless of error.
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
if (!isURL) {
|
|
1130
|
+
const exportTarget = pattern
|
|
1131
|
+
? RegExpPrototypeSymbolReplace.call(
|
|
1132
|
+
patternRegEx,
|
|
1133
|
+
target,
|
|
1134
|
+
() => subpath
|
|
1135
|
+
)
|
|
1136
|
+
: target + subpath;
|
|
1137
|
+
|
|
1138
|
+
return packageResolve(exportTarget, packageJsonUrl, conditions)
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
throwInvalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
if (invalidSegmentRegEx.test(target.slice(2)))
|
|
1146
|
+
throwInvalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
1147
|
+
|
|
1148
|
+
const resolved = new URL$3(target, packageJsonUrl);
|
|
1149
|
+
const resolvedPath = resolved.pathname;
|
|
1150
|
+
const packagePath = new URL$3('.', packageJsonUrl).pathname;
|
|
1151
|
+
|
|
1152
|
+
if (!resolvedPath.startsWith(packagePath))
|
|
1153
|
+
throwInvalidPackageTarget(match, target, packageJsonUrl, internal, base);
|
|
1154
|
+
|
|
1155
|
+
if (subpath === '') return resolved
|
|
1156
|
+
|
|
1157
|
+
if (invalidSegmentRegEx.test(subpath)) {
|
|
1158
|
+
const request = pattern
|
|
1159
|
+
? match.replace('*', () => subpath)
|
|
1160
|
+
: match + subpath;
|
|
1161
|
+
throwInvalidSubpath(request, packageJsonUrl, internal, base);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
if (pattern) {
|
|
1165
|
+
return new URL$3(
|
|
1166
|
+
RegExpPrototypeSymbolReplace.call(
|
|
1167
|
+
patternRegEx,
|
|
1168
|
+
resolved.href,
|
|
1169
|
+
() => subpath
|
|
1170
|
+
)
|
|
1171
|
+
)
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
return new URL$3(subpath, resolved)
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* @param {string} key
|
|
1179
|
+
* @returns {boolean}
|
|
1180
|
+
*/
|
|
1181
|
+
function isArrayIndex(key) {
|
|
1182
|
+
const keyNumber = Number(key);
|
|
1183
|
+
if (`${keyNumber}` !== key) return false
|
|
1184
|
+
return keyNumber >= 0 && keyNumber < 0xff_ff_ff_ff
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* @param {URL} packageJsonUrl
|
|
1189
|
+
* @param {unknown} target
|
|
1190
|
+
* @param {string} subpath
|
|
1191
|
+
* @param {string} packageSubpath
|
|
1192
|
+
* @param {URL} base
|
|
1193
|
+
* @param {boolean} pattern
|
|
1194
|
+
* @param {boolean} internal
|
|
1195
|
+
* @param {Set<string>|undefined} conditions
|
|
1196
|
+
* @returns {URL|null}
|
|
1197
|
+
*/
|
|
1198
|
+
function resolvePackageTarget(
|
|
1199
|
+
packageJsonUrl,
|
|
1200
|
+
target,
|
|
1201
|
+
subpath,
|
|
1202
|
+
packageSubpath,
|
|
1203
|
+
base,
|
|
1204
|
+
pattern,
|
|
1205
|
+
internal,
|
|
1206
|
+
conditions
|
|
1207
|
+
) {
|
|
1208
|
+
if (typeof target === 'string') {
|
|
1209
|
+
return resolvePackageTargetString(
|
|
1210
|
+
target,
|
|
1211
|
+
subpath,
|
|
1212
|
+
packageSubpath,
|
|
1213
|
+
packageJsonUrl,
|
|
1214
|
+
base,
|
|
1215
|
+
pattern,
|
|
1216
|
+
internal,
|
|
1217
|
+
conditions
|
|
1218
|
+
)
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
if (Array.isArray(target)) {
|
|
1222
|
+
/** @type {Array<unknown>} */
|
|
1223
|
+
const targetList = target;
|
|
1224
|
+
if (targetList.length === 0) return null
|
|
1225
|
+
|
|
1226
|
+
/** @type {ErrnoException|null|undefined} */
|
|
1227
|
+
let lastException;
|
|
1228
|
+
let i = -1;
|
|
1229
|
+
|
|
1230
|
+
while (++i < targetList.length) {
|
|
1231
|
+
const targetItem = targetList[i];
|
|
1232
|
+
/** @type {URL|null} */
|
|
1233
|
+
let resolveResult;
|
|
1234
|
+
try {
|
|
1235
|
+
resolveResult = resolvePackageTarget(
|
|
1236
|
+
packageJsonUrl,
|
|
1237
|
+
targetItem,
|
|
1238
|
+
subpath,
|
|
1239
|
+
packageSubpath,
|
|
1240
|
+
base,
|
|
1241
|
+
pattern,
|
|
1242
|
+
internal,
|
|
1243
|
+
conditions
|
|
1244
|
+
);
|
|
1245
|
+
} catch (error) {
|
|
1246
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
1247
|
+
lastException = exception;
|
|
1248
|
+
if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue
|
|
1249
|
+
throw error
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
if (resolveResult === undefined) continue
|
|
1253
|
+
|
|
1254
|
+
if (resolveResult === null) {
|
|
1255
|
+
lastException = null;
|
|
1256
|
+
continue
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
return resolveResult
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
if (lastException === undefined || lastException === null) {
|
|
1263
|
+
return null
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
throw lastException
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
if (typeof target === 'object' && target !== null) {
|
|
1270
|
+
const keys = Object.getOwnPropertyNames(target);
|
|
1271
|
+
let i = -1;
|
|
1272
|
+
|
|
1273
|
+
while (++i < keys.length) {
|
|
1274
|
+
const key = keys[i];
|
|
1275
|
+
if (isArrayIndex(key)) {
|
|
1276
|
+
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
1277
|
+
fileURLToPath(packageJsonUrl),
|
|
1278
|
+
base,
|
|
1279
|
+
'"exports" cannot contain numeric property keys.'
|
|
1280
|
+
)
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
i = -1;
|
|
1285
|
+
|
|
1286
|
+
while (++i < keys.length) {
|
|
1287
|
+
const key = keys[i];
|
|
1288
|
+
if (key === 'default' || (conditions && conditions.has(key))) {
|
|
1289
|
+
// @ts-expect-error: indexable.
|
|
1290
|
+
const conditionalTarget = /** @type {unknown} */ (target[key]);
|
|
1291
|
+
const resolveResult = resolvePackageTarget(
|
|
1292
|
+
packageJsonUrl,
|
|
1293
|
+
conditionalTarget,
|
|
1294
|
+
subpath,
|
|
1295
|
+
packageSubpath,
|
|
1296
|
+
base,
|
|
1297
|
+
pattern,
|
|
1298
|
+
internal,
|
|
1299
|
+
conditions
|
|
1300
|
+
);
|
|
1301
|
+
if (resolveResult === undefined) continue
|
|
1302
|
+
return resolveResult
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
return null
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
if (target === null) {
|
|
1310
|
+
return null
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
throwInvalidPackageTarget(
|
|
1314
|
+
packageSubpath,
|
|
1315
|
+
target,
|
|
1316
|
+
packageJsonUrl,
|
|
1317
|
+
internal,
|
|
1318
|
+
base
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* @param {unknown} exports
|
|
1324
|
+
* @param {URL} packageJsonUrl
|
|
1325
|
+
* @param {URL} base
|
|
1326
|
+
* @returns {boolean}
|
|
1327
|
+
*/
|
|
1328
|
+
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
1329
|
+
if (typeof exports === 'string' || Array.isArray(exports)) return true
|
|
1330
|
+
if (typeof exports !== 'object' || exports === null) return false
|
|
1331
|
+
|
|
1332
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
1333
|
+
let isConditionalSugar = false;
|
|
1334
|
+
let i = 0;
|
|
1335
|
+
let j = -1;
|
|
1336
|
+
while (++j < keys.length) {
|
|
1337
|
+
const key = keys[j];
|
|
1338
|
+
const curIsConditionalSugar = key === '' || key[0] !== '.';
|
|
1339
|
+
if (i++ === 0) {
|
|
1340
|
+
isConditionalSugar = curIsConditionalSugar;
|
|
1341
|
+
} else if (isConditionalSugar !== curIsConditionalSugar) {
|
|
1342
|
+
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
1343
|
+
fileURLToPath(packageJsonUrl),
|
|
1344
|
+
base,
|
|
1345
|
+
'"exports" cannot contain some keys starting with \'.\' and some not.' +
|
|
1346
|
+
' The exports object must either be an object of package subpath keys' +
|
|
1347
|
+
' or an object of main entry condition name keys only.'
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
return isConditionalSugar
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/**
|
|
1356
|
+
* @param {string} match
|
|
1357
|
+
* @param {URL} pjsonUrl
|
|
1358
|
+
* @param {URL} base
|
|
1359
|
+
*/
|
|
1360
|
+
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
|
|
1361
|
+
const pjsonPath = fileURLToPath(pjsonUrl);
|
|
1362
|
+
if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return
|
|
1363
|
+
emittedPackageWarnings.add(pjsonPath + '|' + match);
|
|
1364
|
+
process$1.emitWarning(
|
|
1365
|
+
`Use of deprecated trailing slash pattern mapping "${match}" in the ` +
|
|
1366
|
+
`"exports" field module resolution of the package at ${pjsonPath}${
|
|
1367
|
+
base ? ` imported from ${fileURLToPath(base)}` : ''
|
|
1368
|
+
}. Mapping specifiers ending in "/" is no longer supported.`,
|
|
1369
|
+
'DeprecationWarning',
|
|
1370
|
+
'DEP0155'
|
|
1371
|
+
);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* @param {URL} packageJsonUrl
|
|
1376
|
+
* @param {string} packageSubpath
|
|
1377
|
+
* @param {Record<string, unknown>} packageConfig
|
|
1378
|
+
* @param {URL} base
|
|
1379
|
+
* @param {Set<string>|undefined} conditions
|
|
1380
|
+
* @returns {URL}
|
|
1381
|
+
*/
|
|
1382
|
+
function packageExportsResolve(
|
|
1383
|
+
packageJsonUrl,
|
|
1384
|
+
packageSubpath,
|
|
1385
|
+
packageConfig,
|
|
1386
|
+
base,
|
|
1387
|
+
conditions
|
|
1388
|
+
) {
|
|
1389
|
+
let exports = packageConfig.exports;
|
|
1390
|
+
|
|
1391
|
+
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
|
|
1392
|
+
exports = {'.': exports};
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
if (
|
|
1396
|
+
own.call(exports, packageSubpath) &&
|
|
1397
|
+
!packageSubpath.includes('*') &&
|
|
1398
|
+
!packageSubpath.endsWith('/')
|
|
1399
|
+
) {
|
|
1400
|
+
// @ts-expect-error: indexable.
|
|
1401
|
+
const target = exports[packageSubpath];
|
|
1402
|
+
const resolveResult = resolvePackageTarget(
|
|
1403
|
+
packageJsonUrl,
|
|
1404
|
+
target,
|
|
1405
|
+
'',
|
|
1406
|
+
packageSubpath,
|
|
1407
|
+
base,
|
|
1408
|
+
false,
|
|
1409
|
+
false,
|
|
1410
|
+
conditions
|
|
1411
|
+
);
|
|
1412
|
+
if (resolveResult === null || resolveResult === undefined) {
|
|
1413
|
+
throwExportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
return resolveResult
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
let bestMatch = '';
|
|
1420
|
+
let bestMatchSubpath = '';
|
|
1421
|
+
const keys = Object.getOwnPropertyNames(exports);
|
|
1422
|
+
let i = -1;
|
|
1423
|
+
|
|
1424
|
+
while (++i < keys.length) {
|
|
1425
|
+
const key = keys[i];
|
|
1426
|
+
const patternIndex = key.indexOf('*');
|
|
1427
|
+
|
|
1428
|
+
if (
|
|
1429
|
+
patternIndex !== -1 &&
|
|
1430
|
+
packageSubpath.startsWith(key.slice(0, patternIndex))
|
|
1431
|
+
) {
|
|
1432
|
+
// When this reaches EOL, this can throw at the top of the whole function:
|
|
1433
|
+
//
|
|
1434
|
+
// if (StringPrototypeEndsWith(packageSubpath, '/'))
|
|
1435
|
+
// throwInvalidSubpath(packageSubpath)
|
|
1436
|
+
//
|
|
1437
|
+
// To match "imports" and the spec.
|
|
1438
|
+
if (packageSubpath.endsWith('/')) {
|
|
1439
|
+
emitTrailingSlashPatternDeprecation(
|
|
1440
|
+
packageSubpath,
|
|
1441
|
+
packageJsonUrl,
|
|
1442
|
+
base
|
|
1443
|
+
);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
const patternTrailer = key.slice(patternIndex + 1);
|
|
1447
|
+
|
|
1448
|
+
if (
|
|
1449
|
+
packageSubpath.length >= key.length &&
|
|
1450
|
+
packageSubpath.endsWith(patternTrailer) &&
|
|
1451
|
+
patternKeyCompare(bestMatch, key) === 1 &&
|
|
1452
|
+
key.lastIndexOf('*') === patternIndex
|
|
1453
|
+
) {
|
|
1454
|
+
bestMatch = key;
|
|
1455
|
+
bestMatchSubpath = packageSubpath.slice(
|
|
1456
|
+
patternIndex,
|
|
1457
|
+
packageSubpath.length - patternTrailer.length
|
|
1458
|
+
);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
if (bestMatch) {
|
|
1464
|
+
// @ts-expect-error: indexable.
|
|
1465
|
+
const target = /** @type {unknown} */ (exports[bestMatch]);
|
|
1466
|
+
const resolveResult = resolvePackageTarget(
|
|
1467
|
+
packageJsonUrl,
|
|
1468
|
+
target,
|
|
1469
|
+
bestMatchSubpath,
|
|
1470
|
+
bestMatch,
|
|
1471
|
+
base,
|
|
1472
|
+
true,
|
|
1473
|
+
false,
|
|
1474
|
+
conditions
|
|
1475
|
+
);
|
|
1476
|
+
|
|
1477
|
+
if (resolveResult === null || resolveResult === undefined) {
|
|
1478
|
+
throwExportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return resolveResult
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
throwExportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* @param {string} a
|
|
1489
|
+
* @param {string} b
|
|
1490
|
+
*/
|
|
1491
|
+
function patternKeyCompare(a, b) {
|
|
1492
|
+
const aPatternIndex = a.indexOf('*');
|
|
1493
|
+
const bPatternIndex = b.indexOf('*');
|
|
1494
|
+
const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
|
1495
|
+
const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
|
|
1496
|
+
if (baseLengthA > baseLengthB) return -1
|
|
1497
|
+
if (baseLengthB > baseLengthA) return 1
|
|
1498
|
+
if (aPatternIndex === -1) return 1
|
|
1499
|
+
if (bPatternIndex === -1) return -1
|
|
1500
|
+
if (a.length > b.length) return -1
|
|
1501
|
+
if (b.length > a.length) return 1
|
|
1502
|
+
return 0
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* @param {string} name
|
|
1507
|
+
* @param {URL} base
|
|
1508
|
+
* @param {Set<string>} [conditions]
|
|
1509
|
+
* @returns {URL}
|
|
1510
|
+
*/
|
|
1511
|
+
function packageImportsResolve(name, base, conditions) {
|
|
1512
|
+
if (name === '#' || name.startsWith('#/') || name.endsWith('/')) {
|
|
1513
|
+
const reason = 'is not a valid internal imports specifier name';
|
|
1514
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base))
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/** @type {URL|undefined} */
|
|
1518
|
+
let packageJsonUrl;
|
|
1519
|
+
|
|
1520
|
+
const packageConfig = getPackageScopeConfig(base);
|
|
1521
|
+
|
|
1522
|
+
if (packageConfig.exists) {
|
|
1523
|
+
packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
|
|
1524
|
+
const imports = packageConfig.imports;
|
|
1525
|
+
if (imports) {
|
|
1526
|
+
if (own.call(imports, name) && !name.includes('*')) {
|
|
1527
|
+
const resolveResult = resolvePackageTarget(
|
|
1528
|
+
packageJsonUrl,
|
|
1529
|
+
imports[name],
|
|
1530
|
+
'',
|
|
1531
|
+
name,
|
|
1532
|
+
base,
|
|
1533
|
+
false,
|
|
1534
|
+
true,
|
|
1535
|
+
conditions
|
|
1536
|
+
);
|
|
1537
|
+
if (resolveResult !== null && resolveResult !== undefined) {
|
|
1538
|
+
return resolveResult
|
|
1539
|
+
}
|
|
1540
|
+
} else {
|
|
1541
|
+
let bestMatch = '';
|
|
1542
|
+
let bestMatchSubpath = '';
|
|
1543
|
+
const keys = Object.getOwnPropertyNames(imports);
|
|
1544
|
+
let i = -1;
|
|
1545
|
+
|
|
1546
|
+
while (++i < keys.length) {
|
|
1547
|
+
const key = keys[i];
|
|
1548
|
+
const patternIndex = key.indexOf('*');
|
|
1549
|
+
|
|
1550
|
+
if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {
|
|
1551
|
+
const patternTrailer = key.slice(patternIndex + 1);
|
|
1552
|
+
if (
|
|
1553
|
+
name.length >= key.length &&
|
|
1554
|
+
name.endsWith(patternTrailer) &&
|
|
1555
|
+
patternKeyCompare(bestMatch, key) === 1 &&
|
|
1556
|
+
key.lastIndexOf('*') === patternIndex
|
|
1557
|
+
) {
|
|
1558
|
+
bestMatch = key;
|
|
1559
|
+
bestMatchSubpath = name.slice(
|
|
1560
|
+
patternIndex,
|
|
1561
|
+
name.length - patternTrailer.length
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
if (bestMatch) {
|
|
1568
|
+
const target = imports[bestMatch];
|
|
1569
|
+
const resolveResult = resolvePackageTarget(
|
|
1570
|
+
packageJsonUrl,
|
|
1571
|
+
target,
|
|
1572
|
+
bestMatchSubpath,
|
|
1573
|
+
bestMatch,
|
|
1574
|
+
base,
|
|
1575
|
+
true,
|
|
1576
|
+
true,
|
|
1577
|
+
conditions
|
|
1578
|
+
);
|
|
1579
|
+
|
|
1580
|
+
if (resolveResult !== null && resolveResult !== undefined) {
|
|
1581
|
+
return resolveResult
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
throwImportNotDefined(name, packageJsonUrl, base);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* @param {URL} url
|
|
1593
|
+
* @returns {PackageType}
|
|
1594
|
+
*/
|
|
1595
|
+
function getPackageType(url) {
|
|
1596
|
+
const packageConfig = getPackageScopeConfig(url);
|
|
1597
|
+
return packageConfig.type
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* @param {string} specifier
|
|
1602
|
+
* @param {URL} base
|
|
1603
|
+
*/
|
|
1604
|
+
function parsePackageName(specifier, base) {
|
|
1605
|
+
let separatorIndex = specifier.indexOf('/');
|
|
1606
|
+
let validPackageName = true;
|
|
1607
|
+
let isScoped = false;
|
|
1608
|
+
if (specifier[0] === '@') {
|
|
1609
|
+
isScoped = true;
|
|
1610
|
+
if (separatorIndex === -1 || specifier.length === 0) {
|
|
1611
|
+
validPackageName = false;
|
|
1612
|
+
} else {
|
|
1613
|
+
separatorIndex = specifier.indexOf('/', separatorIndex + 1);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
const packageName =
|
|
1618
|
+
separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);
|
|
1619
|
+
|
|
1620
|
+
// Package name cannot have leading . and cannot have percent-encoding or
|
|
1621
|
+
// \\ separators.
|
|
1622
|
+
if (invalidPackageNameRegEx.exec(packageName) !== null) {
|
|
1623
|
+
validPackageName = false;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
if (!validPackageName) {
|
|
1627
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
1628
|
+
specifier,
|
|
1629
|
+
'is not a valid package name',
|
|
1630
|
+
fileURLToPath(base)
|
|
1631
|
+
)
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
const packageSubpath =
|
|
1635
|
+
'.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex));
|
|
1636
|
+
|
|
1637
|
+
return {packageName, packageSubpath, isScoped}
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* @param {string} specifier
|
|
1642
|
+
* @param {URL} base
|
|
1643
|
+
* @param {Set<string>|undefined} conditions
|
|
1644
|
+
* @returns {URL}
|
|
1645
|
+
*/
|
|
1646
|
+
function packageResolve(specifier, base, conditions) {
|
|
1647
|
+
if (builtinModules.includes(specifier)) {
|
|
1648
|
+
return new URL$3('node:' + specifier)
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
const {packageName, packageSubpath, isScoped} = parsePackageName(
|
|
1652
|
+
specifier,
|
|
1653
|
+
base
|
|
1654
|
+
);
|
|
1655
|
+
|
|
1656
|
+
// ResolveSelf
|
|
1657
|
+
const packageConfig = getPackageScopeConfig(base);
|
|
1658
|
+
|
|
1659
|
+
// Can’t test.
|
|
1660
|
+
/* c8 ignore next 16 */
|
|
1661
|
+
if (packageConfig.exists) {
|
|
1662
|
+
const packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);
|
|
1663
|
+
if (
|
|
1664
|
+
packageConfig.name === packageName &&
|
|
1665
|
+
packageConfig.exports !== undefined &&
|
|
1666
|
+
packageConfig.exports !== null
|
|
1667
|
+
) {
|
|
1668
|
+
return packageExportsResolve(
|
|
1669
|
+
packageJsonUrl,
|
|
1670
|
+
packageSubpath,
|
|
1671
|
+
packageConfig,
|
|
1672
|
+
base,
|
|
1673
|
+
conditions
|
|
1674
|
+
)
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
let packageJsonUrl = new URL$3(
|
|
1679
|
+
'./node_modules/' + packageName + '/package.json',
|
|
1680
|
+
base
|
|
1681
|
+
);
|
|
1682
|
+
let packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
1683
|
+
/** @type {string} */
|
|
1684
|
+
let lastPath;
|
|
1685
|
+
do {
|
|
1686
|
+
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
1687
|
+
if (!stat.isDirectory()) {
|
|
1688
|
+
lastPath = packageJsonPath;
|
|
1689
|
+
packageJsonUrl = new URL$3(
|
|
1690
|
+
(isScoped ? '../../../../node_modules/' : '../../../node_modules/') +
|
|
1691
|
+
packageName +
|
|
1692
|
+
'/package.json',
|
|
1693
|
+
packageJsonUrl
|
|
1694
|
+
);
|
|
1695
|
+
packageJsonPath = fileURLToPath(packageJsonUrl);
|
|
1696
|
+
continue
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
// Package match.
|
|
1700
|
+
const packageConfig = getPackageConfig(packageJsonPath, specifier, base);
|
|
1701
|
+
if (packageConfig.exports !== undefined && packageConfig.exports !== null) {
|
|
1702
|
+
return packageExportsResolve(
|
|
1703
|
+
packageJsonUrl,
|
|
1704
|
+
packageSubpath,
|
|
1705
|
+
packageConfig,
|
|
1706
|
+
base,
|
|
1707
|
+
conditions
|
|
1708
|
+
)
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
if (packageSubpath === '.') {
|
|
1712
|
+
return legacyMainResolve(packageJsonUrl, packageConfig, base)
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
return new URL$3(packageSubpath, packageJsonUrl)
|
|
1716
|
+
// Cross-platform root check.
|
|
1717
|
+
} while (packageJsonPath.length !== lastPath.length)
|
|
1718
|
+
|
|
1719
|
+
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base))
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* @param {string} specifier
|
|
1724
|
+
* @returns {boolean}
|
|
1725
|
+
*/
|
|
1726
|
+
function isRelativeSpecifier(specifier) {
|
|
1727
|
+
if (specifier[0] === '.') {
|
|
1728
|
+
if (specifier.length === 1 || specifier[1] === '/') return true
|
|
1729
|
+
if (
|
|
1730
|
+
specifier[1] === '.' &&
|
|
1731
|
+
(specifier.length === 2 || specifier[2] === '/')
|
|
1732
|
+
) {
|
|
1733
|
+
return true
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
return false
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* @param {string} specifier
|
|
1742
|
+
* @returns {boolean}
|
|
1743
|
+
*/
|
|
1744
|
+
function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
1745
|
+
if (specifier === '') return false
|
|
1746
|
+
if (specifier[0] === '/') return true
|
|
1747
|
+
return isRelativeSpecifier(specifier)
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* The “Resolver Algorithm Specification” as detailed in the Node docs (which is
|
|
1752
|
+
* sync and slightly lower-level than `resolve`).
|
|
1753
|
+
*
|
|
1754
|
+
* @param {string} specifier
|
|
1755
|
+
* @param {URL} base
|
|
1756
|
+
* @param {Set<string>} [conditions]
|
|
1757
|
+
* @param {boolean} [preserveSymlinks]
|
|
1758
|
+
* @returns {URL}
|
|
1759
|
+
*/
|
|
1760
|
+
function moduleResolve(specifier, base, conditions, preserveSymlinks) {
|
|
1761
|
+
const isRemote = base.protocol === 'http:' || base.protocol === 'https:';
|
|
1762
|
+
// Order swapped from spec for minor perf gain.
|
|
1763
|
+
// Ok since relative URLs cannot parse as URLs.
|
|
1764
|
+
/** @type {URL|undefined} */
|
|
1765
|
+
let resolved;
|
|
1766
|
+
|
|
1767
|
+
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
1768
|
+
resolved = new URL$3(specifier, base);
|
|
1769
|
+
} else if (!isRemote && specifier[0] === '#') {
|
|
1770
|
+
resolved = packageImportsResolve(specifier, base, conditions);
|
|
1771
|
+
} else {
|
|
1772
|
+
try {
|
|
1773
|
+
resolved = new URL$3(specifier);
|
|
1774
|
+
} catch {
|
|
1775
|
+
if (!isRemote) {
|
|
1776
|
+
resolved = packageResolve(specifier, base, conditions);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
assert$1(typeof resolved !== 'undefined', 'expected to be defined');
|
|
1782
|
+
|
|
1783
|
+
if (resolved.protocol !== 'file:') {
|
|
1784
|
+
return resolved
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
return finalizeResolution(resolved, base, preserveSymlinks)
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* @param {string} specifier
|
|
1792
|
+
* @param {URL|undefined} parsed
|
|
1793
|
+
* @param {URL|undefined} parsedParentURL
|
|
1794
|
+
*/
|
|
1795
|
+
function checkIfDisallowedImport(specifier, parsed, parsedParentURL) {
|
|
1796
|
+
if (
|
|
1797
|
+
parsed &&
|
|
1798
|
+
parsedParentURL &&
|
|
1799
|
+
(parsedParentURL.protocol === 'http:' ||
|
|
1800
|
+
parsedParentURL.protocol === 'https:')
|
|
1801
|
+
) {
|
|
1802
|
+
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
1803
|
+
// Data: and blob: disallowed due to allowing file: access via
|
|
1804
|
+
// indirection
|
|
1805
|
+
if (
|
|
1806
|
+
parsed &&
|
|
1807
|
+
parsed.protocol !== 'https:' &&
|
|
1808
|
+
parsed.protocol !== 'http:'
|
|
1809
|
+
) {
|
|
1810
|
+
throw new ERR_NETWORK_IMPORT_DISALLOWED(
|
|
1811
|
+
specifier,
|
|
1812
|
+
parsedParentURL,
|
|
1813
|
+
'remote imports cannot import from a local location.'
|
|
1814
|
+
)
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
return {url: parsed.href}
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
if (builtinModules.includes(specifier)) {
|
|
1821
|
+
throw new ERR_NETWORK_IMPORT_DISALLOWED(
|
|
1822
|
+
specifier,
|
|
1823
|
+
parsedParentURL,
|
|
1824
|
+
'remote imports cannot import from a local location.'
|
|
1825
|
+
)
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
throw new ERR_NETWORK_IMPORT_DISALLOWED(
|
|
1829
|
+
specifier,
|
|
1830
|
+
parsedParentURL,
|
|
1831
|
+
'only relative and absolute specifiers are supported.'
|
|
1832
|
+
)
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* @param {URL} url
|
|
1838
|
+
*/
|
|
1839
|
+
function throwIfUnsupportedURLProtocol(url) {
|
|
1840
|
+
if (
|
|
1841
|
+
url.protocol !== 'file:' &&
|
|
1842
|
+
url.protocol !== 'data:' &&
|
|
1843
|
+
url.protocol !== 'node:'
|
|
1844
|
+
) {
|
|
1845
|
+
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url)
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* @param {URL|undefined} parsed
|
|
1851
|
+
* @param {boolean} experimentalNetworkImports
|
|
1852
|
+
*/
|
|
1853
|
+
function throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports) {
|
|
1854
|
+
if (
|
|
1855
|
+
parsed &&
|
|
1856
|
+
parsed.protocol !== 'file:' &&
|
|
1857
|
+
parsed.protocol !== 'data:' &&
|
|
1858
|
+
(!experimentalNetworkImports ||
|
|
1859
|
+
(parsed.protocol !== 'https:' && parsed.protocol !== 'http:'))
|
|
1860
|
+
) {
|
|
1861
|
+
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(
|
|
1862
|
+
parsed,
|
|
1863
|
+
['file', 'data'].concat(
|
|
1864
|
+
experimentalNetworkImports ? ['https', 'http'] : []
|
|
1865
|
+
)
|
|
1866
|
+
)
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* @param {string} specifier
|
|
1872
|
+
* @param {{parentURL?: string, conditions?: Array<string>}} context
|
|
1873
|
+
* @returns {{url: string, format?: string|null}}
|
|
1874
|
+
*/
|
|
1875
|
+
function defaultResolve(specifier, context = {}) {
|
|
1876
|
+
const {parentURL} = context;
|
|
1877
|
+
assert$1(typeof parentURL !== 'undefined', 'expected `parentURL` to be defined');
|
|
1878
|
+
|
|
1879
|
+
/** @type {URL|undefined} */
|
|
1880
|
+
let parsedParentURL;
|
|
1881
|
+
if (parentURL) {
|
|
1882
|
+
try {
|
|
1883
|
+
parsedParentURL = new URL$3(parentURL);
|
|
1884
|
+
} catch {
|
|
1885
|
+
// Ignore exception
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/** @type {URL|undefined} */
|
|
1890
|
+
let parsed;
|
|
1891
|
+
try {
|
|
1892
|
+
parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier)
|
|
1893
|
+
? new URL$3(specifier, parsedParentURL)
|
|
1894
|
+
: new URL$3(specifier);
|
|
1895
|
+
|
|
1896
|
+
if (
|
|
1897
|
+
parsed.protocol === 'data:' ||
|
|
1898
|
+
(experimentalNetworkImports )
|
|
1899
|
+
) {
|
|
1900
|
+
return {url: parsed.href, format: null}
|
|
1901
|
+
}
|
|
1902
|
+
} catch {
|
|
1903
|
+
// Ignore exception
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
// There are multiple deep branches that can either throw or return; instead
|
|
1907
|
+
// of duplicating that deeply nested logic for the possible returns, DRY and
|
|
1908
|
+
// check for a return. This seems the least gnarly.
|
|
1909
|
+
const maybeReturn = checkIfDisallowedImport(
|
|
1910
|
+
specifier,
|
|
1911
|
+
parsed,
|
|
1912
|
+
parsedParentURL
|
|
1913
|
+
);
|
|
1914
|
+
|
|
1915
|
+
if (maybeReturn) return maybeReturn
|
|
1916
|
+
|
|
1917
|
+
// This must come after checkIfDisallowedImport
|
|
1918
|
+
if (parsed && parsed.protocol === 'node:') return {url: specifier}
|
|
1919
|
+
|
|
1920
|
+
throwIfUnsupportedURLScheme(parsed, experimentalNetworkImports);
|
|
1921
|
+
|
|
1922
|
+
const conditions = getConditionsSet(context.conditions);
|
|
1923
|
+
|
|
1924
|
+
const url = moduleResolve(specifier, new URL$3(parentURL), conditions, false);
|
|
1925
|
+
|
|
1926
|
+
throwIfUnsupportedURLProtocol(url);
|
|
1927
|
+
|
|
1928
|
+
return {
|
|
1929
|
+
// Do NOT cast `url` to a string: that will work even when there are real
|
|
1930
|
+
// problems, silencing them
|
|
1931
|
+
url: url.href,
|
|
1932
|
+
format: defaultGetFormatWithoutErrors(url, {parentURL})
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* @typedef {import('./lib/errors.js').ErrnoException} ErrnoException
|
|
1938
|
+
*/
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* Provides a module-relative resolution function scoped to each module,
|
|
1942
|
+
* returning the URL string.
|
|
1943
|
+
* `import.meta.resolve` also accepts a second argument which is the parent
|
|
1944
|
+
* module from which to resolve from.
|
|
1945
|
+
*
|
|
1946
|
+
* This function is asynchronous because the ES module resolver in Node.js is
|
|
1947
|
+
* allowed to be asynchronous.
|
|
1948
|
+
*
|
|
1949
|
+
* @param {string} specifier The module specifier to resolve relative to parent.
|
|
1950
|
+
* @param {string} parent The absolute parent module URL to resolve from.
|
|
1951
|
+
* You should pass `import.meta.url` or something else
|
|
1952
|
+
* @returns {Promise<string>}
|
|
1953
|
+
*/
|
|
1954
|
+
async function resolve$4(specifier, parent) {
|
|
1955
|
+
if (!parent) {
|
|
1956
|
+
throw new Error(
|
|
1957
|
+
'Please pass `parent`: `import-meta-resolve` cannot ponyfill that'
|
|
1958
|
+
)
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
try {
|
|
1962
|
+
return defaultResolve(specifier, {parentURL: parent}).url
|
|
1963
|
+
} catch (error) {
|
|
1964
|
+
const exception = /** @type {ErrnoException} */ (error);
|
|
1965
|
+
|
|
1966
|
+
return exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' &&
|
|
1967
|
+
typeof exception.url === 'string'
|
|
1968
|
+
? exception.url
|
|
1969
|
+
: Promise.reject(error)
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
|
|
217
1973
|
var picomatch$5 = {exports: {}};
|
|
218
1974
|
|
|
219
1975
|
var utils$k = {};
|
|
@@ -2561,7 +4317,7 @@ function getMatcherString$1(id, resolutionBase) {
|
|
|
2561
4317
|
return id;
|
|
2562
4318
|
}
|
|
2563
4319
|
// resolve('') is valid and will default to process.cwd()
|
|
2564
|
-
const basePath = resolve$
|
|
4320
|
+
const basePath = resolve$5(resolutionBase || '')
|
|
2565
4321
|
.split(sep)
|
|
2566
4322
|
.join('/')
|
|
2567
4323
|
// escape all possible (posix + win) path characters that might interfere with regex
|
|
@@ -4566,7 +6322,7 @@ function requireSync () {
|
|
|
4566
6322
|
var minimatch = minimatch_1;
|
|
4567
6323
|
requireGlob().Glob;
|
|
4568
6324
|
var path = require$$0$4;
|
|
4569
|
-
var assert = assert$
|
|
6325
|
+
var assert = assert$2;
|
|
4570
6326
|
var isAbsolute = pathIsAbsolute.exports;
|
|
4571
6327
|
var common = common$c;
|
|
4572
6328
|
var setopts = common.setopts;
|
|
@@ -5226,7 +6982,7 @@ function requireGlob () {
|
|
|
5226
6982
|
var inherits$1 = inherits.exports;
|
|
5227
6983
|
var EE = require$$0$5.EventEmitter;
|
|
5228
6984
|
var path = require$$0$4;
|
|
5229
|
-
var assert = assert$
|
|
6985
|
+
var assert = assert$2;
|
|
5230
6986
|
var isAbsolute = pathIsAbsolute.exports;
|
|
5231
6987
|
var globSync = requireSync();
|
|
5232
6988
|
var common = common$c;
|
|
@@ -7409,7 +9165,7 @@ function getPackageEntryPoint(dirPath) {
|
|
|
7409
9165
|
|
|
7410
9166
|
function isDirectory(path) {
|
|
7411
9167
|
try {
|
|
7412
|
-
if (statSync$
|
|
9168
|
+
if (statSync$2(path).isDirectory()) return true;
|
|
7413
9169
|
} catch (ignored) {
|
|
7414
9170
|
// Nothing to do here
|
|
7415
9171
|
}
|
|
@@ -7426,11 +9182,11 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
|
|
|
7426
9182
|
? dynamicRequireModules.delete(targetPath)
|
|
7427
9183
|
: dynamicRequireModules.set(targetPath, resolvedPath);
|
|
7428
9184
|
for (const path of globExports.sync(isNegated ? pattern.substr(1) : pattern)) {
|
|
7429
|
-
const resolvedPath = resolve$
|
|
9185
|
+
const resolvedPath = resolve$5(path);
|
|
7430
9186
|
const requirePath = normalizePathSlashes(resolvedPath);
|
|
7431
9187
|
if (isDirectory(resolvedPath)) {
|
|
7432
9188
|
dirNames.add(resolvedPath);
|
|
7433
|
-
const modulePath = resolve$
|
|
9189
|
+
const modulePath = resolve$5(join$1(resolvedPath, getPackageEntryPoint(path)));
|
|
7434
9190
|
modifyMap(requirePath, modulePath);
|
|
7435
9191
|
modifyMap(normalizePathSlashes(modulePath), modulePath);
|
|
7436
9192
|
} else {
|
|
@@ -7727,12 +9483,12 @@ function resolveExtensions(importee, importer, extensions) {
|
|
|
7727
9483
|
// not our problem
|
|
7728
9484
|
if (importee[0] !== '.' || !importer) return undefined;
|
|
7729
9485
|
|
|
7730
|
-
const resolved = resolve$
|
|
9486
|
+
const resolved = resolve$5(dirname$1(importer), importee);
|
|
7731
9487
|
const candidates = getCandidates(resolved, extensions);
|
|
7732
9488
|
|
|
7733
9489
|
for (let i = 0; i < candidates.length; i += 1) {
|
|
7734
9490
|
try {
|
|
7735
|
-
const stats = statSync$
|
|
9491
|
+
const stats = statSync$2(candidates[i]);
|
|
7736
9492
|
if (stats.isFile()) return { id: candidates[i] };
|
|
7737
9493
|
} catch (err) {
|
|
7738
9494
|
/* noop */
|
|
@@ -9240,7 +10996,7 @@ function commonjs(options = {}) {
|
|
|
9240
10996
|
|
|
9241
10997
|
const dynamicRequireRoot =
|
|
9242
10998
|
typeof options.dynamicRequireRoot === 'string'
|
|
9243
|
-
? resolve$
|
|
10999
|
+
? resolve$5(options.dynamicRequireRoot)
|
|
9244
11000
|
: process.cwd();
|
|
9245
11001
|
const { commonDir, dynamicRequireModules } = getDynamicRequireModules(
|
|
9246
11002
|
options.dynamicRequireTargets,
|
|
@@ -11530,7 +13286,7 @@ function getMatcherString(id, resolutionBase) {
|
|
|
11530
13286
|
return normalizePath$4(id);
|
|
11531
13287
|
}
|
|
11532
13288
|
// resolve('') is valid and will default to process.cwd()
|
|
11533
|
-
const basePath = normalizePath$4(resolve$
|
|
13289
|
+
const basePath = normalizePath$4(resolve$5(resolutionBase || ''))
|
|
11534
13290
|
// escape all possible (posix + win) path characters that might interfere with regex
|
|
11535
13291
|
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
|
|
11536
13292
|
// Note that we use posix.join because:
|
|
@@ -11737,7 +13493,7 @@ try {
|
|
|
11737
13493
|
catch { }
|
|
11738
13494
|
const ssrExtensions = ['.js', '.cjs', '.json', '.node'];
|
|
11739
13495
|
function resolveFrom(id, basedir, preserveSymlinks = false, ssr = false) {
|
|
11740
|
-
return resolve$
|
|
13496
|
+
return resolve$6.sync(id, {
|
|
11741
13497
|
basedir,
|
|
11742
13498
|
paths: [],
|
|
11743
13499
|
extensions: ssr ? ssrExtensions : DEFAULT_EXTENSIONS$1,
|
|
@@ -11853,6 +13609,7 @@ function getPotentialTsSrcPaths(filePath) {
|
|
|
11853
13609
|
return paths;
|
|
11854
13610
|
}
|
|
11855
13611
|
const importQueryRE = /(\?|&)import=?(?:&|$)/;
|
|
13612
|
+
const directRequestRE$1 = /(\?|&)direct=?(?:&|$)/;
|
|
11856
13613
|
const internalPrefixes = [
|
|
11857
13614
|
FS_PREFIX,
|
|
11858
13615
|
VALID_ID_PREFIX,
|
|
@@ -11866,6 +13623,9 @@ const isInternalRequest = (url) => InternalPrefixRE.test(url);
|
|
|
11866
13623
|
function removeImportQuery(url) {
|
|
11867
13624
|
return url.replace(importQueryRE, '$1').replace(trailingSeparatorRE, '');
|
|
11868
13625
|
}
|
|
13626
|
+
function removeDirectQuery(url) {
|
|
13627
|
+
return url.replace(directRequestRE$1, '$1').replace(trailingSeparatorRE, '');
|
|
13628
|
+
}
|
|
11869
13629
|
function injectQuery(url, queryToInject) {
|
|
11870
13630
|
// encode percents for consistent behavior with pathToFileURL
|
|
11871
13631
|
// see #2614 for details
|
|
@@ -13367,12 +15127,15 @@ async function transformWithEsbuild(code, filename, options, inMap) {
|
|
|
13367
15127
|
// these fields would affect the compilation result
|
|
13368
15128
|
// https://esbuild.github.io/content-types/#tsconfig-json
|
|
13369
15129
|
const meaningfulFields = [
|
|
13370
|
-
'
|
|
15130
|
+
'alwaysStrict',
|
|
15131
|
+
'importsNotUsedAsValues',
|
|
15132
|
+
'jsx',
|
|
13371
15133
|
'jsxFactory',
|
|
13372
15134
|
'jsxFragmentFactory',
|
|
13373
|
-
'
|
|
13374
|
-
'
|
|
13375
|
-
'
|
|
15135
|
+
'jsxImportSource',
|
|
15136
|
+
'preserveValueImports',
|
|
15137
|
+
'target',
|
|
15138
|
+
'useDefineForClassFields'
|
|
13376
15139
|
];
|
|
13377
15140
|
const compilerOptionsForFile = {};
|
|
13378
15141
|
if (loader === 'ts' || loader === 'tsx') {
|
|
@@ -13932,10 +15695,10 @@ function makeAbsolute(cwd, filepath) {
|
|
|
13932
15695
|
return path$g.resolve(cwd, filepath);
|
|
13933
15696
|
}
|
|
13934
15697
|
path$h.makeAbsolute = makeAbsolute;
|
|
13935
|
-
function escape$
|
|
15698
|
+
function escape$3(pattern) {
|
|
13936
15699
|
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
|
13937
15700
|
}
|
|
13938
|
-
path$h.escape = escape$
|
|
15701
|
+
path$h.escape = escape$3;
|
|
13939
15702
|
function removeLeadingDotSegment(entry) {
|
|
13940
15703
|
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
|
13941
15704
|
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
@@ -33821,8 +35584,8 @@ async function urlToBuiltUrl(url, importer, config, pluginContext) {
|
|
|
33821
35584
|
true);
|
|
33822
35585
|
}
|
|
33823
35586
|
|
|
33824
|
-
/* es-module-lexer 1.0.
|
|
33825
|
-
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$b(E,g="@"){if(!C)return init.then((()=>parse$b(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const D=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,D,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const J=[],K=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let D;C.ip()&&(D=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),J.push({n:D,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],D=B<0?void 0:E.slice(B,g),J=D?D[0]:"";K.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?w(I):I,ln:'"'===J||"'"===J?w(D):D});}function w(A){try{return (0, eval)(A)}catch(A){}}return [J,K,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMtLAABAQICAgICAgICAgICAgICAgAAAwMDBAQAAAADAAAAAAMDBQYAAAcABgIFBAUBcAEBAQUDAQABBg8CfwFBoPIAC38AQaDyAAsHcBMGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJhaQAIAmlkAAkCaXAACgJlcwALAmVlAAwDZWxzAA0DZWxlAA4CcmkADwJyZQAQAWYAEQVwYXJzZQASC19faGVhcF9iYXNlAwEKsTcsaAEBf0EAIAA2AugJQQAoAsQJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgLsCUEAIAA2AvAJQQBBADYCyAlBAEEANgLYCUEAQQA2AtAJQQBBADYCzAlBAEEANgLgCUEAQQA2AtQJIAELnwEBA39BACgC2AkhBEEAQQAoAvAJIgU2AtgJQQAgBDYC3AlBACAFQSBqNgLwCSAEQRxqQcgJIAQbIAU2AgBBACgCvAkhBEEAKAK4CSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAG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IAEgAhsQAgsgAwtyAQR/QQAoApQKIQBBACgCmAohAQJAAkADQCAAQQJqIQIgACABTw0BAkACQCACLwEAIgNBpH9qDgIBBAALIAIhACADQXZqDgQCAQECAQsgAEEEaiEADAALC0EAIAI2ApQKECJBAA8LQQAgAjYClApB3QALSQEDf0EAIQMCQCACRQ0AAkADQCAALQAAIgQgAS0AACIFRw0BIAFBAWohASAAQQFqIQAgAkF/aiICDQAMAgsLIAQgBWshAwsgAwsL1gECAEGACAu4AQAAeABwAG8AcgB0AG0AcABvAHIAdABlAHQAYQBmAHIAbwBtAHMAcwBlAHIAdAB2AG8AeQBpAGUAZABlAGwAZQBjAG8AbgB0AGkAbgBpAG4AcwB0AGEAbgB0AHkAYgByAGUAYQByAGUAdAB1AHIAZABlAGIAdQBnAGcAZQBhAHcAYQBpAHQAaAByAHcAaABpAGwAZQBmAG8AcgBpAGYAYwBhAHQAYwBmAGkAbgBhAGwAbABlAGwAcwAAQbgJCxABAAAAAgAAAAAEAAAgOQAA","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
|
|
35587
|
+
/* es-module-lexer 1.0.5 */
|
|
35588
|
+
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$b(E,g="@"){if(!C)return init.then((()=>parse$b(E)));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const k=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let K;C.ip()&&(K=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),k.push({n:K,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),o=I[0],K=B<0?void 0:E.slice(B,g),k=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===o||"'"===o?w(I):I,ln:'"'===k||"'"===k?w(K):K});}function w(A){try{return (0, eval)(A)}catch(A){}}return [k,D,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMtLAABAQICAgICAgICAgICAgICAgIAAwMDBAQAAAADAAAAAAMDBQYAAAcABgIFBAUBcAEBAQUDAQABBg8CfwFBsPIAC38AQbDyAAsHcBMGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJhaQAIAmlkAAkCaXAACgJlcwALAmVlAAwDZWxzAA0DZWxlAA4CcmkADwJyZQAQAWYAEQVwYXJzZQASC19faGVhcF9iYXNlAwEK6TosaAEBf0EAIAA2AvgJQQAoAtQJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgL8CUEAIAA2AoAKQQBBADYC2AlBAEEANgLoCUEAQQA2AuAJQQBBADYC3AlBAEEANgLwCUEAQQA2AuQJIAELnwEBA39BACgC6AkhBEEAQQAoAoAKIgU2AugJQQAgBDYC7AlBACAFQSBqNgKACiAEQRxqQdgJIAQbIAU2AgBBACgCzAkhBEEAKALICSEGIAUgATYCACAFIAA2AgggBSACIAJBAmpBACAGIANGGyAEIANGGzYCDCAFIAM2AhQgBUEANgIQIAUgAjYCBCAFQQA2AhwgBUEAKALICSADRjoAGAtWAQF/QQAoAvAJIgRBEGpB3A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MAYQB0AGMAZgBpAG4AYQBsAGwAZQBsAHMAAEHICQsQAQAAAAIAAAAABAAAMDkAAA==","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),(A=>A.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
|
|
33826
35589
|
|
|
33827
35590
|
/**
|
|
33828
35591
|
* @param {object} exports
|
|
@@ -34011,7 +35774,7 @@ createError(
|
|
|
34011
35774
|
(pkgPath, key, target, isImport = false, base = void 0) => {
|
|
34012
35775
|
const relError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
34013
35776
|
if (key === ".") {
|
|
34014
|
-
assert$
|
|
35777
|
+
assert$2(isImport === false);
|
|
34015
35778
|
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ""}${relError ? '; targets must start with "./"' : ""}`;
|
|
34016
35779
|
}
|
|
34017
35780
|
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
|
|
@@ -34057,7 +35820,7 @@ createError(
|
|
|
34057
35820
|
createError(
|
|
34058
35821
|
"ERR_INVALID_ARG_VALUE",
|
|
34059
35822
|
(name, value, reason = "is invalid") => {
|
|
34060
|
-
let inspected = inspect(value);
|
|
35823
|
+
let inspected = inspect$1(value);
|
|
34061
35824
|
if (inspected.length > 128) {
|
|
34062
35825
|
inspected = `${inspected.slice(0, 128)}...`;
|
|
34063
35826
|
}
|
|
@@ -34158,14 +35921,14 @@ const captureLargerStackTrace = hideStackFrames(
|
|
|
34158
35921
|
function getMessage(key, args, self) {
|
|
34159
35922
|
const message = messages.get(key);
|
|
34160
35923
|
if (typeof message === "function") {
|
|
34161
|
-
assert$
|
|
35924
|
+
assert$2(
|
|
34162
35925
|
message.length <= args.length,
|
|
34163
35926
|
`Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${message.length}).`
|
|
34164
35927
|
);
|
|
34165
35928
|
return Reflect.apply(message, self, args);
|
|
34166
35929
|
}
|
|
34167
35930
|
const expectedLength = (message.match(/%[dfijoOs]/g) || []).length;
|
|
34168
|
-
assert$
|
|
35931
|
+
assert$2(
|
|
34169
35932
|
expectedLength === args.length,
|
|
34170
35933
|
`Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
|
|
34171
35934
|
);
|
|
@@ -34173,7 +35936,7 @@ function getMessage(key, args, self) {
|
|
|
34173
35936
|
return message;
|
|
34174
35937
|
}
|
|
34175
35938
|
args.unshift(message);
|
|
34176
|
-
return Reflect.apply(format$
|
|
35939
|
+
return Reflect.apply(format$3, null, args);
|
|
34177
35940
|
}
|
|
34178
35941
|
Object.freeze(["node", "import"]);
|
|
34179
35942
|
pathToFileURL$1(process.cwd());
|
|
@@ -37040,78 +38803,9 @@ function stattag (stat) {
|
|
|
37040
38803
|
|
|
37041
38804
|
var convertSourceMap = {};
|
|
37042
38805
|
|
|
37043
|
-
var safeBuffer = {exports: {}};
|
|
37044
|
-
|
|
37045
|
-
/* eslint-disable node/no-deprecated-api */
|
|
37046
|
-
|
|
37047
|
-
(function (module, exports) {
|
|
37048
|
-
var buffer = require$$0$a;
|
|
37049
|
-
var Buffer = buffer.Buffer;
|
|
37050
|
-
|
|
37051
|
-
// alternative to using Object.keys for old browsers
|
|
37052
|
-
function copyProps (src, dst) {
|
|
37053
|
-
for (var key in src) {
|
|
37054
|
-
dst[key] = src[key];
|
|
37055
|
-
}
|
|
37056
|
-
}
|
|
37057
|
-
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
37058
|
-
module.exports = buffer;
|
|
37059
|
-
} else {
|
|
37060
|
-
// Copy properties from require('buffer')
|
|
37061
|
-
copyProps(buffer, exports);
|
|
37062
|
-
exports.Buffer = SafeBuffer;
|
|
37063
|
-
}
|
|
37064
|
-
|
|
37065
|
-
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
37066
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
37067
|
-
}
|
|
37068
|
-
|
|
37069
|
-
// Copy static methods from Buffer
|
|
37070
|
-
copyProps(Buffer, SafeBuffer);
|
|
37071
|
-
|
|
37072
|
-
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
37073
|
-
if (typeof arg === 'number') {
|
|
37074
|
-
throw new TypeError('Argument must not be a number')
|
|
37075
|
-
}
|
|
37076
|
-
return Buffer(arg, encodingOrOffset, length)
|
|
37077
|
-
};
|
|
37078
|
-
|
|
37079
|
-
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
37080
|
-
if (typeof size !== 'number') {
|
|
37081
|
-
throw new TypeError('Argument must be a number')
|
|
37082
|
-
}
|
|
37083
|
-
var buf = Buffer(size);
|
|
37084
|
-
if (fill !== undefined) {
|
|
37085
|
-
if (typeof encoding === 'string') {
|
|
37086
|
-
buf.fill(fill, encoding);
|
|
37087
|
-
} else {
|
|
37088
|
-
buf.fill(fill);
|
|
37089
|
-
}
|
|
37090
|
-
} else {
|
|
37091
|
-
buf.fill(0);
|
|
37092
|
-
}
|
|
37093
|
-
return buf
|
|
37094
|
-
};
|
|
37095
|
-
|
|
37096
|
-
SafeBuffer.allocUnsafe = function (size) {
|
|
37097
|
-
if (typeof size !== 'number') {
|
|
37098
|
-
throw new TypeError('Argument must be a number')
|
|
37099
|
-
}
|
|
37100
|
-
return Buffer(size)
|
|
37101
|
-
};
|
|
37102
|
-
|
|
37103
|
-
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
37104
|
-
if (typeof size !== 'number') {
|
|
37105
|
-
throw new TypeError('Argument must be a number')
|
|
37106
|
-
}
|
|
37107
|
-
return buffer.SlowBuffer(size)
|
|
37108
|
-
};
|
|
37109
|
-
} (safeBuffer, safeBuffer.exports));
|
|
37110
|
-
|
|
37111
38806
|
(function (exports) {
|
|
37112
38807
|
var fs = require$$0__default;
|
|
37113
38808
|
var path = require$$0$4;
|
|
37114
|
-
var SafeBuffer = safeBuffer.exports;
|
|
37115
38809
|
|
|
37116
38810
|
Object.defineProperty(exports, 'commentRegex', {
|
|
37117
38811
|
get: function getCommentRegex () {
|
|
@@ -37126,9 +38820,30 @@ var safeBuffer = {exports: {}};
|
|
|
37126
38820
|
}
|
|
37127
38821
|
});
|
|
37128
38822
|
|
|
38823
|
+
var decodeBase64;
|
|
38824
|
+
if (typeof Buffer !== 'undefined') {
|
|
38825
|
+
if (typeof Buffer.from === 'function') {
|
|
38826
|
+
decodeBase64 = decodeBase64WithBufferFrom;
|
|
38827
|
+
} else {
|
|
38828
|
+
decodeBase64 = decodeBase64WithNewBuffer;
|
|
38829
|
+
}
|
|
38830
|
+
} else {
|
|
38831
|
+
decodeBase64 = decodeBase64WithAtob;
|
|
38832
|
+
}
|
|
38833
|
+
|
|
38834
|
+
function decodeBase64WithBufferFrom(base64) {
|
|
38835
|
+
return Buffer.from(base64, 'base64').toString();
|
|
38836
|
+
}
|
|
37129
38837
|
|
|
37130
|
-
function
|
|
37131
|
-
|
|
38838
|
+
function decodeBase64WithNewBuffer(base64) {
|
|
38839
|
+
if (typeof value === 'number') {
|
|
38840
|
+
throw new TypeError('The value to decode must not be of type number.');
|
|
38841
|
+
}
|
|
38842
|
+
return new Buffer(base64, 'base64').toString();
|
|
38843
|
+
}
|
|
38844
|
+
|
|
38845
|
+
function decodeBase64WithAtob(base64) {
|
|
38846
|
+
return decodeURIComponent(escape(atob(base64)));
|
|
37132
38847
|
}
|
|
37133
38848
|
|
|
37134
38849
|
function stripComment(sm) {
|
|
@@ -37166,10 +38881,33 @@ var safeBuffer = {exports: {}};
|
|
|
37166
38881
|
return JSON.stringify(this.sourcemap, null, space);
|
|
37167
38882
|
};
|
|
37168
38883
|
|
|
37169
|
-
|
|
38884
|
+
if (typeof Buffer !== 'undefined') {
|
|
38885
|
+
if (typeof Buffer.from === 'function') {
|
|
38886
|
+
Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
|
|
38887
|
+
} else {
|
|
38888
|
+
Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
|
|
38889
|
+
}
|
|
38890
|
+
} else {
|
|
38891
|
+
Converter.prototype.toBase64 = encodeBase64WithBtoa;
|
|
38892
|
+
}
|
|
38893
|
+
|
|
38894
|
+
function encodeBase64WithBufferFrom() {
|
|
37170
38895
|
var json = this.toJSON();
|
|
37171
|
-
return
|
|
37172
|
-
}
|
|
38896
|
+
return Buffer.from(json, 'utf8').toString('base64');
|
|
38897
|
+
}
|
|
38898
|
+
|
|
38899
|
+
function encodeBase64WithNewBuffer() {
|
|
38900
|
+
var json = this.toJSON();
|
|
38901
|
+
if (typeof json === 'number') {
|
|
38902
|
+
throw new TypeError('The json to encode must not be of type number.');
|
|
38903
|
+
}
|
|
38904
|
+
return new Buffer(json, 'utf8').toString('base64');
|
|
38905
|
+
}
|
|
38906
|
+
|
|
38907
|
+
function encodeBase64WithBtoa() {
|
|
38908
|
+
var json = this.toJSON();
|
|
38909
|
+
return btoa(unescape(encodeURIComponent(json)));
|
|
38910
|
+
}
|
|
37173
38911
|
|
|
37174
38912
|
Converter.prototype.toComment = function (options) {
|
|
37175
38913
|
var base64 = this.toBase64();
|
|
@@ -37247,12 +38985,12 @@ var safeBuffer = {exports: {}};
|
|
|
37247
38985
|
} (convertSourceMap));
|
|
37248
38986
|
|
|
37249
38987
|
function totalist(dir, callback, pre='') {
|
|
37250
|
-
dir = resolve$
|
|
38988
|
+
dir = resolve$5('.', dir);
|
|
37251
38989
|
let arr = readdirSync(dir);
|
|
37252
38990
|
let i=0, abs, stats;
|
|
37253
38991
|
for (; i < arr.length; i++) {
|
|
37254
38992
|
abs = join$1(dir, arr[i]);
|
|
37255
|
-
stats = statSync$
|
|
38993
|
+
stats = statSync$2(abs);
|
|
37256
38994
|
stats.isDirectory()
|
|
37257
38995
|
? totalist(abs, callback, join$1(pre, arr[i]))
|
|
37258
38996
|
: callback(join$1(pre, arr[i]), abs, stats);
|
|
@@ -37406,7 +39144,7 @@ function toHeaders(name, stats, isEtag) {
|
|
|
37406
39144
|
}
|
|
37407
39145
|
|
|
37408
39146
|
function sirv (dir, opts={}) {
|
|
37409
|
-
dir = resolve$
|
|
39147
|
+
dir = resolve$5(dir || '.');
|
|
37410
39148
|
|
|
37411
39149
|
let isNotFound = opts.onNoMatch || is404;
|
|
37412
39150
|
let setHeaders = opts.setHeaders || noop$2;
|
|
@@ -39458,7 +41196,7 @@ const lexStates = {
|
|
|
39458
41196
|
switch (c) {
|
|
39459
41197
|
case '\\':
|
|
39460
41198
|
read();
|
|
39461
|
-
buffer += escape$
|
|
41199
|
+
buffer += escape$2();
|
|
39462
41200
|
return
|
|
39463
41201
|
|
|
39464
41202
|
case '"':
|
|
@@ -39613,7 +41351,7 @@ function literal (s) {
|
|
|
39613
41351
|
}
|
|
39614
41352
|
}
|
|
39615
41353
|
|
|
39616
|
-
function escape$
|
|
41354
|
+
function escape$2 () {
|
|
39617
41355
|
const c = peek();
|
|
39618
41356
|
switch (c) {
|
|
39619
41357
|
case 'b':
|
|
@@ -40931,8 +42669,9 @@ function prepareError(err) {
|
|
|
40931
42669
|
function buildErrorMessage(err, args = [], includeStack = true) {
|
|
40932
42670
|
if (err.plugin)
|
|
40933
42671
|
args.push(` Plugin: ${picocolors.exports.magenta(err.plugin)}`);
|
|
42672
|
+
const loc = err.loc ? `:${err.loc.line}:${err.loc.column}` : '';
|
|
40934
42673
|
if (err.id)
|
|
40935
|
-
args.push(` File: ${picocolors.exports.cyan(err.id)}`);
|
|
42674
|
+
args.push(` File: ${picocolors.exports.cyan(err.id)}${loc}`);
|
|
40936
42675
|
if (err.frame)
|
|
40937
42676
|
args.push(picocolors.exports.yellow(pad$1(err.frame)));
|
|
40938
42677
|
if (includeStack && err.stack)
|
|
@@ -41016,7 +42755,7 @@ async function createPluginContainer(config, moduleGraph, watcher) {
|
|
|
41016
42755
|
// TODO: use import()
|
|
41017
42756
|
const _require = createRequire$1(import.meta.url);
|
|
41018
42757
|
// get rollup version
|
|
41019
|
-
const rollupPkgPath = resolve$
|
|
42758
|
+
const rollupPkgPath = resolve$7(_require.resolve('rollup'), '../../package.json');
|
|
41020
42759
|
const minimalContext = {
|
|
41021
42760
|
meta: {
|
|
41022
42761
|
rollupVersion: JSON.parse(fs$l.readFileSync(rollupPkgPath, 'utf-8'))
|
|
@@ -43785,6 +45524,9 @@ function handleParseError(parserError, html, filePath) {
|
|
|
43785
45524
|
// Accept duplicate attributes #9566
|
|
43786
45525
|
// The first attribute is used, browsers silently ignore duplicates
|
|
43787
45526
|
return;
|
|
45527
|
+
case 'non-void-html-element-start-tag-with-trailing-solidus':
|
|
45528
|
+
// Allow self closing on non-void elements #10439
|
|
45529
|
+
return;
|
|
43788
45530
|
}
|
|
43789
45531
|
const parseError = {
|
|
43790
45532
|
loc: filePath,
|
|
@@ -44566,6 +46308,7 @@ function cssPostPlugin(config) {
|
|
|
44566
46308
|
SPECIAL_QUERY_RE.test(id)) {
|
|
44567
46309
|
return;
|
|
44568
46310
|
}
|
|
46311
|
+
css = stripBomTag(css);
|
|
44569
46312
|
const inlined = inlineRE.test(id);
|
|
44570
46313
|
const modules = cssModulesCache.get(config).get(id);
|
|
44571
46314
|
// #6984, #7552
|
|
@@ -44727,12 +46470,11 @@ function cssPostPlugin(config) {
|
|
|
44727
46470
|
}
|
|
44728
46471
|
else if (!config.build.ssr) {
|
|
44729
46472
|
// legacy build and inline css
|
|
44730
|
-
//
|
|
44731
|
-
//
|
|
44732
|
-
//
|
|
44733
|
-
|
|
44734
|
-
|
|
44735
|
-
}
|
|
46473
|
+
// Entry chunk CSS will be collected into `chunk.viteMetadata.importedCss`
|
|
46474
|
+
// and injected later by the `'vite:build-html'` plugin into the `index.html`
|
|
46475
|
+
// so it will be duplicated. (https://github.com/vitejs/vite/issues/2062#issuecomment-782388010)
|
|
46476
|
+
// But because entry chunk can be imported by dynamic import,
|
|
46477
|
+
// we shouldn't remove the inlined CSS. (#10285)
|
|
44736
46478
|
chunkCSS = await finalizeCss(chunkCSS, true, config);
|
|
44737
46479
|
let cssString = JSON.stringify(chunkCSS);
|
|
44738
46480
|
cssString =
|
|
@@ -44924,7 +46666,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
44924
46666
|
}
|
|
44925
46667
|
const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
|
|
44926
46668
|
if (needInlineImport) {
|
|
44927
|
-
postcssPlugins.unshift((await import('./dep-
|
|
46669
|
+
postcssPlugins.unshift((await import('./dep-9deb2354.js').then(function (n) { return n.i; })).default({
|
|
44928
46670
|
async resolve(id, basedir) {
|
|
44929
46671
|
const publicFile = checkPublicFile(id, config);
|
|
44930
46672
|
if (publicFile) {
|
|
@@ -44946,7 +46688,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
44946
46688
|
logger: config.logger
|
|
44947
46689
|
}));
|
|
44948
46690
|
if (isModule) {
|
|
44949
|
-
postcssPlugins.unshift((await import('./dep-
|
|
46691
|
+
postcssPlugins.unshift((await import('./dep-06c4efef.js').then(function (n) { return n.i; })).default({
|
|
44950
46692
|
...modulesOptions,
|
|
44951
46693
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
44952
46694
|
modules = _modules;
|
|
@@ -44973,13 +46715,14 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
44973
46715
|
}
|
|
44974
46716
|
let postcssResult;
|
|
44975
46717
|
try {
|
|
46718
|
+
const source = removeDirectQuery(id);
|
|
44976
46719
|
// postcss is an unbundled dep and should be lazy imported
|
|
44977
46720
|
postcssResult = await (await import('postcss'))
|
|
44978
46721
|
.default(postcssPlugins)
|
|
44979
46722
|
.process(code, {
|
|
44980
46723
|
...postcssOptions,
|
|
44981
|
-
to:
|
|
44982
|
-
from:
|
|
46724
|
+
to: source,
|
|
46725
|
+
from: source,
|
|
44983
46726
|
...(devSourcemap
|
|
44984
46727
|
? {
|
|
44985
46728
|
map: {
|
|
@@ -53799,7 +55542,7 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
|
|
|
53799
55542
|
preserveSymlinks,
|
|
53800
55543
|
isBuild: true,
|
|
53801
55544
|
isProduction,
|
|
53802
|
-
isRequire:
|
|
55545
|
+
isRequire: true,
|
|
53803
55546
|
root
|
|
53804
55547
|
};
|
|
53805
55548
|
// Since dynamic imports can happen in parallel, we need to
|
|
@@ -54159,7 +55902,7 @@ class Limiter$1 {
|
|
|
54159
55902
|
|
|
54160
55903
|
var limiter = Limiter$1;
|
|
54161
55904
|
|
|
54162
|
-
const zlib = require$$0$
|
|
55905
|
+
const zlib = require$$0$a;
|
|
54163
55906
|
|
|
54164
55907
|
const bufferUtil = bufferUtil$1.exports;
|
|
54165
55908
|
const Limiter = limiter;
|
|
@@ -59288,7 +61031,7 @@ var URL$1 = url.URL;
|
|
|
59288
61031
|
var http$1 = require$$1$2;
|
|
59289
61032
|
var https$1 = require$$1$3;
|
|
59290
61033
|
var Writable = require$$0$7.Writable;
|
|
59291
|
-
var assert = assert$
|
|
61034
|
+
var assert = assert$2;
|
|
59292
61035
|
var debug$2 = debug_1;
|
|
59293
61036
|
|
|
59294
61037
|
// Create handlers that pass events from native requests
|
|
@@ -60523,7 +62266,7 @@ function proxyMiddleware(httpServer, options, config) {
|
|
|
60523
62266
|
// When it is ws proxy, res is net.Socket
|
|
60524
62267
|
const res = originalRes;
|
|
60525
62268
|
if ('req' in res) {
|
|
60526
|
-
config.logger.error(`${picocolors.exports.red(`http proxy error:`)}\n${err.stack}`, {
|
|
62269
|
+
config.logger.error(`${picocolors.exports.red(`http proxy error at ${originalRes.req.url}:`)}\n${err.stack}`, {
|
|
60527
62270
|
timestamp: true,
|
|
60528
62271
|
error: err
|
|
60529
62272
|
});
|
|
@@ -62193,7 +63936,7 @@ var readShebang_1 = readShebang$1;
|
|
|
62193
63936
|
|
|
62194
63937
|
const path$1 = require$$0$4;
|
|
62195
63938
|
const resolveCommand = resolveCommand_1;
|
|
62196
|
-
const escape = _escape;
|
|
63939
|
+
const escape$1 = _escape;
|
|
62197
63940
|
const readShebang = readShebang_1;
|
|
62198
63941
|
|
|
62199
63942
|
const isWin$1 = process.platform === 'win32';
|
|
@@ -62240,8 +63983,8 @@ function parseNonShell(parsed) {
|
|
|
62240
63983
|
parsed.command = path$1.normalize(parsed.command);
|
|
62241
63984
|
|
|
62242
63985
|
// Escape command & arguments
|
|
62243
|
-
parsed.command = escape.command(parsed.command);
|
|
62244
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
63986
|
+
parsed.command = escape$1.command(parsed.command);
|
|
63987
|
+
parsed.args = parsed.args.map((arg) => escape$1.argument(arg, needsDoubleEscapeMetaChars));
|
|
62245
63988
|
|
|
62246
63989
|
const shellCommand = [parsed.command].concat(parsed.args).join(' ');
|
|
62247
63990
|
|
|
@@ -62423,18 +64166,31 @@ function startBrowserProcess(browser, url) {
|
|
|
62423
64166
|
// existing tab when possible instead of creating a new one.
|
|
62424
64167
|
const shouldTryOpenChromeWithAppleScript = process.platform === 'darwin' && (browser === '' || browser === OSX_CHROME);
|
|
62425
64168
|
if (shouldTryOpenChromeWithAppleScript) {
|
|
62426
|
-
|
|
62427
|
-
|
|
62428
|
-
|
|
62429
|
-
|
|
62430
|
-
|
|
62431
|
-
|
|
62432
|
-
|
|
62433
|
-
|
|
62434
|
-
|
|
62435
|
-
|
|
62436
|
-
|
|
62437
|
-
|
|
64169
|
+
// Will use the first open browser found from list
|
|
64170
|
+
const supportedChromiumBrowsers = [
|
|
64171
|
+
'Google Chrome Canary',
|
|
64172
|
+
'Google Chrome Dev',
|
|
64173
|
+
'Google Chrome Beta',
|
|
64174
|
+
'Google Chrome',
|
|
64175
|
+
'Microsoft Edge',
|
|
64176
|
+
'Brave Browser',
|
|
64177
|
+
'Vivaldi',
|
|
64178
|
+
'Chromium'
|
|
64179
|
+
];
|
|
64180
|
+
for (const chromiumBrowser of supportedChromiumBrowsers) {
|
|
64181
|
+
try {
|
|
64182
|
+
// Try our best to reuse existing tab
|
|
64183
|
+
// on OS X Google Chrome with AppleScript
|
|
64184
|
+
execSync(`ps cax | grep "${chromiumBrowser}"`);
|
|
64185
|
+
execSync(`osascript openChrome.applescript "${encodeURI(url)}" "${chromiumBrowser}"`, {
|
|
64186
|
+
cwd: join$2(VITE_PACKAGE_DIR, 'bin'),
|
|
64187
|
+
stdio: 'ignore'
|
|
64188
|
+
});
|
|
64189
|
+
return true;
|
|
64190
|
+
}
|
|
64191
|
+
catch (err) {
|
|
64192
|
+
// Ignore errors
|
|
64193
|
+
}
|
|
62438
64194
|
}
|
|
62439
64195
|
}
|
|
62440
64196
|
// Another special case: on OS X, check if BROWSER has been set to "open".
|
|
@@ -63480,10 +65236,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
63480
65236
|
// user config may provide an alternative mode. But --mode has a higher priority
|
|
63481
65237
|
mode = inlineConfig.mode || config.mode || mode;
|
|
63482
65238
|
configEnv.mode = mode;
|
|
63483
|
-
|
|
63484
|
-
// And Plugins may also have cached that could be corrupted by being used in these extra rollup calls.
|
|
63485
|
-
// So we need to separate the worker plugin from the plugin that vite needs to run.
|
|
63486
|
-
const rawWorkerUserPlugins = (await asyncFlatten(config.worker?.plugins || [])).filter((p) => {
|
|
65239
|
+
const filterPlugin = (p) => {
|
|
63487
65240
|
if (!p) {
|
|
63488
65241
|
return false;
|
|
63489
65242
|
}
|
|
@@ -63496,22 +65249,13 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
63496
65249
|
else {
|
|
63497
65250
|
return p.apply === command;
|
|
63498
65251
|
}
|
|
63499
|
-
}
|
|
65252
|
+
};
|
|
65253
|
+
// Some plugins that aren't intended to work in the bundling of workers (doing post-processing at build time for example).
|
|
65254
|
+
// And Plugins may also have cached that could be corrupted by being used in these extra rollup calls.
|
|
65255
|
+
// So we need to separate the worker plugin from the plugin that vite needs to run.
|
|
65256
|
+
const rawWorkerUserPlugins = (await asyncFlatten(config.worker?.plugins || [])).filter(filterPlugin);
|
|
63500
65257
|
// resolve plugins
|
|
63501
|
-
const rawUserPlugins = (await asyncFlatten(config.plugins || [])).filter(
|
|
63502
|
-
if (!p) {
|
|
63503
|
-
return false;
|
|
63504
|
-
}
|
|
63505
|
-
else if (!p.apply) {
|
|
63506
|
-
return true;
|
|
63507
|
-
}
|
|
63508
|
-
else if (typeof p.apply === 'function') {
|
|
63509
|
-
return p.apply({ ...config, mode }, configEnv);
|
|
63510
|
-
}
|
|
63511
|
-
else {
|
|
63512
|
-
return p.apply === command;
|
|
63513
|
-
}
|
|
63514
|
-
});
|
|
65258
|
+
const rawUserPlugins = (await asyncFlatten(config.plugins || [])).filter(filterPlugin);
|
|
63515
65259
|
const [prePlugins, normalPlugins, postPlugins] = sortUserPlugins(rawUserPlugins);
|
|
63516
65260
|
// run config hooks
|
|
63517
65261
|
const userPlugins = [...prePlugins, ...normalPlugins, ...postPlugins];
|
|
@@ -63885,6 +65629,7 @@ async function bundleConfigFile(fileName, isESM) {
|
|
|
63885
65629
|
platform: 'node',
|
|
63886
65630
|
bundle: true,
|
|
63887
65631
|
format: isESM ? 'esm' : 'cjs',
|
|
65632
|
+
mainFields: ['main'],
|
|
63888
65633
|
sourcemap: 'inline',
|
|
63889
65634
|
metafile: true,
|
|
63890
65635
|
define: {
|
|
@@ -63896,36 +65641,27 @@ async function bundleConfigFile(fileName, isESM) {
|
|
|
63896
65641
|
{
|
|
63897
65642
|
name: 'externalize-deps',
|
|
63898
65643
|
setup(build) {
|
|
63899
|
-
|
|
63900
|
-
|
|
63901
|
-
|
|
63902
|
-
|
|
63903
|
-
|
|
63904
|
-
|
|
63905
|
-
|
|
63906
|
-
|
|
63907
|
-
|
|
63908
|
-
|
|
63909
|
-
|
|
63910
|
-
|
|
63911
|
-
|
|
63912
|
-
|
|
63913
|
-
|
|
63914
|
-
|
|
63915
|
-
|
|
63916
|
-
|
|
63917
|
-
|
|
63918
|
-
return { external: true };
|
|
63919
|
-
}
|
|
63920
|
-
let idFsPath = tryNodeResolve(id, importer, options, false)?.id;
|
|
63921
|
-
if (idFsPath && (isESM || kind === 'dynamic-import')) {
|
|
63922
|
-
idFsPath = pathToFileURL(idFsPath).href;
|
|
63923
|
-
}
|
|
63924
|
-
return {
|
|
63925
|
-
path: idFsPath,
|
|
63926
|
-
external: true
|
|
63927
|
-
};
|
|
65644
|
+
// externalize bare imports
|
|
65645
|
+
build.onResolve({ filter: /^[^.].*/ }, async ({ path: id, importer, kind }) => {
|
|
65646
|
+
if (kind === 'entry-point' || path$n.isAbsolute(id)) {
|
|
65647
|
+
return;
|
|
65648
|
+
}
|
|
65649
|
+
// partial deno support as `npm:` does not work with esbuild
|
|
65650
|
+
if (id.startsWith('npm:')) {
|
|
65651
|
+
return { external: true };
|
|
65652
|
+
}
|
|
65653
|
+
const resolveWithRequire = kind === 'require-call' ||
|
|
65654
|
+
kind === 'require-resolve' ||
|
|
65655
|
+
(kind === 'import-statement' && !isESM);
|
|
65656
|
+
let resolved;
|
|
65657
|
+
if (resolveWithRequire) {
|
|
65658
|
+
const require = createRequire$1(importer);
|
|
65659
|
+
resolved = require.resolve(id);
|
|
65660
|
+
}
|
|
65661
|
+
else {
|
|
65662
|
+
resolved = await resolve$4(id, pathToFileURL(importer).href);
|
|
63928
65663
|
}
|
|
65664
|
+
return { path: resolved, external: true };
|
|
63929
65665
|
});
|
|
63930
65666
|
}
|
|
63931
65667
|
},
|