Skip to content

Commit 7609a87

Browse files
committed
fix: regression from 0.5.x: write .gitignore to new projects
1 parent 408141d commit 7609a87

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/create/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { createVanilla } from "./create-vanilla";
33
import * as p from "@clack/prompts";
44
import { cancelable, spinnerify } from "@solid-cli/utils/ui";
55
import { createStart } from "./create-start";
6-
import { getTemplatesList, StartTemplate, VanillaTemplate } from "./utils/constants";
6+
import { getTemplatesList, GIT_IGNORE, StartTemplate, VanillaTemplate } from "./utils/constants";
77
import { detectPackageManager } from "@solid-cli/utils/package-manager";
88
import { insertAtEnd } from "@solid-cli/utils/fs";
9-
import { existsSync } from "node:fs";
9+
import { existsSync, writeFileSync } from "node:fs";
10+
import { join } from "node:path";
1011
export { createVanilla, createStart };
1112
export const createSolid = (version: string) =>
1213
defineCommand({
@@ -75,6 +76,8 @@ export const createSolid = (version: string) =>
7576
fn: () => createVanilla({ template: template as VanillaTemplate, destination: projectName }, transpileToJS),
7677
});
7778
}
79+
// Add .gitignore
80+
writeFileSync(join(projectName, ".gitignore"), GIT_IGNORE);
7881
// Add "Created with Solid CLI" text to bottom of README
7982
if (existsSync(`${projectName}/README.md`))
8083
await insertAtEnd(

packages/create/src/utils/constants.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
export const GIT_IGNORE = `
2-
dist
1+
export const GIT_IGNORE = `dist
32
.solid
43
.output
54
.vercel

0 commit comments

Comments
 (0)