Skip to content

Commit 01cfe40

Browse files
authored
Migrate to esbuild/Vitest and upgrade @actions/* to ESM-only versions (#492)
* 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
1 parent 84e2095 commit 01cfe40

67 files changed

Lines changed: 2151 additions & 10317 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/minikube-setup/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ runs:
1515
rm -rf node_modules/
1616
npm install
1717
18-
- name: Install ncc
18+
- name: Build
1919
shell: bash
20-
run: npm i -g @vercel/ncc
20+
run: npm run build
2121

2222
- name: Install conntrack
2323
shell: bash
2424
run: sudo apt-get install -y conntrack
2525

26-
- name: Build
27-
shell: bash
28-
run: ncc build src/run.ts -o lib
29-
3026
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
3127
name: Install Kubectl
3228

.github/workflows/run-integration-tests-private.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
run: |
2626
rm -rf node_modules/
2727
npm install
28-
- name: Install ncc
29-
run: npm i -g @vercel/ncc
28+
3029
- name: Build
31-
run: ncc build src/run.ts -o lib
30+
run: npm run build
31+
3232
- name: Azure login
3333
uses: azure/[email protected]
3434
with:

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
npm run typecheck || {
2+
echo ""
3+
echo "❌ Type check failed."
4+
echo "💡 Run 'npm run typecheck' to see errors."
5+
exit 1
6+
}
17
npm test
28
npm run format-check || {
39
echo ""

jest.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)