Skip to content

Commit

Permalink
Fix Node build break on typescript-eslint (#771)
Browse files Browse the repository at this point in the history
typescript-eslint v8.14.0 and earlier were broken by an implementation
change in ESLint v9.15.0. This change makes use of package-lock.json
files to allow resolved dependency versions to be moved forwards in a
more controlled manner, and minimise the chances of unexpected breakages
like this in future.

- Include package-lock.json files to stabilize the Node dependency
  versions resolved across builds.
- Change Makefile targets to use `npm ci` instead of `npm install` so
  that package-lock.json files are honored when resolving dependencies.

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored Nov 18, 2024
1 parent e452fcd commit cc10ac3
Show file tree
Hide file tree
Showing 7 changed files with 12,926 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ build: build-node build-java
.PHONY: build-node
build-node:
cd '$(node_dir)' && \
npm install && \
npm ci && \
npm run build && \
rm -f fabric-gateway-dev.tgz && \
mv $$(npm pack) fabric-gateway-dev.tgz
Expand Down Expand Up @@ -117,15 +117,15 @@ scan-node: scan-node-npm-audit scan-node-osv-scanner
.PHONY: scan-node-npm-audit
scan-node-npm-audit:
cd '$(node_dir)' && \
npm install --package-lock-only && \
npm install --omit=dev --package-lock-only --no-audit && \
npm audit --omit=dev

.PHONY: scan-node-osv-scanner
scan-node-osv-scanner:
go install github.com/google/osv-scanner/cmd/osv-scanner@latest
cd '$(node_dir)' && \
npm install --package-lock-only && \
npm sbom --omit dev --package-lock-only --sbom-format cyclonedx > sbom.json && \
npm install --omit=dev --package-lock-only --no-audit && \
npm sbom --omit=dev --package-lock-only --sbom-format cyclonedx > sbom.json && \
osv-scanner scan --sbom=sbom.json

.PHONY: scan-java
Expand Down Expand Up @@ -174,15 +174,15 @@ scenario-test-go-no-hsm: vendor-chaincode
.PHONY: scenario-test-node
scenario-test-node: vendor-chaincode build-node fabric-ca-client setup-softhsm
cd '$(scenario_dir)/node' && \
rm -rf package-lock.json node_modules && \
npm install && \
npm ci && \
npm install @hyperledger/fabric-gateway@file:../../node/fabric-gateway-dev.tgz && \
npm test

.PHONY: scenario-test-node-no-hsm
scenario-test-node-no-hsm: vendor-chaincode build-node fabric-ca-client
cd '$(scenario_dir)/node' && \
rm -rf package-lock.json node_modules && \
npm install && \
npm ci && \
npm install @hyperledger/fabric-gateway@file:../../node/fabric-gateway-dev.tgz && \
npm run test:no-hsm

.PHONY: scenario-test-java
Expand Down Expand Up @@ -222,7 +222,7 @@ generate-docs:
.PHONY: generate-docs-node
generate-docs-node:
cd '$(node_dir)' && \
npm install && \
npm ci && \
npm run generate-apidoc

.PHONY: generate-docs-java
Expand All @@ -241,7 +241,7 @@ clean: clean-generated clean-node clean-java clean-docs

.PHONY: clean-node
clean-node:
cd '$(node_dir)' && rm -rf package-lock.json node_modules
cd '$(node_dir)' && rm -rf node_modules

.PHONY: clean-java
clean-java:
Expand Down
1 change: 0 additions & 1 deletion node/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ coverage/
*.tgz
src/protos/
apidocs/
package-lock.json
sbom.json
Loading

0 comments on commit cc10ac3

Please sign in to comment.