笔记:TypeScript Architectural Overview

475 阅读6分钟

设计分层

Layer Overview

下面部件都对应一个文件或目录:

src/compiler

src/tsc

  • Standalone compiler 独立编译器 (tsc):命令行编译器

/src/tsc/tsc.ts只是对 src/executeCommandLine/executeCommandLine.ts的简单包装 executeCommandLine.ts唯一export的函数式executeCommandLine(...):

executeCommandLine()
  -> executeCommandLineWorker()
    -> reportDiagnostic = createDiagnosticReporter() // 诊断报告器
    -> options = parseConfigFileWithSystem() // 解析配置
    -> performCompilation(options, reportDiagnostic) // 开始编译
      -> program = createProgram(options) // 创建Program
      -> emitFilesAndReportErrorsAndGetExitStatus(program) // 输出文件;报错

src/services

  • Language Service 语言服务

src/tsserver

  • Standalone Server 独立服务器 (tsserver)

TypeScript源码

根目录

├── bin #包含tsc和tsserver命令行,二者均直接require lib目录下对应js文件
├── built/local #编译结果
├── doc #文档
├── lib #LKG版本的typescript
├── loc #本地化
├── scripts #各种工程脚本
├── src #源码
└── tests #测试??

9 directories

src目录

# 核心
├── compiler
├── tsc
├── executeCommandLine
├── services
├── shims
├── deprecatedCompat #废弃与兼容性
#ts.Debug
├── debug
# 空文件
├── tsserverlibrary # 空的
├── typescriptServices 空的

# ts.server
├── tsserver # ts.server
├── webServer # ts.server的web模式
├── server # ts.server的node模式
# ts.server.typingsInstaller
├── typingsInstaller # ts.server.typingsInstaller
├── typingsInstallerCore

# *.d.ts
├── lib 内置类型声明

# 本地化
├── loc

#其他(with namespace)
├── jsTyping #ts.JsTyping


#其他(no namespace)
├── harness 治理
├── testRunner 测试
├── instrumenter
├── cancellationToken
└── watchGuard

src/compiler目录

4 directories, 70 files

# 配置
├── tsconfig.json
├── tsconfig.release.json

# 基础设施和工具代码
├── core.ts
├── corePublic.ts
├── debug.ts
├── path.ts
├── sys.ts
├── tracing.ts
├── utilities.ts
├── utilitiesPublic.ts
├── semver.ts
├── sourcemap.ts
├── commandLineParser.ts

# 核心部件
├── program.ts
├── types.ts
├── scanner.ts
├── parser.ts
├── binder.ts
├── checker.ts
├── emitter.ts
├── builder.ts
├── builderPublic.ts
├── builderState.ts
├── builderStatePublic.ts

# 诊断
├── diagnosticInformationMap.generated.ts
├── diagnosticMessages.generated.json
├── diagnosticMessages.json
#性能
├── perfLogger.ts
├── performance.ts
├── performanceCore.ts
# tsbuild
├── tsbuild.ts
├── tsbuildPublic.ts
# walker&visitor
├── symbolWalker.ts
├── visitorPublic.ts
# watch
├── watch.ts
├── watchPublic.ts
├── watchUtilities.ts
# 模块解析
├── moduleNameResolver.ts
├── moduleSpecifiers.ts
├── resolutionCache.ts

# Node工厂
├── factory
│   ├── baseNodeFactory.ts
│   ├── emitHelpers.ts
│   ├── emitNode.ts
│   ├── nodeConverters.ts
│   ├── nodeFactory.ts
│   ├── nodeTests.ts
│   ├── parenthesizerRules.ts
│   ├── utilities.ts
│   └── utilitiesPublic.ts

# Transformer
├── transformer.ts
└── transformers
    ├── classFields.ts
    ├── declarations
    │   └── diagnostics.ts
    ├── declarations.ts
    ├── destructuring.ts
    ├── es2015.ts
    ├── es2016.ts
    ├── es2017.ts
    ├── es2018.ts
    ├── es2019.ts
    ├── es2020.ts
    ├── es5.ts
    ├── esnext.ts
    ├── generators.ts
    ├── jsx.ts
    ├── module
    │   ├── esnextAnd2015.ts
    │   ├── module.ts
    │   └── system.ts
    ├── taggedTemplate.ts
    ├── ts.ts
    └── utilities.ts

src/tsserver目录

├── server.ts
├── nodeServer.ts #引用 src/server
└── webServer.ts #引用 src/webServer

