Skip to content

Commit df676ec

Browse files
authored
Merge pull request #2698 from guardian/ash/wider-peer-range
chore: Specify minimum `aws-cdk` version in peerDependencies instead …
2 parents 11b6d95 + 6c611c8 commit df676ec

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

.changeset/gold-owls-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@guardian/cdk": patch
3+
---
4+
5+
Broaden CDK peer dependency ranges to allow any aws-cdk/construct version provided more recent than the specified version

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
"yargs": "^17.7.2"
6969
},
7070
"peerDependencies": {
71-
"aws-cdk": "2.1018.0",
72-
"aws-cdk-lib": "2.200.1",
73-
"constructs": "10.4.2"
71+
"aws-cdk": "^2.1018.0",
72+
"aws-cdk-lib": "^2.200.1",
73+
"constructs": "^10.4.2"
7474
}
7575
}

script/ci-project-generation

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ npm pack --pack-destination $TMP_DIR
2222
exit 1
2323
fi
2424

25-
npm install guardian-cdk-*.tgz
26-
2725
# Ensure the CLI runs - the exit code should be 0.
28-
npx gu-cdk --version
26+
npx --yes guardian-cdk-*.tgz --version
2927

30-
NODE_ENV=test npx gu-cdk new \
28+
NODE_ENV=test npx --yes guardian-cdk-*.tgz new \
3129
--app integration-test \
3230
--stack cdk \
3331
--stage CODE \

src/bin/commands/new-project/utils/init.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,7 @@ function createPackageJson(outputDirectory: string): void {
8484
].reduce((acc, depName) => ({ ...acc, [depName]: getDevDependency(depName)! }), {});
8585

8686
const cdkDeps: Record<string, string> = {
87-
/*
88-
Do not add `@guardian/cdk` to the generated `package.json` file when in TEST as we'll `npm link` it instead.
89-
See https://docs.npmjs.com/cli/v8/commands/npm-link#caveat
90-
91-
TODO remove this once the `new` command allows opting out of automatic dependency installation
92-
*/
93-
...(!isTest && { "@guardian/cdk": LibraryInfo.VERSION }),
94-
87+
"@guardian/cdk": isTest ? `file:../guardian-cdk-${LibraryInfo.VERSION}.tgz` : LibraryInfo.VERSION,
9588
"aws-cdk": LibraryInfo.AWS_CDK_VERSION,
9689
"aws-cdk-lib": LibraryInfo.AWS_CDK_LIB_VERSION,
9790
constructs: LibraryInfo.CONSTRUCTS_VERSION,

0 commit comments

Comments
 (0)