@ttsc/metro 0.32.0 → 0.33.0-next.1

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.
@@ -2,16 +2,15 @@ import type { TtscUnpluginOptions } from "@ttsc/unplugin/api";
2
2
  /**
3
3
  * Options accepted by {@link withTtsc} and the Metro transformer.
4
4
  *
5
- * The `project` / `compilerOptions` / `plugins` fields are inherited from
6
- * `@ttsc/unplugin` so the Metro adapter speaks the exact same configuration
7
- * language as every other bundler integration. The remaining fields are
8
- * Metro-specific.
5
+ * The `precompile` / `project` / `compilerOptions` / `plugins` fields are
6
+ * inherited from `@ttsc/unplugin` so the Metro adapter speaks the exact same
7
+ * configuration language as every other bundler integration. The remaining
8
+ * fields are Metro-specific.
9
9
  *
10
- * Every field is JSON-serialisable on purpose: `withTtsc` runs in the Metro
11
- * **config** process, but the transformer runs in Metro's **worker** processes,
12
- * so the resolved options have to survive a JSON / env round-trip to reach them
13
- * (see {@link serializeOptions}). That is why `include`/`exclude` are plain
14
- * substring patterns rather than `RegExp`.
10
+ * Callers must supply JSON-compatible values: `withTtsc` runs in the Metro
11
+ * config process and the transformer receives serialized options in worker
12
+ * processes through {@link serializeOptions}. Include/exclude patterns are plain
13
+ * strings for that transport.
15
14
  *
16
15
  * @evidence contracts/common.md#principled-implementation
17
16
  * This interface extends the documented Unplugin option contract rather than
@@ -106,7 +105,7 @@ export interface TtscMetroOptions extends TtscUnpluginOptions {
106
105
  * Carries project and upstream paths as strings; every path is resolved by the code that consumes it.
107
106
  */
