Skip to content

Commit

Permalink
build(deps): pin ALL dependency versions in package.json files 2023-0…
Browse files Browse the repository at this point in the history
…7-24

1. Replaced all tilde and caret characters in package.json
files with nothing so that all versions are pinned down
for safety and stability of the build/publishing process.
2. Updated weaver fabric node SDK build to not do an npm install of its
own because the dependencies are already installed by yarn since we've
added the package to the monorepo build.
3. The weaver fabric driver's container build will now ignore the dependency
scripts during npm install because pkcs11's build scripts were failing
due to unknown reasons. We can likely fix this by upgrading the dependencies
versions but I didn't have time to figure out which one is exactly the
one that should be updated to make it so that pkcs11 is also updated.
Disabling the build of the native code is expected to not cause issues
because we already have its build disabled in the root package.json as well.
This makes it likely that it will be okay.
4. Removed the jasmine types from the root package because they
were causing build problems with the weaver tsc compilation.
The proper, longer term solution here is to make the weaver packages'
tsc configuration on-boarded to the monorepo structure, but I did not want
to blow up this commit to be 10x the current size just because of this.

Fixes hyperledger-cacti#2571

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Aug 11, 2023
1 parent ccdaa12 commit cefe5db
Show file tree
Hide file tree
Showing 48 changed files with 13,961 additions and 1,492 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
},
"ghcr.io/devcontainers-contrib/features/kind:1": {
"version": "v0.18.0"
},
"ghcr.io/devcontainers-contrib/features/protoc:1": {
"version": "v3.15.6"
}
}

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_weaver-asset-exchange-besu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ jobs:
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

# PROTOS
- name: Build JS Protos
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_weaver-asset-exchange-fabric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ jobs:
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

# PROTOS
- name: Build JS Protos
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test_weaver-asset-transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,17 @@ jobs:
make build
working-directory: weaver/common/protos-go

- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

# PROTOS
- name: Build JS Protos
run: |
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test_weaver-data-sharing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,17 @@ jobs:
make build
working-directory: weaver/common/protos-go

- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

# PROTOS
- name: Build JS Protos
run: |
Expand Down Expand Up @@ -838,6 +849,17 @@ jobs:
make build
working-directory: weaver/common/protos-go

- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

# PROTOS
- name: Build JS Protos
run: |
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test_weaver-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ jobs:
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

- name: Build JS Protos (Local)
run: |
Expand Down Expand Up @@ -146,6 +157,17 @@ jobs:
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

- name: Build JS Protos (Local)
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/test_weaver-node-pkgs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ jobs:
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

- name: Build JS Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
Expand Down Expand Up @@ -68,6 +80,18 @@ jobs:
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
path: ./.yarn/
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
- run: yarn install

- name: Build JS Protos
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
Expand All @@ -94,8 +118,8 @@ jobs:
with:
node-version: 16.x

- name: NPM INSTALL
run: npm install
- name: Yarn Install
run: yarn install
working-directory: weaver/docs

- name: Build
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"esbenp.prettier-vscode",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
"github.vscode-pull-request-github"
"github.vscode-pull-request-github",
"codeandstuff.package-json-upgrade"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
"author": "hyperledger",
"license": "Apache-2.0",
"devDependencies": {
"@types/chai": "^4.2.16",
"@types/crypto-js": "^4.0.1",
"@types/mocha": "^8.2.2",
"@types/node": "^14.14.37",
"@types/rewire": "^2.5.28",
"chai": "^4.3.4",
"mocha": "^8.3.2",
"sinon": "^10.0.0",
"ts-node": "^9.1.1",
"tslint": "^6.1.3"
"@types/chai": "4.3.5",
"@types/crypto-js": "4.1.1",
"@types/mocha": "8.2.2",
"@types/node": "16.18.40",
"@types/rewire": "2.5.28",
"chai": "4.3.7",
"mocha": "8.4.0",
"sinon": "10.0.0",
"ts-node": "10.9.1"
},
"dependencies": {
"crypto-js": "^4.0.0",
"fabric-shim": "^2.2.1"
"crypto-js": "4.1.1",
"fabric-shim": "2.2.2"
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@
"@lerna-lite/run": "1.17.0",
"@openapitools/openapi-generator-cli": "2.4.14",
"@types/fs-extra": "9.0.12",
"@types/jasminewd2": "2.0.10",
"@types/jest": "27.5.0",
"@types/jest": "28.1.1",
"@types/node": "15.14.7",
"@types/node-fetch": "2.5.12",
"@types/tape": "4.13.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cacti-cmd-gui-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"solid-icons": "1.0.4",
"solid-js": "1.5.7",
"solid-slider": "1.3.9",
"solid-toast": "^0.4.0"
"solid-toast": "0.5.0"
},
"engines": {
"npm": ">=6"
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-cmd-api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"webpack:dev:web": "webpack --env=dev --target=web --config ../../webpack.config.js"
},
"dependencies": {
"@grpc/grpc-js": "1.8.8",
"@grpc/proto-loader": "0.6.4",
"@grpc/grpc-js": "1.9.0",
"@grpc/proto-loader": "0.7.8",
"@hyperledger/cactus-common": "2.0.0-alpha.1",
"@hyperledger/cactus-core": "2.0.0-alpha.1",
"@hyperledger/cactus-core-api": "2.0.0-alpha.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cactus-core-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"axios": "0.21.4"
},
"devDependencies": {
"@grpc/grpc-js": "1.8.8",
"@grpc/proto-loader": "0.6.4",
"@grpc/grpc-js": "1.9.0",
"@grpc/proto-loader": "0.7.8",
"@types/express": "4.17.13",
"@types/google-protobuf": "3.15.5",
"grpc-tools": "1.11.2",
Expand Down
6 changes: 3 additions & 3 deletions weaver/common/policy-dsl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"author": "",
"license": "ISC",
"devDependencies": {
"ava": "^4.3.3",
"jest": "^26.6.3"
"ava": "4.3.3",
"jest": "26.6.3"
},
"dependencies": {
"antlr4": "^4.9.0"
"antlr4": "4.13.0"
}
}
1 change: 0 additions & 1 deletion weaver/common/protos-js/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: build
build:
sh ../get-fabric-protos.sh ../..
npm install --workspaces=false
npm run build

