@ttsc/wasm 0.33.0 → 0.34.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.
Files changed (52) hide show
  1. package/dist/.ttsc-wasm-build.json +65 -41
  2. package/dist/go.mod +2 -3
  3. package/dist/ttsc.wasm +2 -2
  4. package/go.mod +2 -3
  5. package/go.sum +4 -4
  6. package/host/api.go +4 -3
  7. package/host/fountain.go +5 -5
  8. package/package.json +1 -1
  9. package/shim-vendor/shim/ast/enums_gen.go +1 -0
  10. package/shim-vendor/shim/ast/go.mod +2 -2
  11. package/shim-vendor/shim/ast/go.sum +4 -4
  12. package/shim-vendor/shim/ast/neutral.go +141 -0
  13. package/shim-vendor/shim/astnav/go.mod +2 -2
  14. package/shim-vendor/shim/astnav/go.sum +4 -4
  15. package/shim-vendor/shim/bundled/go.mod +2 -2
  16. package/shim-vendor/shim/bundled/go.sum +4 -4
  17. package/shim-vendor/shim/checker/go.mod +2 -2
  18. package/shim-vendor/shim/checker/go.sum +4 -4
  19. package/shim-vendor/shim/compiler/go.mod +2 -2
  20. package/shim-vendor/shim/compiler/go.sum +4 -4
  21. package/shim-vendor/shim/compiler/neutral.go +213 -0
  22. package/shim-vendor/shim/core/go.mod +2 -2
  23. package/shim-vendor/shim/core/go.sum +4 -4
  24. package/shim-vendor/shim/diagnosticwriter/go.mod +2 -2
  25. package/shim-vendor/shim/diagnosticwriter/go.sum +4 -4
  26. package/shim-vendor/shim/lsp/go.mod +2 -2
  27. package/shim-vendor/shim/lsp/go.sum +4 -4
  28. package/shim-vendor/shim/parser/go.mod +2 -2
  29. package/shim-vendor/shim/parser/go.sum +4 -4
  30. package/shim-vendor/shim/printer/go.mod +2 -2
  31. package/shim-vendor/shim/printer/go.sum +4 -4
  32. package/shim-vendor/shim/scanner/go.mod +2 -2
  33. package/shim-vendor/shim/scanner/go.sum +4 -4
  34. package/shim-vendor/shim/stringutil/go.mod +1 -1
  35. package/shim-vendor/shim/stringutil/go.sum +2 -2
  36. package/shim-vendor/shim/stringutil/shim.go +15 -0
  37. package/shim-vendor/shim/transformers/go.mod +2 -2
  38. package/shim-vendor/shim/transformers/go.sum +4 -4
  39. package/shim-vendor/shim/tsoptions/go.mod +2 -2
  40. package/shim-vendor/shim/tsoptions/go.sum +4 -4
  41. package/shim-vendor/shim/tsoptions/neutral.go +56 -0
  42. package/shim-vendor/shim/tspath/go.mod +1 -1
  43. package/shim-vendor/shim/tspath/go.sum +2 -2
  44. package/shim-vendor/shim/tspath/neutral.go +150 -0
  45. package/shim-vendor/shim/tspath/typed_paths.go +266 -0
  46. package/shim-vendor/shim/vfs/cachedvfs/go.mod +2 -2
  47. package/shim-vendor/shim/vfs/cachedvfs/go.sum +4 -4
  48. package/shim-vendor/shim/vfs/go.mod +2 -2
  49. package/shim-vendor/shim/vfs/go.sum +4 -4
  50. package/shim-vendor/shim/vfs/neutral.go +20 -0
  51. package/shim-vendor/shim/vfs/osvfs/go.mod +2 -2
  52. package/shim-vendor/shim/vfs/osvfs/go.sum +4 -4
@@ -1,11 +1,11 @@
1
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 h1:nxP4pPoyqOAgX8lYDFCfl3DyKeXErCvSvhcyzwGV9CE=
2
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
1
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
2
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
3
3
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4
4
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5
5
  github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6
6
  github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
7
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
8
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
7
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
8
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
9
9
  github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
10
10
  github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
11
11
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/printer
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
6
6
 
