ttsc 0.12.3 → 0.12.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/cmd/platform/main.go +9 -0
- package/cmd/ttsc/api_compile.go +109 -101
- package/cmd/ttsc/api_compile_branches_test.go +55 -57
- package/cmd/ttsc/api_transform.go +54 -49
- package/cmd/ttsc/api_transform_branches_test.go +30 -32
- package/cmd/ttsc/build.go +111 -108
- package/cmd/ttsc/build_branches_test.go +95 -97
- package/cmd/ttsc/helpers_test.go +39 -28
- package/cmd/ttsc/main.go +111 -104
- package/cmd/ttsc/main_alias_branches_test.go +21 -23
- package/cmd/ttscserver/main.go +96 -90
- package/cmd/ttscserver/run_lsp_prefers_tsgo_flag_test.go +22 -22
- package/cmd/ttscserver/run_lsp_reports_server_error_test.go +22 -22
- package/cmd/ttscserver/run_lsp_uses_tsgo_environment_test.go +23 -23
- package/cmd/utility-host/main.go +30 -23
- package/driver/lsp.go +53 -7
- package/driver/plugins.go +88 -72
- package/driver/program.go +362 -339
- package/driver/rewrite.go +442 -380
- package/internal/lspserver/lsp_envelope.go +64 -64
- package/internal/lspserver/lsp_frame.go +60 -60
- package/internal/lspserver/lsp_plugin.go +57 -57
- package/internal/lspserver/lsp_proxy.go +265 -251
- package/internal/lspserver/lsp_server.go +155 -144
- package/lib/TtscCompiler.d.ts +7 -0
- package/lib/TtscCompiler.js +7 -0
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/buildNativeCompiler.d.ts +11 -1
- package/lib/compiler/internal/buildNativeCompiler.js +23 -3
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.d.ts +9 -0
- package/lib/compiler/internal/compileProjectInMemory.js +36 -21
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/paths.d.ts +27 -0
- package/lib/compiler/internal/paths.js +70 -0
- package/lib/compiler/internal/paths.js.map +1 -0
- package/lib/compiler/internal/project/readProjectConfig.d.ts +9 -1
- package/lib/compiler/internal/project/readProjectConfig.js +80 -1
- package/lib/compiler/internal/project/readProjectConfig.js.map +1 -1
- package/lib/compiler/internal/project/resolveProjectConfig.d.ts +13 -1
- package/lib/compiler/internal/project/resolveProjectConfig.js +24 -1
- package/lib/compiler/internal/project/resolveProjectConfig.js.map +1 -1
- package/lib/compiler/internal/resolveBinary.d.ts +9 -1
- package/lib/compiler/internal/resolveBinary.js +17 -1
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveEmittedJavaScript.d.ts +16 -1
- package/lib/compiler/internal/resolveEmittedJavaScript.js +42 -10
- package/lib/compiler/internal/resolveEmittedJavaScript.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.d.ts +21 -1
- package/lib/compiler/internal/resolveTsgo.js +23 -1
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runBuild.d.ts +19 -0
- package/lib/compiler/internal/runBuild.js +112 -46
- package/lib/compiler/internal/runBuild.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.d.ts +10 -1
- package/lib/compiler/internal/runSingleFileEmit.js +14 -1
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/sharedHostHelpers.d.ts +5 -0
- package/lib/compiler/internal/sharedHostHelpers.js +6 -2
- package/lib/compiler/internal/sharedHostHelpers.js.map +1 -1
- package/lib/compiler/internal/spawnNative.d.ts +21 -0
- package/lib/compiler/internal/spawnNative.js +59 -0
- package/lib/compiler/internal/spawnNative.js.map +1 -0
- package/lib/compiler/internal/transformProjectInMemory.d.ts +15 -1
- package/lib/compiler/internal/transformProjectInMemory.js +57 -61
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/launcher/internal/getCompilerVersionText.js +7 -0
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js +32 -0
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/resolveCacheDir.d.ts +9 -0
- package/lib/launcher/internal/resolveCacheDir.js +22 -0
- package/lib/launcher/internal/resolveCacheDir.js.map +1 -0
- package/lib/launcher/internal/resolveTtscserverBinary.js +2 -0
- package/lib/launcher/internal/resolveTtscserverBinary.js.map +1 -1
- package/lib/launcher/internal/runTtsc.d.ts +10 -0
- package/lib/launcher/internal/runTtsc.js +22 -9
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runTtscserver.js +10 -35
- package/lib/launcher/internal/runTtscserver.js.map +1 -1
- package/lib/launcher/internal/runTtsx.d.ts +8 -0
- package/lib/launcher/internal/runTtsx.js +33 -7
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/plugin/internal/buildSourcePlugin.d.ts +38 -0
- package/lib/plugin/internal/buildSourcePlugin.js +40 -17
- package/lib/plugin/internal/buildSourcePlugin.js.map +1 -1
- package/lib/plugin/internal/loadProjectPlugins.d.ts +26 -0
- package/lib/plugin/internal/loadProjectPlugins.js +32 -18
- package/lib/plugin/internal/loadProjectPlugins.js.map +1 -1
- package/lib/structures/ITtscCompilerTransformation.d.ts +15 -2
- package/lib/structures/internal/TtscSingleFileEmitOptions.d.ts +0 -2
- package/package.json +9 -9
- package/shim/ast/shim.go +24 -0
- package/shim/checker/shim.go +35 -0
- package/shim/core/shim.go +17 -0
- package/shim/diagnosticwriter/shim.go +4 -0
- package/shim/lsp/shim.go +3 -3
- package/shim/printer/shim.go +20 -0
- package/src/TtscCompiler.ts +7 -0
- package/src/compiler/internal/buildNativeCompiler.ts +23 -3
- package/src/compiler/internal/compileProjectInMemory.ts +34 -25
- package/src/compiler/internal/paths.ts +68 -0
- package/src/compiler/internal/project/readProjectConfig.ts +86 -1
- package/src/compiler/internal/project/resolveProjectConfig.ts +24 -1
- package/src/compiler/internal/resolveBinary.ts +17 -1
- package/src/compiler/internal/resolveEmittedJavaScript.ts +43 -12
- package/src/compiler/internal/resolveTsgo.ts +29 -1
- package/src/compiler/internal/runBuild.ts +110 -55
- package/src/compiler/internal/runSingleFileEmit.ts +14 -1
- package/src/compiler/internal/sharedHostHelpers.ts +7 -7
- package/src/compiler/internal/spawnNative.ts +64 -0
- package/src/compiler/internal/transformProjectInMemory.ts +47 -67
- package/src/launcher/internal/getCompilerVersionText.ts +7 -0
- package/src/launcher/internal/prepareExecution.ts +32 -0
- package/src/launcher/internal/resolveCacheDir.ts +19 -0
- package/src/launcher/internal/resolveTtscserverBinary.ts +2 -0
- package/src/launcher/internal/runTtsc.ts +22 -10
- package/src/launcher/internal/runTtscserver.ts +9 -1
- package/src/launcher/internal/runTtsx.ts +33 -8
- package/src/plugin/internal/buildSourcePlugin.ts +40 -14
- package/src/plugin/internal/loadProjectPlugins.ts +42 -18
- package/src/structures/ITtscCompilerTransformation.ts +15 -2
- package/src/structures/ITtscPlugin.ts +0 -1
- package/src/structures/internal/TtscSingleFileEmitOptions.ts +0 -2
- package/tools/gen_shims/main.go +43 -8
- package/utility/host.go +294 -245
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
package lspserver
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
"context"
|
|
5
|
+
"errors"
|
|
6
|
+
"fmt"
|
|
7
|
+
"io"
|
|
8
|
+
"os/exec"
|
|
9
|
+
"path/filepath"
|
|
10
|
+
"runtime/debug"
|
|
11
|
+
"sync"
|
|
12
|
+
"time"
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
// ErrLSPUpstreamPanic wraps a panic recovered from inside an upstream
|
|
@@ -29,12 +29,12 @@ var ErrLSPUpstreamPanic = errors.New("ttscserver: tsgo upstream runner panicked"
|
|
|
29
29
|
// goroutine and join on a sentinel channel — outside this helper's
|
|
30
30
|
// scope today.
|
|
31
31
|
func RecoverPanicAs(fn func() error) (err error) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
defer func() {
|
|
33
|
+
if r := recover(); r != nil {
|
|
34
|
+
err = fmt.Errorf("%w: %v\n%s", ErrLSPUpstreamPanic, r, debug.Stack())
|
|
35
|
+
}
|
|
36
|
+
}()
|
|
37
|
+
return fn()
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// LSPServerOptions wires ttscserver to its three channels of state:
|
|
@@ -42,29 +42,29 @@ func RecoverPanicAs(fn func() error) (err error) {
|
|
|
42
42
|
// merging plugin diagnostics into the stream, and the tsgo binary that
|
|
43
43
|
// provides the upstream LSP server.
|
|
44
44
|
type LSPServerOptions struct {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
// In is the editor-side reader; ttscserver reads JSON-RPC frames from
|
|
46
|
+
// it and forwards or handles them. RunLSPServer closes it on shutdown
|
|
47
|
+
// if it also implements io.Closer so blocked frame reads can unblock.
|
|
48
|
+
In io.Reader
|
|
49
|
+
// Out is the editor-side writer; ttscserver writes both upstream
|
|
50
|
+
// responses and locally-synthesized messages to it.
|
|
51
|
+
Out io.Writer
|
|
52
|
+
// Err is the upstream tsgo server's stderr sink. ttscserver does not
|
|
53
|
+
// log to it directly.
|
|
54
|
+
Err io.Writer
|
|
55
|
+
|
|
56
|
+
// Cwd is the project root used as the upstream tsgo process working
|
|
57
|
+
// directory. An empty string is rejected before any process starts.
|
|
58
|
+
Cwd string
|
|
59
|
+
// TsgoBinary is the absolute path to the project-selected
|
|
60
|
+
// @typescript/native-preview executable.
|
|
61
|
+
TsgoBinary string
|
|
62
|
+
// Source contributes ttsc plugin diagnostics / code actions /
|
|
63
|
+
// executeCommand handling. Nil falls back to NullPluginSource{}.
|
|
64
|
+
Source PluginSource
|
|
65
|
+
// ProgressDelay is accepted for CLI compatibility. The external tsgo
|
|
66
|
+
// LSP command does not currently expose a progress-delay flag.
|
|
67
|
+
ProgressDelay time.Duration
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// ErrLSPCwdRequired is returned when LSPServerOptions.Cwd is empty.
|
|
@@ -92,39 +92,47 @@ var upstreamValidator = validateDefaultUpstreamOptions
|
|
|
92
92
|
// production runner. The seam stays in the public driver API because
|
|
93
93
|
// tests and embedders otherwise have no way to bypass tsgo.
|
|
94
94
|
func WithUpstreamRunnerForTest(runner LSPUpstreamRunner) func() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
prev := upstreamRunner
|
|
96
|
+
prevValidator := upstreamValidator
|
|
97
|
+
upstreamRunner = runner
|
|
98
|
+
upstreamValidator = func(LSPServerOptions) error { return nil }
|
|
99
|
+
return func() {
|
|
100
|
+
upstreamRunner = prev
|
|
101
|
+
upstreamValidator = prevValidator
|
|
102
|
+
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
// validateDefaultUpstreamOptions enforces production-only requirements
|
|
106
|
+
// before any process or proxy goroutine is started. Test upstream runners
|
|
107
|
+
// bypass this via WithUpstreamRunnerForTest, which replaces upstreamValidator
|
|
108
|
+
// with a no-op.
|
|
105
109
|
func validateDefaultUpstreamOptions(opts LSPServerOptions) error {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
if opts.TsgoBinary == "" {
|
|
111
|
+
return ErrLSPTsgoBinaryRequired
|
|
112
|
+
}
|
|
113
|
+
if !filepath.IsAbs(opts.TsgoBinary) {
|
|
114
|
+
return fmt.Errorf("ttscserver: tsgo binary must be absolute: %s", opts.TsgoBinary)
|
|
115
|
+
}
|
|
116
|
+
return nil
|
|
113
117
|
}
|
|
114
118
|
|
|
119
|
+
// defaultUpstreamRunner spawns `tsgo --lsp --stdio` as an external process and
|
|
120
|
+
// waits for it to exit. Context cancellation causes the process to be killed
|
|
121
|
+
// via CommandContext and the function returns ctx.Err() rather than the
|
|
122
|
+
// (likely "signal: killed") process error.
|
|
115
123
|
func defaultUpstreamRunner(ctx context.Context, in io.Reader, out io.Writer, opts LSPServerOptions) error {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
cmd := exec.CommandContext(ctx, opts.TsgoBinary, "--lsp", "--stdio")
|
|
125
|
+
cmd.Dir = opts.Cwd
|
|
126
|
+
cmd.Stdin = in
|
|
127
|
+
cmd.Stdout = out
|
|
128
|
+
cmd.Stderr = opts.Err
|
|
129
|
+
if err := cmd.Run(); err != nil {
|
|
130
|
+
if ctx.Err() != nil {
|
|
131
|
+
return ctx.Err()
|
|
132
|
+
}
|
|
133
|
+
return fmt.Errorf("tsgo --lsp --stdio: %w", err)
|
|
134
|
+
}
|
|
135
|
+
return nil
|
|
128
136
|
}
|
|
129
137
|
|
|
130
138
|
// RunLSPServer starts an upstream `tsgo --lsp --stdio` process and the byte-level
|
|
@@ -140,92 +148,95 @@ func defaultUpstreamRunner(ctx context.Context, in io.Reader, out io.Writer, opt
|
|
|
140
148
|
// 4. A watchdog cascades context cancellation by closing every pipe so both
|
|
141
149
|
// halves unblock; the goroutines' own defers close the rest.
|
|
142
150
|
func RunLSPServer(ctx context.Context, opts LSPServerOptions) error {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
151
|
+
if opts.Cwd == "" {
|
|
152
|
+
return ErrLSPCwdRequired
|
|
153
|
+
}
|
|
154
|
+
if err := upstreamValidator(opts); err != nil {
|
|
155
|
+
return err
|
|
156
|
+
}
|
|
157
|
+
source := opts.Source
|
|
158
|
+
if source == nil {
|
|
159
|
+
source = NullPluginSource{}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
upstreamInR, upstreamInW := io.Pipe()
|
|
163
|
+
upstreamOutR, upstreamOutW := io.Pipe()
|
|
164
|
+
|
|
165
|
+
proxy := NewProxy(ProxyOptions{
|
|
166
|
+
EditorIn: opts.In,
|
|
167
|
+
EditorOut: opts.Out,
|
|
168
|
+
UpstreamIn: upstreamInW,
|
|
169
|
+
UpstreamOut: upstreamOutR,
|
|
170
|
+
Source: source,
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
serverCtx, cancel := context.WithCancel(ctx)
|
|
174
|
+
defer cancel()
|
|
175
|
+
|
|
176
|
+
// Watchdog: on cancel, close the writer ends of the upstream pipes so
|
|
177
|
+
// both halves unblock with a clean io.EOF. Closing readers directly
|
|
178
|
+
// would surface as io.ErrClosedPipe and make ttsc's error fold
|
|
179
|
+
// ambiguous; closing writers preserves the ErrFrameClosed signal. The
|
|
180
|
+
// editor input is also closed when possible so an upstream process-start
|
|
181
|
+
// failure cannot leave the editor->upstream pump blocked on stdin.
|
|
182
|
+
go func() {
|
|
183
|
+
<-serverCtx.Done()
|
|
184
|
+
closeIfCloser(opts.In)
|
|
185
|
+
upstreamInW.Close()
|
|
186
|
+
upstreamOutW.Close()
|
|
187
|
+
}()
|
|
188
|
+
|
|
189
|
+
var wg sync.WaitGroup
|
|
190
|
+
var serverErr, proxyErr error
|
|
191
|
+
wg.Add(2)
|
|
192
|
+
go func() {
|
|
193
|
+
defer wg.Done()
|
|
194
|
+
defer cancel()
|
|
195
|
+
defer upstreamOutW.Close()
|
|
196
|
+
defer upstreamInR.Close()
|
|
197
|
+
serverErr = RecoverPanicAs(func() error {
|
|
198
|
+
return upstreamRunner(serverCtx, upstreamInR, upstreamOutW, opts)
|
|
199
|
+
})
|
|
200
|
+
}()
|
|
201
|
+
go func() {
|
|
202
|
+
defer wg.Done()
|
|
203
|
+
defer cancel()
|
|
204
|
+
defer upstreamInW.Close()
|
|
205
|
+
defer upstreamOutR.Close()
|
|
206
|
+
proxyErr = proxy.Run(serverCtx)
|
|
207
|
+
}()
|
|
208
|
+
wg.Wait()
|
|
209
|
+
|
|
210
|
+
for _, err := range []error{serverErr, proxyErr} {
|
|
211
|
+
if err == nil {
|
|
212
|
+
continue
|
|
213
|
+
}
|
|
214
|
+
if errors.Is(err, context.Canceled) {
|
|
215
|
+
continue
|
|
216
|
+
}
|
|
217
|
+
if errors.Is(err, ErrFrameClosed) {
|
|
218
|
+
continue
|
|
219
|
+
}
|
|
220
|
+
if errors.Is(err, io.ErrClosedPipe) {
|
|
221
|
+
continue
|
|
222
|
+
}
|
|
223
|
+
return err
|
|
224
|
+
}
|
|
225
|
+
return nil
|
|
218
226
|
}
|
|
219
227
|
|
|
220
228
|
// DenyNpmInstall is kept for source compatibility with older driver
|
|
221
229
|
// embedders that hosted tsgo in-process. The process wrapper cannot
|
|
222
230
|
// override tsgo's internal ATA callback.
|
|
223
231
|
func DenyNpmInstall(_ string, args []string) ([]byte, error) {
|
|
224
|
-
|
|
232
|
+
return nil, fmt.Errorf("ttscserver: npm install disabled in LSP host (args=%v)", args)
|
|
225
233
|
}
|
|
226
234
|
|
|
235
|
+
// closeIfCloser closes value if it implements io.Closer. The error is
|
|
236
|
+
// intentionally discarded: callers invoke this only for cleanup on
|
|
237
|
+
// shutdown paths where the underlying stream is already going away.
|
|
227
238
|
func closeIfCloser(value any) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
239
|
+
if closer, ok := value.(io.Closer); ok {
|
|
240
|
+
_ = closer.Close()
|
|
241
|
+
}
|
|
231
242
|
}
|
package/lib/TtscCompiler.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ import type { ITtscCompilerTransformation } from "./structures/ITtscCompilerTran
|
|
|
23
23
|
*/
|
|
24
24
|
export declare class TtscCompiler {
|
|
25
25
|
private readonly context;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new compiler instance bound to the given project context.
|
|
28
|
+
*
|
|
29
|
+
* The context is defensively copied: mutations to the original object after
|
|
30
|
+
* construction do not affect this instance. Omit `context` (or pass `{}`) to
|
|
31
|
+
* inherit all defaults from the running process.
|
|
32
|
+
*/
|
|
26
33
|
constructor(context?: ITtscCompilerContext);
|
|
27
34
|
/**
|
|
28
35
|
* Build every configured source plugin into the instance cache.
|
package/lib/TtscCompiler.js
CHANGED
|
@@ -34,6 +34,13 @@ const loadProjectPlugins_1 = require("./plugin/internal/loadProjectPlugins");
|
|
|
34
34
|
*/
|
|
35
35
|
class TtscCompiler {
|
|
36
36
|
context;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new compiler instance bound to the given project context.
|
|
39
|
+
*
|
|
40
|
+
* The context is defensively copied: mutations to the original object after
|
|
41
|
+
* construction do not affect this instance. Omit `context` (or pass `{}`) to
|
|
42
|
+
* inherit all defaults from the running process.
|
|
43
|
+
*/
|
|
37
44
|
constructor(context = {}) {
|
|
38
45
|
this.context = {
|
|
39
46
|
...context,
|
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,2FAAwF;AACxF,2EAAqF;AACrF,6EAA0E;AAO1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IACmB,OAAO,CAAuB;IAE/C,YAAmB,OAAO,GAAyB,EAAE;QACnD,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,OAAO;YACV,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS;YACjD,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;gBACrC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;gBACtB,CAAC,CAAC,OAAO,CAAC,OAAO;SACpB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACjD,MAAM,MAAM,GAAG,IAAA,uCAAkB,EAAC;Y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MAAM,KAAK,CAAC;gBACjC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;YACxC,IAAI,EAAE,SAAS;YACf,UAAU;SACX,CAAC;IACJ,CAAC;IACD,OAAO;QACL,WAAW,EACT,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAC7B,CAAC,CAAC,CAAC,uBAAuB,CAAC,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"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Build (or retrieve from cache) the native ttsc compiler host binary used by
|
|
3
|
+
* the in-memory API compilation paths (`compileProjectInMemory`,
|
|
4
|
+
* `transformProjectInMemory`).
|
|
5
|
+
*
|
|
6
|
+
* The host is the `cmd/ttsc` Go entrypoint compiled with `buildSourcePlugin`.
|
|
7
|
+
* The cache key incorporates the ttsc package version and the full `go.mod`
|
|
8
|
+
* contents so a toolchain upgrade automatically produces a fresh binary.
|
|
9
|
+
*
|
|
10
|
+
* @returns Absolute path to the compiled host executable.
|
|
11
|
+
*/
|
|
2
12
|
export declare function buildNativeCompiler(options: {
|
|
3
13
|
cacheBaseDir: string;
|
|
4
14
|
cacheDir?: string;
|
|
@@ -7,7 +7,17 @@ exports.buildNativeCompiler = buildNativeCompiler;
|
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const buildSourcePlugin_1 = require("../../plugin/internal/buildSourcePlugin");
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Build (or retrieve from cache) the native ttsc compiler host binary used by
|
|
12
|
+
* the in-memory API compilation paths (`compileProjectInMemory`,
|
|
13
|
+
* `transformProjectInMemory`).
|
|
14
|
+
*
|
|
15
|
+
* The host is the `cmd/ttsc` Go entrypoint compiled with `buildSourcePlugin`.
|
|
16
|
+
* The cache key incorporates the ttsc package version and the full `go.mod`
|
|
17
|
+
* contents so a toolchain upgrade automatically produces a fresh binary.
|
|
18
|
+
*
|
|
19
|
+
* @returns Absolute path to the compiled host executable.
|
|
20
|
+
*/
|
|
11
21
|
function buildNativeCompiler(options) {
|
|
12
22
|
return (0, buildSourcePlugin_1.buildSourcePlugin)({
|
|
13
23
|
baseDir: options.cacheBaseDir,
|
|
@@ -21,6 +31,10 @@ function buildNativeCompiler(options) {
|
|
|
21
31
|
tsgoVersion: readGoModuleVersion(options.packageRoot),
|
|
22
32
|
});
|
|
23
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Read the `version` field from `package.json` inside `packageRoot`, falling
|
|
36
|
+
* back to `"0.0.0"` when the file is absent or malformed.
|
|
37
|
+
*/
|
|
24
38
|
function readOwnPackageVersion(packageRoot) {
|
|
25
39
|
try {
|
|
26
40
|
const pkg = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.join(packageRoot, "package.json"), "utf8"));
|
|
@@ -30,10 +44,16 @@ function readOwnPackageVersion(packageRoot) {
|
|
|
30
44
|
return "0.0.0";
|
|
31
45
|
}
|
|
32
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Read the full contents of `go.mod` inside `packageRoot` and use it as a
|
|
49
|
+
* version token for the binary cache key. Returns `"unknown"` on read error.
|
|
50
|
+
*
|
|
51
|
+
* Using the entire `go.mod` ensures that any dependency bump (including
|
|
52
|
+
* indirect ones) invalidates the cached binary.
|
|
53
|
+
*/
|
|
33
54
|
function readGoModuleVersion(packageRoot) {
|
|
34
55
|
try {
|
|
35
|
-
|
|
36
|
-
return goMod;
|
|
56
|
+
return node_fs_1.default.readFileSync(node_path_1.default.join(packageRoot, "go.mod"), "utf8");
|
|
37
57
|
}
|
|
38
58
|
catch {
|
|
39
59
|
return "unknown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildNativeCompiler.js","sourceRoot":"","sources":["../../../src/compiler/internal/buildNativeCompiler.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,+EAA4E;AAE5E
|
|
1
|
+
{"version":3,"file":"buildNativeCompiler.js","sourceRoot":"","sources":["../../../src/compiler/internal/buildNativeCompiler.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAE7B,+EAA4E;AAE5E;;;;;;;;;;GAUG;AACH,6BAAoC,OAInC;IACC,OAAO,IAAA,qCAAiB,EAAC;QACvB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC;QACrD,WAAW,EAAE,qBAAqB,CAAC,OAAO,CAAC,WAAW,CAAC;QACvD,WAAW,EAAE,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC;KACtD,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,WAAmB;IAChD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,iBAAE,CAAC,YAAY,CAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACvC,CAAC;QAC3B,OAAO,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,IAAI,CAAC;QACH,OAAO,iBAAE,CAAC,YAAY,CAAC,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -3,6 +3,15 @@ import type { TtscBuildResult } from "../../structures/internal/TtscBuildResult"
|
|
|
3
3
|
/**
|
|
4
4
|
* Compile a project and capture emitted files without writing to the project
|
|
5
5
|
* tree.
|
|
6
|
+
*
|
|
7
|
+
* When no plugins are configured the fast path spawns the native ttsc compiler
|
|
8
|
+
* host (`cmd/ttsc api-compile`) which returns a structured JSON response
|
|
9
|
+
* containing diagnostics and an output file map. When plugins are present the
|
|
10
|
+
* slow path goes through `runBuild` into a temp directory and reads the files
|
|
11
|
+
* back from disk.
|
|
12
|
+
*
|
|
13
|
+
* @returns A map of output path → file content plus a `TtscBuildResult` with
|
|
14
|
+
* diagnostics and the exit status.
|
|
6
15
|
*/
|
|
7
16
|
export declare function compileProjectInMemory(options: ITtscCompilerContext): {
|
|
8
17
|
output: Record<string, string>;
|
|
@@ -10,11 +10,21 @@ const node_os_1 = __importDefault(require("node:os"));
|
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const loadProjectPlugins_1 = require("../../plugin/internal/loadProjectPlugins");
|
|
12
12
|
const buildNativeCompiler_1 = require("./buildNativeCompiler");
|
|
13
|
+
const paths_1 = require("./paths");
|
|
13
14
|
const readProjectConfig_1 = require("./project/readProjectConfig");
|
|
14
15
|
const runBuild_1 = require("./runBuild");
|
|
15
16
|
/**
|
|
16
17
|
* Compile a project and capture emitted files without writing to the project
|
|
17
18
|
* tree.
|
|
19
|
+
*
|
|
20
|
+
* When no plugins are configured the fast path spawns the native ttsc compiler
|
|
21
|
+
* host (`cmd/ttsc api-compile`) which returns a structured JSON response
|
|
22
|
+
* containing diagnostics and an output file map. When plugins are present the
|
|
23
|
+
* slow path goes through `runBuild` into a temp directory and reads the files
|
|
24
|
+
* back from disk.
|
|
25
|
+
*
|
|
26
|
+
* @returns A map of output path → file content plus a `TtscBuildResult` with
|
|
27
|
+
* diagnostics and the exit status.
|
|
18
28
|
*/
|
|
19
29
|
function compileProjectInMemory(options) {
|
|
20
30
|
const cwd = node_path_1.default.resolve(options.cwd ?? process.cwd());
|
|
@@ -30,7 +40,7 @@ function compileProjectInMemory(options) {
|
|
|
30
40
|
const binary = (0, buildNativeCompiler_1.buildNativeCompiler)({
|
|
31
41
|
cacheBaseDir: project.root,
|
|
32
42
|
cacheDir: options.cacheDir ?? options.env?.TTSC_CACHE_DIR,
|
|
33
|
-
packageRoot: packageRootDir(),
|
|
43
|
+
packageRoot: (0, paths_1.packageRootDir)(),
|
|
34
44
|
});
|
|
35
45
|
const res = (0, node_child_process_1.spawnSync)(binary, ["api-compile", "--cwd", project.root, "--tsconfig", tsconfig], {
|
|
36
46
|
cwd: project.root,
|
|
@@ -53,9 +63,14 @@ function compileProjectInMemory(options) {
|
|
|
53
63
|
},
|
|
54
64
|
};
|
|
55
65
|
}
|
|
66
|
+
/** Return true when the project or the call-level options declare any plugins. */
|
|
56
67
|
function hasConfiguredPlugins(options, project) {
|
|
57
68
|
return (0, loadProjectPlugins_1.hasProjectPluginEntries)(project, options.plugins);
|
|
58
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Plugin-backed compilation: emit into a temp directory via `runBuild`, then
|
|
72
|
+
* read back every file the build wrote so they can be returned as strings.
|
|
73
|
+
*/
|
|
59
74
|
function compileProjectWithPlugins(options, cwd, project) {
|
|
60
75
|
const tempRoot = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), "ttsc-api-output-"));
|
|
61
76
|
const tempOutDir = node_path_1.default.join(tempRoot, "out");
|
|
@@ -79,23 +94,28 @@ function compileProjectWithPlugins(options, cwd, project) {
|
|
|
79
94
|
node_fs_1.default.rmSync(tempRoot, { force: true, recursive: true });
|
|
80
95
|
}
|
|
81
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Build a function that maps a path relative to the temp output directory to
|
|
99
|
+
* the key used in the returned `output` map.
|
|
100
|
+
*
|
|
101
|
+
* When `outDir` is inside the project root the key is relative to the project
|
|
102
|
+
* root (preserving the `outDir` prefix). When `outDir` is outside the project
|
|
103
|
+
* root the key is absolute-style (`/absolute/outDir/relative`). When `outDir`
|
|
104
|
+
* is absent the key is the bare relative path.
|
|
105
|
+
*/
|
|
82
106
|
function outputKeyMapper(project) {
|
|
83
107
|
const outDir = project.compilerOptions.outDir;
|
|
84
108
|
if (!outDir) {
|
|
85
109
|
return (relativePath) => relativePath;
|
|
86
110
|
}
|
|
87
111
|
const relativeOutDir = node_path_1.default.relative(project.root, outDir);
|
|
88
|
-
if (relativeOutDir !== "" && !isOutsideRelativePath(relativeOutDir)) {
|
|
112
|
+
if (relativeOutDir !== "" && !(0, paths_1.isOutsideRelativePath)(relativeOutDir)) {
|
|
89
113
|
const prefix = pathToKey(relativeOutDir);
|
|
90
114
|
return (relativePath) => node_path_1.default.posix.join(prefix, relativePath);
|
|
91
115
|
}
|
|
92
116
|
return (relativePath) => pathToKey(node_path_1.default.join(outDir, relativePath));
|
|
93
117
|
}
|
|
94
|
-
|
|
95
|
-
return (relative === ".." ||
|
|
96
|
-
relative.startsWith(`..${node_path_1.default.sep}`) ||
|
|
97
|
-
node_path_1.default.isAbsolute(relative));
|
|
98
|
-
}
|
|
118
|
+
/** Read every file in `directory` recursively and return a `path→content` map. */
|
|
99
119
|
function readOutputDirectory(directory, keyOf) {
|
|
100
120
|
const output = {};
|
|
101
121
|
if (!node_fs_1.default.existsSync(directory)) {
|
|
@@ -106,6 +126,7 @@ function readOutputDirectory(directory, keyOf) {
|
|
|
106
126
|
}
|
|
107
127
|
return output;
|
|
108
128
|
}
|
|
129
|
+
/** Recursively list all files under `directory`, sorted for stable output. */
|
|
109
130
|
function listFiles(directory) {
|
|
110
131
|
const out = [];
|
|
111
132
|
for (const entry of node_fs_1.default.readdirSync(directory, { withFileTypes: true })) {
|
|
@@ -119,9 +140,17 @@ function listFiles(directory) {
|
|
|
119
140
|
}
|
|
120
141
|
return out.sort();
|
|
121
142
|
}
|
|
143
|
+
/** Normalise a file path to a forward-slash key suitable for the output map. */
|
|
122
144
|
function pathToKey(file) {
|
|
123
145
|
return file.replace(/\\/g, "/");
|
|
124
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Parse the JSON envelope written by the native compiler host to stdout.
|
|
149
|
+
*
|
|
150
|
+
* On success returns `{ diagnostics, output }`. On JSON parse failure throws a
|
|
151
|
+
* descriptive error using stderr (preferred) or stdout as context, so callers
|
|
152
|
+
* see the original compiler error rather than a generic JSON parse message.
|
|
153
|
+
*/
|
|
125
154
|
function parseNativeCompileOutput(stdout, stderr) {
|
|
126
155
|
try {
|
|
127
156
|
const parsed = JSON.parse(stdout);
|
|
@@ -135,18 +164,4 @@ function parseNativeCompileOutput(stdout, stderr) {
|
|
|
135
164
|
"ttsc: native compiler host returned no output");
|
|
136
165
|
}
|
|
137
166
|
}
|
|
138
|
-
function packageRootDir() {
|
|
139
|
-
let current = node_path_1.default.resolve(__dirname);
|
|
140
|
-
while (true) {
|
|
141
|
-
if (node_fs_1.default.existsSync(node_path_1.default.join(current, "package.json")) &&
|
|
142
|
-
node_fs_1.default.existsSync(node_path_1.default.join(current, "go.mod"))) {
|
|
143
|
-
return node_fs_1.default.realpathSync.native?.(current) ?? node_fs_1.default.realpathSync(current);
|
|
144
|
-
}
|
|
145
|
-
const parent = node_path_1.default.dirname(current);
|
|
146
|
-
if (parent === current) {
|
|
147
|
-
throw new Error("ttsc: package root not found for native compiler build");
|
|
148
|
-
}
|
|
149
|
-
current = parent;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
167
|
//# sourceMappingURL=compileProjectInMemory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileProjectInMemory.js","sourceRoot":"","sources":["../../../src/compiler/internal/compileProjectInMemory.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA+C;AAC/C,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B,iFAAmF;AAKnF,+DAA4D;AAC5D,mEAAgE;AAChE,yCAAsC;AAEtC
|
|
1
|
+
{"version":3,"file":"compileProjectInMemory.js","sourceRoot":"","sources":["../../../src/compiler/internal/compileProjectInMemory.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA+C;AAC/C,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B,iFAAmF;AAKnF,+DAA4D;AAC5D,mCAAgE;AAChE,mEAAgE;AAChE,yCAAsC;AAEtC;;;;;;;;;;;;GAYG;AACH,gCAAuC,OAA6B;IAIlE,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,IAAI,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,yBAAyB,C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