-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtsconfig.json
More file actions
49 lines (49 loc) · 2.69 KB
/
Copy pathtsconfig.json
File metadata and controls
49 lines (49 loc) · 2.69 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
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"types": ["node"],
// [#12181] `@objectstack/metadata-core` and `@objectstack/metadata-protocol`
// are imported by `src/meta-delete-item-carriers.test.ts` (the real-door
// reproduction), i.e. by the TEST program `tsconfig.test.json`, which
// extends this file. Without these rules tsc resolves those specifiers
// through each dependency's `exports` map — `dist/index.d.ts`, A BUILD
// ARTIFACT — so the verdict would be about the last `pnpm build` rather
// than about the producer's source in the checkout.
// `check:type-source-resolution` refuses exactly that, and its header
// states why the dangerous case is a typecheck that PASSES.
//
// ONE rule per package, not two: both publish a single entry point (their
// `exports` maps carry only `"."` besides, for metadata-core, a `./testing`
// subpath nothing here imports), and a rule pointing at files that are not
// on disk is worse than absent — tsc falls back to node resolution, i.e. to
// `dist`, silently. ⛔ Never spell a key with a star not preceded by a
// slash (`@objectstack/metadata-core*`): it matches the bare name AND every
// subpath, folds them onto one target, and type-checks green against the
// wrong module.
//
// `rootDir` stays `./src`: this BUILD program excludes `**/*.test.ts`, so
// no file in it imports either specifier and neither producer's source is
// pulled in here. The test program that does pull them in already sets
// `rootDir` to the workspace root.
// [#12104] Same rule, same reason, for the three producers
// `src/analytics-automation-json-erasure.test.ts` DRIVES to measure what
// the five `return res.json()` methods really resolve to. That suite's
// claim is "the annotation matches what the producer sends", so its verdict
// must be about the producer's SOURCE; through `exports` it would be about
// the last `pnpm build` of three other packages. Each publishes a single
// `"."` entry point, so one bare-name rule each — no star, per the
// paragraph above.
"paths": {
"@objectstack/metadata-core": ["../metadata-core/src/index.ts"],
"@objectstack/metadata-protocol": ["../metadata-protocol/src/index.ts"],
"@objectstack/rest": ["../rest/src/index.ts"],
"@objectstack/service-analytics": ["../services/service-analytics/src/index.ts"],
"@objectstack/service-automation": ["../services/service-automation/src/index.ts"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
}