mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-03-24 14:42:17 +08:00
* Migrate build toolchain from ncc/Jest to esbuild/Vitest Replace the legacy ncc/Jest/Babel build stack with a modern ESM toolchain: Build: - Replace @vercel/ncc with esbuild (--platform=node --target=node20 --format=esm) - Add createRequire banner for CJS interop in ESM bundle - Add "type": "module" to package.json - Add tsc --noEmit typecheck script (esbuild strips types without checking) - Add typecheck to husky pre-commit hook Dependencies: - Bump @actions/core@3, exec@3, io@3, tool-cache@4 (ESM-only) - Replace jest/ts-jest/@babel/* with vitest@4 Tests: - Convert 29 test files: jest.fn()→vi.fn(), jest.mock()→vi.mock(), jest.spyOn()→vi.spyOn() - Fix vitest 4 compat: mockImplementation requires args, mock call tracking, await .rejects CI: - Update build step from ncc build → npm run build - Update composite action to use npm run build * Switch tsconfig to NodeNext module resolution Change module/moduleResolution from ES2022/bundler to NodeNext/NodeNext and target from ES2022 to ES2020. - Add .js extensions to all relative imports across 59 source/test files (required by NodeNext module resolution) - Add vitest/globals to tsconfig types array for global test API declarations
37 lines
1.1 KiB
JSON
37 lines
1.1 KiB
JSON
{
|
|
"name": "k8s-deploy-action",
|
|
"version": "5.0.4",
|
|
"author": "Deepak Sattiraju",
|
|
"license": "MIT",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "esbuild src/run.ts --bundle --platform=node --target=node20 --format=esm --outfile=lib/index.js --banner:js=\"import { createRequire } from 'module';const require = createRequire(import.meta.url);\"",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"coverage": "vitest run --coverage",
|
|
"format": "prettier --write .",
|
|
"format-check": "prettier --check .",
|
|
"prepare": "husky"
|
|
},
|
|
"dependencies": {
|
|
"@actions/core": "^3.0.0",
|
|
"@actions/exec": "^3.0.0",
|
|
"@actions/io": "^3.0.2",
|
|
"@actions/tool-cache": "4.0.0",
|
|
"@octokit/core": "^7.0.6",
|
|
"@octokit/plugin-retry": "^8.0.3",
|
|
"js-yaml": "4.1.1",
|
|
"minimist": "^1.2.8"
|
|
},
|
|
"devDependencies": {
|
|
"@types/js-yaml": "^4.0.9",
|
|
"@types/minimist": "^1.2.5",
|
|
"@types/node": "^25.2.3",
|
|
"esbuild": "^0.27",
|
|
"husky": "^9.1.7",
|
|
"prettier": "^3.8.1",
|
|
"typescript": "5.9.3",
|
|
"vitest": "^4"
|
|
}
|
|
}
|