nitro-nightly 3.0.1-20260125-215009-8882bc9e → 3.0.1-20260128-210932-ae83c97e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_build/common.mjs +2084 -3212
- package/dist/_build/rolldown.mjs +12 -25
- package/dist/_build/rollup.mjs +11 -27
- package/dist/_build/vite.build.mjs +7 -11
- package/dist/_chunks/dev.mjs +20 -42
- package/dist/_chunks/nitro.mjs +13 -92
- package/dist/_chunks/nitro2.mjs +1 -5
- package/dist/_chunks/utils.mjs +10 -24
- package/dist/_common.mjs +12 -24
- package/dist/_libs/citty.mjs +1 -13
- package/dist/_libs/commondir+is-reference.mjs +12 -22
- package/dist/_libs/compatx.mjs +1 -4
- package/dist/_libs/confbox.mjs +363 -376
- package/dist/_libs/escape-string-regexp.mjs +1 -4
- package/dist/_libs/estree-walker.mjs +4 -92
- package/dist/_libs/hasown+resolve+deepmerge.mjs +144 -230
- package/dist/_libs/httpxy.mjs +5 -21
- package/dist/_libs/klona.mjs +1 -4
- package/dist/_libs/nypm+giget+tinyexec.mjs +874 -926
- package/dist/_libs/plugin-alias.mjs +1 -5
- package/dist/_libs/plugin-inject.mjs +1 -5
- package/dist/_libs/plugin-json.mjs +1 -5
- package/dist/_libs/pluginutils+plugin-commonjs.d.mts +2 -2
- package/dist/_libs/pluginutils.mjs +1 -31
- package/dist/_libs/rc9+c12+dotenv.mjs +43 -83
- package/dist/_libs/readdirp+chokidar.mjs +184 -360
- package/dist/_libs/remapping.mjs +1 -5
- package/dist/_libs/resolve-uri+gen-mapping.mjs +12 -48
- package/dist/_libs/rou3.mjs +1 -32
- package/dist/_libs/tsconfck.mjs +21 -334
- package/dist/_libs/ultrahtml.mjs +3 -16
- package/dist/_libs/unimport+unplugin.mjs +15 -75
- package/dist/_presets.mjs +260 -445
- package/dist/builder.mjs +1 -2
- package/dist/cli/_chunks/build.mjs +1 -5
- package/dist/cli/_chunks/common.mjs +1 -4
- package/dist/cli/_chunks/dev.mjs +1 -5
- package/dist/cli/_chunks/list.mjs +1 -5
- package/dist/cli/_chunks/prepare.mjs +1 -5
- package/dist/cli/_chunks/run.mjs +1 -5
- package/dist/cli/_chunks/task.mjs +1 -5
- package/dist/cli/index.mjs +1 -5
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.mjs +1 -2
- package/dist/vite.mjs +44 -63
- package/package.json +22 -22
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "../_common.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
//#region node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.55.3/node_modules/@rollup/plugin-alias/dist/index.js
|
|
5
3
|
var dist_exports = /* @__PURE__ */ __exportAll({ default: () => alias });
|
|
6
4
|
function matches(pattern, importee) {
|
|
7
5
|
if (pattern instanceof RegExp) return pattern.test(importee);
|
|
@@ -61,6 +59,4 @@ function alias(options = {}) {
|
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
export { dist_exports as n, alias as t };
|
|
62
|
+
export { dist_exports as n, alias as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "../_common.mjs";
|
|
2
2
|
import { S as MagicString, c as walk, i as createFilter, r as attachScopes, s as makeLegalIdentifier } from "../_build/common.mjs";
|
|
3
3
|
import { sep } from "path";
|
|
4
|
-
|
|
5
|
-
//#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.55.3/node_modules/@rollup/plugin-inject/dist/es/index.js
|
|
6
4
|
var es_exports = /* @__PURE__ */ __exportAll({ default: () => inject });
|
|
7
5
|
var escape = function(str) {
|
|
8
6
|
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
@@ -130,6 +128,4 @@ function inject(options) {
|
|
|
130
128
|
}
|
|
131
129
|
};
|
|
132
130
|
}
|
|
133
|
-
|
|
134
|
-
//#endregion
|
|
135
|
-
export { inject as n, es_exports as t };
|
|
131
|
+
export { inject as n, es_exports as t };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { a as dataToEsm, i as createFilter } from "../_build/common.mjs";
|
|
2
|
-
|
|
3
|
-
//#region node_modules/.pnpm/@rollup+plugin-json@6.1.0_rollup@4.55.3/node_modules/@rollup/plugin-json/dist/es/index.js
|
|
4
2
|
function json(options) {
|
|
5
3
|
if (options === void 0) options = {};
|
|
6
4
|
var filter = createFilter(options.include, options.exclude);
|
|
@@ -31,6 +29,4 @@ function json(options) {
|
|
|
31
29
|
}
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { json as t };
|
|
32
|
+
export { json as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Plugin } from "rollup";
|
|
2
2
|
|
|
3
|
-
//#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.
|
|
3
|
+
//#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.57.0/node_modules/@rollup/pluginutils/types/index.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A valid `picomatch` glob pattern, or array of patterns.
|
|
6
6
|
*/
|
|
7
7
|
type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.
|
|
9
|
+
//#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.57.0/node_modules/@rollup/plugin-commonjs/types/index.d.ts
|
|
10
10
|
type RequireReturnsDefaultOption = boolean | 'auto' | 'preferred' | 'namespace';
|
|
11
11
|
type DefaultIsModuleExportsOption = boolean | 'auto';
|
|
12
12
|
interface RollupCommonJSOptions {
|
|
@@ -7,28 +7,6 @@ import assert from "node:assert";
|
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { isCSSRequest, normalizePath } from "vite";
|
|
9
9
|
import assert$1 from "node:assert/strict";
|
|
10
|
-
|
|
11
|
-
//#region node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.55/node_modules/@rolldown/pluginutils/dist/simple-filters.js
|
|
12
|
-
/**
|
|
13
|
-
* Constructs a RegExp that matches the exact string specified.
|
|
14
|
-
*
|
|
15
|
-
* This is useful for plugin hook filters.
|
|
16
|
-
*
|
|
17
|
-
* @param str the string to match.
|
|
18
|
-
* @param flags flags for the RegExp.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* import { exactRegex } from '@rolldown/pluginutils';
|
|
23
|
-
* const plugin = {
|
|
24
|
-
* name: 'plugin',
|
|
25
|
-
* resolveId: {
|
|
26
|
-
* filter: { id: exactRegex('foo') },
|
|
27
|
-
* handler(id) {} // will only be called for `foo`
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
10
|
function exactRegex(str, flags) {
|
|
33
11
|
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
|
34
12
|
}
|
|
@@ -36,9 +14,6 @@ const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
|
|
36
14
|
function escapeRegex(str) {
|
|
37
15
|
return str.replace(escapeRegexRE, "\\$&");
|
|
38
16
|
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.8_@types+node@25.0.9_esbuild@0.27_577572ae8fc6296e77b8a4205393d7c0/node_modules/@hiogawa/vite-plugin-fullstack/dist/plugin-B4MlD0Bd.js
|
|
42
17
|
function parseIdQuery(id) {
|
|
43
18
|
if (!id.includes("?")) return {
|
|
44
19
|
filename: id,
|
|
@@ -621,9 +596,6 @@ function assetsURL(url, config) {
|
|
|
621
596
|
function assetsURLDev(url, config) {
|
|
622
597
|
return config.base + url;
|
|
623
598
|
}
|
|
624
|
-
|
|
625
|
-
//#endregion
|
|
626
|
-
//#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.8_@types+node@25.0.9_esbuild@0.27_577572ae8fc6296e77b8a4205393d7c0/node_modules/@hiogawa/vite-plugin-fullstack/dist/runtime.js
|
|
627
599
|
var runtime_exports = /* @__PURE__ */ __exportAll({ mergeAssets: () => mergeAssets });
|
|
628
600
|
function mergeAssets(...args) {
|
|
629
601
|
const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
|
|
@@ -647,6 +619,4 @@ function mergeAssets(...args) {
|
|
|
647
619
|
});
|
|
648
620
|
}
|
|
649
621
|
}
|
|
650
|
-
|
|
651
|
-
//#endregion
|
|
652
|
-
export { assetsPlugin as n, runtime_exports as t };
|
|
622
|
+
export { assetsPlugin as n, runtime_exports as t };
|
|
@@ -8,8 +8,6 @@ import { resolve } from "node:path";
|
|
|
8
8
|
import { createJiti } from "jiti";
|
|
9
9
|
import destr from "destr";
|
|
10
10
|
import { defu } from "defu";
|
|
11
|
-
|
|
12
|
-
//#region node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.json
|
|
13
11
|
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
14
12
|
module.exports = {
|
|
15
13
|
"name": "dotenv",
|
|
@@ -70,9 +68,6 @@ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
70
68
|
"browser": { "fs": false }
|
|
71
69
|
};
|
|
72
70
|
}));
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js
|
|
76
71
|
var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
77
72
|
const fs$1 = __require("fs");
|
|
78
73
|
const path$1 = __require("path");
|
|
@@ -247,11 +242,11 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
247
242
|
}
|
|
248
243
|
let lastError;
|
|
249
244
|
const parsedAll = {};
|
|
250
|
-
for (const path
|
|
251
|
-
const parsed = DotenvModule.parse(fs$1.readFileSync(path
|
|
245
|
+
for (const path of optionPaths) try {
|
|
246
|
+
const parsed = DotenvModule.parse(fs$1.readFileSync(path, { encoding }));
|
|
252
247
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
253
248
|
} catch (e) {
|
|
254
|
-
if (debug) _debug(`Failed to load ${path
|
|
249
|
+
if (debug) _debug(`Failed to load ${path} ${e.message}`);
|
|
255
250
|
lastError = e;
|
|
256
251
|
}
|
|
257
252
|
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
@@ -261,8 +256,8 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
261
256
|
const keysCount = Object.keys(populated).length;
|
|
262
257
|
const shortPaths = [];
|
|
263
258
|
for (const filePath of optionPaths) try {
|
|
264
|
-
const relative
|
|
265
|
-
shortPaths.push(relative
|
|
259
|
+
const relative = path$1.relative(process.cwd(), filePath);
|
|
260
|
+
shortPaths.push(relative);
|
|
266
261
|
} catch (e) {
|
|
267
262
|
if (debug) _debug(`Failed to load ${filePath} ${e.message}`);
|
|
268
263
|
lastError = e;
|
|
@@ -349,9 +344,6 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
349
344
|
module.exports.populate = DotenvModule.populate;
|
|
350
345
|
module.exports = DotenvModule;
|
|
351
346
|
}));
|
|
352
|
-
|
|
353
|
-
//#endregion
|
|
354
|
-
//#region node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs
|
|
355
347
|
function isBuffer(obj) {
|
|
356
348
|
return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
|
|
357
349
|
}
|
|
@@ -360,7 +352,7 @@ function keyIdentity(key) {
|
|
|
360
352
|
}
|
|
361
353
|
function flatten(target, opts) {
|
|
362
354
|
opts = opts || {};
|
|
363
|
-
const delimiter
|
|
355
|
+
const delimiter = opts.delimiter || ".";
|
|
364
356
|
const maxDepth = opts.maxDepth;
|
|
365
357
|
const transformKey = opts.transformKey || keyIdentity;
|
|
366
358
|
const output = {};
|
|
@@ -369,10 +361,10 @@ function flatten(target, opts) {
|
|
|
369
361
|
Object.keys(object).forEach(function(key) {
|
|
370
362
|
const value = object[key];
|
|
371
363
|
const isarray = opts.safe && Array.isArray(value);
|
|
372
|
-
const type
|
|
364
|
+
const type = Object.prototype.toString.call(value);
|
|
373
365
|
const isbuffer = isBuffer(value);
|
|
374
|
-
const isobject = type
|
|
375
|
-
const newKey = prev ? prev + delimiter
|
|
366
|
+
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
367
|
+
const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
|
|
376
368
|
if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
|
|
377
369
|
output[newKey] = value;
|
|
378
370
|
});
|
|
@@ -382,7 +374,7 @@ function flatten(target, opts) {
|
|
|
382
374
|
}
|
|
383
375
|
function unflatten(target, opts) {
|
|
384
376
|
opts = opts || {};
|
|
385
|
-
const delimiter
|
|
377
|
+
const delimiter = opts.delimiter || ".";
|
|
386
378
|
const overwrite = opts.overwrite || false;
|
|
387
379
|
const transformKey = opts.transformKey || keyIdentity;
|
|
388
380
|
const result = {};
|
|
@@ -391,36 +383,36 @@ function unflatten(target, opts) {
|
|
|
391
383
|
const parsedKey = Number(key);
|
|
392
384
|
return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
|
|
393
385
|
}
|
|
394
|
-
function addKeys(keyPrefix, recipient, target
|
|
395
|
-
return Object.keys(target
|
|
396
|
-
result
|
|
397
|
-
return result
|
|
386
|
+
function addKeys(keyPrefix, recipient, target) {
|
|
387
|
+
return Object.keys(target).reduce(function(result, key) {
|
|
388
|
+
result[keyPrefix + delimiter + key] = target[key];
|
|
389
|
+
return result;
|
|
398
390
|
}, recipient);
|
|
399
391
|
}
|
|
400
392
|
function isEmpty(val) {
|
|
401
|
-
const type
|
|
402
|
-
const isArray = type
|
|
403
|
-
const isObject = type
|
|
393
|
+
const type = Object.prototype.toString.call(val);
|
|
394
|
+
const isArray = type === "[object Array]";
|
|
395
|
+
const isObject = type === "[object Object]";
|
|
404
396
|
if (!val) return true;
|
|
405
397
|
else if (isArray) return !val.length;
|
|
406
398
|
else if (isObject) return !Object.keys(val).length;
|
|
407
399
|
}
|
|
408
|
-
target = Object.keys(target).reduce(function(result
|
|
409
|
-
const type
|
|
410
|
-
if (!(type
|
|
411
|
-
result
|
|
412
|
-
return result
|
|
413
|
-
} else return addKeys(key, result
|
|
400
|
+
target = Object.keys(target).reduce(function(result, key) {
|
|
401
|
+
const type = Object.prototype.toString.call(target[key]);
|
|
402
|
+
if (!(type === "[object Object]" || type === "[object Array]") || isEmpty(target[key])) {
|
|
403
|
+
result[key] = target[key];
|
|
404
|
+
return result;
|
|
405
|
+
} else return addKeys(key, result, flatten(target[key], opts));
|
|
414
406
|
}, {});
|
|
415
407
|
Object.keys(target).forEach(function(key) {
|
|
416
|
-
const split = key.split(delimiter
|
|
408
|
+
const split = key.split(delimiter).map(transformKey);
|
|
417
409
|
let key1 = getkey(split.shift());
|
|
418
410
|
let key2 = getkey(split[0]);
|
|
419
411
|
let recipient = result;
|
|
420
412
|
while (key2 !== void 0) {
|
|
421
413
|
if (key1 === "__proto__") return;
|
|
422
|
-
const type
|
|
423
|
-
const isobject = type
|
|
414
|
+
const type = Object.prototype.toString.call(recipient[key1]);
|
|
415
|
+
const isobject = type === "[object Object]" || type === "[object Array]";
|
|
424
416
|
if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") return;
|
|
425
417
|
if (overwrite && !isobject || !overwrite && recipient[key1] == null) recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
|
|
426
418
|
recipient = recipient[key1];
|
|
@@ -465,9 +457,9 @@ function parse(contents, options = {}) {
|
|
|
465
457
|
}
|
|
466
458
|
return options.flat ? config : unflatten(config, { overwrite: true });
|
|
467
459
|
}
|
|
468
|
-
function parseFile(path
|
|
469
|
-
if (!existsSync(path
|
|
470
|
-
return parse(readFileSync(path
|
|
460
|
+
function parseFile(path, options) {
|
|
461
|
+
if (!existsSync(path)) return {};
|
|
462
|
+
return parse(readFileSync(path, "utf8"), options);
|
|
471
463
|
}
|
|
472
464
|
function read(options) {
|
|
473
465
|
options = withDefaults(options);
|
|
@@ -478,28 +470,7 @@ function readUser(options) {
|
|
|
478
470
|
options.dir = process.env.XDG_CONFIG_HOME || homedir();
|
|
479
471
|
return read(options);
|
|
480
472
|
}
|
|
481
|
-
|
|
482
|
-
//#endregion
|
|
483
|
-
//#region node_modules/.pnpm/perfect-debounce@2.0.0/node_modules/perfect-debounce/dist/index.mjs
|
|
484
473
|
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
485
|
-
/**
|
|
486
|
-
Debounce functions
|
|
487
|
-
@param fn - Promise-returning/async function to debounce.
|
|
488
|
-
@param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
|
|
489
|
-
@returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
|
|
490
|
-
@example
|
|
491
|
-
```
|
|
492
|
-
import { debounce } from 'perfect-debounce';
|
|
493
|
-
const expensiveCall = async input => input;
|
|
494
|
-
const debouncedFn = debounce(expensiveCall, 200);
|
|
495
|
-
for (const number of [1, 2, 3]) {
|
|
496
|
-
console.log(await debouncedFn(number));
|
|
497
|
-
}
|
|
498
|
-
//=> 1
|
|
499
|
-
//=> 2
|
|
500
|
-
//=> 3
|
|
501
|
-
```
|
|
502
|
-
*/
|
|
503
474
|
function debounce(fn, wait = 25, options = {}) {
|
|
504
475
|
options = {
|
|
505
476
|
...DEBOUNCE_DEFAULTS,
|
|
@@ -526,7 +497,7 @@ function debounce(fn, wait = 25, options = {}) {
|
|
|
526
497
|
const debounced = function(...args) {
|
|
527
498
|
if (options.trailing) trailingArgs = args;
|
|
528
499
|
if (currentPromise) return currentPromise;
|
|
529
|
-
return new Promise((resolve
|
|
500
|
+
return new Promise((resolve) => {
|
|
530
501
|
const shouldCallNow = !timeout && options.leading;
|
|
531
502
|
clearTimeout(timeout);
|
|
532
503
|
timeout = setTimeout(() => {
|
|
@@ -538,8 +509,8 @@ function debounce(fn, wait = 25, options = {}) {
|
|
|
538
509
|
}, wait);
|
|
539
510
|
if (shouldCallNow) {
|
|
540
511
|
leadingValue = applyFn(this, args);
|
|
541
|
-
resolve
|
|
542
|
-
} else resolveList.push(resolve
|
|
512
|
+
resolve(leadingValue);
|
|
513
|
+
} else resolveList.push(resolve);
|
|
543
514
|
});
|
|
544
515
|
};
|
|
545
516
|
const _clearTimeout = (timer) => {
|
|
@@ -566,9 +537,6 @@ function debounce(fn, wait = 25, options = {}) {
|
|
|
566
537
|
async function _applyPromised(fn, _this, args) {
|
|
567
538
|
return await fn.apply(_this, args);
|
|
568
539
|
}
|
|
569
|
-
|
|
570
|
-
//#endregion
|
|
571
|
-
//#region node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs
|
|
572
540
|
var dist_exports = /* @__PURE__ */ __exportAll({
|
|
573
541
|
SUPPORTED_EXTENSIONS: () => SUPPORTED_EXTENSIONS,
|
|
574
542
|
loadConfig: () => loadConfig,
|
|
@@ -577,11 +545,6 @@ var dist_exports = /* @__PURE__ */ __exportAll({
|
|
|
577
545
|
watchConfig: () => watchConfig
|
|
578
546
|
});
|
|
579
547
|
var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
580
|
-
/**
|
|
581
|
-
* Load and interpolate environment variables into `process.env`.
|
|
582
|
-
* If you need more control (or access to the values), consider using `loadDotenv` instead
|
|
583
|
-
*
|
|
584
|
-
*/
|
|
585
548
|
async function setupDotenv(options) {
|
|
586
549
|
const targetEnvironment = options.env ?? process.env;
|
|
587
550
|
const environment = await loadDotenv({
|
|
@@ -597,7 +560,6 @@ async function setupDotenv(options) {
|
|
|
597
560
|
}
|
|
598
561
|
return environment;
|
|
599
562
|
}
|
|
600
|
-
/** Load environment variables into an object. */
|
|
601
563
|
async function loadDotenv(options) {
|
|
602
564
|
const environment = Object.create(null);
|
|
603
565
|
const cwd = resolve$1(options.cwd || ".");
|
|
@@ -618,13 +580,13 @@ async function loadDotenv(options) {
|
|
|
618
580
|
if (options.interpolate) interpolate(environment);
|
|
619
581
|
return environment;
|
|
620
582
|
}
|
|
621
|
-
function interpolate(target, source = {}, parse
|
|
583
|
+
function interpolate(target, source = {}, parse = (v) => v) {
|
|
622
584
|
function getValue(key) {
|
|
623
585
|
return source[key] === void 0 ? target[key] : source[key];
|
|
624
586
|
}
|
|
625
587
|
function interpolate$1(value, parents = []) {
|
|
626
588
|
if (typeof value !== "string") return value;
|
|
627
|
-
return parse
|
|
589
|
+
return parse((value.match(/(.?\${?(?:[\w:]+)?}?)/g) || []).reduce((newValue, match) => {
|
|
628
590
|
const parts = /(.?)\${?([\w:]+)?}?/g.exec(match) || [];
|
|
629
591
|
const prefix = parts[1];
|
|
630
592
|
let value$1, replacePart;
|
|
@@ -924,24 +886,24 @@ async function watchConfig(options) {
|
|
|
924
886
|
options.rcFile && resolve$1(l.cwd, typeof options.rcFile === "string" ? options.rcFile : `.${configName}rc`),
|
|
925
887
|
options.packageJson && resolve$1(l.cwd, "package.json")
|
|
926
888
|
]).filter(Boolean))];
|
|
927
|
-
const watch
|
|
889
|
+
const watch = await import("./readdirp+chokidar.mjs").then((n) => n.t).then((r) => r.watch || r.default || r);
|
|
928
890
|
const { diff } = await import("ohash/utils");
|
|
929
|
-
const _fswatcher = watch
|
|
891
|
+
const _fswatcher = watch(watchingFiles, {
|
|
930
892
|
ignoreInitial: true,
|
|
931
893
|
...options.chokidarOptions
|
|
932
894
|
});
|
|
933
|
-
const onChange = async (event, path
|
|
934
|
-
const type
|
|
935
|
-
if (!type
|
|
895
|
+
const onChange = async (event, path) => {
|
|
896
|
+
const type = eventMap[event];
|
|
897
|
+
if (!type) return;
|
|
936
898
|
if (options.onWatch) await options.onWatch({
|
|
937
|
-
type
|
|
938
|
-
path
|
|
899
|
+
type,
|
|
900
|
+
path
|
|
939
901
|
});
|
|
940
902
|
const oldConfig = config;
|
|
941
903
|
try {
|
|
942
904
|
config = await loadConfig(options);
|
|
943
905
|
} catch (error) {
|
|
944
|
-
console.warn(`Failed to load config ${path
|
|
906
|
+
console.warn(`Failed to load config ${path}\n${error}`);
|
|
945
907
|
return;
|
|
946
908
|
}
|
|
947
909
|
const changeCtx = {
|
|
@@ -967,6 +929,4 @@ async function watchConfig(options) {
|
|
|
967
929
|
return config[prop];
|
|
968
930
|
} });
|
|
969
931
|
}
|
|
970
|
-
|
|
971
|
-
//#endregion
|
|
972
|
-
export { debounce as i, loadConfig as n, watchConfig as r, dist_exports as t };
|
|
932
|
+
export { debounce as i, loadConfig as n, watchConfig as r, dist_exports as t };
|