nitropack-nightly 2.12.0-20250715-130505.f0183731 → 2.13.0-20250716-094945.42a23de2

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.
@@ -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
- const rOutput = relative(process.cwd(), nitro.options.output.dir);
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 \`${_compilePathCommandTemplate(
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.deploy) {
1650
+ if (buildInfo.commands?.deploy) {
1659
1651
  nitro.logger.success(
1660
- `You can deploy this build using \`${_compilePathCommandTemplate(
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 _compilePathCommandTemplate(contents, data, base) {
1690
- if (!contents.includes("{{")) {
1691
- return contents;
1677
+ function resolveTmplPath(input, nitro) {
1678
+ if (!input || !input.includes("{{")) {
1679
+ return input;
1692
1680
  }
1693
- return contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
1694
- let val = getProperty(data, match);
1681
+ return input.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
1682
+ let val = getProperty(
1683
+ nitro.options,
1684
+ match
1685
+ );
1695
1686
  if (val) {
1696
- val = relative(base, val);
1687
+ val = relative(nitro.options.rootDir, val);
1697
1688
  } else {
1698
- consola$1.warn(
1699
- `cannot resolve template param '${match}' in ${contents.slice(0, 20)}`
1689
+ nitro.logger.warn(
1690
+ `cannot resolve template param '${match}' in ${input.slice(0, 20)}`
1700
1691
  );
1701
1692
  }
1702
1693
  return val || `${match}`;
@@ -1,4 +1,4 @@
1
- const version = "2.12.0-20250715-130505.f0183731";
1
+ const version = "2.13.0-20250716-094945.42a23de2";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
@@ -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 ./ pages dev",
20
- deploy: "npx wrangler --cwd ./ pages deploy"
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",
@@ -71,8 +71,8 @@ const cloudflarePagesStatic = defineNitroPreset(
71
71
  publicDir: "{{ output.dir }}/{{ baseURL }}"
72
72
  },
73
73
  commands: {
74
- preview: "npx wrangler --cwd ./ pages dev",
75
- deploy: "npx wrangler --cwd ./ pages deploy"
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) => {
@@ -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-13",
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 ./ dev",
122
- deploy: "npx wrangler --cwd ./ deploy"
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: {
@@ -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 ./deno.json start"
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 ./ && deployctl deploy --project=<project_name> {{ output.serverDir }}/index.ts"
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 ./deno.json start"
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 ./ && npm run deploy",
9
- preview: "cd ./ && npm run preview"
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) {
@@ -122,7 +122,7 @@ const netlifyStatic = defineNitroPreset(
122
122
  publicDir: "{{ rootDir }}/dist"
123
123
  },
124
124
  commands: {
125
- preview: "npx serve ./"
125
+ preview: "npx serve {{ output.dir }}"
126
126
  },
127
127
  hooks: {
128
128
  "rollup:before": (nitro) => {
@@ -111,7 +111,7 @@ const netlifyStatic = defineNitroPreset(
111
111
  publicDir: "{{ rootDir }}/dist/{{ baseURL }}"
112
112
  },
113
113
  commands: {
114
- preview: "npx serve ./"
114
+ preview: "npx serve {{ output.dir }}"
115
115
  },
116
116
  hooks: {
117
117
  async compiled(nitro) {
@@ -16,8 +16,8 @@ const vercel = defineNitroPreset(
16
16
  publicDir: "{{ output.dir }}/static/{{ baseURL }}"
17
17
  },
18
18
  commands: {
19
- deploy: "",
20
- preview: ""
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
- deploy: "",
49
- preview: ""
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.0-20250715-130505.f0183731",
3
+ "version": "2.13.0-20250716-094945.42a23de2",
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 nitro dev playground",
81
- "dev:build": "pnpm nitro build playground",
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",