nitropack-nightly 2.11.14-20250704-090507.e6624f7b → 2.12.0-20250713-204442.4753575e
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/cli/dev.mjs +0 -1
- package/dist/core/index.mjs +44 -28
- package/dist/kit/index.d.mts +1 -1
- package/dist/kit/index.d.ts +1 -1
- package/dist/meta/index.mjs +1 -1
- package/dist/presets/_nitro/nitro-dev.mjs +2 -1
- package/dist/presets/_resolve.d.ts +2 -1
- package/dist/presets/_resolve.mjs +7 -1
- package/dist/shared/{nitro.2TeRLAUU.d.mts → nitro.Befw1Azc.d.mts} +1 -0
- package/dist/shared/{nitro.2TeRLAUU.d.ts → nitro.Befw1Azc.d.ts} +1 -0
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +17 -17
package/dist/cli/dev.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -716,54 +716,65 @@ async function loadOptions(configOverrides = {}, opts = {}) {
|
|
|
716
716
|
return options;
|
|
717
717
|
}
|
|
718
718
|
async function _loadUserConfig(configOverrides = {}, opts = {}) {
|
|
719
|
-
let presetOverride = configOverrides.preset || process.env.NITRO_PRESET || process.env.SERVER_PRESET;
|
|
720
|
-
if (configOverrides.dev) {
|
|
721
|
-
presetOverride = "nitro-dev";
|
|
722
|
-
}
|
|
723
719
|
configOverrides = klona(configOverrides);
|
|
724
720
|
globalThis.defineNitroConfig = globalThis.defineNitroConfig || ((c) => c);
|
|
725
721
|
let compatibilityDate = configOverrides.compatibilityDate || opts.compatibilityDate || (process.env.NITRO_COMPATIBILITY_DATE || process.env.SERVER_COMPATIBILITY_DATE || process.env.COMPATIBILITY_DATE);
|
|
726
722
|
const { resolvePreset } = await import('nitropack/presets');
|
|
723
|
+
let preset = configOverrides.preset || process.env.NITRO_PRESET || process.env.SERVER_PRESET;
|
|
727
724
|
const loadedConfig = await (opts.watch ? watchConfig : loadConfig)({
|
|
728
725
|
name: "nitro",
|
|
729
726
|
cwd: configOverrides.rootDir,
|
|
730
727
|
dotenv: opts.dotenv ?? configOverrides.dev,
|
|
731
728
|
extend: { extendKey: ["extends", "preset"] },
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
729
|
+
defaults: NitroDefaults,
|
|
730
|
+
jitiOptions: {
|
|
731
|
+
alias: {
|
|
732
|
+
nitropack: "nitropack/config",
|
|
733
|
+
"nitropack/config": "nitropack/config"
|
|
734
|
+
}
|
|
735
735
|
},
|
|
736
|
-
async
|
|
737
|
-
const getConf = (key) => configOverrides[key] ??
|
|
736
|
+
async overrides({ rawConfigs }) {
|
|
737
|
+
const getConf = (key) => configOverrides[key] ?? rawConfigs.main?.[key] ?? rawConfigs.rc?.[key] ?? rawConfigs.packageJson?.[key];
|
|
738
738
|
if (!compatibilityDate) {
|
|
739
739
|
compatibilityDate = getConf("compatibilityDate");
|
|
740
740
|
}
|
|
741
|
-
const framework =
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
741
|
+
const framework = getConf("framework");
|
|
742
|
+
const isCustomFramework = framework?.name && framework.name !== "nitro";
|
|
743
|
+
if (!preset) {
|
|
744
|
+
preset = getConf("preset");
|
|
745
|
+
}
|
|
746
|
+
if (configOverrides.dev) {
|
|
747
|
+
preset = preset && preset !== "nitro-dev" ? await resolvePreset(preset, {
|
|
747
748
|
static: getConf("static"),
|
|
749
|
+
dev: true,
|
|
748
750
|
compatibilityDate: compatibilityDate || fallbackCompatibilityDate
|
|
749
|
-
}))?._meta?.name
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
"nitropack/config": "nitropack/config"
|
|
751
|
+
}).then((p) => p?._meta?.name).catch(() => "nitro-dev") : "nitro-dev";
|
|
752
|
+
} else if (!preset) {
|
|
753
|
+
preset = await resolvePreset("", {
|
|
754
|
+
static: getConf("static"),
|
|
755
|
+
dev: false,
|
|
756
|
+
compatibilityDate: compatibilityDate || fallbackCompatibilityDate
|
|
757
|
+
}).then((p) => p?._meta?.name);
|
|
757
758
|
}
|
|
759
|
+
return {
|
|
760
|
+
...configOverrides,
|
|
761
|
+
preset,
|
|
762
|
+
typescript: {
|
|
763
|
+
generateRuntimeConfigTypes: !isCustomFramework,
|
|
764
|
+
...getConf("typescript"),
|
|
765
|
+
...configOverrides.typescript
|
|
766
|
+
}
|
|
767
|
+
};
|
|
758
768
|
},
|
|
759
769
|
async resolve(id) {
|
|
760
|
-
const
|
|
770
|
+
const preset2 = await resolvePreset(id, {
|
|
761
771
|
static: configOverrides.static,
|
|
762
|
-
compatibilityDate: compatibilityDate || fallbackCompatibilityDate
|
|
772
|
+
compatibilityDate: compatibilityDate || fallbackCompatibilityDate,
|
|
773
|
+
dev: configOverrides.dev
|
|
763
774
|
});
|
|
764
|
-
if (
|
|
775
|
+
if (preset2) {
|
|
765
776
|
return {
|
|
766
|
-
config: klona(
|
|
777
|
+
config: klona(preset2)
|
|
767
778
|
};
|
|
768
779
|
}
|
|
769
780
|
},
|
|
@@ -772,12 +783,17 @@ async function _loadUserConfig(configOverrides = {}, opts = {}) {
|
|
|
772
783
|
const options = klona(loadedConfig.config);
|
|
773
784
|
options._config = configOverrides;
|
|
774
785
|
options._c12 = loadedConfig;
|
|
775
|
-
const _presetName = (loadedConfig.layers || []).find((l) => l.config?._meta?.name)?.config?._meta?.name ||
|
|
786
|
+
const _presetName = (loadedConfig.layers || []).find((l) => l.config?._meta?.name)?.config?._meta?.name || preset;
|
|
776
787
|
options.preset = _presetName;
|
|
777
788
|
options.compatibilityDate = resolveCompatibilityDates(
|
|
778
789
|
compatibilityDate,
|
|
779
790
|
options.compatibilityDate
|
|
780
791
|
);
|
|
792
|
+
if (options.dev && options.preset !== "nitro-dev") {
|
|
793
|
+
consola.info(
|
|
794
|
+
`Enabled \`${options.preset}\` emulation in development mode.`
|
|
795
|
+
);
|
|
796
|
+
}
|
|
781
797
|
return options;
|
|
782
798
|
}
|
|
783
799
|
|
package/dist/kit/index.d.mts
CHANGED
package/dist/kit/index.d.ts
CHANGED
package/dist/meta/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineNitroPreset } from "nitropack/kit";
|
|
2
2
|
const nitroDev = defineNitroPreset(
|
|
3
3
|
{
|
|
4
|
-
extends: "node",
|
|
5
4
|
entry: "./runtime/nitro-dev",
|
|
6
5
|
output: {
|
|
7
6
|
dir: "{{ buildDir }}/dev",
|
|
@@ -9,12 +8,14 @@ const nitroDev = defineNitroPreset(
|
|
|
9
8
|
publicDir: "{{ buildDir }}/dev"
|
|
10
9
|
},
|
|
11
10
|
externals: { trace: false },
|
|
11
|
+
serveStatic: true,
|
|
12
12
|
inlineDynamicImports: true,
|
|
13
13
|
// externals plugin limitation
|
|
14
14
|
sourceMap: true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
name: "nitro-dev",
|
|
18
|
+
dev: true,
|
|
18
19
|
url: import.meta.url
|
|
19
20
|
}
|
|
20
21
|
);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type CompatibilityDateSpec } from "compatx";
|
|
2
2
|
import type { NitroPreset, NitroPresetMeta } from "nitropack/types";
|
|
3
|
-
export declare function resolvePreset(name: string, opts
|
|
3
|
+
export declare function resolvePreset(name: string, opts?: {
|
|
4
4
|
static?: boolean;
|
|
5
5
|
compatibilityDate?: false | CompatibilityDateSpec;
|
|
6
|
+
dev?: boolean;
|
|
6
7
|
}): Promise<(NitroPreset & {
|
|
7
8
|
_meta?: NitroPresetMeta;
|
|
8
9
|
}) | undefined>;
|
|
@@ -10,7 +10,10 @@ const _stdProviderMap = {
|
|
|
10
10
|
azure_static: "azure",
|
|
11
11
|
cloudflare_pages: "cloudflare"
|
|
12
12
|
};
|
|
13
|
-
export async function resolvePreset(name, opts) {
|
|
13
|
+
export async function resolvePreset(name, opts = {}) {
|
|
14
|
+
if (name === ".") {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
14
17
|
const _name = kebabCase(name) || provider;
|
|
15
18
|
const _compatDates = opts.compatibilityDate ? resolveCompatibilityDatesFromEnv(opts.compatibilityDate) : false;
|
|
16
19
|
const matches = allPresets.filter((preset2) => {
|
|
@@ -18,6 +21,9 @@ export async function resolvePreset(name, opts) {
|
|
|
18
21
|
if (!names.includes(_name)) {
|
|
19
22
|
return false;
|
|
20
23
|
}
|
|
24
|
+
if (opts.dev && !preset2._meta.dev || !opts.dev && preset2._meta.dev) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
21
27
|
if (_compatDates) {
|
|
22
28
|
const _date = _compatDates[_stdProviderMap[preset2._meta.stdName]] || _compatDates[preset2._meta.stdName] || _compatDates[preset2._meta.name] || _compatDates.default;
|
|
23
29
|
if (_date && preset2._meta.compatibilityDate && new Date(preset2._meta.compatibilityDate) > new Date(_date)) {
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App, Router, H3Event, RouterMethod } from 'h3';
|
|
2
2
|
import { FetchRequest, FetchOptions, FetchResponse } from 'ofetch';
|
|
3
|
-
import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.
|
|
4
|
-
export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.
|
|
3
|
+
import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.Befw1Azc.mjs';
|
|
4
|
+
export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.Befw1Azc.mjs';
|
|
5
5
|
import { Hookable } from 'hookable';
|
|
6
6
|
import { NitroRuntimeHooks as NitroRuntimeHooks$1 } from 'nitropack';
|
|
7
7
|
import { AbstractRequest, AbstractResponse } from 'node-mock-http';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App, Router, H3Event, RouterMethod } from 'h3';
|
|
2
2
|
import { FetchRequest, FetchOptions, FetchResponse } from 'ofetch';
|
|
3
|
-
import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.
|
|
4
|
-
export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.
|
|
3
|
+
import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.Befw1Azc.js';
|
|
4
|
+
export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.Befw1Azc.js';
|
|
5
5
|
import { Hookable } from 'hookable';
|
|
6
6
|
import { NitroRuntimeHooks as NitroRuntimeHooks$1 } from 'nitropack';
|
|
7
7
|
import { AbstractRequest, AbstractResponse } from 'node-mock-http';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitropack-nightly",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-20250713-204442.4753575e",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"repository": "nitrojs/nitro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@rollup/plugin-terser": "^0.4.4",
|
|
110
110
|
"@vercel/nft": "^0.29.4",
|
|
111
111
|
"archiver": "^7.0.1",
|
|
112
|
-
"c12": "^3.0
|
|
112
|
+
"c12": "^3.1.0",
|
|
113
113
|
"chokidar": "^4.0.3",
|
|
114
114
|
"citty": "^0.1.6",
|
|
115
115
|
"compatx": "^0.2.0",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"defu": "^6.1.4",
|
|
123
123
|
"destr": "^2.0.5",
|
|
124
124
|
"dot-prop": "^9.0.0",
|
|
125
|
-
"esbuild": "^0.25.
|
|
125
|
+
"esbuild": "^0.25.6",
|
|
126
126
|
"escape-string-regexp": "^5.0.0",
|
|
127
127
|
"etag": "^1.8.1",
|
|
128
128
|
"exsolve": "^1.0.7",
|
|
@@ -146,10 +146,10 @@
|
|
|
146
146
|
"ohash": "^2.0.11",
|
|
147
147
|
"pathe": "^2.0.3",
|
|
148
148
|
"perfect-debounce": "^1.0.0",
|
|
149
|
-
"pkg-types": "^2.
|
|
149
|
+
"pkg-types": "^2.2.0",
|
|
150
150
|
"pretty-bytes": "^6.1.1",
|
|
151
151
|
"radix3": "^1.1.2",
|
|
152
|
-
"rollup": "^4.
|
|
152
|
+
"rollup": "^4.45.0",
|
|
153
153
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
154
154
|
"scule": "^1.3.0",
|
|
155
155
|
"semver": "^7.7.2",
|
|
@@ -162,21 +162,21 @@
|
|
|
162
162
|
"uncrypto": "^0.1.3",
|
|
163
163
|
"unctx": "^2.4.1",
|
|
164
164
|
"unenv": "^2.0.0-rc.18",
|
|
165
|
-
"unimport": "^5.0
|
|
165
|
+
"unimport": "^5.1.0",
|
|
166
166
|
"unplugin-utils": "^0.2.4",
|
|
167
167
|
"unstorage": "^1.16.0",
|
|
168
168
|
"untyped": "^2.0.0",
|
|
169
169
|
"unwasm": "^0.3.9",
|
|
170
170
|
"youch": "4.1.0-beta.8",
|
|
171
|
-
"youch-core": "^0.3.
|
|
171
|
+
"youch-core": "^0.3.3"
|
|
172
172
|
},
|
|
173
173
|
"devDependencies": {
|
|
174
174
|
"@azure/functions": "^3.5.1",
|
|
175
175
|
"@azure/static-web-apps-cli": "^2.0.6",
|
|
176
|
-
"@cloudflare/workers-types": "^4.
|
|
176
|
+
"@cloudflare/workers-types": "^4.20250712.0",
|
|
177
177
|
"@deno/types": "^0.0.1",
|
|
178
|
-
"@netlify/edge-functions": "^2.15.
|
|
179
|
-
"@scalar/api-reference": "^1.
|
|
178
|
+
"@netlify/edge-functions": "^2.15.6",
|
|
179
|
+
"@scalar/api-reference": "^1.32.6",
|
|
180
180
|
"@types/archiver": "^6.0.3",
|
|
181
181
|
"@types/aws-lambda": "^8.10.150",
|
|
182
182
|
"@types/estree": "^1.0.8",
|
|
@@ -188,21 +188,21 @@
|
|
|
188
188
|
"@types/xml2js": "^0.4.14",
|
|
189
189
|
"@vitest/coverage-v8": "^3.2.4",
|
|
190
190
|
"automd": "^0.4.0",
|
|
191
|
-
"changelogen": "^0.6.
|
|
191
|
+
"changelogen": "^0.6.2",
|
|
192
192
|
"edge-runtime": "^4.0.1",
|
|
193
|
-
"eslint": "^9.
|
|
193
|
+
"eslint": "^9.31.0",
|
|
194
194
|
"eslint-config-unjs": "^0.4.2",
|
|
195
195
|
"execa": "^9.6.0",
|
|
196
|
-
"expect-type": "^1.2.
|
|
196
|
+
"expect-type": "^1.2.2",
|
|
197
197
|
"firebase-admin": "^12.7.0",
|
|
198
198
|
"firebase-functions": "^4.9.0",
|
|
199
|
-
"get-port-please": "^3.
|
|
200
|
-
"miniflare": "^4.
|
|
199
|
+
"get-port-please": "^3.2.0",
|
|
200
|
+
"miniflare": "^4.20250709.0",
|
|
201
201
|
"ohash-v1": "npm:ohash@^1.1.6",
|
|
202
|
-
"prettier": "^3.6.
|
|
202
|
+
"prettier": "^3.6.2",
|
|
203
203
|
"typescript": "^5.8.3",
|
|
204
204
|
"unbuild": "^3.5.0",
|
|
205
|
-
"undici": "^7.
|
|
205
|
+
"undici": "^7.11.0",
|
|
206
206
|
"vitest": "^3.2.4",
|
|
207
207
|
"xml2js": "^0.6.2"
|
|
208
208
|
},
|