7
7
  require (
8
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 // indirect
8
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
9
9
  github.com/klauspost/cpuid/v2 v2.2.10 // indirect
10
10
  github.com/zeebo/xxh3 v1.1.0 // indirect
11
11
  golang.org/x/sync v0.21.0 // indirect
@@ -1,11 +1,11 @@
1
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 h1:nxP4pPoyqOAgX8lYDFCfl3DyKeXErCvSvhcyzwGV9CE=
2
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
1
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
2
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
3
3
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4
4
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5
5
  github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6
6
  github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
7
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
8
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
7
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
8
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
9
9
  github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
10
10
  github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
11
11
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/scanner
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
6
6
 
7
7
  require (
8
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 // indirect
8
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
9
9
  github.com/klauspost/cpuid/v2 v2.2.10 // indirect
10
10
  github.com/zeebo/xxh3 v1.1.0 // indirect
11
11
  golang.org/x/sync v0.21.0 // indirect
@@ -1,11 +1,11 @@
1
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 h1:nxP4pPoyqOAgX8lYDFCfl3DyKeXErCvSvhcyzwGV9CE=
2
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
1
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
2
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
3
3
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4
4
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5
5
  github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6
6
  github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
7
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
8
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
7
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
8
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
9
9
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
10
10
  github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
11
11
  github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
@@ -2,4 +2,4 @@ module github.com/microsoft/typescript-go/shim/stringutil
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
@@ -1,2 +1,2 @@
1
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
2
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
1
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
2
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
@@ -32,6 +32,9 @@ const ComparisonEqual = stringutil.ComparisonEqual
32
32
  const ComparisonGreaterThan = stringutil.ComparisonGreaterThan
33
33
  const ComparisonLessThan = stringutil.ComparisonLessThan
34
34
 
35
+ //go:linkname ContainsNonASCII github.com/microsoft/typescript-go/internal/stringutil.ContainsNonASCII
36
+ func ContainsNonASCII(s string) bool
37
+
35
38
  //go:linkname DecodeJSStringRune github.com/microsoft/typescript-go/internal/stringutil.DecodeJSStringRune
36
39
  func DecodeJSStringRune(s string) (rune, int)
37
40
 
@@ -89,6 +92,12 @@ func IsOctalDigit(ch rune) bool
89
92
  //go:linkname IsSurrogate github.com/microsoft/typescript-go/internal/stringutil.IsSurrogate
90
93
  func IsSurrogate(ch rune) bool
91
94
 
95
+ //go:linkname IsUnicodeIdentifierPart github.com/microsoft/typescript-go/internal/stringutil.IsUnicodeIdentifierPart
96
+ func IsUnicodeIdentifierPart(ch rune) bool
97
+
98
+ //go:linkname IsUnicodeIdentifierStart github.com/microsoft/typescript-go/internal/stringutil.IsUnicodeIdentifierStart
99
+ func IsUnicodeIdentifierStart(ch rune) bool
100
+
92
101
  //go:linkname IsWhiteSpaceLike github.com/microsoft/typescript-go/internal/stringutil.IsWhiteSpaceLike
93
102
  func IsWhiteSpaceLike(ch rune) bool
94
103
 
@@ -112,6 +121,12 @@ const SurrogateLowStart = stringutil.SurrogateLowStart
112
121
  //go:linkname SurrogatePairToCodePoint github.com/microsoft/typescript-go/internal/stringutil.SurrogatePairToCodePoint
113
122
  func SurrogatePairToCodePoint(high rune, low rune) rune
114
123
 
124
+ //go:linkname ToLowerJS github.com/microsoft/typescript-go/internal/stringutil.ToLowerJS
125
+ func ToLowerJS(str string) string
126
+
127
+ //go:linkname ToUpperJS github.com/microsoft/typescript-go/internal/stringutil.ToUpperJS
128
+ func ToUpperJS(str string) string
129
+
115
130
  //go:linkname TruncateByRunes github.com/microsoft/typescript-go/internal/stringutil.TruncateByRunes
116
131
  func TruncateByRunes(str string, maxLength int) string
117
132
 
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/transformers
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
6
6
 
7
7
  require (
8
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 // indirect
8
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
9
9
  github.com/klauspost/cpuid/v2 v2.2.10 // indirect
10
10
  github.com/zeebo/xxh3 v1.1.0 // indirect
11
11
  golang.org/x/sync v0.21.0 // indirect
@@ -1,11 +1,11 @@
1
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 h1:nxP4pPoyqOAgX8lYDFCfl3DyKeXErCvSvhcyzwGV9CE=
2
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
1
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
2
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
3
3
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4
4
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5
5
  github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6
6
  github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
7
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
8
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
7
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
8
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
9
9
  github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
10
10
  github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
11
11
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
@@ -2,10 +2,10 @@ module github.com/microsoft/typescript-go/shim/tsoptions
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
6
6
 
7
7
  require (
8
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 // indirect
8
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
9
9
  github.com/klauspost/cpuid/v2 v2.2.10 // indirect
10
10
  github.com/zeebo/xxh3 v1.1.0 // indirect
11
11
  golang.org/x/sync v0.21.0 // indirect
@@ -1,11 +1,11 @@
1
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6 h1:nxP4pPoyqOAgX8lYDFCfl3DyKeXErCvSvhcyzwGV9CE=
2
- github.com/go-json-experiment/json v0.0.0-20260601182631-00ed12fed2a6/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
1
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 h1:KZaTBSyshWX3MP5jukJcNSuXDQTO+rNpt0J564dX/eg=
2
+ github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg=
3
3
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4
4
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5
5
  github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6
6
  github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
7
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
8
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
7
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
8
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
9
9
  github.com/peter-evans/patience v0.3.0 h1:rX0JdJeepqdQl1Sk9c9uvorjYYzL2TfgLX1adqYm9cA=
10
10
  github.com/peter-evans/patience v0.3.0/go.mod h1:Kmxu5sY1NmBLFSStvXjX1wS9mIv7wMcP/ubucyMOAu0=
11
11
  github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
@@ -0,0 +1,56 @@
1
+ package tsoptions
2
+
3
+ import (
4
+ innertsoptions "github.com/microsoft/typescript-go/internal/tsoptions"
5
+ innervfs "github.com/microsoft/typescript-go/internal/vfs"
6
+ )
7
+
8
+ // Version-neutral command-line and config parsing entry points.
9
+ //
10
+ // TypeScript 7.0 parses through a host that carries the working directory,
11
+ // while TypeScript 7.1 takes the filesystem and directory separately and asks
12
+ // its config host whether a content-mapper package may run. Code that must
13
+ // compile on both compiler targets calls these functions, which the 7.1 bridge
14
+ // declares with identical signatures.
15
+
16
+ // parseConfigHost is the 7.0 ParseConfigHost over a filesystem and the
17
+ // directory relative paths resolve against.
18
+ type parseConfigHost struct {
19
+ fs innervfs.FS
20
+ currentDirectory string
21
+ }
22
+
23
+ func (h parseConfigHost) FS() innervfs.FS { return h.fs }
24
+ func (h parseConfigHost) GetCurrentDirectory() string { return h.currentDirectory }
25
+
26
+ // NewParseConfigHost returns the config-parsing host over fs. TypeScript 7.0
27
+ // resolves relative paths against currentDirectory; TypeScript 7.1 resolves
28
+ // them against the config file and leaves content-mapper authorization to the
29
+ // runExternalCode option.
30
+ //
31
+ // @evidence contracts/common.md#principled-implementation Supplies 7.0's ParseConfigHost contract, a filesystem and a current directory, which ttsc's compiler host satisfied before.
32
+ // @evidence contracts/common.md#clear-and-simple-design A two-field value implements the two-method interface.
33
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts The host only reports its inputs; parsing stays with the compiler.
34
+ // @evidence contracts/common.md#meaningful-documentation Native prose states each target's use of currentDirectory.
35
+ // @evidence contracts/portability.md#os-neutral-implementation The supplied FS owns every native operation; the host adds none.
36
+ // @evidenceExclude contracts/performance.md#efficient-algorithms Construction assigns two fields.
37
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work Each call returns a fresh value.
38
+ // @evidence contracts/performance.md#bound-retention-and-release-resources The value retains fs and the directory string for the caller's lifetime and owns no handle.
39
+ func NewParseConfigHost(fs innervfs.FS, currentDirectory string) innertsoptions.ParseConfigHost {
40
+ return parseConfigHost{fs: fs, currentDirectory: currentDirectory}
41
+ }
42
+
43
+ // ParseCommandLineAt parses tsc arguments, resolving relative values against
44
+ // currentDirectory, the directory the arguments were given in.
45
+ //
46
+ // @evidence contracts/common.md#principled-implementation Calls ParseCommandLine with a host whose current directory is the argument base, as ttsc's driver did with a host built at that directory.
47
+ // @evidence contracts/common.md#clear-and-simple-design One parser call keeps the target difference inside the shim.
48
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts Argument parsing remains the compiler's.
49
+ // @evidence contracts/common.md#meaningful-documentation Native prose states which directory relative values use.
50
+ // @evidence contracts/portability.md#os-neutral-implementation Response-file reads go through the supplied FS.
51
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the argument scan.
52
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
53
+ // @evidence contracts/performance.md#bound-retention-and-release-resources The returned command line is caller-owned; the temporary host is released on return.
54
+ func ParseCommandLineAt(args []string, fs innervfs.FS, currentDirectory string) *innertsoptions.ParsedCommandLine {
55
+ return innertsoptions.ParseCommandLine(args, NewParseConfigHost(fs, currentDirectory))
56
+ }
@@ -2,4 +2,4 @@ module github.com/microsoft/typescript-go/shim/tspath
2
2
 
3
3
  go 1.26
4
4
 
5
- require github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063
5
+ require github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b
@@ -1,6 +1,6 @@
1
1
  github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2
2
  github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063 h1:UUVrjTrD+7nkVvkJTjxwA5+SaZ5n1uyAffm2zX2gn+o=
4
- github.com/microsoft/typescript-go v0.0.0-20260610182825-7fc57c005063/go.mod h1:s3yhRRZ7nzSZaiKicku520Tj9Mvewr9y2UtrvpwOmDE=
3
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b h1:IgfPOv9pzPZ1sbyRHOKu3UCvhaTS0IyrkTcs6JLPqhY=
4
+ github.com/microsoft/typescript-go v0.0.0-20260708042240-2bd066d87f5b/go.mod h1:gV4G6M8xxLNqQSRHiFOgKHlY+5YJgYPM6QwFLWllC+8=
5
5
  gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
6
6
  gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
@@ -0,0 +1,150 @@
1
+ package tspath
2
+
3
+ import innertspath "github.com/microsoft/typescript-go/internal/tspath"
4
+
5
+ // Version-neutral path operations.
6
+ //
7
+ // TypeScript 7.1 spells these path operations as methods of
8
+ // its typed paths and CaseSensitivity. TypeScript 7.0 spells the same values as
9
+ // strings and booleans, which cannot carry methods. Code that must compile on
10
+ // both compiler targets calls these functions, which the 7.1 bridge declares
11
+ // with identical signatures over its methods. Here each maps to the 7.0 path
12
+ // function that ttsc's own 7.0 code used for the same purpose.
13
+
14
+ func compareOptions(caseSensitivity CaseSensitivity) innertspath.ComparePathsOptions {
15
+ return innertspath.ComparePathsOptions{UseCaseSensitiveFileNames: caseSensitivity}
16
+ }
17
+
18
+ // Canonicalize applies the case policy to text used as a path identity: an
19
+ // insensitive policy lowercases it the way file names compare.
20
+ //
21
+ // @evidence contracts/common.md#principled-implementation GetCanonicalFileName applies the same file-name lowercasing under an insensitive policy.
22
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
23
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No case folding is reimplemented here.
24
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the insensitive-policy effect.
25
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Text canonicalization performs no native filesystem, path or process operation; the policy is supplied, not read from the OS.
26
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the single pass over the text.
27
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
28
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned string.
29
+ func Canonicalize(caseSensitivity CaseSensitivity, text string) string {
30
+ return innertspath.GetCanonicalFileName(text, caseSensitivity)
31
+ }
32
+
33
+ // CompareFilePaths orders two rooted, normalized file paths under the case
34
+ // policy, returning a negative, zero or positive result.
35
+ //
36
+ // @evidence contracts/common.md#principled-implementation ComparePaths compares the two paths under the supplied case policy; with rooted, normalized operands it needs no current directory.
37
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
38
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No comparison is reimplemented here.
39
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the operand requirements and the result sign.
40
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Comparison reads its arguments only; it opens no file and calls no process.
41
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the comparison over the path text.
42
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
43
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
44
+ func CompareFilePaths(caseSensitivity CaseSensitivity, a RootedFilePath, b RootedFilePath) int {
45
+ return innertspath.ComparePaths(a, b, compareOptions(caseSensitivity))
46
+ }
47
+
48
+ // ContainsPathWith reports whether child is parent or lies below it under the
49
+ // case policy. Both paths must be rooted and normalized.
50
+ //
51
+ // @evidence contracts/common.md#principled-implementation ContainsPath tests containment under the supplied case policy; with rooted operands it needs no current directory.
52
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
53
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No containment test is reimplemented here.
54
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the inclusive meaning and operand requirements.
55
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Containment reads its arguments only; it opens no file and calls no process.
56
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the prefix comparison.
57
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
58
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing.
59
+ func ContainsPathWith(caseSensitivity CaseSensitivity, parent RootedDirectoryPath, child RootedPath) bool {
60
+ return innertspath.ContainsPath(parent, child, compareOptions(caseSensitivity))
61
+ }
62
+
63
+ // RelativePathFromFile returns to relative to the directory of from. The
64
+ // boolean is false when the two paths share no root to relate them through.
65
+ //
66
+ // @evidence contracts/common.md#principled-implementation GetRelativePathFromFile relativizes to against from's directory; 7.0 returns the absolute target when the roots differ, which is reported as false.
67
+ // @evidence contracts/common.md#clear-and-simple-design Two upstream calls keep the target difference inside the shim.
68
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts An unrelatable target is reported rather than returned as a relative path.
69
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the base directory and the false result.
70
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Relativization reads its arguments only; it opens no file and calls no process.
71
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the component walk.
72
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
73
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
74
+ func RelativePathFromFile(caseSensitivity CaseSensitivity, from RootedFilePath, to RootedFilePath) (RelativePath, bool) {
75
+ relative := innertspath.GetRelativePathFromFile(from, to, compareOptions(caseSensitivity))
76
+ return relative, !innertspath.IsRootedDiskPath(relative)
77
+ }
78
+
79
+ // RelativeModuleSpecifier spells a relative path as a module specifier, adding
80
+ // the leading "./" a bare relative path needs.
81
+ //
82
+ // @evidence contracts/common.md#principled-implementation EnsurePathIsNonModuleName adds the "./" prefix a relative module specifier needs.
83
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
84
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No specifier spelling is reimplemented here.
85
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the added "./" prefix.
86
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation The conversion reads its argument only.
87
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the prefix check.
88
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
89
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned specifier.
90
+ func RelativeModuleSpecifier(path RelativePath) ModuleSpecifier {
91
+ return innertspath.EnsurePathIsNonModuleName(path)
92
+ }
93
+
94
+ // ResolveFile resolves path against a rooted directory and normalizes the
95
+ // result. directory must not be empty.
96
+ //
97
+ // @evidence contracts/common.md#principled-implementation GetNormalizedAbsolutePath combines path with the directory and normalizes it, the resolution 7.1 performs.
98
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
99
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No resolution is reimplemented here.
100
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the normalization and the empty-directory precondition.
101
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Resolution manipulates path text only; it reads no filesystem.
102
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the normalization pass.
103
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
104
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
105
+ func ResolveFile(directory RootedDirectoryPath, path string) RootedFilePath {
106
+ return innertspath.GetNormalizedAbsolutePath(path, directory)
107
+ }
108
+
109
+ // FileBaseName returns the last component of a rooted file path.
110
+ //
111
+ // @evidence contracts/common.md#principled-implementation GetBaseFileName returns the path's last component.
112
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
113
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No component split is reimplemented here.
114
+ // @evidence contracts/common.md#meaningful-documentation Native prose states which component is returned.
115
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation The split reads its argument only.
116
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the separator scan.
117
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
118
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned name.
119
+ func FileBaseName(fileName RootedFilePath) string {
120
+ return innertspath.GetBaseFileName(fileName)
121
+ }
122
+
123
+ // FileDirectory returns the rooted directory that contains a file.
124
+ //
125
+ // @evidence contracts/common.md#principled-implementation GetDirectoryPath returns the path without its last component.
126
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
127
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No directory split is reimplemented here.
128
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the returned directory.
129
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation The split reads its argument only.
130
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the separator scan.
131
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
132
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned directory.
133
+ func FileDirectory(fileName RootedFilePath) RootedDirectoryPath {
134
+ return innertspath.GetDirectoryPath(fileName)
135
+ }
136
+
137
+ // RelativePathFromDirectoryWith returns path relative to directory under the
138
+ // case policy. A path on another root comes back absolute.
139
+ //
140
+ // @evidence contracts/common.md#principled-implementation Calls GetRelativePathFromDirectory with the case policy and the directory as its current directory, as ttsc's graph dump called it on 7.0.
141
+ // @evidence contracts/common.md#clear-and-simple-design One upstream call keeps the target difference inside the shim.
142
+ // @evidence contracts/common.md#prohibited-implementation-shortcuts No relative-path computation is reimplemented here.
143
+ // @evidence contracts/common.md#meaningful-documentation Native prose states the result for different roots.
144
+ // @evidenceExclude contracts/portability.md#os-neutral-implementation Relativization reads its arguments only; it opens no file and calls no process.
145
+ // @evidenceExclude contracts/performance.md#efficient-algorithms The compiler owns the component walk.
146
+ // @evidenceExclude contracts/performance.md#reuse-equivalent-work The function coordinates no shared work.
147
+ // @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The function retains nothing beyond the returned path.
148
+ func RelativePathFromDirectoryWith(caseSensitivity CaseSensitivity, directory string, path string) string {
149
+ return innertspath.GetRelativePathFromDirectory(directory, path, innertspath.ComparePathsOptions{UseCaseSensitiveFileNames: caseSensitivity, CurrentDirectory: directory})
150
+ }