Skip to content

Commit

Permalink
feat(ts): automate pnpm stuff [CLK-252116] (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahammond authored May 24, 2024
1 parent 4090b74 commit 8537869
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/clickup-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
}

Expand Down
17 changes: 16 additions & 1 deletion test/clickup-ts.test.ts
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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 8537869

Please sign in to comment.