8000 ci: make the type-check pass by dominicrico · Pull Request #3 · dominicrico/jev-router · GitHub
[go: up one dir, main page]

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
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:

typecheck:
runs-on: ubuntu-latest
# Advisory: benchmarks/tsconfig.json does not type-check cleanly yet (no @types/node,
# .tsx import extensions, and stub-claude-code.ts does not match the real `claude-code` types).
continue-on-error: true
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- run: npm i --no-save tsx typescript
- run: npx tsc --noEmit -p benchmarks/tsconfig.json
cache: npm
- run: npm ci
- run: npm run typecheck
20 changes: 16 additions & 4 deletions benchmarks/stub-claude-code.ts
8000
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Lets benchmarks import the mod's pure functions without the Claude Code host.
export const atom = (ref: unknown, initial: unknown) => ({ ref, initial })
export const read = async () => null
export const update = async () => undefined
// Lets the benchmark and image scripts import the mod's pure functions without the Claude Code host.
// Runtime: the three state helpers below. Types: deliberately loose, only so the scripts type-check in CI;
// the real types come with Claude Code (`.claude-plugin/types`, generated, not committed).
export const atom = (ref: unknown, initial: unknown): any => ({ ref, initial })
export const read = async (..._: any[]): Promise<any> => null
export const update = async (..._: any[]): Promise<any> => undefined

export type EngineInterface = any
export type Register = (on: any, options: Record<string, unknown>) => void

declare global {
namespace JSX {
type Element = any
interface IntrinsicElements { [name: string]: any }
}
}
19 changes: 18 additions & 1 deletion benchmarks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
{ "compilerOptions": { "module": "esnext", "moduleResolution": "bundler", "target": "es2022", "jsx": "preserve", "paths": { "claude-code": ["./stub-claude-code.ts"] } } }
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"target": "es2022",
"jsx": "preserve",
"types": ["node"],
"allowImportingTsExtensions": true,
"allowJs": true,
"checkJs": false,
"noEmit": true,
"skipLibCheck": true,
"strict": false,
"noImplicitAny": false,
"paths": { "claude-code": ["./stub-claude-code.ts"] }
},
"include": ["./*.mts", "./*.ts", "../hooks/register.tsx", "../assets/src/*.mts"]
}
Loading
Loading
0