Skip to content

Commit dd7de1d

Browse files
authored
fix: add missing git ignored files for the migrate command (#1240)
1 parent b47b9b5 commit dd7de1d

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

.changeset/stupid-gifts-stick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
fix: add missing git ignored files for the migrate command

packages/cloudflare/src/cli/commands/migrate.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,29 @@ async function migrateCommand(args: { forceInstall: boolean }): Promise<void> {
136136
} catch (error) {
137137
logger.error("Failed to update package.json", (error as Error).message);
138138
logger.warn(
139-
"\nPlease ensure that your package.json contains the following scripts:\n" +
140-
console.log(
141-
[...Object.entries(openNextScripts)].map(([key, value]) => ` - ${key}: ${value}`).join("\n")
142-
) +
143-
"\n"
139+
`Please ensure that your package.json contains the following scripts:
140+
${[...Object.entries(openNextScripts)].map(([k, v]) => ` - ${k}: ${v}`).join("\n")}
141+
`
144142
);
145143
}
146144

147145
const gitIgnoreExists = fs.existsSync(".gitignore");
148146
printStepTitle(`${gitIgnoreExists ? "Updating" : "Creating"} .gitignore file`);
149-
conditionalAppendFileSync(".gitignore", "# OpenNext\n.open-next\n", {
150-
appendIf: (content) => !content.includes(".open-next"),
151-
appendPrefix: "\n",
152-
});
147+
conditionalAppendFileSync(
148+
".gitignore",
149+
`# OpenNext
150+
.open-next
151+
152+
# wrangler files
153+
.wrangler
154+
.dev.vars*
155+
!.dev.vars.example
156+
`,
157+
{
158+
appendIf: (content) => !content.includes(".open-next"),
159+
appendPrefix: "\n",
160+
}
161+
);
153162

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

0 commit comments

Comments
 (0)