mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #26520 from RyanCavanaugh/release-3.0.2
Release 3.0.2
This commit is contained in:
Vendored
+1
@@ -14132,6 +14132,7 @@ interface Storage {
|
||||
* storage[key] = value
|
||||
*/
|
||||
setItem(key: string, value: string): void;
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
declare var Storage: {
|
||||
|
||||
+36
-11
@@ -60,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
||||
var ts;
|
||||
(function (ts) {
|
||||
ts.versionMajorMinor = "3.0";
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
function createDictionaryObject() {
|
||||
@@ -27809,19 +27809,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -42059,9 +42063,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154:
|
||||
case 156:
|
||||
case 157:
|
||||
var otherKind = node.kind === 156 ? 157 : 156;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -53166,14 +53174,19 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
function serializeTypeOfNode(node) {
|
||||
switch (node.kind) {
|
||||
case 152:
|
||||
case 149:
|
||||
case 156:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238:
|
||||
case 207:
|
||||
case 154:
|
||||
@@ -61494,7 +61507,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -61508,7 +61521,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false;
|
||||
needsDeclare = false;
|
||||
@@ -61529,7 +61542,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
needsDeclare = true;
|
||||
@@ -62229,6 +62242,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -62242,7 +62264,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0;
|
||||
var parentIsFile = node.parent.kind === 277;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1) | 512 | 2);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1) | 2);
|
||||
additions = 0;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -62299,6 +62321,9 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 ^ 4; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 && !(flags & 1)) {
|
||||
flags ^= 1;
|
||||
}
|
||||
if (flags & 512 && flags & 2) {
|
||||
flags ^= 2;
|
||||
}
|
||||
|
||||
+39
-11
@@ -88,7 +88,7 @@ var ts;
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
ts.versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
/* @internal */
|
||||
@@ -33849,19 +33849,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156 /* GetAccessor */) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -50647,9 +50651,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
case 156 /* GetAccessor */:
|
||||
case 157 /* SetAccessor */:
|
||||
var otherKind = node.kind === 156 /* GetAccessor */ ? 157 /* SetAccessor */ : 156 /* GetAccessor */;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -63980,6 +63988,11 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
/**
|
||||
* Serializes the type of a node for use with decorator type metadata.
|
||||
*
|
||||
@@ -63989,10 +64002,10 @@ var ts;
|
||||
switch (node.kind) {
|
||||
case 152 /* PropertyDeclaration */:
|
||||
case 149 /* Parameter */:
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157 /* SetAccessor */:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238 /* ClassDeclaration */:
|
||||
case 207 /* ClassExpression */:
|
||||
case 154 /* MethodDeclaration */:
|
||||
@@ -76386,7 +76399,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278 /* Bundle */) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -76400,7 +76413,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
||||
needsDeclare = false;
|
||||
@@ -76421,7 +76434,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
// Single source file
|
||||
@@ -77198,6 +77211,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -77211,7 +77233,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
||||
var parentIsFile = node.parent.kind === 277 /* SourceFile */;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1 /* Export */) | 512 /* Default */ | 2 /* Ambient */);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */);
|
||||
additions = 0 /* None */;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -77270,6 +77292,11 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 /* All */ ^ 4 /* Public */; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
|
||||
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
|
||||
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
|
||||
flags ^= 1 /* Export */;
|
||||
}
|
||||
if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {
|
||||
flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)
|
||||
}
|
||||
@@ -86912,6 +86939,7 @@ var ts;
|
||||
}
|
||||
ts.createWatchProgram = createWatchProgram;
|
||||
})(ts || (ts = {}));
|
||||
/* @internal */
|
||||
var ts;
|
||||
(function (ts) {
|
||||
var minimumDate = new Date(-8640000000000000);
|
||||
|
||||
Vendored
-182
@@ -2579,14 +2579,6 @@ declare namespace ts {
|
||||
oldProgram?: Program;
|
||||
configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>;
|
||||
}
|
||||
interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
getUnchangedTime?(fileName: string): Date | undefined;
|
||||
getLastStatus?(fileName: string): UpToDateStatus | undefined;
|
||||
setLastStatus?(fileName: string, status: UpToDateStatus): void;
|
||||
parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string | undefined;
|
||||
@@ -4406,180 +4398,6 @@ declare namespace ts {
|
||||
*/
|
||||
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
|
||||
}
|
||||
declare namespace ts {
|
||||
interface BuildHost {
|
||||
verbose(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
error(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
errorDiagnostic(diag: Diagnostic): void;
|
||||
message(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
}
|
||||
/**
|
||||
* A BuildContext tracks what's going on during the course of a build.
|
||||
*
|
||||
* Callers may invoke any number of build requests within the same context;
|
||||
* until the context is reset, each project will only be built at most once.
|
||||
*
|
||||
* Example: In a standard setup where project B depends on project A, and both are out of date,
|
||||
* a failed build of A will result in A remaining out of date. When we try to build
|
||||
* B, we should immediately bail instead of recomputing A's up-to-date status again.
|
||||
*
|
||||
* This also matters for performing fast (i.e. fake) downstream builds of projects
|
||||
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
|
||||
*/
|
||||
interface BuildContext {
|
||||
options: BuildOptions;
|
||||
/**
|
||||
* Map from output file name to its pre-build timestamp
|
||||
*/
|
||||
unchangedOutputs: FileMap<Date>;
|
||||
/**
|
||||
* Map from config file name to up-to-date status
|
||||
*/
|
||||
projectStatus: FileMap<UpToDateStatus>;
|
||||
invalidatedProjects: FileMap<true>;
|
||||
queuedProjects: FileMap<true>;
|
||||
missingRoots: Map<true>;
|
||||
}
|
||||
type Mapper = ReturnType<typeof createDependencyMapper>;
|
||||
interface DependencyGraph {
|
||||
buildQueue: ResolvedConfigFileName[];
|
||||
dependencyMap: Mapper;
|
||||
}
|
||||
interface BuildOptions {
|
||||
dry: boolean;
|
||||
force: boolean;
|
||||
verbose: boolean;
|
||||
}
|
||||
enum UpToDateStatusType {
|
||||
Unbuildable = 0,
|
||||
UpToDate = 1,
|
||||
/**
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
|
||||
*/
|
||||
UpToDateWithUpstreamTypes = 2,
|
||||
OutputMissing = 3,
|
||||
OutOfDateWithSelf = 4,
|
||||
OutOfDateWithUpstream = 5,
|
||||
UpstreamOutOfDate = 6,
|
||||
UpstreamBlocked = 7,
|
||||
/**
|
||||
* Projects with no outputs (i.e. "solution" files)
|
||||
*/
|
||||
ContainerOnly = 8
|
||||
}
|
||||
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
|
||||
namespace Status {
|
||||
/**
|
||||
* The project can't be built at all in its current state. For example,
|
||||
* its config file cannot be parsed, or it has a syntax error or missing file
|
||||
*/
|
||||
interface Unbuildable {
|
||||
type: UpToDateStatusType.Unbuildable;
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
|
||||
*/
|
||||
interface ContainerOnly {
|
||||
type: UpToDateStatusType.ContainerOnly;
|
||||
}
|
||||
/**
|
||||
* The project is up to date with respect to its inputs.
|
||||
* We track what the newest input file is.
|
||||
*/
|
||||
interface UpToDate {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime?: Date;
|
||||
newestOutputFileTime?: Date;
|
||||
newestOutputFileName?: string;
|
||||
oldestOutputFileName?: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the outputs of the project does not exist.
|
||||
*/
|
||||
interface OutputMissing {
|
||||
type: UpToDateStatusType.OutputMissing;
|
||||
/**
|
||||
* The name of the first output file that didn't exist
|
||||
*/
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
interface OutOfDateWithSelf {
|
||||
type: UpToDateStatusType.OutOfDateWithSelf;
|
||||
outOfDateOutputFileName: string;
|
||||
newerInputFileName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends on an out-of-date project, so shouldn't be built yet
|
||||
*/
|
||||
interface UpstreamOutOfDate {
|
||||
type: UpToDateStatusType.UpstreamOutOfDate;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends an upstream project with build errors
|
||||
*/
|
||||
interface UpstreamBlocked {
|
||||
type: UpToDateStatusType.UpstreamBlocked;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than the newest output of
|
||||
* an upstream project.
|
||||
*/
|
||||
interface OutOfDateWithUpstream {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream;
|
||||
outOfDateOutputFileName: string;
|
||||
newerProjectName: string;
|
||||
}
|
||||
}
|
||||
interface FileMap<T> {
|
||||
setValue(fileName: string, value: T): void;
|
||||
getValue(fileName: string): T | never;
|
||||
getValueOrUndefined(fileName: string): T | undefined;
|
||||
hasKey(fileName: string): boolean;
|
||||
removeKey(fileName: string): void;
|
||||
getKeys(): string[];
|
||||
}
|
||||
function createDependencyMapper(): {
|
||||
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
|
||||
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => ExitStatus;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
buildInvalidatedProjects: () => void;
|
||||
buildDependentInvalidatedProjects: () => void;
|
||||
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
|
||||
startWatching: () => void;
|
||||
};
|
||||
/**
|
||||
* Gets the UpToDateStatus for a project
|
||||
*/
|
||||
function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus;
|
||||
function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray<string>;
|
||||
function formatUpToDateStatus<T>(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
|
||||
+41
-13
@@ -75,7 +75,7 @@ var ts;
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
ts.versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
/* @internal */
|
||||
@@ -33836,19 +33836,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156 /* GetAccessor */) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -50634,9 +50638,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
case 156 /* GetAccessor */:
|
||||
case 157 /* SetAccessor */:
|
||||
var otherKind = node.kind === 156 /* GetAccessor */ ? 157 /* SetAccessor */ : 156 /* GetAccessor */;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -63967,6 +63975,11 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
/**
|
||||
* Serializes the type of a node for use with decorator type metadata.
|
||||
*
|
||||
@@ -63976,10 +63989,10 @@ var ts;
|
||||
switch (node.kind) {
|
||||
case 152 /* PropertyDeclaration */:
|
||||
case 149 /* Parameter */:
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157 /* SetAccessor */:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238 /* ClassDeclaration */:
|
||||
case 207 /* ClassExpression */:
|
||||
case 154 /* MethodDeclaration */:
|
||||
@@ -76373,7 +76386,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278 /* Bundle */) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -76387,7 +76400,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
||||
needsDeclare = false;
|
||||
@@ -76408,7 +76421,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
// Single source file
|
||||
@@ -77185,6 +77198,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -77198,7 +77220,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
||||
var parentIsFile = node.parent.kind === 277 /* SourceFile */;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1 /* Export */) | 512 /* Default */ | 2 /* Ambient */);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */);
|
||||
additions = 0 /* None */;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -77257,6 +77279,11 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 /* All */ ^ 4 /* Public */; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
|
||||
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
|
||||
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
|
||||
flags ^= 1 /* Export */;
|
||||
}
|
||||
if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {
|
||||
flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)
|
||||
}
|
||||
@@ -86899,6 +86926,7 @@ var ts;
|
||||
}
|
||||
ts.createWatchProgram = createWatchProgram;
|
||||
})(ts || (ts = {}));
|
||||
/* @internal */
|
||||
var ts;
|
||||
(function (ts) {
|
||||
var minimumDate = new Date(-8640000000000000);
|
||||
@@ -113800,8 +113828,8 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var result = [];
|
||||
for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
|
||||
var ref = refs_2[_i];
|
||||
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
|
||||
var ref = refs_1[_i];
|
||||
result.push({
|
||||
path: ts.normalizeSlashes(ref.fileName),
|
||||
position: ref.pos,
|
||||
|
||||
Vendored
-182
@@ -2579,14 +2579,6 @@ declare namespace ts {
|
||||
oldProgram?: Program;
|
||||
configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>;
|
||||
}
|
||||
interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
getUnchangedTime?(fileName: string): Date | undefined;
|
||||
getLastStatus?(fileName: string): UpToDateStatus | undefined;
|
||||
setLastStatus?(fileName: string, status: UpToDateStatus): void;
|
||||
parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string | undefined;
|
||||
@@ -4406,180 +4398,6 @@ declare namespace ts {
|
||||
*/
|
||||
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
|
||||
}
|
||||
declare namespace ts {
|
||||
interface BuildHost {
|
||||
verbose(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
error(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
errorDiagnostic(diag: Diagnostic): void;
|
||||
message(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
}
|
||||
/**
|
||||
* A BuildContext tracks what's going on during the course of a build.
|
||||
*
|
||||
* Callers may invoke any number of build requests within the same context;
|
||||
* until the context is reset, each project will only be built at most once.
|
||||
*
|
||||
* Example: In a standard setup where project B depends on project A, and both are out of date,
|
||||
* a failed build of A will result in A remaining out of date. When we try to build
|
||||
* B, we should immediately bail instead of recomputing A's up-to-date status again.
|
||||
*
|
||||
* This also matters for performing fast (i.e. fake) downstream builds of projects
|
||||
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
|
||||
*/
|
||||
interface BuildContext {
|
||||
options: BuildOptions;
|
||||
/**
|
||||
* Map from output file name to its pre-build timestamp
|
||||
*/
|
||||
unchangedOutputs: FileMap<Date>;
|
||||
/**
|
||||
* Map from config file name to up-to-date status
|
||||
*/
|
||||
projectStatus: FileMap<UpToDateStatus>;
|
||||
invalidatedProjects: FileMap<true>;
|
||||
queuedProjects: FileMap<true>;
|
||||
missingRoots: Map<true>;
|
||||
}
|
||||
type Mapper = ReturnType<typeof createDependencyMapper>;
|
||||
interface DependencyGraph {
|
||||
buildQueue: ResolvedConfigFileName[];
|
||||
dependencyMap: Mapper;
|
||||
}
|
||||
interface BuildOptions {
|
||||
dry: boolean;
|
||||
force: boolean;
|
||||
verbose: boolean;
|
||||
}
|
||||
enum UpToDateStatusType {
|
||||
Unbuildable = 0,
|
||||
UpToDate = 1,
|
||||
/**
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
|
||||
*/
|
||||
UpToDateWithUpstreamTypes = 2,
|
||||
OutputMissing = 3,
|
||||
OutOfDateWithSelf = 4,
|
||||
OutOfDateWithUpstream = 5,
|
||||
UpstreamOutOfDate = 6,
|
||||
UpstreamBlocked = 7,
|
||||
/**
|
||||
* Projects with no outputs (i.e. "solution" files)
|
||||
*/
|
||||
ContainerOnly = 8
|
||||
}
|
||||
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
|
||||
namespace Status {
|
||||
/**
|
||||
* The project can't be built at all in its current state. For example,
|
||||
* its config file cannot be parsed, or it has a syntax error or missing file
|
||||
*/
|
||||
interface Unbuildable {
|
||||
type: UpToDateStatusType.Unbuildable;
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
|
||||
*/
|
||||
interface ContainerOnly {
|
||||
type: UpToDateStatusType.ContainerOnly;
|
||||
}
|
||||
/**
|
||||
* The project is up to date with respect to its inputs.
|
||||
* We track what the newest input file is.
|
||||
*/
|
||||
interface UpToDate {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime?: Date;
|
||||
newestOutputFileTime?: Date;
|
||||
newestOutputFileName?: string;
|
||||
oldestOutputFileName?: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the outputs of the project does not exist.
|
||||
*/
|
||||
interface OutputMissing {
|
||||
type: UpToDateStatusType.OutputMissing;
|
||||
/**
|
||||
* The name of the first output file that didn't exist
|
||||
*/
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
interface OutOfDateWithSelf {
|
||||
type: UpToDateStatusType.OutOfDateWithSelf;
|
||||
outOfDateOutputFileName: string;
|
||||
newerInputFileName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends on an out-of-date project, so shouldn't be built yet
|
||||
*/
|
||||
interface UpstreamOutOfDate {
|
||||
type: UpToDateStatusType.UpstreamOutOfDate;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends an upstream project with build errors
|
||||
*/
|
||||
interface UpstreamBlocked {
|
||||
type: UpToDateStatusType.UpstreamBlocked;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than the newest output of
|
||||
* an upstream project.
|
||||
*/
|
||||
interface OutOfDateWithUpstream {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream;
|
||||
outOfDateOutputFileName: string;
|
||||
newerProjectName: string;
|
||||
}
|
||||
}
|
||||
interface FileMap<T> {
|
||||
setValue(fileName: string, value: T): void;
|
||||
getValue(fileName: string): T | never;
|
||||
getValueOrUndefined(fileName: string): T | undefined;
|
||||
hasKey(fileName: string): boolean;
|
||||
removeKey(fileName: string): void;
|
||||
getKeys(): string[];
|
||||
}
|
||||
function createDependencyMapper(): {
|
||||
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
|
||||
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => ExitStatus;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
buildInvalidatedProjects: () => void;
|
||||
buildDependentInvalidatedProjects: () => void;
|
||||
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
|
||||
startWatching: () => void;
|
||||
};
|
||||
/**
|
||||
* Gets the UpToDateStatus for a project
|
||||
*/
|
||||
function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus;
|
||||
function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray<string>;
|
||||
function formatUpToDateStatus<T>(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
|
||||
+41
-13
@@ -75,7 +75,7 @@ var ts;
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
ts.versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
/* @internal */
|
||||
@@ -33836,19 +33836,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156 /* GetAccessor */) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -50634,9 +50638,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
case 156 /* GetAccessor */:
|
||||
case 157 /* SetAccessor */:
|
||||
var otherKind = node.kind === 156 /* GetAccessor */ ? 157 /* SetAccessor */ : 156 /* GetAccessor */;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -63967,6 +63975,11 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
/**
|
||||
* Serializes the type of a node for use with decorator type metadata.
|
||||
*
|
||||
@@ -63976,10 +63989,10 @@ var ts;
|
||||
switch (node.kind) {
|
||||
case 152 /* PropertyDeclaration */:
|
||||
case 149 /* Parameter */:
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157 /* SetAccessor */:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238 /* ClassDeclaration */:
|
||||
case 207 /* ClassExpression */:
|
||||
case 154 /* MethodDeclaration */:
|
||||
@@ -76373,7 +76386,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278 /* Bundle */) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -76387,7 +76400,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
||||
needsDeclare = false;
|
||||
@@ -76408,7 +76421,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
// Single source file
|
||||
@@ -77185,6 +77198,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -77198,7 +77220,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
||||
var parentIsFile = node.parent.kind === 277 /* SourceFile */;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1 /* Export */) | 512 /* Default */ | 2 /* Ambient */);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */);
|
||||
additions = 0 /* None */;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -77257,6 +77279,11 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 /* All */ ^ 4 /* Public */; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
|
||||
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
|
||||
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
|
||||
flags ^= 1 /* Export */;
|
||||
}
|
||||
if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {
|
||||
flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)
|
||||
}
|
||||
@@ -86899,6 +86926,7 @@ var ts;
|
||||
}
|
||||
ts.createWatchProgram = createWatchProgram;
|
||||
})(ts || (ts = {}));
|
||||
/* @internal */
|
||||
var ts;
|
||||
(function (ts) {
|
||||
var minimumDate = new Date(-8640000000000000);
|
||||
@@ -113800,8 +113828,8 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var result = [];
|
||||
for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
|
||||
var ref = refs_2[_i];
|
||||
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
|
||||
var ref = refs_1[_i];
|
||||
result.push({
|
||||
path: ts.normalizeSlashes(ref.fileName),
|
||||
position: ref.pos,
|
||||
|
||||
Vendored
-182
@@ -2579,14 +2579,6 @@ declare namespace ts {
|
||||
oldProgram?: Program;
|
||||
configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>;
|
||||
}
|
||||
interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
getUnchangedTime?(fileName: string): Date | undefined;
|
||||
getLastStatus?(fileName: string): UpToDateStatus | undefined;
|
||||
setLastStatus?(fileName: string, status: UpToDateStatus): void;
|
||||
parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string | undefined;
|
||||
@@ -4406,180 +4398,6 @@ declare namespace ts {
|
||||
*/
|
||||
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
|
||||
}
|
||||
declare namespace ts {
|
||||
interface BuildHost {
|
||||
verbose(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
error(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
errorDiagnostic(diag: Diagnostic): void;
|
||||
message(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
}
|
||||
/**
|
||||
* A BuildContext tracks what's going on during the course of a build.
|
||||
*
|
||||
* Callers may invoke any number of build requests within the same context;
|
||||
* until the context is reset, each project will only be built at most once.
|
||||
*
|
||||
* Example: In a standard setup where project B depends on project A, and both are out of date,
|
||||
* a failed build of A will result in A remaining out of date. When we try to build
|
||||
* B, we should immediately bail instead of recomputing A's up-to-date status again.
|
||||
*
|
||||
* This also matters for performing fast (i.e. fake) downstream builds of projects
|
||||
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
|
||||
*/
|
||||
interface BuildContext {
|
||||
options: BuildOptions;
|
||||
/**
|
||||
* Map from output file name to its pre-build timestamp
|
||||
*/
|
||||
unchangedOutputs: FileMap<Date>;
|
||||
/**
|
||||
* Map from config file name to up-to-date status
|
||||
*/
|
||||
projectStatus: FileMap<UpToDateStatus>;
|
||||
invalidatedProjects: FileMap<true>;
|
||||
queuedProjects: FileMap<true>;
|
||||
missingRoots: Map<true>;
|
||||
}
|
||||
type Mapper = ReturnType<typeof createDependencyMapper>;
|
||||
interface DependencyGraph {
|
||||
buildQueue: ResolvedConfigFileName[];
|
||||
dependencyMap: Mapper;
|
||||
}
|
||||
interface BuildOptions {
|
||||
dry: boolean;
|
||||
force: boolean;
|
||||
verbose: boolean;
|
||||
}
|
||||
enum UpToDateStatusType {
|
||||
Unbuildable = 0,
|
||||
UpToDate = 1,
|
||||
/**
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
|
||||
*/
|
||||
UpToDateWithUpstreamTypes = 2,
|
||||
OutputMissing = 3,
|
||||
OutOfDateWithSelf = 4,
|
||||
OutOfDateWithUpstream = 5,
|
||||
UpstreamOutOfDate = 6,
|
||||
UpstreamBlocked = 7,
|
||||
/**
|
||||
* Projects with no outputs (i.e. "solution" files)
|
||||
*/
|
||||
ContainerOnly = 8
|
||||
}
|
||||
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
|
||||
namespace Status {
|
||||
/**
|
||||
* The project can't be built at all in its current state. For example,
|
||||
* its config file cannot be parsed, or it has a syntax error or missing file
|
||||
*/
|
||||
interface Unbuildable {
|
||||
type: UpToDateStatusType.Unbuildable;
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
|
||||
*/
|
||||
interface ContainerOnly {
|
||||
type: UpToDateStatusType.ContainerOnly;
|
||||
}
|
||||
/**
|
||||
* The project is up to date with respect to its inputs.
|
||||
* We track what the newest input file is.
|
||||
*/
|
||||
interface UpToDate {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime?: Date;
|
||||
newestOutputFileTime?: Date;
|
||||
newestOutputFileName?: string;
|
||||
oldestOutputFileName?: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the outputs of the project does not exist.
|
||||
*/
|
||||
interface OutputMissing {
|
||||
type: UpToDateStatusType.OutputMissing;
|
||||
/**
|
||||
* The name of the first output file that didn't exist
|
||||
*/
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
interface OutOfDateWithSelf {
|
||||
type: UpToDateStatusType.OutOfDateWithSelf;
|
||||
outOfDateOutputFileName: string;
|
||||
newerInputFileName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends on an out-of-date project, so shouldn't be built yet
|
||||
*/
|
||||
interface UpstreamOutOfDate {
|
||||
type: UpToDateStatusType.UpstreamOutOfDate;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends an upstream project with build errors
|
||||
*/
|
||||
interface UpstreamBlocked {
|
||||
type: UpToDateStatusType.UpstreamBlocked;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than the newest output of
|
||||
* an upstream project.
|
||||
*/
|
||||
interface OutOfDateWithUpstream {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream;
|
||||
outOfDateOutputFileName: string;
|
||||
newerProjectName: string;
|
||||
}
|
||||
}
|
||||
interface FileMap<T> {
|
||||
setValue(fileName: string, value: T): void;
|
||||
getValue(fileName: string): T | never;
|
||||
getValueOrUndefined(fileName: string): T | undefined;
|
||||
hasKey(fileName: string): boolean;
|
||||
removeKey(fileName: string): void;
|
||||
getKeys(): string[];
|
||||
}
|
||||
function createDependencyMapper(): {
|
||||
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
|
||||
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => ExitStatus;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
buildInvalidatedProjects: () => void;
|
||||
buildDependentInvalidatedProjects: () => void;
|
||||
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
|
||||
startWatching: () => void;
|
||||
};
|
||||
/**
|
||||
* Gets the UpToDateStatus for a project
|
||||
*/
|
||||
function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus;
|
||||
function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray<string>;
|
||||
function formatUpToDateStatus<T>(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
|
||||
+41
-13
@@ -75,7 +75,7 @@ var ts;
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
ts.versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
/* @internal */
|
||||
@@ -33836,19 +33836,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156 /* GetAccessor */) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -50634,9 +50638,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
case 156 /* GetAccessor */:
|
||||
case 157 /* SetAccessor */:
|
||||
var otherKind = node.kind === 156 /* GetAccessor */ ? 157 /* SetAccessor */ : 156 /* GetAccessor */;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -63967,6 +63975,11 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
/**
|
||||
* Serializes the type of a node for use with decorator type metadata.
|
||||
*
|
||||
@@ -63976,10 +63989,10 @@ var ts;
|
||||
switch (node.kind) {
|
||||
case 152 /* PropertyDeclaration */:
|
||||
case 149 /* Parameter */:
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157 /* SetAccessor */:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238 /* ClassDeclaration */:
|
||||
case 207 /* ClassExpression */:
|
||||
case 154 /* MethodDeclaration */:
|
||||
@@ -76373,7 +76386,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278 /* Bundle */) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -76387,7 +76400,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
||||
needsDeclare = false;
|
||||
@@ -76408,7 +76421,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
// Single source file
|
||||
@@ -77185,6 +77198,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -77198,7 +77220,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
||||
var parentIsFile = node.parent.kind === 277 /* SourceFile */;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1 /* Export */) | 512 /* Default */ | 2 /* Ambient */);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */);
|
||||
additions = 0 /* None */;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -77257,6 +77279,11 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 /* All */ ^ 4 /* Public */; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
|
||||
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
|
||||
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
|
||||
flags ^= 1 /* Export */;
|
||||
}
|
||||
if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {
|
||||
flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)
|
||||
}
|
||||
@@ -86899,6 +86926,7 @@ var ts;
|
||||
}
|
||||
ts.createWatchProgram = createWatchProgram;
|
||||
})(ts || (ts = {}));
|
||||
/* @internal */
|
||||
var ts;
|
||||
(function (ts) {
|
||||
var minimumDate = new Date(-8640000000000000);
|
||||
@@ -113800,8 +113828,8 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
var result = [];
|
||||
for (var _i = 0, refs_2 = refs; _i < refs_2.length; _i++) {
|
||||
var ref = refs_2[_i];
|
||||
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
|
||||
var ref = refs_1[_i];
|
||||
result.push({
|
||||
path: ts.normalizeSlashes(ref.fileName),
|
||||
position: ref.pos,
|
||||
|
||||
+39
-11
@@ -88,7 +88,7 @@ var ts;
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
ts.versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = ts.versionMajorMinor + ".1";
|
||||
ts.version = ts.versionMajorMinor + ".2";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
/* @internal */
|
||||
@@ -33849,19 +33849,23 @@ var ts;
|
||||
return createAnonymousType(symbol, exports_1, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
|
||||
}
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
function getAnnotatedAccessorTypeNode(accessor) {
|
||||
if (accessor) {
|
||||
if (accessor.kind === 156 /* GetAccessor */) {
|
||||
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
|
||||
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
|
||||
return getterTypeAnnotation;
|
||||
}
|
||||
else {
|
||||
var setterTypeAnnotation = ts.getEffectiveSetAccessorTypeAnnotationNode(accessor);
|
||||
return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);
|
||||
return setterTypeAnnotation;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getAnnotatedAccessorType(accessor) {
|
||||
var node = getAnnotatedAccessorTypeNode(accessor);
|
||||
return node && getTypeFromTypeNode(node);
|
||||
}
|
||||
function getAnnotatedAccessorThisParameter(accessor) {
|
||||
var parameter = getAccessorThisParameter(accessor);
|
||||
return parameter && parameter.symbol;
|
||||
@@ -50647,9 +50651,13 @@ var ts;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
case 156 /* GetAccessor */:
|
||||
case 157 /* SetAccessor */:
|
||||
var otherKind = node.kind === 156 /* GetAccessor */ ? 157 /* SetAccessor */ : 156 /* GetAccessor */;
|
||||
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor));
|
||||
break;
|
||||
case 154 /* MethodDeclaration */:
|
||||
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
|
||||
var parameter = _c[_b];
|
||||
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
|
||||
@@ -63980,6 +63988,11 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getAccessorTypeNode(node) {
|
||||
var accessors = resolver.getAllAccessorDeclarations(node);
|
||||
return accessors.setAccessor && ts.getSetAccessorTypeAnnotationNode(accessors.setAccessor)
|
||||
|| accessors.getAccessor && ts.getEffectiveReturnTypeNode(accessors.getAccessor);
|
||||
}
|
||||
/**
|
||||
* Serializes the type of a node for use with decorator type metadata.
|
||||
*
|
||||
@@ -63989,10 +64002,10 @@ var ts;
|
||||
switch (node.kind) {
|
||||
case 152 /* PropertyDeclaration */:
|
||||
case 149 /* Parameter */:
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(node.type);
|
||||
case 157 /* SetAccessor */:
|
||||
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
|
||||
case 156 /* GetAccessor */:
|
||||
return serializeTypeNode(getAccessorTypeNode(node));
|
||||
case 238 /* ClassDeclaration */:
|
||||
case 207 /* ClassExpression */:
|
||||
case 154 /* MethodDeclaration */:
|
||||
@@ -76386,7 +76399,7 @@ var ts;
|
||||
}
|
||||
if (node.kind === 278 /* Bundle */) {
|
||||
isBundledEmit = true;
|
||||
var refs_1 = ts.createMap();
|
||||
refs = ts.createMap();
|
||||
var hasNoDefaultLib_1 = false;
|
||||
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
|
||||
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
|
||||
@@ -76400,7 +76413,7 @@ var ts;
|
||||
getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
||||
needsScopeFixMarker = false;
|
||||
resultHasScopeMarker = false;
|
||||
collectReferences(sourceFile, refs_1);
|
||||
collectReferences(sourceFile, refs);
|
||||
if (ts.isExternalModule(sourceFile)) {
|
||||
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
||||
needsDeclare = false;
|
||||
@@ -76421,7 +76434,7 @@ var ts;
|
||||
bundle.hasNoDefaultLib = hasNoDefaultLib_1;
|
||||
var outputFilePath_1 = ts.getDirectoryPath(ts.normalizeSlashes(ts.getOutputPathsFor(node, host, /*forceDtsPaths*/ true).declarationFilePath));
|
||||
var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1);
|
||||
refs_1.forEach(referenceVisitor_1);
|
||||
refs.forEach(referenceVisitor_1);
|
||||
return bundle;
|
||||
}
|
||||
// Single source file
|
||||
@@ -77198,6 +77211,15 @@ var ts;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isScopeMarker(node) {
|
||||
return ts.isExportAssignment(node) || ts.isExportDeclaration(node);
|
||||
}
|
||||
function hasScopeMarker(node) {
|
||||
if (ts.isModuleBlock(node)) {
|
||||
return ts.some(node.statements, isScopeMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function ensureModifiers(node, privateDeclaration) {
|
||||
var currentFlags = ts.getModifierFlags(node);
|
||||
var newFlags = ensureModifierFlags(node, privateDeclaration);
|
||||
@@ -77211,7 +77233,7 @@ var ts;
|
||||
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */;
|
||||
var parentIsFile = node.parent.kind === 277 /* SourceFile */;
|
||||
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1 /* Export */) | 512 /* Default */ | 2 /* Ambient */);
|
||||
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) || hasScopeMarker(node.parent) ? 0 : 1 /* Export */) | 2 /* Ambient */);
|
||||
additions = 0 /* None */;
|
||||
}
|
||||
return maskModifierFlags(node, mask, additions);
|
||||
@@ -77270,6 +77292,11 @@ var ts;
|
||||
if (modifierMask === void 0) { modifierMask = 3071 /* All */ ^ 4 /* Public */; }
|
||||
if (modifierAdditions === void 0) { modifierAdditions = 0 /* None */; }
|
||||
var flags = (ts.getModifierFlags(node) & modifierMask) | modifierAdditions;
|
||||
if (flags & 512 /* Default */ && !(flags & 1 /* Export */)) {
|
||||
// A non-exported default is a nonsequitor - we usually try to remove all export modifiers
|
||||
// from statements in ambient declarations; but a default export must retain its export modifier to be syntactically valid
|
||||
flags ^= 1 /* Export */;
|
||||
}
|
||||
if (flags & 512 /* Default */ && flags & 2 /* Ambient */) {
|
||||
flags ^= 2 /* Ambient */; // `declare` is never required alongside `default` (and would be an error if printed)
|
||||
}
|
||||
@@ -86912,6 +86939,7 @@ var ts;
|
||||
}
|
||||
ts.createWatchProgram = createWatchProgram;
|
||||
})(ts || (ts = {}));
|
||||
/* @internal */
|
||||
var ts;
|
||||
(function (ts) {
|
||||
var minimumDate = new Date(-8640000000000000);
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "typescript",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "typescript",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "http://typescriptlang.org/",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"license": "Apache-2.0",
|
||||
"description": "TypeScript is a language for application scale JavaScript development",
|
||||
"keywords": [
|
||||
|
||||
@@ -22171,6 +22171,7 @@ namespace ts {
|
||||
for (const decl of indexSymbol.declarations) {
|
||||
const declaration = <SignatureDeclaration>decl;
|
||||
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
||||
// tslint:disable-next-line
|
||||
switch (declaration.parameters[0].type!.kind) {
|
||||
case SyntaxKind.StringKeyword:
|
||||
if (!seenStringIndexer) {
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace ts {
|
||||
// If changing the text in this section, be sure to test `configureNightly` too.
|
||||
export const versionMajorMinor = "3.0";
|
||||
/** The version of the TypeScript compiler release */
|
||||
export const version = `${versionMajorMinor}.1`;
|
||||
export const version = `${versionMajorMinor}.2`;
|
||||
}
|
||||
|
||||
namespace ts {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
const minimumDate = new Date(-8640000000000000);
|
||||
const maximumDate = new Date(8640000000000000);
|
||||
|
||||
@@ -4680,6 +4680,7 @@ namespace ts {
|
||||
verticalTab = 0x0B, // \v
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
|
||||
@@ -360,6 +360,7 @@ namespace ts.JsDoc {
|
||||
const varStatement = <VariableStatement>commentOwner;
|
||||
const varDeclarations = varStatement.declarationList.declarations;
|
||||
const parameters = varDeclarations.length === 1 && varDeclarations[0].initializer
|
||||
// tslint:disable-next-line
|
||||
? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer!)
|
||||
: undefined;
|
||||
return { commentOwner, parameters };
|
||||
|
||||
-182
@@ -2579,14 +2579,6 @@ declare namespace ts {
|
||||
oldProgram?: Program;
|
||||
configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>;
|
||||
}
|
||||
interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
getUnchangedTime?(fileName: string): Date | undefined;
|
||||
getLastStatus?(fileName: string): UpToDateStatus | undefined;
|
||||
setLastStatus?(fileName: string, status: UpToDateStatus): void;
|
||||
parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string | undefined;
|
||||
@@ -4406,180 +4398,6 @@ declare namespace ts {
|
||||
*/
|
||||
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
|
||||
}
|
||||
declare namespace ts {
|
||||
interface BuildHost {
|
||||
verbose(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
error(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
errorDiagnostic(diag: Diagnostic): void;
|
||||
message(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
}
|
||||
/**
|
||||
* A BuildContext tracks what's going on during the course of a build.
|
||||
*
|
||||
* Callers may invoke any number of build requests within the same context;
|
||||
* until the context is reset, each project will only be built at most once.
|
||||
*
|
||||
* Example: In a standard setup where project B depends on project A, and both are out of date,
|
||||
* a failed build of A will result in A remaining out of date. When we try to build
|
||||
* B, we should immediately bail instead of recomputing A's up-to-date status again.
|
||||
*
|
||||
* This also matters for performing fast (i.e. fake) downstream builds of projects
|
||||
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
|
||||
*/
|
||||
interface BuildContext {
|
||||
options: BuildOptions;
|
||||
/**
|
||||
* Map from output file name to its pre-build timestamp
|
||||
*/
|
||||
unchangedOutputs: FileMap<Date>;
|
||||
/**
|
||||
* Map from config file name to up-to-date status
|
||||
*/
|
||||
projectStatus: FileMap<UpToDateStatus>;
|
||||
invalidatedProjects: FileMap<true>;
|
||||
queuedProjects: FileMap<true>;
|
||||
missingRoots: Map<true>;
|
||||
}
|
||||
type Mapper = ReturnType<typeof createDependencyMapper>;
|
||||
interface DependencyGraph {
|
||||
buildQueue: ResolvedConfigFileName[];
|
||||
dependencyMap: Mapper;
|
||||
}
|
||||
interface BuildOptions {
|
||||
dry: boolean;
|
||||
force: boolean;
|
||||
verbose: boolean;
|
||||
}
|
||||
enum UpToDateStatusType {
|
||||
Unbuildable = 0,
|
||||
UpToDate = 1,
|
||||
/**
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
|
||||
*/
|
||||
UpToDateWithUpstreamTypes = 2,
|
||||
OutputMissing = 3,
|
||||
OutOfDateWithSelf = 4,
|
||||
OutOfDateWithUpstream = 5,
|
||||
UpstreamOutOfDate = 6,
|
||||
UpstreamBlocked = 7,
|
||||
/**
|
||||
* Projects with no outputs (i.e. "solution" files)
|
||||
*/
|
||||
ContainerOnly = 8
|
||||
}
|
||||
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
|
||||
namespace Status {
|
||||
/**
|
||||
* The project can't be built at all in its current state. For example,
|
||||
* its config file cannot be parsed, or it has a syntax error or missing file
|
||||
*/
|
||||
interface Unbuildable {
|
||||
type: UpToDateStatusType.Unbuildable;
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
|
||||
*/
|
||||
interface ContainerOnly {
|
||||
type: UpToDateStatusType.ContainerOnly;
|
||||
}
|
||||
/**
|
||||
* The project is up to date with respect to its inputs.
|
||||
* We track what the newest input file is.
|
||||
*/
|
||||
interface UpToDate {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime?: Date;
|
||||
newestOutputFileTime?: Date;
|
||||
newestOutputFileName?: string;
|
||||
oldestOutputFileName?: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the outputs of the project does not exist.
|
||||
*/
|
||||
interface OutputMissing {
|
||||
type: UpToDateStatusType.OutputMissing;
|
||||
/**
|
||||
* The name of the first output file that didn't exist
|
||||
*/
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
interface OutOfDateWithSelf {
|
||||
type: UpToDateStatusType.OutOfDateWithSelf;
|
||||
outOfDateOutputFileName: string;
|
||||
newerInputFileName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends on an out-of-date project, so shouldn't be built yet
|
||||
*/
|
||||
interface UpstreamOutOfDate {
|
||||
type: UpToDateStatusType.UpstreamOutOfDate;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends an upstream project with build errors
|
||||
*/
|
||||
interface UpstreamBlocked {
|
||||
type: UpToDateStatusType.UpstreamBlocked;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than the newest output of
|
||||
* an upstream project.
|
||||
*/
|
||||
interface OutOfDateWithUpstream {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream;
|
||||
outOfDateOutputFileName: string;
|
||||
newerProjectName: string;
|
||||
}
|
||||
}
|
||||
interface FileMap<T> {
|
||||
setValue(fileName: string, value: T): void;
|
||||
getValue(fileName: string): T | never;
|
||||
getValueOrUndefined(fileName: string): T | undefined;
|
||||
hasKey(fileName: string): boolean;
|
||||
removeKey(fileName: string): void;
|
||||
getKeys(): string[];
|
||||
}
|
||||
function createDependencyMapper(): {
|
||||
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
|
||||
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => ExitStatus;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
buildInvalidatedProjects: () => void;
|
||||
buildDependentInvalidatedProjects: () => void;
|
||||
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
|
||||
startWatching: () => void;
|
||||
};
|
||||
/**
|
||||
* Gets the UpToDateStatus for a project
|
||||
*/
|
||||
function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus;
|
||||
function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray<string>;
|
||||
function formatUpToDateStatus<T>(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
|
||||
-182
@@ -2579,14 +2579,6 @@ declare namespace ts {
|
||||
oldProgram?: Program;
|
||||
configFileParsingDiagnostics?: ReadonlyArray<Diagnostic>;
|
||||
}
|
||||
interface UpToDateHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
getModifiedTime(fileName: string): Date;
|
||||
getUnchangedTime?(fileName: string): Date | undefined;
|
||||
getLastStatus?(fileName: string): UpToDateStatus | undefined;
|
||||
setLastStatus?(fileName: string, status: UpToDateStatus): void;
|
||||
parseConfigFile?(configFilePath: ResolvedConfigFileName): ParsedCommandLine | undefined;
|
||||
}
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string | undefined;
|
||||
@@ -4406,180 +4398,6 @@ declare namespace ts {
|
||||
*/
|
||||
function createWatchProgram<T extends BuilderProgram>(host: WatchCompilerHostOfConfigFile<T>): WatchOfConfigFile<T>;
|
||||
}
|
||||
declare namespace ts {
|
||||
interface BuildHost {
|
||||
verbose(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
error(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
errorDiagnostic(diag: Diagnostic): void;
|
||||
message(diag: DiagnosticMessage, ...args: string[]): void;
|
||||
}
|
||||
/**
|
||||
* A BuildContext tracks what's going on during the course of a build.
|
||||
*
|
||||
* Callers may invoke any number of build requests within the same context;
|
||||
* until the context is reset, each project will only be built at most once.
|
||||
*
|
||||
* Example: In a standard setup where project B depends on project A, and both are out of date,
|
||||
* a failed build of A will result in A remaining out of date. When we try to build
|
||||
* B, we should immediately bail instead of recomputing A's up-to-date status again.
|
||||
*
|
||||
* This also matters for performing fast (i.e. fake) downstream builds of projects
|
||||
* when their upstream .d.ts files haven't changed content (but have newer timestamps)
|
||||
*/
|
||||
interface BuildContext {
|
||||
options: BuildOptions;
|
||||
/**
|
||||
* Map from output file name to its pre-build timestamp
|
||||
*/
|
||||
unchangedOutputs: FileMap<Date>;
|
||||
/**
|
||||
* Map from config file name to up-to-date status
|
||||
*/
|
||||
projectStatus: FileMap<UpToDateStatus>;
|
||||
invalidatedProjects: FileMap<true>;
|
||||
queuedProjects: FileMap<true>;
|
||||
missingRoots: Map<true>;
|
||||
}
|
||||
type Mapper = ReturnType<typeof createDependencyMapper>;
|
||||
interface DependencyGraph {
|
||||
buildQueue: ResolvedConfigFileName[];
|
||||
dependencyMap: Mapper;
|
||||
}
|
||||
interface BuildOptions {
|
||||
dry: boolean;
|
||||
force: boolean;
|
||||
verbose: boolean;
|
||||
}
|
||||
enum UpToDateStatusType {
|
||||
Unbuildable = 0,
|
||||
UpToDate = 1,
|
||||
/**
|
||||
* The project appears out of date because its upstream inputs are newer than its outputs,
|
||||
* but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs.
|
||||
* This means we can Pseudo-build (just touch timestamps), as if we had actually built this project.
|
||||
*/
|
||||
UpToDateWithUpstreamTypes = 2,
|
||||
OutputMissing = 3,
|
||||
OutOfDateWithSelf = 4,
|
||||
OutOfDateWithUpstream = 5,
|
||||
UpstreamOutOfDate = 6,
|
||||
UpstreamBlocked = 7,
|
||||
/**
|
||||
* Projects with no outputs (i.e. "solution" files)
|
||||
*/
|
||||
ContainerOnly = 8
|
||||
}
|
||||
type UpToDateStatus = Status.Unbuildable | Status.UpToDate | Status.OutputMissing | Status.OutOfDateWithSelf | Status.OutOfDateWithUpstream | Status.UpstreamOutOfDate | Status.UpstreamBlocked | Status.ContainerOnly;
|
||||
namespace Status {
|
||||
/**
|
||||
* The project can't be built at all in its current state. For example,
|
||||
* its config file cannot be parsed, or it has a syntax error or missing file
|
||||
*/
|
||||
interface Unbuildable {
|
||||
type: UpToDateStatusType.Unbuildable;
|
||||
reason: string;
|
||||
}
|
||||
/**
|
||||
* This project doesn't have any outputs, so "is it up to date" is a meaningless question.
|
||||
*/
|
||||
interface ContainerOnly {
|
||||
type: UpToDateStatusType.ContainerOnly;
|
||||
}
|
||||
/**
|
||||
* The project is up to date with respect to its inputs.
|
||||
* We track what the newest input file is.
|
||||
*/
|
||||
interface UpToDate {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime?: Date;
|
||||
newestOutputFileTime?: Date;
|
||||
newestOutputFileName?: string;
|
||||
oldestOutputFileName?: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the outputs of the project does not exist.
|
||||
*/
|
||||
interface OutputMissing {
|
||||
type: UpToDateStatusType.OutputMissing;
|
||||
/**
|
||||
* The name of the first output file that didn't exist
|
||||
*/
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
interface OutOfDateWithSelf {
|
||||
type: UpToDateStatusType.OutOfDateWithSelf;
|
||||
outOfDateOutputFileName: string;
|
||||
newerInputFileName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends on an out-of-date project, so shouldn't be built yet
|
||||
*/
|
||||
interface UpstreamOutOfDate {
|
||||
type: UpToDateStatusType.UpstreamOutOfDate;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* This project depends an upstream project with build errors
|
||||
*/
|
||||
interface UpstreamBlocked {
|
||||
type: UpToDateStatusType.UpstreamBlocked;
|
||||
upstreamProjectName: string;
|
||||
}
|
||||
/**
|
||||
* One or more of the project's outputs is older than the newest output of
|
||||
* an upstream project.
|
||||
*/
|
||||
interface OutOfDateWithUpstream {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream;
|
||||
outOfDateOutputFileName: string;
|
||||
newerProjectName: string;
|
||||
}
|
||||
}
|
||||
interface FileMap<T> {
|
||||
setValue(fileName: string, value: T): void;
|
||||
getValue(fileName: string): T | never;
|
||||
getValueOrUndefined(fileName: string): T | undefined;
|
||||
hasKey(fileName: string): boolean;
|
||||
removeKey(fileName: string): void;
|
||||
getKeys(): string[];
|
||||
}
|
||||
function createDependencyMapper(): {
|
||||
addReference: (childConfigFileName: ResolvedConfigFileName, parentConfigFileName: ResolvedConfigFileName) => void;
|
||||
getReferencesTo: (parentConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getReferencesOf: (childConfigFileName: ResolvedConfigFileName) => ResolvedConfigFileName[];
|
||||
getKeys: () => ReadonlyArray<ResolvedConfigFileName>;
|
||||
};
|
||||
function createBuildContext(options: BuildOptions): BuildContext;
|
||||
function performBuild(args: string[], compilerHost: CompilerHost, buildHost: BuildHost, system?: System): number | undefined;
|
||||
/**
|
||||
* A SolutionBuilder has an immutable set of rootNames that are the "entry point" projects, but
|
||||
* can dynamically add/remove other projects based on changes on the rootNames' references
|
||||
*/
|
||||
function createSolutionBuilder(compilerHost: CompilerHost, buildHost: BuildHost, rootNames: ReadonlyArray<string>, defaultOptions: BuildOptions, system?: System): {
|
||||
buildAllProjects: () => ExitStatus;
|
||||
getUpToDateStatus: (project: ParsedCommandLine | undefined) => UpToDateStatus;
|
||||
getUpToDateStatusOfFile: (configFileName: ResolvedConfigFileName) => UpToDateStatus;
|
||||
cleanAllProjects: () => ExitStatus.Success | ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
resetBuildContext: (opts?: BuildOptions) => void;
|
||||
getBuildGraph: (configFileNames: ReadonlyArray<string>) => DependencyGraph | undefined;
|
||||
invalidateProject: (configFileName: string) => void;
|
||||
buildInvalidatedProjects: () => void;
|
||||
buildDependentInvalidatedProjects: () => void;
|
||||
resolveProjectName: (name: string) => ResolvedConfigFileName | undefined;
|
||||
startWatching: () => void;
|
||||
};
|
||||
/**
|
||||
* Gets the UpToDateStatus for a project
|
||||
*/
|
||||
function getUpToDateStatus(host: UpToDateHost, project: ParsedCommandLine | undefined): UpToDateStatus;
|
||||
function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray<string>;
|
||||
function formatUpToDateStatus<T>(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
|
||||
Reference in New Issue
Block a user