server.ts 中根据环境启动nodeServerwebServer

if (node env) {
  start(initializeNodeSystem(), platform);
} else {
  start(initializeWebSystem(), 'web');
}

initializeNodeSystem()
  -> startNodeSession()
    -> new IoSession().listen() # IoSession extends ts.server.Session
    
initializeWebSystem()
  -> startWebSession()
    -> new WorkerSession.listen() # src/webServer/ ts.server.WorkerSession

tsserver主要代码还是在src/server中。 server是通过websocket进行通信的。通信协议在src/server/protocol.ts中定义。经过构建后最终会产生lib/protocol.d.ts

src/server目录

.
├── protocol.ts
├── session.ts
├── project.ts
├── editorServices.ts
├── packageJsonCache.ts
├── scriptInfo.ts
├── scriptVersionCache.ts
#types
├── types.ts
├── typesMap.json
├── typingsCache.ts
├── watchType.ts
#工具
├── utilities.ts
└── utilitiesPublic.ts

核心数据结构

  • Node
  • SourceFile
  • Program
  • Symbol
  • Type
  • Signature

Node

TypeScript AST中的节点用Node表示。下面是各种Node之间的继承关系(并不全面精确,大概了解一下)

graph LR
 
QualifiedName --> Node
Declaration --> Node
ComputedPropertyName --> Node
Decorator --> Node
VariableDeclarationList --> Node
ObjectBindingPattern --> Node
ArrayBindingPattern --> Node
TypeNode --> Node
TypeNode --> Node
ImportTypeAssertionContainer --> Node
Expression --> Node
LiteralLikeNode --> Node
TemplateSpan --> Node
CaseBlock --> Node
DefaultClause --> Node
CatchClause --> Node
HeritageClause --> Node
ExternalModuleReference --> Node
AssertEntry --> Node
AssertClause --> Node
NamedImports --> Node
NamedExports --> Node
Bundle --> Node
InputFiles --> Node
UnparsedSource --> Node
UnparsedSection --> Node
SyntaxList --> Node

NamedDeclaration --> Declaration
SourceFile --> Declaration

LateBoundName --> ComputedPropertyNam

RequireVariableDeclarationList --> VariableDeclarationList

ThisTypeNode --> TypeNode
NodeWithTypeArguments --> TypeNode
TypePredicateNode --> TypeNode
ArrayTypeNode --> TypeNode
TupleTypeNode --> TypeNode
OptionalTypeNode --> TypeNode
RestTypeNode --> TypeNode
UnionTypeNode --> TypeNode
IntersectionTypeNode --> TypeNode
ConditionalTypeNode --> TypeNode
InferTypeNode --> TypeNode
ParenthesizedTypeNode --> TypeNode
TypeOperatorNode --> TypeNode
IndexedAccessTypeNode --> TypeNode
LiteralTypeNode --> TypeNode
TemplateLiteralTypeNode --> TypeNode
TemplateLiteralTypeSpan --> TypeNode

OmittedExpression --> Expression
UnaryExpression --> Expression
YieldExpression --> Expression
SyntheticExpression --> Expression
ConditionalExpression --> Expression
SpreadElement --> Expression
AsExpression --> Expression
SatisfiesExpression --> Expression

CommaListExpression --> Expression

TemplateLiteralLikeNode --> LiteralLikeNode


ImportTypeNode --> NodeWithTypeArguments
TypeReferenceNode --> NodeWithTypeArguments
TypeQueryNode --> NodeWithTypeArguments

UniqueTypeOperatorNode --> TypeOperatorNode

ValidImportTypeNode --> ImportTypeNode

UpdateExpression --> UnaryExpression
DeleteExpression --> UnaryExpression
TypeOfExpression --> UnaryExpression
VoidExpression --> UnaryExpression
AwaitExpression --> UnaryExpression
TypeAssertion --> UnaryExpression

PrefixUnaryExpression --> UpdateExpression
PostfixUnaryExpression --> UpdateExpression
LeftHandSideExpression --> UpdateExpression

JsonMinusNumericLiteral --> PrefixUnaryExpression

PartiallyEmittedExpression --> LeftHandSideExpression
MemberExpression --> LeftHandSideExpression
NonNullExpression --> LeftHandSideExpression
SyntheticReferenceExpression --> LeftHandSideExpression

PrimaryExpression --> MemberExpression
ElementAccessExpression --> MemberExpression
TaggedTemplateExpression --> MemberExpression

NonNullChain --> NonNullExpression