108
107
  export interface ResolvedTtscMetroOptions {
109
- /** Options forwarded verbatim to the `@ttsc/unplugin` transform core. */
108
+ /** Compiler options with precompile entries normalized to a string array. */
110
109
  ttsc: TtscUnpluginOptions;
111
110
  /** Explicit upstream transformer module path, or `undefined` to auto-detect. */
112
111
  upstreamTransformer?: string;
@@ -60,12 +60,12 @@ export declare function serializeOptions(options: TtscMetroOptions, snapshotRunI
60
60
  * behaviour for a project that called `withTtsc(config)` with no explicit
61
61
  * options.
62
62
  *
63
- * All common compiler options, including the output-addressing `projectRoot`,
64
- * survive this transport without interpreting their paths in the config host. A
63
+ * Common compiler options, including `precompile` entries and `projectRoot`,
64
+ * survive transport without interpreting their paths in the config host. A
65
65
  * present `plugins` property is forwarded even when its value is `false`;
66
- * omission leaves plugin selection to the project. The `include` and `exclude`
67
- * arrays retain only string entries, while invalid array values become empty
68
- * filters. Only a non-empty string is accepted as the private run identity.
66
+ * omission leaves plugin selection to the project. The include/exclude filters
67
+ * and precompile entry list retain only strings; invalid arrays become empty
68
+ * lists. Only a non-empty string is accepted as the private run identity.
69
69
  *
70
70
  * @evidence contracts/common.md#principled-implementation
71
71
  * JSON.parse reads the adapter-owned environment channel. The parser accepts
@@ -90,8 +90,8 @@ export declare function serializeOptions(options: TtscMetroOptions, snapshotRunI
90
90
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
91
91
  * Returns a fresh object and keeps no state or handle.
92
92
  *
93
- * @evidenceExclude contracts/performance.md#efficient-algorithms
94
- * One JSON.parse and a filter over the short include and exclude arrays.
93
+ * @evidence contracts/performance.md#efficient-algorithms
94
+ * Parsing visits the payload bytes and filtering visits the include, exclude and precompile arrays once. Returned arrays retain only their string entries, with storage proportional to the accepted entries and their text.
95
95
  *
96
96
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work
97
97
  * The transformer calls it once per worker and memoises the result in options().
@@ -66,12 +66,12 @@ function serializeOptions(options, snapshotRunId) {
66
66
  * behaviour for a project that called `withTtsc(config)` with no explicit
67
67
  * options.
68
68
  *
69
- * All common compiler options, including the output-addressing `projectRoot`,
70
- * survive this transport without interpreting their paths in the config host. A
69
+ * Common compiler options, including `precompile` entries and `projectRoot`,
70
+ * survive transport without interpreting their paths in the config host. A
71
71
  * present `plugins` property is forwarded even when its value is `false`;
72
- * omission leaves plugin selection to the project. The `include` and `exclude`
73
- * arrays retain only string entries, while invalid array values become empty
74
- * filters. Only a non-empty string is accepted as the private run identity.
72
+ * omission leaves plugin selection to the project. The include/exclude filters
73
+ * and precompile entry list retain only strings; invalid arrays become empty
74
+ * lists. Only a non-empty string is accepted as the private run identity.
75
75
  *
76
76
  * @evidence contracts/common.md#principled-implementation
77
77
  * JSON.parse reads the adapter-owned environment channel. The parser accepts
@@ -96,8 +96,8 @@ function serializeOptions(options, snapshotRunId) {
96
96
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
97
97
  * Returns a fresh object and keeps no state or handle.
98
98
  *
99
- * @evidenceExclude contracts/performance.md#efficient-algorithms
100
- * One JSON.parse and a filter over the short include and exclude arrays.
99
+ * @evidence contracts/performance.md#efficient-algorithms
100
+ * Parsing visits the payload bytes and filtering visits the include, exclude and precompile arrays once. Returned arrays retain only their string entries, with storage proportional to the accepted entries and their text.
101
101
  *
102
102
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work
103
103
  * The transformer calls it once per worker and memoises the result in options().
@@ -110,6 +110,9 @@ function resolveOptionsFromEnv() {
110
110
  const parsed = parse(raw);
111
111
  return {
112
112
  ttsc: {
113
+ precompile: parsed.precompile === undefined
114
+ ? undefined
115
+ : toStringArray(parsed.precompile),
113
116
  project: parsed.project,
114
117
  projectRoot: parsed.projectRoot,
115
118
  compilerOptions: parsed.compilerOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sources":["../../src/core/options.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;;;;AASG;AACI,MAAM,OAAO,GAAG;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACG,SAAU,gBAAgB,CAC9B,OAAyB,EACzB,aAAsB,EAAA;IAEtB,OAAO,IAAI,CAAC,SAAS,CAAC;AACpB,QAAA,IAAI,OAAO,IAAI,EAAE,CAAC;AAClB,QAAA,IAAI,aAAa,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAC3E,KAAA,CAAC;AACJ;AAEA;;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AmB,EACjB,OAAO,MAAM,CAAC,mBAAmB,KAAK;cAClC,MAAM,CAAC;AACT,cAAE,SAAS;AACf,QAAA,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;AACtC,QAAA,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;AACtC,QAAA,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ;AAC9C,YAAA,MAAM,CAAC,eAAe,CAAC,MAAM,KAAK;AAChC,cAAE,EAAE,aAAa,EAAE,MAAM,CAAC,eAAe;cACvC,EAAE,CAAC;KACR;AACH;AAEA,SAAS,KAAK,CACZ,GAAuB,EAAA;IAEvB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,QAAA,OAAO,EAAE;IACX;AACA,IAAA,IAAI;QACF,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;;;;AAItC,QAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK;AACxE,cAAG;cACD,EAAE;IACR;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;IACX;AACF;AAEA;;;;AAIG;AACH,SAAS,aAAa,CAAC,KAAc,EAAA;AACnC,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK;AACxB,UAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,KAAsB,OAAO,KAAK,KAAK,QAAQ;UAClE,EAAE;AACR;;;;;;"}
@@ -64,12 +64,12 @@ function serializeOptions(options, snapshotRunId) {
64
64
  * behaviour for a project that called `withTtsc(config)` with no explicit
65
65
  * options.
66
66
  *
67
- * All common compiler options, including the output-addressing `projectRoot`,
68
- * survive this transport without interpreting their paths in the config host. A
67
+ * Common compiler options, including `precompile` entries and `projectRoot`,
68
+ * survive transport without interpreting their paths in the config host. A
69
69
  * present `plugins` property is forwarded even when its value is `false`;
70
- * omission leaves plugin selection to the project. The `include` and `exclude`
71
- * arrays retain only string entries, while invalid array values become empty
72
- * filters. Only a non-empty string is accepted as the private run identity.
70
+ * omission leaves plugin selection to the project. The include/exclude filters
71
+ * and precompile entry list retain only strings; invalid arrays become empty
72
+ * lists. Only a non-empty string is accepted as the private run identity.
73
73
  *
74
74
  * @evidence contracts/common.md#principled-implementation
75
75
  * JSON.parse reads the adapter-owned environment channel. The parser accepts
@@ -94,8 +94,8 @@ function serializeOptions(options, snapshotRunId) {
94
94
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
95
95
  * Returns a fresh object and keeps no state or handle.
96
96
  *
97
- * @evidenceExclude contracts/performance.md#efficient-algorithms
98
- * One JSON.parse and a filter over the short include and exclude arrays.
97
+ * @evidence contracts/performance.md#efficient-algorithms
98
+ * Parsing visits the payload bytes and filtering visits the include, exclude and precompile arrays once. Returned arrays retain only their string entries, with storage proportional to the accepted entries and their text.
99
99
  *
100
100
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work
101
101
  * The transformer calls it once per worker and memoises the result in options().
@@ -108,6 +108,9 @@ function resolveOptionsFromEnv() {
108
108
  const parsed = parse(raw);
109
109
  return {
110
110
  ttsc: {
111
+ precompile: parsed.precompile === undefined
112
+ ? undefined
113
+ : toStringArray(parsed.precompile),
111
114
  project: parsed.project,
112
115
  projectRoot: parsed.projectRoot,
113
116
  compilerOptions: parsed.compilerOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"options.mjs","sources":["../../src/core/options.ts"],"sourcesContent":[null],"names":[],"mappings":"AAKA;;;;;;;;;AASG;AACI,MAAM,OAAO,GAAG;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACG,SAAU,gBAAgB,CAC9B,OAAyB,EACzB,aAAsB,EAAA;IAEtB,OAAO,IAAI,CAAC,SAAS,CAAC;AACpB,QAAA,IAAI,OAAO,IAAI,EAAE,CAAC;AAClB,QAAA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AAS,IAAI,MAAM,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC;AAC5D,SAAA;AACD,QAAA,mBAAmB,EACjB,OAAO,MAAM,CAAC,mBAAmB,KAAK;cAClC,MAAM,CAAC;AACT,cAAE,SAAS;AACf,QAAA,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;AACtC,QAAA,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;AACtC,QAAA,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ;AAC9C,YAAA,MAAM,CAAC,eAAe,CAAC,MAAM,KAAK;AAChC,cAAE,EAAE,aAAa,EAAE,MAAM,CAAC,eAAe;cACvC,EAAE,CAAC;KACR;AACH;AAEA,SAAS,KAAK,CACZ,GAAuB,EAAA;IAEvB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,QAAA,OAAO,EAAE;IACX;AACA,IAAA,IAAI;QACF,MAAM,KAAK,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;;;;AAItC,QAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK;AACxE,cAAG;cACD,EAAE;IACR;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;IACX;AACF;AAEA;;;;AAIG;AACH,SAAS,aAAa,CAAC,KAAc,EAAA;AACnC,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK;AACxB,UAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,KAAsB,OAAO,KAAK,KAAK,QAAQ;UAClE,EAAE;AACR;;;;"}
@@ -202,11 +202,11 @@ async function transform(params) {
202
202
  // discovery inside the transform after a config candidate changes would
203
203
  // attach one project's recorder evidence to another project's compiler
204
204
  // output.
205
- const transformOptions = {
206
- ...unpluginOptions,
207
- project: project.tsconfig,
208
- };
209
- const result = await api.transformTtsc(filename, params.src, transformOptions, undefined, cache, {
205
+ const result = await api.transformTtsc(filename, params.src, unpluginOptions, undefined, cache, {
206
+ // This route belongs to the current module's discovery transaction.
207
+ // Keeping it out of user options lets explicit precompile entries
208
+ // discover their own projects instead of all compiling this one.
209
+ projectSelection: project.tsconfig,
210
210
  // Metro offers no per-file dependency registration, so the derived
211
211
  // watch inputs (plugin-reported dependencies unioned with the
212
212
  // reference graph's reach, globals, and configs) feed the snapshot
@@ -1 +1 @@
1
- {"version":3,"file":"transformer.js","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":["createRequire","createTtscTransformCache","shareTtscTransformCache","readTtscTransformSession","resolveOptionsFromEnv","createSnapshotRecorder","upstream","resolveUpstreamTransformer","resolveOptions","resolveProjectView","transformTtsc","remapAstLocations","createHash","stableStringify","randomBytes","computeProjectFingerprint","isTransformTarget"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAwBH,MAAM,WAAW,GAAGA,yBAAa,CAAC,gQAAe,CAAC;AAElD;;;;;AAKG;AACH,IAAI,QAA8C;AAClD,IAAI,eAA8D;AAClE,MAAM,KAAK,GAAGC,4BAAwB,EAAE;AACxC;AACA;AACAC,2BAAuB,CAAC,KAAK,EAAEC,4BAAwB,EAAE,CAAC;AAC1D,IAAI,gBAAuE;AAE3E;AACA,SAAS,OAAO,GAAA;AACd,IAAA,QAAQ,QAAQ,KAAKC,+BAAqB,EAAE;AAC9C;AAEA;AACA,SAAS,QAAQ,GAAA;AACf,IAAA,MAAM,IAAI,GAAG,OAAO,EAAE;IACtB,QAAQ,gBAAgB,KAAKC,kCAAsB,CAAC,IAAI,CAAC,aAAa,CAAC;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,uBAAuB,CACrC,QAAgB,EAChB,OAAiC,EAAA;AAEjC,IAAA,IAAI,IAAI,CA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,cAAc,GAAA;AACrB,IAAA,IAAI;AACF,QAAA,MAAM,GAAG,GAAG,WAAW,CAAC,0BAA0B,CAAyB;AAC3E,QAAA,OAAO,GAAG,CAAC,OAAO,IAAI,GAAG;IAC3B;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,GAAG;IACZ;AACF;;;;;;;"}
1
+ {"version":3,"file":"transformer.js","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":["createRequire","createTtscTransformCache","shareTtscTransformCache","readTtscTransformSession","resolveOptionsFromEnv","createSnapshotRecorder","upstream","resolveUpstreamTransformer","resolveOptions","resolveProjectView","transformTtsc","remapAstLocations","createHash","stableStringify","randomBytes","computeProjectFingerprint","isTransformTarget"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAwBH,MAAM,WAAW,GAAGA,yBAAa,CAAC,gQAAe,CAAC;AAElD;;;;;AAKG;AACH,IAAI,QAA8C;AAClD,IAAI,eAA8D;AAClE,MAAM,KAAK,GAAGC,4BAAwB,EAAE;AACxC;AACA;AACAC,2BAAuB,CAAC,KAAK,EAAEC,4BAAwB,EAAE,CAAC;AAC1D,IAAI,gBAAuE;AAE3E;AACA,SAAS,OAAO,GAAA;AACd,IAAA,QAAQ,QAAQ,KAAKC,+BAAqB,EAAE;AAC9C;AAEA;AACA,SAAS,QAAQ,GAAA;AACf,IAAA,MAAM,IAAI,GAAG,OAAO,EAAE;IACtB,QAAQ,gBAAgB,KAAKC,kCAAsB,CAAC,IAAI,CAAC,aAAa,CAAC;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,uBAAuB,CACrC,QAAgB,EAChB,OAAiC,EAAA;AAEjC,IAAA,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;AAC7B,QAAA,OAAO,QAAQ;IACjB;IACA,MAAM,WAAW,GACf,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,CAA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Z;AACF;;;;;;;"}
@@ -199,11 +199,11 @@ async function transform(params) {
199
199
  // discovery inside the transform after a config candidate changes would
200
200
  // attach one project's recorder evidence to another project's compiler
201
201
  // output.
202
- const transformOptions = {
203
- ...unpluginOptions,
204
- project: project.tsconfig,
205
- };
206
- const result = await transformTtsc(filename, params.src, transformOptions, undefined, cache, {
202
+ const result = await transformTtsc(filename, params.src, unpluginOptions, undefined, cache, {
203
+ // This route belongs to the current module's discovery transaction.
204
+ // Keeping it out of user options lets explicit precompile entries
205
+ // discover their own projects instead of all compiling this one.
206
+ projectSelection: project.tsconfig,
207
207
  // Metro offers no per-file dependency registration, so the derived
208
208
  // watch inputs (plugin-reported dependencies unioned with the
209
209
  // reference graph's reach, globals, and configs) feed the snapshot
@@ -1 +1 @@
1
- {"version":3,"file":"transformer.mjs","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAwBH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAElD;;;;;AAKG;AACH,IAAI,QAA8C;AAClD,IAAI,eAA8D;AAClE,MAAM,KAAK,GAAG,wBAAwB,EAAE;AACxC;AACA;AACA,uBAAuB,CAAC,KAAK,EAAE,wBAAwB,EAAE,CAAC;AAC1D,IAAI,gBAAuE;AAE3E;AACA,SAAS,OAAO,GAAA;AACd,IAAA,QAAQ,QAAQ,KAAK,qBAAqB,EAAE;AAC9C;AAEA;AACA,SAAS,QAAQ,GAAA;AACf,IAAA,MAAM,IAAI,GAAG,OAAO,EAAE;IACtB,QAAQ,gBAAgB,KAAK,sBAAsB,CAAC,IAAI,CAAC,aAAa,CAAC;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,uBAAuB,CACrC,QAAgB,EAChB,OAAiC,EAAA;AAEjC,IAAA,IAAI,IAAI,CAAC,UAAU,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,WAAW,KAAK,SAAS,EAAE;AACtC,QAAA,OAAO,EAAE;IACX;AACA,IAAA,IAAI;AACF,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACpD;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;AACG,SAAU,eAAe,CAC7B,QAAgB,EAChB,IAA8B,EAAA;AAE9B,IAAA,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;AAChC,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE;AAC9D,QAAA,OAAO,KAAK;IACd;AACA,IAAA,IACE,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;AACzB,QAAA,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAC3D;AACA,QAAA,OAAO,KAAK;IACd;AACA,IAAA,OAAO,IAAI;AACb;AAEA,SAAS,cAAc,GAAA;AACrB,IAAA,IAAI;AACF,QAAA,MAAM,GAAG,GAAG,WAAW,CAAC,0BAA0B,CAAyB;AAC3E,QAAA,OAAO,GAAG,CAAC,OAAO,IAAI,GAAG;IAC3B;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,GAAG;IACZ;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/metro",
3
- "version": "0.32.0",
3
+ "version": "0.33.0-next.1",
4
4
  "description": "Metro (React Native / Expo) adapter for ttsc plugins.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -35,13 +35,13 @@
35
35
  "src"
36
36
  ],
37
37
  "dependencies": {
38
- "@ttsc/unplugin": "^0.32.0"
38
+ "@ttsc/unplugin": "^0.33.0-next.1"
39
39
  },
40
40
  "peerDependencies": {
41
- "ttsc": "^0.32.0"
41
+ "ttsc": "^0.33.0-next.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@wrtnlabs/evidence": "^0.5.0",
44
+ "@wrtnlabs/evidence": "^0.5.1",
45
45
  "@rollup/plugin-commonjs": "^29.0.2",
46
46
  "@rollup/plugin-node-resolve": "^16.0.3",
47
47
  "@types/node": "^25.3.0",
@@ -50,7 +50,7 @@
50
50
  "tinyglobby": "^0.2.16",
51
51
  "tslib": "^2.8.1",
52
52
  "typescript": "^7.0.2",
53
- "ttsc": "0.32.0"
53
+ "ttsc": "0.33.0-next.1"
54
54
  },
55
55
  "repository": {
56
56
  "type": "git",
@@ -3,16 +3,15 @@ import type { TtscUnpluginOptions } from "@ttsc/unplugin/api";
3
3
  /**
4
4
  * Options accepted by {@link withTtsc} and the Metro transformer.
5
5
  *
6
- * The `project` / `compilerOptions` / `plugins` fields are inherited from
7
- * `@ttsc/unplugin` so the Metro adapter speaks the exact same configuration
8
- * language as every other bundler integration. The remaining fields are
9
- * Metro-specific.
6
+ * The `precompile` / `project` / `compilerOptions` / `plugins` fields are
7
+ * inherited from `@ttsc/unplugin` so the Metro adapter speaks the exact same
8
+ * configuration language as every other bundler integration. The remaining
9
+ * fields are Metro-specific.
10
10
  *
11
- * Every field is JSON-serialisable on purpose: `withTtsc` runs in the Metro
12
- * **config** process, but the transformer runs in Metro's **worker** processes,
13
- * so the resolved options have to survive a JSON / env round-trip to reach them
14
- * (see {@link serializeOptions}). That is why `include`/`exclude` are plain
15
- * substring patterns rather than `RegExp`.
11
+ * Callers must supply JSON-compatible values: `withTtsc` runs in the Metro
12
+ * config process and the transformer receives serialized options in worker
13
+ * processes through {@link serializeOptions}. Include/exclude patterns are plain
14
+ * strings for that transport.
16
15
  *
17
16
  * @evidence contracts/common.md#principled-implementation
18
17
  * This interface extends the documented Unplugin option contract rather than
@@ -110,7 +109,7 @@ export interface TtscMetroOptions extends TtscUnpluginOptions {
110
109
  * Carries project and upstream paths as strings; every path is resolved by the code that consumes it.
111
110
  */
112
111
  export interface ResolvedTtscMetroOptions {
113
- /** Options forwarded verbatim to the `@ttsc/unplugin` transform core. */
112
+ /** Compiler options with precompile entries normalized to a string array. */
114
113
  ttsc: TtscUnpluginOptions;
115
114
 
116
115
  /** Explicit upstream transformer module path, or `undefined` to auto-detect. */
@@ -74,12 +74,12 @@ export function serializeOptions(
74
74
  * behaviour for a project that called `withTtsc(config)` with no explicit
75
75
  * options.
76
76
  *
77
- * All common compiler options, including the output-addressing `projectRoot`,
78
- * survive this transport without interpreting their paths in the config host. A
77
+ * Common compiler options, including `precompile` entries and `projectRoot`,
78
+ * survive transport without interpreting their paths in the config host. A
79
79
  * present `plugins` property is forwarded even when its value is `false`;
80
- * omission leaves plugin selection to the project. The `include` and `exclude`
81
- * arrays retain only string entries, while invalid array values become empty
82
- * filters. Only a non-empty string is accepted as the private run identity.
80
+ * omission leaves plugin selection to the project. The include/exclude filters
81
+ * and precompile entry list retain only strings; invalid arrays become empty
82
+ * lists. Only a non-empty string is accepted as the private run identity.
83
83
  *
84
84
  * @evidence contracts/common.md#principled-implementation
85
85
  * JSON.parse reads the adapter-owned environment channel. The parser accepts
@@ -104,8 +104,8 @@ export function serializeOptions(
104
104
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources
105
105
  * Returns a fresh object and keeps no state or handle.
106
106
  *
107
- * @evidenceExclude contracts/performance.md#efficient-algorithms
108
- * One JSON.parse and a filter over the short include and exclude arrays.
107
+ * @evidence contracts/performance.md#efficient-algorithms
108
+ * Parsing visits the payload bytes and filtering visits the include, exclude and precompile arrays once. Returned arrays retain only their string entries, with storage proportional to the accepted entries and their text.
109
109
  *
110
110
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work
111
111
  * The transformer calls it once per worker and memoises the result in options().
@@ -118,6 +118,10 @@ export function resolveOptionsFromEnv(): ResolvedTtscMetroOptions {
118
118
  const parsed = parse(raw);
119
119
  return {
120
120
  ttsc: {
121
+ precompile:
122
+ parsed.precompile === undefined
123
+ ? undefined
124
+ : toStringArray(parsed.precompile),
121
125
  project: parsed.project,
122
126
  projectRoot: parsed.projectRoot,
123
127
  compilerOptions: parsed.compilerOptions,
@@ -231,17 +231,17 @@ export async function transform(params: {
231
231
  // discovery inside the transform after a config candidate changes would
232
232
  // attach one project's recorder evidence to another project's compiler
233
233
  // output.
234
- const transformOptions = {
235
- ...unpluginOptions,
236
- project: project.tsconfig,
237
- };
238
234
  const result = await transformTtsc(
239
235
  filename,
240
236
  params.src,
241
- transformOptions,
237
+ unpluginOptions,
242
238
  undefined,
243
239
  cache,
244
240
  {
241
+ // This route belongs to the current module's discovery transaction.
242
+ // Keeping it out of user options lets explicit precompile entries
243
+ // discover their own projects instead of all compiling this one.
244
+ projectSelection: project.tsconfig,
245
245
  // Metro offers no per-file dependency registration, so the derived
246
246
  // watch inputs (plugin-reported dependencies unioned with the
247
247
  // reference graph's reach, globals, and configs) feed the snapshot