Files
1b425bb73d chore: add shared tsconfigs infrastructure under common/tsconfigs (#38037)
## What

Adds shared TypeScript config files under `common/tsconfigs/` to support
packages that organize their tsconfigs into a `config/` subdirectory.

## Why

Reduce duplication across packages that need per-platform build/test
configs (ESM, CJS, browser, React Native). The shared configs use
TypeScript's `${configDir}/..` pattern so that leaf configs placed in a
package's `config/` subdirectory resolve paths relative to the package
root.

## Changes

### New shared configs (`common/tsconfigs/`)
- `base.src.json` / `base.test.json` — common base configs for src
builds and tests
- `src.esm.json`, `src.cjs.json`, `src.browser.json`,
`src.react-native.json` — platform-specific src builds
- `test.node.json`, `test.browser.json`, `test.react-native.json` —
platform-specific test configs
- `snippets.json` — shared snippets config

### Root tsconfig.json
- Changed `lib` from `[]` to `["ES2023"]` so shared configs can inherit
it instead of redeclaring

### Dev-tool
- `extract-api.ts`: `getTsconfigFile()` now checks the `config/`
subdirectory when locating a package's tsconfig for API extraction

## Note on root tsconfig files

The other `tsconfig.*.json` files in the repo root (e.g.
`tsconfig.browser.base.json`, `tsconfig.src.esm.json`,
`tsconfig.test.base.json`, etc.) are **legacy** and will be deleted once
all packages migrate to the new shared configs under
`common/tsconfigs/`.

## Usage

A package's leaf config in `config/tsconfig.src.esm.json`:
```json
{
  "extends": "../../../../common/tsconfigs/src.esm.json",
  "include": ["../src/**/*.ts", "../src/**/*.mts"]
}
```

No packages consume these configs yet — this PR just adds the
infrastructure.

Co-authored-by: Copilot <[email protected]>
2026-04-08 20:50:01 -07:00

17 lines
364 B
JSON

{
"compilerOptions": {
"target": "ES2023",
"module": "NodeNext",
"lib": ["ES2023"],
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"sourceMap": true,
"importHelpers": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
}
}