chore: migrate from ncc (CJS) to rollup (ESM)

Switch bundler from @vercel/ncc to rollup to support ESM-only
@actions/toolkit v3 packages. This upgrades all @actions/* dependencies
to their latest major versions and adds "type": "module" to package.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jdx 2026-04-11 13:41:40 +00:00
parent a25e4af358
commit 45d1740529
No known key found for this signature in database
GPG key ID: 584DADE86724B407
8 changed files with 119888 additions and 123366 deletions

241078
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

1191
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load diff

1
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

939
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
"description": "mise tool setup action",
"version": "4.0.1",
"author": "jdx",
"type": "module",
"private": true,
"repository": {
"type": "git",
@ -22,7 +23,7 @@
"format:check": "prettier --check **/*.ts",
"format:write": "prettier --write **/*.ts",
"lint": "npx eslint . && npm run format:check",
"package": "ncc build -s src/index.ts --license licenses.txt",
"package": "npx rimraf ./dist && npx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
"package:watch": "npm run package -- --watch",
"version": "./scripts/version.sh",
"prepare": "husky"
@ -30,24 +31,30 @@
"license": "MIT",
"dependencies": {
"@actions/cache": "^4.0.0",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/glob": "^0.5.0",
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/glob": "^0.6.0",
"@actions/io": "^3.0.0",
"@types/handlebars": "^4.0.40",
"handlebars": "^4.7.8"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^10.0.0",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-typescript": "^12.0.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^24",
"@vercel/ncc": "^0.38.3",
"eslint": "^10.0.0",
"globals": "^17.0.0",
"husky": "^9.1.7",
"jest": "^30",
"js-yaml": "^4.1.0",
"prettier": "^3.4.1",
"rimraf": "^6.0.0",
"rollup": "^4.0.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
}

22
rollup.config.ts Normal file
View file

@ -0,0 +1,22 @@
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'
const config = {
input: 'src/index.ts',
output: {
esModule: true,
file: 'dist/index.js',
format: 'es',
sourcemap: true
},
plugins: [
typescript(),
nodeResolve({ preferBuiltins: true }),
commonjs(),
json()
]
}
export default config

View file

@ -13,7 +13,9 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"newLine": "lf"
"newLine": "lf",
"isolatedModules": true,
"allowSyntheticDefaultImports": true
},
"exclude": ["./dist", "./node_modules", "./__tests__", "./coverage"]
}