Skip to content

Commit

Permalink
chore: ensure nodedjs/eks dependencies are deduplicated
Browse files Browse the repository at this point in the history
In particular yarn may link two copies of @pulumi/pulumi into the provider causing difficult to diagnose failures. This
change applies the approach from @pulumi/pulumi-awsx where the dependencies are proactively deduplicated at build time.

Also note that `yarn install` should receive a --frozen-lockfile option to actually respect the lockfile during build.
  • Loading branch information
t0yv0 committed Dec 23, 2024
1 parent c81c828 commit 6517513
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 165 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ install_java_sdk::
#Intentionally empty for CI / CD templating

nodejs/eks/node_modules: nodejs/eks/package.json nodejs/eks/yarn.lock
yarn install --cwd nodejs/eks --no-progress
yarn install --frozen-lockfile --cwd nodejs/eks --no-progress
cd nodejs/eks && yarn run check-duplicate-deps
@touch nodejs/eks/node_modules

nodejs/eks/bin: nodejs/eks/node_modules ${EKS_SRC}
Expand Down
7 changes: 5 additions & 2 deletions nodejs/eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"format": "prettier --list-different --write .",
"lint-check": "yarn run format-check && tslint -c ../tslint.json -p tsconfig.json",
"lint": "yarn run format && tslint -c ../tslint.json -p tsconfig.json --fix",
"test": "jest"
"test": "jest",
"dedupe-deps": "yarn-deduplicate",
"check-duplicate-deps": "yarn-deduplicate --fail"
},
"homepage": "https://pulumi.com",
"repository": {
Expand Down Expand Up @@ -47,7 +49,8 @@
"prettier": "^2.8.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.6.2"
"typescript": "^4.6.2",
"yarn-deduplicate": "^6.0.2"
},
"pulumi": {
"resource": true
Expand Down
Loading

0 comments on commit 6517513

Please sign in to comment.