Skip to content

chore: 2026 Q4 stack upgrade (EMBED-590) - #474

Draft
tuna1207 wants to merge 6 commits into
masterfrom
feat/stack-upgrade
Draft

tuna1207 wants to merge 6 commits into
masterfrom
feat/stack-upgrade

Conversation

@tuna1207

@tuna1207 tuna1207 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Motivation and Context

Modernize CustomAuth to the 2026 Q4 stack policy: Node 24/26, npm 12, LavaMoat harden, TypeScript + Oxlint/Oxfmt via @toruslabs/torus-scripts@9, Changesets release PR, and MetaMask security scanner. Shared acceptance criteria live in EMBED-573.

Jira Link

Description

Step 4 is blocking this PR

Runtime prerequisite majors are not adopted. This draft stays blocked until both release-adoption gates publish a new release:

  • EMBED-588 torus.js — latest is still 17.2.3 (2026-08-17)
  • EMBED-586 broadcast-channel — latest is still 13.3.0 (2026-08-17)

Those two still depend on eccrypto 7, constants 16, http-helpers 9, and metadata-helpers 8. Bumping CustomAuth's own copies now (eccrypto 8, constants 17, http-helpers 10, metadata-helpers 9, fetch-node-details 17, session-manager 6) would install two majors of each side by side. Tooling and CI landed without them. Resume step 4 with npm view and --min-release-age=0 once both gates publish.

What landed

  • GitHub policy: CODEOWNERS (examples/), PR template Motivation section, Dependabot (npm and github-actions, weekly, 3-day cooldown)
  • Tooling: torus-scripts@8 / ESLint / Prettier → Vite+ (vp), @toruslabs/config@5, Oxlint/Oxfmt, @lavamoat/harden moderate
  • Engines: node >=24.22.0, npm >=12, .nvmrc 26, @types/node ^26.6.6
  • Package entries: main / module / unpkg / jsdelivr unchanged; types moved from dist/lib.cjs/types/index.d.ts to dist/lib.cjs/index.d.ts
  • Dropped unused @babel/runtime peer
  • CI: validate (Node 24.22.0 and 26), release-pr (Changesets, no publish), security-code-scanner; vue-app S3/CloudFront deploy on master uses STS vars.AWS_ROLE_ARN plus Wiz sensor

Majors taken

  • @toruslabs/torus-scripts 8 → 9.0.1, @toruslabs/config 4 → 5, Oxlint presets replace ESLint configs, TypeScript 5 → 7, @types/node 25 → 26, vite-plus / Changesets / harden added

Majors skipped (step 4)

  • @toruslabs/torus.js, @toruslabs/broadcast-channel, and the dependent majors listed above

Scan / audit

  • harden check: moderate 3/3
  • npm audit: 12 left (7 low / 5 moderate) — deepmerge prototype advisory (no in-range fix without an API change); toruslabs stack waiting on step 4; minimatch via eslint-plugin-tsdoc transitive from the oxlint preset
  • CodeQL stays on the default setup (no second workflow). Semgrep runs through the MetaMask security-code-scanner. KICS and Trivy do not apply (library).
  • Oxlint gap: vitest(require-mock-type-parameters) warnings only (0 errors)

Settings this PR cannot change

  • Allow GitHub Actions to create pull requests (needed for release-pr)
  • Create vars.AWS_ROLE_ARN and secrets.WIZ_SENSOR_TOKEN before the first master deploy
  • Confirm secret scanning, push protection, and branch protection in the org UI
  • Do not publish. release-packages stays manual after the release PR merges.

How has this been tested?

  • Node 24.22.1: npm ci, harden, check, build, typecheck, tests (42)
  • Node 26.13.0: same
  • Packed tarball includes dist/lib.{cjs,esm}/index.{js,d.ts} and serviceworker/
  • require and ESM import of the packed build
  • examples/vue-app build with a local pack
  • Auth-flow smoke (manual) — not run
  • nextjs / angular / vite-react example builds — not run
  • passwordless-frontend runtime integration — not run

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Made with Cursor

tuna1207 and others added 5 commits November 9, 2026 21:07
- CODEOWNERS: give examples/ to the product team
- PR template: add Motivation and Context section
- Dependabot: npm and github-actions, weekly, 3-day cooldown

Co-authored-by: Cursor <cursoragent@cursor.com>
- Node >=24.22.0, npm >=12, .nvmrc 26, @types/node ^26
- Replace torus-scripts 8, ESLint and Prettier with vp pack/lint/fmt,
  @toruslabs/oxlint-config-typescript and formatPreset()
- @toruslabs/config 5 (library profile, DOM libs added)
- Add .npmrc policy (min-release-age, allow-scripts-pin) and @lavamoat/harden
- Changesets config (baseBranch master, public access)
- Fix strictNullChecks errors surfaced by config 5
- Remove legacy torus.config.js, eslint/prettier/vitest configs
- Pin vite and vitest overrides to vite-plus 1.5.0

Co-authored-by: Cursor <cursoragent@cursor.com>
…590)

- validate: Node 24.22.0 and 26, npm 12, npm ci, harden check, check,
  build, typecheck, tests, changeset status (PRs), pack dry-run
- release-pr: manual Changesets release PR on master, does not publish
- security-code-scanner: MetaMask reusable scanner pinned to v2.1.1
- vue-app demo deploy moved to validate on master, using STS role
  from vars.AWS_ROLE_ARN plus Wiz sensor; static AWS keys removed

Co-authored-by: Cursor <cursoragent@cursor.com>
- bowser ^2.14.1 -> ^2.15.0
- @sentry/core ^10.45.0 -> ^10.78.0 (dev and optional peer)
- typescript ^7 -> ^7.0.2
- npm audit fix for in-range advisories; remaining advisories are
  transitive or need a major (deepmerge, minimatch via eslint-plugin-tsdoc)

Co-authored-by: Cursor <cursoragent@cursor.com>
- @babel/runtime peer removed: no build step or source import needs it
- Changeset for @toruslabs/customauth (major): Node/npm engines,
  Vite+ build, types path move, babel peer removal

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@socket-security

socket-security Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Comment thread .github/workflows/validate.yml Fixed
Comment thread .github/workflows/validate.yml Fixed
- Replaced the S3 sync action with a direct AWS CLI command for improved reliability and simplicity.
- Removed unnecessary permissions for id-token in the workflow configuration.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

2 participants