PrivateIdentifier --> PrimaryExpression
NullLiteral --> PrimaryExpression
TrueLiteral --> PrimaryExpression
FalseLiteral --> PrimaryExpression
ThisExpression --> PrimaryExpression
SuperExpression --> PrimaryExpression
ImportExpression --> PrimaryExpression
TemplateExpression --> PrimaryExpression
ArrayLiteralExpression --> PrimaryExpression
MetaProperty --> PrimaryExpression


LateBoundElementAccessExpression --> ElementAccessExpression
ElementAccessChain --> ElementAccessExpression
SuperElementAccessExpression --> ElementAccessExpression

ImportMetaProperty --> MetaProperty

ElementAccessChainRoot --> ElementAccessChain

TemplateHead --> TemplateLiteralLikeNode
TemplateMiddle --> TemplateLiteralLikeNode
TemplateTail --> TemplateLiteralLikeNode

Identifier --> PrimaryExpression
Identifier --> Declaration
DeclarationStatement --> NamedDeclaration
DeclarationStatement --> Statement
CallSignatureDeclaration --> SignatureDeclarationBase
CallSignatureDeclaration --> TypeElement
ConstructSignatureDeclaration --> SignatureDeclarationBase
ConstructSignatureDeclaration --> TypeElement
FunctionDeclaration --> FunctionLikeDeclarationBase
FunctionDeclaration --> DeclarationStatement
MethodSignature --> SignatureDeclarationBase
MethodSignature --> TypeElement
IndexSignatureDeclaration --> SignatureDeclarationBase
IndexSignatureDeclaration --> ClassElement
IndexSignatureDeclaration --> TypeElement
IndexSignatureDeclaration --> ClassElement
FunctionOrConstructorTypeNodeBase --> TypeNode
FunctionOrConstructorTypeNodeBase --> SignatureDeclarationBase
TypeLiteralNode --> TypeNode
TypeLiteralNode --> Declaration
MappedTypeNode --> TypeNode
MappedTypeNode --> Declaration
StringLiteral --> LiteralExpression
StringLiteral --> Declaration
BinaryExpression --> Expression
BinaryExpression --> Declaration
LiteralExpression --> LiteralLikeNode
LiteralExpression --> PrimaryExpression
NoSubstitutionTemplateLiteral --> LiteralExpression
NoSubstitutionTemplateLiteral --> TemplateLiteralLikeNode
NoSubstitutionTemplateLiteral --> Declaration
NoSubstitutionTemplateLiteral --> TemplateLiteralLikeNode
NoSubstitutionTemplateLiteral --> NumericLiteral
ObjectLiteralExpressionBase --> PrimaryExpression
ObjectLiteralExpressionBase --> Declaration
PropertyAccessExpression --> MemberExpression
PropertyAccessExpression --> NamedDeclaration
CallExpression --> LeftHandSideExpression
CallExpression --> Declaration
ExpressionWithTypeArguments --> MemberExpression
ExpressionWithTypeArguments --> NodeWithTypeArguments
NewExpression --> PrimaryExpression
NewExpression --> Declaration
ClassDeclaration --> ClassLikeDeclarationBase
ClassDeclaration --> DeclarationStatement
ClassExpression --> ClassLikeDeclarationBase
ClassExpression --> PrimaryExpression
ModuleBlock --> Node
ModuleBlock --> Statement

类型相关的TypeNode

graph LR
ThisTypeNode --> TypeNode
NodeWithTypeArguments --> TypeNode
TypePredicateNode --> TypeNode
ArrayTypeNode --> TypeNode
TupleTypeNode --> TypeNode
OptionalTypeNode --> TypeNode
RestTypeNode --> TypeNode
UnionTypeNode --> TypeNode
IntersectionTypeNode --> TypeNode
ConditionalTypeNode --> TypeNode
InferTypeNode --> TypeNode
ParenthesizedTypeNode --> TypeNode
TypeOperatorNode --> TypeNode
IndexedAccessTypeNode --> TypeNode
LiteralTypeNode --> TypeNode
TemplateLiteralTypeNode --> TypeNode
TemplateLiteralTypeSpan --> TypeNode

Node结构

