Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
20 changes: 10 additions & 10 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "Apache-2.0",
"engines": {
"node": "18"
"node": "22"
},
"dependencies": {
"@faker-js/faker": "^8.1.0",
Expand Down Expand Up @@ -55,7 +55,7 @@
"@types/js-yaml": "^4.0.5",
"@types/json-bigint": "^1.0.4",
"@types/lodash": "^4.17.1",
"@types/node": "^17.0.43",
"@types/node": "^22.0.0",
"@types/pbkdf2": "^3.1.2",
"@types/pump": "^1.1.1",
"@types/readable-stream": "^2.3.13",
Expand All @@ -68,14 +68,14 @@
},
"pkg": {
"targets": [
"node18-linux-x64",
"node18-macos-x64",
"node18-win-x64",
"node18-alpine-x64",
"node18-linux-arm64",
"node18-macos-arm64",
"node18-win-arm64",
"node18-alpine-arm64"
"node22-linux-x64",
"node22-macos-x64",
"node22-win-x64",
"node22-alpine-x64",
"node22-linux-arm64",
"node22-macos-arm64",
"node22-win-arm64",
"node22-alpine-arm64"
],
"outputPath": "release",
"scripts": [
Expand Down
2 changes: 1 addition & 1 deletion cli/src/__tests__/utils/avro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { jest } from '@jest/globals'
jest.mock('../../utils/logWrapper', () => ({
fail: jest.fn(),
}))
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: number) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The process.exit mock uses a manually specified union type for code. To reduce maintenance when Node/@types change, derive the code parameter type from process.exit instead of hard-coding it.

Suggested change
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: Parameters<typeof process.exit>[0]) => {

Copilot uses AI. Check for mistakes.
throw new Error(`Process exited with code ${code}`)
})

Expand Down
2 changes: 1 addition & 1 deletion cli/src/__tests__/utils/convertPayload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.mock('cbor')
jest.mock('../../utils/logWrapper')

// Mock process.exit
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: number) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider typing the mocked process.exit argument using the real function’s parameter type rather than a manually maintained union. This keeps the test resilient to changes in Node’s type definitions.

Suggested change
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: Parameters<typeof process.exit>[0]) => {

Copilot uses AI. Check for mistakes.
throw new Error(`Process.exit called with code ${code}`)
})

Expand Down
2 changes: 1 addition & 1 deletion cli/src/__tests__/utils/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { expect, jest } from '@jest/globals'
jest.mock('../../utils/logWrapper', () => ({
fail: jest.fn(),
}))
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: number) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other tests: avoid hard-coding the process.exit parameter union in the mock. Derive the parameter type from process.exit itself so future Node/@types updates don’t require touching this test.

Suggested change
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: Parameters<typeof process.exit>[0]) => {

Copilot uses AI. Check for mistakes.
throw new Error(`Process exited with code ${code}`)
})

Expand Down
2 changes: 1 addition & 1 deletion cli/src/__tests__/utils/protobuf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.mock('../../utils/logWrapper', () => ({
fail: jest.fn(),
}))

const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: number) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mocked process.exit signature is hard-coded and may drift from Node’s type definitions over time. Prefer typing the argument from the real function (e.g., derive the parameter type from process.exit) so the spy implementation stays aligned across Node/@types upgrades.

Suggested change
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
const mockExit = jest.spyOn(process, 'exit').mockImplementation((code?: Parameters<typeof process.exit>[0]) => {

Copilot uses AI. Check for mistakes.
throw new Error(`Process exited with code ${code}`)
})

Expand Down
7 changes: 4 additions & 3 deletions cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"compilerOptions": {
"incremental": true,
"target": "ES5",
"target": "ES2022",
"module": "commonjs",
"outDir": "./dist",
"lib": ["ESNext", "ScriptHost", "DOM"],
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"types": ["@types/signale", "jest"],
"types": ["@types/signale", "jest", "node"],
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["src/**/*.test.ts", "src/__tests__"]
Expand Down
1,683 changes: 836 additions & 847 deletions cli/yarn.lock

Large diffs are not rendered by default.

Loading