refactor(build): update TypeScript and Rollup configuration
This commit is contained in:
@@ -1,19 +1,18 @@
|
|||||||
import commonjs from '@rollup/plugin-commonjs';
|
// See: https://rollupjs.org/introduction/
|
||||||
import resolve from '@rollup/plugin-node-resolve';
|
|
||||||
import typescript from '@rollup/plugin-typescript';
|
import commonjs from '@rollup/plugin-commonjs'
|
||||||
|
import nodeResolve from '@rollup/plugin-node-resolve'
|
||||||
|
import typescript from '@rollup/plugin-typescript'
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
input: 'src/main.ts',
|
input: 'src/index.ts',
|
||||||
output: {
|
output: {
|
||||||
|
esModule: true,
|
||||||
file: 'dist/index.js',
|
file: 'dist/index.js',
|
||||||
format: 'cjs',
|
format: 'es',
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [typescript(), nodeResolve({ preferBuiltins: true }), commonjs()]
|
||||||
resolve(),
|
}
|
||||||
commonjs(),
|
|
||||||
typescript()
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
export default config
|
||||||
|
|||||||
8
src/index.ts
Normal file
8
src/index.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* The entrypoint for the action. This file simply imports and runs the action's
|
||||||
|
* main logic.
|
||||||
|
*/
|
||||||
|
import { run } from './main.js'
|
||||||
|
|
||||||
|
/* istanbul ignore next */
|
||||||
|
run()
|
||||||
22
tsconfig.base.json
Normal file
22
tsconfig.base.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"declaration": false,
|
||||||
|
"declarationMap": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"lib": ["ES2022"],
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"newLine": "lf",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"pretty": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"strict": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"target": "ES2022"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020' or 'ESNEXT'. */
|
"module": "NodeNext",
|
||||||
"module": "NodeNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"moduleResolution": "NodeNext",
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./dist"
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
||||||
"strict": true, /* Enable all strict type-checking options. */
|
|
||||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
||||||
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
||||||
"baseUrl": "./",
|
|
||||||
"paths": {
|
|
||||||
"*": ["src/*"]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
|
||||||
"node_modules",
|
"include": ["src"]
|
||||||
"**/*.test.ts",
|
|
||||||
"vitest.config.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user