@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 +21 -1
- package/lib/core/fingerprint.d.ts +101 -4
- package/lib/core/fingerprint.js +124 -13
- package/lib/core/fingerprint.js.map +1 -1
- package/lib/core/fingerprint.mjs +125 -15
- package/lib/core/fingerprint.mjs.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.js +131 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +132 -2
- package/lib/index.mjs.map +1 -1
- package/lib/transformer.js +25 -20
- package/lib/transformer.js.map +1 -1
- package/lib/transformer.mjs +26 -21
- package/lib/transformer.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/fingerprint.ts +207 -21
- package/src/index.ts +141 -2
- package/src/transformer.ts +26 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.mjs","sources":["../../src/core/fingerprint.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CG;AAUH;AACA,MAAM,gBAAgB,GAAG,CAAC;AAE1B;AACA,MAAM,kBAAkB,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,YAAY,CAAC;AAEnE;AACA,MAAM,yBAAyB,GAAG,uBAAuB;AAEzD;AACA,MAAM,aAAa,GAAG,mBAAmB;AAEzC;AACA,MAAM,sBAAsB,GAAG,sBAAsB;AAErD;AACA,MAAM,8BAA8B,GAAG,8BAA8B;AA4BrE;AACA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU;AAE5C;;;;;;AAMG;AACG,SAAU,sBAAsB,CACpC,WAA+B,EAAA;AAE/B,IAAA,OAAO,IAAI,CAAC,OAAO,CACjB,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK;AACxD,UAAE;AACF,UAAE,OAAO,CAAC,G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S,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;;;;"}
|
package/lib/index.d.ts
CHANGED
|
@@ -24,5 +24,13 @@ interface MetroConfigLike {
|
|
|
24
24
|
* With no `options`, the transformer auto-discovers `tsconfig.json` and runs
|
|
25
25
|
* the plugins configured there: the standard ttsc model. Pass `options` only to
|
|
26
26
|
* override the project path, plugin list, or include/exclude filters.
|
|
27
|
+
*
|
|
28
|
+
* A `babelTransformerPath` the config already carried is chained rather than
|
|
29
|
+
* replaced: it becomes the upstream this transformer delegates to, so wrapping
|
|
30
|
+
* a working config keeps whatever it configured. `react-native-svg-transformer`
|
|
31
|
+
* is installed by exactly that assignment, and replacing it silently sent every
|
|
32
|
+
* `.svg` to the auto-detected Expo default instead, with the build still
|
|
33
|
+
* succeeding (samchon/ttsc#1321). An explicit `upstreamTransformer` option
|
|
34
|
+
* still wins, since that is the caller saying it outright.
|
|
27
35
|
*/
|
|
28
36
|
export declare function withTtsc<T extends MetroConfigLike>(config: T, options?: TtscMetroOptions): T;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var fs = require('node:fs');
|
|
4
|
+
var node_module = require('node:module');
|
|
3
5
|
var path = require('node:path');
|
|
4
6
|
var node_url = require('node:url');
|
|
5
7
|
var fingerprint = require('./core/fingerprint.js');
|
|
@@ -47,9 +49,17 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
47
49
|
* With no `options`, the transformer auto-discovers `tsconfig.json` and runs
|
|
48
50
|
* the plugins configured there: the standard ttsc model. Pass `options` only to
|
|
49
51
|
* override the project path, plugin list, or include/exclude filters.
|
|
52
|
+
*
|
|
53
|
+
* A `babelTransformerPath` the config already carried is chained rather than
|
|
54
|
+
* replaced: it becomes the upstream this transformer delegates to, so wrapping
|
|
55
|
+
* a working config keeps whatever it configured. `react-native-svg-transformer`
|
|
56
|
+
* is installed by exactly that assignment, and replacing it silently sent every
|
|
57
|
+
* `.svg` to the auto-detected Expo default instead, with the build still
|
|
58
|
+
* succeeding (samchon/ttsc#1321). An explicit `upstreamTransformer` option
|
|
59
|
+
* still wins, since that is the caller saying it outright.
|
|
50
60
|
*/
|
|
51
61
|
function withTtsc(config, options$1 = {}) {
|
|
52
|
-
process.env[options.ENV_KEY] = options.serializeOptions(options$1);
|
|
62
|
+
process.env[options.ENV_KEY] = options.serializeOptions(inheritConfiguredTransformer(config, options$1));
|
|
53
63
|
// Prepare the reference-graph snapshot backing the transformer's cache-key
|
|
54
64
|
// fingerprint (see `core/fingerprint.ts`). This runs in the single Metro
|
|
55
65
|
// config process before any worker exists, so it is the race-free moment to
|
|
@@ -63,6 +73,126 @@ function withTtsc(config, options$1 = {}) {
|
|
|
63
73
|
},
|
|
64
74
|
};
|
|
65
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Adopt the config's own `babelTransformerPath` as the upstream to delegate to.
|
|
78
|
+
*
|
|
79
|
+
* The value `withTtsc` overwrites is precisely the transformer that should run
|
|
80
|
+
* after the ttsc pass, so taking it as the default `upstreamTransformer` is
|
|
81
|
+
* what makes the wrapper additive in the one field it sets. Everything else in
|
|
82
|
+
* the config was already spread through untouched, which is what made the loss
|
|
83
|
+
* hard to see (samchon/ttsc#1321).
|
|
84
|
+
*
|
|
85
|
+
* An explicit option wins, and this package's own transformer is never adopted:
|
|
86
|
+
* a config wrapped twice would otherwise name this module as its own upstream
|
|
87
|
+
* and delegate into itself.
|
|
88
|
+
*/
|
|
89
|
+
function inheritConfiguredTransformer(config, options) {
|
|
90
|
+
const declared = config.transformer?.babelTransformerPath;
|
|
91
|
+
if (options.upstreamTransformer !== undefined ||
|
|
92
|
+
typeof declared !== "string" ||
|
|
93
|
+
declared.length === 0) {
|
|
94
|
+
return options;
|
|
95
|
+
}
|
|
96
|
+
// Resolve before judging. Ownership is a property of the module, not of the
|
|
97
|
+
// string, and every spelling has to become one absolute path before either
|
|
98
|
+
// question can be answered honestly.
|
|
99
|
+
const resolved = resolveFromProject(declared, config);
|
|
100
|
+
if (isOwnTransformer(resolved)) {
|
|
101
|
+
return options;
|
|
102
|
+
}
|
|
103
|
+
return { ...options, upstreamTransformer: resolved };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Resolve a declared `babelTransformerPath` the way Metro would: from the
|
|
107
|
+
* project.
|
|
108
|
+
*
|
|
109
|
+
* Metro resolves this value against the project, while the worker resolves
|
|
110
|
+
* `upstreamTransformer` with a `require` rooted in this package's own
|
|
111
|
+
* `lib/core`. Those are different places, so passing the caller's spelling
|
|
112
|
+
* through unchanged asks the worker to find the module somewhere it was never
|
|
113
|
+
* meant to be. Resolving here, once, in the config process that still knows the
|
|
114
|
+
* project root, removes the ambiguity for every spelling at once:
|
|
115
|
+
*
|
|
116
|
+
* - A relative `./metro-svg.cjs` becomes the file the caller meant, instead of
|
|
117
|
+
* one looked for inside `@ttsc/metro` and not found;
|
|
118
|
+
* - A bare `react-native-svg-transformer` becomes its real location, which
|
|
119
|
+
* matters under pnpm, where this package sits in a virtual store and walking
|
|
120
|
+
* up from it never reaches the project's own `node_modules`;
|
|
121
|
+
* - An absolute path resolves to itself, unchanged;
|
|
122
|
+
* - And `require.resolve("@ttsc/metro/transformer")` — a caller who wired this
|
|
123
|
+
* package by hand — becomes a path {@link isOwnTransformer} can recognise,
|
|
124
|
+
* which no comparison against the bare specifier could.
|
|
125
|
+
*
|
|
126
|
+
* A specifier that cannot be resolved is handed on exactly as written. It may
|
|
127
|
+
* still resolve in the worker, and if it does not, `resolveUpstreamTransformer`
|
|
128
|
+
* names it in an error; inventing a path here would only move the failure
|
|
129
|
+
* somewhere less legible.
|
|
130
|
+
*/
|
|
131
|
+
function resolveFromProject(declared, config) {
|
|
132
|
+
const base = typeof config.projectRoot === "string" && config.projectRoot.length !== 0
|
|
133
|
+
? config.projectRoot
|
|
134
|
+
: process.cwd();
|
|
135
|
+
try {
|
|
136
|
+
return node_module.createRequire(path.join(path.resolve(base), "package.json")).resolve(declared);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return declared;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Whether a `babelTransformerPath` already points at a `@ttsc/metro`
|
|
144
|
+
* transformer — this copy or any other.
|
|
145
|
+
*
|
|
146
|
+
* Adopting one would make this transformer its own upstream. That is not merely
|
|
147
|
+
* redundant: the worker options are process-global, so the adopted copy reads
|
|
148
|
+
* the same `TTSC_METRO_OPTIONS`, finds itself named there, and recurses until
|
|
149
|
+
* the stack ends. Comparing directory strings was not enough, because a second
|
|
150
|
+
* installed copy — a differently hoisted `node_modules`, a shared config
|
|
151
|
+
* package that already wrapped — lives in a different directory and passed the
|
|
152
|
+
* check.
|
|
153
|
+
*
|
|
154
|
+
* So the question asked is "is this module a `@ttsc/metro` transformer", not
|
|
155
|
+
* "is this string our path": the real path settles the same-copy case through
|
|
156
|
+
* symlinks and drive-letter spellings, and the owning `package.json` settles
|
|
157
|
+
* every other copy.
|
|
158
|
+
*/
|
|
159
|
+
function isOwnTransformer(declared) {
|
|
160
|
+
const candidate = path.resolve(declared);
|
|
161
|
+
if (sameRealPath(candidate, transformerModulePath())) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
if (!/^transformer\.(?:js|mjs|cjs)$/i.test(path.basename(candidate))) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const manifest = path.join(path.dirname(path.dirname(candidate)), "package.json");
|
|
169
|
+
return JSON.parse(fs.readFileSync(manifest, "utf8")).name === "@ttsc/metro";
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// No readable manifest beside it, so nothing identifies it as ours.
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Whether two paths name the same file on disk.
|
|
178
|
+
*
|
|
179
|
+
* Resolved through `realpath` so a symlinked install and its target compare
|
|
180
|
+
* equal, and case-folded on Windows, where `D:\` and `d:\` and a differently
|
|
181
|
+
* cased base name all address one file.
|
|
182
|
+
*/
|
|
183
|
+
function sameRealPath(left, right) {
|
|
184
|
+
const identity = (file) => {
|
|
185
|
+
let resolved = path.resolve(file);
|
|
186
|
+
try {
|
|
187
|
+
resolved = fs.realpathSync.native(resolved);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// Not on disk: the resolved spelling is the best identity available.
|
|
191
|
+
}
|
|
192
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
193
|
+
};
|
|
194
|
+
return identity(left) === identity(right);
|
|
195
|
+
}
|
|
66
196
|
/**
|
|
67
197
|
* Absolute path to the built transformer module Metro will `require`.
|
|
68
198
|
*
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":["options","ENV_KEY","serializeOptions","prepareSnapshot","join","dirname","fileURLToPath"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":["options","ENV_KEY","serializeOptions","prepareSnapshot","createRequire","join","resolve","basename","dirname","readFileSync","realpathSync","fileURLToPath"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AA4BH;;;;;;;;;;;;;;;;;;;;AAoBG;SACa,QAAQ,CACtB,MAAS,EACTA,YAA4B,EAAE,EAAA;AAE9B,IAAA,OAAO,CAAC,GAAG,CAACC,eAAO,CAAC,GAAGC,wBAAgB,CACrC,4BAA4B,CAAC,MAAM,EAAEF,SAAO,CAAC,CAC9C;;;;;AAKD,IAAAG,2BAAe,CACb,OAAO,M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
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join, dirname, resolve, basename } from 'node:path';
|
|
2
4
|
import { fileURLToPath } from 'node:url';
|
|
3
5
|
import { prepareSnapshot } from './core/fingerprint.mjs';
|
|
4
6
|
import { ENV_KEY, serializeOptions } from './core/options.mjs';
|
|
@@ -44,9 +46,17 @@ import { ENV_KEY, serializeOptions } from './core/options.mjs';
|
|
|
44
46
|
* With no `options`, the transformer auto-discovers `tsconfig.json` and runs
|
|
45
47
|
* the plugins configured there: the standard ttsc model. Pass `options` only to
|
|
46
48
|
* override the project path, plugin list, or include/exclude filters.
|
|
49
|
+
*
|
|
50
|
+
* A `babelTransformerPath` the config already carried is chained rather than
|
|
51
|
+
* replaced: it becomes the upstream this transformer delegates to, so wrapping
|
|
52
|
+
* a working config keeps whatever it configured. `react-native-svg-transformer`
|
|
53
|
+
* is installed by exactly that assignment, and replacing it silently sent every
|
|
54
|
+
* `.svg` to the auto-detected Expo default instead, with the build still
|
|
55
|
+
* succeeding (samchon/ttsc#1321). An explicit `upstreamTransformer` option
|
|
56
|
+
* still wins, since that is the caller saying it outright.
|
|
47
57
|
*/
|
|
48
58
|
function withTtsc(config, options = {}) {
|
|
49
|
-
process.env[ENV_KEY] = serializeOptions(options);
|
|
59
|
+
process.env[ENV_KEY] = serializeOptions(inheritConfiguredTransformer(config, options));
|
|
50
60
|
// Prepare the reference-graph snapshot backing the transformer's cache-key
|
|
51
61
|
// fingerprint (see `core/fingerprint.ts`). This runs in the single Metro
|
|
52
62
|
// config process before any worker exists, so it is the race-free moment to
|
|
@@ -60,6 +70,126 @@ function withTtsc(config, options = {}) {
|
|
|
60
70
|
},
|
|
61
71
|
};
|
|
62
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Adopt the config's own `babelTransformerPath` as the upstream to delegate to.
|
|
75
|
+
*
|
|
76
|
+
* The value `withTtsc` overwrites is precisely the transformer that should run
|
|
77
|
+
* after the ttsc pass, so taking it as the default `upstreamTransformer` is
|
|
78
|
+
* what makes the wrapper additive in the one field it sets. Everything else in
|
|
79
|
+
* the config was already spread through untouched, which is what made the loss
|
|
80
|
+
* hard to see (samchon/ttsc#1321).
|
|
81
|
+
*
|
|
82
|
+
* An explicit option wins, and this package's own transformer is never adopted:
|
|
83
|
+
* a config wrapped twice would otherwise name this module as its own upstream
|
|
84
|
+
* and delegate into itself.
|
|
85
|
+
*/
|
|
86
|
+
function inheritConfiguredTransformer(config, options) {
|
|
87
|
+
const declared = config.transformer?.babelTransformerPath;
|
|
88
|
+
if (options.upstreamTransformer !== undefined ||
|
|
89
|
+
typeof declared !== "string" ||
|
|
90
|
+
declared.length === 0) {
|
|
91
|
+
return options;
|
|
92
|
+
}
|
|
93
|
+
// Resolve before judging. Ownership is a property of the module, not of the
|
|
94
|
+
// string, and every spelling has to become one absolute path before either
|
|
95
|
+
// question can be answered honestly.
|
|
96
|
+
const resolved = resolveFromProject(declared, config);
|
|
97
|
+
if (isOwnTransformer(resolved)) {
|
|
98
|
+
return options;
|
|
99
|
+
}
|
|
100
|
+
return { ...options, upstreamTransformer: resolved };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Resolve a declared `babelTransformerPath` the way Metro would: from the
|
|
104
|
+
* project.
|
|
105
|
+
*
|
|
106
|
+
* Metro resolves this value against the project, while the worker resolves
|
|
107
|
+
* `upstreamTransformer` with a `require` rooted in this package's own
|
|
108
|
+
* `lib/core`. Those are different places, so passing the caller's spelling
|
|
109
|
+
* through unchanged asks the worker to find the module somewhere it was never
|
|
110
|
+
* meant to be. Resolving here, once, in the config process that still knows the
|
|
111
|
+
* project root, removes the ambiguity for every spelling at once:
|
|
112
|
+
*
|
|
113
|
+
* - A relative `./metro-svg.cjs` becomes the file the caller meant, instead of
|
|
114
|
+
* one looked for inside `@ttsc/metro` and not found;
|
|
115
|
+
* - A bare `react-native-svg-transformer` becomes its real location, which
|
|
116
|
+
* matters under pnpm, where this package sits in a virtual store and walking
|
|
117
|
+
* up from it never reaches the project's own `node_modules`;
|
|
118
|
+
* - An absolute path resolves to itself, unchanged;
|
|
119
|
+
* - And `require.resolve("@ttsc/metro/transformer")` — a caller who wired this
|
|
120
|
+
* package by hand — becomes a path {@link isOwnTransformer} can recognise,
|
|
121
|
+
* which no comparison against the bare specifier could.
|
|
122
|
+
*
|
|
123
|
+
* A specifier that cannot be resolved is handed on exactly as written. It may
|
|
124
|
+
* still resolve in the worker, and if it does not, `resolveUpstreamTransformer`
|
|
125
|
+
* names it in an error; inventing a path here would only move the failure
|
|
126
|
+
* somewhere less legible.
|
|
127
|
+
*/
|
|
128
|
+
function resolveFromProject(declared, config) {
|
|
129
|
+
const base = typeof config.projectRoot === "string" && config.projectRoot.length !== 0
|
|
130
|
+
? config.projectRoot
|
|
131
|
+
: process.cwd();
|
|
132
|
+
try {
|
|
133
|
+
return createRequire(join(resolve(base), "package.json")).resolve(declared);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return declared;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Whether a `babelTransformerPath` already points at a `@ttsc/metro`
|
|
141
|
+
* transformer — this copy or any other.
|
|
142
|
+
*
|
|
143
|
+
* Adopting one would make this transformer its own upstream. That is not merely
|
|
144
|
+
* redundant: the worker options are process-global, so the adopted copy reads
|
|
145
|
+
* the same `TTSC_METRO_OPTIONS`, finds itself named there, and recurses until
|
|
146
|
+
* the stack ends. Comparing directory strings was not enough, because a second
|
|
147
|
+
* installed copy — a differently hoisted `node_modules`, a shared config
|
|
148
|
+
* package that already wrapped — lives in a different directory and passed the
|
|
149
|
+
* check.
|
|
150
|
+
*
|
|
151
|
+
* So the question asked is "is this module a `@ttsc/metro` transformer", not
|
|
152
|
+
* "is this string our path": the real path settles the same-copy case through
|
|
153
|
+
* symlinks and drive-letter spellings, and the owning `package.json` settles
|
|
154
|
+
* every other copy.
|
|
155
|
+
*/
|
|
156
|
+
function isOwnTransformer(declared) {
|
|
157
|
+
const candidate = resolve(declared);
|
|
158
|
+
if (sameRealPath(candidate, transformerModulePath())) {
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
if (!/^transformer\.(?:js|mjs|cjs)$/i.test(basename(candidate))) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
const manifest = join(dirname(dirname(candidate)), "package.json");
|
|
166
|
+
return JSON.parse(readFileSync(manifest, "utf8")).name === "@ttsc/metro";
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// No readable manifest beside it, so nothing identifies it as ours.
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Whether two paths name the same file on disk.
|
|
175
|
+
*
|
|
176
|
+
* Resolved through `realpath` so a symlinked install and its target compare
|
|
177
|
+
* equal, and case-folded on Windows, where `D:\` and `d:\` and a differently
|
|
178
|
+
* cased base name all address one file.
|
|
179
|
+
*/
|
|
180
|
+
function sameRealPath(left, right) {
|
|
181
|
+
const identity = (file) => {
|
|
182
|
+
let resolved = resolve(file);
|
|
183
|
+
try {
|
|
184
|
+
resolved = realpathSync.native(resolved);
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
// Not on disk: the resolved spelling is the best identity available.
|
|
188
|
+
}
|
|
189
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
190
|
+
};
|
|
191
|
+
return identity(left) === identity(right);
|
|
192
|
+
}
|
|
63
193
|
/**
|
|
64
194
|
* Absolute path to the built transformer module Metro will `require`.
|
|
65
195
|
*
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"s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,CAAC,WAAW,EAAE,GAAG,QAAQ;AACzE,IAAA,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC3C;AAEA;;;;;;;;AAQG;AACH,SAAS,qBAAqB,GAAA;AAC5B,IAAA,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,gBAAgB,CAAC;AACxE;;;;"}
|
package/lib/transformer.js
CHANGED
|
@@ -89,12 +89,17 @@ async function transform(params) {
|
|
|
89
89
|
return upstream$1.transform(params);
|
|
90
90
|
}
|
|
91
91
|
let transformedSrc = params.src;
|
|
92
|
-
|
|
92
|
+
{
|
|
93
93
|
unpluginOptions ??= api.resolveOptions(opts.ttsc);
|
|
94
94
|
const projectRoot = typeof params.options.projectRoot === "string"
|
|
95
95
|
? params.options.projectRoot
|
|
96
96
|
: undefined;
|
|
97
97
|
const explicitProject = typeof opts.ttsc.project === "string" ? opts.ttsc.project : undefined;
|
|
98
|
+
const project = fingerprint.resolveProjectView({
|
|
99
|
+
compilerOptions: opts.ttsc.compilerOptions,
|
|
100
|
+
explicitProject,
|
|
101
|
+
projectRoot,
|
|
102
|
+
});
|
|
98
103
|
const result = await api.transformTtsc(resolveAbsoluteFilename(params.filename, params.options), params.src, unpluginOptions, undefined, cache, {
|
|
99
104
|
// Metro offers no per-file dependency registration, so the derived
|
|
100
105
|
// watch inputs (plugin-reported dependencies unioned with the
|
|
@@ -102,24 +107,29 @@ async function transform(params) {
|
|
|
102
107
|
// that the next run's getCacheKey re-hashes instead. Fires on cache
|
|
103
108
|
// hits too, so a worker that never recompiled still records the
|
|
104
109
|
// inputs backing the outputs it serves.
|
|
105
|
-
|
|
110
|
+
// The project view is resolved once for this file and handed to every
|
|
111
|
+
// one of its watch inputs. `record` runs per input, and validating the
|
|
112
|
+
// memo means stat-ing the whole `extends` chain, which is an answer
|
|
113
|
+
// that cannot change between two inputs of one file
|
|
114
|
+
// (samchon/ttsc#1316).
|
|
115
|
+
addWatchFile: (input) => snapshotRecorder.record({ input, project }),
|
|
106
116
|
// A volatile declaration means the output depends on non-file inputs
|
|
107
117
|
// that no file fingerprint can represent; the snapshot marks it and
|
|
108
118
|
// getCacheKey degrades to a per-run nonce (no cross-run reuse).
|
|
109
|
-
markVolatile: () => snapshotRecorder.recordVolatile({
|
|
119
|
+
markVolatile: () => snapshotRecorder.recordVolatile({ project }),
|
|
110
120
|
});
|
|
121
|
+
// A file the program does not contain comes back as `undefined` from the
|
|
122
|
+
// shared transform, exactly as an unchanged one does, so it passes through
|
|
123
|
+
// here with no special case. That decision belongs to
|
|
124
|
+
// `@ttsc/unplugin`'s core and is shared with every bundler adapter; this
|
|
125
|
+
// transformer used to hold its own copy of it, recognising the case by
|
|
126
|
+
// searching the error text for "did not return output" while the adapters
|
|
127
|
+
// failed the build for the identical condition (samchon/ttsc#1308).
|
|
128
|
+
// Genuine compile and type failures still propagate so Metro surfaces them.
|
|
111
129
|
if (result !== undefined && typeof result.code === "string") {
|
|
112
130
|
transformedSrc = result.code;
|
|
113
131
|
}
|
|
114
132
|
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
// A file that is not part of the tsconfig program is not a build error,
|
|
117
|
-
// pass it through untransformed. Genuine compile/type failures propagate so
|
|
118
|
-
// Metro surfaces them, matching the other ttsc bundler integrations.
|
|
119
|
-
if (!isFileOutsideProject(error)) {
|
|
120
|
-
throw error;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
133
|
return upstream$1.transform({ ...params, src: transformedSrc });
|
|
124
134
|
}
|
|
125
135
|
/**
|
|
@@ -160,6 +170,10 @@ function getCacheKey(...args) {
|
|
|
160
170
|
hash.update(upstreamKey);
|
|
161
171
|
}
|
|
162
172
|
hash.update(fingerprint.computeProjectFingerprint({
|
|
173
|
+
// The same overlay `transform` hands the recorder. Both read these
|
|
174
|
+
// options from `options()`, so the walk and the recorder judge one
|
|
175
|
+
// project by one program (samchon/ttsc#1316).
|
|
176
|
+
compilerOptions: opts.ttsc.compilerOptions,
|
|
163
177
|
explicitProject: typeof opts.ttsc.project === "string" ? opts.ttsc.project : undefined,
|
|
164
178
|
projectRoot: cacheKeyProjectRoot(args),
|
|
165
179
|
}));
|
|
@@ -226,15 +240,6 @@ function shouldTransform(filename, opts) {
|
|
|
226
240
|
}
|
|
227
241
|
return true;
|
|
228
242
|
}
|
|
229
|
-
/**
|
|
230
|
-
* `transformTtsc` throws `"ttsc transform did not return output for <file>"`
|
|
231
|
-
* when the requested file is not part of the compiled program (e.g. excluded
|
|
232
|
-
* from the tsconfig). That case is non-fatal: the file should pass through.
|
|
233
|
-
*/
|
|
234
|
-
function isFileOutsideProject(error) {
|
|
235
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
236
|
-
return message.includes("did not return output");
|
|
237
|
-
}
|
|
238
243
|
function packageVersion() {
|
|
239
244
|
try {
|
|
240
245
|
const pkg = nodeRequire("@ttsc/metro/package.json");
|
package/lib/transformer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.js","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":["createRequire","createTtscTransformCache","createSnapshotRecorder","resolveOptionsFromEnv","upstream","resolveUpstreamTransformer","resolveOptions","transformTtsc","createHash","stableStringify","computeProjectFingerprint"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;
|
|
1
|
+
{"version":3,"file":"transformer.js","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":["createRequire","createTtscTransformCache","createSnapshotRecorder","resolveOptionsFromEnv","upstream","resolveUpstreamTransformer","resolveOptions","resolveProjectView","transformTtsc","createHash","stableStringify","computeProjectFingerprint"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAoBH,MAAM,WAAW,GAAGA,yBAAa,CAAC,gQAAe,CAAC;AAElD;;;;AAIG;AACH,MAAM,YAAY,GAAG,cAAc;AACnC,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AAK,SAAS,EAAE;AACtC,QAAA,OAAO,EAAE;IACX;AACA,IAAA,IAAI;AACF,QAAA,OAAO,MAAM,CAACA,UAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACpD;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;IACX;AACF;AAEA;;;;;AAKG;AACG,SAAU,eAAe,CAC7B,QAAgB,EAChB,IAA8B,EAAA;AAE9B,IAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;AAC9D,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/lib/transformer.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createTtscTransformCache, resolveOptions, transformTtsc } from '@ttsc/u
|
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { createSnapshotRecorder, stableStringify, computeProjectFingerprint } from './core/fingerprint.mjs';
|
|
5
|
+
import { createSnapshotRecorder, stableStringify, computeProjectFingerprint, resolveProjectView } from './core/fingerprint.mjs';
|
|
6
6
|
import { resolveOptionsFromEnv } from './core/options.mjs';
|
|
7
7
|
import { resolveUpstreamTransformer } from './core/upstream.mjs';
|
|
8
8
|
|
|
@@ -86,12 +86,17 @@ async function transform(params) {
|
|
|
86
86
|
return upstream.transform(params);
|
|
87
87
|
}
|
|
88
88
|
let transformedSrc = params.src;
|
|
89
|
-
|
|
89
|
+
{
|
|
90
90
|
unpluginOptions ??= resolveOptions(opts.ttsc);
|
|
91
91
|
const projectRoot = typeof params.options.projectRoot === "string"
|
|
92
92
|
? params.options.projectRoot
|
|
93
93
|
: undefined;
|
|
94
94
|
const explicitProject = typeof opts.ttsc.project === "string" ? opts.ttsc.project : undefined;
|
|
95
|
+
const project = resolveProjectView({
|
|
96
|
+
compilerOptions: opts.ttsc.compilerOptions,
|
|
97
|
+
explicitProject,
|
|
98
|
+
projectRoot,
|
|
99
|
+
});
|
|
95
100
|
const result = await transformTtsc(resolveAbsoluteFilename(params.filename, params.options), params.src, unpluginOptions, undefined, cache, {
|
|
96
101
|
// Metro offers no per-file dependency registration, so the derived
|
|
97
102
|
// watch inputs (plugin-reported dependencies unioned with the
|
|
@@ -99,24 +104,29 @@ async function transform(params) {
|
|
|
99
104
|
// that the next run's getCacheKey re-hashes instead. Fires on cache
|
|
100
105
|
// hits too, so a worker that never recompiled still records the
|
|
101
106
|
// inputs backing the outputs it serves.
|
|
102
|
-
|
|
107
|
+
// The project view is resolved once for this file and handed to every
|
|
108
|
+
// one of its watch inputs. `record` runs per input, and validating the
|
|
109
|
+
// memo means stat-ing the whole `extends` chain, which is an answer
|
|
110
|
+
// that cannot change between two inputs of one file
|
|
111
|
+
// (samchon/ttsc#1316).
|
|
112
|
+
addWatchFile: (input) => snapshotRecorder.record({ input, project }),
|
|
103
113
|
// A volatile declaration means the output depends on non-file inputs
|
|
104
114
|
// that no file fingerprint can represent; the snapshot marks it and
|
|
105
115
|
// getCacheKey degrades to a per-run nonce (no cross-run reuse).
|
|
106
|
-
markVolatile: () => snapshotRecorder.recordVolatile({
|
|
116
|
+
markVolatile: () => snapshotRecorder.recordVolatile({ project }),
|
|
107
117
|
});
|
|
118
|
+
// A file the program does not contain comes back as `undefined` from the
|
|
119
|
+
// shared transform, exactly as an unchanged one does, so it passes through
|
|
120
|
+
// here with no special case. That decision belongs to
|
|
121
|
+
// `@ttsc/unplugin`'s core and is shared with every bundler adapter; this
|
|
122
|
+
// transformer used to hold its own copy of it, recognising the case by
|
|
123
|
+
// searching the error text for "did not return output" while the adapters
|
|
124
|
+
// failed the build for the identical condition (samchon/ttsc#1308).
|
|
125
|
+
// Genuine compile and type failures still propagate so Metro surfaces them.
|
|
108
126
|
if (result !== undefined && typeof result.code === "string") {
|
|
109
127
|
transformedSrc = result.code;
|
|
110
128
|
}
|
|
111
129
|
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
// A file that is not part of the tsconfig program is not a build error,
|
|
114
|
-
// pass it through untransformed. Genuine compile/type failures propagate so
|
|
115
|
-
// Metro surfaces them, matching the other ttsc bundler integrations.
|
|
116
|
-
if (!isFileOutsideProject(error)) {
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
130
|
return upstream.transform({ ...params, src: transformedSrc });
|
|
121
131
|
}
|
|
122
132
|
/**
|
|
@@ -157,6 +167,10 @@ function getCacheKey(...args) {
|
|
|
157
167
|
hash.update(upstreamKey);
|
|
158
168
|
}
|
|
159
169
|
hash.update(computeProjectFingerprint({
|
|
170
|
+
// The same overlay `transform` hands the recorder. Both read these
|
|
171
|
+
// options from `options()`, so the walk and the recorder judge one
|
|
172
|
+
// project by one program (samchon/ttsc#1316).
|
|
173
|
+
compilerOptions: opts.ttsc.compilerOptions,
|
|
160
174
|
explicitProject: typeof opts.ttsc.project === "string" ? opts.ttsc.project : undefined,
|
|
161
175
|
projectRoot: cacheKeyProjectRoot(args),
|
|
162
176
|
}));
|
|
@@ -223,15 +237,6 @@ function shouldTransform(filename, opts) {
|
|
|
223
237
|
}
|
|
224
238
|
return true;
|
|
225
239
|
}
|
|
226
|
-
/**
|
|
227
|
-
* `transformTtsc` throws `"ttsc transform did not return output for <file>"`
|
|
228
|
-
* when the requested file is not part of the compiled program (e.g. excluded
|
|
229
|
-
* from the tsconfig). That case is non-fatal: the file should pass through.
|
|
230
|
-
*/
|
|
231
|
-
function isFileOutsideProject(error) {
|
|
232
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
233
|
-
return message.includes("did not return output");
|
|
234
|
-
}
|
|
235
240
|
function packageVersion() {
|
|
236
241
|
try {
|
|
237
242
|
const pkg = nodeRequire("@ttsc/metro/package.json");
|
package/lib/transformer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.mjs","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;
|
|
1
|
+
{"version":3,"file":"transformer.mjs","sources":["../src/transformer.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AAoBH,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAElD;;;;AAIG;AACH,MAAM,YAAY,GAAG,cAAc;AACnC,MAAM,WAAW,GAAG,eAAe;AAEnC;;;;;AAKG;AACH,IAAI,QAA8C;AAClD,IAAI,eAA8D;AAClE,MAAM,KAAK,GAAG,wBAAwB,EAAE;AACxC,MAAM,gBAAgB,GAAG,sBAAsB,EAAE;AAEjD;AACA,SAAS,OAAO,GAAA;AACd,IAAA,QAAQ,QAAQ,KAAK,qBAAqB,EAAE;AAC9C;AAEA;;;;;;;;;;;AAWG;AACG,SAAU,uBAAuB,CACrC,QAAgB,EAChB,OAAiC,EAAA;AAEjC,IAAA,IAAI,IAA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