mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-15 06:10:32 +00:00
## Summary
- Switch bundler from `@vercel/ncc` to `rollup` with
`@rollup/plugin-commonjs`, `@rollup/plugin-node-resolve`,
`@rollup/plugin-json`, and `@rollup/plugin-typescript`
- Add `"type": "module"` to `package.json` for ESM support
- Upgrade all `@actions/*` dependencies to their latest major versions
(`@actions/core` v3, `@actions/exec` v3, `@actions/cache` v6,
`@actions/glob` v0.6, `@actions/io` v3)
- Remove old ncc artifacts (`dist/licenses.txt`,
`dist/sourcemap-register.js`)
## Why
The `@actions/toolkit` packages v3+ are ESM-only and can't be bundled by
ncc (which uses webpack with CJS `require()`). This is what's blocking
#435 (renovate `@actions/exec` v3 upgrade). The official
`actions/typescript-action` template has already migrated to rollup.
## Test plan
- [ ] CI passes (`npm run all` — format, lint, package)
- [ ] `check-dist` workflow passes (dist/index.js matches build output)
- [ ] Integration tests pass on all platforms (ubuntu, macos, windows,
alpine)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Moderate risk because it changes the action’s build/bundling pipeline
and module format (CJS→ESM), which can break runtime execution or
dependency resolution if the generated `dist/` output differs across
environments.
>
> **Overview**
> Migrates the GitHub Action build from `@vercel/ncc` (CommonJS) to a
Rollup-based ESM bundle, adding `rollup.config.ts` and updating
TypeScript settings to `NodeNext` to support ESM output.
>
> Updates `package.json` to `"type": "module"`, switches the packaging
script to Rollup, and upgrades `@actions/*` dependencies to their latest
major (ESM-only) versions. The checked-in `dist/` artifacts are
regenerated accordingly (including license output) and legacy
ncc-specific artifacts are removed.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
59e728e570. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
29 lines
662 B
TypeScript
29 lines
662 B
TypeScript
import commonjs from '@rollup/plugin-commonjs'
|
|
import json from '@rollup/plugin-json'
|
|
import nodeResolve from '@rollup/plugin-node-resolve'
|
|
import typescript from '@rollup/plugin-typescript'
|
|
import license from 'rollup-plugin-license'
|
|
import path from 'path'
|
|
|
|
const config = {
|
|
input: 'src/index.ts',
|
|
output: {
|
|
esModule: true,
|
|
file: 'dist/index.js',
|
|
format: 'es',
|
|
sourcemap: true
|
|
},
|
|
plugins: [
|
|
typescript(),
|
|
nodeResolve({ preferBuiltins: true }),
|
|
commonjs({ ignoreTryCatch: false }),
|
|
json(),
|
|
license({
|
|
thirdParty: {
|
|
output: path.resolve('dist', 'licenses.txt')
|
|
}
|
|
})
|
|
]
|
|
}
|
|
|
|
export default config
|