Skip to content

refactor: migrate to ESM + esbuild from @vercel/ncc#28

Merged
ronaldtse merged 3 commits intomainfrom
feat/esm-esbuild-migration
Feb 16, 2026
Merged

refactor: migrate to ESM + esbuild from @vercel/ncc#28
ronaldtse merged 3 commits intomainfrom
feat/esm-esbuild-migration

Conversation

@ronaldtse
Copy link
Copy Markdown
Contributor

Summary

This PR migrates the GitHub Action from CommonJS + @vercel/ncc to ESM + esbuild, following the same pattern used in the site-gen action.

Changes

Build System

  • Replace @vercel/ncc with esbuild for faster builds (~100x faster)
  • Update build command to use inline esbuild with CJS output format

Dependencies Updated

  • @actions/core: v1.x → v3.0.0 (now uses named exports)
  • @actions/exec: v1.x → v3.0.0
  • @actions/tool-cache: v1.x → v3.0.0
  • @actions/io: v1.x → v3.0.2
  • vitest: v2.x → v3.2.4
  • typescript: v5.5 → v5.8.3
  • esbuild: added v0.25.2
  • @vercel/ncc: removed

TypeScript Configuration

  • module: "commonjs" → "ESNext"
  • moduleResolution: "bundler"
  • Added verbatimModuleSyntax: true for explicit type imports

Source Code Updates

  • Changed all namespace imports to named imports
  • Added .js extensions to all relative imports
  • Used import type for type-only imports

Benefits

  • Security: Fixes 8 moderate vulnerabilities (undici, vite)
  • Performance: esbuild is significantly faster than ncc
  • Modern: Uses latest @actions/* packages with proper ESM support
  • Maintainability: Aligns with site-gen action architecture

Test Results

All 118 tests pass.

Test plan

  • Verify build completes successfully with npm run build
  • Verify all tests pass with npm test
  • Verify dist/index.js is generated correctly
  • Test in a real workflow (integration tests should cover this)

Comment thread .github/workflows/check-dist.yml Fixed
@ronaldtse ronaldtse force-pushed the feat/esm-esbuild-migration branch from 35cf48b to 8cb75c2 Compare February 14, 2026 12:21
- Add explicit permissions to check-dist.yml workflow
- Add semver validation for version input to prevent command injection
- Fix vitest to use run mode instead of watch mode
@ronaldtse ronaldtse merged commit 0b6a68d into main Feb 16, 2026
38 checks passed
@ronaldtse ronaldtse deleted the feat/esm-esbuild-migration branch February 16, 2026 09:41
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