diff --git a/src/clickup-ts.ts b/src/clickup-ts.ts index 6290f0f1..2c2faf72 100644 --- a/src/clickup-ts.ts +++ b/src/clickup-ts.ts @@ -239,6 +239,13 @@ export module clickupTs { if (options.sendSlackWebhookOnRelease !== false) { slackAlert.addReleaseEvent(this, options.sendSlackWebhookOnReleaseOpts); } + + if (this.package.packageManager === javascript.NodePackageManager.PNPM) { + // Automate part of https://app.clickup-stg.com/333/v/dc/ad-757629/ad-3577645 + this.package.addField('packageManager', 'pnpm@9.1.2'); + // necessary to allow minor/patch version updates of pnpm on dev boxes + this.npmrc.addConfig('package-manager-strict', 'false'); + } } } diff --git a/test/clickup-ts.test.ts b/test/clickup-ts.test.ts index c8aa9a63..70c68ee7 100644 --- a/test/clickup-ts.test.ts +++ b/test/clickup-ts.test.ts @@ -1,4 +1,4 @@ -import { Testing } from 'projen'; +import { Testing, javascript } from 'projen'; import { clickupTs } from '../src'; describe('ClickUpTypeScriptProject', () => { @@ -111,6 +111,21 @@ describe('ClickUpTypeScriptProject', () => { expect(matchedFiles).toHaveLength(1); }); }); + describe('pnpm', () => { + const p = new clickupTs.ClickUpTypeScriptProject({ + name: '@time-loop/test', + defaultReleaseBranch: 'main', + packageManager: javascript.NodePackageManager.PNPM, + pnpmVersion: '9', + }); + const synth = Testing.synth(p); + it('packageManager', () => { + expect(synth['package.json'].packageManager).toBe('pnpm@9.1.2'); + }); + it('package-manager-strict=false', () => { + expect(synth['.npmrc']).toMatch(/package-manager-strict=false/); + }); + }); }); describe('normalizeName', () => {