Skip to content

Commit adc6d07

Browse files
authored
fix(core): stop adding outdated vscode/cursor rule files to gitignore (#33680)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes legacy additions of `.cursor/rules/nx-rules.mdc` and `.github/instructions/nx.instructions.md` to `.gitignore` across code, templates, and migrations. > > - **.gitignore behavior**: > - Remove logic in `packages/nx/src/command-line/init/implementation/utils.ts` that appended `.cursor/rules/nx-rules.mdc` and `.github/instructions/nx.instructions.md`. > - Clean up root `.gitignore` to exclude those entries. > - Update new workspace templates (`packages/workspace/.../__dot__gitignore`) to omit those entries. > - **Migrations**: > - Remove migration `21-1-0-add-ignore-entries-for-nx-rule-files` from `packages/nx/migrations.json` and delete its implementation and spec. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7863fa5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 804d4c2 commit adc6d07

8 files changed

Lines changed: 0 additions & 84 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ storybook-static
7676

7777
.claude/settings.local.json
7878

79-
.cursor/rules/nx-rules.mdc
8079
.cursor/mcp.json
81-
.github/instructions/nx.instructions.md
8280

8381
# Added by Claude Task Master
8482
# Logs

packages/nx/migrations.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@
121121
"description": "Updates release changelog config based on the breaking changes in Nx v21",
122122
"implementation": "./src/migrations/update-21-0-0/release-changelog-config-changes"
123123
},
124-
"21-1-0-add-ignore-entries-for-nx-rule-files": {
125-
"version": "21.1.0-beta.2",
126-
"description": "Adds **/nx-rules.mdc and **/nx.instructions.md to .gitignore if not present",
127-
"implementation": "./src/migrations/update-21-1-0/add-gitignore-entry"
128-
},
129124
"22-0-0-release-version-config-changes": {
130125
"version": "22.0.0-beta.1",
131126
"description": "Updates release version config based on the breaking changes in Nx v22",

packages/nx/src/command-line/init/implementation/utils.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,6 @@ export function updateGitIgnore(root: string) {
221221
}
222222
lines.push('.nx/workspace-data');
223223
}
224-
if (!contents.includes('.cursor/rules/nx-rules.mdc')) {
225-
if (!sepIncluded) {
226-
lines.push('\n');
227-
sepIncluded = true;
228-
}
229-
lines.push('.cursor/rules/nx-rules.mdc');
230-
}
231-
if (!contents.includes('.github/instructions/nx.instructions.md')) {
232-
if (!sepIncluded) {
233-
lines.push('\n');
234-
sepIncluded = true;
235-
}
236-
lines.push('.github/instructions/nx.instructions.md');
237-
}
238224

239225
writeFileSync(ignorePath, lines.join('\n'), 'utf-8');
240226
} catch {}

packages/nx/src/migrations/update-21-1-0/add-gitignore-entry.spec.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/nx/src/migrations/update-21-1-0/add-gitignore-entry.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/workspace/src/generators/new/files-integrated-repo/__dot__gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ Thumbs.db
4040

4141
.nx/cache
4242
.nx/workspace-data
43-
.cursor/rules/nx-rules.mdc
44-
.github/instructions/nx.instructions.md

packages/workspace/src/generators/new/files-package-based-repo/__dot__gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ Thumbs.db
4040

4141
.nx/cache
4242
.nx/workspace-data
43-
.cursor/rules/nx-rules.mdc
44-
.github/instructions/nx.instructions.md

packages/workspace/src/generators/new/files-root-app/__dot__gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ Thumbs.db
4040

4141
.nx/cache
4242
.nx/workspace-data
43-
.cursor/rules/nx-rules.mdc
44-
.github/instructions/nx.instructions.md

0 commit comments

Comments
 (0)