-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ts): automate pnpm stuff [CLK-252116] (#273)
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', '[email protected]'); | ||
// necessary to allow minor/patch version updates of pnpm on dev boxes | ||
this.npmrc.addConfig('package-manager-strict', 'false'); | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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('[email protected]'); | ||
}); | ||
it('package-manager-strict=false', () => { | ||
expect(synth['.npmrc']).toMatch(/package-manager-strict=false/); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('normalizeName', () => { | ||
|