-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.examples.json
More file actions
75 lines (75 loc) · 4.11 KB
/
Copy pathtsconfig.examples.json
File metadata and controls
75 lines (75 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
// Lightweight static type-check for the playground example sources.
//
// The runtime example smoke (site/scripts/smoke-examples.ts) only catches
// crashes and missing canvases — stale TextStyle keys like `fill`, `stroke`,
// or `wordWrap` are silently ignored at runtime, so they slip through. This
// config type-checks the example `.js` sources against the engine's own source
// types (no build required: `@codexo/exojs` maps to `src/index.ts`), so the
// editor-visible "`fill` does not exist in TextStyleOptions" diagnostics also
// fail `pnpm typecheck:examples`.
//
// `strict` is ON. Example code is a copy-paste surface for `create-exo-app`
// scaffolds, which are strict by default — code that only compiles under
// `strict: false` here would fail to compile the moment a user pastes it in.
// All lifecycle overrides (`update(delta: Time)`, `draw(context:
// RenderingContext)`, etc.) are explicitly typed, and every `this.app` read
// is narrowed via a local `const app = this.app; if (app === null) throw ...`
// guard at the top of the owning method (mirrors the `Scene.inputs` /
// `Scene.tweens` / `Scene.loader` getters, which throw the same way when
// accessed before the scene is attached).
//
// Scope: the full example catalog. Every `.js` under `examples/` is
// type-checked against the engine source types, so stale TextStyle keys are
// caught catalog-wide. `examples/shared/runtime.d.ts` supplies the
// playground-only globals (`window.assets`, `__EXAMPLE_META__`).
//
// `examples/shared/editor-support.d.ts` is deliberately NOT included: it is a
// Monaco-only extra-lib that re-declares `Json`/`TextAsset`/etc. inside
// `declare module '@codexo/exojs'`, which collides with the real source
// exports here (duplicate-identifier). Its permissive Scene/Loader shims are
// unnecessary for `.js` sources — checked JS infers `this._x` fields directly.
//
// The entire example catalog type-checks against the engine source types with
// zero per-example excludes. The former stale-API clusters (two-argument
// `Signal.add`, `PushSceneOptions.input`, `Sprite` dynamic instance fields,
// `AudioAnalyser` getters, WGSL module return types) were migrated to the
// current API in the example sources themselves.
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"target": "es2022",
"lib": ["es2022", "dom", "dom.iterable"],
"types": [],
"allowJs": true,
"checkJs": true,
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolvePackageJsonImports": true,
"customConditions": ["@codexo/source", "@codexo/exojs-particles-source"],
"paths": {
"@codexo/exojs": ["./src/index.ts"],
"@codexo/exojs/extensions": ["./src/extensions/index.ts"],
"@codexo/exojs/renderer-sdk": ["./src/renderer-sdk.ts"],
"@codexo/exojs/debug": ["./src/debug/index.ts"],
"@codexo/exojs-particles": ["./packages/exojs-particles/src/index.ts"],
"@codexo/exojs-particles/register": ["./packages/exojs-particles/src/register.ts"],
"@codexo/exojs-tiled": ["./packages/exojs-tiled/src/index.ts"],
"@codexo/exojs-tiled/register": ["./packages/exojs-tiled/src/register.ts"],
"@codexo/exojs-tilemap": ["./packages/exojs-tilemap/src/index.ts"],
"@codexo/exojs-tilemap/register": ["./packages/exojs-tilemap/src/register.ts"],
"@codexo/exojs-ldtk": ["./packages/exojs-ldtk/src/index.ts"],
"@codexo/exojs-ldtk/register": ["./packages/exojs-ldtk/src/register.ts"],
"@codexo/exojs-physics": ["./packages/exojs-physics/src/index.ts"],
"@codexo/exojs-physics/debug": ["./packages/exojs-physics/src/debug/index.ts"],
"@codexo/exojs-audio-fx": ["./packages/exojs-audio-fx/src/index.ts"],
"@examples/runtime": ["./examples/shared/runtime.d.ts"],
"@examples/physics-tilemap": ["./examples/shared/physics-tilemap.ts"]
}
},
"include": ["examples/**/*.js", "examples/**/*.ts", "examples/shared/runtime.d.ts", "src/typings.d.ts"],
"exclude": ["examples/shared/editor-support.d.ts"]
}