From 333e2e9dd8f04e8613a5662e4254acb7d6322dfd Mon Sep 17 00:00:00 2001 From: Oleksandr Karpov Date: Thu, 27 Aug 2026 15:40:19 +0300 Subject: [PATCH 1/2] Move CI and engines to Node 18+ for webpack-dev-server v5 webpack-dev-server 5 requires Node >= 18.12.0 and open@10 requires Node >= 18, so the previous `engines: {node: ">=12"}` was no longer truthful and the CI matrix (12.x/14.x/16.x) could not install the dependency tree at all. - engines.node: ">=12" -> ">=18.12.0" - Node CI matrix: [12.x, 14.x, 16.x] -> [18.x, 20.x, 22.x] - Publish workflow: Node 14 -> 22 Both workflows now install with --legacy-peer-deps. That works around a pre-existing conflict unrelated to this change: the root pins tslint ^6.0.0 while tslint-config-airbnb@5.11.2 peer-requires tslint ^5.11.0. npm 6 ignored peer conflicts, but npm >= 7 treats this as fatal, which is why `npm i` fails on every currently supported Node and why CI is red on master today. Working around it here keeps this PR landable and unblocks the publish workflow; untangling the TSLint stack properly belongs in its own change. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/nodejs.yml | 7 +++++-- .github/workflows/npm-publish.yml | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0939beb..636dd49 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [18.x, 20.x, 22.x] steps: - uses: actions/checkout@v1 @@ -18,8 +18,11 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: npm install, build, and test + # --legacy-peer-deps works around a pre-existing conflict unrelated to the + # build: the root pins tslint ^6 while tslint-config-airbnb peer-requires + # tslint ^5. npm >= 7 treats that as fatal, so plain `npm i` cannot install. run: | - npm i + npm i --legacy-peer-deps npm run build npm run test:ci env: diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 09615f5..f0b2ea0 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -9,9 +9,9 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 22 registry-url: https://registry.npmjs.org/ - - run: npm i + - run: npm i --legacy-peer-deps - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/package.json b/package.json index 12850c0..5e16620 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Build a Typescript app without pain", "license": "MIT", "engines": { - "node": ">=12" + "node": ">=18.12.0" }, "bin": { "ffbt": "./dist/cli/entrypoint.js" From e403af9e9f658e2cae4a3a36f0c5a43b001c2637 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpov Date: Thu, 27 Aug 2026 15:45:39 +0300 Subject: [PATCH 2/2] Guard Compiler.watch() result, which is optional in current webpack 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Compiler.watch()` is typed `undefined | Watching` in current webpack 5 releases (it was `Watching` back in 5.75), so dereferencing it in the cleanup callback fails to compile: src/services/webpack/runner/run-compile-watcher.ts(23,13): error TS18048: 'watcher' is possibly 'undefined'. This is pre-existing and not specific to the dev-server migration — the file is byte-identical to master. It stayed hidden because this repo sets `package-lock=false`, so a fresh install drifts webpack from 5.75 to 5.110 within the declared `^5.75.0`, and because CI could not get past `npm i` to reach the build at all. Co-Authored-By: Claude Opus 5 (1M context) --- src/services/webpack/runner/run-compile-watcher.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/webpack/runner/run-compile-watcher.ts b/src/services/webpack/runner/run-compile-watcher.ts index b782a4f..941151d 100644 --- a/src/services/webpack/runner/run-compile-watcher.ts +++ b/src/services/webpack/runner/run-compile-watcher.ts @@ -20,7 +20,9 @@ export class RunWebpackCompileWatcherStrategy implements ServiceRunStrategy { }); cleanupIfError(() => { - watcher.close(() => { + // Compiler.watch() is typed `undefined | Watching` in current webpack 5 + // releases — it yields undefined when the compiler is already watching. + watcher?.close(() => { console.log(" 👍"); }); });