Skip to content

Commit

Permalink
fix: flatten filename for workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar committed Feb 16, 2022
1 parent 1338fc5 commit 7614967
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ export class TurborepoProject extends typescript.TypeScriptProject {

// Adds VS Code settings for ESLint to recognize sub-projects
// https://github.com/Microsoft/vscode-eslint#settings-options
new JsonFile(this, `${this.name}.code-workspace`, {
const codeWorkspaceFilename = this.name.split('/').join('-')
new JsonFile(this, `${codeWorkspaceFilename}.code-workspace`, {
obj: vscodeConfig,
})
}
Expand Down
6 changes: 3 additions & 3 deletions test/__snapshots__/sub-projects.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test/sub-projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ describe('TurborepoProject', () => {
expect.assertions(1)

const project = createProject({
name: 'root',
name: '@foo/root',
vscodeMultiRootWorkspaces: true,
})

const subProjectDir = 'packages/baz'
createSubProject({
name: 'sub',
name: '@foo/sub',
parent: project,
outdir: subProjectDir,
})

const synth = synthProjectSnapshot(project)

expect(JSON.parse(synth[`${project.name}.code-workspace`])).toMatchSnapshot()
expect(JSON.parse(synth['@foo-root.code-workspace'])).toMatchSnapshot()
})


Expand Down

0 comments on commit 7614967

Please sign in to comment.