@contractspec/tool.typescript 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +24 -0
- package/CHANGELOG.md +12 -0
- package/README.md +62 -0
- package/package.json +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AI Agent Guide -- `@contractspec/tool.typescript`
|
|
2
|
+
|
|
3
|
+
Scope: `packages/tools/typescript/*`
|
|
4
|
+
|
|
5
|
+
Shared TypeScript configuration presets (base, nextjs, react-library) extended by every package's `tsconfig.json` in the monorepo.
|
|
6
|
+
|
|
7
|
+
## Quick Context
|
|
8
|
+
|
|
9
|
+
- **Layer**: tool
|
|
10
|
+
- **Consumers**: all monorepo packages (via `"extends": "@contractspec/tool.typescript/..."`)
|
|
11
|
+
|
|
12
|
+
## Public Exports
|
|
13
|
+
|
|
14
|
+
Config-only package -- no code exports. Provides `tsconfig.*.json` preset files consumed via `extends`.
|
|
15
|
+
|
|
16
|
+
## Guardrails
|
|
17
|
+
|
|
18
|
+
- Compiler option changes propagate to every package -- verify with `bun run typecheck` across the repo
|
|
19
|
+
- Do not weaken strict-mode settings (`strict`, `noUncheckedIndexedAccess`, etc.)
|
|
20
|
+
- Adding a new preset file requires documenting which packages should use it
|
|
21
|
+
|
|
22
|
+
## Local Commands
|
|
23
|
+
|
|
24
|
+
- No `build`, `test`, `lint`, or `dev` scripts -- config-only package
|
package/CHANGELOG.md
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @contractspec/tool.typescript
|
|
2
|
+
|
|
3
|
+
Website: https://contractspec.io/
|
|
4
|
+
|
|
5
|
+
**Shared TypeScript configuration presets** for the ContractSpec monorepo.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add -D @contractspec/tool.typescript
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Available Configs
|
|
14
|
+
|
|
15
|
+
| Config | File | Use Case |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Base | `base.json` | Default strict config for all packages |
|
|
18
|
+
| Next.js | `nextjs.json` | Next.js apps with App Router |
|
|
19
|
+
| React Library | `react-library.json` | React component libraries |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Extend from your `tsconfig.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"extends": "@contractspec/tool.typescript/base.json",
|
|
28
|
+
"compilerOptions": {
|
|
29
|
+
"outDir": "./dist"
|
|
30
|
+
},
|
|
31
|
+
"include": ["src"]
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Next.js App
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"extends": "@contractspec/tool.typescript/nextjs.json",
|
|
40
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### React Library
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"extends": "@contractspec/tool.typescript/react-library.json",
|
|
49
|
+
"compilerOptions": {
|
|
50
|
+
"outDir": "./dist"
|
|
51
|
+
},
|
|
52
|
+
"include": ["src"]
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Key Settings (base)
|
|
57
|
+
|
|
58
|
+
- `strict: true` -- all strict checks enabled
|
|
59
|
+
- `module: "Preserve"` -- bundler-compatible module resolution
|
|
60
|
+
- `noUncheckedIndexedAccess: true` -- safer array/object access
|
|
61
|
+
- `verbatimModuleSyntax: true` -- explicit import/export types
|
|
62
|
+
- `target: "esnext"` -- latest ECMAScript features
|