-
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(npmrc): automatically manage pnpm and node versions [INFRA-33946] (
#313) * feat(npmrc): automatically manage pnpm and node versions [INFRA-33946] * cdk is a subclass of ts * maybe leave the package-manager-strict=false ? --------- Co-authored-by: Andrew Hammond <[email protected]>
- Loading branch information
1 parent
76a46f4
commit 8aa1502
Showing
5 changed files
with
225 additions
and
6 deletions.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 +1,5 @@ | ||
import path from 'path'; | ||
import { Testing } from 'projen'; | ||
import { javascript, Testing } from 'projen'; | ||
import { requiredParams } from './requiredParams'; | ||
import { clickupCdk } from '../src'; | ||
import { datadogServiceCatalog } from '../src/datadog-service-catalog'; | ||
|
@@ -51,6 +51,32 @@ describe('ClickUpCdkTypeScriptApp', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('pnpm', () => { | ||
p = new clickupCdk.ClickUpCdkTypeScriptApp({ | ||
...requiredParams, | ||
packageManager: javascript.NodePackageManager.PNPM, | ||
}); | ||
const synth = Testing.synth(p); | ||
it('packageManager', () => { | ||
expect(synth['package.json'].packageManager).toBe('[email protected]'); | ||
}); | ||
|
||
const npmrcEntries = [ | ||
// 'package-manager-strict=false', | ||
'manage-package-manager-versions=true', | ||
'use-node-version=22.13.1', | ||
]; | ||
it.each(npmrcEntries)('%s', (npmrcEntry) => { | ||
expect(synth['.npmrc']).toContain(npmrcEntry); | ||
}); | ||
|
||
['.npmrc', 'package.json'].forEach((file) => { | ||
test(file, () => { | ||
expect(synth[file]).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
|
@@ -93,6 +119,27 @@ describe('ClickUpCdkConstructLibrary', () => { | |
const releaseFile = synth['.github/workflows/release.yml']; | ||
expect(releaseFile).toMatchSnapshot(); | ||
}); | ||
|
||
describe('pnpm', () => { | ||
p = new clickupCdk.ClickUpCdkConstructLibrary({ | ||
...commonProps, | ||
packageManager: javascript.NodePackageManager.PNPM, | ||
}); | ||
const synth = Testing.synth(p); | ||
it('packageManager', () => { | ||
expect(synth['package.json'].packageManager).toBe('[email protected]'); | ||
}); | ||
|
||
const npmrcEntries = [ | ||
'package-manager-strict=false', | ||
'manage-package-manager-versions=true', | ||
'use-node-version=22.13.1', | ||
'node-linker=hoisted', | ||
]; | ||
it.each(npmrcEntries)('%s', (npmrcEntry) => { | ||
expect(synth['.npmrc']).toContain(npmrcEntry); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
|
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 |
---|---|---|
|
@@ -120,10 +120,16 @@ describe('ClickUpTypeScriptProject', () => { | |
}); | ||
const synth = Testing.synth(p); | ||
it('packageManager', () => { | ||
expect(synth['package.json'].packageManager).toBe('[email protected].4'); | ||
expect(synth['package.json'].packageManager).toBe('[email protected].5'); | ||
}); | ||
it('package-manager-strict=false', () => { | ||
expect(synth['.npmrc']).toMatch(/package-manager-strict=false/); | ||
|
||
const npmrcEntries = [ | ||
'package-manager-strict=false', | ||
'manage-package-manager-versions=true', | ||
'use-node-version=22.13.1', | ||
]; | ||
it.each(npmrcEntries)('%s', (npmrcEntry) => { | ||
expect(synth['.npmrc']).toContain(npmrcEntry); | ||
}); | ||
}); | ||
}); | ||
|