ttsc 0.8.1 → 0.10.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 +39 -68
- package/cmd/ttsc/api_compile.go +109 -115
- package/cmd/ttsc/api_transform.go +54 -51
- package/cmd/ttsc/main.go +103 -121
- package/driver/program.go +30 -2
- package/driver/rewrite.go +126 -9
- package/go.mod +2 -0
- package/lib/TtscCompiler.js +28 -46
- package/lib/TtscCompiler.js.map +1 -1
- package/lib/compiler/internal/buildNativeCompiler.js +8 -38
- package/lib/compiler/internal/buildNativeCompiler.js.map +1 -1
- package/lib/compiler/internal/compileProjectInMemory.js +36 -63
- package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
- package/lib/compiler/internal/project/readProjectConfig.js +108 -60
- package/lib/compiler/internal/project/readProjectConfig.js.map +1 -1
- package/lib/compiler/internal/project/resolveProjectConfig.js +15 -45
- package/lib/compiler/internal/project/resolveProjectConfig.js.map +1 -1
- package/lib/compiler/internal/resolveBinary.js +10 -40
- package/lib/compiler/internal/resolveBinary.js.map +1 -1
- package/lib/compiler/internal/resolveEmittedJavaScript.js +21 -48
- package/lib/compiler/internal/resolveEmittedJavaScript.js.map +1 -1
- package/lib/compiler/internal/resolveTsgo.js +14 -44
- package/lib/compiler/internal/resolveTsgo.js.map +1 -1
- package/lib/compiler/internal/runBuild.d.ts +7 -0
- package/lib/compiler/internal/runBuild.js +47 -66
- package/lib/compiler/internal/runBuild.js.map +1 -1
- package/lib/compiler/internal/runSingleFileEmit.js +18 -48
- package/lib/compiler/internal/runSingleFileEmit.js.map +1 -1
- package/lib/compiler/internal/transformProjectInMemory.js +41 -75
- package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
- package/lib/launcher/internal/getCompilerVersionText.js +7 -37
- package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
- package/lib/launcher/internal/prepareExecution.js +48 -69
- package/lib/launcher/internal/prepareExecution.js.map +1 -1
- package/lib/launcher/internal/runTtsc.js +53 -64
- package/lib/launcher/internal/runTtsc.js.map +1 -1
- package/lib/launcher/internal/runTtsx.js +328 -57
- package/lib/launcher/internal/runTtsx.js.map +1 -1
- package/lib/plugin/internal/buildSourcePlugin.d.ts +8 -0
- package/lib/plugin/internal/buildSourcePlugin.js +287 -139
- package/lib/plugin/internal/buildSourcePlugin.js.map +1 -1
- package/lib/plugin/internal/loadProjectPlugins.d.ts +2 -0
- package/lib/plugin/internal/loadProjectPlugins.js +197 -9
- package/lib/plugin/internal/loadProjectPlugins.js.map +1 -1
- package/lib/structures/ITtscCompilerContext.d.ts +16 -3
- package/lib/structures/ITtscCompilerResult.d.ts +4 -0
- package/lib/structures/ITtscCompilerTransformation.d.ts +2 -0
- package/lib/structures/ITtscPluginFactoryContext.d.ts +6 -3
- package/lib/structures/ITtscProjectPluginConfig.d.ts +8 -7
- package/lib/structures/internal/ITtscParsedProjectConfig.d.ts +2 -0
- package/lib/structures/internal/ITtscProjectLocatorOptions.d.ts +2 -0
- package/lib/structures/internal/TtscCommonOptions.d.ts +2 -0
- package/package.json +9 -14
- package/shim/diagnosticwriter/lint.go +8 -0
- package/shim/printer/go.mod +5 -0
- package/shim/printer/shim.go +23 -0
- package/src/TtscCompiler.ts +20 -5
- package/src/compiler/internal/buildNativeCompiler.ts +2 -2
- package/src/compiler/internal/compileProjectInMemory.ts +21 -16
- package/src/compiler/internal/project/readProjectConfig.ts +134 -35
- package/src/compiler/internal/project/resolveProjectConfig.ts +2 -2
- package/src/compiler/internal/resolveBinary.ts +2 -2
- package/src/compiler/internal/resolveEmittedJavaScript.ts +11 -7
- package/src/compiler/internal/resolveTsgo.ts +2 -2
- package/src/compiler/internal/runBuild.ts +34 -21
- package/src/compiler/internal/runSingleFileEmit.ts +3 -3
- package/src/compiler/internal/transformProjectInMemory.ts +37 -37
- package/src/launcher/internal/getCompilerVersionText.ts +2 -2
- package/src/launcher/internal/prepareExecution.ts +14 -4
- package/src/launcher/internal/runTtsc.ts +30 -4
- package/src/launcher/internal/runTtsx.ts +377 -26
- package/src/plugin/internal/buildSourcePlugin.ts +321 -50
- package/src/plugin/internal/loadProjectPlugins.ts +266 -10
- package/src/structures/ITtscCompilerContext.ts +17 -3
- package/src/structures/ITtscCompilerResult.ts +5 -0
- package/src/structures/ITtscCompilerTransformation.ts +3 -0
- package/src/structures/ITtscPluginFactoryContext.ts +6 -3
- package/src/structures/ITtscProjectPluginConfig.ts +8 -7
- package/src/structures/internal/ITtscParsedProjectConfig.ts +2 -0
- package/src/structures/internal/ITtscProjectLocatorOptions.ts +2 -0
- package/src/structures/internal/TtscCommonOptions.ts +2 -0
- package/utility/host.go +622 -20
- package/cmd/ttsc/main_test.go +0 -288
- package/test/compiler.test.ts +0 -422
- package/test/platform.test.ts +0 -12
- package/test/project.test.ts +0 -197
- package/test/source-build.test.ts +0 -45
- package/test/tsgo.test.ts +0 -69
package/cmd/ttsc/main.go
CHANGED
|
@@ -12,121 +12,103 @@
|
|
|
12
12
|
package main
|
|
13
13
|
|
|
14
14
|
import (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
"flag"
|
|
16
|
+
"fmt"
|
|
17
|
+
"io"
|
|
18
|
+
"os"
|
|
19
|
+
"runtime"
|
|
20
|
+
"strings"
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
// These are overridden via `-ldflags "-X main.version=... -X main.commit=..."`
|
|
24
24
|
// in CI. Sensible defaults keep local `go run ./cmd/ttsc` usable.
|
|
25
25
|
var (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
version = "0.0.0-dev"
|
|
27
|
+
commit = "dev"
|
|
28
|
+
date = "unknown"
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
// stdout / stderr are package-level to keep the CLI testable.
|
|
32
32
|
var (
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
stdout io.Writer = os.Stdout
|
|
34
|
+
stderr io.Writer = os.Stderr
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
func main() {
|
|
38
|
-
|
|
38
|
+
os.Exit(run(os.Args[1:]))
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
func run(args []string) int {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
if len(args) == 0 {
|
|
43
|
+
return runBuild(nil)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
switch args[0] {
|
|
47
|
+
case "-h", "--help", "help":
|
|
48
|
+
printHelp(stdout)
|
|
49
|
+
return 0
|
|
50
|
+
case "-v", "--version", "version":
|
|
51
|
+
printVersion(stdout)
|
|
52
|
+
return 0
|
|
53
|
+
case "demo":
|
|
54
|
+
return runDemo(args[1:])
|
|
55
|
+
case "build":
|
|
56
|
+
return runBuild(args[1:])
|
|
57
|
+
case "api-compile":
|
|
58
|
+
return runAPICompile(args[1:])
|
|
59
|
+
case "api-transform":
|
|
60
|
+
return runAPITransform(args[1:])
|
|
61
|
+
case "check":
|
|
62
|
+
// `ttsc check` runs the analyze pipeline without emitting JS — useful
|
|
63
|
+
// in CI and pre-commit checks that only need schema validation.
|
|
64
|
+
return runBuild(append([]string{"--noEmit"}, args[1:]...))
|
|
65
|
+
case "-p", "--project":
|
|
66
|
+
if len(args) < 2 {
|
|
67
|
+
fmt.Fprintln(stderr, "ttsc: -p/--project requires a path argument")
|
|
68
|
+
return 2
|
|
69
|
+
}
|
|
70
|
+
return runBuild(append([]string{"--tsconfig=" + args[1]}, args[2:]...))
|
|
71
|
+
default:
|
|
72
|
+
if isBuildAlias(args[0]) {
|
|
73
|
+
return runBuild(args)
|
|
74
|
+
}
|
|
75
|
+
fmt.Fprintf(stderr, "ttsc: unknown command %q\n", args[0])
|
|
76
|
+
fmt.Fprintln(stderr, `ttsc: run "ttsc --help" to see supported commands`)
|
|
77
|
+
return 2
|
|
78
|
+
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
func isBuildAlias(arg string) bool {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// appendUnique appends `extra` to `args` only when it's not already present.
|
|
98
|
-
func appendUnique(args []string, extra ...string) []string {
|
|
99
|
-
out := append([]string{}, args...)
|
|
100
|
-
for _, e := range extra {
|
|
101
|
-
seen := false
|
|
102
|
-
for _, a := range out {
|
|
103
|
-
if a == e {
|
|
104
|
-
seen = true
|
|
105
|
-
break
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if !seen {
|
|
109
|
-
out = append(out, e)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return out
|
|
82
|
+
if strings.HasPrefix(arg, "-") {
|
|
83
|
+
return true
|
|
84
|
+
}
|
|
85
|
+
switch {
|
|
86
|
+
case strings.HasSuffix(arg, ".json"),
|
|
87
|
+
strings.HasSuffix(arg, ".ts"),
|
|
88
|
+
strings.HasSuffix(arg, ".tsx"),
|
|
89
|
+
strings.HasSuffix(arg, ".mts"),
|
|
90
|
+
strings.HasSuffix(arg, ".cts"):
|
|
91
|
+
return true
|
|
92
|
+
default:
|
|
93
|
+
return false
|
|
94
|
+
}
|
|
113
95
|
}
|
|
114
96
|
|
|
115
97
|
func printVersion(w io.Writer) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
fmt.Fprintf(
|
|
99
|
+
w,
|
|
100
|
+
"ttsc %s (commit %s, built %s, %s/%s, go %s)\n",
|
|
101
|
+
version,
|
|
102
|
+
commit,
|
|
103
|
+
date,
|
|
104
|
+
runtime.GOOS,
|
|
105
|
+
runtime.GOARCH,
|
|
106
|
+
runtime.Version(),
|
|
107
|
+
)
|
|
126
108
|
}
|
|
127
109
|
|
|
128
110
|
func printHelp(w io.Writer) {
|
|
129
|
-
|
|
111
|
+
fmt.Fprintln(w, strings.TrimSpace(`
|
|
130
112
|
ttsc — standalone typescript-go host.
|
|
131
113
|
|
|
132
114
|
Usage:
|
|
@@ -172,37 +154,37 @@ Integration guide (bundlers):
|
|
|
172
154
|
}
|
|
173
155
|
|
|
174
156
|
func runDemo(args []string) int {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
157
|
+
fs := flag.NewFlagSet("demo", flag.ContinueOnError)
|
|
158
|
+
fs.SetOutput(stderr)
|
|
159
|
+
typ := fs.String("type", "string", "atomic type to simulate")
|
|
160
|
+
if err := fs.Parse(args); err != nil {
|
|
161
|
+
return 2
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
arrow, err := demoArrow(*typ)
|
|
165
|
+
if err != nil {
|
|
166
|
+
fmt.Fprintf(stderr, "ttsc demo: %v\n", err)
|
|
167
|
+
return 2
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
fmt.Fprintf(stdout, "// demo<%s> -> emitted by ttsc %s\n", *typ, version)
|
|
171
|
+
fmt.Fprintln(stdout, arrow)
|
|
172
|
+
return 0
|
|
191
173
|
}
|
|
192
174
|
|
|
193
175
|
func demoArrow(name string) (string, error) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
176
|
+
switch strings.ToLower(name) {
|
|
177
|
+
case "any":
|
|
178
|
+
return "(input) => true", nil
|
|
179
|
+
case "boolean":
|
|
180
|
+
return `(input) => "boolean" === typeof input`, nil
|
|
181
|
+
case "number":
|
|
182
|
+
return `(input) => "number" === typeof input`, nil
|
|
183
|
+
case "bigint":
|
|
184
|
+
return `(input) => "bigint" === typeof input`, nil
|
|
185
|
+
case "string", "":
|
|
186
|
+
return `(input) => "string" === typeof input`, nil
|
|
187
|
+
default:
|
|
188
|
+
return "", fmt.Errorf("unknown --type value %q (want: string|number|boolean|bigint|any)", name)
|
|
189
|
+
}
|
|
208
190
|
}
|
package/driver/program.go
CHANGED
|
@@ -85,7 +85,7 @@ func NewLintDiagnostic(
|
|
|
85
85
|
if file != nil {
|
|
86
86
|
d.File = file.FileName()
|
|
87
87
|
if pos >= 0 {
|
|
88
|
-
length :=
|
|
88
|
+
length := lint.Len()
|
|
89
89
|
d.Start = &pos
|
|
90
90
|
d.Length = &length
|
|
91
91
|
line, col := shimscanner.GetECMALineAndByteOffsetOfPosition(file, pos)
|
|
@@ -240,6 +240,9 @@ func ParseTSConfig(fs vfs.FS, cwd, tsconfigPath string, host shimcompiler.Compil
|
|
|
240
240
|
|
|
241
241
|
// CreateProgramFromConfig builds a tsgo Program from the parsed config.
|
|
242
242
|
func CreateProgramFromConfig(parsed *tsoptions.ParsedCommandLine, host shimcompiler.CompilerHost) (*shimcompiler.Program, []Diagnostic, error) {
|
|
243
|
+
if parsed == nil {
|
|
244
|
+
return nil, nil, errors.New("driver: nil parsed command line")
|
|
245
|
+
}
|
|
243
246
|
opts := shimcompiler.ProgramOptions{
|
|
244
247
|
Config: parsed,
|
|
245
248
|
SingleThreaded: core.TSTrue,
|
|
@@ -343,7 +346,7 @@ func (fs sourcePreambleFS) ReadFile(filePath string) (string, bool) {
|
|
|
343
346
|
if !ok || !isSourcePreambleTarget(filePath) {
|
|
344
347
|
return contents, ok
|
|
345
348
|
}
|
|
346
|
-
return fs.preamble
|
|
349
|
+
return ApplySourcePreamble(contents, fs.preamble), true
|
|
347
350
|
}
|
|
348
351
|
|
|
349
352
|
func (fs sourcePreambleFS) WriteFile(filePath string, data string) error {
|
|
@@ -377,10 +380,35 @@ func isSourcePreambleTarget(filePath string) bool {
|
|
|
377
380
|
return false
|
|
378
381
|
}
|
|
379
382
|
|
|
383
|
+
// ApplySourcePreamble inserts a generated source preamble without moving the
|
|
384
|
+
// file's BOM or hashbang away from the first bytes of the physical output.
|
|
385
|
+
func ApplySourcePreamble(text string, preamble string) string {
|
|
386
|
+
if preamble == "" {
|
|
387
|
+
return text
|
|
388
|
+
}
|
|
389
|
+
bom := ""
|
|
390
|
+
rest := text
|
|
391
|
+
if strings.HasPrefix(rest, "\ufeff") {
|
|
392
|
+
bom = "\ufeff"
|
|
393
|
+
rest = strings.TrimPrefix(rest, "\ufeff")
|
|
394
|
+
}
|
|
395
|
+
if strings.HasPrefix(rest, "#!") {
|
|
396
|
+
end := strings.IndexByte(rest, '\n')
|
|
397
|
+
if end < 0 {
|
|
398
|
+
return bom + rest + "\n" + preamble
|
|
399
|
+
}
|
|
400
|
+
return bom + rest[:end+1] + preamble + rest[end+1:]
|
|
401
|
+
}
|
|
402
|
+
return bom + preamble + rest
|
|
403
|
+
}
|
|
404
|
+
|
|
380
405
|
// SourceFiles exposes the program's user-authored source files (declaration
|
|
381
406
|
// files filtered out).
|
|
382
407
|
func (p *Program) SourceFiles() []*ast.SourceFile {
|
|
383
408
|
out := make([]*ast.SourceFile, 0)
|
|
409
|
+
if p == nil || p.TSProgram == nil {
|
|
410
|
+
return out
|
|
411
|
+
}
|
|
384
412
|
for _, f := range p.TSProgram.SourceFiles() {
|
|
385
413
|
if f.IsDeclarationFile {
|
|
386
414
|
continue
|
package/driver/rewrite.go
CHANGED
|
@@ -316,26 +316,143 @@ func matchParen(text string, pos int) (int, bool) {
|
|
|
316
316
|
return 0, false
|
|
317
317
|
}
|
|
318
318
|
depth := 1
|
|
319
|
+
lastSignificant := byte('(')
|
|
319
320
|
for i := pos + 1; i < len(text); i++ {
|
|
320
|
-
|
|
321
|
+
ch := text[i]
|
|
322
|
+
switch ch {
|
|
323
|
+
case ' ', '\t', '\n', '\r', '\f':
|
|
324
|
+
continue
|
|
321
325
|
case '(':
|
|
322
326
|
depth++
|
|
327
|
+
lastSignificant = ch
|
|
323
328
|
case ')':
|
|
324
329
|
depth--
|
|
325
330
|
if depth == 0 {
|
|
326
331
|
return i, true
|
|
327
332
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
333
|
+
lastSignificant = ch
|
|
334
|
+
case '"', '\'':
|
|
335
|
+
end, ok := skipQuoted(text, i, ch)
|
|
336
|
+
if !ok {
|
|
337
|
+
return 0, false
|
|
338
|
+
}
|
|
339
|
+
i = end
|
|
340
|
+
lastSignificant = 'x'
|
|
341
|
+
case '`':
|
|
342
|
+
end, ok := skipTemplate(text, i)
|
|
343
|
+
if !ok {
|
|
344
|
+
return 0, false
|
|
345
|
+
}
|
|
346
|
+
i = end
|
|
347
|
+
lastSignificant = 'x'
|
|
348
|
+
case '/':
|
|
349
|
+
if i+1 < len(text) {
|
|
350
|
+
switch text[i+1] {
|
|
351
|
+
case '/':
|
|
352
|
+
i = skipLineComment(text, i+2)
|
|
353
|
+
continue
|
|
354
|
+
case '*':
|
|
355
|
+
end, ok := skipBlockComment(text, i+2)
|
|
356
|
+
if !ok {
|
|
357
|
+
return 0, false
|
|
358
|
+
}
|
|
359
|
+
i = end
|
|
360
|
+
continue
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if canStartRegexLiteral(lastSignificant) {
|
|
364
|
+
end, ok := skipRegexLiteral(text, i)
|
|
365
|
+
if !ok {
|
|
366
|
+
return 0, false
|
|
334
367
|
}
|
|
335
|
-
|
|
368
|
+
i = end
|
|
369
|
+
lastSignificant = 'x'
|
|
370
|
+
continue
|
|
371
|
+
}
|
|
372
|
+
lastSignificant = ch
|
|
373
|
+
default:
|
|
374
|
+
lastSignificant = ch
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return 0, false
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
func skipQuoted(text string, pos int, quote byte) (int, bool) {
|
|
381
|
+
for i := pos + 1; i < len(text); i++ {
|
|
382
|
+
switch text[i] {
|
|
383
|
+
case '\\':
|
|
384
|
+
i++
|
|
385
|
+
case quote:
|
|
386
|
+
return i, true
|
|
387
|
+
case '\n', '\r':
|
|
388
|
+
return 0, false
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return 0, false
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
func skipTemplate(text string, pos int) (int, bool) {
|
|
395
|
+
for i := pos + 1; i < len(text); i++ {
|
|
396
|
+
switch text[i] {
|
|
397
|
+
case '\\':
|
|
398
|
+
i++
|
|
399
|
+
case '`':
|
|
400
|
+
return i, true
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return 0, false
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
func skipLineComment(text string, pos int) int {
|
|
407
|
+
for i := pos; i < len(text); i++ {
|
|
408
|
+
if text[i] == '\n' || text[i] == '\r' {
|
|
409
|
+
return i
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return len(text) - 1
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
func skipBlockComment(text string, pos int) (int, bool) {
|
|
416
|
+
for i := pos; i+1 < len(text); i++ {
|
|
417
|
+
if text[i] == '*' && text[i+1] == '/' {
|
|
418
|
+
return i + 1, true
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return 0, false
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
func canStartRegexLiteral(previous byte) bool {
|
|
425
|
+
return strings.ContainsRune("([{=,:;!&|?+-*~^<>%", rune(previous))
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
func skipRegexLiteral(text string, pos int) (int, bool) {
|
|
429
|
+
inClass := false
|
|
430
|
+
for i := pos + 1; i < len(text); i++ {
|
|
431
|
+
switch text[i] {
|
|
432
|
+
case '\\':
|
|
433
|
+
i++
|
|
434
|
+
case '[':
|
|
435
|
+
inClass = true
|
|
436
|
+
case ']':
|
|
437
|
+
inClass = false
|
|
438
|
+
case '/':
|
|
439
|
+
if inClass {
|
|
440
|
+
continue
|
|
441
|
+
}
|
|
442
|
+
for i+1 < len(text) && isRegexFlag(text[i+1]) {
|
|
443
|
+
i++
|
|
336
444
|
}
|
|
337
|
-
i
|
|
445
|
+
return i, true
|
|
446
|
+
case '\n', '\r':
|
|
447
|
+
return 0, false
|
|
338
448
|
}
|
|
339
449
|
}
|
|
340
450
|
return 0, false
|
|
341
451
|
}
|
|
452
|
+
|
|
453
|
+
func isRegexFlag(ch byte) bool {
|
|
454
|
+
return ch == '_' ||
|
|
455
|
+
ch == '$' ||
|
|
456
|
+
unicode.IsLetter(rune(ch)) ||
|
|
457
|
+
unicode.IsDigit(rune(ch))
|
|
458
|
+
}
|
package/go.mod
CHANGED
|
@@ -14,6 +14,7 @@ replace (
|
|
|
14
14
|
github.com/microsoft/typescript-go/shim/core => ./shim/core
|
|
15
15
|
github.com/microsoft/typescript-go/shim/diagnosticwriter => ./shim/diagnosticwriter
|
|
16
16
|
github.com/microsoft/typescript-go/shim/parser => ./shim/parser
|
|
17
|
+
github.com/microsoft/typescript-go/shim/printer => ./shim/printer
|
|
17
18
|
github.com/microsoft/typescript-go/shim/scanner => ./shim/scanner
|
|
18
19
|
github.com/microsoft/typescript-go/shim/tsoptions => ./shim/tsoptions
|
|
19
20
|
github.com/microsoft/typescript-go/shim/tspath => ./shim/tspath
|
|
@@ -29,6 +30,7 @@ require (
|
|
|
29
30
|
github.com/microsoft/typescript-go/shim/compiler v0.0.0
|
|
30
31
|
github.com/microsoft/typescript-go/shim/core v0.0.0
|
|
31
32
|
github.com/microsoft/typescript-go/shim/diagnosticwriter v0.0.0
|
|
33
|
+
github.com/microsoft/typescript-go/shim/printer v0.0.0
|
|
32
34
|
github.com/microsoft/typescript-go/shim/scanner v0.0.0
|
|
33
35
|
github.com/microsoft/typescript-go/shim/tsoptions v0.0.0
|
|
34
36
|
github.com/microsoft/typescript-go/shim/tspath v0.0.0
|
package/lib/TtscCompiler.js
CHANGED
|
@@ -1,41 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
6
|
exports.TtscCompiler = void 0;
|
|
37
|
-
const
|
|
38
|
-
const
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
39
9
|
const compileProjectInMemory_1 = require("./compiler/internal/compileProjectInMemory");
|
|
40
10
|
const resolveProjectConfig_1 = require("./compiler/internal/project/resolveProjectConfig");
|
|
41
11
|
const resolveBinary_1 = require("./compiler/internal/resolveBinary");
|
|
@@ -93,6 +63,7 @@ class TtscCompiler {
|
|
|
93
63
|
cacheDir: this.resolvePluginCacheDir(),
|
|
94
64
|
cwd: execution.cwd,
|
|
95
65
|
entries: this.context.plugins,
|
|
66
|
+
projectRoot: execution.projectRoot,
|
|
96
67
|
tsconfig: execution.tsconfig,
|
|
97
68
|
});
|
|
98
69
|
return loaded.nativePlugins.map((plugin) => plugin.binary);
|
|
@@ -118,9 +89,9 @@ class TtscCompiler {
|
|
|
118
89
|
const envCacheDir = this.context.env?.TTSC_CACHE_DIR ?? process.env.TTSC_CACHE_DIR;
|
|
119
90
|
const projectRoot = this.resolveCleanProjectRoot();
|
|
120
91
|
return removeExistingDirectories([
|
|
121
|
-
...(envCacheDir ? [
|
|
122
|
-
|
|
123
|
-
|
|
92
|
+
...(envCacheDir ? [node_path_1.default.resolve(envCacheDir, "plugins")] : []),
|
|
93
|
+
node_path_1.default.join(projectRoot, "node_modules", ".ttsc"),
|
|
94
|
+
node_path_1.default.join(projectRoot, ".ttsc"),
|
|
124
95
|
]);
|
|
125
96
|
}
|
|
126
97
|
/**
|
|
@@ -175,7 +146,9 @@ class TtscCompiler {
|
|
|
175
146
|
});
|
|
176
147
|
return {
|
|
177
148
|
cwd,
|
|
178
|
-
projectRoot:
|
|
149
|
+
projectRoot: this.context.projectRoot
|
|
150
|
+
? node_path_1.default.resolve(cwd, this.context.projectRoot)
|
|
151
|
+
: node_path_1.default.dirname(tsconfig),
|
|
179
152
|
tsconfig,
|
|
180
153
|
};
|
|
181
154
|
}
|
|
@@ -191,15 +164,15 @@ class TtscCompiler {
|
|
|
191
164
|
}
|
|
192
165
|
}
|
|
193
166
|
resolveCwd() {
|
|
194
|
-
return
|
|
167
|
+
return node_path_1.default.resolve(this.context.cwd ?? process.cwd());
|
|
195
168
|
}
|
|
196
169
|
resolveCacheDir() {
|
|
197
170
|
if (!this.context.cacheDir) {
|
|
198
171
|
return undefined;
|
|
199
172
|
}
|
|
200
|
-
return
|
|
173
|
+
return node_path_1.default.isAbsolute(this.context.cacheDir)
|
|
201
174
|
? this.context.cacheDir
|
|
202
|
-
:
|
|
175
|
+
: node_path_1.default.resolve(this.resolveCwd(), this.context.cacheDir);
|
|
203
176
|
}
|
|
204
177
|
resolvePluginCacheDir() {
|
|
205
178
|
return this.resolveCacheDir() ?? this.context.env?.TTSC_CACHE_DIR;
|
|
@@ -209,10 +182,10 @@ exports.TtscCompiler = TtscCompiler;
|
|
|
209
182
|
function removeExistingDirectories(directories) {
|
|
210
183
|
const removed = [];
|
|
211
184
|
for (const directory of [...new Set(directories)]) {
|
|
212
|
-
if (!
|
|
185
|
+
if (!node_fs_1.default.existsSync(directory)) {
|
|
213
186
|
continue;
|
|
214
187
|
}
|
|
215
|
-
|
|
188
|
+
node_fs_1.default.rmSync(directory, { recursive: true, force: true });
|
|
216
189
|
removed.push(directory);
|
|
217
190
|
}
|
|
218
191
|
return removed;
|
|
@@ -241,8 +214,11 @@ function runTransformation(task) {
|
|
|
241
214
|
}
|
|
242
215
|
function toCompilerResult(project) {
|
|
243
216
|
const { output, result } = project;
|
|
244
|
-
if (result.status === 0 && result.diagnostics
|
|
217
|
+
if (result.status === 0 && !hasErrorDiagnostics(result.diagnostics)) {
|
|
245
218
|
return {
|
|
219
|
+
...(result.diagnostics.length === 0
|
|
220
|
+
? {}
|
|
221
|
+
: { diagnostics: result.diagnostics }),
|
|
246
222
|
output,
|
|
247
223
|
type: "success",
|
|
248
224
|
};
|
|
@@ -267,8 +243,11 @@ function createProcessDiagnostic(result) {
|
|
|
267
243
|
}
|
|
268
244
|
function toCompilerTransformation(project) {
|
|
269
245
|
const { result, typescript } = project;
|
|
270
|
-
if (result.status === 0 && result.diagnostics
|
|
246
|
+
if (result.status === 0 && !hasErrorDiagnostics(result.diagnostics)) {
|
|
271
247
|
return {
|
|
248
|
+
...(result.diagnostics.length === 0
|
|
249
|
+
? {}
|
|
250
|
+
: { diagnostics: result.diagnostics }),
|
|
272
251
|
type: "success",
|
|
273
252
|
typescript,
|
|
274
253
|
};
|
|
@@ -281,6 +260,9 @@ function toCompilerTransformation(project) {
|
|
|
281
260
|
typescript,
|
|
282
261
|
};
|
|
283
262
|
}
|
|
263
|
+
function hasErrorDiagnostics(diagnostics) {
|
|
264
|
+
return diagnostics.some((diagnostic) => diagnostic.category === "error");
|
|
265
|
+
}
|
|
284
266
|
function normalizeError(error) {
|
|
285
267
|
if (!(error instanceof Error)) {
|
|
286
268
|
return error;
|
package/lib/TtscCompiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscCompiler.js","sourceRoot":"","sources":["../src/TtscCompiler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TtscCompiler.js","sourceRoot":"","sources":["../src/TtscCompiler.ts"],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