nitro-nightly 3.0.1-20251106-175629-e46f1ce8 → 3.0.1-20251107-000224-0e58602b
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/vite.build.mjs +1 -1
- package/dist/_build/vite.plugin.mjs +1 -1
- package/dist/_chunks/{BX5q0aQR.mjs → qtb0dNRk.mjs} +9 -11
- package/dist/_presets.mjs +1 -1
- package/dist/builder.mjs +1 -1
- package/dist/runtime/internal/task.mjs +1 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/vite.mjs +1 -1
- package/lib/tsconfig.json +27 -0
- package/package.json +4 -3
package/dist/_build/rolldown.mjs
CHANGED
|
@@ -71,7 +71,7 @@ const getRolldownConfig = (nitro) => {
|
|
|
71
71
|
transform: {
|
|
72
72
|
inject: base.env.inject,
|
|
73
73
|
jsx: {
|
|
74
|
-
runtime: "classic",
|
|
74
|
+
runtime: nitro.options.esbuild?.options?.jsx === "automatic" ? "automatic" : "classic",
|
|
75
75
|
pragma: nitro.options.esbuild?.options?.jsxFactory,
|
|
76
76
|
pragmaFrag: nitro.options.esbuild?.options?.jsxFragment,
|
|
77
77
|
development: nitro.options.dev
|
|
@@ -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/qtb0dNRk.mjs";
|
|
17
17
|
import "../_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "../_libs/dot-prop.mjs";
|
|
19
19
|
import "../_chunks/zV3n76Yk.mjs";
|
|
@@ -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/qtb0dNRk.mjs";
|
|
6
6
|
import { a as prettyPath, n as writeBuildInfo, t as getBuildInfo } from "../_chunks/zV3n76Yk.mjs";
|
|
7
7
|
import { i as scanHandlers } from "../_chunks/thLbatgM.mjs";
|
|
8
8
|
import { i as NodeDevWorker, r as NitroDevApp } from "../_dev.mjs";
|
|
@@ -316,7 +316,10 @@ async function resolvePathOptions(options) {
|
|
|
316
316
|
if (options.serverDir === void 0) options.serverDir = options.srcDir;
|
|
317
317
|
consola$1.warn(`"srcDir" option is deprecated. Please use "serverDir" instead.`);
|
|
318
318
|
}
|
|
319
|
-
if (options.serverDir !== false)
|
|
319
|
+
if (options.serverDir !== false) {
|
|
320
|
+
if (options.serverDir === true) options.serverDir = "server";
|
|
321
|
+
options.serverDir = resolve(options.rootDir, options.serverDir || ".") + "/";
|
|
322
|
+
}
|
|
320
323
|
options.alias ??= {};
|
|
321
324
|
if (!options.static && !options.entry) throw new Error(`Nitro entry is missing! Is "${options.preset}" preset correct?`);
|
|
322
325
|
if (options.entry) options.entry = resolveNitroPath(options.entry, options);
|
|
@@ -1105,7 +1108,7 @@ async function prepareDir(dir) {
|
|
|
1105
1108
|
//#endregion
|
|
1106
1109
|
//#region src/prerender/utils.ts
|
|
1107
1110
|
const allowedExtensions = new Set(["", ".json"]);
|
|
1108
|
-
const linkParents
|
|
1111
|
+
const linkParents = /* @__PURE__ */ new Map();
|
|
1109
1112
|
const HTML_ENTITIES = {
|
|
1110
1113
|
"<": "<",
|
|
1111
1114
|
">": ">",
|
|
@@ -1136,9 +1139,9 @@ async function extractLinks(html, from, res, crawlLinks) {
|
|
|
1136
1139
|
links.push(_link.pathname + _link.search);
|
|
1137
1140
|
}
|
|
1138
1141
|
for (const link of links) {
|
|
1139
|
-
const _parents = linkParents
|
|
1142
|
+
const _parents = linkParents.get(link);
|
|
1140
1143
|
if (_parents) _parents.add(from);
|
|
1141
|
-
else linkParents
|
|
1144
|
+
else linkParents.set(link, new Set([from]));
|
|
1142
1145
|
}
|
|
1143
1146
|
return links;
|
|
1144
1147
|
}
|
|
@@ -1149,7 +1152,7 @@ function getExtension(link) {
|
|
|
1149
1152
|
function formatPrerenderRoute(route) {
|
|
1150
1153
|
let str = ` ├─ ${route.route} (${route.generateTimeMS}ms)`;
|
|
1151
1154
|
if (route.error) {
|
|
1152
|
-
const parents = linkParents
|
|
1155
|
+
const parents = linkParents.get(route.route);
|
|
1153
1156
|
const errorColor = colors[route.error.status === 404 ? "yellow" : "red"];
|
|
1154
1157
|
const errorLead = parents?.size ? "├──" : "└──";
|
|
1155
1158
|
str += `\n │ ${errorLead} ${errorColor(route.error.message)}`;
|
|
@@ -1168,7 +1171,6 @@ function matchesIgnorePattern(path, pattern) {
|
|
|
1168
1171
|
//#endregion
|
|
1169
1172
|
//#region src/prerender/prerender.ts
|
|
1170
1173
|
const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
1171
|
-
const linkParents = /* @__PURE__ */ new Map();
|
|
1172
1174
|
async function prerender(nitro) {
|
|
1173
1175
|
if (nitro.options.noPublicDir) {
|
|
1174
1176
|
nitro.logger.warn("Skipping prerender since `noPublicDir` option is enabled.");
|
|
@@ -1323,11 +1325,7 @@ async function prerender(nitro) {
|
|
|
1323
1325
|
});
|
|
1324
1326
|
if (nitro.options.prerender.failOnError && failedRoutes.size > 0) {
|
|
1325
1327
|
nitro.logger.log("\nErrors prerendering:");
|
|
1326
|
-
for (const route of failedRoutes)
|
|
1327
|
-
const parents = linkParents.get(route.route);
|
|
1328
|
-
parents?.size && `${[...parents.values()].map((link) => colors.gray(` │ └── Linked from ${link}`)).join("\n")}`;
|
|
1329
|
-
nitro.logger.log(formatPrerenderRoute(route));
|
|
1330
|
-
}
|
|
1328
|
+
for (const route of failedRoutes) nitro.logger.log(formatPrerenderRoute(route));
|
|
1331
1329
|
nitro.logger.log("");
|
|
1332
1330
|
throw new Error("Exiting due to prerender errors.");
|
|
1333
1331
|
}
|
package/dist/_presets.mjs
CHANGED
|
@@ -1443,7 +1443,7 @@ function generateBuildConfig(nitro, o11Routes) {
|
|
|
1443
1443
|
function deprecateSWR(nitro) {
|
|
1444
1444
|
if (nitro.options.future.nativeSWR) return;
|
|
1445
1445
|
let hasLegacyOptions = false;
|
|
1446
|
-
for (const [
|
|
1446
|
+
for (const [_key, value] of Object.entries(nitro.options.routeRules)) {
|
|
1447
1447
|
if (_hasProp(value, "isr")) continue;
|
|
1448
1448
|
if (value.cache === false) value.isr = false;
|
|
1449
1449
|
if (_hasProp(value, "static")) {
|
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/qtb0dNRk.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/dot-prop.mjs";
|
|
19
19
|
import { t as getBuildInfo } from "./_chunks/zV3n76Yk.mjs";
|
|
@@ -49,7 +49,7 @@ export function startScheduleRunner() {
|
|
|
49
49
|
}
|
|
50
50
|
const payload = { scheduledTime: Date.now() };
|
|
51
51
|
for (const schedule of scheduledTasks) {
|
|
52
|
-
|
|
52
|
+
new Cron(schedule.cron, async () => {
|
|
53
53
|
await Promise.all(schedule.tasks.map((name) => runTask(name, {
|
|
54
54
|
payload,
|
|
55
55
|
context: {}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -3032,7 +3032,7 @@ interface NitroOptions extends PresetOptions {
|
|
|
3032
3032
|
/**
|
|
3033
3033
|
* Nitro input config (nitro.config)
|
|
3034
3034
|
*/
|
|
3035
|
-
interface NitroConfig extends DeepPartial<Omit<NitroOptions, "routeRules" | "rollupConfig" | "preset" | "compatibilityDate" | "unenv" | "_config" | "_c12">>, C12InputConfig<NitroConfig> {
|
|
3035
|
+
interface NitroConfig extends DeepPartial<Omit<NitroOptions, "routeRules" | "rollupConfig" | "preset" | "compatibilityDate" | "unenv" | "serverDir" | "_config" | "_c12">>, C12InputConfig<NitroConfig> {
|
|
3036
3036
|
preset?: PresetNameInput;
|
|
3037
3037
|
extends?: string | string[] | NitroPreset;
|
|
3038
3038
|
routeRules?: {
|
|
@@ -3041,6 +3041,7 @@ interface NitroConfig extends DeepPartial<Omit<NitroOptions, "routeRules" | "rol
|
|
|
3041
3041
|
rollupConfig?: Partial<RollupConfig>;
|
|
3042
3042
|
compatibilityDate?: CompatibilityDateSpec;
|
|
3043
3043
|
unenv?: Preset | Preset[];
|
|
3044
|
+
serverDir?: boolean | "./" | "./server" | (string & {});
|
|
3044
3045
|
}
|
|
3045
3046
|
interface LoadConfigOptions {
|
|
3046
3047
|
watch?: boolean;
|
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/qtb0dNRk.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/dot-prop.mjs";
|
|
19
19
|
import "./_chunks/zV3n76Yk.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"moduleDetection": "force",
|
|
7
|
+
"isolatedModules": true,
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
|
|
10
|
+
"allowJs": true,
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"allowSyntheticDefaultImports": true,
|
|
18
|
+
"noUncheckedIndexedAccess": true,
|
|
19
|
+
"noImplicitOverride": true,
|
|
20
|
+
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"noImplicitReturns": true,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"useUnknownInCatchVariables": true,
|
|
25
|
+
"noUnusedLocals": true
|
|
26
|
+
}
|
|
27
|
+
}
|
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-20251107-000224-0e58602b",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"homepage": "https://nitro.build",
|
|
6
6
|
"repository": "nitrojs/nitro",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"./vite": "./dist/vite.mjs",
|
|
21
21
|
"./h3": "./lib/deps/h3.mjs",
|
|
22
22
|
"./deps/h3": "./lib/deps/h3.mjs",
|
|
23
|
-
"./deps/ofetch": "./lib/deps/ofetch.mjs"
|
|
23
|
+
"./deps/ofetch": "./lib/deps/ofetch.mjs",
|
|
24
|
+
"./tsconfig": "./lib/tsconfig.json"
|
|
24
25
|
},
|
|
25
26
|
"types": "./lib/index.d.mts",
|
|
26
27
|
"bin": {
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"test:fixture:types": "pnpm stub && node ./test/scripts/gen-fixture-types.ts && cd test/fixture && tsc --noEmit",
|
|
47
48
|
"test:rolldown": "NITRO_BUILDER=rolldown pnpm vitest",
|
|
48
49
|
"test:rollup": "NITRO_BUILDER=rollup pnpm vitest",
|
|
49
|
-
"test:types": "tsc --noEmit
|
|
50
|
+
"test:types": "tsc --noEmit"
|
|
50
51
|
},
|
|
51
52
|
"resolutions": {
|
|
52
53
|
"nitro": "link:.",
|