@pyreon/typescript
v0.47.0
Published
TypeScript configuration presets for Pyreon projects
Readme
@pyreon/typescript
TypeScript config presets for Pyreon projects — base, app, lib.
@pyreon/typescript ships three tsconfig.json presets you extend from your own config. The base preset configures the JSX import source (@pyreon/core), ES2024 target, bundler module resolution, strict mode (including exactOptionalPropertyTypes + noUncheckedIndexedAccess), and source maps. The app preset adds noEmit (type-check only — bundler handles emit). The lib preset adds declaration + declarationMap for publishable packages. No compilerOptions ceremony at the consumer side.
Install
bun add -D @pyreon/typescriptUsage
Applications
For Pyreon apps (SPAs, SSR apps, example apps):
// tsconfig.json
{
"extends": "@pyreon/typescript/app",
"include": ["src/**/*"]
}Libraries
For publishable packages that need .d.ts output:
{
"extends": "@pyreon/typescript/lib",
"include": ["src/**/*"],
"compilerOptions": {
"outDir": "./lib"
}
}Base only
If you need finer control, extend base and add your own flags:
{
"extends": "@pyreon/typescript",
"compilerOptions": {
"noEmit": true,
"rootDir": "./src"
}
}What's included
All presets configure:
- JSX —
"jsx": "react-jsx"with"jsxImportSource": "@pyreon/core"so<div />resolves to Pyreon's JSX runtime out of the box. - Modern target —
target: "ES2024",module: "Preserve",lib: ["ES2024", "DOM", "DOM.Iterable"]. - Bundler resolution —
moduleResolution: "Bundler",verbatimModuleSyntax: true,resolveJsonModule: true,moduleDetection: "force". - Strict mode —
strict,exactOptionalPropertyTypes,noUncheckedIndexedAccess,noImplicitOverride,forceConsistentCasingInFileNames. skipLibCheck: true— node_modules.d.tsfiles are not re-checked.- Source maps enabled.
exclude:node_modules,lib,dist.
app adds
noEmit: true— type-checking only, the bundler (Vite/esbuild/Bun) emits.
lib adds
declaration: true+declarationMap: true— generates.d.ts+.d.ts.mapfor consumers.
Subpath exports
| Subpath | File |
| --------------------- | ------------ |
| @pyreon/typescript | base.json |
| @pyreon/typescript/app | app.json |
| @pyreon/typescript/lib | lib.json |
Peer dependencies
typescript >= 5.9.0
Gotchas
exactOptionalPropertyTypesis enabled. Optional properties need explicit| undefinedwhen assigned from functions that may return undefined. This is intentional — it catches a real bug class.noUncheckedIndexedAccessis enabled. Array element access returnsT | undefined— guard witharr[i]?orif (!arr[i]) return.jsxImportSource: "@pyreon/core"is fixed inbase. If you're using a compat layer (@pyreon/react-compat,@pyreon/vue-compat, …), overridejsxImportSourcein your own tsconfig.module: "Preserve"is for Bun/bundler resolution. If you need rawtscemit, switch tomodule: "ESNext".
Documentation
Full docs: pyreon.dev/docs/typescript (or docs/src/content/docs/typescript.md in this repo).
License
MIT
