Merge pull request #242 from oke-py/feature/migrate-to-rollup

chore: migrate build process from @vercel/ncc to rollup
This commit is contained in:
Naoki Oketani
2025-05-05 19:16:18 +09:00
committed by GitHub
4 changed files with 1143 additions and 410 deletions

1505
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,18 +5,20 @@
"description": "GitHub Action to run `npm audit`",
"main": "lib/main.js",
"type": "module",
"exports": {
".": "./dist/index.js"
},
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"build": "tsc",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"pack": "ncc build --v8-cache --source-map --target es2020",
"pack": "npx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
"test": "vitest --run",
"test:coverage": "vitest --run --coverage",
"all": "npm run build && npm run format && npm run lint && npm run pack && npm run test:coverage"
"all": "npm run format && npm run lint && npm run test:coverage && npm run pack"
},
"repository": {
"type": "git",
@@ -37,10 +39,12 @@
"strip-ansi": "^7.1.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-typescript": "^11.0.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^8.31.1",
"@typescript-eslint/parser": "^8.31.1",
"@vercel/ncc": "^0.38.3",
"@vitest/coverage-v8": "^3.1.2",
"eslint": "^9.26.0",
"eslint-define-config": "^2.1.0",
@@ -48,6 +52,8 @@
"eslint-plugin-github": "^6.0.0",
"js-yaml": "^4.0.0",
"prettier": "^3.5.3",
"rollup": "^3.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.3",
"vite": "^6.3.4",
"vitest": "^3.1.2"

19
rollup.config.ts Normal file
View File

@@ -0,0 +1,19 @@
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
const config = {
input: 'src/main.ts',
output: {
file: 'dist/index.js',
format: 'cjs',
sourcemap: true
},
plugins: [
resolve(),
commonjs(),
typescript()
]
};
export default config;

15
tsconfig.eslint.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": true
},
"exclude": ["dist", "node_modules"],
"include": [
"__tests__",
"src",
"eslint.config.js",
"rollup.config.ts"
]
}