@ttsc/metro 0.28.3 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,6 +41,10 @@ module.exports = withTtsc(getDefaultConfig(__dirname));
41
41
 
42
42
  `withTtsc` sets `transformer.babelTransformerPath` and leaves the rest of your config untouched. It auto-detects the upstream transformer to delegate to (`@expo/metro-config/babel-transformer` for Expo, then `@react-native/metro-babel-transformer`, then the legacy `metro-react-native-babel-transformer`).
43
43
 
44
+ If your config already set `transformer.babelTransformerPath`, that transformer is **chained rather than replaced**: the `ttsc` pass runs first and then delegates to it, so wrapping a working config keeps what it configured. This is what makes `react-native-svg-transformer` — whose entire installation is that one assignment — keep working after you adopt `@ttsc/metro`. Pass `upstreamTransformer` explicitly to override both that and auto-detection.
45
+
46
+ The value is resolved from your `projectRoot`, exactly as Metro resolves it, so a relative `"./metro-svg.cjs"` and a bare `"react-native-svg-transformer"` both mean what they mean in your project rather than inside this package. A path that names `@ttsc/metro`'s own transformer is never chained — in any spelling, including a second copy installed elsewhere in your tree — because delegating this transformer into itself would recurse on every file.
47
+
44
48
  Auto-detection only skips a candidate whose entry point is genuinely **not available** — the package is not installed, or it is installed but the requested subpath is not exported (Expo/React Native version skew). A candidate that _does_ resolve but fails while loading — a top-level throw, an incompatible runtime ABI, or a missing peer/transitive dependency — surfaces its original error (as the `cause` of a `@ttsc/metro` wrapper) instead of being treated as absent. This stops a broken Expo/React Native install from silently falling through to the wrong transformer, and stops an explicit `upstreamTransformer` failure from being reported as if the module did not exist.
45
49
 
46
50
  ## Configuration
