From eb74a5e6d1a4c1647aa141ebc926c2a79b57217d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Sun, 26 Jul 2026 14:42:59 +0200 Subject: [PATCH] Require Node.js 22+ Needs a temporary env var for the tasks, until a larger dependency update --- .gitea/workflows/ci.yaml | 4 ++-- .nvmrc | 2 +- AGENTS.md | 8 ++++---- package.json | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 523f9e1..2c38f48 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: - name: Install Node uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 22 - name: Install Dependencies run: npm ci @@ -33,7 +33,7 @@ jobs: name: "Test" runs-on: ubuntu-latest container: - image: cypress/browsers:node16.18.0-chrome107-ff106-edge + image: cypress/browsers:node-22.21.0-chrome-141.0.7390.107-1-ff-144.0-edge-141.0.3537.92-1 timeout-minutes: 10 steps: diff --git a/.nvmrc b/.nvmrc index b6a7d89..8fdd954 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +22 \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index a977898..51fa898 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ Unhosted Ember.js Web UI for [Kosmos Kredits](https://wiki.kosmos.org/Kredits) - **ethers 5** + **@kredits/contracts** for on-chain reads/writes - **ember-concurrency** for async sync tasks; **Ember Services** for state (no Redux, no Ember Data) - **QUnit** + qunit-dom + fetch-mock for tests -- **Node 16** (`.nvmrc`); `>= 14` in engines +- **Node 22** (`.nvmrc`); `>= 22` in engines ## Commands @@ -22,8 +22,7 @@ Unhosted Ember.js Web UI for [Kosmos Kredits](https://wiki.kosmos.org/Kredits) |---|---| | Dev server (RSK testnet) | `npm start` | | Dev against local Hardhat devchain | `npm run start:local` | -| Full lint + test pipeline (CI) | `npm test` | -| Ember/QUnit suite only | `npm run test:ember` | +| Ember/QUnit suite (all tests) | `ember test` | | Interactive test runner | `ember test --server` | | All linters | `npm run lint` | | Lint JS (autofix) | `npm run lint:js -- --fix` | @@ -91,7 +90,7 @@ Read in `config/environment.js` (lines ~102–110). No `.env.example` (`.gitigno - **Framework**: QUnit via `ember-qunit` + `qunit-dom`; `@ember/test-helpers` (`render`, `click`, `fillIn`). - **HTTP mocking**: `fetch-mock` — `tests/test-helper.js` mocks Bitstamp ticker endpoints globally. -- **Runner**: headless Chrome (`testem.js`); CI uses Node 16 via `.github/workflows/ci.yml`. +- **Runner**: headless Chrome (`testem.js`); CI uses Node 22 via `.gitea/workflows/ci.yaml`. - **File patterns**: - `tests/unit//-test.js` — unit tests for services, controllers, routes, models, helpers, utils. - `tests/integration/components//component-test.js` — component rendering tests (PODS layout). @@ -102,6 +101,7 @@ Read in `config/environment.js` (lines ~102–110). No `.env.example` (`.gitigno ## Gotchas - **Mid-migration codebase**: classic and Octane component styles coexist. Linters warn (not error) on legacy patterns; `.template-lintrc.js` keeps a `pending` list of templates still using `{{action}}`. +- **OpenSSL on Node 17+**: `ember-auto-import@1` bundles webpack 4, which hashes with MD4 — dropped by OpenSSL 3 in Node 17+. The `npm` scripts (`start`, `test`, `build`, `build-prod`, `start:local`) prepend `NODE_OPTIONS=--openssl-legacy-provider` to work around this. Direct `npx ember ...` invocations must set the flag manually. Remove once ember-auto-import is upgraded to v2+. - **`release/` is committed build output** — don't hand-edit; regenerated by `npm run build-prod` (auto-staged on `npm version`). - **Deployment is `git push 5apps master`** (5apps static hosting) — pushing to `master` triggers a deploy. Be deliberate about commits/pushes. - **No `.env.example`** — set `WEB3_*` vars inline (see `npm run start:local` for the pattern). diff --git a/package.json b/package.json index d8896ac..5d152a9 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,11 @@ "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*", "lint:hbs": "ember-template-lint .", "lint:js": "eslint .", - "start": "ember serve", - "test": "ember test", - "start:local": "WEB3_PROVIDER_URL=http://localhost:8545 WEB3_CHAIN_ID=1337 WEB3_NETWORK_NAME='Hardhat Devchain' ember serve", - "build": "ember build --environment=production", - "build-prod": "rm -rf release/* && ember build -prod --output-path release", + "start": "NODE_OPTIONS=--openssl-legacy-provider ember serve", + "test": "NODE_OPTIONS=--openssl-legacy-provider ember test", + "start:local": "WEB3_PROVIDER_URL=http://localhost:8545 WEB3_CHAIN_ID=1337 WEB3_NETWORK_NAME='Hardhat Devchain' NODE_OPTIONS=--openssl-legacy-provider ember serve", + "build": "NODE_OPTIONS=--openssl-legacy-provider ember build --environment=production", + "build-prod": "rm -rf release/* && NODE_OPTIONS=--openssl-legacy-provider ember build -prod --output-path release", "preversion": "npm test", "version": "npm run build-prod && git add release/", "deploy": "git push 5apps master" @@ -76,7 +76,7 @@ "web3-utils": "^1.7.3" }, "engines": { - "node": ">= 14" + "node": ">= 22" }, "ember": { "edition": "octane"