Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-gifts-stick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/cloudflare": patch
---

fix: add missing git ignored files for the migrate command
27 changes: 18 additions & 9 deletions packages/cloudflare/src/cli/commands/migrate.ts
Comment thread
vicb marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,29 @@ async function migrateCommand(args: { forceInstall: boolean }): Promise<void> {
} catch (error) {
logger.error("Failed to update package.json", (error as Error).message);
logger.warn(
"\nPlease ensure that your package.json contains the following scripts:\n" +
console.log(
[...Object.entries(openNextScripts)].map(([key, value]) => ` - ${key}: ${value}`).join("\n")
) +
"\n"
`Please ensure that your package.json contains the following scripts:
${[...Object.entries(openNextScripts)].map(([k, v]) => ` - ${k}: ${v}`).join("\n")}
`
Comment thread
vicb marked this conversation as resolved.
);
}

const gitIgnoreExists = fs.existsSync(".gitignore");
printStepTitle(`${gitIgnoreExists ? "Updating" : "Creating"} .gitignore file`);
conditionalAppendFileSync(".gitignore", "# OpenNext\n.open-next\n", {
appendIf: (content) => !content.includes(".open-next"),
appendPrefix: "\n",
});
conditionalAppendFileSync(
".gitignore",
`# OpenNext
.open-next

# wrangler files
.wrangler
.dev.vars*
Comment thread
vicb marked this conversation as resolved.
Comment thread
vicb marked this conversation as resolved.
!.dev.vars.example
`,
{
appendIf: (content) => !content.includes(".open-next"),
Comment thread
vicb marked this conversation as resolved.
appendPrefix: "\n",
}
);

const nextConfig = findNextConfig({ appPath: projectDir });

Expand Down
Loading