diff --git a/src/index.ts b/src/index.ts index 26b773c..624a9d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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. * diff --git a/test/synth.test.ts b/test/synth.test.ts index aa4bcc9..4d41d3e 100644 --- a/test/synth.test.ts +++ b/test/synth.test.ts @@ -11,7 +11,6 @@ describe('TurborepoProject', () => { expect(synth['package.json'].devDependencies).toHaveProperty('turbo') }) - it('should add itself as a development dependency', () => { expect.assertions(1) @@ -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)