Skip to content

Commit c7fe624

Browse files
skulidropekclaude
andcommitted
fix(app): emit declaration files and fix package type exports for external consumers
- Add tsconfig.build.json that emits .d.ts only from src/ (excludes examples with test fixture imports) - Change build script to vite build && tsc -p tsconfig.build.json so declarations survive Vite's dist clean - Point exports.types from ./src/index.ts to ./dist/index.d.ts so consumers get compiled declarations - Remove src/ from published files — only dist/ is shipped - Add tests/consumer/ fixture with strict tsconfig and proof-obligation import to pass tsc --noEmit Closes #25 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 564ef0a commit c7fe624

4 files changed

Lines changed: 61 additions & 5 deletions

File tree

packages/app/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66
"main": "dist/index.js",
77
"exports": {
88
".": {
9-
"types": "./src/index.ts",
9+
"types": "./dist/index.d.ts",
1010
"import": "./dist/index.js",
1111
"default": "./dist/index.js"
1212
}
1313
},
1414
"files": [
15-
"dist",
16-
"src"
15+
"dist"
1716
],
1817
"publishConfig": {
1918
"access": "public"
2019
},
2120
"scripts": {
22-
"build": "vite build",
21+
"build": "vite build && tsc -p tsconfig.build.json",
2322
"dev": "vite build --watch",
2423
"lint": "npx @ton-ai-core/vibecode-linter src/",
2524
"lint:tests": "npx @ton-ai-core/vibecode-linter tests/",
2625
"lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
2726
"lint:types": "./scripts/lint-types.sh",
2827
"check": "tsc --noEmit",
2928
"test": "vitest run",
30-
"typecheck": "tsc --noEmit"
29+
"typecheck": "tsc --noEmit",
30+
"test:consumer": "tsc -p tests/consumer/tsconfig.json"
3131
},
3232
"repository": {
3333
"type": "git",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Consumer proof: external project imports createClientEffect and compiles with tsc --noEmit.
2+
// This file must compile cleanly with no local module declaration overrides.
3+
import { createClientEffect } from "@prover-coder-ai/openapi-effect"
4+
5+
type Paths = {
6+
"/health": {
7+
get: {
8+
responses: {
9+
200: {
10+
content: {
11+
"application/json": { ok: boolean }
12+
}
13+
}
14+
}
15+
}
16+
}
17+
}
18+
19+
const client = createClientEffect<Paths>()
20+
21+
// Verify .GET exists and returns something (compile-time check only)
22+
const _result = client.GET("/health")
23+
void _result
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"noEmit": true,
5+
"module": "NodeNext",
6+
"moduleResolution": "NodeNext",
7+
"target": "ES2022",
8+
"lib": ["ES2022", "DOM"],
9+
"verbatimModuleSyntax": true,
10+
"paths": {
11+
"@prover-coder-ai/openapi-effect": ["../../dist/index.d.ts"]
12+
}
13+
},
14+
"include": ["index.ts"]
15+
}

packages/app/tsconfig.build.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "dist",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"emitDeclarationOnly": true,
9+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
10+
"types": ["node"]
11+
},
12+
"include": ["src/**/*"],
13+
"exclude": [
14+
"src/examples/**/*",
15+
"node_modules",
16+
"dist"
17+
]
18+
}

0 commit comments

Comments
 (0)