nitropack-nightly 2.12.0-20250715-130505.f0183731 → 2.12.2-20250716-173745.6df77925
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/core/index.mjs +17 -26
- package/dist/meta/index.mjs +1 -1
- package/dist/presets/_types.gen.d.ts +7 -7
- package/dist/presets/aws-lambda/preset.mjs +1 -1
- package/dist/presets/cloudflare/preset.mjs +10 -10
- package/dist/presets/deno/preset-legacy.mjs +1 -1
- package/dist/presets/deno/preset.mjs +2 -2
- package/dist/presets/edgio/preset.mjs +2 -2
- package/dist/presets/netlify/legacy/preset.mjs +1 -1
- package/dist/presets/netlify/preset.mjs +1 -1
- package/dist/presets/vercel/preset.mjs +6 -5
- package/package.json +3 -3
package/dist/core/index.mjs
CHANGED
|
@@ -1619,8 +1619,8 @@ async function buildProduction(nitro, rollupConfig) {
|
|
|
1619
1619
|
nitro: version
|
|
1620
1620
|
},
|
|
1621
1621
|
commands: {
|
|
1622
|
-
preview: nitro.options.commands.preview,
|
|
1623
|
-
deploy: nitro.options.commands.deploy
|
|
1622
|
+
preview: resolveTmplPath(nitro.options.commands.preview, nitro),
|
|
1623
|
+
deploy: resolveTmplPath(nitro.options.commands.deploy, nitro)
|
|
1624
1624
|
},
|
|
1625
1625
|
config: {
|
|
1626
1626
|
...Object.fromEntries(
|
|
@@ -1642,26 +1642,14 @@ async function buildProduction(nitro, rollupConfig) {
|
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
1644
|
await nitro.hooks.callHook("compiled", nitro);
|
|
1645
|
-
|
|
1646
|
-
const rewriteRelativePaths = (input) => {
|
|
1647
|
-
return input.replace(/([\s:])\.\/(\S*)/g, `$1${rOutput}/$2`);
|
|
1648
|
-
};
|
|
1649
|
-
if (buildInfo.commands.preview) {
|
|
1645
|
+
if (buildInfo.commands?.preview) {
|
|
1650
1646
|
nitro.logger.success(
|
|
1651
|
-
`You can preview this build using \`${
|
|
1652
|
-
rewriteRelativePaths(buildInfo.commands.preview),
|
|
1653
|
-
nitro.options,
|
|
1654
|
-
nitro.options.rootDir
|
|
1655
|
-
)}\``
|
|
1647
|
+
`You can preview this build using \`${buildInfo.commands?.preview}\``
|
|
1656
1648
|
);
|
|
1657
1649
|
}
|
|
1658
|
-
if (buildInfo.commands
|
|
1650
|
+
if (buildInfo.commands?.deploy) {
|
|
1659
1651
|
nitro.logger.success(
|
|
1660
|
-
`You can deploy this build using \`${
|
|
1661
|
-
rewriteRelativePaths(buildInfo.commands.deploy),
|
|
1662
|
-
nitro.options,
|
|
1663
|
-
nitro.options.rootDir
|
|
1664
|
-
)}\``
|
|
1652
|
+
`You can deploy this build using \`${buildInfo.commands?.deploy}\``
|
|
1665
1653
|
);
|
|
1666
1654
|
}
|
|
1667
1655
|
}
|
|
@@ -1686,17 +1674,20 @@ async function _snapshot(nitro) {
|
|
|
1686
1674
|
})
|
|
1687
1675
|
);
|
|
1688
1676
|
}
|
|
1689
|
-
function
|
|
1690
|
-
if (!
|
|
1691
|
-
return
|
|
1677
|
+
function resolveTmplPath(input, nitro) {
|
|
1678
|
+
if (!input || !input.includes("{{")) {
|
|
1679
|
+
return input;
|
|
1692
1680
|
}
|
|
1693
|
-
return
|
|
1694
|
-
let val = getProperty(
|
|
1681
|
+
return input.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
|
|
1682
|
+
let val = getProperty(
|
|
1683
|
+
nitro.options,
|
|
1684
|
+
match
|
|
1685
|
+
);
|
|
1695
1686
|
if (val) {
|
|
1696
|
-
val = relative(
|
|
1687
|
+
val = relative(nitro.options.rootDir, val);
|
|
1697
1688
|
} else {
|
|
1698
|
-
|
|
1699
|
-
`cannot resolve template param '${match}' in ${
|
|
1689
|
+
nitro.logger.warn(
|
|
1690
|
+
`cannot resolve template param '${match}' in ${input.slice(0, 20)}`
|
|
1700
1691
|
);
|
|
1701
1692
|
}
|
|
1702
1693
|
return val || `${match}`;
|
package/dist/meta/index.mjs
CHANGED
|
@@ -6,13 +6,13 @@ import type { PresetOptions as FirebaseOptions } from "./firebase/preset";
|
|
|
6
6
|
import type { PresetOptions as NetlifyOptions } from "./netlify/preset";
|
|
7
7
|
import type { PresetOptions as VercelOptions } from "./vercel/preset";
|
|
8
8
|
export interface PresetOptions {
|
|
9
|
-
awsAmplify
|
|
10
|
-
awsLambda
|
|
11
|
-
azure
|
|
12
|
-
cloudflare
|
|
13
|
-
firebase
|
|
14
|
-
netlify
|
|
15
|
-
vercel
|
|
9
|
+
awsAmplify?: AwsAmplifyOptions;
|
|
10
|
+
awsLambda?: AwsLambdaOptions;
|
|
11
|
+
azure?: AzureOptions;
|
|
12
|
+
cloudflare?: CloudflareOptions;
|
|
13
|
+
firebase?: FirebaseOptions;
|
|
14
|
+
netlify?: NetlifyOptions;
|
|
15
|
+
vercel?: VercelOptions;
|
|
16
16
|
}
|
|
17
17
|
export declare const presetsWithConfig: readonly ["awsAmplify", "awsLambda", "azure", "cloudflare", "firebase", "netlify", "vercel"];
|
|
18
18
|
export type PresetName = "alwaysdata" | "aws-amplify" | "aws-lambda" | "azure" | "azure-functions" | "azure-swa" | "base-worker" | "bun" | "cleavr" | "cli" | "cloudflare" | "cloudflare-dev" | "cloudflare-durable" | "cloudflare-module" | "cloudflare-module-legacy" | "cloudflare-pages" | "cloudflare-pages-static" | "cloudflare-worker" | "deno" | "deno-deploy" | "deno-server" | "deno-server-legacy" | "digital-ocean" | "edgio" | "firebase" | "firebase-app-hosting" | "flight-control" | "genezio" | "github-pages" | "gitlab-pages" | "heroku" | "iis" | "iis-handler" | "iis-node" | "koyeb" | "layer0" | "netlify" | "netlify-builder" | "netlify-edge" | "netlify-legacy" | "netlify-static" | "nitro-dev" | "nitro-prerender" | "node" | "node-cluster" | "node-listener" | "node-server" | "platform-sh" | "render-com" | "service-worker" | "static" | "stormkit" | "vercel" | "vercel-edge" | "vercel-static" | "winterjs" | "zeabur" | "zeabur-static" | "zerops" | "zerops-static";
|
|
@@ -16,8 +16,8 @@ const cloudflarePages = defineNitroPreset(
|
|
|
16
16
|
entry: "./runtime/cloudflare-pages",
|
|
17
17
|
exportConditions: ["workerd"],
|
|
18
18
|
commands: {
|
|
19
|
-
preview: "npx wrangler --cwd
|
|
20
|
-
deploy: "npx wrangler --cwd
|
|
19
|
+
preview: "npx wrangler --cwd {{ output.dir }} pages dev",
|
|
20
|
+
deploy: "npx wrangler --cwd {{ output.dir }} pages deploy"
|
|
21
21
|
},
|
|
22
22
|
output: {
|
|
23
23
|
dir: "{{ rootDir }}/dist",
|
|
@@ -44,7 +44,7 @@ const cloudflarePages = defineNitroPreset(
|
|
|
44
44
|
hooks: {
|
|
45
45
|
"build:before": async (nitro) => {
|
|
46
46
|
await enableNodeCompat(nitro);
|
|
47
|
-
if (!nitro.options.cloudflare
|
|
47
|
+
if (!nitro.options.cloudflare?.deployConfig) {
|
|
48
48
|
nitro.options.commands.preview = "npx wrangler pages dev {{ output.dir }}";
|
|
49
49
|
nitro.options.commands.deploy = "npx wrangler pages deploy {{ output.dir }}";
|
|
50
50
|
}
|
|
@@ -71,12 +71,12 @@ const cloudflarePagesStatic = defineNitroPreset(
|
|
|
71
71
|
publicDir: "{{ output.dir }}/{{ baseURL }}"
|
|
72
72
|
},
|
|
73
73
|
commands: {
|
|
74
|
-
preview: "npx wrangler --cwd
|
|
75
|
-
deploy: "npx wrangler --cwd
|
|
74
|
+
preview: "npx wrangler --cwd {{ output.dir }} pages dev",
|
|
75
|
+
deploy: "npx wrangler --cwd {{ output.dir }} pages deploy"
|
|
76
76
|
},
|
|
77
77
|
hooks: {
|
|
78
78
|
"build:before": async (nitro) => {
|
|
79
|
-
if (!nitro.options.cloudflare
|
|
79
|
+
if (!nitro.options.cloudflare?.deployConfig) {
|
|
80
80
|
nitro.options.commands.preview = "npx wrangler pages dev {{ output.dir }}";
|
|
81
81
|
nitro.options.commands.deploy = "npx wrangler pages deploy {{ output.dir }}";
|
|
82
82
|
}
|
|
@@ -104,7 +104,7 @@ export const cloudflareDev = defineNitroPreset(
|
|
|
104
104
|
{
|
|
105
105
|
name: "cloudflare-dev",
|
|
106
106
|
aliases: ["cloudflare-module", "cloudflare-durable", "cloudflare-pages"],
|
|
107
|
-
compatibilityDate: "2025-07-
|
|
107
|
+
compatibilityDate: "2025-07-15",
|
|
108
108
|
url: import.meta.url,
|
|
109
109
|
dev: true
|
|
110
110
|
}
|
|
@@ -118,8 +118,8 @@ const cloudflareModule = defineNitroPreset(
|
|
|
118
118
|
},
|
|
119
119
|
exportConditions: ["workerd"],
|
|
120
120
|
commands: {
|
|
121
|
-
preview: "npx wrangler --cwd
|
|
122
|
-
deploy: "npx wrangler --cwd
|
|
121
|
+
preview: "npx wrangler --cwd {{ output.dir }} dev",
|
|
122
|
+
deploy: "npx wrangler --cwd {{ output.dir }} deploy"
|
|
123
123
|
},
|
|
124
124
|
unenv: [unenvCfExternals],
|
|
125
125
|
rollupConfig: {
|
|
@@ -136,7 +136,7 @@ const cloudflareModule = defineNitroPreset(
|
|
|
136
136
|
hooks: {
|
|
137
137
|
"build:before": async (nitro) => {
|
|
138
138
|
await enableNodeCompat(nitro);
|
|
139
|
-
if (!nitro.options.cloudflare
|
|
139
|
+
if (!nitro.options.cloudflare?.deployConfig) {
|
|
140
140
|
nitro.options.commands.preview = "npx wrangler dev {{ output.serverDir }}/index.mjs --assets {{ output.publicDir }}";
|
|
141
141
|
nitro.options.commands.deploy = "npx wrangler deploy {{ output.serverDir }}/index.mjs --assets {{ output.publicDir }}";
|
|
142
142
|
}
|
|
@@ -11,7 +11,7 @@ export const denoServerLegacy = defineNitroPreset(
|
|
|
11
11
|
entry: "./runtime/deno-server",
|
|
12
12
|
exportConditions: ["deno"],
|
|
13
13
|
commands: {
|
|
14
|
-
preview: "deno task --config
|
|
14
|
+
preview: "deno task --config {{ output.dir }}/deno.json start"
|
|
15
15
|
},
|
|
16
16
|
unenv: {
|
|
17
17
|
inject: {
|
|
@@ -12,7 +12,7 @@ const denoDeploy = defineNitroPreset(
|
|
|
12
12
|
serveStatic: "deno",
|
|
13
13
|
commands: {
|
|
14
14
|
preview: "",
|
|
15
|
-
deploy: "cd
|
|
15
|
+
deploy: "cd {{ output.dir }} && deployctl deploy --project=<project_name> ./server/index.ts"
|
|
16
16
|
},
|
|
17
17
|
unenv: unenvDenoPreset,
|
|
18
18
|
rollupConfig: {
|
|
@@ -37,7 +37,7 @@ const denoServer = defineNitroPreset(
|
|
|
37
37
|
entry: "./runtime/deno-server",
|
|
38
38
|
exportConditions: ["deno"],
|
|
39
39
|
commands: {
|
|
40
|
-
preview: "deno task --config
|
|
40
|
+
preview: "deno task --config {{ output.dir }}/deno.json start"
|
|
41
41
|
},
|
|
42
42
|
rollupConfig: {
|
|
43
43
|
external: (id) => id.startsWith("https://"),
|
|
@@ -5,8 +5,8 @@ const edgio = defineNitroPreset(
|
|
|
5
5
|
{
|
|
6
6
|
extends: "node-server",
|
|
7
7
|
commands: {
|
|
8
|
-
deploy: "cd
|
|
9
|
-
preview: "cd
|
|
8
|
+
deploy: "cd {{ output.dir }} && npm run deploy",
|
|
9
|
+
preview: "cd {{ output.dir }} && npm run preview"
|
|
10
10
|
},
|
|
11
11
|
hooks: {
|
|
12
12
|
async compiled(nitro) {
|
|
@@ -16,8 +16,8 @@ const vercel = defineNitroPreset(
|
|
|
16
16
|
publicDir: "{{ output.dir }}/static/{{ baseURL }}"
|
|
17
17
|
},
|
|
18
18
|
commands: {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
preview: "",
|
|
20
|
+
deploy: "npx vercel deploy --prebuilt"
|
|
21
21
|
},
|
|
22
22
|
hooks: {
|
|
23
23
|
"rollup:before": (nitro) => {
|
|
@@ -45,8 +45,8 @@ const vercelEdge = defineNitroPreset(
|
|
|
45
45
|
publicDir: "{{ output.dir }}/static/{{ baseURL }}"
|
|
46
46
|
},
|
|
47
47
|
commands: {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
preview: "",
|
|
49
|
+
deploy: "npx vercel deploy --prebuilt"
|
|
50
50
|
},
|
|
51
51
|
unenv: {
|
|
52
52
|
external: builtnNodeModules.flatMap((m) => `node:${m}`),
|
|
@@ -90,7 +90,8 @@ const vercelStatic = defineNitroPreset(
|
|
|
90
90
|
publicDir: "{{ output.dir }}/static/{{ baseURL }}"
|
|
91
91
|
},
|
|
92
92
|
commands: {
|
|
93
|
-
preview: "npx serve {{ output.publicDir }}"
|
|
93
|
+
preview: "npx serve {{ output.publicDir }}",
|
|
94
|
+
deploy: "npx vercel deploy --prebuilt"
|
|
94
95
|
},
|
|
95
96
|
hooks: {
|
|
96
97
|
"rollup:before": (nitro) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitropack-nightly",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.2-20250716-173745.6df77925",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"repository": "nitrojs/nitro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
],
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "pnpm gen-presets && unbuild",
|
|
80
|
-
"dev": "pnpm
|
|
81
|
-
"dev:build": "pnpm
|
|
80
|
+
"dev": "pnpm -C playground dev",
|
|
81
|
+
"dev:build": "pnpm -C playground build",
|
|
82
82
|
"dev:start": "node playground/.output/server/index.mjs",
|
|
83
83
|
"gen-mirror": "pnpm jiti scripts/gen-mirror.ts",
|
|
84
84
|
"gen-node-compat": "pnpm node-ts scripts/gen-node-compat.ts",
|