nitro-nightly 3.0.1-20260106-182834-5019d347 → 3.0.1-20260106-205209-b085a480
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 +24899 -0
- package/dist/_build/rolldown.mjs +5 -18
- package/dist/_build/rollup.mjs +5 -52
- package/dist/_build/vite.build.mjs +2 -21
- package/dist/{_dev.mjs → _chunks/dev.mjs} +4 -7
- package/dist/{_nitro.mjs → _chunks/nitro.mjs} +16 -195
- package/dist/_chunks/nitro2.mjs +101 -0
- package/dist/_chunks/utils.mjs +278 -0
- package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +32 -4
- package/dist/_libs/@jridgewell/gen-mapping.mjs +304 -2
- package/dist/_libs/@jridgewell/remapping.mjs +1 -2
- package/dist/_libs/@rollup/plugin-commonjs.mjs +75 -31
- package/dist/_libs/@rollup/plugin-inject.mjs +1 -3
- package/dist/_libs/@rollup/plugin-json.mjs +1 -1
- package/dist/_libs/@rollup/plugin-node-resolve.mjs +1111 -7
- package/dist/_libs/c12.mjs +597 -41
- package/dist/_libs/chokidar.mjs +235 -2
- package/dist/_libs/confbox.mjs +454 -1476
- package/dist/_libs/estree-walker.mjs +1 -144
- package/dist/_libs/giget.mjs +2235 -1377
- package/dist/_libs/httpxy.mjs +1 -1
- package/dist/_libs/unimport.mjs +1547 -1772
- package/dist/_presets.mjs +3 -9
- package/dist/builder.mjs +7 -12
- package/dist/cli/_chunks/build.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +3 -5
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/vite.mjs +14 -1128
- package/package.json +2 -2
- package/dist/_build/shared.mjs +0 -60
- package/dist/_build/shared2.mjs +0 -40
- package/dist/_build/shared3.mjs +0 -68
- package/dist/_libs/@jridgewell/resolve-uri.mjs +0 -166
- package/dist/_libs/@jridgewell/sourcemap-codec.mjs +0 -167
- package/dist/_libs/@jridgewell/trace-mapping.mjs +0 -141
- package/dist/_libs/@rolldown/pluginutils.mjs +0 -31
- package/dist/_libs/@rollup/plugin-replace.mjs +0 -104
- package/dist/_libs/@rollup/pluginutils.mjs +0 -241
- package/dist/_libs/acorn.mjs +0 -5034
- package/dist/_libs/commondir.mjs +0 -22
- package/dist/_libs/deepmerge.mjs +0 -86
- package/dist/_libs/dot-prop.mjs +0 -138
- package/dist/_libs/dotenv.mjs +0 -345
- package/dist/_libs/duplexer.mjs +0 -71
- package/dist/_libs/etag.mjs +0 -80
- package/dist/_libs/exsolve.mjs +0 -1007
- package/dist/_libs/fdir.mjs +0 -514
- package/dist/_libs/function-bind.mjs +0 -63
- package/dist/_libs/gzip-size.mjs +0 -21
- package/dist/_libs/hasown.mjs +0 -14
- package/dist/_libs/is-core-module.mjs +0 -220
- package/dist/_libs/is-module.mjs +0 -13
- package/dist/_libs/is-reference.mjs +0 -33
- package/dist/_libs/js-tokens.mjs +0 -382
- package/dist/_libs/knitwork.mjs +0 -124
- package/dist/_libs/local-pkg.mjs +0 -125
- package/dist/_libs/magic-string.mjs +0 -939
- package/dist/_libs/mime.mjs +0 -1391
- package/dist/_libs/mlly.mjs +0 -1415
- package/dist/_libs/node-fetch-native.mjs +0 -7
- package/dist/_libs/nypm.mjs +0 -239
- package/dist/_libs/path-parse.mjs +0 -47
- package/dist/_libs/pathe.mjs +0 -202
- package/dist/_libs/perfect-debounce.mjs +0 -89
- package/dist/_libs/picomatch.mjs +0 -1673
- package/dist/_libs/pkg-types.mjs +0 -197
- package/dist/_libs/pretty-bytes.mjs +0 -116
- package/dist/_libs/quansync.mjs +0 -90
- package/dist/_libs/rc9.mjs +0 -136
- package/dist/_libs/readdirp.mjs +0 -237
- package/dist/_libs/resolve.mjs +0 -689
- package/dist/_libs/std-env.mjs +0 -158
- package/dist/_libs/strip-literal.mjs +0 -51
- package/dist/_libs/tinyexec.mjs +0 -627
- package/dist/_libs/tinyglobby.mjs +0 -292
- package/dist/_libs/unplugin-utils.mjs +0 -61
- package/dist/_libs/unplugin.mjs +0 -1225
- package/dist/_libs/untyped.mjs +0 -271
- package/dist/_libs/unwasm.mjs +0 -5895
- package/dist/_libs/webpack-virtual-modules.mjs +0 -272
- package/dist/_nitro2.mjs +0 -303
- /package/dist/{_rolldown.mjs → _common.mjs} +0 -0
|
@@ -1,13 +1,57 @@
|
|
|
1
|
-
import { i as __toESM } from "../../
|
|
2
|
-
import {
|
|
3
|
-
import { t as MagicString } from "../magic-string.mjs";
|
|
4
|
-
import { n as walk } from "../estree-walker.mjs";
|
|
5
|
-
import { a as makeLegalIdentifier, i as extractAssignedNames, n as createFilter, t as attachScopes } from "./pluginutils.mjs";
|
|
6
|
-
import { t as require_commondir } from "../commondir.mjs";
|
|
7
|
-
import { t as require_is_reference } from "../is-reference.mjs";
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "../../_common.mjs";
|
|
2
|
+
import { K as MagicString, at as Builder, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes, u as extractAssignedNames } from "../../_build/common.mjs";
|
|
8
3
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
9
4
|
import { basename, dirname, extname, join, relative, resolve, sep } from "path";
|
|
10
5
|
|
|
6
|
+
//#region node_modules/.pnpm/commondir@1.0.1/node_modules/commondir/index.js
|
|
7
|
+
var require_commondir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8
|
+
var path$1 = __require("path");
|
|
9
|
+
module.exports = function(basedir, relfiles) {
|
|
10
|
+
if (relfiles) var files = relfiles.map(function(r) {
|
|
11
|
+
return path$1.resolve(basedir, r);
|
|
12
|
+
});
|
|
13
|
+
else var files = basedir;
|
|
14
|
+
var res = files.slice(1).reduce(function(ps, file) {
|
|
15
|
+
if (!file.match(/^([A-Za-z]:)?\/|\\/)) throw new Error("relative path without a basedir");
|
|
16
|
+
var xs = file.split(/\/+|\\+/);
|
|
17
|
+
for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++);
|
|
18
|
+
return ps.slice(0, i);
|
|
19
|
+
}, files[0].split(/\/+|\\+/));
|
|
20
|
+
return res.length > 1 ? res.join("/") : "/";
|
|
21
|
+
};
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region node_modules/.pnpm/is-reference@1.2.1/node_modules/is-reference/dist/is-reference.js
|
|
26
|
+
var require_is_reference = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
27
|
+
(function(global, factory) {
|
|
28
|
+
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, global.isReference = factory());
|
|
29
|
+
})(exports, (function() {
|
|
30
|
+
"use strict";
|
|
31
|
+
function isReference$1(node, parent) {
|
|
32
|
+
if (node.type === "MemberExpression") return !node.computed && isReference$1(node.object, node);
|
|
33
|
+
if (node.type === "Identifier") {
|
|
34
|
+
if (!parent) return true;
|
|
35
|
+
switch (parent.type) {
|
|
36
|
+
case "MemberExpression": return parent.computed || node === parent.object;
|
|
37
|
+
case "MethodDefinition": return parent.computed;
|
|
38
|
+
case "FieldDefinition": return parent.computed || node === parent.value;
|
|
39
|
+
case "Property": return parent.computed || node === parent.value;
|
|
40
|
+
case "ExportSpecifier":
|
|
41
|
+
case "ImportSpecifier": return node === parent.local;
|
|
42
|
+
case "LabeledStatement":
|
|
43
|
+
case "BreakStatement":
|
|
44
|
+
case "ContinueStatement": return false;
|
|
45
|
+
default: return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return isReference$1;
|
|
51
|
+
}));
|
|
52
|
+
}));
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
11
55
|
//#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.55.1/node_modules/@rollup/plugin-commonjs/dist/es/index.js
|
|
12
56
|
var import_commondir = /* @__PURE__ */ __toESM(require_commondir(), 1);
|
|
13
57
|
var import_is_reference = /* @__PURE__ */ __toESM(require_is_reference(), 1);
|
|
@@ -74,10 +118,10 @@ function getName(id) {
|
|
|
74
118
|
if (name !== "index") return name;
|
|
75
119
|
return makeLegalIdentifier(basename(dirname(id)));
|
|
76
120
|
}
|
|
77
|
-
function normalizePathSlashes(path$
|
|
78
|
-
return path$
|
|
121
|
+
function normalizePathSlashes(path$2) {
|
|
122
|
+
return path$2.replace(/\\/g, "/");
|
|
79
123
|
}
|
|
80
|
-
const getVirtualPathForDynamicRequirePath = (path$
|
|
124
|
+
const getVirtualPathForDynamicRequirePath = (path$2, commonDir) => `/${normalizePathSlashes(relative(commonDir, path$2))}`;
|
|
81
125
|
function capitalize(name) {
|
|
82
126
|
return name[0].toUpperCase() + name.slice(1);
|
|
83
127
|
}
|
|
@@ -113,9 +157,9 @@ function getPackageEntryPoint(dirPath) {
|
|
|
113
157
|
} catch (ignored) {}
|
|
114
158
|
return entryPoint;
|
|
115
159
|
}
|
|
116
|
-
function isDirectory(path$
|
|
160
|
+
function isDirectory(path$2) {
|
|
117
161
|
try {
|
|
118
|
-
if (statSync(path$
|
|
162
|
+
if (statSync(path$2).isDirectory()) return true;
|
|
119
163
|
} catch (ignored) {}
|
|
120
164
|
return false;
|
|
121
165
|
}
|
|
@@ -125,12 +169,12 @@ function getDynamicRequireModules(patterns, dynamicRequireRoot) {
|
|
|
125
169
|
for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
|
|
126
170
|
const isNegated = pattern.startsWith("!");
|
|
127
171
|
const modifyMap = (targetPath, resolvedPath) => isNegated ? dynamicRequireModules.delete(targetPath) : dynamicRequireModules.set(targetPath, resolvedPath);
|
|
128
|
-
for (const path$
|
|
129
|
-
const resolvedPath = resolve(path$
|
|
172
|
+
for (const path$2 of new Builder().withBasePath().withDirs().glob(isNegated ? pattern.substr(1) : pattern).crawl(relative(".", dynamicRequireRoot)).sync().sort((a, b) => a.localeCompare(b, "en"))) {
|
|
173
|
+
const resolvedPath = resolve(path$2);
|
|
130
174
|
const requirePath = normalizePathSlashes(resolvedPath);
|
|
131
175
|
if (isDirectory(resolvedPath)) {
|
|
132
176
|
dirNames.add(resolvedPath);
|
|
133
|
-
const modulePath = resolve(join(resolvedPath, getPackageEntryPoint(path$
|
|
177
|
+
const modulePath = resolve(join(resolvedPath, getPackageEntryPoint(path$2)));
|
|
134
178
|
modifyMap(requirePath, modulePath);
|
|
135
179
|
modifyMap(normalizePathSlashes(modulePath), modulePath);
|
|
136
180
|
} else {
|
|
@@ -649,23 +693,23 @@ function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRan
|
|
|
649
693
|
magicString.trim().indent(" ", { exclude: indentExclusionRanges }).prepend(`(function (${args.join(", ")}) {\n`).append(` \n} (${passedArgs.join(", ")}));`);
|
|
650
694
|
}
|
|
651
695
|
function rewriteExportsAndGetExportsBlock(magicString, moduleName, exportsName, exportedExportsName, wrapped, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsAssignmentsByName, topLevelAssignments, defineCompiledEsmExpressions, deconflictedExportNames, code, HELPERS_NAME, exportMode, defaultIsModuleExports, usesRequireWrapper, requireName) {
|
|
652
|
-
const exports = [];
|
|
696
|
+
const exports$1 = [];
|
|
653
697
|
const exportDeclarations = [];
|
|
654
|
-
if (usesRequireWrapper) getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions);
|
|
655
|
-
else if (exportMode === "replace") getExportsForReplacedModuleExports(magicString, exports, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME);
|
|
698
|
+
if (usesRequireWrapper) getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions);
|
|
699
|
+
else if (exportMode === "replace") getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME);
|
|
656
700
|
else {
|
|
657
701
|
if (exportMode === "module") {
|
|
658
702
|
exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`);
|
|
659
|
-
exports.push(`${exportedExportsName} as __moduleExports`);
|
|
660
|
-
} else exports.push(`${exportsName} as __moduleExports`);
|
|
703
|
+
exports$1.push(`${exportedExportsName} as __moduleExports`);
|
|
704
|
+
} else exports$1.push(`${exportsName} as __moduleExports`);
|
|
661
705
|
if (wrapped) exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME));
|
|
662
|
-
else getExports(magicString, exports, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode);
|
|
706
|
+
else getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode);
|
|
663
707
|
}
|
|
664
|
-
if (exports.length) exportDeclarations.push(`export { ${exports.join(", ")} }`);
|
|
708
|
+
if (exports$1.length) exportDeclarations.push(`export { ${exports$1.join(", ")} }`);
|
|
665
709
|
return `\n\n${exportDeclarations.join(";\n")};`;
|
|
666
710
|
}
|
|
667
|
-
function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions) {
|
|
668
|
-
exports.push(`${requireName} as __require`);
|
|
711
|
+
function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions) {
|
|
712
|
+
exports$1.push(`${requireName} as __require`);
|
|
669
713
|
if (wrapped) return;
|
|
670
714
|
if (exportMode === "replace") rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName);
|
|
671
715
|
else {
|
|
@@ -674,16 +718,16 @@ function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exp
|
|
|
674
718
|
replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName);
|
|
675
719
|
}
|
|
676
720
|
}
|
|
677
|
-
function getExportsForReplacedModuleExports(magicString, exports, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME) {
|
|
721
|
+
function getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME) {
|
|
678
722
|
for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, exportsName);
|
|
679
723
|
magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, "var ");
|
|
680
|
-
exports.push(`${exportsName} as __moduleExports`);
|
|
724
|
+
exports$1.push(`${exportsName} as __moduleExports`);
|
|
681
725
|
exportDeclarations.push(getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME));
|
|
682
726
|
}
|
|
683
727
|
function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) {
|
|
684
728
|
return `export default ${defaultIsModuleExports === true ? exportedExportsName : defaultIsModuleExports === false ? `${exportedExportsName}.default` : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`}`;
|
|
685
729
|
}
|
|
686
|
-
function getExports(magicString, exports, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode) {
|
|
730
|
+
function getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode) {
|
|
687
731
|
let deconflictedDefaultExportName;
|
|
688
732
|
for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, `${moduleName}.exports`);
|
|
689
733
|
for (const [exportName, { nodes }] of exportsAssignmentsByName) {
|
|
@@ -699,11 +743,11 @@ function getExports(magicString, exports, exportDeclarations, moduleExportsAssig
|
|
|
699
743
|
}
|
|
700
744
|
if (needsDeclaration) magicString.prepend(`var ${deconflicted};\n`);
|
|
701
745
|
if (exportName === "default") deconflictedDefaultExportName = deconflicted;
|
|
702
|
-
else exports.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`);
|
|
746
|
+
else exports$1.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`);
|
|
703
747
|
}
|
|
704
748
|
const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName);
|
|
705
|
-
if (defaultIsModuleExports === false || defaultIsModuleExports === "auto" && isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
|
|
706
|
-
else if (defaultIsModuleExports === true || !isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports.push(`${exportedExportsName} as default`);
|
|
749
|
+
if (defaultIsModuleExports === false || defaultIsModuleExports === "auto" && isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
|
|
750
|
+
else if (defaultIsModuleExports === true || !isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${exportedExportsName} as default`);
|
|
707
751
|
else exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME));
|
|
708
752
|
}
|
|
709
753
|
function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) {
|
|
@@ -767,7 +811,7 @@ function getRequireHandlers() {
|
|
|
767
811
|
processRequireExpressions(imports, await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => {
|
|
768
812
|
return {
|
|
769
813
|
source,
|
|
770
|
-
isConditional: requiresBySource[source].every((require) => require.isInsideConditional)
|
|
814
|
+
isConditional: requiresBySource[source].every((require$1) => require$1.isInsideConditional)
|
|
771
815
|
};
|
|
772
816
|
})), requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString);
|
|
773
817
|
return imports.length ? `${imports.join(";\n")};\n\n` : "";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as walk } from "../estree-walker.mjs";
|
|
3
|
-
import { a as makeLegalIdentifier, n as createFilter, t as attachScopes } from "./pluginutils.mjs";
|
|
1
|
+
import { K as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes } from "../../_build/common.mjs";
|
|
4
2
|
import { sep } from "path";
|
|
5
3
|
|
|
6
4
|
//#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.55.1/node_modules/@rollup/plugin-inject/dist/es/index.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as createFilter, l as dataToEsm } from "../../_build/common.mjs";
|
|
2
2
|
|
|
3
3
|
//#region node_modules/.pnpm/@rollup+plugin-json@6.1.0_rollup@4.55.1/node_modules/@rollup/plugin-json/dist/es/index.js
|
|
4
4
|
function json(options) {
|