From e75c8ca46248b0d4a44fcbec4c6e667679e4f6c6 Mon Sep 17 00:00:00 2001 From: Aleksei Menshutin Date: Fri, 3 Jul 2026 11:52:17 +0300 Subject: [PATCH 1/2] Fix ci-ets: pin @types/node@18 for the ArkAnalyzer build ArkAnalyzer's npm install pulls the floating latest @types/node, whose new d.ts files (e.g. ffi.d.ts) use syntax that ArkAnalyzer's bundled TypeScript cannot parse, so `npm run build` fails with TS1139/TS1005 errors and the whole ci-ets job dies before any Gradle test runs. Pin a compatible @types/node major right after npm install. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b1c150d0..9a87cbd96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,6 +135,10 @@ jobs: cd $DEST_DIR npm install + # ArkAnalyzer's bundled TypeScript cannot parse the d.ts files of the + # latest floating @types/node (e.g. ffi.d.ts uses newer syntax and + # breaks `npm run build` with TS1139 etc.); pin a compatible major. + npm install --no-save @types/node@18 npm run build - name: Run ETS tests From a4f82adc331b40e9ddaa61af27e5c8717bc6473e Mon Sep 17 00:00:00 2001 From: Aleksei Menshutin Date: Fri, 3 Jul 2026 12:14:43 +0300 Subject: [PATCH 2/2] Fix ci-ets: pin @types/node in the manifest instead of a second npm install A follow-up `npm install --no-save @types/node@18` re-resolves the npm tree and prunes ohos-typescript, which ArkAnalyzer's postinstall script installs with --no-save (it is absent from package.json), so the build fails with TS2307. Pin @types/node via `npm pkg set` BEFORE the single `npm install` instead: the pin then survives resolution and postinstall keeps ohos-typescript in place. Verified locally: `npm run build` produces out/src/save/serializeArkIR.js. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a87cbd96..c99046c50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,11 +134,15 @@ jobs: echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV cd $DEST_DIR + # ArkAnalyzer's bundled TypeScript (ohos-typescript 4.9.5) cannot parse + # the d.ts files of the latest floating @types/node (e.g. ffi.d.ts uses + # newer syntax and breaks `npm run build` with TS1139 etc.), so pin a + # compatible major IN THE MANIFEST before the single `npm install`. + # NB: do not run a second `npm install ` afterwards — it re-resolves + # the tree and prunes ohos-typescript, which the postinstall script adds + # with --no-save (i.e. it is absent from package.json). + npm pkg set 'devDependencies.@types/node=18' npm install - # ArkAnalyzer's bundled TypeScript cannot parse the d.ts files of the - # latest floating @types/node (e.g. ffi.d.ts uses newer syntax and - # breaks `npm run build` with TS1139 etc.); pin a compatible major. - npm install --no-save @types/node@18 npm run build - name: Run ETS tests