diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c3effa692..2a4ebe929 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,7 +1,4 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI +name: Explorer CI on: push: @@ -9,20 +6,19 @@ on: pull_request: workflow_dispatch: +env: + NODE_VERSION: 22.x + jobs: lint: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - name: Cache node modules id: cache-nodemodules @@ -32,10 +28,10 @@ jobs: with: # caching node_modules path: node_modules - key: ${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ matrix.node-version }}-build-${{ env.cache-name }}- - ${{ matrix.node-version }}-build- + ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}- + ${{ env.NODE_VERSION }}-build- - name: Install Dependencies if: steps.cache-nodemodules.outputs.cache-hit != 'true' @@ -46,16 +42,12 @@ jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - name: Cache node modules id: cache-nodemodules @@ -65,10 +57,10 @@ jobs: with: # caching node_modules path: node_modules - key: ${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ matrix.node-version }}-build-${{ env.cache-name }}- - ${{ matrix.node-version }}-build- + ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}- + ${{ env.NODE_VERSION }}-build- - name: Install Dependencies if: steps.cache-nodemodules.outputs.cache-hit != 'true' @@ -86,16 +78,12 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - name: Cache node modules id: cache-nodemodules @@ -105,10 +93,10 @@ jobs: with: # caching node_modules path: node_modules - key: ${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ matrix.node-version }}-build-${{ env.cache-name }}- - ${{ matrix.node-version }}-build- + ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}- + ${{ env.NODE_VERSION }}-build- - name: Install Dependencies if: steps.cache-nodemodules.outputs.cache-hit != 'true' @@ -119,16 +107,12 @@ jobs: typescript-check: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NODE_VERSION }} - name: Cache node modules id: cache-nodemodules @@ -138,10 +122,10 @@ jobs: with: # caching node_modules path: node_modules - key: ${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + key: ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ matrix.node-version }}-build-${{ env.cache-name }}- - ${{ matrix.node-version }}-build- + ${{ env.NODE_VERSION }}-build-${{ env.cache-name }}- + ${{ env.NODE_VERSION }}-build- - name: Install Dependencies if: steps.cache-nodemodules.outputs.cache-hit != 'true' diff --git a/.nvmrc b/.nvmrc index e44a38e08..517f38666 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.12.1 +v22.14.0 diff --git a/README.md b/README.md index 85fe184c9..1d5f4cdf8 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,14 @@ This project uses [Vite](https://vitejs.dev/). You can find information about ho ### Install Node and NPM -The project requires node@18.12.x. Follow installation instructions on [nodejs.org](https://nodejs.org/en/). +The project requires node@22. Follow installation instructions on [nodejs.org](https://nodejs.org/en/). (Recommended) Install using [nvm](https://github.com/nvm-sh/nvm). Make sure to use npm version 8+ by running `npm install -g npm@latest` after you install Node. ### Google BigQuery Setup + This setup is required for the Tokens page of the explorer to function: 1. [Select or create a Cloud Platform project][projects]. @@ -22,6 +23,7 @@ This setup is required for the Tokens page of the explorer to function: 1. [Set up authentication with a service account][auth] Once you have completed these steps and generated the JSON key file, you must populate the following environment variables in the .env file with their corresponding values from the JSON key file: + ``` GOOGLE_APP_PROJECT_ID=your-project-id GOOGLE_APP_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\n... @@ -34,11 +36,12 @@ GOOGLE_APP_CLIENT_EMAIL=your-client-email ## Install, compile, and run -* `npm install` then -* `npm start` for development mode, or -* `npm run build` then `npm run prod-server` for production mode +- `npm install` then +- `npm start` for development mode, or +- `npm run build` then `npm run prod-server` for production mode ### Installing on Apple Silicon + Since `canvas` does not provide pre-built binaries for Apple chips during `npm install` it will try to compile it manually. To get this to succeed you need to install several dependencies by following the instructions [here](https://github.com/Automattic/node-canvas#compiling). ## Running on Parallel Networks @@ -57,9 +60,9 @@ Since `canvas` does not provide pre-built binaries for Apple chips during `npm i ### Run unit tests -* Run tests in watch mode `npm test` -* Run test to produce coverage `npm run test:coverage` -* To open coverage HTML report in app root do `open coverage/index.html` +- Run tests in watch mode `npm test` +- Run test to produce coverage `npm run test:coverage` +- To open coverage HTML report in app root do `open coverage/index.html` ### Debugging Unit Tests in Chrome @@ -84,20 +87,21 @@ Since `canvas` does not provide pre-built binaries for Apple chips during `npm i 1. US English (default) 1. Spanish 1. French -1. Japanese -1. Korean +1. Japanese +1. Korean When updating translation entires or adding new languages consult the guide [Translating](./docs/translating.md). ## Additional Documentation -* [How to define transactions](./src/containers/shared/components/Transaction/README.md) -* [Routing](./docs/routing.md) + +- [How to define transactions](./src/containers/shared/components/Transaction/README.md) +- [Routing](./docs/routing.md) ## React Documentation -* Latest news in [react blog](https://reactjs.org/blog) -* [React documentation](https://reactjs.org/docs) -* [How to think in react](https://reactjs.org/docs/thinking-in-react.html) and break down components +- Latest news in [react blog](https://reactjs.org/blog) +- [React documentation](https://reactjs.org/docs) +- [How to think in react](https://reactjs.org/docs/thinking-in-react.html) and break down components [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquery.googleapis.com [projects]: https://console.cloud.google.com/project diff --git a/package-lock.json b/package-lock.json index 1b3d3599c..fb7508834 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,7 +63,7 @@ "@types/enzyme": "^3.10.12", "@types/jest": "^26.0.24", "@types/lodash": "^4.17.6", - "@types/node": "^18.19.33", + "@types/node": "^22.14.0", "@types/react": "^17.0.39", "@types/react-dom": "^17.0.9", "@typescript-eslint/eslint-plugin": "^7.0.0", @@ -107,7 +107,7 @@ "xrpl": "^4.2.0" }, "engines": { - "node": ">=18.0.0 <19", + "node": ">=22.0.0 <23", "npm": ">=9.0.0 <11.0.0" } }, @@ -5015,11 +5015,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.86", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.86.tgz", - "integrity": "sha512-fifKayi175wLyKyc5qUfyENhQ1dCNI1UNjp653d8kuYcPQN5JhX3dGuP/XmvPTg/xRBn1VTLpbmi+H/Mr7tLfQ==", + "version": "22.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.21.0" } }, "node_modules/@types/normalize-package-data": { @@ -22834,9 +22834,9 @@ "dev": true }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.1", @@ -27576,11 +27576,11 @@ "dev": true }, "@types/node": { - "version": "18.19.86", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.86.tgz", - "integrity": "sha512-fifKayi175wLyKyc5qUfyENhQ1dCNI1UNjp653d8kuYcPQN5JhX3dGuP/XmvPTg/xRBn1VTLpbmi+H/Mr7tLfQ==", + "version": "22.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.21.0" } }, "@types/normalize-package-data": { @@ -41003,9 +41003,9 @@ "dev": true }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.1", diff --git a/package.json b/package.json index 6bb9caf55..673c0780a 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@types/enzyme": "^3.10.12", "@types/jest": "^26.0.24", "@types/lodash": "^4.17.6", - "@types/node": "^18.19.33", + "@types/node": "^22.14.0", "@types/react": "^17.0.39", "@types/react-dom": "^17.0.9", "@typescript-eslint/eslint-plugin": "^7.0.0", @@ -139,7 +139,7 @@ ], "prettier": "@xrplf/prettier-config", "engines": { - "node": ">=18.0.0 <19", + "node": ">=22.0.0 <23", "npm": ">=9.0.0 <11.0.0" } }