Skip to content

Commit

Permalink
Use Node 20
Browse files Browse the repository at this point in the history
- Remove use of fs-extra since the standard Node fs package provides all required functionality.

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday committed Nov 4, 2023
1 parent 76cc057 commit 9512d2d
Show file tree
Hide file tree
Showing 44 changed files with 1,743 additions and 1,339 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

env:
CHAINCODE_CONTAINER_NODE_VER: 18
CHAINCODE_CONTAINER_NODE_VER: 20
DOCKER_REGISTRY: ${{ github.repository_owner == 'hyperledger' && 'docker.io' || 'ghcr.io' }}

jobs:
Expand All @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- uses: actions/download-artifact@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'
- name: BuildData
id: builddata
run: |
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'
- name: Install/Rebuild/UnitTest
run: |
set -xev
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'

- uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'
- uses: actions/download-artifact@v3
with:
name: node-tgzs
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following [Rush categories](https://rushjs.io/pages/maintainer/add_to_repo/)

### Pre-requisites

* node v18 => recommend to use [nvm](https://github.com/nvm-sh/nvm)
* node v20 => recommend to use [nvm](https://github.com/nvm-sh/nvm)
* rush => `npm install -g @microsoft/rush`

> Note that npm v6 has some bugs that mean adding new dependencies etc are not properly picked up. Longer term we should consider moving to yarn or pnpm. However in practice this isn't a serious problem and has been possible to be worked around by issuing `rm ./common/config/rush/npm-shrinkwrap.json` and then `rush update`
Expand Down
3 changes: 1 addition & 2 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ The dependencies of `fabric-contract-api` and `fabric-shim` will be required.
"name": "chaincode",
"description": "My first exciting chaincode implemented in node.js",
"engines": {
"node": "^12.16.1",
"npm": "^6.4.1"
"node": "^20.9.0"
},
"scripts": {
"test": "mocha....."
Expand Down
9 changes: 5 additions & 4 deletions apis/fabric-contract-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Fabric Shim"
],
"engines": {
"node": "^18.0.0"
"node": "^20.9.0"
},
"license": "Apache-2.0",
"types": "./types/index.d.ts",
Expand All @@ -46,13 +46,14 @@
},
"dependencies": {
"fabric-shim-api": "2.5.4",
"class-transformer": "^0.4.0",
"class-transformer": "^0.5.1",
"fast-safe-stringify": "^2.1.1",
"get-params": "^0.1.2",
"reflect-metadata": "^0.1.13",
"winston": "^3.7.2"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.2",
"ajv": "^6.12.2",
"ajv-cli": "^3.2.1",
"ajv-formats": "2.1.1",
Expand All @@ -62,11 +63,11 @@
"eslint": "^6.6.0",
"gulp": "^4.0.2",
"gulp-debug": "~4.0.0",
"gulp-eslint": "~6.0.0",
"gulp-eslint": "^6.0.0",
"mocha": "9.1.3",
"nyc": "15.1.0",
"rewire": "6.0.0",
"sinon": "13.0.1",
"typescript": "4.4.4"
"typescript": "5.2.2"
}
}
13 changes: 5 additions & 8 deletions apis/fabric-contract-api/test/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
*/
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"sourceMap": true,
"lib": [
"esnext"
]
"sourceMap": true
},
"exclude": [
"node_modules"
"node_modules"
]
}
}
34 changes: 0 additions & 34 deletions apis/fabric-contract-api/types/tsconfig.json

This file was deleted.

3 changes: 1 addition & 2 deletions apis/fabric-shim-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"Fabric Shim"
],
"engines": {
"node": "^18.0.0",
"eslint": "^6.6.0"
"node": "^20.9.0"
},
"types": "./types/index.d.ts",
"license": "Apache-2.0",
Expand Down
37 changes: 0 additions & 37 deletions apis/fabric-shim-api/types/tsconfig.json

This file was deleted.

Loading

0 comments on commit 9512d2d

Please sign in to comment.