From 7daae4c3edeb70c4c30220bf1b1469fdbaccba24 Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Tue, 24 Nov 2026 18:38:01 +0000 Subject: [PATCH 1/2] fix(cli): keep the inferred execa options out of the runNodeCommand declaration --- .changeset/tame-ways-tan.md | 5 +++++ apps/cli/src/exec/node-container.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/tame-ways-tan.md diff --git a/.changeset/tame-ways-tan.md b/.changeset/tame-ways-tan.md new file mode 100644 index 00000000..22a8d558 --- /dev/null +++ b/.changeset/tame-ways-tan.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +fix the `runNodeCommand` declaration, which a consumer compiling with `exactOptionalPropertyTypes` rejected diff --git a/apps/cli/src/exec/node-container.ts b/apps/cli/src/exec/node-container.ts index 3a0502ec..c6836eb4 100644 --- a/apps/cli/src/exec/node-container.ts +++ b/apps/cli/src/exec/node-container.ts @@ -1,4 +1,4 @@ -import { ExecaError, execa } from "execa"; +import { ExecaError, execa, type ResultPromise } from "execa"; import { type Hex, isHex } from "viem"; import type { CartesiEnvironmentVariables } from "../base.js"; @@ -83,7 +83,7 @@ export const runNodeCommand = (options: { env?: Record; projectName: string; stdout?: "stdout" | "stderr"; -}) => +}): ResultPromise => execa( "docker", nodeExecArgs({ ...options, interactive: !!process.stdin.isTTY }), From af1f366e22bd2feb465790c82c5550d2d8d5a63b Mon Sep 17 00:00:00 2001 From: Bruno Menezes Date: Wed, 25 Nov 2026 09:29:22 +0000 Subject: [PATCH 2/2] ci(cli): type-check the published declarations as a strict consumer --- .github/workflows/cli.yaml | 3 +++ apps/cli/package.json | 1 + apps/cli/tsconfig.declarations.json | 15 +++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 apps/cli/tsconfig.declarations.json diff --git a/.github/workflows/cli.yaml b/.github/workflows/cli.yaml index f8438122..038a3543 100644 --- a/.github/workflows/cli.yaml +++ b/.github/workflows/cli.yaml @@ -43,6 +43,9 @@ jobs: - name: Type check run: bun run --cwd apps/cli typecheck:tsc + - name: Type check declarations + run: bun run --cwd apps/cli typecheck:declarations + - name: Test run: bun test apps/cli/ diff --git a/apps/cli/package.json b/apps/cli/package.json index 60b38e25..2b39c0f8 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -65,6 +65,7 @@ "posttest": "bun lint", "test": "bun test", "typecheck": "run-s codegen typecheck:tsc", + "typecheck:declarations": "tsc -p tsconfig.declarations.json", "typecheck:tsc": "tsc" }, "engines": { diff --git a/apps/cli/tsconfig.declarations.json b/apps/cli/tsconfig.declarations.json new file mode 100644 index 00000000..0b9c53ca --- /dev/null +++ b/apps/cli/tsconfig.declarations.json @@ -0,0 +1,15 @@ +{ + // type-check the published declarations as a strict consumer would, with + // exact optional types and the library check on: our own build skips both + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "exactOptionalPropertyTypes": true, + "skipLibCheck": false, + "noEmit": true, + "types": ["node"] + }, + "files": ["dist/types/lib.d.ts"] +}