nitro-nightly 3.0.1-20260120-133205-cbfce96c → 3.0.1-20260120-133849-ca1a9dee
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 +2 -2
- package/dist/_build/rolldown.mjs +2 -2
- package/dist/_build/rollup.mjs +7 -7
- package/dist/_chunks/dev.mjs +2 -2
- package/dist/_chunks/nitro.mjs +2 -2
- package/dist/_libs/citty.mjs +140 -110
- package/dist/_libs/{@rollup/plugin-commonjs.mjs → commondir+is-reference.mjs} +2 -2
- package/dist/_libs/compatx.d.mts +1 -1
- package/dist/_libs/{@rollup/plugin-node-resolve.mjs → hasown+resolve+deepmerge.mjs} +2 -2
- package/dist/_libs/{giget.mjs → nypm+giget+tinyexec.mjs} +68 -15
- package/dist/_libs/{@rollup/plugin-inject.mjs → plugin-inject.mjs} +1 -1
- package/dist/_libs/{@rollup/plugin-json.mjs → plugin-json.mjs} +1 -1
- package/dist/_libs/{@hiogawa/vite-plugin-fullstack.mjs → pluginutils.mjs} +2 -2
- package/dist/_libs/{c12.mjs → rc9+c12+dotenv.mjs} +2 -2
- package/dist/_libs/{@jridgewell/remapping.mjs → remapping.mjs} +1 -1
- package/dist/_libs/{@jridgewell/gen-mapping.mjs → resolve-uri+gen-mapping.mjs} +1 -1
- package/dist/_libs/{unimport.mjs → unimport+unplugin.mjs} +1 -1
- package/dist/builder.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +1 -1
- package/dist/types/index.d.mts +14 -14
- package/dist/vite.mjs +6 -6
- package/package.json +4 -4
- /package/dist/_libs/{c12.d.mts → c12+giget+readdirp+chokidar.d.mts} +0 -0
- /package/dist/_libs/{@rollup/plugin-alias.mjs → plugin-alias.mjs} +0 -0
- /package/dist/_libs/{@rollup/plugin-commonjs.d.mts → pluginutils+plugin-commonjs.d.mts} +0 -0
- /package/dist/_libs/{chokidar.mjs → readdirp+chokidar.mjs} +0 -0
- /package/dist/_libs/{unimport.d.mts → unplugin+unimport.d.mts} +0 -0
package/dist/_build/common.mjs
CHANGED
|
@@ -15899,7 +15899,7 @@ function parseVirtualImportsRegex(strippedCode, importMap, virtualImports) {
|
|
|
15899
15899
|
};
|
|
15900
15900
|
}
|
|
15901
15901
|
async function detectImports(code, ctx, options) {
|
|
15902
|
-
if (options?.parser === "acorn") return import("../_libs/unimport.mjs").then((n) => n.n).then((r$3) => r$3.detectImportsAcorn(code, ctx, options));
|
|
15902
|
+
if (options?.parser === "acorn") return import("../_libs/unimport+unplugin.mjs").then((n) => n.n).then((r$3) => r$3.detectImportsAcorn(code, ctx, options));
|
|
15903
15903
|
return detectImportsRegex(code, ctx, options);
|
|
15904
15904
|
}
|
|
15905
15905
|
const FileExtensionLookup = [
|
|
@@ -24872,7 +24872,7 @@ async function baseBuildPlugins(nitro, base) {
|
|
|
24872
24872
|
nitro.vfs = virtualPlugin.api.modules;
|
|
24873
24873
|
plugins$1.push(virtualPlugin, virtualDeps());
|
|
24874
24874
|
if (nitro.options.imports) {
|
|
24875
|
-
const unimportPlugin = await import("../_libs/unimport.mjs").then((n) => n.t);
|
|
24875
|
+
const unimportPlugin = await import("../_libs/unimport+unplugin.mjs").then((n) => n.t);
|
|
24876
24876
|
plugins$1.push(unimportPlugin.default.rollup(nitro.options.imports));
|
|
24877
24877
|
}
|
|
24878
24878
|
if (nitro.options.wasm !== false) plugins$1.push(unwasm(nitro.options.wasm || {}));
|
package/dist/_build/rolldown.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../_common.mjs";
|
|
2
2
|
import { _ as writeTypes, a as libChunkName, at as join, h as writeBuildInfo, i as getChunkName, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE, st as relative } from "./common.mjs";
|
|
3
|
-
import { i as debounce } from "../_libs/c12.mjs";
|
|
3
|
+
import { i as debounce } from "../_libs/rc9+c12+dotenv.mjs";
|
|
4
4
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
5
5
|
import { n as scanHandlers } from "../_chunks/nitro2.mjs";
|
|
6
|
-
import { n as watch$1 } from "../_libs/chokidar.mjs";
|
|
6
|
+
import { n as watch$1 } from "../_libs/readdirp+chokidar.mjs";
|
|
7
7
|
import { t as generateFSTree } from "../_chunks/utils.mjs";
|
|
8
8
|
import { builtinModules } from "node:module";
|
|
9
9
|
import { watch } from "node:fs";
|
package/dist/_build/rollup.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "../_common.mjs";
|
|
2
2
|
import { _ as writeTypes, a as libChunkName, at as join, h as writeBuildInfo, i as getChunkName, it as isAbsolute, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE, st as relative, t as oxc } from "./common.mjs";
|
|
3
|
-
import { i as debounce } from "../_libs/c12.mjs";
|
|
3
|
+
import { i as debounce } from "../_libs/rc9+c12+dotenv.mjs";
|
|
4
4
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
5
5
|
import { n as scanHandlers } from "../_chunks/nitro2.mjs";
|
|
6
|
-
import { n as watch$1 } from "../_libs/chokidar.mjs";
|
|
7
|
-
import { t as alias } from "../_libs
|
|
8
|
-
import { t as inject } from "../_libs
|
|
6
|
+
import { n as watch$1 } from "../_libs/readdirp+chokidar.mjs";
|
|
7
|
+
import { t as alias } from "../_libs/plugin-alias.mjs";
|
|
8
|
+
import { t as inject } from "../_libs/plugin-inject.mjs";
|
|
9
9
|
import { t as generateFSTree } from "../_chunks/utils.mjs";
|
|
10
|
-
import { t as commonjs } from "../_libs
|
|
11
|
-
import { t as json } from "../_libs
|
|
12
|
-
import { t as nodeResolve } from "../_libs
|
|
10
|
+
import { t as commonjs } from "../_libs/commondir+is-reference.mjs";
|
|
11
|
+
import { t as json } from "../_libs/plugin-json.mjs";
|
|
12
|
+
import { t as nodeResolve } from "../_libs/hasown+resolve+deepmerge.mjs";
|
|
13
13
|
import { watch } from "node:fs";
|
|
14
14
|
import { defu } from "defu";
|
|
15
15
|
|
package/dist/_chunks/dev.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B as T, V as a, at as join$1, ct as resolve$1, g as writeDevBuildInfo, j as src_default, rt as extname$1 } from "../_build/common.mjs";
|
|
2
|
-
import { i as debounce } from "../_libs/c12.mjs";
|
|
2
|
+
import { i as debounce } from "../_libs/rc9+c12+dotenv.mjs";
|
|
3
3
|
import { t as createProxyServer } from "../_libs/httpxy.mjs";
|
|
4
|
-
import { n as watch$1 } from "../_libs/chokidar.mjs";
|
|
4
|
+
import { n as watch$1 } from "../_libs/readdirp+chokidar.mjs";
|
|
5
5
|
import consola$1 from "consola";
|
|
6
6
|
import { createReadStream, existsSync } from "node:fs";
|
|
7
7
|
import { readFile, rm, stat as stat$1 } from "node:fs/promises";
|
package/dist/_chunks/nitro.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as resolveModulePath, A as compressPublicAssets, H as d, I as prettyPath, L as resolveNitroPath, M as build, R as writeFile$1, V as a, at as join, ct as resolve, et as resolveModuleURL, j as src_default, k as scanUnprefixedPublicAssets, p as runParallel, q as findWorkspaceDir, st as relative } from "../_build/common.mjs";
|
|
2
|
-
import { n as loadConfig, r as watchConfig } from "../_libs/c12.mjs";
|
|
2
|
+
import { n as loadConfig, r as watchConfig } from "../_libs/rc9+c12+dotenv.mjs";
|
|
3
3
|
import { n as resolveCompatibilityDates, r as resolveCompatibilityDatesFromEnv } from "../_libs/compatx.mjs";
|
|
4
4
|
import { t as klona } from "../_libs/klona.mjs";
|
|
5
5
|
import { t as escapeStringRegexp } from "../_libs/escape-string-regexp.mjs";
|
|
@@ -567,7 +567,7 @@ function isPkgInstalled(pkg, root) {
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
async function installPkg(pkg, root) {
|
|
570
|
-
const { addDevDependency } = await import("../_libs/giget.mjs").then((n) => n.n);
|
|
570
|
+
const { addDevDependency } = await import("../_libs/nypm+giget+tinyexec.mjs").then((n) => n.n);
|
|
571
571
|
return addDevDependency(pkg, { cwd: root });
|
|
572
572
|
}
|
|
573
573
|
|
package/dist/_libs/citty.mjs
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { colors } from "consola/utils";
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
3
2
|
|
|
4
|
-
//#region node_modules/.pnpm/citty@0.
|
|
5
|
-
function toArray(val) {
|
|
6
|
-
if (Array.isArray(val)) return val;
|
|
7
|
-
return val === void 0 ? [] : [val];
|
|
8
|
-
}
|
|
9
|
-
function formatLineColumns(lines, linePrefix = "") {
|
|
10
|
-
const maxLengh = [];
|
|
11
|
-
for (const line of lines) for (const [i, element] of line.entries()) maxLengh[i] = Math.max(maxLengh[i] || 0, element.length);
|
|
12
|
-
return lines.map((l) => l.map((c, i) => linePrefix + c[i === 0 ? "padStart" : "padEnd"](maxLengh[i])).join(" ")).join("\n");
|
|
13
|
-
}
|
|
14
|
-
function resolveValue(input) {
|
|
15
|
-
return typeof input === "function" ? input() : input;
|
|
16
|
-
}
|
|
17
|
-
var CLIError = class extends Error {
|
|
18
|
-
constructor(message, code) {
|
|
19
|
-
super(message);
|
|
20
|
-
this.code = code;
|
|
21
|
-
this.name = "CLIError";
|
|
22
|
-
}
|
|
23
|
-
};
|
|
3
|
+
//#region node_modules/.pnpm/citty@0.2.0/node_modules/citty/dist/_chunks/libs/scule.mjs
|
|
24
4
|
const NUMBER_CHAR_RE = /\d/;
|
|
25
5
|
const STR_SPLITTERS = [
|
|
26
6
|
"-",
|
|
@@ -85,101 +65,136 @@ function camelCase(str, opts) {
|
|
|
85
65
|
function kebabCase(str, joiner) {
|
|
86
66
|
return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? "-") : "";
|
|
87
67
|
}
|
|
88
|
-
|
|
89
|
-
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region node_modules/.pnpm/citty@0.2.0/node_modules/citty/dist/index.mjs
|
|
71
|
+
function toArray(val) {
|
|
72
|
+
if (Array.isArray(val)) return val;
|
|
73
|
+
return val === void 0 ? [] : [val];
|
|
90
74
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
out[key] = old == void 0 ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
|
75
|
+
function formatLineColumns(lines, linePrefix = "") {
|
|
76
|
+
const maxLength = [];
|
|
77
|
+
for (const line of lines) for (const [i, element] of line.entries()) maxLength[i] = Math.max(maxLength[i] || 0, element.length);
|
|
78
|
+
return lines.map((l) => l.map((c, i) => linePrefix + c[i === 0 ? "padStart" : "padEnd"](maxLength[i])).join(" ")).join("\n");
|
|
96
79
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
let idx = 0;
|
|
107
|
-
const len = args.length;
|
|
108
|
-
const alibi = opts.alias !== void 0;
|
|
109
|
-
const strict = opts.unknown !== void 0;
|
|
110
|
-
const defaults = opts.default !== void 0;
|
|
111
|
-
opts.alias = opts.alias || {};
|
|
112
|
-
opts.string = toArr(opts.string);
|
|
113
|
-
opts.boolean = toArr(opts.boolean);
|
|
114
|
-
if (alibi) for (k in opts.alias) {
|
|
115
|
-
arr = opts.alias[k] = toArr(opts.alias[k]);
|
|
116
|
-
for (i = 0; i < arr.length; i++) (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
|
117
|
-
}
|
|
118
|
-
for (i = opts.boolean.length; i-- > 0;) {
|
|
119
|
-
arr = opts.alias[opts.boolean[i]] || [];
|
|
120
|
-
for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
|
121
|
-
}
|
|
122
|
-
for (i = opts.string.length; i-- > 0;) {
|
|
123
|
-
arr = opts.alias[opts.string[i]] || [];
|
|
124
|
-
for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
|
|
80
|
+
function resolveValue(input) {
|
|
81
|
+
return typeof input === "function" ? input() : input;
|
|
82
|
+
}
|
|
83
|
+
var CLIError = class extends Error {
|
|
84
|
+
code;
|
|
85
|
+
constructor(message, code) {
|
|
86
|
+
super(message);
|
|
87
|
+
this.name = "CLIError";
|
|
88
|
+
this.code = code;
|
|
125
89
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
90
|
+
};
|
|
91
|
+
function parseRawArgs(args = [], opts = {}) {
|
|
92
|
+
const booleans = new Set(opts.boolean || []);
|
|
93
|
+
const strings = new Set(opts.string || []);
|
|
94
|
+
const aliasMap = opts.alias || {};
|
|
95
|
+
const defaults = opts.default || {};
|
|
96
|
+
const aliasToMain = /* @__PURE__ */ new Map();
|
|
97
|
+
const mainToAliases = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const [key, value] of Object.entries(aliasMap)) {
|
|
99
|
+
const targets = value;
|
|
100
|
+
for (const target of targets) {
|
|
101
|
+
aliasToMain.set(key, target);
|
|
102
|
+
if (!mainToAliases.has(target)) mainToAliases.set(target, []);
|
|
103
|
+
mainToAliases.get(target).push(key);
|
|
104
|
+
aliasToMain.set(target, key);
|
|
105
|
+
if (!mainToAliases.has(key)) mainToAliases.set(key, []);
|
|
106
|
+
mainToAliases.get(key).push(target);
|
|
132
107
|
}
|
|
133
108
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
109
|
+
const options = {};
|
|
110
|
+
function getType(name) {
|
|
111
|
+
if (booleans.has(name)) return "boolean";
|
|
112
|
+
const aliases = mainToAliases.get(name) || [];
|
|
113
|
+
for (const alias of aliases) if (booleans.has(alias)) return "boolean";
|
|
114
|
+
return "string";
|
|
115
|
+
}
|
|
116
|
+
const allOptions = new Set([
|
|
117
|
+
...booleans,
|
|
118
|
+
...strings,
|
|
119
|
+
...Object.keys(aliasMap),
|
|
120
|
+
...Object.values(aliasMap).flat(),
|
|
121
|
+
...Object.keys(defaults)
|
|
122
|
+
]);
|
|
123
|
+
for (const name of allOptions) if (!options[name]) options[name] = {
|
|
124
|
+
type: getType(name),
|
|
125
|
+
default: defaults[name]
|
|
126
|
+
};
|
|
127
|
+
for (const [alias, main] of aliasToMain.entries()) if (alias.length === 1 && options[main] && !options[main].short) options[main].short = alias;
|
|
128
|
+
const processedArgs = [];
|
|
129
|
+
const negatedFlags = {};
|
|
130
|
+
for (let i = 0; i < args.length; i++) {
|
|
131
|
+
const arg = args[i];
|
|
137
132
|
if (arg === "--") {
|
|
138
|
-
|
|
133
|
+
processedArgs.push(...args.slice(i));
|
|
139
134
|
break;
|
|
140
135
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
|
|
146
|
-
out[name] = false;
|
|
147
|
-
} else {
|
|
148
|
-
for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
|
|
149
|
-
name = arg.substring(j, idx);
|
|
150
|
-
val = arg.slice(Math.max(0, ++idx)) || i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i];
|
|
151
|
-
arr = j === 2 ? [name] : name;
|
|
152
|
-
for (idx = 0; idx < arr.length; idx++) {
|
|
153
|
-
name = arr[idx];
|
|
154
|
-
if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
|
|
155
|
-
toVal(out, name, idx + 1 < arr.length || val, opts);
|
|
156
|
-
}
|
|
136
|
+
if (arg.startsWith("--no-")) {
|
|
137
|
+
const flagName = arg.slice(5);
|
|
138
|
+
negatedFlags[flagName] = true;
|
|
139
|
+
continue;
|
|
157
140
|
}
|
|
141
|
+
processedArgs.push(arg);
|
|
158
142
|
}
|
|
159
|
-
|
|
160
|
-
|
|
143
|
+
let parsed;
|
|
144
|
+
try {
|
|
145
|
+
parsed = parseArgs({
|
|
146
|
+
args: processedArgs,
|
|
147
|
+
options: Object.keys(options).length > 0 ? options : void 0,
|
|
148
|
+
allowPositionals: true,
|
|
149
|
+
strict: false
|
|
150
|
+
});
|
|
151
|
+
} catch {
|
|
152
|
+
parsed = {
|
|
153
|
+
values: {},
|
|
154
|
+
positionals: processedArgs
|
|
155
|
+
};
|
|
161
156
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
const out = { _: [] };
|
|
158
|
+
out._ = parsed.positionals;
|
|
159
|
+
for (const [key, value] of Object.entries(parsed.values)) out[key] = value;
|
|
160
|
+
for (const [name] of Object.entries(negatedFlags)) out[name] = false;
|
|
161
|
+
for (const [alias, main] of aliasToMain.entries()) {
|
|
162
|
+
if (out[alias] !== void 0 && out[main] === void 0) out[main] = out[alias];
|
|
163
|
+
if (out[main] !== void 0 && out[alias] === void 0) out[alias] = out[main];
|
|
165
164
|
}
|
|
166
165
|
return out;
|
|
167
166
|
}
|
|
168
|
-
|
|
167
|
+
const noColor = /* @__PURE__ */ (() => {
|
|
168
|
+
const env = globalThis.process?.env ?? {};
|
|
169
|
+
return env.NO_COLOR === "1" || env.TERM === "dumb" || env.TEST || env.CI;
|
|
170
|
+
})();
|
|
171
|
+
const _c = (c, r = 39) => (t) => noColor ? t : `\u001B[${c}m${t}\u001B[${r}m`;
|
|
172
|
+
const bold = /* @__PURE__ */ _c(1, 22);
|
|
173
|
+
const cyan = /* @__PURE__ */ _c(36);
|
|
174
|
+
const gray = /* @__PURE__ */ _c(90);
|
|
175
|
+
const underline = /* @__PURE__ */ _c(4, 24);
|
|
176
|
+
function parseArgs$1(rawArgs, argsDef) {
|
|
169
177
|
const parseOptions = {
|
|
170
178
|
boolean: [],
|
|
171
179
|
string: [],
|
|
172
|
-
mixed: [],
|
|
173
180
|
alias: {},
|
|
174
181
|
default: {}
|
|
175
182
|
};
|
|
176
183
|
const args = resolveArgs(argsDef);
|
|
177
184
|
for (const arg of args) {
|
|
178
185
|
if (arg.type === "positional") continue;
|
|
179
|
-
if (arg.type === "string") parseOptions.string.push(arg.name);
|
|
186
|
+
if (arg.type === "string" || arg.type === "enum") parseOptions.string.push(arg.name);
|
|
180
187
|
else if (arg.type === "boolean") parseOptions.boolean.push(arg.name);
|
|
181
188
|
if (arg.default !== void 0) parseOptions.default[arg.name] = arg.default;
|
|
182
189
|
if (arg.alias) parseOptions.alias[arg.name] = arg.alias;
|
|
190
|
+
const camelName = camelCase(arg.name);
|
|
191
|
+
const kebabName = kebabCase(arg.name);
|
|
192
|
+
if (camelName !== arg.name || kebabName !== arg.name) {
|
|
193
|
+
const existingAliases = toArray(parseOptions.alias[arg.name] || []);
|
|
194
|
+
if (camelName !== arg.name && !existingAliases.includes(camelName)) existingAliases.push(camelName);
|
|
195
|
+
if (kebabName !== arg.name && !existingAliases.includes(kebabName)) existingAliases.push(kebabName);
|
|
196
|
+
if (existingAliases.length > 0) parseOptions.alias[arg.name] = existingAliases;
|
|
197
|
+
}
|
|
183
198
|
}
|
|
184
199
|
const parsed = parseRawArgs(rawArgs, parseOptions);
|
|
185
200
|
const [ ...positionalArguments] = parsed._;
|
|
@@ -191,6 +206,10 @@ function parseArgs(rawArgs, argsDef) {
|
|
|
191
206
|
if (nextPositionalArgument !== void 0) parsedArgsProxy[arg.name] = nextPositionalArgument;
|
|
192
207
|
else if (arg.default === void 0 && arg.required !== false) throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, "EARG");
|
|
193
208
|
else parsedArgsProxy[arg.name] = arg.default;
|
|
209
|
+
} else if (arg.type === "enum") {
|
|
210
|
+
const argument = parsedArgsProxy[arg.name];
|
|
211
|
+
const options = arg.options || [];
|
|
212
|
+
if (argument !== void 0 && options.length > 0 && !options.includes(argument)) throw new CLIError(`Invalid value for argument: ${cyan(`--${arg.name}`)} (${cyan(argument)}). Expected one of: ${options.map((o) => cyan(o)).join(", ")}.`, "EARG");
|
|
194
213
|
} else if (arg.required && parsedArgsProxy[arg.name] === void 0) throw new CLIError(`Missing required argument: --${arg.name}`, "EARG");
|
|
195
214
|
return parsedArgsProxy;
|
|
196
215
|
}
|
|
@@ -208,7 +227,7 @@ function defineCommand(def) {
|
|
|
208
227
|
}
|
|
209
228
|
async function runCommand(cmd, opts) {
|
|
210
229
|
const cmdArgs = await resolveValue(cmd.args || {});
|
|
211
|
-
const parsedArgs = parseArgs(opts.rawArgs, cmdArgs);
|
|
230
|
+
const parsedArgs = parseArgs$1(opts.rawArgs, cmdArgs);
|
|
212
231
|
const context = {
|
|
213
232
|
rawArgs: opts.rawArgs,
|
|
214
233
|
args: parsedArgs,
|
|
@@ -223,7 +242,7 @@ async function runCommand(cmd, opts) {
|
|
|
223
242
|
const subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith("-"));
|
|
224
243
|
const subCommandName = opts.rawArgs[subCommandArgIndex];
|
|
225
244
|
if (subCommandName) {
|
|
226
|
-
if (!subCommands[subCommandName]) throw new CLIError(`Unknown command
|
|
245
|
+
if (!subCommands[subCommandName]) throw new CLIError(`Unknown command ${cyan(subCommandName)}`, "E_UNKNOWN_COMMAND");
|
|
227
246
|
const subCommand = await resolveValue(subCommands[subCommandName]);
|
|
228
247
|
if (subCommand) await runCommand(subCommand, { rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) });
|
|
229
248
|
} else if (!cmd.run) throw new CLIError(`No command specified.`, "E_NO_COMMAND");
|
|
@@ -246,11 +265,12 @@ async function resolveSubCommand(cmd, rawArgs, parent) {
|
|
|
246
265
|
}
|
|
247
266
|
async function showUsage(cmd, parent) {
|
|
248
267
|
try {
|
|
249
|
-
|
|
268
|
+
console.log(await renderUsage(cmd, parent) + "\n");
|
|
250
269
|
} catch (error) {
|
|
251
|
-
|
|
270
|
+
console.error(error);
|
|
252
271
|
}
|
|
253
272
|
}
|
|
273
|
+
const negativePrefixRe = /^no[-A-Z]/;
|
|
254
274
|
async function renderUsage(cmd, parent) {
|
|
255
275
|
const cmdMeta = await resolveValue(cmd.meta || {});
|
|
256
276
|
const cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));
|
|
@@ -265,15 +285,24 @@ async function renderUsage(cmd, parent) {
|
|
|
265
285
|
const isRequired = arg.required !== false && arg.default === void 0;
|
|
266
286
|
const defaultHint = arg.default ? `="${arg.default}"` : "";
|
|
267
287
|
posLines.push([
|
|
268
|
-
|
|
288
|
+
cyan(name + defaultHint),
|
|
269
289
|
arg.description || "",
|
|
270
290
|
arg.valueHint ? `<${arg.valueHint}>` : ""
|
|
271
291
|
]);
|
|
272
292
|
usageLine.push(isRequired ? `<${name}>` : `[${name}]`);
|
|
273
293
|
} else {
|
|
274
294
|
const isRequired = arg.required === true && arg.default === void 0;
|
|
275
|
-
const argStr =
|
|
276
|
-
argLines.push([
|
|
295
|
+
const argStr = [...(arg.alias || []).map((a) => `-${a}`), `--${arg.name}`].join(", ") + (arg.type === "string" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `"${arg.default || ""}"`}` : "") + (arg.type === "enum" && arg.options ? `=<${arg.options.join("|")}>` : "");
|
|
296
|
+
argLines.push([cyan(argStr + (isRequired ? " (required)" : "")), arg.description || ""]);
|
|
297
|
+
/**
|
|
298
|
+
* print negative boolean arg variant usage when
|
|
299
|
+
* - enabled by default or has `negativeDescription`
|
|
300
|
+
* - not prefixed with `no-` or `no[A-Z]`
|
|
301
|
+
*/
|
|
302
|
+
if (arg.type === "boolean" && (arg.default === true || arg.negativeDescription) && !negativePrefixRe.test(arg.name)) {
|
|
303
|
+
const negativeArgStr = [...(arg.alias || []).map((a) => `--no-${a}`), `--no-${arg.name}`].join(", ");
|
|
304
|
+
argLines.push([cyan(negativeArgStr + (isRequired ? " (required)" : "")), arg.negativeDescription || ""]);
|
|
305
|
+
}
|
|
277
306
|
if (isRequired) usageLine.push(argStr);
|
|
278
307
|
}
|
|
279
308
|
if (cmd.subCommands) {
|
|
@@ -281,30 +310,31 @@ async function renderUsage(cmd, parent) {
|
|
|
281
310
|
const subCommands = await resolveValue(cmd.subCommands);
|
|
282
311
|
for (const [name, sub] of Object.entries(subCommands)) {
|
|
283
312
|
const meta = await resolveValue((await resolveValue(sub))?.meta);
|
|
284
|
-
|
|
313
|
+
if (meta?.hidden) continue;
|
|
314
|
+
commandsLines.push([cyan(name), meta?.description || ""]);
|
|
285
315
|
commandNames.push(name);
|
|
286
316
|
}
|
|
287
317
|
usageLine.push(commandNames.join("|"));
|
|
288
318
|
}
|
|
289
319
|
const usageLines = [];
|
|
290
320
|
const version = cmdMeta.version || parentMeta.version;
|
|
291
|
-
usageLines.push(
|
|
321
|
+
usageLines.push(gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : "")})`), "");
|
|
292
322
|
const hasOptions = argLines.length > 0 || posLines.length > 0;
|
|
293
|
-
usageLines.push(`${
|
|
323
|
+
usageLines.push(`${underline(bold("USAGE"))} ${cyan(`${commandName}${hasOptions ? " [OPTIONS]" : ""} ${usageLine.join(" ")}`)}`, "");
|
|
294
324
|
if (posLines.length > 0) {
|
|
295
|
-
usageLines.push(
|
|
325
|
+
usageLines.push(underline(bold("ARGUMENTS")), "");
|
|
296
326
|
usageLines.push(formatLineColumns(posLines, " "));
|
|
297
327
|
usageLines.push("");
|
|
298
328
|
}
|
|
299
329
|
if (argLines.length > 0) {
|
|
300
|
-
usageLines.push(
|
|
330
|
+
usageLines.push(underline(bold("OPTIONS")), "");
|
|
301
331
|
usageLines.push(formatLineColumns(argLines, " "));
|
|
302
332
|
usageLines.push("");
|
|
303
333
|
}
|
|
304
334
|
if (commandsLines.length > 0) {
|
|
305
|
-
usageLines.push(
|
|
335
|
+
usageLines.push(underline(bold("COMMANDS")), "");
|
|
306
336
|
usageLines.push(formatLineColumns(commandsLines, " "));
|
|
307
|
-
usageLines.push("", `Use
|
|
337
|
+
usageLines.push("", `Use ${cyan(`${commandName} <command> --help`)} for more information about a command.`);
|
|
308
338
|
}
|
|
309
339
|
return usageLines.filter((l) => typeof l === "string").join("\n");
|
|
310
340
|
}
|
|
@@ -318,13 +348,13 @@ async function runMain(cmd, opts = {}) {
|
|
|
318
348
|
} else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
|
|
319
349
|
const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
|
|
320
350
|
if (!meta?.version) throw new CLIError("No version specified", "E_NO_VERSION");
|
|
321
|
-
|
|
351
|
+
console.log(meta.version);
|
|
322
352
|
} else await runCommand(cmd, { rawArgs });
|
|
323
353
|
} catch (error) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
354
|
+
if (error instanceof CLIError) {
|
|
355
|
+
await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
|
|
356
|
+
console.error(error.message);
|
|
357
|
+
} else console.error(error, "\n");
|
|
328
358
|
process.exit(1);
|
|
329
359
|
}
|
|
330
360
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as __toESM, r as __require, t as __commonJSMin } from "
|
|
2
|
-
import { F as Builder, S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes, u as extractAssignedNames } from "
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
|
|
2
|
+
import { F as Builder, S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes, u as extractAssignedNames } from "../_build/common.mjs";
|
|
3
3
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
4
4
|
import { basename, dirname, extname, join, relative, resolve, sep } from "path";
|
|
5
5
|
|
package/dist/_libs/compatx.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ declare const platforms: readonly ["aws", "azure", "cloudflare", "deno", "fireba
|
|
|
6
6
|
/**
|
|
7
7
|
* Known platform name
|
|
8
8
|
*/
|
|
9
|
-
type PlatformName = typeof platforms[number] | string & {};
|
|
9
|
+
type PlatformName = (typeof platforms)[number] | (string & {});
|
|
10
10
|
/**
|
|
11
11
|
* Normalize the compatibility dates from input config and defaults.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as __toESM, r as __require, t as __commonJSMin } from "
|
|
2
|
-
import { c as createFilter } from "
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
|
|
2
|
+
import { c as createFilter } from "../_build/common.mjs";
|
|
3
3
|
import nativeFs, { realpathSync } from "fs";
|
|
4
4
|
import path, { dirname, extname, normalize, resolve, sep } from "path";
|
|
5
5
|
import { builtinModules } from "module";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "../_common.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { at as join$2, ct as resolve$2, nt as dirname$2, ot as normalize$2, tt as basename$2 } from "../_build/common.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createWriteStream, existsSync, readdirSync, renameSync } from "node:fs";
|
|
5
5
|
import nativeFs from "fs";
|
|
@@ -7,7 +7,7 @@ import path from "path";
|
|
|
7
7
|
import Ds from "crypto";
|
|
8
8
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
9
9
|
import { homedir, tmpdir } from "node:os";
|
|
10
|
-
import { delimiter, dirname as dirname$1, normalize as normalize$1, resolve as resolve$1 } from "node:path";
|
|
10
|
+
import { delimiter, dirname as dirname$1, join as join$1, normalize as normalize$1, resolve as resolve$1 } from "node:path";
|
|
11
11
|
import { cwd } from "node:process";
|
|
12
12
|
import { promisify } from "node:util";
|
|
13
13
|
import { defu } from "defu";
|
|
@@ -643,7 +643,14 @@ const K = (e$7, t$7, n$4) => {
|
|
|
643
643
|
const q$1 = K;
|
|
644
644
|
|
|
645
645
|
//#endregion
|
|
646
|
-
//#region node_modules/.pnpm/nypm@0.6.
|
|
646
|
+
//#region node_modules/.pnpm/nypm@0.6.4/node_modules/nypm/dist/index.mjs
|
|
647
|
+
var dist_exports$1 = /* @__PURE__ */ __exportAll({
|
|
648
|
+
addDependency: () => addDependency,
|
|
649
|
+
addDevDependency: () => addDevDependency,
|
|
650
|
+
detectPackageManager: () => detectPackageManager,
|
|
651
|
+
installDependencies: () => installDependencies,
|
|
652
|
+
packageManagers: () => packageManagers
|
|
653
|
+
});
|
|
647
654
|
async function findup(cwd$1, match, options = {}) {
|
|
648
655
|
const segments = normalize$2(cwd$1).split("/");
|
|
649
656
|
while (segments.length > 0) {
|
|
@@ -652,6 +659,12 @@ async function findup(cwd$1, match, options = {}) {
|
|
|
652
659
|
segments.pop();
|
|
653
660
|
}
|
|
654
661
|
}
|
|
662
|
+
async function readPackageJSON(cwd$1) {
|
|
663
|
+
return findup(cwd$1, (p$2) => {
|
|
664
|
+
const pkgPath = join$1(p$2, "package.json");
|
|
665
|
+
if (existsSync(pkgPath)) return readFile(pkgPath, "utf8").then((data) => JSON.parse(data));
|
|
666
|
+
});
|
|
667
|
+
}
|
|
655
668
|
function cached(fn) {
|
|
656
669
|
let v$3;
|
|
657
670
|
return () => {
|
|
@@ -672,7 +685,7 @@ const hasCorepack = cached(async () => {
|
|
|
672
685
|
}
|
|
673
686
|
});
|
|
674
687
|
async function executeCommand(command, args, options = {}) {
|
|
675
|
-
const xArgs = command
|
|
688
|
+
const xArgs = command !== "npm" && command !== "bun" && command !== "deno" && options.corepack !== false && await hasCorepack() ? ["corepack", [command, ...args]] : [command, args];
|
|
676
689
|
const { exitCode, stdout, stderr } = await K(xArgs[0], xArgs[1], { nodeOptions: {
|
|
677
690
|
cwd: resolve$2(options.cwd || process.cwd()),
|
|
678
691
|
env: options.env,
|
|
@@ -701,7 +714,8 @@ async function resolveOperationOptions(options = {}) {
|
|
|
701
714
|
dev: options.dev ?? false,
|
|
702
715
|
workspace: options.workspace,
|
|
703
716
|
global: options.global ?? false,
|
|
704
|
-
dry: options.dry ?? false
|
|
717
|
+
dry: options.dry ?? false,
|
|
718
|
+
corepack: options.corepack ?? true
|
|
705
719
|
};
|
|
706
720
|
}
|
|
707
721
|
function getWorkspaceArgs(options) {
|
|
@@ -721,7 +735,7 @@ function parsePackageManagerField(packageManager) {
|
|
|
721
735
|
version,
|
|
722
736
|
buildMeta
|
|
723
737
|
};
|
|
724
|
-
const sanitized = name.replace(/\W+/g, "");
|
|
738
|
+
const sanitized = (name || "").replace(/\W+/g, "");
|
|
725
739
|
return {
|
|
726
740
|
name: sanitized,
|
|
727
741
|
version,
|
|
@@ -759,6 +773,13 @@ const packageManagers = [
|
|
|
759
773
|
files: ["deno.json"]
|
|
760
774
|
}
|
|
761
775
|
];
|
|
776
|
+
/**
|
|
777
|
+
* Detect the package manager used in a directory (and up) by checking various sources:
|
|
778
|
+
*
|
|
779
|
+
* 1. Use `packageManager` field from package.json
|
|
780
|
+
*
|
|
781
|
+
* 2. Known lock files and other files
|
|
782
|
+
*/
|
|
762
783
|
async function detectPackageManager(cwd$1, options = {}) {
|
|
763
784
|
const detected = await findup(resolve$2(cwd$1 || "."), async (path$2) => {
|
|
764
785
|
if (!options.ignorePackageJSON) {
|
|
@@ -797,6 +818,15 @@ async function detectPackageManager(cwd$1, options = {}) {
|
|
|
797
818
|
}
|
|
798
819
|
return detected;
|
|
799
820
|
}
|
|
821
|
+
/**
|
|
822
|
+
* Installs project dependencies.
|
|
823
|
+
*
|
|
824
|
+
* @param options - Options to pass to the API call.
|
|
825
|
+
* @param options.cwd - The directory to run the command in.
|
|
826
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
827
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
828
|
+
* @param options.frozenLockFile - Whether to install dependencies with frozen lock file.
|
|
829
|
+
*/
|
|
800
830
|
async function installDependencies(options = {}) {
|
|
801
831
|
const resolvedOptions = await resolveOperationOptions(options);
|
|
802
832
|
const commandArgs = options.frozenLockFile ? {
|
|
@@ -806,20 +836,34 @@ async function installDependencies(options = {}) {
|
|
|
806
836
|
pnpm: ["install", "--frozen-lockfile"],
|
|
807
837
|
deno: ["install", "--frozen"]
|
|
808
838
|
}[resolvedOptions.packageManager.name] : ["install"];
|
|
839
|
+
if (options.ignoreWorkspace && resolvedOptions.packageManager.name === "pnpm") commandArgs.push("--ignore-workspace");
|
|
809
840
|
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, commandArgs, {
|
|
810
841
|
cwd: resolvedOptions.cwd,
|
|
811
|
-
silent: resolvedOptions.silent
|
|
842
|
+
silent: resolvedOptions.silent,
|
|
843
|
+
corepack: resolvedOptions.corepack
|
|
812
844
|
});
|
|
813
845
|
return { exec: {
|
|
814
846
|
command: resolvedOptions.packageManager.command,
|
|
815
847
|
args: commandArgs
|
|
816
848
|
} };
|
|
817
849
|
}
|
|
850
|
+
/**
|
|
851
|
+
* Adds dependency to the project.
|
|
852
|
+
*
|
|
853
|
+
* @param name - Name of the dependency to add.
|
|
854
|
+
* @param options - Options to pass to the API call.
|
|
855
|
+
* @param options.cwd - The directory to run the command in.
|
|
856
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
857
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
858
|
+
* @param options.dev - Whether to add the dependency as dev dependency.
|
|
859
|
+
* @param options.workspace - The name of the workspace to use.
|
|
860
|
+
* @param options.global - Whether to run the command in global mode.
|
|
861
|
+
*/
|
|
818
862
|
async function addDependency(name, options = {}) {
|
|
819
863
|
const resolvedOptions = await resolveOperationOptions(options);
|
|
820
864
|
const names = Array.isArray(name) ? name : [name];
|
|
821
865
|
if (resolvedOptions.packageManager.name === "deno") {
|
|
822
|
-
for (let i$8 = 0; i$8 < names.length; i$8++) if (!/^(npm|jsr|file):.+$/.test(names[i$8])) names[i$8] = `npm:${names[i$8]}`;
|
|
866
|
+
for (let i$8 = 0; i$8 < names.length; i$8++) if (!/^(npm|jsr|file):.+$/.test(names[i$8] || "")) names[i$8] = `npm:${names[i$8]}`;
|
|
823
867
|
}
|
|
824
868
|
if (names.length === 0) return {};
|
|
825
869
|
const args = (resolvedOptions.packageManager.name === "yarn" ? [
|
|
@@ -837,7 +881,8 @@ async function addDependency(name, options = {}) {
|
|
|
837
881
|
]).filter(Boolean);
|
|
838
882
|
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
839
883
|
cwd: resolvedOptions.cwd,
|
|
840
|
-
silent: resolvedOptions.silent
|
|
884
|
+
silent: resolvedOptions.silent,
|
|
885
|
+
corepack: resolvedOptions.corepack
|
|
841
886
|
});
|
|
842
887
|
if (!resolvedOptions.dry && options.installPeerDependencies) {
|
|
843
888
|
const existingPkg = await readPackageJSON(resolvedOptions.cwd);
|
|
@@ -845,11 +890,11 @@ async function addDependency(name, options = {}) {
|
|
|
845
890
|
const peerDevDeps = [];
|
|
846
891
|
for (const _name of names) {
|
|
847
892
|
const pkgName = _name.match(/^(.[^@]+)/)?.[0];
|
|
848
|
-
const pkg =
|
|
893
|
+
const pkg = createRequire(join$1(resolvedOptions.cwd, "/_.js"))(`${pkgName}/package.json`);
|
|
849
894
|
if (!pkg.peerDependencies || pkg.name !== pkgName) continue;
|
|
850
895
|
for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
|
|
851
896
|
if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
|
|
852
|
-
if (existingPkg
|
|
897
|
+
if (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;
|
|
853
898
|
(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);
|
|
854
899
|
}
|
|
855
900
|
}
|
|
@@ -861,6 +906,18 @@ async function addDependency(name, options = {}) {
|
|
|
861
906
|
args
|
|
862
907
|
} };
|
|
863
908
|
}
|
|
909
|
+
/**
|
|
910
|
+
* Adds dev dependency to the project.
|
|
911
|
+
*
|
|
912
|
+
* @param name - Name of the dev dependency to add.
|
|
913
|
+
* @param options - Options to pass to the API call.
|
|
914
|
+
* @param options.cwd - The directory to run the command in.
|
|
915
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
916
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
917
|
+
* @param options.workspace - The name of the workspace to use.
|
|
918
|
+
* @param options.global - Whether to run the command in global mode.
|
|
919
|
+
*
|
|
920
|
+
*/
|
|
864
921
|
async function addDevDependency(name, options = {}) {
|
|
865
922
|
return await addDependency(name, {
|
|
866
923
|
...options,
|
|
@@ -868,10 +925,6 @@ async function addDevDependency(name, options = {}) {
|
|
|
868
925
|
});
|
|
869
926
|
}
|
|
870
927
|
|
|
871
|
-
//#endregion
|
|
872
|
-
//#region node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/index.mjs
|
|
873
|
-
var dist_exports$1 = /* @__PURE__ */ __exportAll({ addDevDependency: () => addDevDependency });
|
|
874
|
-
|
|
875
928
|
//#endregion
|
|
876
929
|
//#region node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs
|
|
877
930
|
const e$6 = globalThis.Blob, o$5 = globalThis.File, a$10 = globalThis.FormData, s$7 = globalThis.Headers, t$6 = globalThis.Request, h = globalThis.Response, i$7 = globalThis.AbortController, l$1 = globalThis.fetch || (() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes } from "
|
|
1
|
+
import { S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes } from "../_build/common.mjs";
|
|
2
2
|
import { sep } from "path";
|
|
3
3
|
|
|
4
4
|
//#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.55.2/node_modules/@rollup/plugin-inject/dist/es/index.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createFilter, l as dataToEsm } from "
|
|
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.2/node_modules/@rollup/plugin-json/dist/es/index.js
|
|
4
4
|
function json(options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __exportAll } from "
|
|
2
|
-
import { S as MagicString, x as stripLiteral } from "
|
|
1
|
+
import { n as __exportAll } from "../_common.mjs";
|
|
2
|
+
import { S as MagicString, x as stripLiteral } from "../_build/common.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
@@ -843,7 +843,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
843
843
|
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
844
844
|
const gigetPrefixes = customProviderKeys.length > 0 ? [...new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
845
845
|
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
846
|
-
const { downloadTemplate } = await import("./giget.mjs").then((n) => n.t);
|
|
846
|
+
const { downloadTemplate } = await import("./nypm+giget+tinyexec.mjs").then((n) => n.t);
|
|
847
847
|
const { digest } = await import("ohash");
|
|
848
848
|
const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + digest(source).slice(0, 10).replace(/[-_]/g, "");
|
|
849
849
|
let cloneDir;
|
|
@@ -924,7 +924,7 @@ async function watchConfig(options) {
|
|
|
924
924
|
options.rcFile && resolve$1(l.cwd, typeof options.rcFile === "string" ? options.rcFile : `.${configName}rc`),
|
|
925
925
|
options.packageJson && resolve$1(l.cwd, "package.json")
|
|
926
926
|
]).filter(Boolean))];
|
|
927
|
-
const watch$1 = await import("./chokidar.mjs").then((n) => n.t).then((r) => r.watch || r.default || r);
|
|
927
|
+
const watch$1 = await import("./readdirp+chokidar.mjs").then((n) => n.t).then((r) => r.watch || r.default || r);
|
|
928
928
|
const { diff } = await import("ohash/utils");
|
|
929
929
|
const _fswatcher = watch$1(watchingFiles, {
|
|
930
930
|
ignoreInitial: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./gen-mapping.mjs";
|
|
1
|
+
import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./resolve-uri+gen-mapping.mjs";
|
|
2
2
|
|
|
3
3
|
//#region node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs
|
|
4
4
|
var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as decode, w as encode } from "
|
|
1
|
+
import { C as decode, w as encode } from "../_build/common.mjs";
|
|
2
2
|
|
|
3
3
|
//#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
4
4
|
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "../_common.mjs";
|
|
2
2
|
import { E as parse$1, P as require_picomatch, S as MagicString, T as Parser, at as join$1, b as getMagicString, ct as resolve$1, it as isAbsolute$2, y as createUnimport } from "../_build/common.mjs";
|
|
3
3
|
import { t as walk } from "./estree-walker.mjs";
|
|
4
|
-
import { t as remapping } from "
|
|
4
|
+
import { t as remapping } from "./remapping.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs, { promises } from "node:fs";
|
|
7
7
|
import "node:fs/promises";
|
package/dist/builder.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./_common.mjs";
|
|
2
2
|
import { D as prepare, M as build, O as copyPublicAssets, _ as writeTypes, m as getBuildInfo } from "./_build/common.mjs";
|
|
3
|
-
import "./_libs/c12.mjs";
|
|
3
|
+
import "./_libs/rc9+c12+dotenv.mjs";
|
|
4
4
|
import { a as loadOptions, i as createNitro, n as runTask, r as prerender, t as listTasks } from "./_chunks/nitro.mjs";
|
|
5
5
|
import "./_libs/tsconfck.mjs";
|
|
6
6
|
import "./_chunks/nitro2.mjs";
|
package/dist/cli/_chunks/dev.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ct as resolve } from "../../_build/common.mjs";
|
|
2
|
-
import "../../_libs/c12.mjs";
|
|
2
|
+
import "../../_libs/rc9+c12+dotenv.mjs";
|
|
3
3
|
import { t as NitroDevServer } from "../../_chunks/dev.mjs";
|
|
4
4
|
import { t as defineCommand } from "../../_libs/citty.mjs";
|
|
5
5
|
import { t as commonArgs } from "./common.mjs";
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as commonjs } from "../_libs
|
|
2
|
-
import { a as WatchConfigOptions, i as ResolvedConfig, n as ConfigWatcher, o as ChokidarOptions, r as DotenvOptions, t as C12InputConfig } from "../_libs/c12.mjs";
|
|
1
|
+
import { t as commonjs } from "../_libs/pluginutils+plugin-commonjs.mjs";
|
|
2
|
+
import { a as WatchConfigOptions, i as ResolvedConfig, n as ConfigWatcher, o as ChokidarOptions, r as DotenvOptions, t as C12InputConfig } from "../_libs/c12+giget+readdirp+chokidar.mjs";
|
|
3
3
|
import { n as CompatibilityDates, r as DateString, t as CompatibilityDateSpec } from "../_libs/compatx.mjs";
|
|
4
4
|
import { t as ProxyServerOptions } from "../_libs/httpxy.mjs";
|
|
5
5
|
import { t as TSConfig } from "../_libs/pkg-types.mjs";
|
|
6
|
-
import { n as Unimport, t as UnimportPluginOptions } from "../_libs/unimport.mjs";
|
|
6
|
+
import { n as Unimport, t as UnimportPluginOptions } from "../_libs/unplugin+unimport.mjs";
|
|
7
7
|
import "../_libs/esbuild.mjs";
|
|
8
8
|
import { t as UnwasmPluginOptions } from "../_libs/unwasm.mjs";
|
|
9
9
|
import { n as RouterContext, t as RouterCompilerOptions } from "../_libs/rou3.mjs";
|
|
@@ -38,7 +38,7 @@ import { DurableObject } from "cloudflare:workers";
|
|
|
38
38
|
//#region src/types/fetch/fetch.d.ts
|
|
39
39
|
interface InternalApi {}
|
|
40
40
|
type RouterMethod = Lowercase<HTTPMethod>;
|
|
41
|
-
type NitroFetchRequest = Exclude<keyof InternalApi, `/_${string}` | `/api/_${string}`> | Exclude<FetchRequest, string> | string & {};
|
|
41
|
+
type NitroFetchRequest = Exclude<keyof InternalApi, `/_${string}` | `/api/_${string}`> | Exclude<FetchRequest, string> | (string & {});
|
|
42
42
|
type MiddlewareOf<Route$2 extends string, Method extends RouterMethod | "default"> = Method extends keyof InternalApi[MatchedRoutes<Route$2>] ? InternalApi[MatchedRoutes<Route$2>][Method] : never;
|
|
43
43
|
type TypedInternalResponse<Route$2, Default = unknown, Method extends RouterMethod = RouterMethod> = Default extends string | boolean | number | null | void | object ? Default : Route$2 extends string ? MiddlewareOf<Route$2, Method> extends never ? MiddlewareOf<Route$2, "default"> extends never ? Default : MiddlewareOf<Route$2, "default"> : MiddlewareOf<Route$2, Method> : Default;
|
|
44
44
|
type AvailableRouterMethod<R extends NitroFetchRequest> = R extends string ? keyof InternalApi[MatchedRoutes<R>] extends undefined ? RouterMethod : Extract<keyof InternalApi[MatchedRoutes<R>], "default"> extends undefined ? Extract<RouterMethod, keyof InternalApi[MatchedRoutes<R>]> : RouterMethod : RouterMethod;
|
|
@@ -1708,7 +1708,7 @@ interface VercelServerlessFunctionConfig {
|
|
|
1708
1708
|
/**
|
|
1709
1709
|
* The runtime to use. Defaults to the auto-detected Node.js version.
|
|
1710
1710
|
*/
|
|
1711
|
-
runtime?: "nodejs20.x" | "nodejs22.x" | "bun1.x" | string & {};
|
|
1711
|
+
runtime?: "nodejs20.x" | "nodejs22.x" | "bun1.x" | (string & {});
|
|
1712
1712
|
[key: string]: unknown;
|
|
1713
1713
|
}
|
|
1714
1714
|
interface VercelOptions {
|
|
@@ -1747,7 +1747,7 @@ interface PresetOptions {
|
|
|
1747
1747
|
vercel?: VercelOptions;
|
|
1748
1748
|
}
|
|
1749
1749
|
type PresetName = "alwaysdata" | "aws-amplify" | "aws-lambda" | "azure-swa" | "base-worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflare-durable" | "cloudflare-module" | "cloudflare-pages" | "cloudflare-pages-static" | "deno" | "deno-deploy" | "deno-server" | "digital-ocean" | "firebase-app-hosting" | "flight-control" | "genezio" | "github-pages" | "gitlab-pages" | "heroku" | "iis-handler" | "iis-node" | "koyeb" | "netlify" | "netlify-edge" | "netlify-static" | "nitro-dev" | "nitro-prerender" | "node" | "node-cluster" | "node-middleware" | "node-server" | "platform-sh" | "render-com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zerops" | "zerops-static";
|
|
1750
|
-
type PresetNameInput = "alwaysdata" | "aws-amplify" | "awsAmplify" | "aws_amplify" | "aws-lambda" | "awsLambda" | "aws_lambda" | "azure-swa" | "azureSwa" | "azure_swa" | "base-worker" | "baseWorker" | "base_worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflareDev" | "cloudflare_dev" | "cloudflare-durable" | "cloudflareDurable" | "cloudflare_durable" | "cloudflare-module" | "cloudflareModule" | "cloudflare_module" | "cloudflare-pages" | "cloudflarePages" | "cloudflare_pages" | "cloudflare-pages-static" | "cloudflarePagesStatic" | "cloudflare_pages_static" | "deno" | "deno-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "firebase-app-hosting" | "firebaseAppHosting" | "firebase_app_hosting" | "flight-control" | "flightControl" | "flight_control" | "genezio" | "github-pages" | "githubPages" | "github_pages" | "gitlab-pages" | "gitlabPages" | "gitlab_pages" | "heroku" | "iis-handler" | "iisHandler" | "iis_handler" | "iis-node" | "iisNode" | "iis_node" | "koyeb" | "netlify" | "netlify-edge" | "netlifyEdge" | "netlify_edge" | "netlify-static" | "netlifyStatic" | "netlify_static" | "nitro-dev" | "nitroDev" | "nitro_dev" | "nitro-prerender" | "nitroPrerender" | "nitro_prerender" | "node" | "node-cluster" | "nodeCluster" | "node_cluster" | "node-middleware" | "nodeMiddleware" | "node_middleware" | "node-server" | "nodeServer" | "node_server" | "platform-sh" | "platformSh" | "platform_sh" | "render-com" | "renderCom" | "render_com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "vercelStatic" | "vercel_static" | "winterjs" | "zeabur" | "zeabur-static" | "zeaburStatic" | "zeabur_static" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | string & {};
|
|
1750
|
+
type PresetNameInput = "alwaysdata" | "aws-amplify" | "awsAmplify" | "aws_amplify" | "aws-lambda" | "awsLambda" | "aws_lambda" | "azure-swa" | "azureSwa" | "azure_swa" | "base-worker" | "baseWorker" | "base_worker" | "bun" | "cleavr" | "cloudflare-dev" | "cloudflareDev" | "cloudflare_dev" | "cloudflare-durable" | "cloudflareDurable" | "cloudflare_durable" | "cloudflare-module" | "cloudflareModule" | "cloudflare_module" | "cloudflare-pages" | "cloudflarePages" | "cloudflare_pages" | "cloudflare-pages-static" | "cloudflarePagesStatic" | "cloudflare_pages_static" | "deno" | "deno-deploy" | "denoDeploy" | "deno_deploy" | "deno-server" | "denoServer" | "deno_server" | "digital-ocean" | "digitalOcean" | "digital_ocean" | "firebase-app-hosting" | "firebaseAppHosting" | "firebase_app_hosting" | "flight-control" | "flightControl" | "flight_control" | "genezio" | "github-pages" | "githubPages" | "github_pages" | "gitlab-pages" | "gitlabPages" | "gitlab_pages" | "heroku" | "iis-handler" | "iisHandler" | "iis_handler" | "iis-node" | "iisNode" | "iis_node" | "koyeb" | "netlify" | "netlify-edge" | "netlifyEdge" | "netlify_edge" | "netlify-static" | "netlifyStatic" | "netlify_static" | "nitro-dev" | "nitroDev" | "nitro_dev" | "nitro-prerender" | "nitroPrerender" | "nitro_prerender" | "node" | "node-cluster" | "nodeCluster" | "node_cluster" | "node-middleware" | "nodeMiddleware" | "node_middleware" | "node-server" | "nodeServer" | "node_server" | "platform-sh" | "platformSh" | "platform_sh" | "render-com" | "renderCom" | "render_com" | "standard" | "static" | "stormkit" | "vercel" | "vercel-static" | "vercelStatic" | "vercel_static" | "winterjs" | "zeabur" | "zeabur-static" | "zeaburStatic" | "zeabur_static" | "zerops" | "zerops-static" | "zeropsStatic" | "zerops_static" | (string & {});
|
|
1751
1751
|
//#endregion
|
|
1752
1752
|
//#region src/types/openapi-ts.d.ts
|
|
1753
1753
|
/**
|
|
@@ -2374,7 +2374,7 @@ interface NitroEventHandler extends NitroHandlerCommon {
|
|
|
2374
2374
|
* Default is `"web"`. If set to `"node"`, the handler will be converted into a web compatible handler.
|
|
2375
2375
|
*/
|
|
2376
2376
|
format?: EventHandlerFormat;
|
|
2377
|
-
env?: MaybeArray$1<"dev" | "prod" | "prerender" | PresetName | string & {}>;
|
|
2377
|
+
env?: MaybeArray$1<"dev" | "prod" | "prerender" | PresetName | (string & {})>;
|
|
2378
2378
|
}
|
|
2379
2379
|
interface NitroDevEventHandler extends NitroHandlerCommon {
|
|
2380
2380
|
/**
|
|
@@ -2455,9 +2455,9 @@ interface NitroRouteConfig {
|
|
|
2455
2455
|
status?: HTTPstatus;
|
|
2456
2456
|
};
|
|
2457
2457
|
prerender?: boolean;
|
|
2458
|
-
proxy?: string | {
|
|
2458
|
+
proxy?: string | ({
|
|
2459
2459
|
to: string;
|
|
2460
|
-
} & ProxyOptions;
|
|
2460
|
+
} & ProxyOptions);
|
|
2461
2461
|
isr?: number | boolean | VercelISRConfig;
|
|
2462
2462
|
cors?: boolean;
|
|
2463
2463
|
swr?: boolean | number;
|
|
@@ -2549,7 +2549,7 @@ type NitroTypes = {
|
|
|
2549
2549
|
tsConfig?: TSConfig;
|
|
2550
2550
|
};
|
|
2551
2551
|
interface NitroFrameworkInfo {
|
|
2552
|
-
name?: "nitro" | string & {};
|
|
2552
|
+
name?: "nitro" | (string & {});
|
|
2553
2553
|
version?: string;
|
|
2554
2554
|
}
|
|
2555
2555
|
/** Build info written to `.output/nitro.json` or `.nitro/dev/nitro.json` */
|
|
@@ -2666,14 +2666,14 @@ interface NitroOpenAPIConfig {
|
|
|
2666
2666
|
/**
|
|
2667
2667
|
* Scalar UI configuration
|
|
2668
2668
|
*/
|
|
2669
|
-
scalar?: false | Partial<unknown> & {
|
|
2669
|
+
scalar?: false | (Partial<unknown> & {
|
|
2670
2670
|
/**
|
|
2671
2671
|
* Scalar UI route
|
|
2672
2672
|
*
|
|
2673
2673
|
* Default is `/_scalar`
|
|
2674
2674
|
*/
|
|
2675
2675
|
route?: string;
|
|
2676
|
-
};
|
|
2676
|
+
});
|
|
2677
2677
|
/**
|
|
2678
2678
|
* Swagger UI configuration
|
|
2679
2679
|
*/
|
|
@@ -2936,7 +2936,7 @@ interface NitroConfig extends Partial<Omit<NitroOptions, "routeRules" | "rollupC
|
|
|
2936
2936
|
rollupConfig?: Partial<RollupConfig>;
|
|
2937
2937
|
compatibilityDate?: CompatibilityDateSpec;
|
|
2938
2938
|
unenv?: Preset | Preset[];
|
|
2939
|
-
serverDir?: boolean | "./" | "./server" | string & {};
|
|
2939
|
+
serverDir?: boolean | "./" | "./server" | (string & {});
|
|
2940
2940
|
serverEntry?: string | NitroOptions["serverEntry"];
|
|
2941
2941
|
renderer?: false | NitroOptions["renderer"];
|
|
2942
2942
|
output?: Partial<NitroOptions["output"]>;
|
|
@@ -2978,7 +2978,7 @@ interface StorageMounts {
|
|
|
2978
2978
|
[option: string]: any;
|
|
2979
2979
|
};
|
|
2980
2980
|
}
|
|
2981
|
-
type DatabaseConnectionName = "default" | string & {};
|
|
2981
|
+
type DatabaseConnectionName = "default" | (string & {});
|
|
2982
2982
|
type DatabaseConnectionConfig = {
|
|
2983
2983
|
connector: ConnectorName;
|
|
2984
2984
|
options?: {
|
package/dist/vite.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "./_common.mjs";
|
|
2
2
|
import { $ as resolveModulePath, B as T, D as prepare, I as prettyPath, O as copyPublicAssets, V as a, a as libChunkName, at as join$1, ct as resolve$1, h as writeBuildInfo, i as getChunkName, it as isAbsolute$1, m as getBuildInfo, n as baseBuildPlugins, nt as dirname$1, o as baseBuildConfig, r as NODE_MODULES_RE, st as relative$1, tt as basename$1 } from "./_build/common.mjs";
|
|
3
|
-
import { i as debounce } from "./_libs/c12.mjs";
|
|
3
|
+
import { i as debounce } from "./_libs/rc9+c12+dotenv.mjs";
|
|
4
4
|
import { t as formatCompatibilityDate } from "./_libs/compatx.mjs";
|
|
5
5
|
import { i as createNitro } from "./_chunks/nitro.mjs";
|
|
6
6
|
import "./_libs/tsconfck.mjs";
|
|
7
7
|
import { n as scanHandlers } from "./_chunks/nitro2.mjs";
|
|
8
8
|
import { i as NodeEnvRunner, r as NitroDevApp } from "./_chunks/dev.mjs";
|
|
9
|
-
import { n as watch$1 } from "./_libs/chokidar.mjs";
|
|
10
|
-
import { t as alias } from "./_libs
|
|
11
|
-
import { t as inject } from "./_libs
|
|
12
|
-
import { n as assetsPlugin } from "./_libs
|
|
9
|
+
import { n as watch$1 } from "./_libs/readdirp+chokidar.mjs";
|
|
10
|
+
import { t as alias } from "./_libs/plugin-alias.mjs";
|
|
11
|
+
import { t as inject } from "./_libs/plugin-inject.mjs";
|
|
12
|
+
import { n as assetsPlugin } from "./_libs/pluginutils.mjs";
|
|
13
13
|
import consola$1 from "consola";
|
|
14
14
|
import { existsSync, watch } from "node:fs";
|
|
15
15
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -442,7 +442,7 @@ function nitroPreviewPlugin(ctx) {
|
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
async function loadPreviewDotEnv(root) {
|
|
445
|
-
const { loadDotenv } = await import("./_libs/c12.mjs").then((n) => n.t);
|
|
445
|
+
const { loadDotenv } = await import("./_libs/rc9+c12+dotenv.mjs").then((n) => n.t);
|
|
446
446
|
const env = await loadDotenv({
|
|
447
447
|
cwd: root,
|
|
448
448
|
fileName: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.0.1-20260120-
|
|
3
|
+
"version": "3.0.1-20260120-133849-ca1a9dee",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-routes",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@azure/functions": "^3.5.1",
|
|
91
91
|
"@azure/static-web-apps-cli": "^2.0.7",
|
|
92
|
-
"@cloudflare/workers-types": "^4.
|
|
92
|
+
"@cloudflare/workers-types": "^4.20260120.0",
|
|
93
93
|
"@deno/types": "^0.0.1",
|
|
94
94
|
"@hiogawa/vite-plugin-fullstack": "^0.0.11",
|
|
95
95
|
"@netlify/edge-functions": "^3.0.3",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"c12": "^3.3.3",
|
|
116
116
|
"changelogen": "^0.6.2",
|
|
117
117
|
"chokidar": "^5.0.0",
|
|
118
|
-
"citty": "^0.
|
|
118
|
+
"citty": "^0.2.0",
|
|
119
119
|
"compatx": "^0.2.0",
|
|
120
120
|
"confbox": "^0.2.2",
|
|
121
121
|
"cookie-es": "^2.0.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"mime": "^4.1.0",
|
|
143
143
|
"miniflare": "^4.20260114.0",
|
|
144
144
|
"mlly": "^1.8.0",
|
|
145
|
-
"nypm": "^0.6.
|
|
145
|
+
"nypm": "^0.6.4",
|
|
146
146
|
"obuild": "^0.4.18",
|
|
147
147
|
"pathe": "^2.0.3",
|
|
148
148
|
"perfect-debounce": "^2.0.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|