export interface Node extends ReadonlyTextRange {
    readonly kind: SyntaxKind;
    readonly flags: NodeFlags;
    /** @internal */ modifierFlagsCache: ModifierFlags;
    /** @internal */ readonly transformFlags: TransformFlags; // Flags for transforms
    /** @internal */ id?: NodeId;                          // Unique id (used to look up NodeLinks)
    readonly parent: Node;                                // Parent node (initialized by binding)
    /** @internal */ original?: Node;                      // The original node if this is an updated node.
    /** @internal */ symbol: Symbol;                       // Symbol declared by node (initialized by binding)
    /** @internal */ locals?: SymbolTable;                 // Locals associated with node (initialized by binding)
    /** @internal */ nextContainer?: Node;                 // Next container in declaration order (initialized by binding)
    /** @internal */ localSymbol?: Symbol;                 // Local symbol declared by node (initialized by binding only for exported nodes)
    /** @internal */ flowNode?: FlowNode;                  // Associated FlowNode (initialized by binding)
    /** @internal */ emitNode?: EmitNode;                  // Associated EmitNode (initialized by transforms)
    /** @internal */ contextualType?: Type;                // Used to temporarily assign a contextual type during overload resolution
    /** @internal */ inferenceContext?: InferenceContext;  // Inference context for contextual type
}
export interface Type {
    flags: TypeFlags;                // Flags
    /** @internal */ id: TypeId;      // Unique ID
    /** @internal */ checker: TypeChecker;
    symbol: Symbol;                  // Symbol associated with type (if any)
    pattern?: DestructuringPattern;  // Destructuring pattern represented by type (if any)
    aliasSymbol?: Symbol;            // Alias associated with type
    aliasTypeArguments?: readonly Type[]; // Alias type arguments (if any)
    /** @internal */
    permissiveInstantiation?: Type;  // Instantiation with type parameters mapped to wildcard type
    /** @internal */
    restrictiveInstantiation?: Type; // Instantiation with type parameters mapped to unconstrained form
    /** @internal */
    uniqueLiteralFilledInstantiation?: Type;  // Instantiation with type parameters mapped to never type
    /** @internal */
    immediateBaseConstraint?: Type;  // Immediate base constraint cache
    /** @internal */
    widened?: Type; // Cached widened form of the type
}
graph LR
IntrinsicType --> Type
LiteralType --> Type
UniqueESSymbolType --> Type
EnumType --> Type
ObjectType --> Type
UnionOrIntersectionType --> Type
SyntheticDefaultModuleType --> Type
InstantiableType --> Type

NullableType --> IntrinsicType
FreshableIntrinsicType --> IntrinsicType

StringLiteralType --> LiteralType
NumberLiteralType --> LiteralType
BigIntLiteralType --> LiteralType

InterfaceType --> ObjectType
TypeReference --> ObjectType
AnonymousType --> ObjectType
EvolvingArrayType --> ObjectType
ReverseMappedType --> ObjectType

UnionType --> UnionOrIntersectionType
IntersectionType --> UnionOrIntersectionType

TypeParameter --> InstantiableType
IndexedAccessType --> InstantiableType
IndexType --> InstantiableType
ConditionalType --> InstantiableType
TemplateLiteralType --> InstantiableType
StringMappingType --> InstantiableType
SubstitutionType --> InstantiableType

InterfaceTypeWithDeclaredMembers --> InterfaceType

DeferredTypeReference --> TypeReference
TupleTypeReference --> TypeReference

InstantiationExpressionType --> AnonymousType
MappedType --> AnonymousType

编译过程

TODO:

构建

TypeScript整个工程是通过一系列Gulp任务进行构建。

问题:tsc本身是用ts写的,那么tsc.js是如何被编译出来的呢? 回答:一般语言开发过程都是先使用另一种语言开发本语言的编译器。当本语言足以编写编译器时,再用自身实现本语言的编辑器。这个过程叫做“自举,Bootstrap”。所以,第一个tsc.js应该是用js写的。但是第一个tsc的编写过程并没有记录在git仓库中。应该是完成后才创建的TypeScript仓库。

默认任务

# Default
default                         Runs 'local'

构建任务

# Build
local                           Builds the full compiler and services ⭐️
tsc                             Builds the command-line compiler ⭐️
services                        Builds the language service ⭐️
tsserver                        Builds the language server ⭐️
scripts                         Builds files in the 'scripts' folder. ⭐️
lib                             Builds the library targets ⭐️
min                             Builds only tsc and tsserver ⭐️
lssl                            Builds language service server library ⭐️
tests                           Builds the test infrastructure
other-outputs                   Builds miscelaneous scripts and documents distributed with the LKG                             ???
tsc-instrumented                Builds an instrumented tsc.js

