typia 13.0.0-dev.20260507 → 13.0.0-dev.20260510
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/executable/TypiaGenerateWizard.js +54 -45
- package/lib/executable/TypiaGenerateWizard.js.map +1 -1
- package/lib/executable/TypiaGenerateWizard2.mjs +64 -55
- package/lib/executable/TypiaGenerateWizard2.mjs.map +1 -1
- package/lib/executable/typia.d.ts +1 -1
- package/lib/executable/typia.js +1 -14
- package/lib/executable/typia.js.map +1 -1
- package/lib/executable/typia2.mjs +1 -16
- package/lib/executable/typia2.mjs.map +1 -1
- package/native/adapter/adapter.go +3 -3
- package/native/go.mod +0 -4
- package/native/internal/printer/printer.go +229 -0
- package/package.json +11 -8
- package/src/executable/TypiaGenerateWizard.ts +25 -23
- package/src/executable/typia.ts +1 -13
- package/lib/_virtual/ArgumentParser.mjs +0 -4
- package/lib/_virtual/ArgumentParser.mjs.map +0 -1
- package/lib/_virtual/CommandExecutor.mjs +0 -4
- package/lib/_virtual/CommandExecutor.mjs.map +0 -1
- package/lib/_virtual/FileRetriever.mjs +0 -4
- package/lib/_virtual/FileRetriever.mjs.map +0 -1
- package/lib/_virtual/PackageManager.mjs +0 -4
- package/lib/_virtual/PackageManager.mjs.map +0 -1
- package/lib/_virtual/PluginConfigurator.mjs +0 -4
- package/lib/_virtual/PluginConfigurator.mjs.map +0 -1
- package/lib/_virtual/TypiaSetupWizard.mjs +0 -4
- package/lib/_virtual/TypiaSetupWizard.mjs.map +0 -1
- package/lib/executable/TypiaSetupWizard.d.ts +0 -7
- package/lib/executable/TypiaSetupWizard.js +0 -133
- package/lib/executable/TypiaSetupWizard.js.map +0 -1
- package/lib/executable/TypiaSetupWizard.mjs +0 -3
- package/lib/executable/TypiaSetupWizard.mjs.map +0 -1
- package/lib/executable/TypiaSetupWizard2.mjs +0 -144
- package/lib/executable/TypiaSetupWizard2.mjs.map +0 -1
- package/lib/executable/setup/ArgumentParser.d.ts +0 -7
- package/lib/executable/setup/ArgumentParser.js +0 -36
- package/lib/executable/setup/ArgumentParser.js.map +0 -1
- package/lib/executable/setup/ArgumentParser.mjs +0 -3
- package/lib/executable/setup/ArgumentParser.mjs.map +0 -1
- package/lib/executable/setup/ArgumentParser2.mjs +0 -41
- package/lib/executable/setup/ArgumentParser2.mjs.map +0 -1
- package/lib/executable/setup/CommandExecutor.d.ts +0 -3
- package/lib/executable/setup/CommandExecutor.js +0 -15
- package/lib/executable/setup/CommandExecutor.js.map +0 -1
- package/lib/executable/setup/CommandExecutor.mjs +0 -3
- package/lib/executable/setup/CommandExecutor.mjs.map +0 -1
- package/lib/executable/setup/CommandExecutor2.mjs +0 -19
- package/lib/executable/setup/CommandExecutor2.mjs.map +0 -1
- package/lib/executable/setup/FileRetriever.d.ts +0 -7
- package/lib/executable/setup/FileRetriever.js +0 -25
- package/lib/executable/setup/FileRetriever.js.map +0 -1
- package/lib/executable/setup/FileRetriever.mjs +0 -3
- package/lib/executable/setup/FileRetriever.mjs.map +0 -1
- package/lib/executable/setup/FileRetriever2.mjs +0 -30
- package/lib/executable/setup/FileRetriever2.mjs.map +0 -1
- package/lib/executable/setup/PackageManager.d.ts +0 -24
- package/lib/executable/setup/PackageManager.js +0 -79
- package/lib/executable/setup/PackageManager.js.map +0 -1
- package/lib/executable/setup/PackageManager.mjs +0 -3
- package/lib/executable/setup/PackageManager.mjs.map +0 -1
- package/lib/executable/setup/PackageManager2.mjs +0 -88
- package/lib/executable/setup/PackageManager2.mjs.map +0 -1
- package/lib/executable/setup/PluginConfigurator.d.ts +0 -4
- package/lib/executable/setup/PluginConfigurator.js +0 -60
- package/lib/executable/setup/PluginConfigurator.js.map +0 -1
- package/lib/executable/setup/PluginConfigurator.mjs +0 -3
- package/lib/executable/setup/PluginConfigurator.mjs.map +0 -1
- package/lib/executable/setup/PluginConfigurator2.mjs +0 -65
- package/lib/executable/setup/PluginConfigurator2.mjs.map +0 -1
- package/native/go.work +0 -20
- package/native/go.work.sum +0 -11
- package/native/shim/printer/go.mod +0 -5
- package/native/shim/printer/shim.go +0 -249
- package/native/third_party/ttsc/driver/host.go +0 -31
- package/native/third_party/ttsc/driver/program.go +0 -466
- package/native/third_party/ttsc/driver/rewrite.go +0 -341
- package/native/third_party/ttsc/go.mod +0 -48
- package/native/third_party/ttsc/go.sum +0 -22
- package/native/third_party/ttsc/shim/ast/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/ast/go.mod +0 -5
- package/native/third_party/ttsc/shim/ast/lint.go +0 -331
- package/native/third_party/ttsc/shim/ast/shim.go +0 -210
- package/native/third_party/ttsc/shim/bundled/extra-shim.json +0 -1
- package/native/third_party/ttsc/shim/bundled/go.mod +0 -5
- package/native/third_party/ttsc/shim/bundled/shim.go +0 -23
- package/native/third_party/ttsc/shim/checker/extra-shim.json +0 -31
- package/native/third_party/ttsc/shim/checker/go.mod +0 -5
- package/native/third_party/ttsc/shim/checker/shim.go +0 -166
- package/native/third_party/ttsc/shim/compiler/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/compiler/go.mod +0 -5
- package/native/third_party/ttsc/shim/compiler/shim.go +0 -65
- package/native/third_party/ttsc/shim/core/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/core/go.mod +0 -5
- package/native/third_party/ttsc/shim/core/shim.go +0 -29
- package/native/third_party/ttsc/shim/diagnosticwriter/go.mod +0 -5
- package/native/third_party/ttsc/shim/diagnosticwriter/lint.go +0 -137
- package/native/third_party/ttsc/shim/diagnosticwriter/shim.go +0 -29
- package/native/third_party/ttsc/shim/parser/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/parser/go.mod +0 -5
- package/native/third_party/ttsc/shim/parser/shim.go +0 -61
- package/native/third_party/ttsc/shim/scanner/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/scanner/go.mod +0 -5
- package/native/third_party/ttsc/shim/scanner/shim.go +0 -134
- package/native/third_party/ttsc/shim/tsoptions/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/tsoptions/go.mod +0 -5
- package/native/third_party/ttsc/shim/tsoptions/shim.go +0 -173
- package/native/third_party/ttsc/shim/tspath/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/tspath/go.mod +0 -5
- package/native/third_party/ttsc/shim/tspath/shim.go +0 -236
- package/native/third_party/ttsc/shim/vfs/cachedvfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/cachedvfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/cachedvfs/shim.go +0 -12
- package/native/third_party/ttsc/shim/vfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/osvfs/extra-shim.json +0 -4
- package/native/third_party/ttsc/shim/vfs/osvfs/go.mod +0 -5
- package/native/third_party/ttsc/shim/vfs/osvfs/shim.go +0 -13
- package/native/third_party/ttsc/shim/vfs/shim.go +0 -22
- package/src/executable/TypiaSetupWizard.ts +0 -167
- package/src/executable/setup/ArgumentParser.ts +0 -42
- package/src/executable/setup/CommandExecutor.ts +0 -8
- package/src/executable/setup/FileRetriever.ts +0 -19
- package/src/executable/setup/PackageManager.ts +0 -87
- package/src/executable/setup/PluginConfigurator.ts +0 -65
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
package checker
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
innerast "github.com/microsoft/typescript-go/internal/ast"
|
|
5
|
-
innerchecker "github.com/microsoft/typescript-go/internal/checker"
|
|
6
|
-
_ "unsafe"
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
type Checker = innerchecker.Checker
|
|
10
|
-
type IndexInfo = innerchecker.IndexInfo
|
|
11
|
-
type Signature = innerchecker.Signature
|
|
12
|
-
type SignatureKind = innerchecker.SignatureKind
|
|
13
|
-
type Type = innerchecker.Type
|
|
14
|
-
type TypeFlags = innerchecker.TypeFlags
|
|
15
|
-
type ObjectFlags = innerchecker.ObjectFlags
|
|
16
|
-
type ElementFlags = innerchecker.ElementFlags
|
|
17
|
-
|
|
18
|
-
const (
|
|
19
|
-
SignatureKindCall = innerchecker.SignatureKindCall
|
|
20
|
-
|
|
21
|
-
TypeFlagsAny = innerchecker.TypeFlagsAny
|
|
22
|
-
TypeFlagsUnknown = innerchecker.TypeFlagsUnknown
|
|
23
|
-
TypeFlagsUndefined = innerchecker.TypeFlagsUndefined
|
|
24
|
-
TypeFlagsNull = innerchecker.TypeFlagsNull
|
|
25
|
-
TypeFlagsVoid = innerchecker.TypeFlagsVoid
|
|
26
|
-
TypeFlagsNever = innerchecker.TypeFlagsNever
|
|
27
|
-
TypeFlagsObject = innerchecker.TypeFlagsObject
|
|
28
|
-
TypeFlagsTemplateLiteral = innerchecker.TypeFlagsTemplateLiteral
|
|
29
|
-
TypeFlagsStringMapping = innerchecker.TypeFlagsStringMapping
|
|
30
|
-
TypeFlagsUnion = innerchecker.TypeFlagsUnion
|
|
31
|
-
TypeFlagsIntersection = innerchecker.TypeFlagsIntersection
|
|
32
|
-
TypeFlagsLiteral = innerchecker.TypeFlagsLiteral
|
|
33
|
-
TypeFlagsStringLiteral = innerchecker.TypeFlagsStringLiteral
|
|
34
|
-
TypeFlagsNumberLiteral = innerchecker.TypeFlagsNumberLiteral
|
|
35
|
-
TypeFlagsBigIntLiteral = innerchecker.TypeFlagsBigIntLiteral
|
|
36
|
-
TypeFlagsBooleanLiteral = innerchecker.TypeFlagsBooleanLiteral
|
|
37
|
-
TypeFlagsStringLike = innerchecker.TypeFlagsStringLike
|
|
38
|
-
TypeFlagsNumberLike = innerchecker.TypeFlagsNumberLike
|
|
39
|
-
TypeFlagsBigIntLike = innerchecker.TypeFlagsBigIntLike
|
|
40
|
-
TypeFlagsBooleanLike = innerchecker.TypeFlagsBooleanLike
|
|
41
|
-
|
|
42
|
-
ObjectFlagsReference = innerchecker.ObjectFlagsReference
|
|
43
|
-
ObjectFlagsClass = innerchecker.ObjectFlagsClass
|
|
44
|
-
ObjectFlagsInterface = innerchecker.ObjectFlagsInterface
|
|
45
|
-
ObjectFlagsClassOrInterface = innerchecker.ObjectFlagsClassOrInterface
|
|
46
|
-
|
|
47
|
-
ElementFlagsNone = innerchecker.ElementFlagsNone
|
|
48
|
-
ElementFlagsRequired = innerchecker.ElementFlagsRequired
|
|
49
|
-
ElementFlagsOptional = innerchecker.ElementFlagsOptional
|
|
50
|
-
ElementFlagsRest = innerchecker.ElementFlagsRest
|
|
51
|
-
ElementFlagsVariadic = innerchecker.ElementFlagsVariadic
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
func IsTupleType(t *innerchecker.Type) bool {
|
|
55
|
-
return innerchecker.IsTupleType(t)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
func Checker_getIndexInfosOfType(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.IndexInfo {
|
|
59
|
-
return recv.GetIndexInfosOfType(t)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
func Checker_getPropertiesOfType(recv *innerchecker.Checker, t *innerchecker.Type) []*innerast.Symbol {
|
|
63
|
-
return recv.GetPropertiesOfType(t)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
func Checker_getApparentProperties(recv *innerchecker.Checker, t *innerchecker.Type) []*innerast.Symbol {
|
|
67
|
-
return recv.GetApparentProperties(t)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
func Checker_getTypeArguments(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.Type {
|
|
71
|
-
return recv.GetTypeArguments(t)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
func Checker_getTypeOfSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerchecker.Type {
|
|
75
|
-
return recv.GetTypeOfSymbol(symbol)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
func Checker_getTypeOfSymbolAtLocation(recv *innerchecker.Checker, symbol *innerast.Symbol, node *innerast.Node) *innerchecker.Type {
|
|
79
|
-
return recv.GetTypeOfSymbolAtLocation(symbol, node)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
func Checker_getTypeOfPropertyOfType(recv *innerchecker.Checker, t *innerchecker.Type, name string) *innerchecker.Type {
|
|
83
|
-
return recv.GetTypeOfPropertyOfType(t, name)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
//go:linkname checkerGetAliasSymbolForTypeNode github.com/microsoft/typescript-go/internal/checker.(*Checker).getAliasSymbolForTypeNode
|
|
87
|
-
func checkerGetAliasSymbolForTypeNode(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol
|
|
88
|
-
|
|
89
|
-
func Checker_getAliasSymbolForTypeNode(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol {
|
|
90
|
-
return checkerGetAliasSymbolForTypeNode(recv, node)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//go:linkname checkerGetDeclarationOfAliasSymbol github.com/microsoft/typescript-go/internal/checker.(*Checker).getDeclarationOfAliasSymbol
|
|
94
|
-
func checkerGetDeclarationOfAliasSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Node
|
|
95
|
-
|
|
96
|
-
func Checker_getDeclarationOfAliasSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Node {
|
|
97
|
-
return checkerGetDeclarationOfAliasSymbol(recv, symbol)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
//go:linkname checkerGetTargetOfImportSpecifier github.com/microsoft/typescript-go/internal/checker.(*Checker).getTargetOfImportSpecifier
|
|
101
|
-
func checkerGetTargetOfImportSpecifier(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol
|
|
102
|
-
|
|
103
|
-
func Checker_getTargetOfImportSpecifier(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol {
|
|
104
|
-
if recv == nil || node == nil {
|
|
105
|
-
return nil
|
|
106
|
-
}
|
|
107
|
-
return checkerGetTargetOfImportSpecifier(recv, node)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
func Checker_getAliasedSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Symbol {
|
|
111
|
-
if recv == nil || symbol == nil {
|
|
112
|
-
return nil
|
|
113
|
-
}
|
|
114
|
-
return recv.GetAliasedSymbol(symbol)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
//go:linkname checkerResolveEntityName github.com/microsoft/typescript-go/internal/checker.(*Checker).resolveEntityName
|
|
118
|
-
func checkerResolveEntityName(
|
|
119
|
-
recv *innerchecker.Checker,
|
|
120
|
-
name *innerast.Node,
|
|
121
|
-
meaning innerast.SymbolFlags,
|
|
122
|
-
ignoreErrors bool,
|
|
123
|
-
dontResolveAlias bool,
|
|
124
|
-
location *innerast.Node,
|
|
125
|
-
) *innerast.Symbol
|
|
126
|
-
|
|
127
|
-
func Checker_resolveEntityName(
|
|
128
|
-
recv *innerchecker.Checker,
|
|
129
|
-
name *innerast.Node,
|
|
130
|
-
meaning innerast.SymbolFlags,
|
|
131
|
-
ignoreErrors bool,
|
|
132
|
-
dontResolveAlias bool,
|
|
133
|
-
location *innerast.Node,
|
|
134
|
-
) *innerast.Symbol {
|
|
135
|
-
if recv == nil || name == nil {
|
|
136
|
-
return nil
|
|
137
|
-
}
|
|
138
|
-
return checkerResolveEntityName(recv, name, meaning, ignoreErrors, dontResolveAlias, location)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
//go:linkname checkerGetTypeNameSymbol github.com/microsoft/typescript-go/internal/checker.getTypeNameSymbol
|
|
142
|
-
func checkerGetTypeNameSymbol(t *innerchecker.Type) *innerast.Symbol
|
|
143
|
-
|
|
144
|
-
func Type_getTypeNameSymbol(t *innerchecker.Type) *innerast.Symbol {
|
|
145
|
-
if t == nil {
|
|
146
|
-
return nil
|
|
147
|
-
}
|
|
148
|
-
return checkerGetTypeNameSymbol(t)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
//go:linkname checkerIsArrayType github.com/microsoft/typescript-go/internal/checker.(*Checker).isArrayType
|
|
152
|
-
func checkerIsArrayType(recv *innerchecker.Checker, t *innerchecker.Type) bool
|
|
153
|
-
|
|
154
|
-
func Checker_isArrayType(recv *innerchecker.Checker, t *innerchecker.Type) bool {
|
|
155
|
-
return checkerIsArrayType(recv, t)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
//go:linkname checkerGetBaseTypes github.com/microsoft/typescript-go/internal/checker.(*Checker).getBaseTypes
|
|
159
|
-
func checkerGetBaseTypes(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.Type
|
|
160
|
-
|
|
161
|
-
func Checker_getBaseTypes(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.Type {
|
|
162
|
-
if recv == nil || t == nil {
|
|
163
|
-
return nil
|
|
164
|
-
}
|
|
165
|
-
return checkerGetBaseTypes(recv, t)
|
|
166
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
package compiler
|
|
4
|
-
|
|
5
|
-
import "context"
|
|
6
|
-
import "github.com/microsoft/typescript-go/internal/ast"
|
|
7
|
-
import "github.com/microsoft/typescript-go/internal/compiler"
|
|
8
|
-
import "github.com/microsoft/typescript-go/internal/core"
|
|
9
|
-
import "github.com/microsoft/typescript-go/internal/diagnostics"
|
|
10
|
-
import "github.com/microsoft/typescript-go/internal/tsoptions"
|
|
11
|
-
import "github.com/microsoft/typescript-go/internal/vfs"
|
|
12
|
-
import _ "unsafe"
|
|
13
|
-
|
|
14
|
-
type CheckerPool = compiler.CheckerPool
|
|
15
|
-
|
|
16
|
-
//go:linkname CombineEmitResults github.com/microsoft/typescript-go/internal/compiler.CombineEmitResults
|
|
17
|
-
func CombineEmitResults(results []*compiler.EmitResult) *compiler.EmitResult
|
|
18
|
-
|
|
19
|
-
type CompilerHost = compiler.CompilerHost
|
|
20
|
-
type DuplicateSourceFile = compiler.DuplicateSourceFile
|
|
21
|
-
|
|
22
|
-
const EmitAll = compiler.EmitAll
|
|
23
|
-
|
|
24
|
-
type EmitHost = compiler.EmitHost
|
|
25
|
-
type EmitOnly = compiler.EmitOnly
|
|
26
|
-
|
|
27
|
-
const EmitOnlyDts = compiler.EmitOnlyDts
|
|
28
|
-
const EmitOnlyForcedDts = compiler.EmitOnlyForcedDts
|
|
29
|
-
const EmitOnlyJs = compiler.EmitOnlyJs
|
|
30
|
-
|
|
31
|
-
type EmitOptions = compiler.EmitOptions
|
|
32
|
-
type EmitResult = compiler.EmitResult
|
|
33
|
-
type FileIncludeReason = compiler.FileIncludeReason
|
|
34
|
-
|
|
35
|
-
//go:linkname FilterNoEmitSemanticDiagnostics github.com/microsoft/typescript-go/internal/compiler.FilterNoEmitSemanticDiagnostics
|
|
36
|
-
func FilterNoEmitSemanticDiagnostics(diagnostics []*ast.Diagnostic, options *core.CompilerOptions) []*ast.Diagnostic
|
|
37
|
-
|
|
38
|
-
//go:linkname GetDiagnosticsOfAnyProgram github.com/microsoft/typescript-go/internal/compiler.GetDiagnosticsOfAnyProgram
|
|
39
|
-
func GetDiagnosticsOfAnyProgram(ctx context.Context, program compiler.ProgramLike, file *ast.SourceFile, skipNoEmitCheckForDtsDiagnostics bool, getBindDiagnostics func(context.Context, *ast.SourceFile) []*ast.Diagnostic, getSemanticDiagnostics func(context.Context, *ast.SourceFile) []*ast.Diagnostic) []*ast.Diagnostic
|
|
40
|
-
|
|
41
|
-
//go:linkname HandleNoEmitOnError github.com/microsoft/typescript-go/internal/compiler.HandleNoEmitOnError
|
|
42
|
-
func HandleNoEmitOnError(ctx context.Context, program compiler.ProgramLike, file *ast.SourceFile) *compiler.EmitResult
|
|
43
|
-
|
|
44
|
-
type LibFile = compiler.LibFile
|
|
45
|
-
|
|
46
|
-
//go:linkname NewCachedFSCompilerHost github.com/microsoft/typescript-go/internal/compiler.NewCachedFSCompilerHost
|
|
47
|
-
func NewCachedFSCompilerHost(currentDirectory string, fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, trace func(msg *diagnostics.Message, args ...any)) compiler.CompilerHost
|
|
48
|
-
|
|
49
|
-
//go:linkname NewCompilerHost github.com/microsoft/typescript-go/internal/compiler.NewCompilerHost
|
|
50
|
-
func NewCompilerHost(currentDirectory string, fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, trace func(msg *diagnostics.Message, args ...any)) compiler.CompilerHost
|
|
51
|
-
|
|
52
|
-
//go:linkname NewProgram github.com/microsoft/typescript-go/internal/compiler.NewProgram
|
|
53
|
-
func NewProgram(opts compiler.ProgramOptions) *compiler.Program
|
|
54
|
-
|
|
55
|
-
type Program = compiler.Program
|
|
56
|
-
type ProgramLike = compiler.ProgramLike
|
|
57
|
-
type ProgramOptions = compiler.ProgramOptions
|
|
58
|
-
|
|
59
|
-
//go:linkname SortAndDeduplicateDiagnostics github.com/microsoft/typescript-go/internal/compiler.SortAndDeduplicateDiagnostics
|
|
60
|
-
func SortAndDeduplicateDiagnostics(diagnostics []*ast.Diagnostic) []*ast.Diagnostic
|
|
61
|
-
|
|
62
|
-
type SourceFileMayBeEmittedHost = compiler.SourceFileMayBeEmittedHost
|
|
63
|
-
type SourceMapEmitResult = compiler.SourceMapEmitResult
|
|
64
|
-
type WriteFile = compiler.WriteFile
|
|
65
|
-
type WriteFileData = compiler.WriteFileData
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
package core
|
|
2
|
-
|
|
3
|
-
import innercore "github.com/microsoft/typescript-go/internal/core"
|
|
4
|
-
|
|
5
|
-
type CompilerOptions = innercore.CompilerOptions
|
|
6
|
-
type Tristate = innercore.Tristate
|
|
7
|
-
type TextPos = innercore.TextPos
|
|
8
|
-
type TextRange = innercore.TextRange
|
|
9
|
-
type ScriptKind = innercore.ScriptKind
|
|
10
|
-
|
|
11
|
-
const (
|
|
12
|
-
TSFalse = innercore.TSFalse
|
|
13
|
-
TSTrue = innercore.TSTrue
|
|
14
|
-
|
|
15
|
-
ScriptKindUnknown = innercore.ScriptKindUnknown
|
|
16
|
-
ScriptKindJS = innercore.ScriptKindJS
|
|
17
|
-
ScriptKindJSX = innercore.ScriptKindJSX
|
|
18
|
-
ScriptKindTS = innercore.ScriptKindTS
|
|
19
|
-
ScriptKindTSX = innercore.ScriptKindTSX
|
|
20
|
-
ScriptKindExternal = innercore.ScriptKindExternal
|
|
21
|
-
ScriptKindJSON = innercore.ScriptKindJSON
|
|
22
|
-
ScriptKindDeferred = innercore.ScriptKindDeferred
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
// NewTextRange constructs a closed/open [pos, end) text range.
|
|
26
|
-
func NewTextRange(pos, end int) TextRange { return innercore.NewTextRange(pos, end) }
|
|
27
|
-
|
|
28
|
-
// UndefinedTextRange marks synthesized AST nodes that do not map to source.
|
|
29
|
-
func UndefinedTextRange() TextRange { return innercore.UndefinedTextRange() }
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Lint diagnostic helpers.
|
|
2
|
-
//
|
|
3
|
-
// Plugins that participate in `ttsc check` / `ttsc build` (e.g. `@ttsc/lint`)
|
|
4
|
-
// need to emit findings that ride the same color/context renderer as tsgo's
|
|
5
|
-
// own typecheck diagnostics. The plumbing has to live next to the existing
|
|
6
|
-
// shim so the renderer keeps its single owner of `internal/diagnosticwriter`
|
|
7
|
-
// and `internal/diagnostics`.
|
|
8
|
-
//
|
|
9
|
-
// Consumers construct a `LintDiagnostic` from `(file, pos, end, code,
|
|
10
|
-
// category, message)` and pass it to `FormatMixedDiagnostics` together with
|
|
11
|
-
// any raw tsgo diagnostics. The renderer treats both the same way.
|
|
12
|
-
package diagnosticwriter
|
|
13
|
-
|
|
14
|
-
import (
|
|
15
|
-
"io"
|
|
16
|
-
|
|
17
|
-
"github.com/microsoft/typescript-go/internal/ast"
|
|
18
|
-
"github.com/microsoft/typescript-go/internal/diagnostics"
|
|
19
|
-
inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
|
|
20
|
-
"github.com/microsoft/typescript-go/internal/locale"
|
|
21
|
-
"github.com/microsoft/typescript-go/internal/tspath"
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
// LintCategory selects warning vs error rendering. Warnings render yellow,
|
|
25
|
-
// errors render red — the exit-code decision lives in the caller.
|
|
26
|
-
type LintCategory int
|
|
27
|
-
|
|
28
|
-
const (
|
|
29
|
-
LintCategoryWarning LintCategory = iota
|
|
30
|
-
LintCategoryError
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
// LintDiagnostic is a public, plugin-emittable diagnostic shaped like the
|
|
34
|
-
// `internal/diagnosticwriter.Diagnostic` interface. The internal type is
|
|
35
|
-
// unexported, so this is the only way to mix lint output with tsgo's own
|
|
36
|
-
// diagnostics in a single render pass.
|
|
37
|
-
type LintDiagnostic struct {
|
|
38
|
-
file *ast.SourceFile
|
|
39
|
-
pos int
|
|
40
|
-
end int
|
|
41
|
-
code int32
|
|
42
|
-
category LintCategory
|
|
43
|
-
message string
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// NewLintDiagnostic builds a lint diagnostic anchored at [pos, end) in the
|
|
47
|
-
// supplied source file. `code` shows up in the rendered banner — the
|
|
48
|
-
// convention is to give each rule its own stable integer.
|
|
49
|
-
func NewLintDiagnostic(file *ast.SourceFile, pos, end int, code int32, category LintCategory, message string) *LintDiagnostic {
|
|
50
|
-
if end <= pos {
|
|
51
|
-
end = pos + 1
|
|
52
|
-
}
|
|
53
|
-
return &LintDiagnostic{
|
|
54
|
-
file: file,
|
|
55
|
-
pos: pos,
|
|
56
|
-
end: end,
|
|
57
|
-
code: code,
|
|
58
|
-
category: category,
|
|
59
|
-
message: message,
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
func (d *LintDiagnostic) File() inner.FileLike {
|
|
64
|
-
if d == nil || d.file == nil {
|
|
65
|
-
return nil
|
|
66
|
-
}
|
|
67
|
-
return d.file
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
func (d *LintDiagnostic) Pos() int { return d.pos }
|
|
71
|
-
func (d *LintDiagnostic) End() int { return d.end }
|
|
72
|
-
func (d *LintDiagnostic) Len() int { return d.end - d.pos }
|
|
73
|
-
func (d *LintDiagnostic) Code() int32 { return d.code }
|
|
74
|
-
|
|
75
|
-
func (d *LintDiagnostic) Category() diagnostics.Category {
|
|
76
|
-
if d.category == LintCategoryError {
|
|
77
|
-
return diagnostics.CategoryError
|
|
78
|
-
}
|
|
79
|
-
return diagnostics.CategoryWarning
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
func (d *LintDiagnostic) Localize(_ locale.Locale) string { return d.message }
|
|
83
|
-
func (d *LintDiagnostic) MessageChain() []inner.Diagnostic { return nil }
|
|
84
|
-
func (d *LintDiagnostic) RelatedInformation() []inner.Diagnostic { return nil }
|
|
85
|
-
|
|
86
|
-
// IsError reports whether the diagnostic should fail the build. Lint plugins
|
|
87
|
-
// use this to compute their exit code separately from the renderer.
|
|
88
|
-
func (d *LintDiagnostic) IsError() bool { return d.category == LintCategoryError }
|
|
89
|
-
|
|
90
|
-
// FormatMixedDiagnostics renders raw tsgo diagnostics and lint diagnostics
|
|
91
|
-
// together with TypeScript-style colors and source context, followed by the
|
|
92
|
-
// `Found N errors` summary. Returns the count of error-level diagnostics so
|
|
93
|
-
// callers can decide on an exit code.
|
|
94
|
-
func FormatMixedDiagnostics(
|
|
95
|
-
output io.Writer,
|
|
96
|
-
astDiags []*ast.Diagnostic,
|
|
97
|
-
lintDiags []*LintDiagnostic,
|
|
98
|
-
currentDirectory string,
|
|
99
|
-
) int {
|
|
100
|
-
if len(astDiags) == 0 && len(lintDiags) == 0 {
|
|
101
|
-
return 0
|
|
102
|
-
}
|
|
103
|
-
all := make([]inner.Diagnostic, 0, len(astDiags)+len(lintDiags))
|
|
104
|
-
errors := 0
|
|
105
|
-
for _, d := range astDiags {
|
|
106
|
-
if d == nil {
|
|
107
|
-
continue
|
|
108
|
-
}
|
|
109
|
-
all = append(all, inner.WrapASTDiagnostic(d))
|
|
110
|
-
if d.Category() == diagnostics.CategoryError {
|
|
111
|
-
errors++
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
for _, d := range lintDiags {
|
|
115
|
-
if d == nil {
|
|
116
|
-
continue
|
|
117
|
-
}
|
|
118
|
-
all = append(all, d)
|
|
119
|
-
if d.IsError() {
|
|
120
|
-
errors++
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if len(all) == 0 {
|
|
124
|
-
return 0
|
|
125
|
-
}
|
|
126
|
-
options := &inner.FormattingOptions{
|
|
127
|
-
Locale: locale.Default,
|
|
128
|
-
ComparePathsOptions: tspath.ComparePathsOptions{
|
|
129
|
-
CurrentDirectory: currentDirectory,
|
|
130
|
-
UseCaseSensitiveFileNames: true,
|
|
131
|
-
},
|
|
132
|
-
NewLine: "\n",
|
|
133
|
-
}
|
|
134
|
-
inner.FormatDiagnosticsWithColorAndContext(output, all, options)
|
|
135
|
-
inner.WriteErrorSummaryText(output, all, options)
|
|
136
|
-
return errors
|
|
137
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
package diagnosticwriter
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"io"
|
|
5
|
-
|
|
6
|
-
"github.com/microsoft/typescript-go/internal/ast"
|
|
7
|
-
inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
|
|
8
|
-
"github.com/microsoft/typescript-go/internal/locale"
|
|
9
|
-
"github.com/microsoft/typescript-go/internal/tspath"
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
// FormatASTDiagnosticsWithColorAndContext writes TypeScript-style pretty
|
|
13
|
-
// diagnostics using the same internal formatter as typescript-go.
|
|
14
|
-
func FormatASTDiagnosticsWithColorAndContext(output io.Writer, diagnostics []*ast.Diagnostic, currentDirectory string) {
|
|
15
|
-
if len(diagnostics) == 0 {
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
formatted := inner.FromASTDiagnostics(diagnostics)
|
|
19
|
-
options := &inner.FormattingOptions{
|
|
20
|
-
Locale: locale.Default,
|
|
21
|
-
ComparePathsOptions: tspath.ComparePathsOptions{
|
|
22
|
-
CurrentDirectory: currentDirectory,
|
|
23
|
-
UseCaseSensitiveFileNames: true,
|
|
24
|
-
},
|
|
25
|
-
NewLine: "\n",
|
|
26
|
-
}
|
|
27
|
-
inner.FormatDiagnosticsWithColorAndContext(output, formatted, options)
|
|
28
|
-
inner.WriteErrorSummaryText(output, formatted, options)
|
|
29
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
package parser
|
|
4
|
-
|
|
5
|
-
import "github.com/microsoft/typescript-go/internal/ast"
|
|
6
|
-
import "github.com/microsoft/typescript-go/internal/core"
|
|
7
|
-
import "github.com/microsoft/typescript-go/internal/parser"
|
|
8
|
-
import _ "unsafe"
|
|
9
|
-
|
|
10
|
-
//go:linkname GetJSDocCommentRanges github.com/microsoft/typescript-go/internal/parser.GetJSDocCommentRanges
|
|
11
|
-
func GetJSDocCommentRanges(f *ast.NodeFactory, commentRanges []ast.CommentRange, node *ast.Node, text string) []ast.CommentRange
|
|
12
|
-
|
|
13
|
-
type JSDocInfo = parser.JSDocInfo
|
|
14
|
-
|
|
15
|
-
const PCArgumentExpressions = parser.PCArgumentExpressions
|
|
16
|
-
const PCArrayBindingElements = parser.PCArrayBindingElements
|
|
17
|
-
const PCArrayLiteralMembers = parser.PCArrayLiteralMembers
|
|
18
|
-
const PCBlockStatements = parser.PCBlockStatements
|
|
19
|
-
const PCClassMembers = parser.PCClassMembers
|
|
20
|
-
const PCCount = parser.PCCount
|
|
21
|
-
const PCEnumMembers = parser.PCEnumMembers
|
|
22
|
-
const PCHeritageClauseElement = parser.PCHeritageClauseElement
|
|
23
|
-
const PCHeritageClauses = parser.PCHeritageClauses
|
|
24
|
-
const PCImportAttributes = parser.PCImportAttributes
|
|
25
|
-
const PCImportOrExportSpecifiers = parser.PCImportOrExportSpecifiers
|
|
26
|
-
const PCJSDocComment = parser.PCJSDocComment
|
|
27
|
-
const PCJSDocParameters = parser.PCJSDocParameters
|
|
28
|
-
const PCJsxAttributes = parser.PCJsxAttributes
|
|
29
|
-
const PCJsxChildren = parser.PCJsxChildren
|
|
30
|
-
const PCObjectBindingElements = parser.PCObjectBindingElements
|
|
31
|
-
const PCObjectLiteralMembers = parser.PCObjectLiteralMembers
|
|
32
|
-
const PCParameters = parser.PCParameters
|
|
33
|
-
const PCRestProperties = parser.PCRestProperties
|
|
34
|
-
const PCSourceElements = parser.PCSourceElements
|
|
35
|
-
const PCSwitchClauseStatements = parser.PCSwitchClauseStatements
|
|
36
|
-
const PCSwitchClauses = parser.PCSwitchClauses
|
|
37
|
-
const PCTupleElementTypes = parser.PCTupleElementTypes
|
|
38
|
-
const PCTypeArguments = parser.PCTypeArguments
|
|
39
|
-
const PCTypeMembers = parser.PCTypeMembers
|
|
40
|
-
const PCTypeParameters = parser.PCTypeParameters
|
|
41
|
-
const PCVariableDeclarations = parser.PCVariableDeclarations
|
|
42
|
-
|
|
43
|
-
type ParseFlags = parser.ParseFlags
|
|
44
|
-
|
|
45
|
-
const ParseFlagsAwait = parser.ParseFlagsAwait
|
|
46
|
-
const ParseFlagsIgnoreMissingOpenBrace = parser.ParseFlagsIgnoreMissingOpenBrace
|
|
47
|
-
const ParseFlagsJSDoc = parser.ParseFlagsJSDoc
|
|
48
|
-
const ParseFlagsNone = parser.ParseFlagsNone
|
|
49
|
-
const ParseFlagsType = parser.ParseFlagsType
|
|
50
|
-
const ParseFlagsYield = parser.ParseFlagsYield
|
|
51
|
-
|
|
52
|
-
//go:linkname ParseIsolatedEntityName github.com/microsoft/typescript-go/internal/parser.ParseIsolatedEntityName
|
|
53
|
-
func ParseIsolatedEntityName(text string) *ast.EntityName
|
|
54
|
-
|
|
55
|
-
//go:linkname ParseSourceFile github.com/microsoft/typescript-go/internal/parser.ParseSourceFile
|
|
56
|
-
func ParseSourceFile(opts ast.SourceFileParseOptions, sourceText string, scriptKind core.ScriptKind) *ast.SourceFile
|
|
57
|
-
|
|
58
|
-
type Parser = parser.Parser
|
|
59
|
-
type ParserState = parser.ParserState
|
|
60
|
-
type ParsingContext = parser.ParsingContext
|
|
61
|
-
type ParsingContexts = parser.ParsingContexts
|