.PHONY: publish
Expand Down
12 changes: 6 additions & 6 deletions weaver/common/protos-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"js"
],
"dependencies": {
"@grpc/grpc-js": "^1.1.3",
"@grpc/proto-loader": "^0.5.5",
"google-protobuf": "^3.21.2",
"grpc": "^1.24.3",
"grpc-tools": "^1.9.1"
"@grpc/grpc-js": "1.9.0",
"@grpc/proto-loader": "0.7.8",
"google-protobuf": "3.21.2",
"grpc": "1.24.11",
"grpc-tools": "1.12.4"
},
"devDependencies": {
"grpc_tools_node_protoc_ts": "^5.0.1"
"grpc_tools_node_protoc_ts": "5.3.3"
},
"author": "Sandeep Nishad",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion weaver/core/drivers/fabric-driver/fabricDriver.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /driver/fabric

ADD .npmrc .
ADD package.json .
RUN npm install --unsafe-perm
RUN yarn install

ADD server /driver/fabric/server
ADD constants /driver/fabric/constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /driver/fabric
ADD protos-js /driver/fabric/protos-js
ADD cacti-weaver-sdk-fabric /driver/fabric/cacti-weaver-sdk-fabric
ADD package.json .
RUN npm install --unsafe-perm
RUN yarn install

ADD server /driver/fabric/server
ADD constants /driver/fabric/constants
Expand All @@ -22,7 +22,7 @@ RUN npm run build
FROM builder-${BUILD_TAG} AS builder

RUN rm -rf node_modules
RUN npm ci --only=production
RUN yarn install --production --frozen-lockfile

FROM node:16-alpine AS prod

Expand Down
8 changes: 2 additions & 6 deletions weaver/core/drivers/fabric-driver/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NETWORK_NAME ?= network1
COMPOSE_ARG ?=

build: .npmrc
npm install --workspaces=false
yarn install
npm run build

protos-js:
Expand All @@ -29,11 +29,7 @@ cacti-weaver-sdk-fabric: protos-js
cp -r ../../../sdks/fabric/interoperation-node-sdk/package.json ./cacti-weaver-sdk-fabric/package.json

build-local: cacti-weaver-sdk-fabric
cp package.json package-remote.json
cp package-local.json package.json
(npm install --workspaces=false --unsafe-perm) || \
(mv package-remote.json package.json && exit 1) # Only if fails
mv package-remote.json package.json # Only if success
yarn install
npm run build

build-image-local: cacti-weaver-sdk-fabric
Expand Down
32 changes: 16 additions & 16 deletions weaver/core/drivers/fabric-driver/package-local.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@fidm/x509": "1.2.1",
"@grpc/grpc-js": "1.9.0",
"@hyperledger/cacti-weaver-protos-js": "file:./protos-js",
"@hyperledger/cacti-weaver-sdk-fabric": "file:./cacti-weaver-sdk-fabric",
"@fidm/x509": "^1.2.1",
"@grpc/grpc-js": "^1.1.1",
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"dotenv": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"fabric-ca-client": "^2.2.8",
"fabric-network": "^2.2.8",
"level": "^8.0.0",
"winston": "^3.3.3"
"@typescript-eslint/eslint-plugin": "5.54.1",
"@typescript-eslint/parser": "5.54.1",
"dotenv": "8.6.0",
"eslint-config-prettier": "8.9.0",
"eslint-plugin-prettier": "3.4.1",
"fabric-ca-client": "2.2.18",
"fabric-network": "2.2.18",
"level": "8.0.0",
"winston": "3.10.0"
},
"devDependencies": {
"patch-package": "^6.2.2",
"@types/node": "^14.0.14",
"typedoc": "^0.23.15",
"typescript": "4.9.5",
"nodemon": "^2.0.4"
"@types/node": "16.11.7",
"nodemon": "2.0.22",
"patch-package": "6.5.1",
"typedoc": "0.24.8",
"typescript": "4.9.5"
}
}
Loading

0 comments on commit cefe5db

Please sign in to comment.