build-eslint-rules              Compiles eslint rules to js
LKG                             Makes a new LKG out of the built js files
baseline-accept                 Makes the most recent test results the new baseline, overwriting the old baseline
baseline-accept-rwc             Makes the most recent rwc test results the new baseline, overwriting the old baseline

LKG=Last Known Good。发布到 npm 中的 TypeScript 是从 lib 目录中的 LKG 版本。LKG 版本的 Typecript 是通过gulp LKG任务生成的。这也是为什么TS源码中会有一个lib目录。

lssl=Language Service Server Library

生成

# Generate
generate-diagnostics            Generates a diagnostic file in TypeScript based on an input JSON file
generate-code-coverage          Generates code coverage data via istanbul
generate-spec                   Generates a Markdown version of the Language Specification

Watch模式

# Watch
watch                           Watches for changes and rebuilds and runs tests in parallel.
watch-tsc                       Watch for changes and rebuild the command-line compiler only. ⭐️
watch-tsserver                  Watch for changes and rebuild the language server only ⭐️
watch-lssl                      Watch for changes and rebuild tsserverlibrary only ⭐️
watch-services                  Watches for changes and rebuild language service only ⭐️
watch-min                       Watches for changes to a tsc and tsserver only
watch-local                     Watches for changes to projects in src/ (but does not execute  tests). ⭐️

清理输出

# Clean
clean                           Cleans build outputs
clean-tsc                       Cleans outputs for the command-line compiler
clean-services                  Cleans outputs for the language service
clean-tsserver                  Cleans outputs for the language server
clean-min                       Cleans outputs for tsc and tsserver
clean-tests                     Cleans the outputs for the test infrastructure
clean-eslint-rules              Cleans the outputs for the eslint rules
clean-lssl                      Clean outputs for the language service server library

运行各种脚本

# Runs scripts
## eslint相关
run-eslint-rules-tests          Runs the eslint rule tests
lint-scripts                    Runs eslint on the scripts sources.
lint-compiler                   Runs eslint on the compiler sources.
lint                            Runs eslint on the compiler and scripts sources.

## 测试
runtests                        Runs the tests using the built run.js file.
runtests-parallel               Runs all the tests in parallel using the built run.js file.
test-browser-integration        Runs scripts/browserIntegrationTest.ts which tests that typescript.js loads in a browser
importDefinitelyTypedTests      Runs the importDefinitelyTypedTests script to copy DT's tests to the TS-internal RWC tests

## 生成构建用的配置文件
configure-nightly               Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing
configure-insiders              Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing
configure-experimental          Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing
create-language-services-build  Runs scripts/createLanguageServicesBuild.ts to prepare a build which only has the require('typescript') JS.

## 发布
publish-nightly                 Runs `npm publish --tag next` to create a new nightly build on npm

Diff

# Diff
diff                            Diffs the compiler baselines using the diff tool specified by the 'DIFF' environment variable
diff-rwc                        Diffs the RWC baselines using the diff tool specified by the 'DIFF' environment variable

其他

# Misc
update-sublime                  Updates the sublime plugin's tsserver
generate-types-map

构建输出

通过运行npm run gulp构建整个工程。会在工程目录下生成built/local目录。 其中包含一些*.tsbuildinfo文件。这个文件中描述了相应js文件的构建信息。 其中sourceFiles中列出了js是由哪些ts文件构建而来。

问题:这个ts列表是如何产生的?这个tsbuildinfo文件与tsbuild.ts是什么关系? 猜测:列表应该来自对应tsconfig.json的files字段,然后通过tsbuild解析tsconfig进行构建的。

# 本地化
├── cs
├── de
├── enu.lcg
├── es
├── fr
├── it
├── ja
├── ko
├── pl
├── pt-br
├── ru
├── tr
├── zh-cn
├── zh-tw

