ttsc 0.26.1 → 0.27.0
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 +10 -1
- package/cmd/ttsc/api_transform.go +17 -3
- package/cmd/ttscgraph/auxiliary_identity_state_tracks_retargets_not_source_contents_test.go +85 -0
- package/cmd/ttscgraph/disk_realpath_other.go +16 -0
- package/cmd/ttscgraph/disk_realpath_windows.go +56 -0
- package/cmd/ttscgraph/serve.go +104 -35
- package/driver/diagnostics_preamble.go +284 -0
- package/driver/emit_plugin.go +71 -19
- package/driver/graph.go +64 -11
- package/driver/input_observation.go +273 -0
- package/driver/input_observation_test.go +149 -0
- package/driver/plugins.go +384 -4
- package/driver/program.go +81 -15
- package/driver/resolution_candidates.go +13 -5
- package/driver/rewrite.go +47 -4
- package/internal/graph/diagnostics.go +4 -3
- package/internal/graph/provenance.go +10 -1
- package/lib/TtscCompiler.d.ts +12 -11
- package/lib/TtscCompiler.js +44 -29
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/captureProcessOutput.js +2 -2
- package/lib/compiler/internal/captureProcessOutput.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.js +11 -3
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/resolveEmittedJavaScript.d.ts +2 -0
- package/lib/compiler/internal/resolveEmittedJavaScript.js +3 -0
- package/lib/compiler/internal/resolveEmittedJavaScript.js.map +1 -1
- package/lib/compiler/internal/runBuild.d.ts +29 -1
- package/lib/compiler/internal/runBuild.js +117 -32
- package/lib/compiler/internal/runBuild.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.js +9 -2
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/sharedHostHelpers.d.ts +28 -0
- package/lib/compiler/internal/sharedHostHelpers.js +39 -0
- package/lib/compiler/internal/sharedHostHelpers.js.map +1 -1
- package/lib/compiler/internal/startResidentTransform.js +12 -4
- package/lib/compiler/internal/startResidentTransform.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.d.ts +3 -0
- package/lib/compiler/internal/transformProjectInMemory.js +239 -35
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/flags/schema.js +33 -5
- package/lib/flags/schema.js.map +1 -1
- package/lib/internal/createCanonicalTempDirectory.d.ts +17 -0
- package/lib/internal/createCanonicalTempDirectory.js +42 -0
- package/lib/internal/createCanonicalTempDirectory.js.map +1 -0
- package/lib/internal/projectInputPathIdentity.d.ts +3 -0
- package/lib/internal/projectInputPathIdentity.js +11 -5
- package/lib/internal/projectInputPathIdentity.js.map +1 -1
- package/lib/internal/resolveNodeBinary.d.ts +14 -0
- package/lib/internal/resolveNodeBinary.js +150 -0
- package/lib/internal/resolveNodeBinary.js.map +1 -0
- package/lib/internal/resolveSafeCacheCleanupTargets.d.ts +15 -0
- package/lib/internal/resolveSafeCacheCleanupTargets.js +61 -0
- package/lib/internal/resolveSafeCacheCleanupTargets.js.map +1 -0
- package/lib/launcher/internal/assertNoSolutionBuild.d.ts +31 -0
- package/lib/launcher/internal/assertNoSolutionBuild.js +38 -0
- package/lib/launcher/internal/assertNoSolutionBuild.js.map +1 -0
- package/lib/launcher/internal/prepareExecution.d.ts +3 -0
- package/lib/launcher/internal/prepareExecution.js +73 -26
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +27 -13
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runTtscserver.js +18 -3
- package/lib/launcher/internal/runTtscserver.js.map +1 -1
- package/lib/launcher/internal/runTtsx.js +4 -0
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/launcher/internal/runtimeHooks.d.ts +37 -1
- package/lib/launcher/internal/runtimeHooks.js +660 -62
- package/lib/launcher/internal/runtimeHooks.js.map +1 -1
- package/lib/plugin/internal/buildSourcePlugin.d.ts +62 -8
- package/lib/plugin/internal/buildSourcePlugin.js +754 -72
- package/lib/plugin/internal/buildSourcePlugin.js.map +1 -1
- package/lib/plugin/internal/loadProjectPlugins.d.ts +17 -5
- package/lib/plugin/internal/loadProjectPlugins.js +1339 -77
- package/lib/plugin/internal/loadProjectPlugins.js.map +1 -1
- package/lib/register.d.ts +1 -0
- package/lib/register.js +46 -0
- package/lib/register.js.map +1 -0
- package/lib/structures/ITtscCompilerContext.d.ts +6 -3
- package/lib/structures/ITtscCompilerTransformation.d.ts +31 -0
- package/lib/structures/ITtscPlugin.d.ts +33 -0
- package/package.json +16 -9
- package/shim/checker/go.mod +9 -0
- package/shim/checker/go.sum +22 -0
- package/shim/checker/shim.go +75 -0
- package/shim/compiler/emit_sourcemap.go +56 -15
- package/shim/compiler/incremental.go +45 -8
- package/src/TtscCompiler.ts +55 -33
- package/src/compiler/internal/captureProcessOutput.ts +3 -2
- package/src/compiler/internal/compileProjectInMemory.ts +11 -3
- package/src/compiler/internal/resolveEmittedJavaScript.ts +6 -0
- package/src/compiler/internal/runBuild.ts +172 -36
- package/src/compiler/internal/runSingleFileEmit.ts +9 -2
- package/src/compiler/internal/sharedHostHelpers.ts +44 -0
- package/src/compiler/internal/startResidentTransform.ts +12 -3
- package/src/compiler/internal/transformProjectInMemory.ts +410 -39
- package/src/flags/schema.ts +35 -5
- package/src/internal/createCanonicalTempDirectory.ts +53 -0
- package/src/internal/projectInputPathIdentity.ts +17 -4
- package/src/internal/resolveNodeBinary.ts +173 -0
- package/src/internal/resolveSafeCacheCleanupTargets.ts +85 -0
- package/src/launcher/internal/assertNoSolutionBuild.ts +40 -0
- package/src/launcher/internal/prepareExecution.ts +78 -26
- package/src/launcher/internal/runTtsc.ts +26 -13
- package/src/launcher/internal/runTtscserver.ts +18 -3
- package/src/launcher/internal/runTtsx.ts +4 -0
- package/src/launcher/internal/runtimeHooks.ts +830 -66
- package/src/plugin/internal/buildSourcePlugin.ts +984 -79
- package/src/plugin/internal/loadProjectPlugins.ts +1718 -104
- package/src/register.ts +47 -0
- package/src/structures/ITtscCompilerContext.ts +6 -3
- package/src/structures/ITtscCompilerTransformation.ts +39 -0
- package/src/structures/ITtscPlugin.ts +36 -0
- package/tools/shim_audit/baseline.json +0 -1
- package/utility/host.go +9 -3
- package/lib/internal/assertSafeExplicitCacheDirectory.d.ts +0 -5
- package/lib/internal/assertSafeExplicitCacheDirectory.js +0 -26
- package/lib/internal/assertSafeExplicitCacheDirectory.js.map +0 -1
- package/src/internal/assertSafeExplicitCacheDirectory.ts +0 -29
package/driver/rewrite.go
CHANGED
|
@@ -129,10 +129,10 @@ func (p *Program) EmitAllRaw(writeFile shimcompiler.WriteFile) (*shimcompiler.Em
|
|
|
129
129
|
}
|
|
130
130
|
return DefaultWriteFile(fileName, text)
|
|
131
131
|
}
|
|
132
|
-
result := p.
|
|
132
|
+
result := p.emitProgram(shimcompiler.EmitOptions{
|
|
133
133
|
WriteFile: wf,
|
|
134
134
|
})
|
|
135
|
-
return result,
|
|
135
|
+
return result, p.convertProgramDiagnostics(result.Diagnostics), nil
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// EmitFile runs tsgo's emitter for one source file, applying the same rewrite
|
|
@@ -197,11 +197,54 @@ func (p *Program) emit(rs *RewriteSet, target *ast.SourceFile, writeFile shimcom
|
|
|
197
197
|
return DefaultWriteFile(fileName, patched)
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
result := p.
|
|
200
|
+
result := p.emitProgram(shimcompiler.EmitOptions{
|
|
201
201
|
TargetSourceFile: target,
|
|
202
202
|
WriteFile: wf,
|
|
203
203
|
})
|
|
204
|
-
return result,
|
|
204
|
+
return result, p.convertProgramDiagnostics(result.Diagnostics), nil
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// emitProgram runs one whole-program or single-file emit, taking tsgo's
|
|
208
|
+
// incremental lane when the resolved compiler options ask for build
|
|
209
|
+
// information.
|
|
210
|
+
//
|
|
211
|
+
// tsgo's own CLI branches the same way — `performIncrementalCompilation` vs
|
|
212
|
+
// `performCompilation`, on `CompilerOptions.IsIncremental()` — but it branches
|
|
213
|
+
// in `internal/execute`, which a host constructing its Program in-process never
|
|
214
|
+
// enters. ttsc always took the plain branch, so `incremental`, `composite`, and
|
|
215
|
+
// `tsBuildInfoFile` parsed, resolved, and then vanished: a plugin-carrying
|
|
216
|
+
// project emitted its JavaScript and no `.tsbuildinfo` at all (issue #1188).
|
|
217
|
+
// `driver/emit_containment.go` had already exempted `.tsbuildinfo` from the
|
|
218
|
+
// outDir guard for a write that could not happen.
|
|
219
|
+
//
|
|
220
|
+
// A single-file emit stays on the plain lane. Build information describes a
|
|
221
|
+
// whole program, and tsgo's incremental program returns early on a
|
|
222
|
+
// `TargetSourceFile` request without writing any, so routing it there would
|
|
223
|
+
// only add a snapshot computation nothing reads.
|
|
224
|
+
func (p *Program) emitProgram(options shimcompiler.EmitOptions) *shimcompiler.EmitResult {
|
|
225
|
+
ctx := context.Background()
|
|
226
|
+
if options.TargetSourceFile == nil && p.emitsBuildInfo() {
|
|
227
|
+
return shimcompiler.EmitFreshWithBuildInfo(ctx, p.TSProgram, options)
|
|
228
|
+
}
|
|
229
|
+
return p.TSProgram.Emit(ctx, options)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// emitsBuildInfo reports whether this program's resolved options ask tsgo to
|
|
233
|
+
// write build information.
|
|
234
|
+
//
|
|
235
|
+
// The question is delegated to `CompilerOptions.IsIncremental`, the same
|
|
236
|
+
// predicate tsgo's own CLI branches on, rather than restated as
|
|
237
|
+
// `Incremental || Composite` here: a second copy of the rule is a second thing
|
|
238
|
+
// to keep in step with upstream.
|
|
239
|
+
func (p *Program) emitsBuildInfo() bool {
|
|
240
|
+
if p == nil || p.TSProgram == nil {
|
|
241
|
+
return false
|
|
242
|
+
}
|
|
243
|
+
options := p.TSProgram.Options()
|
|
244
|
+
if options == nil {
|
|
245
|
+
return false
|
|
246
|
+
}
|
|
247
|
+
return options.IsIncremental()
|
|
205
248
|
}
|
|
206
249
|
|
|
207
250
|
// DefaultWriteFile is the default disk writer used when EmitAll's caller does not
|
|
@@ -3,9 +3,10 @@ package graph
|
|
|
3
3
|
import "github.com/samchon/ttsc/packages/ttsc/driver"
|
|
4
4
|
|
|
5
5
|
// FileDiagnostics returns the resident program's compiler diagnostics for the
|
|
6
|
-
// source file at path,
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// source file at path, with the code tsgo reports and the location the driver
|
|
7
|
+
// resolves (see Diagnostic: authored-relative under a source preamble). Because
|
|
8
|
+
// the graph rides the already-open Program, this is one Program.Diagnostics()
|
|
9
|
+
// call over the warm checker, not a second compile.
|
|
9
10
|
//
|
|
10
11
|
// This is the compiler-only slice: it carries the TypeScript semantic
|
|
11
12
|
// diagnostics, not @ttsc/lint or transform-plugin findings.
|
|
@@ -179,7 +179,16 @@ type SourceDigest struct {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
// Diagnostic is one compiler diagnostic riding the snapshot that produced the
|
|
182
|
-
// facts. Positions are 1-based
|
|
182
|
+
// facts. Positions are 1-based and authored-relative: where a SourcePreamble
|
|
183
|
+
// plugin injected text ahead of a file, the driver maps the position back onto
|
|
184
|
+
// the bytes a consumer can read for itself (the file this dump publishes a Disk
|
|
185
|
+
// digest of), rather than onto the augmented text the checker saw. Node spans in
|
|
186
|
+
// this dump stay checker-relative by declaration — see SourceDigest — because
|
|
187
|
+
// they describe the facts, while a diagnostic is an instruction to go look at a
|
|
188
|
+
// line.
|
|
189
|
+
//
|
|
190
|
+
// A diagnostic that points inside the injected preamble itself has no authored
|
|
191
|
+
// counterpart, so it arrives with Line and Column zero and its message intact.
|
|
183
192
|
type Diagnostic struct {
|
|
184
193
|
// File uses the dump's path vocabulary.
|
|
185
194
|
File string `json:"file"`
|
package/lib/TtscCompiler.d.ts
CHANGED
|
@@ -48,15 +48,16 @@ export declare class TtscCompiler {
|
|
|
48
48
|
/**
|
|
49
49
|
* Remove compiled cache artifacts for this compiler instance.
|
|
50
50
|
*
|
|
51
|
-
* Removes
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* project-local caches. A user-provided `GOCACHE` is never removed.
|
|
51
|
+
* Removes an explicit `cacheDir` wholesale. Otherwise removes the plugin
|
|
52
|
+
* binary subdirectory, a safely identified ttsc-owned Go build cache
|
|
53
|
+
* (including an external `TTSC_GO_CACHE_DIR`), and the two legacy
|
|
54
|
+
* project-local caches. A user-provided `GOCACHE` is never removed. Every
|
|
55
|
+
* resolved deletion target is validated before the first removal. The cache
|
|
55
56
|
* location comes from this instance's `cacheDir` and environment
|
|
56
57
|
* (`TTSC_CACHE_DIR` / `TTSC_GO_CACHE_DIR`), defaulting to
|
|
57
|
-
* `<workspaceRoot>/node_modules/.cache/ttsc`.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
* `<workspaceRoot>/node_modules/.cache/ttsc`. Any resolved cache target that
|
|
59
|
+
* equals or contains the project, or names a filesystem root, is rejected
|
|
60
|
+
* before any directory is removed.
|
|
60
61
|
*
|
|
61
62
|
* @returns Cache directories that were removed.
|
|
62
63
|
*/
|
|
@@ -107,10 +108,10 @@ export declare class TtscCompiler {
|
|
|
107
108
|
* The effective environment for this instance's source-plugin builds and
|
|
108
109
|
* clean targets: `context.env` merged over `process.env`, matching the
|
|
109
110
|
* documented {@link ITtscCompilerContext.env} contract that child compiler,
|
|
110
|
-
* native-plugin,
|
|
111
|
-
* fresh object so callers never mutate the shared
|
|
112
|
-
* `context.env` was supplied this is a plain copy of
|
|
113
|
-
* default behavior is unchanged.
|
|
111
|
+
* native-plugin, native-host, and isolated descriptor processes already
|
|
112
|
+
* receive. Returned as a fresh object so callers never mutate the shared
|
|
113
|
+
* `process.env`; when no `context.env` was supplied this is a plain copy of
|
|
114
|
+
* `process.env`, so CLI / default behavior is unchanged.
|
|
114
115
|
*/
|
|
115
116
|
private resolveEffectiveEnv;
|
|
116
117
|
}
|
package/lib/TtscCompiler.js
CHANGED
|
@@ -11,7 +11,7 @@ const resolveProjectConfig_1 = require("./compiler/internal/project/resolveProje
|
|
|
11
11
|
const resolveBinary_1 = require("./compiler/internal/resolveBinary");
|
|
12
12
|
const runBuild_1 = require("./compiler/internal/runBuild");
|
|
13
13
|
const transformProjectInMemory_1 = require("./compiler/internal/transformProjectInMemory");
|
|
14
|
-
const
|
|
14
|
+
const resolveSafeCacheCleanupTargets_1 = require("./internal/resolveSafeCacheCleanupTargets");
|
|
15
15
|
const buildSourcePlugin_1 = require("./plugin/internal/buildSourcePlugin");
|
|
16
16
|
const loadProjectPlugins_1 = require("./plugin/internal/loadProjectPlugins");
|
|
17
17
|
/**
|
|
@@ -82,15 +82,16 @@ class TtscCompiler {
|
|
|
82
82
|
/**
|
|
83
83
|
* Remove compiled cache artifacts for this compiler instance.
|
|
84
84
|
*
|
|
85
|
-
* Removes
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* project-local caches. A user-provided `GOCACHE` is never removed.
|
|
85
|
+
* Removes an explicit `cacheDir` wholesale. Otherwise removes the plugin
|
|
86
|
+
* binary subdirectory, a safely identified ttsc-owned Go build cache
|
|
87
|
+
* (including an external `TTSC_GO_CACHE_DIR`), and the two legacy
|
|
88
|
+
* project-local caches. A user-provided `GOCACHE` is never removed. Every
|
|
89
|
+
* resolved deletion target is validated before the first removal. The cache
|
|
89
90
|
* location comes from this instance's `cacheDir` and environment
|
|
90
91
|
* (`TTSC_CACHE_DIR` / `TTSC_GO_CACHE_DIR`), defaulting to
|
|
91
|
-
* `<workspaceRoot>/node_modules/.cache/ttsc`.
|
|
92
|
-
*
|
|
93
|
-
*
|
|
92
|
+
* `<workspaceRoot>/node_modules/.cache/ttsc`. Any resolved cache target that
|
|
93
|
+
* equals or contains the project, or names a filesystem root, is rejected
|
|
94
|
+
* before any directory is removed.
|
|
94
95
|
*
|
|
95
96
|
* @returns Cache directories that were removed.
|
|
96
97
|
*/
|
|
@@ -101,25 +102,32 @@ class TtscCompiler {
|
|
|
101
102
|
node_path_1.default.join(projectRoot, ".ttsc"),
|
|
102
103
|
];
|
|
103
104
|
const explicitCacheDir = this.resolveCacheDir();
|
|
105
|
+
let targets;
|
|
104
106
|
if (explicitCacheDir !== undefined) {
|
|
105
|
-
(0, assertSafeExplicitCacheDirectory_1.assertSafeExplicitCacheDirectory)(projectRoot, explicitCacheDir);
|
|
106
107
|
// An explicit constructor `cacheDir` names the cache directory for this
|
|
107
108
|
// instance — exactly like `ttsc clean --cache-dir X` on the CLI — so
|
|
108
109
|
// remove it wholesale plus the legacy project-local caches. This keeps
|
|
109
110
|
// the programmatic and CLI clean contracts identical for an explicit
|
|
110
111
|
// cache dir.
|
|
111
|
-
|
|
112
|
+
targets = [explicitCacheDir, ...legacyTargets];
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
else {
|
|
115
|
+
// Default / `context.env.TTSC_CACHE_DIR`: resolve the cache root and the Go
|
|
116
|
+
// build cache (`TTSC_GO_CACHE_DIR`) from this instance's effective
|
|
117
|
+
// environment — the same `{ ...process.env, ...context.env }` that
|
|
118
|
+
// prepare()/compile()/transform() build with — then remove only the
|
|
119
|
+
// ttsc-owned subdirectories, so a possibly-shared root is never deleted and
|
|
120
|
+
// a user-provided `GOCACHE` is never touched. Using the effective env (not
|
|
121
|
+
// ambient `process.env`) makes clean() remove exactly the artifacts this
|
|
122
|
+
// instance owns, including a `TTSC_GO_CACHE_DIR` supplied only in
|
|
123
|
+
// `context.env`.
|
|
124
|
+
targets = (0, buildSourcePlugin_1.resolveCleanTargets)(projectRoot, this.resolvePluginCacheDir(), this.resolveEffectiveEnv());
|
|
125
|
+
}
|
|
126
|
+
// Validate the complete deletion set before removing the first directory.
|
|
127
|
+
// This includes an environment-selected TTSC_GO_CACHE_DIR and project-local
|
|
128
|
+
// legacy locations, not only an explicit constructor cacheDir.
|
|
129
|
+
const safeTargets = (0, resolveSafeCacheCleanupTargets_1.resolveSafeCacheCleanupTargets)(projectRoot, targets);
|
|
130
|
+
return removeExistingDirectories(safeTargets);
|
|
123
131
|
}
|
|
124
132
|
/**
|
|
125
133
|
* Compile the configured project.
|
|
@@ -210,10 +218,10 @@ class TtscCompiler {
|
|
|
210
218
|
* The effective environment for this instance's source-plugin builds and
|
|
211
219
|
* clean targets: `context.env` merged over `process.env`, matching the
|
|
212
220
|
* documented {@link ITtscCompilerContext.env} contract that child compiler,
|
|
213
|
-
* native-plugin,
|
|
214
|
-
* fresh object so callers never mutate the shared
|
|
215
|
-
* `context.env` was supplied this is a plain copy of
|
|
216
|
-
* default behavior is unchanged.
|
|
221
|
+
* native-plugin, native-host, and isolated descriptor processes already
|
|
222
|
+
* receive. Returned as a fresh object so callers never mutate the shared
|
|
223
|
+
* `process.env`; when no `context.env` was supplied this is a plain copy of
|
|
224
|
+
* `process.env`, so CLI / default behavior is unchanged.
|
|
217
225
|
*/
|
|
218
226
|
resolveEffectiveEnv() {
|
|
219
227
|
return { ...process.env, ...this.context.env };
|
|
@@ -222,12 +230,16 @@ class TtscCompiler {
|
|
|
222
230
|
exports.TtscCompiler = TtscCompiler;
|
|
223
231
|
function removeExistingDirectories(directories) {
|
|
224
232
|
const removed = [];
|
|
225
|
-
|
|
226
|
-
|
|
233
|
+
const visited = new Set();
|
|
234
|
+
for (const directory of directories) {
|
|
235
|
+
if (visited.has(directory.path))
|
|
236
|
+
continue;
|
|
237
|
+
visited.add(directory.path);
|
|
238
|
+
if (!directory.exists || !node_fs_1.default.existsSync(directory.path)) {
|
|
227
239
|
continue;
|
|
228
240
|
}
|
|
229
|
-
node_fs_1.default.rmSync(directory, { recursive: true, force: true });
|
|
230
|
-
removed.push(directory);
|
|
241
|
+
node_fs_1.default.rmSync(directory.path, { recursive: true, force: true });
|
|
242
|
+
removed.push(directory.requestedPath);
|
|
231
243
|
}
|
|
232
244
|
return removed;
|
|
233
245
|
}
|
|
@@ -324,11 +336,14 @@ function toCompilerResult(project) {
|
|
|
324
336
|
};
|
|
325
337
|
}
|
|
326
338
|
function toCompilerTransformation(project) {
|
|
327
|
-
const { dependencies, dependenciesComplete, graph, result, typescript, volatile, } = project;
|
|
339
|
+
const { dependencies, dependenciesComplete, graph, hostInputHashes, hostInputRealpaths, hostInputs, result, typescript, volatile, } = project;
|
|
328
340
|
const advisoryFields = {
|
|
329
341
|
...(dependencies === undefined ? {} : { dependencies }),
|
|
330
342
|
...(dependenciesComplete === undefined ? {} : { dependenciesComplete }),
|
|
331
343
|
...(graph === undefined ? {} : { graph }),
|
|
344
|
+
...(hostInputHashes === undefined ? {} : { hostInputHashes }),
|
|
345
|
+
...(hostInputRealpaths === undefined ? {} : { hostInputRealpaths }),
|
|
346
|
+
...(hostInputs === undefined ? {} : { hostInputs }),
|
|
332
347
|
...(volatile === undefined ? {} : { volatile }),
|
|
333
348
|
};
|
|
334
349
|
if (result.status === 0 && !hasErrorDiagnostics(result.diagnostics)) {
|
package/lib/TtscCompiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscCompiler.js","sourceRoot":"","sources":["../src/TtscCompiler.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,uFAAoF;AACpF,2FAAwF;AACxF,qEAAkE;AAClE,2DAAuE;AACvE,2FAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"TtscCompiler.js","sourceRoot":"","sources":["../src/TtscCompiler.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,uFAAoF;AACpF,2FAAwF;AACxF,qEAAkE;AAClE,2DAAuE;AACvE,2FAAwF;AACxF,8FAGmD;AACnD,2EAA0E;AAC1E,6EAA0E;AAO1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IACmB,OAAO,CAAuB;IAE/C;;;;;;OAMG;IACH,YAAmB,OAAO,GAAyB,EAAE;QACnD,IAAI,CAAC,OAAO,GAA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EAAE,CAAC;KAChD,CAAC;IACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACpE,OAAO;YACL,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;gBACjC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;YACxC,GAAG,cAAc;YACjB,IAAI,EAAE,SAAS;YACf,UAAU;SACX,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,cAAc;QACjB,WAAW,EACT,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAC7B,CAAC,CAAC,CAAC,IAAA,kCAAuB,EAAC,MAAM,CAAC,CAAC;YACnC,CAAC,CAAC,MAAM,CAAC,WAAW;QACxB,IAAI,EAAE,SAAS;QACf,UAAU;KACX,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,WAA+C;IAE/C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.captureProcessOutput = captureProcessOutput;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
9
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const createCanonicalTempDirectory_1 = require("../../internal/createCanonicalTempDirectory");
|
|
10
10
|
/**
|
|
11
11
|
* A pair of temporary files standing in for a child process's pipes.
|
|
12
12
|
*
|
|
@@ -25,7 +25,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
25
25
|
* bytes.
|
|
26
26
|
*/
|
|
27
27
|
function captureProcessOutput() {
|
|
28
|
-
const directory =
|
|
28
|
+
const directory = (0, createCanonicalTempDirectory_1.createCanonicalTempDirectory)("ttsc-spawn-");
|
|
29
29
|
const stdoutPath = node_path_1.default.join(directory, "stdout");
|
|
30
30
|
const stderrPath = node_path_1.default.join(directory, "stderr");
|
|
31
31
|
const stdoutFd = node_fs_1.default.openSync(stdoutPath, "w+");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureProcessOutput.js","sourceRoot":"","sources":["../../../src/compiler/internal/captureProcessOutput.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"captureProcessOutput.js","sourceRoot":"","sources":["../../../src/compiler/internal/captureProcessOutput.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,8FAA2F;AAc3F;;;;;;;;;;;;;;;;GAgBG;AACH;IACE,MAAM,SAAS,GAAG,IAAA,2DAA4B,EAAC,aAAa,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC/C,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,iBAAE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EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,eAAe;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -5,13 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.compileProjectInMemory = compileProjectInMemory;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
9
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const createCanonicalTempDirectory_1 = require("../../internal/createCanonicalTempDirectory");
|
|
10
10
|
const loadProjectPlugins_1 = require("../../plugin/internal/loadProjectPlugins");
|
|
11
11
|
const buildNativeCompiler_1 = require("./buildNativeCompiler");
|
|
12
12
|
const paths_1 = require("./paths");
|
|
13
13
|
const readProjectConfig_1 = require("./project/readProjectConfig");
|
|
14
14
|
const runBuild_1 = require("./runBuild");
|
|
15
|
+
const sharedHostHelpers_1 = require("./sharedHostHelpers");
|
|
15
16
|
const spawnNative_1 = require("./spawnNative");
|
|
16
17
|
/**
|
|
17
18
|
* Compile a project and capture emitted files without writing to the project
|
|
@@ -44,7 +45,7 @@ function compileProjectInMemory(options) {
|
|
|
44
45
|
});
|
|
45
46
|
const res = (0, spawnNative_1.spawnNative)(binary, ["api-compile", "--cwd", project.root, "--tsconfig", tsconfig], {
|
|
46
47
|
cwd: project.root,
|
|
47
|
-
env:
|
|
48
|
+
env: (0, sharedHostHelpers_1.inheritedSidecarEnv)(options.env),
|
|
48
49
|
});
|
|
49
50
|
if (res.error) {
|
|
50
51
|
throw new Error(`ttsc: failed to spawn native compiler host ${binary}: ${res.error.message}`);
|
|
@@ -82,7 +83,7 @@ function shouldUsePluginBuild(options, project) {
|
|
|
82
83
|
* read back every file the build wrote so they can be returned as strings.
|
|
83
84
|
*/
|
|
84
85
|
function compileProjectWithPlugins(options, cwd, project) {
|
|
85
|
-
const tempRoot =
|
|
86
|
+
const tempRoot = (0, createCanonicalTempDirectory_1.createCanonicalTempDirectory)("ttsc-api-output-");
|
|
86
87
|
const tempOutDir = node_path_1.default.join(tempRoot, "out");
|
|
87
88
|
try {
|
|
88
89
|
const result = (0, runBuild_1.runBuild)({
|
|
@@ -91,6 +92,13 @@ function compileProjectWithPlugins(options, cwd, project) {
|
|
|
91
92
|
emit: true,
|
|
92
93
|
forceListEmittedFiles: true,
|
|
93
94
|
outDir: tempOutDir,
|
|
95
|
+
// The temp directory is an `outDir` this lane injected so the emit can be
|
|
96
|
+
// read back as strings; the project need not declare one at all. tsgo
|
|
97
|
+
// answers an inferred common source directory with TS5011 as soon as any
|
|
98
|
+
// `outDir` is in play, so pin the root it would infer. The keys
|
|
99
|
+
// `outputKeyMapper` builds are unchanged by it — that root is exactly the
|
|
100
|
+
// layout tsgo already lays the emit out against (issue #1172).
|
|
101
|
+
pinInferredRootDir: true,
|
|
94
102
|
quiet: true,
|
|
95
103
|
resolvedProject: project,
|
|
96
104
|
structuredDiagnostics: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileProjectInMemory.js","sourceRoot":"","sources":["../../../src/compiler/internal/compileProjectInMemory.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"compileProjectInMemory.js","sourceRoot":"","sources":["../../../src/compiler/internal/compileProjectInMemory.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,8FAA2F;AAC3F,iFAAmF;AAKnF,+DAA4D;AAC5D,mCAAgE;AAChE,mEAAgE;AAChE,yCAAsC;AACtC,2DAA0D;AAC1D,+CAAwD;AAExD;;;;;;;;;;;;GAYG;AACH,gCAAuC,OAA6B;IAIlE,MAAM,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CA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,+CAA+C,CAClD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
* Returns `null` when no matching output file is found on disk.
|
|
16
16
|
*/
|
|
17
17
|
export declare function resolveEmittedJavaScript(options: {
|
|
18
|
+
/** Skip trailing-stem recovery when exact source ownership is required. */
|
|
19
|
+
allowStemFallback?: boolean;
|
|
18
20
|
/** Pre-computed list of emitted paths; when absent `outDir` is scanned. */
|
|
19
21
|
emittedFiles?: readonly string[];
|
|
20
22
|
outDir: string;
|
|
@@ -36,6 +36,9 @@ function resolveEmittedJavaScript(options) {
|
|
|
36
36
|
return candidate;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
if (options.allowStemFallback === false) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
39
42
|
// Score the pre-computed emit list first (cheap). When it yields nothing —
|
|
40
43
|
// because the list is incomplete (a native transform host such as typia emits
|
|
41
44
|
// without printing the `--listEmittedFiles` lines) or because the emit landed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEmittedJavaScript.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveEmittedJavaScript.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,mCAAgD;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,kCAAyC,
|
|
1
|
+
{"version":3,"file":"resolveEmittedJavaScript.js","sourceRoot":"","sources":["../../../src/compiler/internal/resolveEmittedJavaScript.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,mCAAgD;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,kCAAyC,OAQxC;IACC,MAAM,KAAK,GAAG,wBAAwB,CACpC,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,UAAU,CACnB,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,OAAO,CAAC,YAAY,EAAE,GA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boolean;
|
|
12
12
|
/** Keep every compiler-owned side product inside this private directory. */
|
|
13
13
|
isolateOutputsTo?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Hand tsgo the `rootDir` it would otherwise infer, for a build whose
|
|
16
|
+
* `outDir` this process injected rather than the project declaring it.
|
|
17
|
+
*
|
|
18
|
+
* Tsgo answers an inferred common source directory with TS5011 the moment an
|
|
19
|
+
* `outDir` is in play, so injecting one turns a project that declares no
|
|
20
|
+
* output at all — the `noEmit` check-only shape `tsgo`, `ttsc`, and `ttsc
|
|
21
|
+
* --emit` all accept — into one that must configure the layout of output the
|
|
22
|
+
* user never asked for and never sees (issue #1172).
|
|
23
|
+
*
|
|
24
|
+
* The pinned value is the one tsgo itself infers: with a config file in play
|
|
25
|
+
* its common source directory is that file's directory, never the computed
|
|
26
|
+
* common directory of the input files (`outputpaths.GetCommonSourceDirectory`
|
|
27
|
+
* consults the file list only for a config-less program). Pinning it
|
|
28
|
+
* therefore silences the demand without moving a single output, and it is the
|
|
29
|
+
* same source root `prepareExecution.ts::resolveRuntimeSourceRoot`,
|
|
30
|
+
* `runtimeHooks.ts::resolveDependencySourceRoot`, and
|
|
31
|
+
* `watchTopology.ts::inferPerSourceCompilerOutputs` already model on the
|
|
32
|
+
* JavaScript side.
|
|
33
|
+
*
|
|
34
|
+
* Ignored when the project declares its own `rootDir`: that project already
|
|
35
|
+
* satisfies tsgo, and overriding it would relocate the emit out from under
|
|
36
|
+
* every consumer that mirrors the declared root.
|
|
37
|
+
*
|
|
38
|
+
* Never set for a user-supplied `--outDir`. That outDir is the user's own
|
|
39
|
+
* request, and TS5011 is then tsgo's genuine answer to it.
|
|
40
|
+
*/
|
|
41
|
+
pinInferredRootDir?: boolean;
|
|
14
42
|
/**
|
|
15
43
|
* Receives selected native-plugin source roots after the project resolves.
|
|
16
44
|
* The watch launcher uses these roots to invalidate a sidecar when its Go
|
|
@@ -81,7 +109,7 @@ export type ResidentCheckEntryPlan = {
|
|
|
81
109
|
* Plan every configured check entry while sharing resident processes only by
|
|
82
110
|
* binary/name/argument identity.
|
|
83
111
|
*/
|
|
84
|
-
export declare function planResidentCheckEntries(plugins: readonly ITtscLoadedNativePlugin[], createArgs: (plugin: ITtscLoadedNativePlugin) => string[]): ResidentCheckEntryPlan[];
|
|
112
|
+
export declare function planResidentCheckEntries(plugins: readonly ITtscLoadedNativePlugin[], createArgs: (plugin: ITtscLoadedNativePlugin) => string[], tsgoArgs?: string): ResidentCheckEntryPlan[];
|
|
85
113
|
/** Retain one complete change stream per configured resident check entry. */
|
|
86
114
|
export declare function bufferResidentCheckEntryRequests(pending: Map<number, ResidentCheckRequest>, checks: readonly ResidentCheckEntryPlan[], request: ResidentCheckRequest): void;
|
|
87
115
|
/** Consume exactly one configured entry's buffered request. */
|