nitro-nightly 3.0.1-20251109-233810-e280abba → 3.0.1-20251110-004511-201ee906
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/rolldown.mjs +1 -1
- package/dist/_build/rollup.mjs +1 -1
- package/dist/_build/vite.build.mjs +2 -2
- package/dist/_build/vite.plugin.mjs +1 -1
- package/dist/_chunks/{Bb_Lq1zU.mjs → CzeQHoGT.mjs} +52 -25
- package/dist/_libs/c12.mjs +1 -1
- package/dist/_libs/giget.mjs +63 -2
- package/dist/builder.mjs +1 -1
- package/dist/cli/_chunks/dist4.mjs +2 -2
- package/dist/cli/_chunks/dist5.mjs +4 -0
- package/dist/vite.mjs +1 -1
- package/package.json +10 -4
- /package/dist/_chunks/{CNxJ25Zn.mjs → DJgsNglP.mjs} +0 -0
package/dist/_build/rolldown.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { n as baseBuildConfig, r as replace, t as baseBuildPlugins } from "./com
|
|
|
28
28
|
import "../_libs/remapping.mjs";
|
|
29
29
|
import "../_libs/unwasm.mjs";
|
|
30
30
|
import "../_libs/etag.mjs";
|
|
31
|
-
import { n as raw, t as generateFSTree } from "../_chunks/
|
|
31
|
+
import { n as raw, t as generateFSTree } from "../_chunks/DJgsNglP.mjs";
|
|
32
32
|
import "../_libs/duplexer.mjs";
|
|
33
33
|
import "../_libs/gzip-size.mjs";
|
|
34
34
|
import "../_libs/pretty-bytes.mjs";
|
package/dist/_build/rollup.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import { n as baseBuildConfig, r as replace, t as baseBuildPlugins } from "./com
|
|
|
30
30
|
import "../_libs/remapping.mjs";
|
|
31
31
|
import "../_libs/unwasm.mjs";
|
|
32
32
|
import "../_libs/etag.mjs";
|
|
33
|
-
import { n as raw, t as generateFSTree } from "../_chunks/
|
|
33
|
+
import { n as raw, t as generateFSTree } from "../_chunks/DJgsNglP.mjs";
|
|
34
34
|
import "../_libs/duplexer.mjs";
|
|
35
35
|
import "../_libs/gzip-size.mjs";
|
|
36
36
|
import "../_libs/pretty-bytes.mjs";
|
|
@@ -13,7 +13,7 @@ import "../_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "../_libs/compatx.mjs";
|
|
14
14
|
import "../_libs/klona.mjs";
|
|
15
15
|
import { r as a } from "../_libs/std-env.mjs";
|
|
16
|
-
import "../_chunks/
|
|
16
|
+
import "../_chunks/CzeQHoGT.mjs";
|
|
17
17
|
import "../_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "../_libs/tsconfck.mjs";
|
|
19
19
|
import "../_libs/dot-prop.mjs";
|
|
@@ -43,7 +43,7 @@ import "../_libs/vite-plugin-fullstack.mjs";
|
|
|
43
43
|
|
|
44
44
|
//#region src/build/vite/build.ts
|
|
45
45
|
async function viteBuild(nitro$1) {
|
|
46
|
-
if (nitro$1.options.dev) throw new Error("Nitro
|
|
46
|
+
if (nitro$1.options.dev) throw new Error("Nitro dev CLI does not supports vite. Please use `vite dev` instead.");
|
|
47
47
|
const { createBuilder } = nitro$1.options.builder === "rolldown-vite" ? await import("rolldown-vite").catch(() => import("vite")) : await import("vite");
|
|
48
48
|
await (await createBuilder({
|
|
49
49
|
base: nitro$1.options.rootDir,
|
|
@@ -2,7 +2,7 @@ import { C as join$1, D as relative$1, O as resolve$1, S as isAbsolute$1, b as d
|
|
|
2
2
|
import { f as sanitizeFilePath } from "../_libs/local-pkg.mjs";
|
|
3
3
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
4
4
|
import { n as T, r as a } from "../_libs/std-env.mjs";
|
|
5
|
-
import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/
|
|
5
|
+
import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/CzeQHoGT.mjs";
|
|
6
6
|
import { n as prettyPath } from "../_chunks/DTJoprWj.mjs";
|
|
7
7
|
import { i as scanHandlers } from "../_chunks/CYzvH-lo.mjs";
|
|
8
8
|
import { n as writeBuildInfo, t as getBuildInfo } from "./common.mjs";
|
|
@@ -12,6 +12,7 @@ import { i as scanHandlers, r as scanAndSyncOptions, t as runParallel } from "./
|
|
|
12
12
|
import { a as findRoute, i as findAllRoutes, n as addRoute, r as createRouter, t as compileRouterToString } from "../_libs/rou3.mjs";
|
|
13
13
|
import { t as src_default } from "../_libs/mime.mjs";
|
|
14
14
|
import { n as z, t as P } from "../_libs/ultrahtml.mjs";
|
|
15
|
+
import { createRequire } from "node:module";
|
|
15
16
|
import consola$1, { consola } from "consola";
|
|
16
17
|
import { Hookable, createDebugger } from "hookable";
|
|
17
18
|
import { existsSync, promises } from "node:fs";
|
|
@@ -515,33 +516,59 @@ async function resolveUnenv(options) {
|
|
|
515
516
|
|
|
516
517
|
//#endregion
|
|
517
518
|
//#region src/config/resolvers/builder.ts
|
|
519
|
+
const VALID_BUILDERS = [
|
|
520
|
+
"rollup",
|
|
521
|
+
"rolldown",
|
|
522
|
+
"vite",
|
|
523
|
+
"rolldown-vite"
|
|
524
|
+
];
|
|
518
525
|
async function resolveBuilder(options) {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
throw new Error(`Builder "vite" is not available. Make sure to install "vite" package.`);
|
|
541
|
-
}
|
|
542
|
-
break;
|
|
543
|
-
default: throw new Error(`Builder "${options.builder}" is not supported.`);
|
|
526
|
+
options.builder ??= process.env.NITRO_BUILDER;
|
|
527
|
+
if (options.builder) {
|
|
528
|
+
if (!VALID_BUILDERS.includes(options.builder)) throw new Error(`Invalid nitro builder "${options.builder}". Valid builders are: ${VALID_BUILDERS.join(", ")}.`);
|
|
529
|
+
const pkg = options.builder === "rolldown-vite" ? "vite" : options.builder;
|
|
530
|
+
if (!isPkgInstalled(pkg, options.rootDir)) {
|
|
531
|
+
if (!await consola$1.prompt(`Nitro builder package \`${pkg}\` is not installed. Would you like to install it?`, {
|
|
532
|
+
type: "confirm",
|
|
533
|
+
default: true,
|
|
534
|
+
cancel: "null"
|
|
535
|
+
})) throw new Error(`Nitro builder package "${options.builder}" is not installed. Please install it in your project dependencies.`);
|
|
536
|
+
await installPkg(pkg, options.rootDir);
|
|
537
|
+
}
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
for (const pkg of [
|
|
541
|
+
"rolldown",
|
|
542
|
+
"rollup",
|
|
543
|
+
"vite"
|
|
544
|
+
]) if (isPkgInstalled(pkg, options.rootDir)) {
|
|
545
|
+
options.builder = pkg;
|
|
546
|
+
return;
|
|
544
547
|
}
|
|
548
|
+
const pkgToInstall = await consola$1.prompt(`No nitro builder specified. Which builder would you like to install?`, {
|
|
549
|
+
type: "select",
|
|
550
|
+
cancel: "null",
|
|
551
|
+
options: VALID_BUILDERS.map((b) => ({
|
|
552
|
+
label: b,
|
|
553
|
+
value: b
|
|
554
|
+
}))
|
|
555
|
+
});
|
|
556
|
+
if (!pkgToInstall) throw new Error(`No nitro builder specified. Please install one of the following packages: ${VALID_BUILDERS.join(", ")} and set it as the builder in your nitro config or via the NITRO_BUILDER environment variable.`);
|
|
557
|
+
await installPkg(pkgToInstall, options.rootDir);
|
|
558
|
+
options.builder = pkgToInstall;
|
|
559
|
+
}
|
|
560
|
+
const require = createRequire(process.cwd() + "/_index.js");
|
|
561
|
+
function isPkgInstalled(pkg, root) {
|
|
562
|
+
try {
|
|
563
|
+
require.resolve(pkg, { paths: [root] });
|
|
564
|
+
return true;
|
|
565
|
+
} catch {
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
async function installPkg(pkg, root) {
|
|
570
|
+
const { addDevDependency } = await import("../cli/_chunks/dist4.mjs");
|
|
571
|
+
return addDevDependency(pkg === "rolldown-vite" ? "vite@npm:rolldown-vite" : pkg, { cwd: root });
|
|
545
572
|
}
|
|
546
573
|
|
|
547
574
|
//#endregion
|
package/dist/_libs/c12.mjs
CHANGED
|
@@ -2576,7 +2576,7 @@ async function resolveConfig(source, options, sourceOptions = {}) {
|
|
|
2576
2576
|
const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
|
|
2577
2577
|
const gigetPrefixes = customProviderKeys.length > 0 ? [.../* @__PURE__ */ new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
|
|
2578
2578
|
if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
|
|
2579
|
-
const { downloadTemplate } = await import("../cli/_chunks/
|
|
2579
|
+
const { downloadTemplate } = await import("../cli/_chunks/dist5.mjs");
|
|
2580
2580
|
const { digest } = await import("ohash");
|
|
2581
2581
|
const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + digest(source).slice(0, 10).replace(/[-_]/g, "");
|
|
2582
2582
|
let cloneDir;
|
package/dist/_libs/giget.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM, n as __require, r as __toDynamicImportESM, t as __commonJS } from "../_chunks/Bqks5huO.mjs";
|
|
2
|
-
import { C as join$2, O as resolve$2, b as dirname$2, w as normalize$2, y as basename$2 } from "./c12.mjs";
|
|
2
|
+
import { C as join$2, O as resolve$2, b as dirname$2, f as readPackageJSON, w as normalize$2, y as basename$2 } from "./c12.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { delimiter, dirname, normalize, resolve } from "node:path";
|
|
5
5
|
import { cwd } from "node:process";
|
|
@@ -704,6 +704,15 @@ async function resolveOperationOptions(options = {}) {
|
|
|
704
704
|
dry: options.dry ?? false
|
|
705
705
|
};
|
|
706
706
|
}
|
|
707
|
+
function getWorkspaceArgs(options) {
|
|
708
|
+
if (!options.workspace) return [];
|
|
709
|
+
const workspacePkg = typeof options.workspace === "string" && options.workspace !== "" ? options.workspace : void 0;
|
|
710
|
+
if (options.packageManager.name === "pnpm") return workspacePkg ? ["--filter", workspacePkg] : ["--workspace-root"];
|
|
711
|
+
if (options.packageManager.name === "npm") return workspacePkg ? ["-w", workspacePkg] : ["--workspaces"];
|
|
712
|
+
if (options.packageManager.name === "yarn") if (!options.packageManager.majorVersion || options.packageManager.majorVersion === "1") return workspacePkg ? ["--cwd", workspacePkg] : ["-W"];
|
|
713
|
+
else return workspacePkg ? ["workspace", workspacePkg] : [];
|
|
714
|
+
return [];
|
|
715
|
+
}
|
|
707
716
|
function parsePackageManagerField(packageManager) {
|
|
708
717
|
const [name, _version] = (packageManager || "").split("@");
|
|
709
718
|
const [version, buildMeta] = _version?.split("+") || [];
|
|
@@ -806,6 +815,58 @@ async function installDependencies(options = {}) {
|
|
|
806
815
|
args: commandArgs
|
|
807
816
|
} };
|
|
808
817
|
}
|
|
818
|
+
async function addDependency(name, options = {}) {
|
|
819
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
820
|
+
const names = Array.isArray(name) ? name : [name];
|
|
821
|
+
if (resolvedOptions.packageManager.name === "deno") {
|
|
822
|
+
for (let i$9 = 0; i$9 < names.length; i$9++) if (!/^(npm|jsr|file):.+$/.test(names[i$9])) names[i$9] = `npm:${names[i$9]}`;
|
|
823
|
+
}
|
|
824
|
+
if (names.length === 0) return {};
|
|
825
|
+
const args = (resolvedOptions.packageManager.name === "yarn" ? [
|
|
826
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
827
|
+
resolvedOptions.global && resolvedOptions.packageManager.majorVersion === "1" ? "global" : "",
|
|
828
|
+
"add",
|
|
829
|
+
resolvedOptions.dev ? "-D" : "",
|
|
830
|
+
...names
|
|
831
|
+
] : [
|
|
832
|
+
resolvedOptions.packageManager.name === "npm" ? "install" : "add",
|
|
833
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
834
|
+
resolvedOptions.dev ? "-D" : "",
|
|
835
|
+
resolvedOptions.global ? "-g" : "",
|
|
836
|
+
...names
|
|
837
|
+
]).filter(Boolean);
|
|
838
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
839
|
+
cwd: resolvedOptions.cwd,
|
|
840
|
+
silent: resolvedOptions.silent
|
|
841
|
+
});
|
|
842
|
+
if (!resolvedOptions.dry && options.installPeerDependencies) {
|
|
843
|
+
const existingPkg = await readPackageJSON(resolvedOptions.cwd);
|
|
844
|
+
const peerDeps = [];
|
|
845
|
+
const peerDevDeps = [];
|
|
846
|
+
for (const _name of names) {
|
|
847
|
+
const pkgName = _name.match(/^(.[^@]+)/)?.[0];
|
|
848
|
+
const pkg = await readPackageJSON(pkgName, { url: resolvedOptions.cwd }).catch(() => ({}));
|
|
849
|
+
if (!pkg.peerDependencies || pkg.name !== pkgName) continue;
|
|
850
|
+
for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
|
|
851
|
+
if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
|
|
852
|
+
if (existingPkg.dependencies?.[peerDependency] || existingPkg.devDependencies?.[peerDependency]) continue;
|
|
853
|
+
(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (peerDeps.length > 0) await addDependency(peerDeps, { ...resolvedOptions });
|
|
857
|
+
if (peerDevDeps.length > 0) await addDevDependency(peerDevDeps, { ...resolvedOptions });
|
|
858
|
+
}
|
|
859
|
+
return { exec: {
|
|
860
|
+
command: resolvedOptions.packageManager.command,
|
|
861
|
+
args
|
|
862
|
+
} };
|
|
863
|
+
}
|
|
864
|
+
async function addDevDependency(name, options = {}) {
|
|
865
|
+
return await addDependency(name, {
|
|
866
|
+
...options,
|
|
867
|
+
dev: true
|
|
868
|
+
});
|
|
869
|
+
}
|
|
809
870
|
|
|
810
871
|
//#endregion
|
|
811
872
|
//#region node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
|
|
@@ -19225,4 +19286,4 @@ async function downloadTemplate(input, options = {}) {
|
|
|
19225
19286
|
var import_proxy = /* @__PURE__ */ __toESM(require_proxy(), 1);
|
|
19226
19287
|
|
|
19227
19288
|
//#endregion
|
|
19228
|
-
export { require_node_fetch_native_DhEqb06g as i, registryProvider as n, require_node as r, downloadTemplate as t };
|
|
19289
|
+
export { addDependency as a, installDependencies as c, require_node_fetch_native_DhEqb06g as i, packageManagers as l, registryProvider as n, addDevDependency as o, require_node as r, detectPackageManager as s, downloadTemplate as t };
|
package/dist/builder.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import "./_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "./_libs/compatx.mjs";
|
|
14
14
|
import "./_libs/klona.mjs";
|
|
15
15
|
import "./_libs/std-env.mjs";
|
|
16
|
-
import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/
|
|
16
|
+
import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/CzeQHoGT.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/tsconfck.mjs";
|
|
19
19
|
import "./_libs/dot-prop.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../_libs/c12.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { a as addDependency, c as installDependencies, l as packageManagers, o as addDevDependency, s as detectPackageManager } from "../../_libs/giget.mjs";
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { addDependency, addDevDependency, detectPackageManager, installDependencies, packageManagers };
|
package/dist/vite.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import "./_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "./_libs/compatx.mjs";
|
|
14
14
|
import "./_libs/klona.mjs";
|
|
15
15
|
import "./_libs/std-env.mjs";
|
|
16
|
-
import "./_chunks/
|
|
16
|
+
import "./_chunks/CzeQHoGT.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/tsconfck.mjs";
|
|
19
19
|
import "./_libs/dot-prop.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.0.1-
|
|
3
|
+
"version": "3.0.1-20251110-004511-201ee906",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"homepage": "https://nitro.build",
|
|
6
6
|
"repository": "nitrojs/nitro",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"nitro": "node ./src/cli/index.ts",
|
|
49
49
|
"release": "pnpm test && pnpm build && changelogen --release --prerelease --push",
|
|
50
50
|
"stub": "obuild --stub",
|
|
51
|
-
"test": "pnpm lint && pnpm test:types && pnpm
|
|
51
|
+
"test": "pnpm lint && pnpm test:types && pnpm test:rollup && pnpm test:rolldown",
|
|
52
|
+
"test:rollup": "NITRO_BUILDER=rollup pnpm vitest",
|
|
52
53
|
"test:rolldown": "NITRO_BUILDER=rolldown pnpm vitest",
|
|
53
54
|
"test:types": "tsc --noEmit"
|
|
54
55
|
},
|
|
@@ -67,7 +68,6 @@
|
|
|
67
68
|
"ohash": "^2.0.11",
|
|
68
69
|
"oxc-minify": "^0.96.0",
|
|
69
70
|
"oxc-transform": "^0.96.0",
|
|
70
|
-
"rollup": "^4.53.1",
|
|
71
71
|
"srvx": "^0.9.5",
|
|
72
72
|
"undici": "^7.16.0",
|
|
73
73
|
"unenv": "^2.0.0-rc.24",
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
"@azure/static-web-apps-cli": "^2.0.7",
|
|
79
79
|
"@cloudflare/workers-types": "^4.20251109.0",
|
|
80
80
|
"@deno/types": "^0.0.1",
|
|
81
|
+
"rollup": "^4.53.1",
|
|
81
82
|
"@hiogawa/vite-plugin-fullstack": "npm:@pi0/vite-plugin-fullstack@0.0.5-pr-1297",
|
|
82
83
|
"@netlify/edge-functions": "^3.0.2",
|
|
83
84
|
"@netlify/functions": "^5.1.0",
|
|
@@ -129,6 +130,7 @@
|
|
|
129
130
|
"mime": "^4.1.0",
|
|
130
131
|
"miniflare": "^4.20251105.0",
|
|
131
132
|
"mlly": "^1.8.0",
|
|
133
|
+
"nypm": "^0.6.2",
|
|
132
134
|
"obuild": "^0.4.1",
|
|
133
135
|
"pathe": "^2.0.3",
|
|
134
136
|
"perfect-debounce": "^2.0.0",
|
|
@@ -164,12 +166,16 @@
|
|
|
164
166
|
"peerDependencies": {
|
|
165
167
|
"rolldown": "*",
|
|
166
168
|
"vite": "^7",
|
|
169
|
+
"rollup": "^4",
|
|
167
170
|
"xml2js": "^0.6.2"
|
|
168
171
|
},
|
|
169
172
|
"peerDependenciesMeta": {
|
|
170
173
|
"rolldown": {
|
|
171
174
|
"optional": true
|
|
172
175
|
},
|
|
176
|
+
"rollup": {
|
|
177
|
+
"optional": true
|
|
178
|
+
},
|
|
173
179
|
"vite": {
|
|
174
180
|
"optional": true
|
|
175
181
|
},
|
|
@@ -177,7 +183,7 @@
|
|
|
177
183
|
"optional": true
|
|
178
184
|
}
|
|
179
185
|
},
|
|
180
|
-
"packageManager": "pnpm@10.
|
|
186
|
+
"packageManager": "pnpm@10.21.0",
|
|
181
187
|
"engines": {
|
|
182
188
|
"node": "^20.19.0 || >=22.12.0"
|
|
183
189
|
}
|
|
File without changes
|