@@ -60,7 +64,7 @@ module.exports = withTtsc(getDefaultConfig(__dirname), {
60
64
  - `project`: path to the `tsconfig.json` the transformer should read (resolved from `process.cwd()`).
61
65
  - `compilerOptions`: a temporary overlay layered on the selected project config.
62
66
  - `plugins`: an explicit `ttsc` plugin list override, or `false` to disable project plugins.
63
- - `upstreamTransformer`: an explicit module path for the Babel transformer to delegate to, when auto-detection is not what you want.
67
+ - `upstreamTransformer`: an explicit module path for the Babel transformer to delegate to, when neither the config's own transformer nor auto-detection is what you want.
64
68
  - `include` / `exclude`: substring patterns matched against the project-relative file path, selecting which files run through the `ttsc` pass (`.ts`/`.tsx`/`.cts`/`.mts` only; declaration and JavaScript files always pass straight through).
65
69
 
66
70
  Options are forwarded from the Metro **config** process to Metro's **worker** processes through the `TTSC_METRO_OPTIONS` environment variable, so they must stay JSON-serialisable (hence substring patterns rather than `RegExp`).
@@ -74,6 +78,22 @@ For each TypeScript file Metro asks to transform:
74
78
 
75
79
  The plugin contract and `tsconfig` discovery match the Unplugin integrations. Metro's worker has no build-start callback, so its shared transform cache validates the complete project snapshot on every hit instead of using a build-scoped first-delivery shortcut.
76
80
 
81
+ ### Files outside the program
82
+
83
+ Metro resolves its own module graph, and that graph is not the set of files your `tsconfig` describes. A file Metro delivers that the compiled program does not contain is passed to the upstream transformer untransformed, and reported naming the file and the `tsconfig` it is missing from — once per file per compile in each Metro worker, since a Metro worker has no build boundary to reset the report at:
84
+
85
+ ```
86
+ ttsc: /app/scripts/tool.ts is not part of the program described by /app/tsconfig.json,
87
+ so it was left untransformed. Add it to that project's "include" if ttsc plugins
88
+ should apply to it.
89
+ ```
90
+
91
+ This is not a build error. The file is simply not this project's to transform, and the usual cause is a Metro graph reaching past the `tsconfig`'s `include` — a source beside `src` rather than inside it, or one in a sibling workspace folder. Add it to that project's `include` if `ttsc` plugins should apply to it.
92
+
93
+ The report matters because passing through is not the same as leaving alone: a file that skips the `ttsc` pass keeps whatever plugin-driven syntax it carries, which fails at runtime rather than at build time. Declaration and JavaScript files never reach the pass at all, so they are not reported; they are filtered before it, as `include` / `exclude` above describes.
94
+
95
+ This is the shared core's answer rather than Metro's own, so every `@ttsc/unplugin` adapter gives the identical one. `@ttsc/metro` used to be alone in treating it as non-fatal while every adapter failed the build.
96
+
77
97
  ## Cache invalidation
78
98
 
79
99
  Metro keys its transform cache on each file's own content plus one static transformer key, and its babel-transformer contract has no per-file dependency registration. A `ttsc` transform can depend on a _type_ in another file, so `@ttsc/metro` folds a project fingerprint into that static key: every regular file reached by the non-following project walk, plus reference-graph inputs outside that walk (`node_modules` declarations, monorepo sibling sources, files reached through symlinks or Windows junctions, and out-of-root tsconfig `extends` ancestry) recorded under `node_modules/.cache/ttsc-metro`. Editing any of them re-keys the next run, so `metro bundle` and dev-server starts pick up cross-file type changes without `--reset-cache`.
@@ -1,3 +1,50 @@
1
+ /**
2
+ * Project fingerprint and reference-graph snapshot for `@ttsc/metro`.
3
+ *
4
+ * Metro's transform cache keys each file on its own content plus one static
5
+ * transformer key computed once per run (`getCacheKey`, called on the main
6
+ * process at `Transformer` construction). A ttsc transform's output can depend
7
+ * on inputs Metro never keys: other project sources reached through type-only
8
+ * edges, `node_modules` declarations, monorepo sibling sources, and the
9
+ * tsconfig `extends` ancestry. This module folds all of them into the static
10
+ * key so the cache key incorporates every input that can influence a
11
+ * transform's output:
12
+ *
13
+ * - **Project walk.** Every input file under the fingerprint roots (Metro's
14
+ * `projectRoot` plus the resolved tsconfig's directory when it lies outside),
15
+ * hashed with the exact walk universe the `@ttsc/unplugin` transform core
16
+ * validates its own cache against.
17
+ * - **Recorded out-of-walk inputs.** The transform core cannot walk files outside
18
+ * the roots or under ignored directories, but the host-owned reference graph
19
+ * (samchon/ttsc#718) reports them per transform. Workers record them into a
20
+ * snapshot under `node_modules/.cache/ttsc-metro`; the next run's
21
+ * `getCacheKey` re-hashes the recorded set.
22
+ *
23
+ * Snapshot layout: one main file carrying a random epoch id plus per-worker
24
+ * files with unique names, so concurrent workers never race a shared write.
25
+ * `withTtsc` (the single config process, before workers exist) compacts worker
26
+ * files into the main file. Readers take the union of every file, reading the
27
+ * worker files strictly before the main file: the compactor renames the merged
28
+ * main into place strictly before deleting a worker file, so a worker file that
29
+ * disappears mid-read is always already merged into the main the reader loads
30
+ * afterwards.
31
+ *
32
+ * Sound degradations, by design:
33
+ *
34
+ * - No readable snapshot (first run, wiped cache dir, unwritable filesystem)
35
+ * folds a random nonce: that run shares no cache entries with any other run.
36
+ * - A failed snapshot write persists the pending observation beside the snapshot
37
+ * directory. While any such recovery document exists, readers fold a nonce;
38
+ * successful compaction merges it and mints a fresh epoch.
39
+ * - A recreated snapshot carries a fresh epoch id, so it can never alias a key
40
+ * from an older epoch whose recorded set is unknown.
41
+ * - A plugin-declared volatile output (non-file inputs; unrepresentable in any
42
+ * file fingerprint) marks the snapshot volatile, which also folds a nonce
43
+ * until a later run records the volatile declaration gone.
44
+ * - A recorded input that disappears hashes as a stable `missing` marker, so
45
+ * deletion and reappearance both move the key.
46
+ */
47
+ import { readProjectMembershipPolicy } from "@ttsc/unplugin/api";
1
48
  /** Union of the snapshot state readable on disk. */
2
49
  interface SnapshotState {
3
50
  /** Random epoch id minted when the main snapshot was created. */
@@ -25,12 +72,45 @@ export declare function resolveFingerprintBase(projectRoot: string | undefined):
25
72
  * recorded out-of-walk snapshot.
26
73
  */
27
74
  export declare function fingerprintRoots(base: string, explicitProject: string | undefined): string[];
75
+ /**
76
+ * One project, and the membership policy that describes it.
77
+ *
78
+ * The recorder's question is whether the project walk already covers an input,
79
+ * so it needs both the walk's roots and the policy that walk used, and it is
80
+ * wrong exactly when those two describe different projects. Passing them
81
+ * separately made that mismatch expressible — the policy for one project
82
+ * alongside the root of another — and passing the policy alone made it
83
+ * expressible in a quieter way still, since a recorder that resolved its own
84
+ * could describe a different program than the walk hashed. Both halves travel
85
+ * together so neither can be supplied without the other (samchon/ttsc#1316).
86
+ */
87
+ export interface TtscMetroProjectView {
88
+ /** The base directory both fingerprint sides agree on. */
89
+ readonly base: string;
90
+ /** The caller's explicit `project`, if any. */
91
+ readonly explicitProject: string | undefined;
92
+ /** The membership policy resolved for that project. */
93
+ readonly policy: ReturnType<typeof readProjectMembershipPolicy>;
94
+ }
95
+ /**
96
+ * Resolve one transform's project view, once, for every watch input it reports.
97
+ *
98
+ * Exported because the recorder is asked once per input while the answer is a
99
+ * property of the project, and validating the memo means stat-ing the whole
100
+ * `extends` chain (samchon/ttsc#1316).
101
+ */
102
+ export declare function resolveProjectView(props: {
103
+ compilerOptions?: Record<string, unknown>;
104
+ explicitProject?: string;
105
+ projectRoot?: string;
106
+ }): TtscMetroProjectView;
28
107
  /**
29
108
  * Compute the fingerprint `getCacheKey` folds into Metro's static transformer
30
109
  * key. Never throws: any failure degrades to a nonce, which soundly disables
31
110
  * cross-run cache reuse for this run instead of serving stale output.
32
111
  */
33
112
  export declare function computeProjectFingerprint(props: {
113
+ compilerOptions?: Record<string, unknown>;
34
114
  explicitProject?: string;
35
115
  projectRoot?: string;
36
116
  }): string;
@@ -66,13 +146,30 @@ export declare function readSnapshotState(base: string): SnapshotState | undefin
66
146
  */
67
147
  export declare function createSnapshotRecorder(): {
68
148
  record: (props: {
69
- explicitProject?: string;
70
149
  input: string;
71
- projectRoot?: string;
150
+ /**
151
+ * The project this input belongs to, with the policy its walk uses,
152
+ * resolved once per transform through {@link resolveProjectView}.
153
+ *
154
+ * One value rather than a root and a policy side by side, because the
155
+ * recorder is wrong precisely when those two describe different projects.
156
+ * Deriving the policy here instead would be the same fault in a quieter
157
+ * form: a recorder that resolved its own could describe a different program
158
+ * than the walk hashed, which is what happened when the caller's
159
+ * compiler-options overlay reached one half and not the other, and the
160
+ * input was then covered by neither (samchon/ttsc#1316).
161
+ *
162
+ * Resolving it once per transform is also what makes it affordable.
163
+ * `record` runs once per watch input rather than once per file, and
164
+ * validating the memo means stat-ing the whole `extends` chain, measured at
165
+ * 12 microseconds per stat — a few thousand modules times fifteen inputs
166
+ * each cost over half a second per run for an answer that cannot change
167
+ * between two inputs of one file.
168
+ */
169
+ project: TtscMetroProjectView;
72
170
  }) => void;
73
171
  recordVolatile: (props: {
74
- explicitProject?: string;
75
- projectRoot?: string;
172
+ project: TtscMetroProjectView;
76
173
  }) => void;
77
174
  };
78
175
  /**
@@ -88,10 +88,103 @@ function resolveFingerprintBase(projectRoot) {
88
88
  */
89
89
  function fingerprintRoots(base, explicitProject) {
90
90
  const tsconfig = resolveProjectTsconfig(base, explicitProject);
91
- if (api.isProjectWalkPath(base, tsconfig)) {
92
- return [base];
93
- }
94
- return [base, path.dirname(tsconfig)];
91
+ // Containment, not walk membership. The question here is whether the
92
+ // tsconfig's directory already sits inside the subtree the base walk covers,
93
+ // so that adding it would repeat the same walk. `isProjectWalkPath` answers a
94
+ // different question, whether the walk *hashes* that path, and once the walk
95
+ // stopped hashing files that cannot enter the program it began answering
96
+ // `false` for every `tsconfig.json`, which returned the base twice and hashed
97
+ // the whole project twice on every cache key (samchon/ttsc#1307).
98
+ const directory = path.dirname(path.resolve(tsconfig));
99
+ const relative = path.relative(path.resolve(base), directory);
100
+ const inside = relative === "" ||
101
+ (relative !== ".." &&
102
+ !relative.startsWith(`..${path.sep}`) &&
103
+ !path.isAbsolute(relative));
104
+ return inside ? [base] : [base, directory];
105
+ }
106
+ /**
107
+ * Resolve one transform's project view, once, for every watch input it reports.
108
+ *
109
+ * Exported because the recorder is asked once per input while the answer is a
110
+ * property of the project, and validating the memo means stat-ing the whole
111
+ * `extends` chain (samchon/ttsc#1316).
112
+ */
113
+ function resolveProjectView(props) {
114
+ const base = resolveFingerprintBase(props.projectRoot);
115
+ return {
116
+ base,
117
+ explicitProject: props.explicitProject,
118
+ policy: membershipPolicy(resolveProjectTsconfig(base, props.explicitProject), props.compilerOptions),
119
+ };
120
+ }
121
+ /**
122
+ * The membership policy of one project, memoized per resolved tsconfig and
123
+ * caller overlay.
124
+ *
125
+ * Every use of the walk pair has to ask the same policy, or the two halves
126
+ * disagree about the same project. The walk hashes what the configuration can
127
+ * admit, and `isProjectWalkPath` answers whether the walk covers a path, so a
128
+ * permissive answer here would claim coverage the walk does not provide and the
129
+ * input would be recorded nowhere at all (samchon/ttsc#1307).
130
+ */
131
+ const MEMBERSHIP_POLICIES = new Map();
132
+ function membershipPolicy(tsconfig, compilerOptions) {
133
+ // Keyed by the config's path and the caller's overlay, and never trusted on
134
+ // the key alone: a hit is served only while the config's own stamp still
135
+ // matches. A Metro worker outlives many runs, and this is consulted once per
136
+ // delivered file, so a memo that trusted its key would hold the policy a
137
+ // project had when the worker started. An edit adding `exclude` would then
138
+ // leave the worker judging a file in-walk while the next run's walk skipped
139
+ // it, which is precisely the both-sides-disagree hole this policy exists to
140
+ // close.
141
+ //
142
+ // The overlay belongs in the key rather than the stamp because it is part of
143
+ // the question, not part of any file: keyed by path alone the memo would hand
144
+ // a caller who passed `allowJs` the policy resolved for a caller who did not.
145
+ const key = [tsconfig, stableStringify(compilerOptions ?? {})].join(String.fromCharCode(0));
146
+ const existing = MEMBERSHIP_POLICIES.get(key);
147
+ if (existing !== undefined && existing.stamp === stampOf(existing.sources)) {
148
+ return existing.policy;
149
+ }
150
+ // The caller's compiler-options overlay wins for the compile, so it has to
151
+ // win here too, exactly as it does in the adapter: a project given
152
+ // `allowJs: true` through `withTtsc` has a wider program than its tsconfig
153
+ // alone describes, and a narrower policy here would ask a different question
154
+ // about the same project (samchon/ttsc#1316).
155
+ const policy = api.mergeMembershipPolicyOverlay(api.readProjectMembershipPolicy(tsconfig), compilerOptions ?? {}, path.dirname(path.resolve(tsconfig)));
156
+ // Stamp the whole `extends` chain, not the leaf. Adding `exclude` to a shared
157
+ // `tsconfig.base.json` leaves the leaf's own mtime and size untouched while
158
+ // changing every answer the policy gives, so a leaf-only stamp would keep the
159
+ // worker on the pre-edit policy for its lifetime.
160
+ const sources = policy.sources.length === 0 ? [tsconfig] : [...policy.sources];
161
+ MEMBERSHIP_POLICIES.set(key, {
162
+ policy,
163
+ sources,
164
+ stamp: stampOf(sources),
165
+ });
166
+ return policy;
167
+ }
168
+ /** A stamp over every config a policy was read from, in a stable order. */
169
+ function stampOf(sources) {
170
+ return sources
171
+ .map((source) => {
172
+ try {
173
+ const stats = fs.statSync(source);
174
+ // A directory occupying a candidate path can never be the config, so it
175
+ // contributes its existence and not its modification time, which moves
176
+ // whenever any child is added or removed (samchon/ttsc#1316).
177
+ return stats.isDirectory()
178
+ ? `${source}:directory`
179
+ : `${source}:${stats.mtimeMs}:${stats.size}`;
180
+ }
181
+ catch {
182
+ // Absent now. `readProjectMembershipPolicy` answers for that too, and
183
+ // the policy must be re-asked once the config appears.
184
+ return `${source}:absent`;
185
+ }
186
+ })
187
+ .join("|");
95
188
  }
96
189
  /**
97
190
  * Locate the tsconfig governing the project, mirroring the transform core's
@@ -128,8 +221,25 @@ function computeProjectFingerprint(props) {
128
221
  try {
129
222
  const base = resolveFingerprintBase(props.projectRoot);
130
223
  const hash = node_crypto.createHash("sha256");
224
+ // Judge the fingerprint's walk by the same configuration the compile
225
+ // does. Metro folds this into one static key, so an entry the program
226
+ // could never contain used to re-key every transformed file rather than
227
+ // costing one compile the way it does for a bundler (samchon/ttsc#1307).
228
+ //
229
+ // The caller's compiler-options overlay is part of that configuration, and
230
+ // has to reach the walk as well as the recorder. The two are the halves of
231
+ // one cache key and run in different processes, so they agree only by
232
+ // deriving from the same declared options: a walk resolved without the
233
+ // overlay while the recorder resolves with it leaves an overlay-admitted
234
+ // input in neither half, which is the both-sides-disagree hole in its
235
+ // quietest form (samchon/ttsc#1316).
236
+ const project = resolveProjectView({
237
+ compilerOptions: props.compilerOptions,
238
+ explicitProject: props.explicitProject,
239
+ projectRoot: props.projectRoot,
240
+ });
131
241
  for (const root of fingerprintRoots(base, props.explicitProject)) {
132
- hash.update(stableStringify(api.collectProjectInputHashes(root)));
242
+ hash.update(stableStringify(api.collectProjectInputHashes(root, undefined, undefined, project.policy)));
133
243
  }
134
244
  const snapshot = readSnapshotState(base);
135
245
  if (snapshot === undefined || snapshot.volatile) {
@@ -328,15 +438,15 @@ function readSnapshotState(base) {
328
438
  function createSnapshotRecorder() {
329
439
  const suffix = `${process.pid.toString(36)}-${node_crypto.randomBytes(6).toString("hex")}`;
330
440
  const states = new Map();
331
- function stateFor(projectRoot, explicitProject) {
332
- const base = resolveFingerprintBase(projectRoot);
441
+ function stateFor(project) {
442
+ const base = project.base;
333
443
  let state = states.get(base);
334
444
  if (state === undefined) {
335
445
  state = {
336
446
  dirty: false,
337
447
  files: new Set(),
338
448
  observed: false,
339
- roots: fingerprintRoots(base, explicitProject),
449
+ roots: fingerprintRoots(base, project.explicitProject),
340
450
  volatile: false,
341
451
  };
342
452
  states.set(base, state);
@@ -373,14 +483,14 @@ function createSnapshotRecorder() {
373
483
  }
374
484
  return {
375
485
  record(props) {
376
- const base = resolveFingerprintBase(props.projectRoot);
377
- const state = stateFor(props.projectRoot, props.explicitProject);
486
+ const base = props.project.base;
487
+ const state = stateFor(props.project);
378
488
  const input = path.resolve(props.input);
379
489
  const firstObservation = !state.observed;
380
490
  state.observed = true;
381
491
  if (state.files.has(input) ||
382
492
  (fs.existsSync(input) &&
383
- state.roots.some((root) => api.isProjectWalkPath(root, input)))) {
493
+ state.roots.some((root) => api.isProjectWalkPath(root, input, undefined, undefined, props.project.policy)))) {
384
494
  // Even when every input belongs to the project walk, the worker must
385
495
  // publish that it performed a clean transform. Otherwise an old main
386
496
  // snapshot with `volatile: true` remains sticky forever.
@@ -395,8 +505,8 @@ function createSnapshotRecorder() {
395
505
  flush(base, state);
396
506
  },
397
507
  recordVolatile(props) {
398
- const base = resolveFingerprintBase(props.projectRoot);
399
- const state = stateFor(props.projectRoot, props.explicitProject);
508
+ const base = props.project.base;
509
+ const state = stateFor(props.project);
400
510
  if (state.volatile) {
401
511
  flush(base, state);
402
512
  return;
@@ -592,5 +702,6 @@ exports.fingerprintRoots = fingerprintRoots;
592
702
  exports.prepareSnapshot = prepareSnapshot;
593
703
  exports.readSnapshotState = readSnapshotState;
594
704
  exports.resolveFingerprintBase = resolveFingerprintBase;
705
+ exports.resolveProjectView = resolveProjectView;
595
706
  exports.stableStringify = stableStringify;
596
707
  //# sourceMappingURL=fingerprint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fingerprint.js","sources":["../../src/core/fingerprint.ts"],"sourcesContent":[null],"names":["isProjectWalkPath","createHash","collectProjectInputHashes","collectExternalIn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aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;AACxD,QAAA,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC;IAC3B;IAAE,OAAO,KAAK,EAAE;QACd,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAChC,QAAA,MAAM,KAAK;IACb;AACF;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAC,KAAc,EAAA;AAC5C,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,QAAA,OAAO,CAAA,CAAA,EAAI,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;IACpD;IACA,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC/C,QAAA,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK;AAC5B,aAAA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAC/C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAA,EAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA,CAAA,EAAI,eAAe,CAAC,IAAI,CAAC,CAAA,CAAE;AACtE,aAAA,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG;IACjB;AACA,IAAA,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAC9B;;;;;;;;;;"}
1
+ {"version":3,"file":"fingerprint.js","sources":["../../src/core/fingerprint.ts"],"sourcesContent":[null],"names":["mergeMembershipPolicyOverlay","readProjectMembershipPolicy","createHash","collectProjectInputHashes","collectExternalInputHashes","randomBytes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C3B;IAAE,OAAO,KAAK,EAAE;QACd,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAChC,QAAA,MAAM,KAAK;IACb;AACF;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAC,KAAc,EAAA;AAC5C,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,QAAA,OAAO,CAAA,CAAA,EAAI,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;IACpD;IACA,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC/C,QAAA,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK;AAC5B,aAAA,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAC/C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAA,EAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA,CAAA,EAAI,eAAe,CAAC,IAAI,CAAC,CAAA,CAAE;AACtE,aAAA,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG;IACjB;AACA,IAAA,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;AAC9B;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { isProjectWalkPath, collectProjectInputHashes, collectExternalInputHashes } from '@ttsc/unplugin/api';
1
+ import { isProjectWalkPath, mergeMembershipPolicyOverlay, readProjectMembershipPolicy, collectProjectInputHashes, collectExternalInputHashes } from '@ttsc/unplugin/api';
2
2
  import { randomBytes, createHash } from 'node:crypto';
3
3
  import fs from 'node:fs';
4
4
  import path from 'node:path';
@@ -86,10 +86,103 @@ function resolveFingerprintBase(projectRoot) {
86
86
  */
87
87
  function fingerprintRoots(base, explicitProject) {
88
88
  const tsconfig = resolveProjectTsconfig(base, explicitProject);
89
- if (isProjectWalkPath(base, tsconfig)) {
90
- return [base];
91
- }
92
- return [base, path.dirname(tsconfig)];
89
+ // Containment, not walk membership. The question here is whether the
90
+ // tsconfig's directory already sits inside the subtree the base walk covers,
91
+ // so that adding it would repeat the same walk. `isProjectWalkPath` answers a
92
+ // different question, whether the walk *hashes* that path, and once the walk
93
+ // stopped hashing files that cannot enter the program it began answering
94
+ // `false` for every `tsconfig.json`, which returned the base twice and hashed
95
+ // the whole project twice on every cache key (samchon/ttsc#1307).
96
+ const directory = path.dirname(path.resolve(tsconfig));
97
+ const relative = path.relative(path.resolve(base), directory);
98
+ const inside = relative === "" ||
99
+ (relative !== ".." &&
100
+ !relative.startsWith(`..${path.sep}`) &&
101
+ !path.isAbsolute(relative));
102
+ return inside ? [base] : [base, directory];
103
+ }
104
+ /**
105
+ * Resolve one transform's project view, once, for every watch input it reports.
106
+ *
107
+ * Exported because the recorder is asked once per input while the answer is a
108
+ * property of the project, and validating the memo means stat-ing the whole
109
+ * `extends` chain (samchon/ttsc#1316).
110
+ */
111
+ function resolveProjectView(props) {
112
+ const base = resolveFingerprintBase(props.projectRoot);
113
+ return {
114
+ base,
115
+ explicitProject: props.explicitProject,
116
+ policy: membershipPolicy(resolveProjectTsconfig(base, props.explicitProject), props.compilerOptions),
117
+ };
118
+ }
119
+ /**
120
+ * The membership policy of one project, memoized per resolved tsconfig and
121
+ * caller overlay.
122
+ *
123
+ * Every use of the walk pair has to ask the same policy, or the two halves
124
+ * disagree about the same project. The walk hashes what the configuration can
125
+ * admit, and `isProjectWalkPath` answers whether the walk covers a path, so a
126
+ * permissive answer here would claim coverage the walk does not provide and the
127
+ * input would be recorded nowhere at all (samchon/ttsc#1307).
128
+ */
129
+ const MEMBERSHIP_POLICIES = new Map();
130
+ function membershipPolicy(tsconfig, compilerOptions) {
131
+ // Keyed by the config's path and the caller's overlay, and never trusted on
132
+ // the key alone: a hit is served only while the config's own stamp still
133
+ // matches. A Metro worker outlives many runs, and this is consulted once per
134
+ // delivered file, so a memo that trusted its key would hold the policy a
135
+ // project had when the worker started. An edit adding `exclude` would then
136
+ // leave the worker judging a file in-walk while the next run's walk skipped
137
+ // it, which is precisely the both-sides-disagree hole this policy exists to
138
+ // close.
139
+ //
140
+ // The overlay belongs in the key rather than the stamp because it is part of
141
+ // the question, not part of any file: keyed by path alone the memo would hand
142
+ // a caller who passed `allowJs` the policy resolved for a caller who did not.
143
+ const key = [tsconfig, stableStringify(compilerOptions ?? {})].join(String.fromCharCode(0));
144
+ const existing = MEMBERSHIP_POLICIES.get(key);
145
+ if (existing !== undefined && existing.stamp === stampOf(existing.sources)) {
146
+ return existing.policy;
147
+ }
148
+ // The caller's compiler-options overlay wins for the compile, so it has to
149
+ // win here too, exactly as it does in the adapter: a project given
150
+ // `allowJs: true` through `withTtsc` has a wider program than its tsconfig
151
+ // alone describes, and a narrower policy here would ask a different question
152
+ // about the same project (samchon/ttsc#1316).
153
+ const policy = mergeMembershipPolicyOverlay(readProjectMembershipPolicy(tsconfig), compilerOptions ?? {}, path.dirname(path.resolve(tsconfig)));
154
+ // Stamp the whole `extends` chain, not the leaf. Adding `exclude` to a shared
155
+ // `tsconfig.base.json` leaves the leaf's own mtime and size untouched while
156
+ // changing every answer the policy gives, so a leaf-only stamp would keep the
157
+ // worker on the pre-edit policy for its lifetime.
158
+ const sources = policy.sources.length === 0 ? [tsconfig] : [...policy.sources];
159
+ MEMBERSHIP_POLICIES.set(key, {
160
+ policy,
161
+ sources,
162
+ stamp: stampOf(sources),
163
+ });
164
+ return policy;
165
+ }
166
+ /** A stamp over every config a policy was read from, in a stable order. */
167
+ function stampOf(sources) {
168
+ return sources
169
+ .map((source) => {
170
+ try {
171
+ const stats = fs.statSync(source);
172
+ // A directory occupying a candidate path can never be the config, so it
173
+ // contributes its existence and not its modification time, which moves
174
+ // whenever any child is added or removed (samchon/ttsc#1316).
175
+ return stats.isDirectory()
176
+ ? `${source}:directory`
177
+ : `${source}:${stats.mtimeMs}:${stats.size}`;
178
+ }
179
+ catch {
180
+ // Absent now. `readProjectMembershipPolicy` answers for that too, and
181
+ // the policy must be re-asked once the config appears.
182
+ return `${source}:absent`;
183
+ }
184
+ })
185
+ .join("|");
93
186
  }
94
187
  /**
95
188
  * Locate the tsconfig governing the project, mirroring the transform core's
@@ -126,8 +219,25 @@ function computeProjectFingerprint(props) {
126
219
  try {
127
220
  const base = resolveFingerprintBase(props.projectRoot);
128
221
  const hash = createHash("sha256");
222
+ // Judge the fingerprint's walk by the same configuration the compile
223
+ // does. Metro folds this into one static key, so an entry the program
224
+ // could never contain used to re-key every transformed file rather than
225
+ // costing one compile the way it does for a bundler (samchon/ttsc#1307).
226
+ //
227
+ // The caller's compiler-options overlay is part of that configuration, and
228
+ // has to reach the walk as well as the recorder. The two are the halves of
229
+ // one cache key and run in different processes, so they agree only by
230
+ // deriving from the same declared options: a walk resolved without the
231
+ // overlay while the recorder resolves with it leaves an overlay-admitted
232
+ // input in neither half, which is the both-sides-disagree hole in its
233
+ // quietest form (samchon/ttsc#1316).
234
+ const project = resolveProjectView({
235
+ compilerOptions: props.compilerOptions,
236
+ explicitProject: props.explicitProject,
237
+ projectRoot: props.projectRoot,
238
+ });
129
239
  for (const root of fingerprintRoots(base, props.explicitProject)) {
130
- hash.update(stableStringify(collectProjectInputHashes(root)));
240
+ hash.update(stableStringify(collectProjectInputHashes(root, undefined, undefined, project.policy)));
131
241
  }
132
242
  const snapshot = readSnapshotState(base);
133
243
  if (snapshot === undefined || snapshot.volatile) {
@@ -326,15 +436,15 @@ function readSnapshotState(base) {
326
436
  function createSnapshotRecorder() {
327
437
  const suffix = `${process.pid.toString(36)}-${randomBytes(6).toString("hex")}`;
328
438
  const states = new Map();
329
- function stateFor(projectRoot, explicitProject) {
330
- const base = resolveFingerprintBase(projectRoot);
439
+ function stateFor(project) {
440
+ const base = project.base;
331
441
  let state = states.get(base);
332
442
  if (state === undefined) {
333
443
  state = {
334
444
  dirty: false,
335
445
  files: new Set(),
336
446
  observed: false,
337
- roots: fingerprintRoots(base, explicitProject),
447
+ roots: fingerprintRoots(base, project.explicitProject),
338
448
  volatile: false,
339
449
  };
340
450
  states.set(base, state);
@@ -371,14 +481,14 @@ function createSnapshotRecorder() {
371
481
  }
372
482
  return {
373
483
  record(props) {
374
- const base = resolveFingerprintBase(props.projectRoot);
375
- const state = stateFor(props.projectRoot, props.explicitProject);
484
+ const base = props.project.base;
485
+ const state = stateFor(props.project);
376
486
  const input = path.resolve(props.input);
377
487
  const firstObservation = !state.observed;
378
488
  state.observed = true;
379
489
  if (state.files.has(input) ||
380
490
  (fs.existsSync(input) &&
381
- state.roots.some((root) => isProjectWalkPath(root, input)))) {
491
+ state.roots.some((root) => isProjectWalkPath(root, input, undefined, undefined, props.project.policy)))) {
382
492
  // Even when every input belongs to the project walk, the worker must
383
493
  // publish that it performed a clean transform. Otherwise an old main
384
494
  // snapshot with `volatile: true` remains sticky forever.
@@ -393,8 +503,8 @@ function createSnapshotRecorder() {
393
503
  flush(base, state);
394
504
  },
395
505
  recordVolatile(props) {
396
- const base = resolveFingerprintBase(props.projectRoot);
397
- const state = stateFor(props.projectRoot, props.explicitProject);
506
+ const base = props.project.base;
507
+ const state = stateFor(props.project);
398
508
  if (state.volatile) {
399
509
  flush(base, state);
400
510
  return;
@@ -584,5 +694,5 @@ function stableStringify(value) {
584
694
  return JSON.stringify(value);
585
695
  }
586
696
 
587
- export { computeProjectFingerprint, createSnapshotRecorder, fingerprintRoots, prepareSnapshot, readSnapshotState, resolveFingerprintBase, stableStringify };
697
+ export { computeProjectFingerprint, createSnapshotRecorder, fingerprintRoots, prepareSnapshot, readSnapshotState, resolveFingerprintBase, resolveProjectView, stableStringify };
588
698
  //# sourceMappingURL=fingerprint.mjs.map