build: initialize JavaScript action project

This commit is contained in:
Alfi Maulana 2023-11-20 17:14:25 +07:00
parent d27fb54a3f
commit a83bb9b6ec
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4
9 changed files with 4644 additions and 1 deletions

28
.eslintrc.json Normal file
View File

@ -0,0 +1,28 @@
{
"root": true,
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"overrides": [
{
"files": ["**/*.mts", "**/*.ts"],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["tsconfig.eslint.json"]
},
"plugins": ["@typescript-eslint", "eslint-plugin-tsdoc"],
"rules": {
"tsdoc/syntax": "error"
}
},
{
"files": ["**/*.test.*"],
"env": {
"jest": true
}
}
]
}

5
.gitignore vendored
View File

@ -1,4 +1,7 @@
.* .*
!.eslint*
!.git* !.git*
build build/
dist/
node_modules/

19
jest.config.json Normal file
View File

@ -0,0 +1,19 @@
{
"collectCoverage": true,
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
},
"extensionsToTreatAsEsm": [".ts", ".mts"],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.mjs$": "$1.mts"
},
"testMatch": ["**/*.test.ts"],
"transform": {
"^.+\\.m?ts$": ["ts-jest", { "useESM": true }]
}
}

8
main/index.mjs Normal file
View File

@ -0,0 +1,8 @@
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
/******/
/************************************************************************/
var __webpack_exports__ = {};
//# sourceMappingURL=main.mjs.map

27
package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "cmake-action",
"private": true,
"type": "module",
"scripts": {
"bundle": "tsc && ncc build dist/main.mjs -o main",
"check": "sort-package-json && prettier --write . !dist && eslint src",
"test": "jest"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-tsdoc": "^0.2.17",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"sort-package-json": "^2.6.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"packageManager": "yarn@4.0.2"
}

0
src/main.mts Normal file
View File

4
tsconfig.eslint.json Normal file
View File

@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": []
}

17
tsconfig.json Normal file
View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"strict": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"declaration": true,
"outDir": "dist",
"sourceMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2022"],
"target": "ES2022",
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["**/*.test.*"]
}

4537
yarn.lock Normal file

File diff suppressed because it is too large Load Diff