Skip to content

Commit

Permalink
feat: adds packageManager prop
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
moltar committed Feb 7, 2022
1 parent 2333208 commit a931312
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/index.ts
Expand Up @@ -188,6 +188,13 @@ export class TurborepoProject extends typescript.TypeScriptProject {
*/
this.addDevDeps('turbo')

/**
* Adds package manager to prevent turbo warnings
*
* @see https://turborepo.org/docs/reference/codemods#turborepo-1x
*/
this.package.addField('packageManager', this.package.packageManager)

/**
* Finally, turborepo config.
*
Expand Down
10 changes: 9 additions & 1 deletion test/synth.test.ts
Expand Up @@ -11,7 +11,6 @@ describe('TurborepoProject', () => {
expect(synth['package.json'].devDependencies).toHaveProperty('turbo')
})


it('should add itself as a development dependency', () => {
expect.assertions(1)

Expand All @@ -21,6 +20,15 @@ describe('TurborepoProject', () => {
expect(synth['package.json'].devDependencies).toHaveProperty('projen-turborepo')
})

it('should add packageManager prop', () => {
expect.assertions(1)

const project = createProject()
const synth = synthProjectSnapshot(project)

expect(synth['package.json'].packageManager).toBe('yarn')
})

it('should set root package as private', () => {
expect.assertions(1)

Expand Down

0 comments on commit a931312

Please sign in to comment.