# 内置类型定义
├── lib.d.ts
├── lib.dom.d.ts
├── lib.dom.iterable.d.ts
├── lib.es2015.collection.d.ts
├── lib.es2015.core.d.ts
├── lib.es2015.d.ts
├── lib.es2015.generator.d.ts
├── lib.es2015.iterable.d.ts
├── lib.es2015.promise.d.ts
├── lib.es2015.proxy.d.ts
├── lib.es2015.reflect.d.ts
├── lib.es2015.symbol.d.ts
├── lib.es2015.symbol.wellknown.d.ts
├── lib.es2016.array.include.d.ts
├── lib.es2016.d.ts
├── lib.es2016.full.d.ts
├── lib.es2017.d.ts
├── lib.es2017.full.d.ts
├── lib.es2017.intl.d.ts
├── lib.es2017.object.d.ts
├── lib.es2017.sharedmemory.d.ts
├── lib.es2017.string.d.ts
├── lib.es2017.typedarrays.d.ts
├── lib.es2018.asyncgenerator.d.ts
├── lib.es2018.asynciterable.d.ts
├── lib.es2018.d.ts
├── lib.es2018.full.d.ts
├── lib.es2018.intl.d.ts
├── lib.es2018.promise.d.ts
├── lib.es2018.regexp.d.ts
├── lib.es2019.array.d.ts
├── lib.es2019.d.ts
├── lib.es2019.full.d.ts
├── lib.es2019.object.d.ts
├── lib.es2019.string.d.ts
├── lib.es2019.symbol.d.ts
├── lib.es2020.bigint.d.ts
├── lib.es2020.d.ts
├── lib.es2020.full.d.ts
├── lib.es2020.intl.d.ts
├── lib.es2020.promise.d.ts
├── lib.es2020.sharedmemory.d.ts
├── lib.es2020.string.d.ts
├── lib.es2020.symbol.wellknown.d.ts
├── lib.es5.d.ts
├── lib.es6.d.ts
├── lib.esnext.d.ts
├── lib.esnext.full.d.ts
├── lib.esnext.intl.d.ts
├── lib.esnext.promise.d.ts
├── lib.esnext.string.d.ts
├── lib.esnext.weakref.d.ts
├── lib.scripthost.d.ts
├── lib.webworker.d.ts
├── lib.webworker.importscripts.d.ts
├── lib.webworker.iterable.d.ts

# 诊断信息
├── diagnosticMessages.generated.json

├── cancellationToken.js(cancellationToken.js.map)

# typescript
├── typescript.d.ts
├── typescript.js(typescript.js.map)
├── typescript_standalone.d.ts

# tsc
├── tsc.js(tsc.js.map)
├── tsc.tsbuildinfo
├── executeCommandLine.d.ts(executeCommandLine.d.ts.map)
├── executeCommandLine.js(executeCommandLine.js.map)
├── executeCommandLine.tsbuildinfo

# tsserver
├── tsserver.js(tsserver.js.map)
├── tsserver.tsbuildinfo

# server
├── server.d.ts(server.d.ts.map)
├── server.js(server.js.map)
├── server.tsbuildinfo

# services
├── services.d.ts(services.d.ts.map)
├── services.js(services.js.map)
├── services.tsbuildinfo

# compiler
├── compiler.d.ts(compiler.d.ts.map)
├── compiler.js(compiler.js.map)
├── compiler.tsbuildinfo
├── compiler-debug.js(compiler-debug.js.map)
├── compiler-debug.tsbuildinfo

# deprecatedCompat
├── deprecatedCompat.d.ts(deprecatedCompat.d.ts.map)
├── deprecatedCompat.js(deprecatedCompat.js.map)
├── deprecatedCompat.tsbuildinfo


# jsTyping
├── jsTyping.d.ts(jsTyping.d.ts.map)
├── jsTyping.js(jsTyping.js.map)
├── jsTyping.tsbuildinfo


# shims
├── shims.d.ts(shims.d.ts.map)
├── shims.js(shims.js.map)
├── shims.tsbuildinfo

# tsserverlibrary
├── tsserverlibrary.d.ts
├── tsserverlibrary.js(tsserverlibrary.js.map)
├── tsserverlibrary.out.d.ts
├── tsserverlibrary.out.js(tsserverlibrary.out.js.map)
├── tsserverlibrary.out.tsbuildinfo

# ???
├── typesMap.json


├── typescriptServices.d.ts
├── typescriptServices.js(typescriptServices.js.map)
├── typescriptServices.out.d.ts
├── typescriptServices.out.js(typescriptServices.out.js.map)
├── typescriptServices.out.tsbuildinfo


├── typingsInstaller.js(typingsInstaller.js.map)
├── typingsInstaller.tsbuildinfo

├── typingsInstallerCore.d.ts(typingsInstallerCore.d.ts.map)
├── typingsInstallerCore.js(typingsInstallerCore.js.map)
├── typingsInstallerCore.tsbuildinfo

├── watchGuard.js(watchGuard.js.map)
├── webServer.d.ts(webServer.d.ts.map)
├── webServer.js(webServer.js.map)
└── webServer.tsbuildinfo

参考链接