Skip to content

Commit 279cddf

Browse files
KTrain5169fengmk2
andauthored
docs: clarify gitignore strategy for JetBrains (#2378)
I forgot to adjust this and decided it's easier if this was done instead, since thje root .gitignore would need to be modified. --------- Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent b8ab58f commit 279cddf

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

docs/guide/ide-integration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ You can also manually set up the IDE configuration to match your Vite+ setup:
151151
</project>
152152
```
153153

154-
Often, `.idea` folders are gitignored in a project, even the `externalDependencies.xml` file. Adding the `.idea/.gitignore` file with the following content will help ensure that it is present:
154+
Often, `.idea` folders are gitignored in a project, even the `externalDependencies.xml` file, which is used to tell your IDE what plugins should be used for the workspace.
155155

156-
```gitignore [.idea/.gitignore]
157-
!externalDependencies.xml
156+
Please make sure to add this line to your main `.gitignore` file, to ensure that the file will be included:
157+
158+
```gitignore [.gitignore]
159+
!.idea/externalDependencies.xml
158160
```

packages/cli/src/utils/__tests__/editor.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,6 @@ describe('writeEditorConfigs', () => {
665665
expect(oxfmtSettingsXml).toContain(
666666
'<option name="preferOxfmtCodeStyleSettings" value="true" />',
667667
);
668-
669-
const gitignore = fs.readFileSync(path.join(projectRoot, '.idea', '.gitignore'), 'utf8');
670-
expect(gitignore).toBe('**\n!externalDependencies.xml\n');
671668
});
672669

673670
it('writes workspace.xml with the resolved package manager', async () => {
@@ -709,8 +706,5 @@ describe('writeEditorConfigs', () => {
709706
'utf8',
710707
);
711708
expect(oxfmtSettingsXml).toContain('<component name="OxfmtSettings">');
712-
713-
const gitignore = fs.readFileSync(path.join(projectRoot, '.idea', '.gitignore'), 'utf8');
714-
expect(gitignore).toBe('**\n!externalDependencies.xml\n');
715709
});
716710
});

packages/cli/src/utils/editor.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ const JETBRAINS_OXFMT_SETTINGS = `<?xml version="1.0" encoding="UTF-8"?>
130130
</project>
131131
`;
132132

133-
const JETBRAINS_GITIGNORE_ADDITION = `**
134-
!externalDependencies.xml
135-
`;
136-
137133
type EditorConfigValue = Record<string, unknown> | string;
138134

139135
export const EDITORS = [
@@ -163,7 +159,6 @@ export const EDITORS = [
163159
// Placeholder; writeEditorConfig() regenerates this with the resolved package manager.
164160
'workspace.xml': jetbrainsWorkspaceConfig(PackageManager.pnpm),
165161
'OxfmtSettings.xml': JETBRAINS_OXFMT_SETTINGS,
166-
'.gitignore': JETBRAINS_GITIGNORE_ADDITION,
167162
},
168163
},
169164
] as const;

0 commit comments

Comments
 (0)