-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.examples.json
More file actions
84 lines (84 loc) · 5.1 KB
/
Copy pathtsconfig.examples.json
File metadata and controls
84 lines (84 loc) · 5.1 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
76
77
78
79
80
81
82
83
84
{
// Static type-check for the consumer-facing code the repository ships as
// copy-paste material: the playground example catalog and the opt-in
// all-in-one IIFE entry.
//
// 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 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`.
//
// The compiler policy lives in the shared consumer profile: plain `strict`,
// no engine-only options. Example code is a copy-paste surface for
// `create-exo-app` scaffolds, and code that only compiles under a profile the
// reader does not have is a gate reporting drift that is not there. 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 plus `scripts/exo-full.entry.ts`. Every
// authored `.ts` under `examples/` is type-checked against the engine source
// types, so stale TextStyle keys are caught catalog-wide. The full-bundle entry is the
// same kind of program - a named re-export surface resolved against every
// extension package's source - and the production build only compiles it when
// EXOJS_FULL_BUNDLE=1, so without it here a stale named export is visible only
// in the CI build lane. `examples/shared/runtime.ts` supplies the shared
// helper kit and the playground-only globals (`window.assets`,
// `__EXAMPLE_META__`).
//
// The generated `.js` siblings are NOT in this program. They are transpiled
// from the `.ts` beside them by `examples:sync` and committed so a release
// bundle ships the catalog in both languages; type-checking a mechanical
// transpile of an already-checked source finds nothing its source does not.
// `examples:sync:check` is what guards them, and it compares them against
// that source rather than against the engine.
//
// One `.js` is named individually because it is not that:
// `worker-streamed-terrain.js` is the only example whose generation is not a
// plain transpile. Its `?worker` import is inlined at generation time, so the
// emitted file carries code the `.ts` does not, and dropping it would leave
// that code unchecked.
//
// `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 exist
// for the editor's JavaScript view, which is not this program.
//
// 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.
"extends": "@codexo/exojs-config/typescript/consumer.json",
"compilerOptions": {
"customConditions": ["@codexo/exojs-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-tiled": ["./packages/exojs-tiled/src/index.ts"],
"@codexo/exojs-tilemap": ["./packages/exojs-tilemap/src/index.ts"],
"@codexo/exojs-aseprite": ["./packages/exojs-aseprite/src/index.ts"],
"@codexo/exojs-ldtk": ["./packages/exojs-ldtk/src/index.ts"],
"@codexo/exojs-physics": ["./packages/exojs-physics/src/index.ts"],
"@codexo/exojs-physics/debug": ["./packages/exojs-physics/src/debug/index.ts"],
"@codexo/exojs-tilemap-physics": ["./packages/exojs-tilemap-physics/src/index.ts"],
"@codexo/exojs-lighting": ["./packages/exojs-lighting/src/index.ts"],
"@codexo/exojs-pathfinding": ["./packages/exojs-pathfinding/src/index.ts"],
"@codexo/exojs-audio-fx": ["./packages/exojs-audio-fx/src/index.ts"],
"@examples/runtime": ["./examples/shared/runtime.ts"],
"@examples/terrain-noise": ["./examples/shared/terrain-noise.ts"]
}
},
"include": ["examples/**/*.ts", "examples/tilemap/worker-streamed-terrain.js", "scripts/exo-full.entry.ts", "src/typings.d.ts"],
"exclude": ["examples/shared/editor-support.d.ts", "examples/**/*.worker.ts"]
}