Skip to content

KO-22267 upgrade to nodejs24 and modernise the build pipeline and tests#36

Open
ls-simon-he wants to merge 3 commits intomasterfrom
KO-22267
Open

KO-22267 upgrade to nodejs24 and modernise the build pipeline and tests#36
ls-simon-he wants to merge 3 commits intomasterfrom
KO-22267

Conversation

@ls-simon-he
Copy link
Copy Markdown
Collaborator

KO-22267

  • upgrade nodejs to v24
  • Modernise the build pipeline
  • Update the legacy test files
  • Create the dist files

Notes: this doesn't change the source code which is the only file src/db.js

Comment thread dist/db.js Dismissed
Comment thread dist/db.js Dismissed
Comment thread dist/db.js Dismissed
Comment thread dist/db.js Dismissed
Comment thread dist/db.js Dismissed
Comment thread dist/db.js Dismissed
Comment thread .travis.yml Outdated
language: node_js
node_js:
- 0.12
- 24
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this config file, since we're not using travis anymore

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly .eslintrc as well? It was removed on devDeps/GruntFile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, done.

Comment thread karma.conf.js Outdated
@@ -1,106 +1,71 @@
// Karma configuration
// Generated on Fri Feb 26 2016 11:48:37 GMT+1100 (AUS Eastern Summer Time)
process.env.CHROME_BIN = process.env.CHROME_BIN || require('puppeteer').executablePath();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do it below.

if (!process.env.CHROME_BIN) {
      try {
          process.env.CHROME_BIN = require('puppeteer').executablePath();
      } catch (err) {
          console.warn('[karma] Puppeteer Chrome not available, falling back to system Chrome:', err.message);
          // leave CHROME_BIN unset; karma-chrome-launcher will try `google-chrome`/`chromium` on PATH
      }
  }

2 potential issues:

  • with the current statement, it short-circuits only on truthy CHROME_BIN, not on "Puppeteer is unusable". The || only skips the Puppeteer call when the env var is already set. If CHROME_BIN is empty, Puppeteer is required regardless of whether its Chrome download exists.
  • executablePath() throws when the download was skipped. Puppeteer 21+ uses @puppeteer/browsers and downloads a pinned Chrome for Testing build to ~/.cache/puppeteer during npm install's postinstall.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -8,23 +8,25 @@ jobs:
build:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need to add a PR-time test run as well, for additional checks?

Add a pull_request: trigger that runs npm ci && npm test (CI=true) before this merges. Everything below is untested until that happens.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ls-aljon-gutierrez
Copy link
Copy Markdown

one more thing - the .nvmrc is still set to 5.7.0, which is inconsistent with the update. We might need to bump it to 24

Remove .travis.yml and .eslintrc (both replaced/dropped in this upgrade),
bump .nvmrc to 24 to match engines, harden the Puppeteer fallback in
karma.conf.js so a missing bundled Chrome degrades to system Chrome
instead of throwing, and add a pull_request trigger to the workflow so
build+test runs on PRs (publish stays release-only).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ls-simon-he
Copy link
Copy Markdown
Collaborator Author

one more thing - the .nvmrc is still set to 5.7.0, which is inconsistent with the update. We might need to bump it to 24

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants