ttsc 0.32.0 → 0.32.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.
- package/lib/TtscCompiler.js +1 -1
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcess.d.ts +74 -96
- package/lib/compiler/internal/ResidentCheckProcess.js +150 -335
- package/lib/compiler/internal/ResidentCheckProcess.js.map +1 -1
- package/lib/compiler/internal/ResidentCheckProcessHost.d.ts +127 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js +447 -0
- package/lib/compiler/internal/ResidentCheckProcessHost.js.map +1 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.d.ts +64 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js +3 -0
- package/lib/compiler/internal/ResidentCheckProcessProtocol.js.map +1 -0
- package/lib/compiler/internal/build/BuildExecution.d.ts +103 -1
- package/lib/compiler/internal/build/BuildExecution.js +91 -11
- package/lib/compiler/internal/build/BuildExecution.js.map +1 -1
- package/lib/compiler/internal/build/ResidentCheckWatchSession.d.ts +16 -11
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js +37 -21
- package/lib/compiler/internal/build/ResidentCheckWatchSession.js.map +1 -1
- package/lib/compiler/internal/build/RunBuildOptions.d.ts +6 -5
- package/lib/compiler/internal/build/WatchInputPublication.d.ts +59 -0
- package/lib/compiler/internal/build/WatchInputPublication.js +93 -0
- package/lib/compiler/internal/build/WatchInputPublication.js.map +1 -0
- package/lib/compiler/internal/build/runBuild.d.ts +29 -2
- package/lib/compiler/internal/build/runBuild.js +45 -19
- package/lib/compiler/internal/build/runBuild.js.map +1 -1
- package/lib/compiler/internal/buildNativeCompiler.d.ts +2 -0
- package/lib/compiler/internal/buildNativeCompiler.js +1 -0
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.js +4 -2
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/project/resolveOwningProjectConfig.d.ts +7 -2
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js +6 -3
- package/lib/compiler/internal/project/resolveOwningProjectConfig.js.map +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js +1 -1
- package/lib/compiler/internal/readEffectiveCompilerOptions.js.map +1 -1
- package/lib/compiler/internal/resolveBinary.d.ts +1 -0
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.d.ts +6 -0
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.d.ts +28 -1
- package/lib/compiler/internal/runSingleFileEmit.js +120 -86
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/startResidentTransform.js +8 -2
- package/lib/compiler/internal/startResidentTransform.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.js +11 -3
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/transformProjectInWorker.d.ts +1 -1
- package/lib/compiler/internal/transformProjectInWorker.js +3 -2
- package/lib/compiler/internal/transformProjectInWorker.js.map +1 -1
- package/lib/internal/workerModuleUrl.d.ts +28 -0
- package/lib/internal/workerModuleUrl.js +40 -0
- package/lib/internal/workerModuleUrl.js.map +1 -0
- package/lib/launcher/internal/buildSingleRootProject.js +2 -1
- package/lib/launcher/internal/buildSingleRootProject.js.map +1 -1
- package/lib/launcher/internal/getCompilerVersionText.js +3 -2
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js +2 -1
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +91 -41
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.d.ts +10 -6
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js +11 -9
- package/lib/launcher/internal/runtime/CommonJsRuntimeSource.js.map +1 -1
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.d.ts +20 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js +27 -0
- package/lib/launcher/internal/runtime/advertiseTypeScriptExtensions.js.map +1 -0
- package/lib/launcher/internal/runtime/installRuntimeHooks.d.ts +5 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js +7 -3
- package/lib/launcher/internal/runtime/installRuntimeHooks.js.map +1 -1
- package/lib/launcher/internal/watch/AsyncWatchTopology.d.ts +113 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js +232 -0
- package/lib/launcher/internal/watch/AsyncWatchTopology.js.map +1 -0
- package/lib/launcher/internal/watch/WatchSettlement.d.ts +49 -0
- package/lib/launcher/internal/watch/WatchSettlement.js +70 -0
- package/lib/launcher/internal/watch/WatchSettlement.js.map +1 -0
- package/lib/launcher/internal/watch/WatchTopology.d.ts +29 -1
- package/lib/launcher/internal/watch/WatchTopology.js +86 -10
- package/lib/launcher/internal/watch/WatchTopology.js.map +1 -1
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.d.ts +121 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js +3 -0
- package/lib/launcher/internal/watch/WatchTopologyWorkerProtocol.js.map +1 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.d.ts +19 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js +62 -0
- package/lib/launcher/internal/watch/serveWatchTopologyWorker.js.map +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.d.ts +1 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js +22 -0
- package/lib/launcher/internal/watch/watchTopologyWorker.js.map +1 -0
- package/lib/plugin/CapabilityPluginResolver.d.ts +1 -1
- package/lib/plugin/CapabilityPluginResolver.js +3 -2
- package/lib/plugin/CapabilityPluginResolver.js.map +1 -1
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.d.ts +15 -12
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js +13 -11
- package/lib/plugin/internal/load/PluginDescriptorEvaluationCache.js.map +1 -1
- package/lib/plugin/internal/load/PluginPackageResolution.d.ts +2 -2
- package/lib/plugin/internal/load/PluginPackageResolution.js +13 -7
- package/lib/plugin/internal/load/PluginPackageResolution.js.map +1 -1
- package/lib/plugin/internal/load/ProjectPluginEntries.d.ts +23 -7
- package/lib/plugin/internal/load/ProjectPluginEntries.js +36 -14
- package/lib/plugin/internal/load/ProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.d.ts +3 -1
- package/lib/plugin/internal/load/collectProjectHostInputs.js +5 -2
- package/lib/plugin/internal/load/collectProjectHostInputs.js.map +1 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.d.ts +3 -1
- package/lib/plugin/internal/load/hasProjectPluginEntries.js +4 -2
- package/lib/plugin/internal/load/hasProjectPluginEntries.js.map +1 -1
- package/lib/plugin/internal/load/loadProjectPlugins.d.ts +36 -5
- package/lib/plugin/internal/load/loadProjectPlugins.js +466 -416
- package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
- package/lib/plugin/internal/load/pluginResolutionFailure.d.ts +18 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js +32 -0
- package/lib/plugin/internal/load/pluginResolutionFailure.js.map +1 -0
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.d.ts +1 -1
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js +3 -2
- package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js.map +1 -1
- package/lib/structures/ITtscCompilerContext.d.ts +12 -12
- package/lib/structures/ITtscPlugin.d.ts +7 -5
- package/lib/structures/ITtscPluginFactoryContext.d.ts +9 -8
- package/lib/structures/internal/TtscSingleFileEmitOptions.d.ts +12 -6
- package/package.json +9 -9
- package/src/TtscCompiler.ts +1 -1
- package/src/compiler/internal/ResidentCheckProcess.ts +159 -374
- package/src/compiler/internal/ResidentCheckProcessHost.ts +502 -0
- package/src/compiler/internal/ResidentCheckProcessProtocol.ts +53 -0
- package/src/compiler/internal/build/BuildExecution.ts +118 -9
- package/src/compiler/internal/build/ResidentCheckWatchSession.ts +41 -24
- package/src/compiler/internal/build/RunBuildOptions.ts +9 -5
- package/src/compiler/internal/build/WatchInputPublication.ts +106 -0
- package/src/compiler/internal/build/runBuild.ts +58 -34
- package/src/compiler/internal/buildNativeCompiler.ts +4 -0
- package/src/compiler/internal/compileProjectInMemory.ts +8 -2
- package/src/compiler/internal/project/resolveOwningProjectConfig.ts +16 -5
- package/src/compiler/internal/readEffectiveCompilerOptions.ts +1 -1
- package/src/compiler/internal/resolveBinary.ts +4 -1
- package/src/compiler/internal/resolveTsgo.ts +7 -0
- package/src/compiler/internal/runSingleFileEmit.ts +139 -99
- package/src/compiler/internal/startResidentTransform.ts +9 -2
- package/src/compiler/internal/transformProjectInMemory.ts +12 -3
- package/src/compiler/internal/transformProjectInWorker.ts +10 -2
- package/src/internal/workerModuleUrl.ts +34 -0
- package/src/launcher/internal/buildSingleRootProject.ts +2 -0
- package/src/launcher/internal/getCompilerVersionText.ts +3 -2
- package/src/launcher/internal/prepareExecution.ts +2 -0
- package/src/launcher/internal/runTtsc.ts +123 -45
- package/src/launcher/internal/runtime/CommonJsRuntimeSource.ts +11 -9
- package/src/launcher/internal/runtime/advertiseTypeScriptExtensions.ts +25 -0
- package/src/launcher/internal/runtime/installRuntimeHooks.ts +7 -3
- package/src/launcher/internal/watch/AsyncWatchTopology.ts +267 -0
- package/src/launcher/internal/watch/WatchSettlement.ts +67 -0
- package/src/launcher/internal/watch/WatchTopology.ts +84 -13
- package/src/launcher/internal/watch/WatchTopologyWorkerProtocol.ts +106 -0
- package/src/launcher/internal/watch/serveWatchTopologyWorker.ts +75 -0
- package/src/launcher/internal/watch/watchTopologyWorker.ts +29 -0
- package/src/plugin/CapabilityPluginResolver.ts +9 -2
- package/src/plugin/internal/load/PluginDescriptorEvaluationCache.ts +17 -12
- package/src/plugin/internal/load/PluginPackageResolution.ts +14 -9
- package/src/plugin/internal/load/ProjectPluginEntries.ts +40 -15
- package/src/plugin/internal/load/collectProjectHostInputs.ts +7 -1
- package/src/plugin/internal/load/hasProjectPluginEntries.ts +8 -3
- package/src/plugin/internal/load/loadProjectPlugins.ts +672 -594
- package/src/plugin/internal/load/pluginResolutionFailure.ts +37 -0
- package/src/plugin/internal/source/PluginBuildEnvironmentReadings.ts +8 -2
- package/src/structures/ITtscCompilerContext.ts +12 -12
- package/src/structures/ITtscPlugin.ts +7 -5
- package/src/structures/ITtscPluginFactoryContext.ts +9 -8
- package/src/structures/internal/TtscSingleFileEmitOptions.ts +22 -11
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
* @param props.tsconfig - The config project discovery found for the file.
|
|
43
43
|
* @param props.file - The file whose project is asked for.
|
|
44
44
|
* @param props.binary - An explicit TypeScript-Go binary, when one was given.
|
|
45
|
+
* @param props.env - Complete environment shared by compiler selection and
|
|
46
|
+
* root-file expansion; omission inherits the current process environment.
|
|
45
47
|
* @param props.onConfig - Called with every config this reads, so a caller that
|
|
46
48
|
* fingerprints its inputs can record them.
|
|
47
49
|
* @evidence contracts/common.md#principled-implementation Successful compiler showConfig supplies root membership observations, best-effort filesystem identity compares aliases, and visited identity keys terminate repeated graph states while declaration-order DFS selects the first observed containing project. Failed observations preserve the discovered fallback without certifying membership.
|
|
@@ -63,12 +65,15 @@ export declare function resolveOwningProjectConfig(props: {
|
|
|
63
65
|
* compiler.
|
|
64
66
|
*/
|
|
65
67
|
binary?: string;
|
|
68
|
+
/** Complete environment for compiler selection and root-file expansion. */
|
|
69
|
+
env?: NodeJS.ProcessEnv;
|
|
66
70
|
/** Observe each directly read config, including ones with no reference edges. */
|
|
67
71
|
onConfig?: (config: string) => void;
|
|
68
72
|
/**
|
|
69
73
|
* Expanded root files kept across lookups, by config path, for a caller whose
|
|
70
|
-
* selected builds already hold for the same
|
|
71
|
-
* project once per process
|
|
74
|
+
* selected builds and compiler environment already hold for the same
|
|
75
|
+
* lifetime: ttsx builds each owning project once per process
|
|
76
|
+
* (samchon/ttsc#1747).
|
|
72
77
|
*/
|
|
73
78
|
expansions?: Map<string, {
|
|
74
79
|
files: readonly string[];
|
|
@@ -56,6 +56,8 @@ const selectReferencedProject_1 = require("./selectReferencedProject");
|
|
|
56
56
|
* @param props.tsconfig - The config project discovery found for the file.
|
|
57
57
|
* @param props.file - The file whose project is asked for.
|
|
58
58
|
* @param props.binary - An explicit TypeScript-Go binary, when one was given.
|
|
59
|
+
* @param props.env - Complete environment shared by compiler selection and
|
|
60
|
+
* root-file expansion; omission inherits the current process environment.
|
|
59
61
|
* @param props.onConfig - Called with every config this reads, so a caller that
|
|
60
62
|
* fingerprints its inputs can record them.
|
|
61
63
|
* @evidence contracts/common.md#principled-implementation Successful compiler showConfig supplies root membership observations, best-effort filesystem identity compares aliases, and visited identity keys terminate repeated graph states while declaration-order DFS selects the first observed containing project. Failed observations preserve the discovered fallback without certifying membership.
|
|
@@ -109,7 +111,7 @@ function resolveOwningProjectConfig(props) {
|
|
|
109
111
|
}
|
|
110
112
|
/** Expand `config` now, and keep the expansion when the caller asked to. */
|
|
111
113
|
function expand(config) {
|
|
112
|
-
const roots = rootFiles(config, props.binary);
|
|
114
|
+
const roots = rootFiles(config, props.binary, props.env);
|
|
113
115
|
props.expansions?.set(config, roots);
|
|
114
116
|
return roots;
|
|
115
117
|
}
|
|
@@ -178,14 +180,15 @@ function readReferences(config, onConfig) {
|
|
|
178
180
|
* include approximation or permanent failed answer substitutes for compiler
|
|
179
181
|
* behavior.
|
|
180
182
|
*/
|
|
181
|
-
function rootFiles(config, binary) {
|
|
183
|
+
function rootFiles(config, binary, env) {
|
|
182
184
|
const takenAt = Date.now();
|
|
183
185
|
let files = [];
|
|
184
186
|
try {
|
|
185
187
|
const directory = node_path_1.default.dirname(config);
|
|
186
|
-
const tsgo = (0, resolveTsgo_1.resolveTsgo)({ binary, cwd: directory });
|
|
188
|
+
const tsgo = (0, resolveTsgo_1.resolveTsgo)({ binary, cwd: directory, env });
|
|
187
189
|
const result = (0, spawnNative_1.spawnNative)(tsgo.binary, ["-p", config, "--showConfig"], {
|
|
188
190
|
cwd: directory,
|
|
191
|
+
env,
|
|
189
192
|
encoding: "utf8",
|
|
190
193
|
});
|
|
191
194
|
if (result.status === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOwningProjectConfig.js","sourceRoot":"","sources":["../../../../src/compiler/internal/project/resolveOwningProjectConfig.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,4HAAyH;AACzH,8CAA2C;AAC3C,gDAA6C;AAC7C,gDAA6C;AAC7C,mDAAgD;AAChD,uEAAoE;AAEpE
|
|
1
|
+
{"version":3,"file":"resolveOwningProjectConfig.js","sourceRoot":"","sources":["../../../../src/compiler/internal/project/resolveOwningProjectConfig.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,4HAAyH;AACzH,8CAA2C;AAC3C,gDAA6C;AAC7C,gDAA6C;AAC7C,mDAAgD;AAChD,uEAAoE;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,oCAA2C,KA0B1C;IACC,MAAM,UAAU,GAAG,mBAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,oBAAoB,GAAG,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxE,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,UAAU,GAAG,IAAA,yEAAmC,EAAC;QACrD,oBAAoB,EAAE,KAAK;KAC5B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,mBAAI,CAAC,OAAO,CAAC,KAAK,C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AAC;QACH,OAAO,iBAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,QAAgB;IAC9B,IAAI,CAAC;QACH,OAAO,iBAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -77,7 +77,7 @@ function readEffectiveCompilerOptions(project, passthrough = [], binary, env, co
|
|
|
77
77
|
catch {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
|
-
const tsgo = (0, resolveTsgo_1.resolveTsgo)({ cwd: project.root, binary });
|
|
80
|
+
const tsgo = (0, resolveTsgo_1.resolveTsgo)({ cwd: project.root, binary, env });
|
|
81
81
|
const result = (0, spawnNative_1.spawnNative)(tsgo.binary, ["-p", project.path, ...passthrough, "-p", project.path, "--showConfig"], { cwd: compilerArgsCwd, env, encoding: "utf8" });
|
|
82
82
|
if (result.status !== 0)
|
|
83
83
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readEffectiveCompilerOptions.js","sourceRoot":"","sources":["../../../src/compiler/internal/readEffectiveCompilerOptions.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAChE,uFAAoF;AACpF,mFAAgF;AAEhF,+EAA4E;AAC5E,6CAA0C;AAC1C,+CAA4C;AAC5C,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,sCACE,OAAiC,EACjC,WAAW,GAAsB,EAAE,EACnC,MAAe,EACf,GAAuB,EACvB,eAAe,GAAW,OAAO,CAAC,IAAI;IAEtC,MAAM,SAAS,GAAG,IAAA,mDAAwB,EAAC,WAAW,CAAC,CAAC;IACxD,IAAI,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC;IACnC,IAAI,KAA0C,CAAC;IAC/C,IAAI,SAAS,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,IAAI,YAAyC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,yDAA2B,CAAC,OAAO,CACnD,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,EACpC,eAAe,CAChB,CAAC;YACF,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YACtC,WAAW,GAAG,IAAA,mDAAwB,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;YAC9D,KAAK,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,SAAS,CAAC,YAAY;gBACtD,IAAI,yDAA2B,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,WAAW;oBACpE,OAAO,IAAI,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"readEffectiveCompilerOptions.js","sourceRoot":"","sources":["../../../src/compiler/internal/readEffectiveCompilerOptions.ts"],"names":[],"mappings":";;;AAAA,mEAAgE;AAChE,uFAAoF;AACpF,mFAAgF;AAEhF,+EAA4E;AAC5E,6CAA0C;AAC1C,+CAA4C;AAC5C,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,sCACE,OAAiC,EACjC,WAAW,GAAsB,EAAE,EACnC,MAAe,EACf,GAAuB,EACvB,eAAe,GAAW,OAAO,CAAC,IAAI;IAEtC,MAAM,SAAS,GAAG,IAAA,mDAAwB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AAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClE,MAAM,UAAU,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAC9C,OAAO,IAAI,EAAE,IAAI,KAAK,MAAM,IAAI,OAAO,UAAU,KAAK,QAAQ;YAC5D,CAAC,CAAC,IAAA,uDAA0B,EAAC,UAAU,EAAE,MAAM,CAAC;YAChD,CAAC,CAAC,UAAU,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -24,5 +24,6 @@
|
|
|
24
24
|
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Resolution owns no persistent map, descriptor or task and returns only the selected path spelling.
|
|
25
25
|
*/
|
|
26
26
|
export declare function resolveBinary(opts?: {
|
|
27
|
+
/** Complete selection environment; omission reads the current process. */
|
|
27
28
|
env?: NodeJS.ProcessEnv;
|
|
28
29
|
}): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveBinary.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveBinary.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,wEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,uBACE,IAAI,
|
|
1
|
+
{"version":3,"file":"resolveBinary.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveBinary.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,wEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,uBACE,IAAI,GAGA,EAAE;IAEN,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,MAAM,QAAQ,GAAG,uCAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAC7D,IAAI,QAAQ,IAAI,mBAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CACpB,SAAS,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,QAAQ,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CACtG,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;IAED,MAAM,KAAK,GAAG,sBAAsB,EAAE,CAAC;IACvC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IAExB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,gFAAgF;AAChF,SAAS,sBAAsB;IAC7B,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAC5B,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CACjE,CAAC;IACF,OAAO,iBAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc;IACrB,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACtD,OAAO,iBAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,iBAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -33,6 +33,12 @@ export declare function resolveTsgo(opts?: {
|
|
|
33
33
|
binary?: string;
|
|
34
34
|
/** Directory from which to discover `typescript`. */
|
|
35
35
|
cwd?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Complete environment for executable selection; omission reads the current
|
|
38
|
+
* process environment. Public compiler owners merge caller overrides before
|
|
39
|
+
* invoking this resolver, retaining their original overlay for channel
|
|
40
|
+
* ownership.
|
|
41
|
+
*/
|
|
36
42
|
env?: NodeJS.ProcessEnv;
|
|
37
43
|
/**
|
|
38
44
|
* Absolute filename used to anchor fallback resolution when the package is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTsgo.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveTsgo.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,6CAA4C;AAC5C,0DAA6B;AAE7B,wEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACE,IAAI,
|
|
1
|
+
{"version":3,"file":"resolveTsgo.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveTsgo.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,6CAA4C;AAC5C,0DAA6B;AAE7B,wEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACE,IAAI,GAoBA,EAAE;IAEN,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,MAAM,QAAQ,GACZ,IAAI,CAAC,MAAM,IAAI,uCAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IAClE,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,mBAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CACb,iEAAiE,QAAQ,EAAE,CAC5E,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YACnC,OAAO,EAAE,QAAQ;SAClB,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,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OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CACjD,CAAC;IACF,IAAI,CAAC,iBAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO;QACL,MAAM;QACN,OAAO,EACL,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACrE,WAAW;QACX,WAAW;QACX,mBAAmB;QACnB,OAAO,EACL,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KACtE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,IAAY;IAChD,IAAI,CAAC;QACH,OAAO,IAAA,2BAAa,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,iEAAiE;AACjE,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAA4B,CAAC;AAC9E,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TtscSingleFileEmitOptions } from "../../structures/internal/TtscSingleFileEmitOptions";
|
|
2
|
+
import { WatchInputPublication } from "./build/WatchInputPublication";
|
|
2
3
|
import { CompilerProjectSelection } from "./project/CompilerProjectSelection";
|
|
3
4
|
/**
|
|
4
5
|
* Emit one source file by building its project into a temporary directory.
|
|
@@ -15,7 +16,8 @@ import { CompilerProjectSelection } from "./project/CompilerProjectSelection";
|
|
|
15
16
|
* argument cwd with public output planning. Response freshness is checked
|
|
16
17
|
* before native work and publication; these sequential checks do not pin bytes
|
|
17
18
|
* atomically. Callers without that record retain explicit config/nearest-file
|
|
18
|
-
* discovery.
|
|
19
|
+
* discovery. Watch-input handlers must complete synchronously; use
|
|
20
|
+
* {@link runSingleFileEmit.async} for promise-returning handlers.
|
|
19
21
|
*
|
|
20
22
|
* @returns The transformed JavaScript source text.
|
|
21
23
|
* @throws When the build exits non-zero, proves no JavaScript for the requested
|
|
@@ -32,3 +34,28 @@ import { CompilerProjectSelection } from "./project/CompilerProjectSelection";
|
|
|
32
34
|
* @evidence contracts/portability.md#os-neutral-implementation Native paths and filesystem identities use Node APIs, child execution uses argument arrays, and optional output targets resolve from the invocation cwd on each supported host.
|
|
33
35
|
*/
|
|
34
36
|
export declare function runSingleFileEmit(options: TtscSingleFileEmitOptions, selection?: ReturnType<typeof CompilerProjectSelection.read>): string;
|
|
37
|
+
/**
|
|
38
|
+
* Keep synchronous and awaited single-file emission on one temporary lifetime.
|
|
39
|
+
*
|
|
40
|
+
* @evidence contracts/common.md#principled-implementation Both entries share project/root selection, producing build, response freshness, provenance lookup and temporary-output cleanup; awaited completion joins every nested publication before compilation and output selection.
|
|
41
|
+
* @evidence contracts/common.md#clear-and-simple-design One generator owns project emission, optional public output and cleanup for both completion modes; the companion adds a runner without another output-selection implementation.
|
|
42
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Pending registration cannot authorize a build, and rejected publication reaches the same temporary cleanup path. Completion mode preserves response checks and provenance instead of reconstructing source ownership from filenames.
|
|
43
|
+
* @evidence contracts/common.md#meaningful-documentation Each entry states completion mode and the shared temporary lifetime; sequence prose requires rejection delivery into its finally path, while the primary entry documents output selection and cleanup failures.
|
|
44
|
+
* @evidence contracts/portability.md#os-neutral-implementation The shared sequence retains existing native source/output identity, cwd bases and private-directory handling across suspension without another native boundary.
|
|
45
|
+
* @evidence contracts/performance.md#efficient-algorithms One project selection and full-project build serve one provenance lookup; each handoff is awaited once with no additional source or output traversal.
|
|
46
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each sequence owns fresh compiler effects rather than an output cache or shared generation; higher-level owners decide equivalent build reuse.
|
|
47
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One accepted private output directory spans nested handoff and build work, and the existing finally path removes it on success or failure and preserves cleanup error aggregation.
|
|
48
|
+
*/
|
|
49
|
+
export declare namespace runSingleFileEmit {
|
|
50
|
+
/**
|
|
51
|
+
* Await watch-input registration before emitting and selecting one source's
|
|
52
|
+
* JavaScript. Rejected publication follows the same temporary cleanup path.
|
|
53
|
+
*/
|
|
54
|
+
function async(options: TtscSingleFileEmitOptions, selection?: ReturnType<typeof CompilerProjectSelection.read>): Promise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Emit through one selected project while suspending at watch handoffs.
|
|
57
|
+
* Internal completion runners must deliver rejection into this sequence so
|
|
58
|
+
* its finally block retains temporary-output cleanup ownership.
|
|
59
|
+
*/
|
|
60
|
+
function steps(options: TtscSingleFileEmitOptions, selection?: ReturnType<typeof CompilerProjectSelection.read>): WatchInputPublication.Sequence<string>;
|
|
61
|
+
}
|
|
@@ -8,10 +8,12 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const createCanonicalTempDirectory_1 = require("../../internal/createCanonicalTempDirectory");
|
|
10
10
|
const EmitOwnershipIndex_1 = require("./EmitOwnershipIndex");
|
|
11
|
+
const WatchInputPublication_1 = require("./build/WatchInputPublication");
|
|
11
12
|
const runBuild_1 = require("./build/runBuild");
|
|
12
13
|
const CompilerProjectSelection_1 = require("./project/CompilerProjectSelection");
|
|
13
14
|
const readProjectConfig_1 = require("./project/readProjectConfig");
|
|
14
15
|
const readEffectiveCompilerOptions_1 = require("./readEffectiveCompilerOptions");
|
|
16
|
+
const SidecarEnvironment_1 = require("./sharedHost/SidecarEnvironment");
|
|
15
17
|
/**
|
|
16
18
|
* Emit one source file by building its project into a temporary directory.
|
|
17
19
|
*
|
|
@@ -27,7 +29,8 @@ const readEffectiveCompilerOptions_1 = require("./readEffectiveCompilerOptions")
|
|
|
27
29
|
* argument cwd with public output planning. Response freshness is checked
|
|
28
30
|
* before native work and publication; these sequential checks do not pin bytes
|
|
29
31
|
* atomically. Callers without that record retain explicit config/nearest-file
|
|
30
|
-
* discovery.
|
|
32
|
+
* discovery. Watch-input handlers must complete synchronously; use
|
|
33
|
+
* {@link runSingleFileEmit.async} for promise-returning handlers.
|
|
31
34
|
*
|
|
32
35
|
* @returns The transformed JavaScript source text.
|
|
33
36
|
* @throws When the build exits non-zero, proves no JavaScript for the requested
|
|
@@ -44,98 +47,129 @@ const readEffectiveCompilerOptions_1 = require("./readEffectiveCompilerOptions")
|
|
|
44
47
|
* @evidence contracts/portability.md#os-neutral-implementation Native paths and filesystem identities use Node APIs, child execution uses argument arrays, and optional output targets resolve from the invocation cwd on each supported host.
|
|
45
48
|
*/
|
|
46
49
|
function runSingleFileEmit(options, selection) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// actual source/output ownership separately.
|
|
90
|
-
pinInferredRootDir: true,
|
|
91
|
-
resolvedProject: project,
|
|
92
|
-
tsconfig,
|
|
93
|
-
});
|
|
94
|
-
if (result.status !== 0) {
|
|
95
|
-
throw new Error("ttsc single-file emit exited " +
|
|
96
|
-
result.status +
|
|
97
|
-
"\n" +
|
|
98
|
-
(result.stderr || result.stdout));
|
|
99
|
-
}
|
|
100
|
-
const emitted = new EmitOwnershipIndex_1.EmitOwnershipIndex({
|
|
101
|
-
emitDir: outDir,
|
|
102
|
-
rootDir,
|
|
103
|
-
emittedSources: result.emittedSources,
|
|
104
|
-
emittedSourceProofFailures: result.emittedSourceProofFailures,
|
|
105
|
-
outputs: EmitOwnershipIndex_1.EmitOwnershipIndex.listOutputs(outDir),
|
|
106
|
-
}).find(sourceFile);
|
|
107
|
-
if (emitted === null) {
|
|
108
|
-
throw new Error(`ttsc single-file emit: ${tsconfig} emitted no JavaScript owned by ${sourceFile}; check that the project includes the source and its options permit JavaScript emission`);
|
|
109
|
-
}
|
|
110
|
-
const transformed = node_fs_1.default.readFileSync(emitted, "utf8");
|
|
50
|
+
return WatchInputPublication_1.WatchInputPublication.run(runSingleFileEmit.steps(options, selection));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Keep synchronous and awaited single-file emission on one temporary lifetime.
|
|
54
|
+
*
|
|
55
|
+
* @evidence contracts/common.md#principled-implementation Both entries share project/root selection, producing build, response freshness, provenance lookup and temporary-output cleanup; awaited completion joins every nested publication before compilation and output selection.
|
|
56
|
+
* @evidence contracts/common.md#clear-and-simple-design One generator owns project emission, optional public output and cleanup for both completion modes; the companion adds a runner without another output-selection implementation.
|
|
57
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Pending registration cannot authorize a build, and rejected publication reaches the same temporary cleanup path. Completion mode preserves response checks and provenance instead of reconstructing source ownership from filenames.
|
|
58
|
+
* @evidence contracts/common.md#meaningful-documentation Each entry states completion mode and the shared temporary lifetime; sequence prose requires rejection delivery into its finally path, while the primary entry documents output selection and cleanup failures.
|
|
59
|
+
* @evidence contracts/portability.md#os-neutral-implementation The shared sequence retains existing native source/output identity, cwd bases and private-directory handling across suspension without another native boundary.
|
|
60
|
+
* @evidence contracts/performance.md#efficient-algorithms One project selection and full-project build serve one provenance lookup; each handoff is awaited once with no additional source or output traversal.
|
|
61
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each sequence owns fresh compiler effects rather than an output cache or shared generation; higher-level owners decide equivalent build reuse.
|
|
62
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources One accepted private output directory spans nested handoff and build work, and the existing finally path removes it on success or failure and preserves cleanup error aggregation.
|
|
63
|
+
*/
|
|
64
|
+
(function (runSingleFileEmit) {
|
|
65
|
+
/**
|
|
66
|
+
* Await watch-input registration before emitting and selecting one source's
|
|
67
|
+
* JavaScript. Rejected publication follows the same temporary cleanup path.
|
|
68
|
+
*/
|
|
69
|
+
function async(options, selection) {
|
|
70
|
+
return WatchInputPublication_1.WatchInputPublication.runAsync(steps(options, selection));
|
|
71
|
+
}
|
|
72
|
+
runSingleFileEmit.async = async;
|
|
73
|
+
/**
|
|
74
|
+
* Emit through one selected project while suspending at watch handoffs.
|
|
75
|
+
* Internal completion runners must deliver rejection into this sequence so
|
|
76
|
+
* its finally block retains temporary-output cleanup ownership.
|
|
77
|
+
*/
|
|
78
|
+
function* steps(options, selection) {
|
|
79
|
+
const cwd = node_path_1.default.resolve(options.cwd ?? process.cwd());
|
|
80
|
+
const sourceFile = realpathIfExists(node_path_1.default.isAbsolute(options.file)
|
|
81
|
+
? options.file
|
|
82
|
+
: node_path_1.default.resolve(cwd, options.file));
|
|
83
|
+
const project = selection?.project ??
|
|
84
|
+
(0, readProjectConfig_1.readProjectConfig)({
|
|
85
|
+
cwd,
|
|
86
|
+
file: options.file,
|
|
87
|
+
projectRoot: options.projectRoot,
|
|
88
|
+
tsconfig: options.tsconfig,
|
|
89
|
+
});
|
|
90
|
+
const tsconfig = project.path;
|
|
91
|
+
const compilerArgsCwd = selection?.compilerArgsCwd ?? project.root;
|
|
111
92
|
if (selection !== undefined)
|
|
112
93
|
CompilerProjectSelection_1.CompilerProjectSelection.assertCurrent(selection);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
finally {
|
|
94
|
+
// The root tsgo lays the outputs against: a `--rootDir` forwarded on the
|
|
95
|
+
// command line, which reaches it after the config; otherwise the declared
|
|
96
|
+
// one, which `readProjectConfig` already absolutized; otherwise the project's
|
|
97
|
+
// own directory, which `pinInferredRootDir` hands it below.
|
|
98
|
+
const effective = (0, readEffectiveCompilerOptions_1.readEffectiveCompilerOptions)(project, options.passthrough, options.binary, SidecarEnvironment_1.SidecarEnvironment.merge(process.env, options.env), compilerArgsCwd)?.("rootDir");
|
|
99
|
+
const rootDir = typeof effective === "string"
|
|
100
|
+
? node_path_1.default.resolve(compilerArgsCwd, effective)
|
|
101
|
+
: project.root;
|
|
102
|
+
if (selection !== undefined)
|
|
103
|
+
CompilerProjectSelection_1.CompilerProjectSelection.assertCurrent(selection);
|
|
104
|
+
const outDir = (0, createCanonicalTempDirectory_1.createCanonicalTempDirectory)("ttsc-single-file-");
|
|
105
|
+
let failed = false;
|
|
106
|
+
let failure;
|
|
128
107
|
try {
|
|
129
|
-
|
|
108
|
+
const result = yield* runBuild_1.runBuild.steps({
|
|
109
|
+
...options,
|
|
110
|
+
cwd,
|
|
111
|
+
compilerArgsCwd,
|
|
112
|
+
emit: true,
|
|
113
|
+
forceEmitProvenance: true,
|
|
114
|
+
isolateOutputsTo: outDir,
|
|
115
|
+
outDir,
|
|
116
|
+
// The private temp directory above is an `outDir` this lane injected, not
|
|
117
|
+
// one the project declared, and tsgo answers an inferred common source
|
|
118
|
+
// directory with TS5011 as soon as any `outDir` is in play. Pinning the
|
|
119
|
+
// root tsgo would infer keeps `ttsc <file.ts>` working on a project that
|
|
120
|
+
// declares no output at all, while the producing invocation reports its
|
|
121
|
+
// actual source/output ownership separately.
|
|
122
|
+
pinInferredRootDir: true,
|
|
123
|
+
resolvedProject: project,
|
|
124
|
+
tsconfig,
|
|
125
|
+
});
|
|
126
|
+
if (result.status !== 0) {
|
|
127
|
+
throw new Error("ttsc single-file emit exited " +
|
|
128
|
+
result.status +
|
|
129
|
+
"\n" +
|
|
130
|
+
(result.stderr || result.stdout));
|
|
131
|
+
}
|
|
132
|
+
const emitted = new EmitOwnershipIndex_1.EmitOwnershipIndex({
|
|
133
|
+
emitDir: outDir,
|
|
134
|
+
rootDir,
|
|
135
|
+
emittedSources: result.emittedSources,
|
|
136
|
+
emittedSourceProofFailures: result.emittedSourceProofFailures,
|
|
137
|
+
outputs: EmitOwnershipIndex_1.EmitOwnershipIndex.listOutputs(outDir),
|
|
138
|
+
}).find(sourceFile);
|
|
139
|
+
if (emitted === null) {
|
|
140
|
+
throw new Error(`ttsc single-file emit: ${tsconfig} emitted no JavaScript owned by ${sourceFile}; check that the project includes the source and its options permit JavaScript emission`);
|
|
141
|
+
}
|
|
142
|
+
const transformed = node_fs_1.default.readFileSync(emitted, "utf8");
|
|
143
|
+
if (selection !== undefined)
|
|
144
|
+
CompilerProjectSelection_1.CompilerProjectSelection.assertCurrent(selection);
|
|
145
|
+
if (options.out) {
|
|
146
|
+
const target = node_path_1.default.isAbsolute(options.out)
|
|
147
|
+
? options.out
|
|
148
|
+
: node_path_1.default.resolve(cwd, options.out);
|
|
149
|
+
node_fs_1.default.mkdirSync(node_path_1.default.dirname(target), { recursive: true });
|
|
150
|
+
node_fs_1.default.writeFileSync(target, transformed, "utf8");
|
|
151
|
+
}
|
|
152
|
+
return transformed;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
failed = true;
|
|
156
|
+
failure = error;
|
|
157
|
+
throw error;
|
|
130
158
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
finally {
|
|
160
|
+
try {
|
|
161
|
+
node_fs_1.default.rmSync(outDir, { recursive: true, force: true });
|
|
162
|
+
}
|
|
163
|
+
catch (cleanupError) {
|
|
164
|
+
if (failed) {
|
|
165
|
+
throw new AggregateError([failure, cleanupError], "ttsc: single-file emission and temporary output cleanup failed", { cause: failure });
|
|
166
|
+
}
|
|
167
|
+
throw cleanupError;
|
|
134
168
|
}
|
|
135
|
-
throw cleanupError;
|
|
136
169
|
}
|
|
137
170
|
}
|
|
138
|
-
|
|
171
|
+
runSingleFileEmit.steps = steps;
|
|
172
|
+
})(runSingleFileEmit || (exports.runSingleFileEmit = runSingleFileEmit = {}));
|
|
139
173
|
/**
|
|
140
174
|
* Resolve a physical target when native realpath succeeds; otherwise preserve
|
|
141
175
|
* the requested lexical spelling so project diagnostics and ownership lookup
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runSingleFileEmit.js","sourceRoot":"","sources":["../../../src/compiler/internal/runSingleFileEmit.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,8FAA2F;AAE3F,6DAA0D;AAC1D,+CAA4C;AAC5C,iFAA8E;AAC9E,mEAAgE;AAChE,iFAA8E;
|
|
1
|
+
{"version":3,"file":"runSingleFileEmit.js","sourceRoot":"","sources":["../../../src/compiler/internal/runSingleFileEmit.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,8FAA2F;AAE3F,6DAA0D;AAC1D,yEAAsE;AACtE,+CAA4C;AAC5C,iFAA8E;AAC9E,mEAAgE;AAChE,iFAA8E;AAC9E,wEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,2BACE,OAAkC,EAClC,SAA4D;IAE5D,OAAO,6CAAqB,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,WAAiB,iB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E,YAAY,CAAC,EACvB,gEAAgE,EAChE,EAAE,KAAK,EAAE,OAAO,EAAE,CACnB,CAAC;gBACJ,CAAC;gBACD,MAAM,YAAY,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IA9GgB,kBAAA,KAAK,QA8GrB,CAAA;AACH,CAAC,EAhIgB,iBAAiB,aAnBlB,iBAAiB,GAmBhB,iBAAiB,QAgIjC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,OAAO,iBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -60,7 +60,9 @@ function startResidentTransform(context) {
|
|
|
60
60
|
tsconfig: context.tsconfig,
|
|
61
61
|
});
|
|
62
62
|
const loaded = (0, loadProjectPlugins_1.loadProjectPlugins)({
|
|
63
|
-
binary: (0, resolveBinary_1.resolveBinary)(
|
|
63
|
+
binary: (0, resolveBinary_1.resolveBinary)({
|
|
64
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(process.env, context.env),
|
|
65
|
+
}) ?? "",
|
|
64
66
|
cacheDir: context.cacheDir ??
|
|
65
67
|
SidecarEnvironment_1.SidecarEnvironment.read(context.env, "TTSC_CACHE_DIR"),
|
|
66
68
|
cwd,
|
|
@@ -77,7 +79,11 @@ function startResidentTransform(context) {
|
|
|
77
79
|
}
|
|
78
80
|
(0, assertSharedHostCompatibility_1.assertSharedHostCompatibility)(transformers, "source-to-source");
|
|
79
81
|
const host = (0, selectSharedHostPlugin_1.selectSharedHostPlugin)(transformers);
|
|
80
|
-
const tsgoBinary = (0, resolveTsgo_1.resolveTsgo)({
|
|
82
|
+
const tsgoBinary = (0, resolveTsgo_1.resolveTsgo)({
|
|
83
|
+
...context,
|
|
84
|
+
cwd: project.root,
|
|
85
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(process.env, context.env),
|
|
86
|
+
}).binary;
|
|
81
87
|
const resident = new ResidentTransformProcess_1.ResidentTransformProcess({
|
|
82
88
|
args: [
|
|
83
89
|
"serve",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startResidentTransform.js","sourceRoot":"","sources":["../../../src/compiler/internal/startResidentTransform.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,wEAAqE;AACrE,sFAAmF;AAInF,yEAAsE;AAEtE,mEAAgE;AAChE,mDAAgD;AAChD,+CAA4C;AAC5C,wEAAqE;AACrE,8FAA2F;AAC3F,oGAAiG;AACjG,gFAA6E;AAC7E,0EAAuE;AACvE,gFAA6E;AAC7E,8FAA2F;AAC3F,gFAA6E;AAC7E,gFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,gCACE,OAA6B;IAE7B,MAAM,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,qCAAiB,EAAC;QAChC,GAAG;QACH,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAA,uCAAkB,EAAC;QAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"startResidentTransform.js","sourceRoot":"","sources":["../../../src/compiler/internal/startResidentTransform.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,wEAAqE;AACrE,sFAAmF;AAInF,yEAAsE;AAEtE,mEAAgE;AAChE,mDAAgD;AAChD,+CAA4C;AAC5C,wEAAqE;AACrE,8FAA2F;AAC3F,oGAAiG;AACjG,gFAA6E;AAC7E,0EAAuE;AACvE,gFAA6E;AAC7E,8FAA2F;AAC3F,gFAA6E;AAC7E,gFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;KAC1D,EACD,OAAO,CAAC,GAAG,EACX,EAAE,gBAAgB,EAAE,UAAU,EAAE,CACjC,CAAC;IACF,MAAM,IAAI,GAAG,IAAA,qCAAiB,EAAC,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAC7D,uCAAkB,CAAC,KAAK,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACxD,uEAAuE;IACvE,yEAAyE;IACzE,kEAAkE;IAClE,gDAAgD;IAChD,uCAAkB,CAAC,KAAK,CACtB,GAAG,EACH,wBAAwB,EACxB,uCAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,wBAAwB,CAAC;QAC5D,eAAe,CAClB,CAAC;IACF,4EAA4E;IAC5E,gEAAgE;IAChE,IAAA,+CAAsB,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACzC,IAAA,mEAAgC,EAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACnD,IAAA,6DAA6B,EAC3B,GAAG,EACH,OAAO,CAAC,GAAG,EACX,IAAA,+CAAsB,EAAC,aAAa,CAAC,CACtC,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,sBAAsB,CAC7B,OAA2C;IAE3C,OAAO,IAAI,CAAC,SAAS,CACnB,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC,CAAC,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -68,7 +68,9 @@ const spawnNative_1 = require("./spawnNative");
|
|
|
68
68
|
function transformProjectInMemory(options) {
|
|
69
69
|
const cwd = node_path_1.default.resolve(options.cwd ?? process.cwd());
|
|
70
70
|
const loaded = (0, loadProjectPlugins_1.loadProjectPlugins)({
|
|
71
|
-
binary: (0, resolveBinary_1.resolveBinary)(
|
|
71
|
+
binary: (0, resolveBinary_1.resolveBinary)({
|
|
72
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(process.env, options.env),
|
|
73
|
+
}) ?? "",
|
|
72
74
|
cacheDir: options.cacheDir ??
|
|
73
75
|
SidecarEnvironment_1.SidecarEnvironment.read(options.env, "TTSC_CACHE_DIR"),
|
|
74
76
|
cwd,
|
|
@@ -109,15 +111,17 @@ function transformProjectWithNativeHost(options, project, baseline) {
|
|
|
109
111
|
const observedHostInputs = mergeHostInputs(baseline?.hostInputs, projectHostInputs);
|
|
110
112
|
const observedHostInputHashes = mergeCompatibleHostInputHashes(baseline?.hostInputHashes ?? {}, projectHostInputHashes, baseline?.hostInputs ?? [], projectHostInputs);
|
|
111
113
|
const observedHostInputRealpaths = mergeCompatibleHostInputHashes(baseline?.hostInputRealpaths ?? {}, projectHostInputRealpaths, baseline?.hostInputs ?? [], projectHostInputs);
|
|
114
|
+
const env = (0, inheritedSidecarEnv_1.inheritedSidecarEnv)(options.env);
|
|
112
115
|
const binary = (0, buildNativeCompiler_1.buildNativeCompiler)({
|
|
113
116
|
cacheBaseDir: project.root,
|
|
114
117
|
cacheDir: options.cacheDir ??
|
|
115
118
|
SidecarEnvironment_1.SidecarEnvironment.read(options.env, "TTSC_CACHE_DIR"),
|
|
119
|
+
env,
|
|
116
120
|
packageRoot: (0, packageRootDir_1.packageRootDir)(),
|
|
117
121
|
});
|
|
118
122
|
const res = (0, spawnNative_1.spawnNative)(binary, ["api-transform", "--cwd", project.root, "--tsconfig", project.path], {
|
|
119
123
|
cwd: project.root,
|
|
120
|
-
env
|
|
124
|
+
env,
|
|
121
125
|
});
|
|
122
126
|
if (res.error) {
|
|
123
127
|
throw new Error(`ttsc: failed to spawn native compiler host ${binary}: ${res.error.message}`);
|
|
@@ -157,7 +161,11 @@ function transformProjectWithPlugins(options, loaded) {
|
|
|
157
161
|
const transformers = loaded.nativePlugins.filter((plugin) => plugin.stage === "transform");
|
|
158
162
|
const tsgoBinary = loaded.nativePlugins.length === 0
|
|
159
163
|
? ""
|
|
160
|
-
: (0, resolveTsgo_1.resolveTsgo)({
|
|
164
|
+
: (0, resolveTsgo_1.resolveTsgo)({
|
|
165
|
+
...options,
|
|
166
|
+
cwd: project.root,
|
|
167
|
+
env: SidecarEnvironment_1.SidecarEnvironment.merge(process.env, options.env),
|
|
168
|
+
}).binary;
|
|
161
169
|
const checked = runNativeChecks(options, project, tsgoBinary, loaded.nativePlugins, checks, loaded.identities);
|
|
162
170
|
const checkedHostInputs = mergeHostInputs(loaded.hostInputs, checked.hostInputs);
|
|
163
171
|
const checkedHostInputHashes = mergeCompatibleHostInputHashes(revalidateHostInputHashes(loaded.hostInputHashes, loaded.hostInputs), revalidateHostInputHashes(checked.hostInputHashes ?? {}, checked.hostInputs ?? []), loaded.hostInputs, checked.hostInputs, loaded.deferredHostInputs);
|