diff --git a/.changeset/bump-vinext-autoconfig.md b/.changeset/bump-vinext-autoconfig.md new file mode 100644 index 0000000000..e7057f4e71 --- /dev/null +++ b/.changeset/bump-vinext-autoconfig.md @@ -0,0 +1,7 @@ +--- +"@cloudflare/autoconfig": patch +--- + +Use vinext 1.4.6 or later when configuring Next.js projects + +Autoconfig now runs `vinext init` with `vinext@^1.4.6` (previously `^1.3.0`), so newly configured Next.js projects pick up the latest vinext fixes. diff --git a/packages/autoconfig/src/frameworks/next.ts b/packages/autoconfig/src/frameworks/next.ts index aada5889c0..cef6bd592e 100644 --- a/packages/autoconfig/src/frameworks/next.ts +++ b/packages/autoconfig/src/frameworks/next.ts @@ -12,7 +12,7 @@ import type { const VINEXT_MINIMUM_NEXT_VERSION = "16.0.0"; // `--name` requires vinext 1.2.0 or later -const VINEXT_PACKAGE = "vinext@^1.3.0"; +const VINEXT_PACKAGE = "vinext@^1.4.6"; const OPENNEXT_CONFIGURATION_DESCRIPTION = "Configuring project for Next.js with OpenNext by running `@opennextjs/cloudflare migrate`"; diff --git a/packages/autoconfig/tests/frameworks/next.test.ts b/packages/autoconfig/tests/frameworks/next.test.ts index 1addeb3896..218d699e31 100644 --- a/packages/autoconfig/tests/frameworks/next.test.ts +++ b/packages/autoconfig/tests/frameworks/next.test.ts @@ -80,7 +80,7 @@ describe("Next.js framework configure()", () => { expect(runCommand).toHaveBeenCalledWith( [ "npx", - "vinext@^1.3.0", + "vinext@^1.4.6", "init", "--platform=cloudflare", "--cdn-cache=none", @@ -110,7 +110,7 @@ describe("Next.js framework configure()", () => { ); expect(vi.mocked(runCommand).mock.calls[0]?.[0]).toEqual( - expect.arrayContaining(["pnpm", "dlx", "vinext@^1.3.0", "init"]) + expect.arrayContaining(["pnpm", "dlx", "vinext@^1.4.6", "init"]) ); expect(results.buildCommandOverride).toBe("pnpm vite build"); }); @@ -139,7 +139,7 @@ describe("Next.js framework configure()", () => { const results = await framework.configure(getOptions("cf")); expect(vi.mocked(runCommand).mock.calls[0]?.[0]).toEqual( - expect.arrayContaining(["npx", "vinext@^1.3.0", "init"]) + expect.arrayContaining(["npx", "vinext@^1.4.6", "init"]) ); expect(results.buildTool).toBe("vite"); expect(framework.configurationDescription).toBe( @@ -155,7 +155,7 @@ describe("Next.js framework configure()", () => { await framework.configure(getOptions("cf")); expect(vi.mocked(runCommand).mock.calls[0]?.[0]).toContain( - "vinext@^1.3.0" + "vinext@^1.4.6" ); });