Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/tame-ways-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

fix the `runNodeCommand` declaration, which a consumer compiling with `exactOptionalPropertyTypes` rejected
3 changes: 3 additions & 0 deletions .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
1 change: 1 addition & 0 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/src/exec/node-container.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -83,7 +83,7 @@ export const runNodeCommand = (options: {
env?: Record<string, string>;
projectName: string;
stdout?: "stdout" | "stderr";
}) =>
}): ResultPromise =>
execa(
"docker",
nodeExecArgs({ ...options, interactive: !!process.stdin.isTTY }),
Expand Down
15 changes: 15 additions & 0 deletions apps/cli/tsconfig.declarations.json
Original file line number Diff line number Diff line change
@@ -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"]
}
Loading