Skip to content

Commit

Permalink
Update node version to 18 (#177)
Browse files Browse the repository at this point in the history
* Update node version to 18

* Remove deploy test to check

* Add deploy unit test with one test commented

* Fix lint

* Add deploy unit test with mock

* Update project-template docker image
  • Loading branch information
felipe.fuerback authored Apr 15, 2024
1 parent 33a8c91 commit de08e16
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion chain-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @gala-chain/cli
$ galachain COMMAND
running command...
$ galachain (--version)
@gala-chain/cli/1.1.10 linux-x64 node-v18.17.1
@gala-chain/cli/1.1.10 linux-x64 node-v18.17.0
$ galachain --help [COMMAND]
USAGE
$ galachain COMMAND
Expand Down
4 changes: 2 additions & 2 deletions chain-cli/chaincode-template/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine AS build
FROM node:18-alpine AS build

WORKDIR /usr/src/app

Expand All @@ -8,7 +8,7 @@ RUN npm ci --include=dev
RUN npm run build
RUN npm prune --production

FROM gcr.io/distroless/nodejs16-debian11 as production
FROM gcr.io/distroless/nodejs18-debian11 as production

ARG CC_SERVER_ADDRESS=0.0.0.0
ARG CC_SERVER_PORT=7052
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/chaincode-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/axios": "^0.14.0",
"@types/jest": "^29.5.12",
"@types/node": "^16.11.41",
"@types/node": "18.11.9",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"axios": "^0.27.2",
Expand Down
1 change: 0 additions & 1 deletion chain-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"scripts": {
"clean": "tsc -b --clean",
"build": "shx rm -rf lib && mkdir -p lib && cp -r network lib/ && rsync -a --exclude-from=chaincode-template/.gitignore chaincode-template lib/ && tsc -b && oclif manifest && oclif readme && rm tsconfig.tsbuildinfo",
"build-win": "shx rm -rf lib && tsc -b && oclif manifest && oclif readme && xcopy chaincode-template lib\\chaincode-template /E /I && del tsconfig.tsbuildinfo",
"madge": "madge --circular --warning lib",
"lint": "nx run lint",
"fix": "nx run lint --fix",
Expand Down
10 changes: 6 additions & 4 deletions chain-cli/src/commands/deploy/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ describe("Deploy Command", () => {

jest.spyOn(ux, "prompt").mockResolvedValueOnce("Y");

jest.mocked(deployChaincode).mockResolvedValue({
status: "CC_DEPLOY_SCHEDULED",
chaincode: "chaincode-name",
channel: "channel-name"
jest.mocked(deployChaincode).mockImplementation(async () => {
return {
status: "CC_DEPLOY_SCHEDULED",
chaincode: "chaincode-name",
channel: "channel-name"
};
});

// When
Expand Down
2 changes: 1 addition & 1 deletion chaincode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"devDependencies": {
"@types/elliptic": "*",
"@types/node": "^16.11.41",
"@types/node": "18.11.9",
"@types/setimmediate": "^1.0.2",
"dd-trace": "^4.20.0",
"git-branch-is": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions licenses/licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@
"@types/[email protected]","@types/long","4.0.2","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for long.js","MIT"
"@types/[email protected]","@types/minimatch","3.0.5","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for Minimatch","MIT"
"@types/[email protected]","@types/node","15.14.9","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for Node.js","MIT"
"@types/node@16.11.7","@types/node","16.11.7","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for Node.js","MIT"
"@types/node@16.18.68","@types/node","16.18.68","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for node","MIT"
"@types/node@16.18.96","@types/node","16.18.96","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for node","MIT"
"@types/node@18.11.9","@types/node","18.11.9","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for Node.js","MIT"
"@types/[email protected]","@types/normalize-package-data","2.4.3","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for normalize-package-data","MIT"
"@types/[email protected]","@types/parse-json","4.0.1","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for parse-json","MIT"
"@types/[email protected]","@types/responselike","1.0.2","https://github.com/DefinitelyTyped/DefinitelyTyped","TypeScript definitions for responselike","MIT"
Expand Down
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@nx/workspace": "17.2.8",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest": "29.5.11",
"@types/node": "16.11.7",
"@types/node": "18.11.9",
"@typescript-eslint/eslint-plugin": "6.13.2",
"@typescript-eslint/parser": "6.13.2",
"eslint": "8.55.0",
Expand Down

0 comments on commit de08e16

Please sign in to comment.