From 24bd469a6d8675bfb6b36dd93aee70dcfb23a36f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 13 Apr 2020 12:57:38 -0700 Subject: [PATCH 1/7] Baseline programs in tsc -b and tsc -incremental mode as well --- src/testRunner/unittests/tsbuild/helpers.ts | 8 +++++--- src/testRunner/unittests/tsc/helpers.ts | 11 +++++++++-- src/testRunner/unittests/tsc/incremental.ts | 3 ++- src/testRunner/unittests/tscWatch/helpers.ts | 13 +++++++++---- .../with-noEmitOnError.js | 13 +++++++++++++ .../incremental/initial-build/with-noEmitOnError.js | 13 +++++++++++++ 6 files changed, 51 insertions(+), 10 deletions(-) diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index cadfa8bde60cc..75b40cc1417fd 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -273,7 +273,7 @@ interface Symbol { export function verifyTscIncrementalEdits({ subScenario, fs, scenario, commandLineArgs, - baselineSourceMap, modifyFs, baselineReadFileCalls, + baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, incrementalScenarios }: VerifyTsBuildInput) { describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario}`, () => { @@ -292,7 +292,8 @@ interface Symbol { tick(); }, baselineSourceMap, - baselineReadFileCalls + baselineReadFileCalls, + baselinePrograms }); Debug.assert(!!incrementalScenarios.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); }); @@ -327,7 +328,8 @@ interface Symbol { tick(); }, baselineSourceMap, - baselineReadFileCalls + baselineReadFileCalls, + baselinePrograms }); }); after(() => { diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index e2a38981ed280..48abd71e531cc 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -27,6 +27,7 @@ namespace ts { modifyFs?: (fs: vfs.FileSystem) => void; baselineSourceMap?: boolean; baselineReadFileCalls?: boolean; + baselinePrograms?: boolean; } export type CommandLineProgram = [Program, EmitAndSemanticDiagnosticsBuilderProgram?]; @@ -74,7 +75,7 @@ namespace ts { const { scenario, subScenario, buildKind, commandLineArgs, modifyFs, - baselineSourceMap, baselineReadFileCalls + baselineSourceMap, baselineReadFileCalls, baselinePrograms } = input; if (modifyFs) modifyFs(fs); @@ -100,12 +101,18 @@ namespace ts { sys.write(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}\n`); sys.exit = exitCode => sys.exitCode = exitCode; + const { cb, getPrograms } = commandLineCallbacks(sys, originalReadFile); executeCommandLine( sys, - commandLineCallbacks(sys, originalReadFile).cb, + cb, commandLineArgs, ); sys.write(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}\n`); + if (baselinePrograms) { + const baseline: string[] = []; + tscWatch.baselinePrograms(baseline, getPrograms); + sys.write(baseline.join("\n")); + } if (baselineReadFileCalls) { sys.write(`readFiles:: ${JSON.stringify(actualReadFileMap, /*replacer*/ undefined, " ")} `); } diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index 862e5cdf6b458..ead5f402e03fd 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -86,7 +86,8 @@ const a = { lastName: 'sdsd' };`, "utf-8") } - ] + ], + baselinePrograms: true }); }); } diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index f778c98cedf34..00440206be546 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -376,10 +376,7 @@ namespace ts.tscWatch { if (baselineSourceMap) generateSourceMapBaselineFiles(sys); sys.diff(baseline, oldSnap); sys.serializeOutput(baseline); - const programs = getPrograms(); - for (const program of programs) { - baselineProgram(baseline, program); - } + const programs = baselinePrograms(baseline, getPrograms); sys.serializeWatches(baseline); baseline.push(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}`, ""); sys.writtenFiles.forEach((value, key) => { @@ -389,6 +386,14 @@ namespace ts.tscWatch { return programs; } + export function baselinePrograms(baseline: string[], getPrograms: () => readonly CommandLineProgram[]) { + const programs = getPrograms(); + for (const program of programs) { + baselineProgram(baseline, program); + } + return programs; + } + function baselineProgram(baseline: string[], [program, builderProgram]: CommandLineProgram) { const options = program.getCompilerOptions(); baseline.push(`Program root files: ${JSON.stringify(program.getRootFileNames())}`); diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js index e54b0e9d8d216..9923f0c48c3b6 100644 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js +++ b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js @@ -1,6 +1,19 @@ //// [/lib/incremental-declaration-doesnt-changeOutput.txt] /lib/tsc --incremental -p src exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts //// [/src/dev-build/shared/types/db.js] diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js index 7d139de09b044..e3bba0fddb45f 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js @@ -14,5 +14,18 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts From 695c0b2bf3c08dceae04f891f6fce5bd26c23ce3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 27 May 2020 15:05:52 -0700 Subject: [PATCH 2/7] Refactor outFile --- src/compiler/builder.ts | 12 ++++----- src/compiler/builderState.ts | 6 ++--- src/compiler/checker.ts | 4 +-- src/compiler/emitter.ts | 16 +++++------ src/compiler/factory.ts | 2 +- src/compiler/program.ts | 30 ++++++++++----------- src/compiler/transformers/module/module.ts | 2 +- src/compiler/transformers/module/system.ts | 2 +- src/compiler/tsbuildPublic.ts | 2 +- src/compiler/utilities.ts | 6 ++++- src/compiler/watchPublic.ts | 2 +- src/server/project.ts | 4 +-- src/server/session.ts | 2 +- src/services/sourcemaps.ts | 2 +- src/testRunner/unittests/tsbuild/helpers.ts | 2 +- 15 files changed, 49 insertions(+), 45 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index d5a1e16f2f1d1..3eb2115daaf7b 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -173,7 +173,7 @@ namespace ts { const compilerOptions = newProgram.getCompilerOptions(); state.compilerOptions = compilerOptions; // With --out or --outFile, any change affects all semantic diagnostics so no need to cache them - if (!compilerOptions.outFile && !compilerOptions.out) { + if (!outFile(compilerOptions)) { state.semanticDiagnosticsPerFile = createMap(); } state.changedFilesSet = createMap(); @@ -197,7 +197,7 @@ namespace ts { if (changedFilesSet) { copyEntries(changedFilesSet, state.changedFilesSet); } - if (!compilerOptions.outFile && !compilerOptions.out && oldState!.affectedFilesPendingEmit) { + if (!outFile(compilerOptions) && oldState!.affectedFilesPendingEmit) { state.affectedFilesPendingEmit = oldState!.affectedFilesPendingEmit.slice(); state.affectedFilesPendingEmitKind = cloneMapOrUndefined(oldState!.affectedFilesPendingEmitKind); state.affectedFilesPendingEmitIndex = oldState!.affectedFilesPendingEmitIndex; @@ -374,7 +374,7 @@ namespace ts { // so operations are performed directly on program, return program const program = Debug.checkDefined(state.program); const compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { Debug.assert(!state.semanticDiagnosticsPerFile); return program; } @@ -700,7 +700,7 @@ namespace ts { * Gets the program information to be emitted in buildInfo so that we can use it to create new program */ function getProgramBuildInfo(state: Readonly, getCanonicalFileName: GetCanonicalFileName): ProgramBuildInfo | undefined { - if (state.compilerOptions.outFile || state.compilerOptions.out) return undefined; + if (outFile(state.compilerOptions)) return undefined; const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory(); const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions)!, currentDirectory)); const fileInfos: MapLike = {}; @@ -933,7 +933,7 @@ namespace ts { let emitKind = BuilderFileEmit.Full; let isPendingEmitFile = false; if (!affected) { - if (!state.compilerOptions.out && !state.compilerOptions.outFile) { + if (!outFile(state.compilerOptions)) { const pendingAffectedFile = getNextAffectedFilePendingEmit(state); if (!pendingAffectedFile) { if (state.emittedBuildInfo) { @@ -1071,7 +1071,7 @@ namespace ts { function getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] { assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); const compilerOptions = Debug.checkDefined(state.program).getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { Debug.assert(!state.semanticDiagnosticsPerFile); // We dont need to cache the diagnostics just return them from program return Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index 44beb3a015d7e..315e67bdbb2d5 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -403,7 +403,7 @@ namespace ts { export function getAllDependencies(state: BuilderState, programOfThisState: Program, sourceFile: SourceFile): readonly string[] { const compilerOptions = programOfThisState.getCompilerOptions(); // With --out or --outFile all outputs go into single file, all files depend on each other - if (compilerOptions.outFile || compilerOptions.out) { + if (outFile(compilerOptions)) { return getAllFileNames(state, programOfThisState); } @@ -519,7 +519,7 @@ namespace ts { const compilerOptions = programOfThisState.getCompilerOptions(); // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, // so returning the file itself is good enough. - if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + if (compilerOptions && outFile(compilerOptions)) { return [sourceFileWithUpdatedShape]; } return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); @@ -534,7 +534,7 @@ namespace ts { } const compilerOptions = programOfThisState.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { return [sourceFileWithUpdatedShape]; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4ed83e41eb510..a611e9d1bb4e6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1352,7 +1352,7 @@ namespace ts { const declContainer = getEnclosingBlockScopeContainer(declaration); if (declarationFile !== useFile) { if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) || - (!compilerOptions.outFile && !compilerOptions.out) || + (!outFile(compilerOptions)) || isInTypeQuery(usage) || declaration.flags & NodeFlags.Ambient) { // nodes are in different files and order cannot be determined @@ -5201,7 +5201,7 @@ namespace ts { const links = getSymbolLinks(symbol); let specifier = links.specifierCache && links.specifierCache.get(contextFile.path); if (!specifier) { - const isBundle = (compilerOptions.out || compilerOptions.outFile); + const isBundle = !!outFile(compilerOptions); // For declaration bundles, we need to generate absolute paths relative to the common source dir for imports, // just like how the declaration emitter does for the ambient module declarations - we can easily accomplish this // using the `baseUrl` compiler option (which we would otherwise never use in declaration emit) and a non-relative diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 10b6f7b786d4d..aea8ba3875e53 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -25,7 +25,7 @@ namespace ts { includeBuildInfo?: boolean) { const sourceFiles = isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit); const options = host.getCompilerOptions(); - if (options.outFile || options.out) { + if (outFile(options)) { const prepends = host.getPrependNodes(); if (sourceFiles.length || prepends.length) { const bundle = createBundle(sourceFiles, prepends); @@ -45,7 +45,7 @@ namespace ts { } } if (includeBuildInfo) { - const buildInfoPath = getTsBuildInfoEmitOutputFilePath(host.getCompilerOptions()); + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); if (buildInfoPath) return action({ buildInfoPath }, /*sourceFileOrBundle*/ undefined); } } @@ -55,7 +55,7 @@ namespace ts { const configFile = options.configFilePath; if (!isIncrementalCompilation(options)) return undefined; if (options.tsBuildInfoFile) return options.tsBuildInfoFile; - const outPath = options.outFile || options.out; + const outPath = outFile(options); let buildInfoExtensionLess: string; if (outPath) { buildInfoExtensionLess = removeFileExtension(outPath); @@ -74,7 +74,7 @@ namespace ts { /*@internal*/ export function getOutputPathsForBundle(options: CompilerOptions, forceDtsPaths: boolean): EmitFileNames { - const outPath = options.outFile || options.out!; + const outPath = outFile(options)!; const jsFilePath = options.emitDeclarationOnly ? undefined : outPath; const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); const declarationFilePath = (forceDtsPaths || getEmitDeclarations(options)) ? removeFileExtension(outPath) + Extension.Dts : undefined; @@ -210,7 +210,7 @@ namespace ts { /*@internal*/ export function getAllProjectOutputs(configFile: ParsedCommandLine, ignoreCase: boolean): readonly string[] { const { addOutput, getOutputs } = createAddOutput(); - if (configFile.options.outFile || configFile.options.out) { + if (outFile(configFile.options)) { getSingleOutputFileNames(configFile, addOutput); } else { @@ -226,7 +226,7 @@ namespace ts { inputFileName = normalizePath(inputFileName); Debug.assert(contains(commandLine.fileNames, inputFileName), `Expected fileName to be present in command line`); const { addOutput, getOutputs } = createAddOutput(); - if (commandLine.options.outFile || commandLine.options.out) { + if (outFile(commandLine.options)) { getSingleOutputFileNames(commandLine, addOutput); } else { @@ -237,7 +237,7 @@ namespace ts { /*@internal*/ export function getFirstProjectOutput(configFile: ParsedCommandLine, ignoreCase: boolean): string { - if (configFile.options.outFile || configFile.options.out) { + if (outFile(configFile.options)) { const { jsFilePath } = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false); return Debug.checkDefined(jsFilePath, `project ${configFile.options.configFilePath} expected to have at least one output`); } @@ -404,7 +404,7 @@ namespace ts { const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles; const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson); // Setup and perform the transformation to retrieve declarations from the input files - const inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [createBundle(filesForEmit, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit; + const inputListOrBundle = outFile(compilerOptions) ? [createBundle(filesForEmit, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : filesForEmit; if (emitOnlyDtsFiles && !getEmitDeclarations(compilerOptions)) { // Checker wont collect the linked aliases since thats only done when declaration is enabled. // Do that here when emitting only dts files diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 833da8c8a6a56..795c1cdcea15d 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -1581,7 +1581,7 @@ namespace ts { if (file.moduleName) { return createLiteral(file.moduleName); } - if (!file.isDeclarationFile && (options.out || options.outFile)) { + if (!file.isDeclarationFile && outFile(options)) { return createLiteral(getExternalModuleNameFromPath(host, file.fileName)); } return undefined; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c8847d0435896..c9a3f88476fc6 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -834,7 +834,7 @@ namespace ts { if (rootNames.length) { for (const parsedRef of resolvedProjectReferences) { if (!parsedRef) continue; - const out = parsedRef.commandLine.options.outFile || parsedRef.commandLine.options.out; + const out = outFile(parsedRef.commandLine.options); if (useSourceOfProjectReferenceRedirect) { if (out || getEmitModuleKind(parsedRef.commandLine.options) === ModuleKind.None) { for (const fileName of parsedRef.commandLine.fileNames) { @@ -1503,7 +1503,7 @@ namespace ts { } function emitBuildInfo(writeFileCallback?: WriteFileCallback): EmitResult { - Debug.assert(!options.out && !options.outFile); + Debug.assert(!outFile(options)); performance.mark("beforeEmit"); const emitResult = emitFiles( notImplementedResolver, @@ -1597,7 +1597,7 @@ namespace ts { // This is because in the -out scenario all files need to be emitted, and therefore all // files need to be type checked. And the way to specify that all files need to be type // checked is to not pass the file to getEmitResolver. - const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); + const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(outFile(options) ? undefined : sourceFile, cancellationToken); performance.mark("beforeEmit"); @@ -1674,7 +1674,7 @@ namespace ts { function getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[] { const options = program.getCompilerOptions(); // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit) - if (!sourceFile || options.out || options.outFile) { + if (!sourceFile || outFile(options)) { return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } else { @@ -2403,7 +2403,7 @@ namespace ts { if (refFile && !useSourceOfProjectReferenceRedirect) { const redirectProject = getProjectReferenceRedirectProject(fileName); if (redirectProject) { - if (redirectProject.commandLine.options.outFile || redirectProject.commandLine.options.out) { + if (outFile(redirectProject.commandLine.options)) { // Shouldnt create many to 1 mapping file in --out scenario return undefined; } @@ -2535,7 +2535,7 @@ namespace ts { function getProjectReferenceOutputName(referencedProject: ResolvedProjectReference, fileName: string) { - const out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out; + const out = outFile(referencedProject.commandLine.options); return out ? changeExtension(out, Extension.Dts) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); @@ -2577,7 +2577,7 @@ namespace ts { mapFromToProjectReferenceRedirectSource = createMap(); forEachResolvedProjectReference(resolvedRef => { if (resolvedRef) { - const out = resolvedRef.commandLine.options.outFile || resolvedRef.commandLine.options.out; + const out = outFile(resolvedRef.commandLine.options); if (out) { // Dont know which source file it means so return true? const outputDts = changeExtension(out, Extension.Dts); @@ -3001,12 +3001,13 @@ namespace ts { } } + const outputFile = outFile(options); if (options.tsBuildInfoFile) { if (!isIncrementalCompilation(options)) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "tsBuildInfoFile", "incremental", "composite"); } } - else if (options.incremental && !options.outFile && !options.out && !options.configFilePath) { + else if (options.incremental && !outputFile && !options.configFilePath) { programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); } @@ -3087,7 +3088,7 @@ namespace ts { if (!getEmitDeclarations(options)) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); } - if (options.out || options.outFile) { + if (outputFile) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", options.out ? "out" : "outFile"); } } @@ -3105,7 +3106,6 @@ namespace ts { } const languageVersion = options.target || ScriptTarget.ES3; - const outFile = options.outFile || options.out; const firstNonAmbientExternalModuleSourceFile = find(files, f => isExternalModule(f) && !f.isDeclarationFile); if (options.isolatedModules) { @@ -3126,7 +3126,7 @@ namespace ts { } // Cannot specify module gen that isn't amd or system with --out - if (outFile && !options.emitDeclarationOnly) { + if (outputFile && !options.emitDeclarationOnly) { if (options.module && !(options.module === ModuleKind.AMD || options.module === ModuleKind.System)) { createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module"); } @@ -3286,7 +3286,7 @@ namespace ts { } } if (ref.prepend) { - const out = options.outFile || options.out; + const out = outFile(options); if (out) { if (!host.fileExists(out)) { createDiagnosticForReference(parentFile, index, Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path); @@ -3421,7 +3421,7 @@ namespace ts { } // If options have --outFile or --out just check that - const out = options.outFile || options.out; + const out = outFile(options); if (out) { return isSameFile(filePath, out) || isSameFile(filePath, removeFileExtension(out) + Extension.Dts); } @@ -3504,7 +3504,7 @@ namespace ts { mapOfDeclarationDirectories = createMap(); host.forEachResolvedProjectReference(ref => { if (!ref) return; - const out = ref.commandLine.options.outFile || ref.commandLine.options.out; + const out = outFile(ref.commandLine.options); if (out) { mapOfDeclarationDirectories!.set(getDirectoryPath(host.toPath(out)), true); } @@ -3704,7 +3704,7 @@ namespace ts { const ref = projectReferences[i]; const resolvedRefOpts = getCommandLine(ref, i); if (ref.prepend && resolvedRefOpts && resolvedRefOpts.options) { - const out = resolvedRefOpts.options.outFile || resolvedRefOpts.options.out; + const out = outFile(resolvedRefOpts.options); // Upstream project didn't have outFile set -- skip (error will have been issued earlier) if (!out) continue; diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 5f0381c7fa50e..798d057fa5dba 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -56,7 +56,7 @@ namespace ts { if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & TransformFlags.ContainsDynamicImport || - (isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && (compilerOptions.out || compilerOptions.outFile)))) { + (isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && outFile(compilerOptions)))) { return node; } diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 6d0a7ee6b523b..750b4525e74e9 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -119,7 +119,7 @@ namespace ts { ) ), EmitFlags.NoTrailingComments); - if (!(compilerOptions.outFile || compilerOptions.out)) { + if (!outFile(compilerOptions)) { moveEmitHelpers(updated, moduleBodyBlock, helper => !helper.scoped); } diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 3eb793b7599bb..a55712c44944b 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1799,7 +1799,7 @@ namespace ts { } // If options have --outFile or --out, check if its that - const out = configFile.options.outFile || configFile.options.out; + const out = outFile(configFile.options); if (out && (isSameFile(state, fileName, out) || isSameFile(state, fileName, removeFileExtension(out) + Extension.Dts))) { return true; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 06d4c9020143b..29d5cdfe74f0b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3858,6 +3858,10 @@ namespace ts { return removeFileExtension(path) + Extension.Dts; } + export function outFile(options: CompilerOptions) { + return options.outFile || options.out; + } + export interface EmitFileNames { jsFilePath?: string | undefined; sourceMapFilePath?: string | undefined; @@ -3877,7 +3881,7 @@ namespace ts { */ export function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile, forceDtsEmit?: boolean): readonly SourceFile[] { const options = host.getCompilerOptions(); - if (options.outFile || options.out) { + if (outFile(options)) { const moduleKind = getEmitModuleKind(options); const moduleEmitEnabled = options.emitDeclarationOnly || moduleKind === ModuleKind.AMD || moduleKind === ModuleKind.System; // Can emit only sources that are not declaration file and are either non module code or module with --module or --target es6 specified diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index d7b9f3b058795..5b7e7c357ee7c 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -5,7 +5,7 @@ namespace ts { readFile(fileName: string): string | undefined; } export function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost) { - if (compilerOptions.out || compilerOptions.outFile) return undefined; + if (outFile(compilerOptions)) return undefined; const buildInfoPath = getTsBuildInfoEmitOutputFilePath(compilerOptions); if (!buildInfoPath) return undefined; const content = host.readFile(buildInfoPath); diff --git a/src/server/project.ts b/src/server/project.ts index ee007b0b2131f..a3645fdddd1f3 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1035,7 +1035,7 @@ namespace ts.server { ); if (this.generatedFilesMap) { - const outPath = this.compilerOptions.outFile && this.compilerOptions.out; + const outPath = outFile(this.compilerOptions); if (isGeneratedFileWatcher(this.generatedFilesMap)) { // --out if (!outPath || !this.isValidGeneratedFileWatcher( @@ -1209,7 +1209,7 @@ namespace ts.server { /* @internal */ addGeneratedFileWatch(generatedFile: string, sourceFile: string) { - if (this.compilerOptions.outFile || this.compilerOptions.out) { + if (outFile(this.compilerOptions)) { // Single watcher if (!this.generatedFilesMap) { this.generatedFilesMap = this.createGeneratedFileWatcher(generatedFile); diff --git a/src/server/session.ts b/src/server/session.ts index 3f0321074a994..28681eb6c0a86 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1721,7 +1721,7 @@ namespace ts.server { return { projectFileName: project.getProjectName(), fileNames: project.getCompileOnSaveAffectedFileList(info), - projectUsesOutFile: !!compilationSettings.outFile || !!compilationSettings.out + projectUsesOutFile: !!outFile(compilationSettings) }; } ); diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index b582ba0065d86..e095708ed94d0 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -76,7 +76,7 @@ namespace ts { } const options = program.getCompilerOptions(); - const outPath = options.outFile || options.out; + const outPath = outFile(options); const declarationPath = outPath ? removeFileExtension(outPath) + Extension.Dts : diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index 75b40cc1417fd..43f86006317b9 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -240,7 +240,7 @@ interface Symbol { sys: System & { writtenFiles: Map; }, originalReadCall?: System["readFile"] ) { - const out = options.outFile || options.out; + const out = outFile(options); if (!out) return; const { buildInfoPath, jsFilePath, declarationFilePath } = getOutputPathsForBundle(options, /*forceDts*/ false); if (!buildInfoPath || !sys.writtenFiles.has(buildInfoPath)) return; From 9d8b280bad2a6b60c8f77cb8995a4e9ded1e0a2d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 May 2020 09:57:13 -0700 Subject: [PATCH 3/7] Tests --- src/testRunner/unittests/tsbuild/helpers.ts | 37 +- .../unittests/tsbuild/noEmitOnError.ts | 42 +- src/testRunner/unittests/tsbuild/watchMode.ts | 33 +- src/testRunner/unittests/tsc/incremental.ts | 52 +- .../unittests/tscWatch/emitAndErrorUpdates.ts | 51 +- src/testRunner/unittests/tscWatch/helpers.ts | 14 +- .../semantic-errors-with-incremental.js | 86 +++ .../semantic-errors.js | 39 ++ .../syntax-errors-with-incremental.js | 90 +++ .../syntax-errors.js | 43 ++ .../semantic-errors-with-incremental.js | 30 + .../initial-build/semantic-errors.js | 30 + .../syntax-errors-with-incremental.js | 27 + ...ences-are-provided.js => syntax-errors.js} | 9 + .../semantic-errors-with-incremental.js | 26 + .../no-change-run/semantic-errors.js | 26 + .../syntax-errors-with-incremental.js | 27 + .../no-change-run/syntax-errors.js | 27 + ...mit-any-files-on-error-with-incremental.js | 553 ++++++++++++++++++ .../does-not-emit-any-files-on-error.js | 293 +++++++++- .../with-noEmitOnError-semantic-errors.js | 87 +++ ...js => with-noEmitOnError-syntax-errors.js} | 0 .../with-noEmitOnError-semantic-errors.js | 30 + ...js => with-noEmitOnError-syntax-errors.js} | 0 .../with-noEmitOnError-semantic-errors.js | 26 + .../with-noEmitOnError-syntax-errors.js | 31 + .../with-noEmitOnError-with-incremental.js | 520 ++++++++++++++++ .../with-noEmitOnError.js | 268 ++++++++- .../with-noEmitOnError-with-incremental.js | 537 +++++++++++++++++ .../with-noEmitOnError.js | 269 ++++++++- .../with-noEmitOnError-with-incremental.js | 524 +++++++++++++++++ .../default/with-noEmitOnError.js | 268 ++++++++- .../with-noEmitOnError-with-incremental.js | 535 +++++++++++++++++ .../defaultAndD/with-noEmitOnError.js | 269 ++++++++- .../with-noEmitOnError-with-incremental.js | 520 ++++++++++++++++ .../isolatedModules/with-noEmitOnError.js | 268 ++++++++- .../with-noEmitOnError-with-incremental.js | 537 +++++++++++++++++ .../isolatedModulesAndD/with-noEmitOnError.js | 269 ++++++++- 38 files changed, 6416 insertions(+), 77 deletions(-) create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js rename tests/baselines/reference/tsbuild/noEmitOnError/initial-build/{has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js => syntax-errors.js} (56%) create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js create mode 100644 tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js create mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js rename tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/{with-noEmitOnError.js => with-noEmitOnError-syntax-errors.js} (100%) create mode 100644 tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js rename tests/baselines/reference/tsc/incremental/initial-build/{with-noEmitOnError.js => with-noEmitOnError-syntax-errors.js} (100%) create mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js create mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js create mode 100644 tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index 43f86006317b9..b887b21cbbf24 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -267,20 +267,34 @@ interface Symbol { commandLineArgs?: readonly string[]; } - export interface VerifyTsBuildInput extends TscCompile { - incrementalScenarios: TscIncremental[]; + export interface VerifyTsBuildInput extends VerifyTsBuildInputWorker { + baselineIncremental?: boolean; } - export function verifyTscIncrementalEdits({ + export function verifyTscIncrementalEdits(input: VerifyTsBuildInput) { + verifyTscIncrementalEditsWorker(input); + if (input.baselineIncremental) { + verifyTscIncrementalEditsWorker({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + } + } + + export interface VerifyTsBuildInputWorker extends TscCompile { + incrementalScenarios: TscIncremental[]; + } + function verifyTscIncrementalEditsWorker({ subScenario, fs, scenario, commandLineArgs, baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, incrementalScenarios - }: VerifyTsBuildInput) { + }: VerifyTsBuildInputWorker) { describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario}`, () => { let tick: () => void; let sys: TscCompileSystem; + let baseFs: vfs.FileSystem; before(() => { - let baseFs: vfs.FileSystem; ({ fs: baseFs, tick } = getFsWithTime(fs())); sys = tscCompile({ scenario, @@ -298,6 +312,7 @@ interface Symbol { Debug.assert(!!incrementalScenarios.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); }); after(() => { + baseFs = undefined!; sys = undefined!; tick = undefined!; }); @@ -307,7 +322,7 @@ interface Symbol { for (const { buildKind, - modifyFs, + modifyFs: incrementalModifyFs, subScenario: incrementalSubScenario, commandLineArgs: incrementalCommandLineArgs } of incrementalScenarios) { @@ -324,7 +339,7 @@ interface Symbol { commandLineArgs: incrementalCommandLineArgs || commandLineArgs, modifyFs: fs => { tick(); - modifyFs(fs); + incrementalModifyFs(fs); tick(); }, baselineSourceMap, @@ -340,14 +355,12 @@ interface Symbol { const sys = tscCompile({ scenario, subScenario, - fs: () => newSys.vfs, + fs: () => baseFs.makeReadonly(), commandLineArgs, modifyFs: fs => { tick(); - // Delete output files - const host = fakes.SolutionBuilderHost.create(fs); - const builder = createSolutionBuilder(host, commandLineArgs, { clean: true }); - builder.clean(); + if (modifyFs) modifyFs(fs); + incrementalModifyFs(fs); }, }); diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index 41afbca2dd905..da718ec4fe600 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -1,10 +1,42 @@ namespace ts { describe("unittests:: tsbuild - with noEmitOnError", () => { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: "has empty files diagnostic when files is empty and no references are provided", - fs: () => loadProjectFromDisk("tests/projects/noEmitOnError"), - commandLineArgs: ["--b", "/src/tsconfig.json"], + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/noEmitOnError"); }); + after(() => { + projFs = undefined!; + }); + + function verifyNoEmitOnError(subScenario: string, incrementalScenario: TscIncremental, modifyFs?: TscIncremental["modifyFs"]) { + verifyTscIncrementalEdits({ + scenario: "noEmitOnError", + subScenario, + fs: () => projFs, + modifyFs, + commandLineArgs: ["--b", "/src/tsconfig.json"], + incrementalScenarios: [ + incrementalScenario, + noChangeRun, + ], + baselinePrograms: true, + baselineIncremental: true + }); + } + + verifyNoEmitOnError("syntax errors", { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +};`, "utf-8") + }); + + verifyNoEmitOnError("semantic errors", { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8") + }, fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8")); }); } diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index 69faba35c318e..1c12631c2f32d 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -1273,17 +1273,34 @@ ${coreFiles[1].content}`); { currentDirectory: `${projectsLocation}/noEmitOnError` } ), changes: [ - sys => { - sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, `import { A } from "../shared/types/db"; + noChange, + sys => change(sys, "Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' -};`); - sys.checkTimeoutQueueLengthAndRun(1); // build project - sys.checkTimeoutQueueLength(0); - return "Fix error"; - } - ] +};`), + sys => change(sys, "Semantic Error", `import { A } from "../shared/types/db"; +const a: string = 10;`), + noChange, + sys => change(sys, "Fix Semantic Error", `import { A } from "../shared/types/db"; +const a: string = "hello";`), + noChange, + ], + baselineIncremental: true }); + + function change(sys: WatchedSystem, caption: string, content: string) { + sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, content); + sys.checkTimeoutQueueLengthAndRun(1); // build project + sys.checkTimeoutQueueLength(0); + return caption; + } + + function noChange(sys: WatchedSystem) { + sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${projectsLocation}/noEmitOnError/src/main.ts`)!); + sys.checkTimeoutQueueLengthAndRun(1); // build project + sys.checkTimeoutQueueLength(0); + return "No change"; + } }); describe("unittests:: tsbuild:: watchMode:: with reexport when referenced project reexports definitions from another file", () => { diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index ead5f402e03fd..90b12454daae2 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -73,21 +73,49 @@ namespace ts { incrementalScenarios: [noChangeRun] }); - verifyTscIncrementalEdits({ - scenario: "incremental", - subScenario: "with noEmitOnError", - fs: () => loadProjectFromDisk("tests/projects/noEmitOnError"), - commandLineArgs: ["--incremental", "-p", "src"], - incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + describe("with noEmitOnError", () => { + let projFs: vfs.FileSystem; + before(() => { + projFs = loadProjectFromDisk("tests/projects/noEmitOnError"); + }); + after(() => { + projFs = undefined!; + }); + verifyTscIncrementalEdits({ + scenario: "incremental", + subScenario: "with noEmitOnError syntax errors", + fs: () => projFs, + commandLineArgs: ["--incremental", "-p", "src"], + incrementalScenarios: [ + { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`, "utf-8") - } - ], - baselinePrograms: true + }, + noChangeRun, + ], + baselinePrograms: true + }); + + verifyTscIncrementalEdits({ + scenario: "incremental", + subScenario: "with noEmitOnError semantic errors", + fs: () => projFs, + commandLineArgs: ["--incremental", "-p", "src"], + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8"), + incrementalScenarios: [ + { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8") + }, + noChangeRun, + ], + baselinePrograms: true + }); }); }); } diff --git a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts index 65f311ebcd100..488aa865c88fc 100644 --- a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts +++ b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts @@ -14,6 +14,7 @@ namespace ts.tscWatch { lib, configFile, changes, + baselineIncremental }: VerifyEmitAndErrorUpdatesWorker) { verifyTscWatch({ scenario: "emitAndErrorUpdates", @@ -23,7 +24,8 @@ namespace ts.tscWatch { [...files(), configFile(), lib?.() || libFile], { currentDirectory: currentDirectory || projectRoot } ), - changes + changes, + baselineIncremental }); } @@ -41,6 +43,7 @@ namespace ts.tscWatch { lib?: () => File; changes: TscWatchCompileChange[]; configFile?: () => File; + baselineIncremental?: boolean } function verifyEmitAndErrorUpdates(input: VerifyEmitAndErrorUpdates) { verifyEmitAndErrorUpdatesWorker({ @@ -299,23 +302,39 @@ export class Data2 { }); }); - verifyEmitAndErrorUpdates({ - subScenario: "with noEmitOnError", - currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError`, - files: () => ["shared/types/db.ts", "src/main.ts", "src/other.ts"] - .map(f => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", f)), - lib: () => ({ path: libFile.path, content: libContent }), - configFile: () => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", "tsconfig.json"), - changes: [ - sys => { - sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, `import { A } from "../shared/types/db"; + describe("with noEmitOnError", () => { + verifyEmitAndErrorUpdates({ + subScenario: "with noEmitOnError", + currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError`, + files: () => ["shared/types/db.ts", "src/main.ts", "src/other.ts"] + .map(f => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", f)), + lib: () => ({ path: libFile.path, content: libContent }), + configFile: () => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", "tsconfig.json"), + changes: [ + noChange, + sys => change(sys, "Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' -};`); - sys.checkTimeoutQueueLengthAndRun(1); // build project - return "Fix the error"; - } - ] +};`), + sys => change(sys, "Semantic Error", `import { A } from "../shared/types/db"; +const a: string = 10;`), + noChange, + sys => change(sys, "Fix Semantic Error", `import { A } from "../shared/types/db"; +const a: string = "hello";`), + noChange, + ], + baselineIncremental: true + }); + function change(sys: WatchedSystem, caption: string, content: string) { + sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, content); + sys.checkTimeoutQueueLengthAndRun(1); // build project + return caption; + } + function noChange(sys: WatchedSystem) { + sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`)!); + sys.checkTimeoutQueueLengthAndRun(1); // build project + return "No change"; + } }); }); } diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 00440206be546..9da489529d35c 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -419,11 +419,23 @@ namespace ts.tscWatch { baseline.push(""); } - export function verifyTscWatch(input: TscWatchCompile) { + export interface VerifyTscWatch extends TscWatchCompile { + baselineIncremental?: boolean; + } + export function verifyTscWatch(input: VerifyTscWatch) { describe(input.scenario, () => { describe(input.subScenario, () => { tscWatchCompile(input); }); + if (input.baselineIncremental) { + describe(`${input.subScenario} with incremental`, () => { + tscWatchCompile({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + }); + } }); } diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..71741a7713e00 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js @@ -0,0 +1,86 @@ +//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js new file mode 100644 index 0000000000000..a874b8396ec64 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js @@ -0,0 +1,39 @@ +//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..6ef39f98f7657 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js @@ -0,0 +1,90 @@ +//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js new file mode 100644 index 0000000000000..5a17a748b5d10 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js @@ -0,0 +1,43 @@ +//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..16b6b689c8612 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js @@ -0,0 +1,30 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js new file mode 100644 index 0000000000000..b75481c9e096f --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js @@ -0,0 +1,30 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..5dfead1ecf460 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js @@ -0,0 +1,27 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js similarity index 56% rename from tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js rename to tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js index 4ad74c07000bb..fc647fcb75633 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js @@ -14,5 +14,14 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..df16c85bec9c2 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js @@ -0,0 +1,26 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js new file mode 100644 index 0000000000000..e91a35068d1b6 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js @@ -0,0 +1,26 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..46c6e80904517 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js @@ -0,0 +1,27 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js new file mode 100644 index 0000000000000..71e9e80879e5d --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js @@ -0,0 +1,27 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js new file mode 100644 index 0000000000000..b74b840cbba6f --- /dev/null +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js @@ -0,0 +1,553 @@ +/a/lib/tsc.js -b -w -verbose --incremental +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +[12:00:32 AM] Projects in this build: + * tsconfig.json + + +[12:00:33 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:34 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:35 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:39 AM] File change detected. Starting incremental compilation... + + +[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:42 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:46 AM] File change detected. Starting incremental compilation... + + +[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:07 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:11 AM] File change detected. Starting incremental compilation... + + +[12:01:12 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:13 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:19 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:20 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:21 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:27 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:35 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + +Output:: +>> Screen clear +[12:01:40 AM] File change detected. Starting incremental compilation... + + +[12:01:41 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:42 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:44 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:45 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js index 3eb6fcf4cef41..c598b9182d532 100644 --- a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js @@ -97,7 +97,65 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:39 AM] File change detected. Starting incremental compilation... + + +[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:42 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -127,16 +185,16 @@ console.log("hi"); Output:: >> Screen clear -[12:00:39 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:00:40 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist +[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist -[12:00:41 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:00:58 AM] Found 0 errors. Watching for file changes. +[12:01:05 AM] Found 0 errors. Watching for file changes. @@ -171,3 +229,228 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +[12:01:10 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:11 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:12 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:16 AM] File change detected. Starting incremental compilation... + + +[12:01:17 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:18 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:19 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + +Output:: +>> Screen clear +[12:01:23 AM] File change detected. Starting incremental compilation... + + +[12:01:24 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:25 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:30 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:31 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + +Output:: +>> Screen clear +[12:01:35 AM] File change detected. Starting incremental compilation... + + +[12:01:36 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' + + +[12:01:37 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:39 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:40 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js new file mode 100644 index 0000000000000..6d9d31aeb5b23 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js @@ -0,0 +1,87 @@ +//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js similarity index 100% rename from tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError.js rename to tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js new file mode 100644 index 0000000000000..d89c6dde708a8 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -0,0 +1,30 @@ +//// [/lib/initial-buildOutput.txt] +/lib/tsc --incremental -p src +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js similarity index 100% rename from tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError.js rename to tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js new file mode 100644 index 0000000000000..35e8db9e4a1e3 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js @@ -0,0 +1,26 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --incremental -p src +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js new file mode 100644 index 0000000000000..93fd71e9c2e6b --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js @@ -0,0 +1,31 @@ +//// [/lib/no-change-runOutput.txt] +/lib/tsc --incremental -p src +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..3502ea656ffed --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js @@ -0,0 +1,520 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js index 52b857514a001..ff3d37d1756f4 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js @@ -89,7 +89,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -119,10 +175,10 @@ console.log("hi"); Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +[12:00:58 AM] Found 0 errors. Watching for file changes. @@ -158,3 +214,209 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..e9b5c0f582db9 --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,537 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js index 5a066cb731c36..81d56e023aeb1 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js @@ -89,7 +89,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -133,10 +189,10 @@ export {}; Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -172,3 +228,210 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..60123ba64603c --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js @@ -0,0 +1,524 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js index 41bbb52ea00c9..c98673a9e5459 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js @@ -95,7 +95,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -125,10 +181,10 @@ console.log("hi"); Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +[12:00:58 AM] Found 0 errors. Watching for file changes. @@ -164,3 +220,209 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..71fbb59e88bfb --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,535 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js index 521d633599d9c..3ee3f8f7fe5a0 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js @@ -89,7 +89,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -133,10 +189,10 @@ export {}; Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -172,3 +228,210 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..c497b7cf5da36 --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js @@ -0,0 +1,520 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"isolatedModules":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:04 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:10 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:14 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... + + +[12:01:26 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js index 3a9cebc8071d4..83915898829c2 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js @@ -89,7 +89,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -119,10 +175,10 @@ console.log("hi"); Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:53 AM] Found 0 errors. Watching for file changes. +[12:00:58 AM] Found 0 errors. Watching for file changes. @@ -158,3 +214,209 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:02 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:03 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:07 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:08 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + +Output:: +>> Screen clear +[12:01:12 AM] File change detected. Starting incremental compilation... + + +[12:01:16 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js new file mode 100644 index 0000000000000..2c19d3533c8be --- /dev/null +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -0,0 +1,537 @@ +/a/lib/tsc.js --w --incremental +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{"compilerOptions":{"outDir":"./dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true}} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +Output:: +>> Screen clear +[12:00:31 AM] Starting compilation in watch mode... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:32 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:10 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:16 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-5014788164-export interface A {\n name: string;\n}\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-3531856636-export {};\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "isolatedModules": true, + "declaration": true, + "watch": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:20 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... + + +[12:01:35 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js index afc8a1c445691..7a37b658c044e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js @@ -89,7 +89,63 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix the error +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:00:36 AM] File change detected. Starting incremental compilation... + + +src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +[12:00:37 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Syntax error //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; @@ -133,10 +189,10 @@ export {}; Output:: >> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... +[12:00:41 AM] File change detected. Starting incremental compilation... -[12:00:59 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -172,3 +228,210 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +Change:: Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:09 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:13 AM] File change detected. Starting incremental compilation... + + +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: Fix Semantic Error + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + + +[12:01:25 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +Change:: No change + +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + + +[12:01:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined From fc82093497ff557e69ac15dd82c42931539a8a49 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 May 2020 17:44:16 -0700 Subject: [PATCH 4/7] Distinct input and output --- src/harness/vfsUtil.ts | 4 +- .../tsbuild/containerOnlyReferenced.ts | 2 +- src/testRunner/unittests/tsbuild/outFile.ts | 2 +- .../unittests/tsbuild/resolveJsonModule.ts | 6 +- src/testRunner/unittests/tsbuild/sample.ts | 4 +- src/testRunner/unittests/tsc/helpers.ts | 49 ++- src/testRunner/unittests/tsc/incremental.ts | 6 +- .../modules-and-globals-mixed-in-amd.js | 15 +- .../multiple-emitHelpers-in-all-projects.js | 19 +- .../multiple-prologues-in-all-projects.js | 15 +- .../shebang-in-all-projects.js | 17 +- .../stripInternal.js | 65 ++-- .../triple-slash-refs-in-all-projects.js | 15 +- .../multiple-emitHelpers-in-all-projects.js | 15 +- .../multiple-prologues-in-all-projects.js | 17 +- .../stripInternal.js | 65 ++-- .../modules-and-globals-mixed-in-amd.js | 75 +++- .../multiple-emitHelpers-in-all-projects.js | 140 ++++--- .../multiple-prologues-in-all-projects.js | 133 ++++--- .../initial-build/shebang-in-all-projects.js | 91 ++++- .../initial-build/stripInternal.js | 150 ++++--- .../triple-slash-refs-in-all-projects.js | 101 ++++- ...e-resolution-finds-original-source-file.js | 94 +++-- .../builds-after-fixing-config-file-errors.js | 15 +- ...ntax-errors-after-change-to-config-file.js | 29 +- ...s-syntax-errors-after-change-to-ts-file.js | 15 +- .../reports-syntax-errors-in-config-file.js | 41 +- .../when-tsconfig-extends-the-missing-file.js | 39 +- .../reports-syntax-errors-in-config-file.js | 9 +- ...ter-initial-build-doesnt-build-anything.js | 84 +++- ...ter-initial-build-doesnt-build-anything.js | 9 +- ...s-not-in-rootDir-at-the-import-location.js | 158 +++++++- ...ts-the-error-about-it-by-stopping-build.js | 105 ++++- ...ng-setup-correctly-and-reports-no-error.js | 151 ++++++- ...-emitDeclarationOnly-and-declarationMap.js | 25 +- ...import-project-with-emitDeclarationOnly.js | 25 +- ...mports-project-with-emitDeclarationOnly.js | 25 +- ...mports-project-with-emitDeclarationOnly.js | 27 +- ...-emitDeclarationOnly-and-declarationMap.js | 76 +++- ...import-project-with-emitDeclarationOnly.js | 98 +++-- ...mports-project-with-emitDeclarationOnly.js | 79 +++- ...es-is-empty-and-references-are-provided.js | 57 ++- ...is-empty-and-no-references-are-provided.js | 34 +- .../initial-build/test-exit-code.js | 12 +- ...-transitive-module-with-isolatedModules.js | 31 +- .../inferred-type-from-transitive-module.js | 31 +- ...hange-in-signature-with-isolatedModules.js | 31 +- ...-transitive-module-with-isolatedModules.js | 88 ++++- .../inferred-type-from-transitive-module.js | 78 +++- ...hange-in-signature-with-isolatedModules.js | 92 ++++- ...rojects-and-concatenates-them-correctly.js | 13 +- ...based-projects-and-emits-them-correctly.js | 125 +++++- ...ved-json-files-and-emits-them-correctly.js | 121 +++++- ...rojects-and-concatenates-them-correctly.js | 120 +++++- ...rojects-and-concatenates-them-correctly.js | 120 +++++- ...s-merged-and-contains-late-bound-member.js | 35 +- ...s-merged-and-contains-late-bound-member.js | 54 ++- ...zed-module-specifiers-resolve-correctly.js | 122 +++++- .../semantic-errors-with-incremental.js | 17 +- .../semantic-errors.js | 17 +- .../syntax-errors-with-incremental.js | 21 +- .../syntax-errors.js | 21 +- .../semantic-errors-with-incremental.js | 50 ++- .../initial-build/semantic-errors.js | 50 ++- .../syntax-errors-with-incremental.js | 48 ++- .../initial-build/syntax-errors.js | 48 ++- .../semantic-errors-with-incremental.js | 9 +- .../no-change-run/semantic-errors.js | 9 +- .../syntax-errors-with-incremental.js | 9 +- .../no-change-run/syntax-errors.js | 9 +- .../outFile/initial-build/clean-projects.js | 138 ++++++- .../non-module-projects-without-prepend.js | 200 ++++++---- ...erated-when-incremental-is-set-to-false.js | 160 ++++++-- ...-buildInfo-absence-results-in-new-build.js | 367 +++++++++++++++++- .../outFile/no-change-run/clean-projects.js | 9 +- .../baseline-sectioned-sourcemaps.js | 37 +- .../emitHelpers-in-all-projects.js | 41 +- .../multiple-prologues-in-all-projects.js | 39 +- .../shebang-in-all-projects.js | 39 +- .../strict-in-all-projects.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal.js | 37 +- .../triple-slash-refs-in-all-projects.js | 37 +- .../baseline-sectioned-sourcemaps.js | 37 +- .../emitHelpers-in-all-projects.js | 41 +- ...tHelpers-in-only-one-dependency-project.js | 37 +- .../multiple-emitHelpers-in-all-projects.js | 41 +- ...tiple-emitHelpers-in-different-projects.js | 41 +- .../multiple-prologues-in-all-projects.js | 39 +- ...ultiple-prologues-in-different-projects.js | 37 +- .../shebang-in-all-projects.js | 39 +- .../shebang-in-only-one-dependency-project.js | 37 +- .../strict-in-all-projects.js | 37 +- .../strict-in-one-dependency.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal-jsdoc-style-comment.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...-jsdoc-style-with-comments-emit-enabled.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...tripInternal-with-comments-emit-enabled.js | 37 +- .../stripInternal.js | 37 +- .../triple-slash-refs-in-all-projects.js | 37 +- .../triple-slash-refs-in-one-project.js | 37 +- ...t-composite-but-uses-project-references.js | 37 +- ...-source-files-are-empty-in-the-own-file.js | 37 +- .../emitHelpers-in-all-projects.js | 37 +- ...tHelpers-in-only-one-dependency-project.js | 41 +- .../multiple-emitHelpers-in-all-projects.js | 37 +- ...tiple-emitHelpers-in-different-projects.js | 37 +- .../multiple-prologues-in-all-projects.js | 41 +- ...ultiple-prologues-in-different-projects.js | 39 +- .../strict-in-all-projects.js | 39 +- .../strict-in-one-dependency.js | 39 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- .../stripInternal-jsdoc-style-comment.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...en-one-two-three-are-prepended-in-order.js | 37 +- ...tripInternal-with-comments-emit-enabled.js | 37 +- .../stripInternal.js | 37 +- .../baseline-sectioned-sourcemaps.js | 137 ++++++- .../declarationMap-and-sourceMap-disabled.js | 161 ++++++-- .../emitHelpers-in-all-projects.js | 182 +++++++-- ...tHelpers-in-only-one-dependency-project.js | 169 ++++++-- .../multiple-emitHelpers-in-all-projects.js | 276 +++++++------ ...tiple-emitHelpers-in-different-projects.js | 202 +++++++--- .../multiple-prologues-in-all-projects.js | 251 ++++++------ ...ultiple-prologues-in-different-projects.js | 208 ++++++---- .../initial-build/shebang-in-all-projects.js | 182 ++++++--- .../shebang-in-only-one-dependency-project.js | 153 +++++++- .../initial-build/strict-in-all-projects.js | 200 ++++++---- .../initial-build/strict-in-one-dependency.js | 155 +++++++- ...hen-internal-is-inside-another-internal.js | 230 +++++++---- ...en-one-two-three-are-prepended-in-order.js | 260 ++++++++----- .../stripInternal-jsdoc-style-comment.js | 240 ++++++++---- ...en-one-two-three-are-prepended-in-order.js | 282 ++++++++------ ...-jsdoc-style-with-comments-emit-enabled.js | 280 +++++++------ ...l-when-few-members-of-enum-are-internal.js | 220 ++++++++--- ...en-one-two-three-are-prepended-in-order.js | 260 ++++++++----- ...nal-when-prepend-is-completely-internal.js | 63 ++- ...en-one-two-three-are-prepended-in-order.js | 282 ++++++++------ ...tripInternal-with-comments-emit-enabled.js | 280 +++++++------ .../initial-build/stripInternal.js | 240 ++++++++---- .../triple-slash-refs-in-all-projects.js | 190 +++++++-- .../triple-slash-refs-in-one-project.js | 161 ++++++-- ...roject-is-not-composite-but-incremental.js | 160 ++++++-- ...t-composite-but-uses-project-references.js | 160 ++++++-- ...final-project-specifies-tsBuildInfoFile.js | 162 ++++++-- ...-source-files-are-empty-in-the-own-file.js | 138 ++++++- .../initial-build/builds-correctly.js | 63 ++- ...nfo-file-because-no-rootDir-in-the-base.js | 77 +++- ...reports-error-for-same-tsbuildinfo-file.js | 51 ++- ...eports-no-error-when-tsbuildinfo-differ.js | 53 ++- .../files-containing-json-file.js | 60 ++- ...ting-json-module-from-project-reference.js | 77 +++- .../initial-build/include-and-files.js | 63 ++- ...r-include-and-file-name-matches-ts-file.js | 67 +++- ...nclude-of-json-along-with-other-include.js | 60 ++- .../initial-build/include-only.js | 60 ++- .../initial-build/sourcemap.js | 77 +++- .../initial-build/without-outDir.js | 77 +++- ...ting-json-module-from-project-reference.js | 9 +- .../no-change-run/sourcemap.js | 9 +- .../no-change-run/without-outDir.js | 9 +- ...-type-only-changes-in-upstream-projects.js | 21 +- .../listEmittedFiles.js | 23 +- .../listFiles.js | 23 +- ...uilds-from-start-if-force-option-is-set.js | 9 +- ...uilds-when-extended-config-file-changes.js | 15 +- .../rebuilds-when-tsconfig-changes.js | 39 +- .../incremental-declaration-changes/sample.js | 23 +- .../when-declaration-option-changes.js | 25 +- .../when-esModuleInterop-option-changes.js | 41 +- ...en-logic-config-changes-declaration-dir.js | 41 +- .../when-module-option-changes.js | 25 +- .../when-target-option-changes.js | 29 +- .../Only-builds-the-leaf-node-project.js | 15 +- ...it-would-skip-builds-during-a-dry-build.js | 9 +- .../listEmittedFiles.js | 23 +- .../listFiles.js | 23 +- .../sample.js | 23 +- .../always-builds-under-with-force-option.js | 104 ++++- ...rectly-when-declarationDir-is-specified.js | 95 ++++- ...ilds-correctly-when-outDir-is-specified.js | 95 ++++- ...composite-or-doesnt-have-any-references.js | 76 +++- .../can-detect-when-and-what-to-rebuild.js | 270 ++++++++++++- ...ojects-if-upstream-projects-have-errors.js | 105 ++++- ...does-not-write-any-files-in-a-dry-build.js | 73 +++- .../sample1/initial-build/listEmittedFiles.js | 104 ++++- .../sample1/initial-build/listFiles.js | 104 ++++- ...uilds-when-extended-config-file-changes.js | 125 +++++- .../removes-all-files-it-built.js | 115 +++++- .../tsbuild/sample1/initial-build/sample.js | 104 ++++- .../when-declaration-option-changes.js | 72 +++- .../when-esModuleInterop-option-changes.js | 121 +++++- .../when-logic-specifies-tsBuildInfoFile.js | 121 +++++- .../when-module-option-changes.js | 72 +++- .../when-target-option-changes.js | 85 ++-- .../always-builds-under-with-force-option.js | 9 +- .../removes-all-files-it-built.js | 9 +- .../tsbuild/sample1/no-change-run/sample.js | 9 +- ...roject-uses-different-module-resolution.js | 70 +++- .../initial-build/builds-correctly.js | 75 +++- ...de-resolution-with-external-module-name.js | 65 +++- ...and-line-but-has-tsbuild-info-in-config.js | 40 +- ...and-line-but-has-tsbuild-info-in-config.js | 40 +- ...setting-composite-false-on-command-line.js | 39 +- ...-setting-composite-null-on-command-line.js | 39 +- .../with-noEmitOnError-semantic-errors.js | 17 +- .../with-noEmitOnError-syntax-errors.js | 21 +- .../with-only-dts-files.js | 13 +- ...g-filename-for-buildinfo-on-commandline.js | 38 +- .../when-passing-rootDir-from-commandline.js | 35 +- ...when-passing-rootDir-is-in-the-tsconfig.js | 36 +- .../with-noEmitOnError-semantic-errors.js | 50 ++- .../with-noEmitOnError-syntax-errors.js | 48 ++- .../initial-build/with-only-dts-files.js | 33 +- ...g-filename-for-buildinfo-on-commandline.js | 9 +- .../when-passing-rootDir-from-commandline.js | 9 +- ...when-passing-rootDir-is-in-the-tsconfig.js | 9 +- .../with-noEmitOnError-semantic-errors.js | 9 +- .../with-noEmitOnError-syntax-errors.js | 9 +- .../no-change-run/with-only-dts-files.js | 9 +- .../initial-build/combined-with-watch.js | 15 +- .../listFilesOnly/initial-build/loose-file.js | 27 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 12 +- 226 files changed, 11966 insertions(+), 3931 deletions(-) diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index 88fc73ebca9be..71d95b4d4ab60 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -34,6 +34,7 @@ namespace vfs { export interface DiffOptions { includeChangedFileWithSameContent?: boolean; + baseIsNotShadowRoot?: boolean; } /** @@ -697,7 +698,8 @@ namespace vfs { * Generates a `FileSet` patch containing all the entries in this `FileSystem` that are not in `base`. * @param base The base file system. If not provided, this file system's `shadowRoot` is used (if present). */ - public diff(base = this.shadowRoot, options: DiffOptions = {}) { + public diff(base?: FileSystem | undefined, options: DiffOptions = {}) { + if (!base && !options.baseIsNotShadowRoot) base = this.shadowRoot; const differences: FileSet = {}; const hasDifferences = base ? FileSystem.rootDiff(differences, this, base, options) : diff --git a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts index 8a208a698fa6a..93304fd95b6c4 100644 --- a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts +++ b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts @@ -5,7 +5,7 @@ namespace ts { subScenario: "verify that subsequent builds after initial build doesnt build anything", fs: () => loadProjectFromDisk("tests/projects/containerOnlyReferenced"), commandLineArgs: ["--b", "/src", "--verbose"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); } diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index a4594409042d8..a9f6621564c22 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -174,7 +174,7 @@ namespace ts { subScenario: "clean projects", fs: getOutFileFsAfterBuild, commandLineArgs: ["--b", "/src/third", "--clean"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); verifyTsc({ diff --git a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts index 0a5144da7c2eb..ab13e84eefdf2 100644 --- a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts +++ b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts @@ -57,7 +57,7 @@ export default hello.hello`); fs: () => projFs, commandLineArgs: ["--b", "src/tsconfig_withFiles.json", "--verbose"], modifyFs: fs => replaceText(fs, "src/tsconfig_withFiles.json", `"composite": true,`, `"composite": true, "sourceMap": true,`), - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); verifyTscIncrementalEdits({ @@ -66,7 +66,7 @@ export default hello.hello`); fs: () => projFs, commandLineArgs: ["--b", "src/tsconfig_withFiles.json", "--verbose"], modifyFs: fs => replaceText(fs, "src/tsconfig_withFiles.json", `"outDir": "dist",`, ""), - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); @@ -76,7 +76,7 @@ export default hello.hello`); subScenario: "importing json module from project reference", fs: () => loadProjectFromDisk("tests/projects/importJsonFromProjectReference"), commandLineArgs: ["--b", "src/tsconfig.json", "--verbose"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); } diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index 10fe37cb33fa7..55f629e38eb31 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -70,7 +70,7 @@ namespace ts { subScenario: "removes all files it built", fs: getSampleFsAfterBuild, commandLineArgs: ["--b", "/src/tests", "--clean"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); it("cleans till project specified", () => { @@ -103,7 +103,7 @@ namespace ts { subScenario: "always builds under with force option", fs: () => projFs, commandLineArgs: ["--b", "/src/tests", "--force"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); }); diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index 48abd71e531cc..9257578ffd7d7 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -16,6 +16,7 @@ namespace ts { buildKind: BuildKind.NoChangeRun, modifyFs: noop }; + export const noChangeOnlyRuns = [noChangeRun]; export interface TscCompile { scenario: string; @@ -70,14 +71,16 @@ namespace ts { } export function tscCompile(input: TscCompile) { - const baseFs = input.fs(); - const fs = baseFs.shadow(); + const initialFs = input.fs(); + const inputFs = initialFs.shadow(); const { scenario, subScenario, buildKind, commandLineArgs, modifyFs, baselineSourceMap, baselineReadFileCalls, baselinePrograms } = input; - if (modifyFs) modifyFs(fs); + if (modifyFs) modifyFs(inputFs); + inputFs.makeReadonly(); + const fs = inputFs.shadow(); // Create system const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc" }) as TscCompileSystem; @@ -118,14 +121,20 @@ namespace ts { } if (baselineSourceMap) generateSourceMapBaselineFiles(sys); - // Baseline the errors - fs.writeFileSync(`/lib/${buildKind || BuildKind.Initial}Output.txt`, sys.output.join("")); fs.makeReadonly(); sys.baseLine = () => { - const patch = fs.diff(baseFs, { includeChangedFileWithSameContent: true }); - // eslint-disable-next-line no-null/no-null - Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, patch ? vfs.formatPatch(patch) : null); + const baseFsPatch = !buildKind || buildKind === BuildKind.Initial ? + inputFs.diff(/*base*/ undefined, { baseIsNotShadowRoot: true }) : + inputFs.diff(initialFs, { includeChangedFileWithSameContent: true }); + const patch = fs.diff(inputFs, { includeChangedFileWithSameContent: true }); + Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, `Input:: +${baseFsPatch ? vfs.formatPatch(baseFsPatch) : ""} + +Output:: +${sys.output.join("")} + +${patch ? vfs.formatPatch(patch) : ""}`); }; return sys; } @@ -137,19 +146,21 @@ namespace ts { } export function verifyTsc(input: TscCompile) { - describe(input.scenario, () => { - describe(input.subScenario, () => { - let sys: TscCompileSystem; - before(() => { - sys = tscCompile({ - ...input, - fs: () => getFsWithTime(input.fs()).fs.makeReadonly() + describe(`tsc ${input.commandLineArgs.join(" ")} ${input.scenario}:: ${input.subScenario}`, () => { + describe(input.scenario, () => { + describe(input.subScenario, () => { + let sys: TscCompileSystem; + before(() => { + sys = tscCompile({ + ...input, + fs: () => getFsWithTime(input.fs()).fs.makeReadonly() + }); }); + after(() => { + sys = undefined!; + }); + verifyTscBaseline(() => sys); }); - after(() => { - sys = undefined!; - }); - verifyTscBaseline(() => sys); }); }); } diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index 90b12454daae2..8b616194f5956 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -17,7 +17,7 @@ namespace ts { }`, }), commandLineArgs: ["--incremental", "--p", "src/project", "--tsBuildInfoFile", "src/project/.tsbuildinfo"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); verifyTscIncrementalEdits({ @@ -34,7 +34,7 @@ namespace ts { }`, }), commandLineArgs: ["--p", "src/project", "--rootDir", "src/project/src"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); verifyTscIncrementalEdits({ @@ -70,7 +70,7 @@ namespace ts { }`, }), commandLineArgs: ["--p", "src/project"], - incrementalScenarios: [noChangeRun] + incrementalScenarios: noChangeOnlyRuns }); describe("with noEmitOnError", () => { diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js index c2d1035fc8c2e..18a90930a3d7c 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/modules-and-globals-mixed-in-amd.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var myGlob = 20; define("file1", ["require", "exports"], function (require, exports) { @@ -357,9 +363,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js index 30ce5e95cefa5..15f1cddb0f277 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,12 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +23,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; @@ -915,11 +923,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js index 03ae15191b9d8..fc32cc1ebd096 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] "use strict"; "myPrologue"; @@ -507,9 +513,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js index 3fc4cacb86df1..176d6a0d2468b 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/shebang-in-all-projects.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +#!someshebang lib file1 +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +22,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] #!someshebang lib file0 var myGlob = 20; @@ -362,10 +369,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -#!someshebang lib file1 -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js index b5bddf5859669..1b74e80929944 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/stripInternal.js @@ -1,4 +1,35 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c }console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +46,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] /*@internal*/ var myGlob = 20; define("file1", ["require", "exports"], function (require, exports) { @@ -1893,34 +1924,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c }console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js index 688ca0cc27e6e..5678035f987b9 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;console.log(x); + + + +Output:: /lib/tsc --b /src/app --verbose [12:04:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] /// var file0Const = new libfile0(); @@ -457,9 +463,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;console.log(x); - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js index fbad9dae2e765..675e7469a49ef 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { } + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +21,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.js] var __read = (this && this.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; @@ -800,9 +806,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { } - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] file written with same contents //// [/src/lib/module.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js index 685305aa38d4a..ad23914083586 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +"myPrologue5" +export const x = 10; + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -15,8 +22,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../lib/file0.ts","../lib/file1.ts","../lib/file2.ts","../lib/global.ts","file3.ts","file4.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC;;ICAvB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,KAAK,KAAK,CAAC"} @@ -671,10 +678,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -"myPrologue5" -export const x = 10; - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["file0.ts","file1.ts","file2.ts","global.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;;ICApB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC"} diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js index ebe8a5f929513..cb26d9f069cd8 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/incremental-headers-change-without-dts-changes/stripInternal.js @@ -1,4 +1,35 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/lib/file1.ts] +/*@internal*/ export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c } + + + +Output:: /lib/tsc --b /src/app --verbose [12:08:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +44,8 @@ [12:08:00 AM] Updating output of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare module "file1" { export class normalC { @@ -2069,34 +2100,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file1.ts] -/*@internal*/ export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c } - //// [/src/lib/module.d.ts] file written with same contents //// [/src/lib/module.d.ts.map] {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["file0.ts","file1.ts","file2.ts","global.ts"],"names":[],"mappings":"AAAc,QAAA,MAAM,MAAM,KAAK,CAAC;;ICAlB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAClC,MAAM,OAAO,OAAO;;QAEF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM;QACN,IAAI,CAAC,IACM,MAAM,CADK;QACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;KACvC;IACD,MAAM,WAAW,OAAO,CAAC;QACP,MAAa,CAAC;SAAI;QAClB,SAAgB,GAAG,SAAK;QACxB,UAAiB,aAAa,CAAC;YAAE,MAAa,CAAC;aAAG;SAAE;QACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;YAAE,MAAa,SAAS;aAAG;SAAE;QAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;QAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;QAC9B,MAAM,aAAa,KAAK,CAAC;QAChC,KAAY,YAAY;YAAG,CAAC,IAAA;YAAE,CAAC,IAAA;YAAE,CAAC,IAAA;SAAE;KACrD;IACa,MAAM,OAAO,SAAS;KAAG;IACzB,MAAM,UAAU,WAAW,SAAK;IAChC,MAAM,WAAW,iBAAiB,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAChE,MAAM,WAAW,aAAa,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IACtE,MAAM,QAAQ,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;IAC3D,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,MAAM,CAAC,MAAM,aAAa,KAAK,CAAC;IAChC,MAAM,MAAM,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;;;ICzBlD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;;ACApB,QAAA,MAAM,WAAW,KAAK,CAAC"} diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js index be5554e722dc6..8d5dd5eed34e4 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/modules-and-globals-mixed-in-amd.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +82,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "file1" { diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js index 97aabafd08c18..893b4c37771f0 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,83 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1";function forappfile3Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/app/file4.ts] +const myVar = 30; +function appfile4Spread(...b: number[]) { } +appfile4Spread(...[10, 20, 30]); + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; +function libfile0Spread(...b: number[]) { } +libfile0Spread(...[10, 20, 30]); + +//// [/src/lib/file1.ts] +export const x = 10;function forlibfile1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "downlevelIteration": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,19 +92,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -export const z = 30; -import { x } from "file1";function forappfile3Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/app/file4.ts] -const myVar = 30; -function appfile4Spread(...b: number[]) { } -appfile4Spread(...[10, 20, 30]); - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare function libfile0Spread(...b: number[]): void; @@ -1145,34 +1213,6 @@ declare function appfile4Spread(...b: number[]): void; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -const myGlob = 20; -function libfile0Spread(...b: number[]) { } -libfile0Spread(...[10, 20, 30]); - -//// [/src/lib/file1.ts] -export const x = 10;function forlibfile1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare function libfile0Spread(...b: number[]): void; @@ -1881,19 +1921,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": false, - "downlevelIteration": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"] - -} - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js index 49dac70814c7a..fb3e881a8dc1b 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/multiple-prologues-in-all-projects.js @@ -1,4 +1,78 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +"myPrologue" +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +"myPrologue2"; +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +"myPrologue" +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +"myPrologueFile" +export const y = 20; + +//// [/src/lib/global.ts] +"myPrologue3" +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,17 +87,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -"myPrologue" -export const z = 30; -import { x } from "file1"; - -//// [/src/app/file4.ts] -"myPrologue2"; -const myVar = 30; - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "file1" { @@ -677,35 +742,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -"myPrologue" -const myGlob = 20; - -//// [/src/lib/file2.ts] -"myPrologueFile" -export const y = 20; - -//// [/src/lib/global.ts] -"myPrologue3" -const globalConst = 10; - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare module "file1" { @@ -1167,18 +1203,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"] - -} - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js index 74bab6f42298b..1869f50a4c4ad 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/shebang-in-all-projects.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +#!someshebang app file3 +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +#!someshebang lib file0 +const myGlob = 20; + +//// [/src/lib/file1.ts] +#!someshebang lib file1 +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,13 +85,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -#!someshebang app file3 -export const z = 30; -import { x } from "file1"; - + + //// [/src/app/module.d.ts] #!someshebang lib file0 declare const myGlob = 20; @@ -528,14 +595,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/file0.ts] -#!someshebang lib file0 -const myGlob = 20; - -//// [/src/lib/file1.ts] -#!someshebang lib file1 -export const x = 10; - //// [/src/lib/module.d.ts] #!someshebang lib file0 declare const myGlob = 20; diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js index d235c145f991b..bb809835351b2 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/stripInternal.js @@ -1,4 +1,99 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, +"stripInternal": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +/*@internal*/ const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; +export class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +export namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ export class internalC {} +/*@internal*/ export function internalfoo() {} +/*@internal*/ export namespace internalNamespace { export class someClass {} } +/*@internal*/ export namespace internalOther.something { export class someClass {} } +/*@internal*/ export import internalImport = internalNamespace.someClass; +/*@internal*/ export type internalType = internalC; +/*@internal*/ export const internalConst = 10; +/*@internal*/ export enum internalEnum { a, b, c } + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,8 +108,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/app/module.d.ts] declare module "file1" { export const x = 10; @@ -2089,55 +2184,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, -"stripInternal": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "module.js" - }, - "exclude": ["module.d.ts"], - "references": [ - { "path": "../lib", "prepend": true } - ] -} - -//// [/src/lib/file0.ts] -/*@internal*/ const myGlob = 20; - -//// [/src/lib/file1.ts] -export const x = 10; -export class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -export namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ export class internalC {} -/*@internal*/ export function internalfoo() {} -/*@internal*/ export namespace internalNamespace { export class someClass {} } -/*@internal*/ export namespace internalOther.something { export class someClass {} } -/*@internal*/ export import internalImport = internalNamespace.someClass; -/*@internal*/ export type internalType = internalC; -/*@internal*/ export const internalConst = 10; -/*@internal*/ export enum internalEnum { a, b, c } - //// [/src/lib/module.d.ts] declare const myGlob = 20; declare module "file1" { diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js index af0e9a6ea5f66..f5f4e8c323dd9 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/triple-slash-refs-in-all-projects.js @@ -1,4 +1,83 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "file1"; + +//// [/src/app/file4.ts] +/// +const file4Const = new appfile4(); +const myVar = 30; + +//// [/src/app/tripleRef.d.ts] +declare class appfile4 { } + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +/// +const file0Const = new libfile0(); +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tripleRef.d.ts] +declare class libfile0 { } + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc --b /src/app --verbose [12:01:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,13 +92,8 @@ [12:01:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file4.ts] -/// -const file4Const = new appfile4(); -const myVar = 30; - + + //// [/src/app/module.d.ts] /// /// @@ -668,14 +742,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/app/tripleRef.d.ts] -declare class appfile4 { } - -//// [/src/lib/file0.ts] -/// -const file0Const = new libfile0(); -const myGlob = 20; - //// [/src/lib/module.d.ts] /// declare const file0Const: libfile0; @@ -1086,6 +1152,3 @@ declare const globalConst = 10; ====================================================================== -//// [/src/lib/tripleRef.d.ts] -declare class libfile0 { } - diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js index 04d3212b9935e..b070bcef95566 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/initial-build/when-the-module-resolution-finds-original-source-file.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/app/file3.ts] +export const z = 30; +import { x } from "lib/file1"; + +//// [/src/app/file4.ts] +const myVar = 30; + +//// [/src/app/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "module.js" + }, + "exclude": ["module.d.ts"], + "references": [ + { "path": "../lib", "prepend": true } + ] +} + +//// [/src/lib/file0.ts] +const myGlob = 20; + +//// [/src/lib/file1.ts] +export const x = 10; + +//// [/src/lib/file2.ts] +export const y = 20; + +//// [/src/lib/global.ts] +const globalConst = 10; + +//// [/src/lib/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "amd", + "composite": true, + "sourceMap": true, + "declarationMap": true, + "strict": false, + "outFile": "../module.js", "rootDir": "../" + }, + "exclude": ["module.d.ts"] + +} + + + +Output:: /lib/tsc -b /src/app --verbose [12:00:00 AM] Projects in this build: * src/lib/tsconfig.json @@ -13,12 +82,8 @@ [12:00:00 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success - - -//// [/src/app/file3.ts] -export const z = 30; -import { x } from "lib/file1"; - + + //// [/src/app/module.d.ts] declare const myGlob = 20; declare module "lib/file1" { @@ -518,21 +583,6 @@ declare const myVar = 30; ====================================================================== -//// [/src/lib/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "module": "amd", - "composite": true, - "sourceMap": true, - "declarationMap": true, - "strict": false, - "outFile": "../module.js", "rootDir": "../" - }, - "exclude": ["module.d.ts"] - -} - //// [/src/module.d.ts] declare const myGlob = 20; declare module "lib/file1" { diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js index 0d5e1c5125cfb..907c37c49d20a 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-changes/builds-after-fixing-config-file-errors.js @@ -1,8 +1,14 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} + + + +Output:: /lib/tsc --b /src/tsconfig.json exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare function foo(): void; @@ -27,9 +33,6 @@ function bar() { } exports.bar = bar; -//// [/src/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js index e9c41eb95c65a..47aa64fe1a1ab 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-config-file.js @@ -1,16 +1,4 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --b /src/tsconfig.json -src/tsconfig.json:8:9 - error TS1005: ',' expected. - -8 "b.ts" -   ~~~~~~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - +Input:: //// [/src/tsconfig.json] { "compilerOptions": { @@ -23,3 +11,18 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped ] } + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/tsconfig.json:8:9 - error TS1005: ',' expected. + +8 "b.ts" +   ~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js index a69f31cf4d4ef..15011c5129363 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/incremental-declaration-doesnt-change/reports-syntax-errors-after-change-to-ts-file.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/a.ts] +export function foo() { }export function fooBar() { } + + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,8 +15,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/a.ts] -export function foo() { }export function fooBar() { } - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js index baa0311442172..ef55c7e7b4ceb 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/reports-syntax-errors-in-config-file.js @@ -1,4 +1,39 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export function foo() { } + +//// [/src/b.ts] +export function bar() { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + }, + "files": [ + "a.ts" + "b.ts" + ] +} + + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,5 +44,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js index 0403cf03bb88e..b948e6af2015f 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/initial-build/when-tsconfig-extends-the-missing-file.js @@ -1,4 +1,37 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/tsconfig.first.json] +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./tsconfig.first.json" }, + { "path": "./tsconfig.second.json" } + ] +} + +//// [/src/tsconfig.second.json] +{ + "extends": "./foobar.json", + "compilerOptions": { + "composite": true + } +} + + + +Output:: /lib/tsc --b /src/tsconfig.json error TS5083: Cannot read file '/src/foobar.json'. @@ -12,5 +45,5 @@ Found 4 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js index a3a339da3c8e4..0ae857d8deb97 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/no-change-run/reports-syntax-errors-in-config-file.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json src/tsconfig.json:7:9 - error TS1005: ',' expected. @@ -9,5 +12,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index 3fc8dac542226..664e43d863851 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -1,4 +1,82 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/folder/index.ts] +export const x = 10; + +//// [/src/src/folder/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} + +//// [/src/src/folder2/index.ts] +export const x = 10; + +//// [/src/src/folder2/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + } +} + +//// [/src/src/tsconfig.json] +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./folder" }, + { "path": "./folder2"} + ] + } + +//// [/src/tests/index.ts] +export const x = 10; + +//// [/src/tests/tsconfig.json] +{ + "files": ["index.ts"], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../src" } + ] +} + +//// [/src/tsconfig.json] +{ + "files": [], + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./src" }, + { "path": "./tests"} + ] +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/src/folder/tsconfig.json @@ -20,8 +98,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/folder/index.d.ts] export declare const x = 10; diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index fa95a039a613e..97a1127a6149d 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src --verbose [12:04:00 AM] Projects in this build: * src/src/folder/tsconfig.json @@ -14,5 +17,5 @@ [12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js index ad10d21163026..e70f1f9d5aa39 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -1,4 +1,142 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/animals/animal.ts] +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + + +//// [/src/animals/dog.ts] +import Animal from '.'; +import { makeRandomName } from '../core/utilities'; + +export interface Dog extends Animal { + woof(): void; + name: string; +} + +export function createDog(): Dog { + return ({ + size: "medium", + woof: function(this: Dog) { + console.log(`${this.name} says "Woof"!`); + }, + name: makeRandomName() + }); +} + + + +//// [/src/animals/index.ts] +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/core/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + } +} + +//// [/src/core/utilities.ts] +import * as A from '../animals'; + +export function makeRandomName() { + return "Bob!?! "; +} + +export function lastElementOf(arr: T[]): T | undefined { + if (arr.length === 0) return undefined; + return arr[arr.length - 1]; +} + + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] + + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -57,19 +195,5 @@ Found 7 errors. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/core/utilities.ts] -import * as A from '../animals'; - -export function makeRandomName() { - return "Bob!?! "; -} - -export function lastElementOf(arr: T[]): T | undefined { - if (arr.length === 0) return undefined; - return arr[arr.length - 1]; -} - - - + + diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js index 759404e0d1933..f84d662938dfd 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -1,20 +1,27 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: - * src/animals/tsconfig.json - * src/zoo/tsconfig.json - * src/core/tsconfig.json - * src/tsconfig.json +Input:: +//// [/lib/lib.d.ts] -error TS6202: Project references may not form a circular graph. Cycle detected: /src/tsconfig.json -/src/core/tsconfig.json -/src/zoo/tsconfig.json -/src/animals/tsconfig.json +//// [/src/animals/animal.ts] -Found 1 error. -exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped +//// [/src/animals/dog.ts] + + +//// [/src/animals/index.ts] + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/core/tsconfig.json] @@ -31,3 +38,75 @@ exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped ] } +//// [/src/core/utilities.ts] + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] + + + + +Output:: +/lib/tsc --b /src/tsconfig.json --verbose +[12:00:00 AM] Projects in this build: + * src/animals/tsconfig.json + * src/zoo/tsconfig.json + * src/core/tsconfig.json + * src/tsconfig.json + +error TS6202: Project references may not form a circular graph. Cycle detected: /src/tsconfig.json +/src/core/tsconfig.json +/src/zoo/tsconfig.json +/src/animals/tsconfig.json + + +Found 1 error. + +exitCode:: ExitStatus.ProjectReferenceCycle_OutputsSkupped + + diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js index 56c9f505b67a1..54546e00acb22 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -1,4 +1,149 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/animals/animal.ts] +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} + + +//// [/src/animals/dog.ts] +import Animal from '.'; +import { makeRandomName } from '../core/utilities'; + +export interface Dog extends Animal { + woof(): void; + name: string; +} + +export function createDog(): Dog { + return ({ + size: "medium", + woof: function(this: Dog) { + console.log(`${this.name} says "Woof"!`); + }, + name: makeRandomName() + }); +} + + + +//// [/src/animals/index.ts] +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; + + +//// [/src/animals/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/animals", + "rootDir": ".", + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/core/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/core", + "rootDir": "." + } +} + +//// [/src/core/utilities.ts] + +export function makeRandomName() { + return "Bob!?! "; +} + +export function lastElementOf(arr: T[]): T | undefined { + if (arr.length === 0) return undefined; + return arr[arr.length - 1]; +} + + + +//// [/src/tsconfig-base.json] +{ + "compilerOptions": { + "declaration": true, + "target": "es5", + "module": "commonjs", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "composite": true + } +} + +//// [/src/tsconfig.json] +{ + "files": [], + "references": [ + { + "path": "./core" + }, + { + "path": "./animals" + }, + { + "path": "./zoo" + } + ] +} + +//// [/src/zoo/tsconfig.json] +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "outDir": "../lib/zoo", + "rootDir": "." + }, + "references": [ + { + "path": "../animals" + } + ] +} + +//// [/src/zoo/zoo.ts] +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + + + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -19,8 +164,8 @@ [12:00:00 AM] Building project '/src/zoo/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/animals/animal.d.ts] export declare type Size = "small" | "medium" | "large"; export default interface Animal { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 45ebd6052bebb..1cc9486f0a255 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -1,4 +1,15 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + + + + +Output:: /lib/tsc --b /src --verbose [12:04:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +19,8 @@ [12:04:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { @@ -27,14 +38,6 @@ export interface A { //// [/src/lib/c.d.ts.map] file written with same contents //// [/src/lib/index.d.ts] file written with same contents //// [/src/lib/index.d.ts.map] file written with same contents -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index e7f944f1896ce..2b27b1f8c1543 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -1,4 +1,15 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + + + + +Output:: /lib/tsc --b /src --verbose [12:04:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +19,8 @@ [12:04:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { @@ -21,14 +32,6 @@ export interface A { //// [/src/lib/b.d.ts] file written with same contents //// [/src/lib/c.d.ts] file written with same contents //// [/src/lib/index.d.ts] file written with same contents -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index b1de2d8635930..a7f794c0d4164 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -1,4 +1,15 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +export interface A { + b: B; foo: any; +} + + + + +Output:: /lib/tsc --b /src --verbose [12:04:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +19,8 @@ [12:04:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] export declare class B { prop: string; @@ -27,14 +38,6 @@ export interface A { //// [/src/lib/b.d.ts.map] file written with same contents //// [/src/lib/c.d.ts] file written with same contents //// [/src/lib/c.d.ts.map] file written with same contents -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -export interface A { - b: B; foo: any; -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index 0e5f645761d8b..01b72909bac58 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -1,4 +1,16 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; +} + + + + +Output:: /lib/tsc --b /src --verbose [12:08:00 AM] Projects in this build: * src/tsconfig.json @@ -10,21 +22,12 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] file written with same contents //// [/src/lib/a.d.ts.map] {"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -class C { } -export interface A { - b: B; -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 1f386297fa0a1..99dbafc18ed99 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -1,4 +1,74 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/src/index.ts] +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +78,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index 69c8b3b3879a1..f88d72cce381c 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -1,4 +1,74 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/src/index.ts] +export { A } from "./a"; +export { B } from "./b"; +export { C } from "./c"; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +78,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] import { B } from "./b"; export interface A { @@ -37,28 +107,6 @@ export { B } from "./b"; export { C } from "./c"; -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, /* Enable incremental compilation */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - "outDir": "./lib", /* Redirect output structure to the directory. */ - "composite": true, /* Enable project compilation */ - "strict": true, /* Enable all strict type-checking options. */ - - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - - "alwaysStrict": true, - "rootDir": "src", - "emitDeclarationOnly": true - } -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index 2f3704424a002..9264f15be5c08 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -1,4 +1,68 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +export interface A { + b: B; +} + + +//// [/src/src/b.ts] +import { C } from "./c"; + +export interface B { + b: C; +} + + +//// [/src/src/c.ts] +import { A } from "./a"; + +export interface C { + a: A; +} + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + "outDir": "./lib", /* Redirect output structure to the directory. */ + "composite": true, /* Enable project compilation */ + "strict": true, /* Enable all strict type-checking options. */ + + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + + "alwaysStrict": true, + "rootDir": "src", + "emitDeclarationOnly": true + } +} + + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +72,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/a.d.ts] export declare class B { prop: string; @@ -42,15 +106,6 @@ export interface C { //// [/src/lib/c.d.ts.map] {"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../src/c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} -//// [/src/src/index.ts] unlink -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -export interface A { - b: B; -} - - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js index 614c5b8cb4a02..a249f7d2e4ff3 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js @@ -1,8 +1,59 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/with-references -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/index.ts] +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/no-references/tsconfig.json] + +//// [/src/with-references/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + ], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + + +Output:: +/lib/tsc --b /src/with-references +exitCode:: ExitStatus.Success + + //// [/src/core/index.d.ts] export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map diff --git a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js index 5d5d7be53949f..12eee2bc1e7c9 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/initial-build/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js @@ -1,4 +1,32 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/index.ts] + + +//// [/src/core/tsconfig.json] + + +//// [/src/no-references/tsconfig.json] +{ + "references": [], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + +//// [/src/with-references/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/no-references src/no-references/tsconfig.json:3:14 - error TS18002: The 'files' list in config file '/src/no-references/tsconfig.json' is empty. @@ -9,5 +37,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js index 96d503b040789..2a7d6272ff3ec 100644 --- a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js +++ b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/initial-build/test-exit-code.js @@ -1,4 +1,10 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + + + +Output:: /lib/tsc -b bogus.json error TS5083: Cannot read file '/bogus.json'. @@ -6,5 +12,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js index b4c446d96703f..1afafe2064ea1 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js @@ -1,17 +1,4 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - +Input:: //// [/src/bar.ts] interface RawAction { (...args: any[]): Promise | void; @@ -23,6 +10,22 @@ declare function foo(): ActionFactory; export default foo()(function foobar(): void { }); + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + //// [/src/obj/bar.d.ts] declare const _default: () => void; export default _default; diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js index b855f9cea594b..3c3d4a97ac77d 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js @@ -1,17 +1,4 @@ -//// [/lib/incremental-declaration-changesOutput.txt] -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - +Input:: //// [/src/bar.ts] interface RawAction { (...args: any[]): Promise | void; @@ -23,6 +10,22 @@ declare function foo(): ActionFactory; export default foo()(function foobar(): void { }); + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + //// [/src/obj/bar.d.ts] declare const _default: () => void; export default _default; diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index 6b72fb26bc76e..effff0c513e90 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -1,4 +1,18 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: /lib/tsc --b /src --verbose [12:04:00 AM] Projects in this build: * src/tsconfig.json @@ -16,16 +30,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - + + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js index b5cbfb4bb7429..5a2aad4b9172e 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} + +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} + + +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} + +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); + +//// [/src/lazyIndex.ts] +export { default as bar } from './bar'; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, "isolatedModules": true + } +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +80,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; @@ -151,13 +223,3 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret "version": "FakeTSVersion" } -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "declaration": true, - "outDir": "obj", - "incremental": true, "isolatedModules": true - } -} - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js index da6fb71f58d45..1e2b45bc6f7d4 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js @@ -1,4 +1,76 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); + +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} + +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} + + +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} + +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); + +//// [/src/lazyIndex.ts] +export { default as bar } from './bar'; + + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true + } +} + + + +Output:: /lib/tsc --b /src --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +80,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index 6c8e247f4e723..d513f6fefbf46 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -1,14 +1,58 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: - * src/tsconfig.json +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(param: string): void { +}); -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist +//// [/src/bundling.ts] +export class LazyModule { + constructor(private importCallback: () => Promise) {} +} -[12:01:00 AM] Building project '/src/tsconfig.json'... +export class LazyAction< + TAction extends (...args: any[]) => any, + TModule +> { + constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) { + } +} -exitCode:: ExitStatus.Success +//// [/src/global.d.ts] +interface PromiseConstructor { + new (): Promise; +} +declare var Promise: PromiseConstructor; +interface Promise { +} + +//// [/src/index.ts] +import { LazyAction, LazyModule } from './bundling'; +const lazyModule = new LazyModule(() => + import('./lazyIndex') +); +export const lazyBar = new LazyAction(lazyModule, m => m.bar); //// [/src/lazyIndex.ts] export { default as bar } from './bar'; @@ -16,6 +60,30 @@ export { default as bar } from './bar'; import { default as bar } from './bar'; bar("hello"); +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "declaration": true, + "outDir": "obj", + "incremental": true, "isolatedModules": true + } +} + + + +Output:: +/lib/tsc --b /src --verbose +[12:01:00 AM] Projects in this build: + * src/tsconfig.json + +[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist + +[12:01:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + //// [/src/obj/bar.d.ts] declare const _default: (param: string) => void; export default _default; @@ -159,13 +227,3 @@ bar_2.default("hello"); "version": "FakeTSVersion" } -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "declaration": true, - "outDir": "obj", - "incremental": true, "isolatedModules": true - } -} - diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js index 41f3786c4108c..93e5af380e7b8 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js @@ -1,8 +1,4 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success - - +Input:: //// [/src/sub-project/index.js] /** * @typedef {Nominal} MyNominal @@ -10,6 +6,13 @@ exitCode:: ExitStatus.Success const c = /** @type {*} */(undefined); + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/src/sub-project/sub-project.d.ts] file written with same contents //// [/src/sub-project/sub-project.js] /** diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js index 9b0975176237a..9be011499262a 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-and-emits-them-correctly.js @@ -1,3 +1,123 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +module.exports = {}; + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +import { Nominal } from '../common/nominal'; + +/** + * @typedef {Nominal} MyNominal + */ + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +import { MyNominal } from '../sub-project/index'; + +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +export function getVar() { + return 'key'; +} + + +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../lib", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/lib/common/nominal.d.ts] export type Nominal = T & { [Symbol.species]: Name; @@ -47,11 +167,6 @@ module.exports = {}; "version": "FakeTSVersion" } -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success - - //// [/lib/sub-project/index.d.ts] export type MyNominal = string & { [Symbol.species]: "MyNominal"; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js index 1386d22a21a80..6b7f9e60e5932 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js @@ -1,8 +1,123 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/index.ts] +import x = require("./obj.json"); +export = x; + + +//// [/src/common/obj.json] +{ + "val": 42 +} + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "outDir": null, + "composite": true + }, + "include": ["index.ts", "obj.json"] +} + +//// [/src/sub-project/index.js] +import mod from '../common'; + +export const m = mod; + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +import { m } from '../sub-project/index'; + +const variable = { + key: m, +}; + +export function getVar() { + return variable; +} + + +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.js"] +} +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "../out", + "allowJs": true, + "checkJs": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/out/sub-project/index.d.ts] export const m: { val: number; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js index 562866d175f90..6960991ab6a91 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/loads-outfile-js-projects-and-concatenates-them-correctly.js @@ -1,8 +1,122 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "common.js" + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(null); + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project.js" + }, + "references": [ + { "path": "../common", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project-2.js" + }, + "references": [ + { "path": "../sub-project", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "src.js" + }, + "references": [ + { "path": "./sub-project", "prepend": true }, + { "path": "./sub-project-2", "prepend": true } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/src/common/common.d.ts] type Nominal = T & { [Symbol.species]: Name; diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js index 562866d175f90..6960991ab6a91 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js @@ -1,8 +1,122 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc -b /src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/common/nominal.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + + +//// [/src/common/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "common.js" + }, + "include": ["nominal.js"] +} + +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(null); + + +//// [/src/sub-project/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project.js" + }, + "references": [ + { "path": "../common", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/sub-project-2/index.js] +const variable = { + key: /** @type {MyNominal} */('value'), +}; + +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} +//// [/src/sub-project-2/tsconfig.json] +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outFile": "sub-project-2.js" + }, + "references": [ + { "path": "../sub-project", "prepend": true } + ], + "include": ["./index.js"] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "allowJs": true, + "checkJs": true, + "declaration": true + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "src.js" + }, + "references": [ + { "path": "./sub-project", "prepend": true }, + { "path": "./sub-project-2", "prepend": true } + ], + "include": [] +} + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + //// [/src/common/common.d.ts] type Nominal = T & { [Symbol.species]: Name; diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js index 93648fb156333..156b519da628b 100644 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js +++ b/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js @@ -1,4 +1,20 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} + +type A = HKT[typeof sym]; + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:04:00 AM] Projects in this build: * src/tsconfig.json @@ -10,27 +26,14 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/main.js] "use strict"; exports.__esModule = true; var sym = Symbol(); -//// [/src/src/main.ts] -import { HKT } from "./hkt"; - -const sym = Symbol(); - -declare module "./hkt" { - interface HKT { - [sym]: { a: T } - } -} - -type A = HKT[typeof sym]; - //// [/src/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js index 3661e23425ef7..eb6fb704a1870 100644 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js +++ b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js @@ -1,4 +1,52 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/globals.d.ts] +interface SymbolConstructor { + (description?: string | number): symbol; +} +declare var Symbol: SymbolConstructor; + +//// [/src/src/hkt.ts] +export interface HKT { } + +//// [/src/src/main.ts] +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} +const x = 10; +type A = HKT[typeof sym]; + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "rootDir": "src", + "incremental": true + } +} + + + +Output:: /lib/tsc --b /src/tsconfig.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig.json @@ -8,8 +56,8 @@ [12:01:00 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/hkt.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js index b9c4252df0055..bab2eab97b46a 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/initial-build/synthesized-module-specifiers-resolve-correctly.js @@ -1,4 +1,120 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +interface SymbolConstructor { + readonly species: symbol; + readonly toStringTag: symbol; +} +declare var Symbol: SymbolConstructor; +interface Symbol { + readonly [Symbol.toStringTag]: string; +} + + +//// [/src/solution/common/nominal.ts] +export declare type Nominal = T & { + [Symbol.species]: Name; +}; + + +//// [/src/solution/common/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "include": ["nominal.ts"] +} + +//// [/src/solution/sub-project/index.ts] +import { Nominal } from '../common/nominal'; + +export type MyNominal = Nominal; + + +//// [/src/solution/sub-project/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" } + ], + "include": ["./index.ts"] +} + +//// [/src/solution/sub-project-2/index.ts] +import { MyNominal } from '../sub-project/index'; + +const variable = { + key: 'value' as MyNominal, +}; + +export function getVar(): keyof typeof variable { + return 'key'; +} + + +//// [/src/solution/sub-project-2/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../sub-project" } + ], + "include": ["./index.ts"] +} + +//// [/src/solution/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./sub-project" }, + { "path": "./sub-project-2" } + ], + "include": [] +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "skipLibCheck": true, + "rootDir": "./", + "outDir": "lib", + } +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "./solution" } + ], + "include": [] + } + + + +Output:: /lib/tsc -b /src --verbose [12:00:00 AM] Projects in this build: * src/solution/common/tsconfig.json @@ -20,8 +136,8 @@ [12:00:00 AM] Building project '/src/solution/sub-project-2/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/lib/solution/common/nominal.d.ts] export declare type Nominal = T & { [Symbol.species]: Name; diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js index 71741a7713e00..2751ddcc4bc6c 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +21,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -80,7 +87,3 @@ console.log("hi"); "version": "FakeTSVersion" } -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js index a874b8396ec64..efc202b1259ce 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: /lib/tsc --b /src/tsconfig.json exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +21,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -33,7 +40,3 @@ exports.__esModule = true; console.log("hi"); -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js index 6ef39f98f7657..4c1695671faa6 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js @@ -1,4 +1,13 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +23,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -82,9 +91,3 @@ console.log("hi"); "version": "FakeTSVersion" } -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js index 5a17a748b5d10..71c86e5347232 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js @@ -1,4 +1,13 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: /lib/tsc --b /src/tsconfig.json exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +23,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -35,9 +44,3 @@ exports.__esModule = true; console.log("hi"); -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js index 16b6b689c8612..d3cb5a3c1eac4 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js @@ -1,4 +1,44 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,9 +62,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js index b75481c9e096f..e1faa9bb5fa9f 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js @@ -1,4 +1,44 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --b /src/tsconfig.json src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,9 +62,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js index 5dfead1ecf460..65f93aa39c7fe 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js @@ -1,4 +1,46 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -23,5 +65,5 @@ Program files:: /src/src/other.ts No cached semantic diagnostics in the builder:: - - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js index fc647fcb75633..44a28736d1798 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js @@ -1,4 +1,46 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --b /src/tsconfig.json src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -23,5 +65,5 @@ Program files:: /src/src/other.ts No cached semantic diagnostics in the builder:: - - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js index df16c85bec9c2..a289053008946 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,5 +25,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js index e91a35068d1b6..2545c2f0db6d9 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,5 +25,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js index 46c6e80904517..72c5a8f5fcb3d 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json --incremental src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -23,5 +26,5 @@ Program files:: /src/src/other.ts No cached semantic diagnostics in the builder:: - - + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js index 71e9e80879e5d..35191fdd7c8fa 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tsconfig.json src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -23,5 +26,5 @@ Program files:: /src/src/other.ts No cached semantic diagnostics in the builder:: - - + + diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js index 619b5b5465621..f1187c0e9156b 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js @@ -1,8 +1,140 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/third --clean -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/2/second-output.d.ts] + + +//// [/src/2/second-output.d.ts.map] + + +//// [/src/2/second-output.js] + + +//// [/src/2/second-output.js.map] + + +//// [/src/2/second-output.tsbuildinfo] + + +//// [/src/first/bin/first-output.d.ts] + + +//// [/src/first/bin/first-output.d.ts.map] + + +//// [/src/first/bin/first-output.js] + + +//// [/src/first/bin/first-output.js.map] + + +//// [/src/first/bin/first-output.tsbuildinfo] + + +//// [/src/first/first_PART1.ts] + + +//// [/src/first/first_part2.ts] +//// [/src/first/first_part3.ts] + + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/thirdjs/output/third-output.d.ts] + + +//// [/src/third/thirdjs/output/third-output.d.ts.map] + + +//// [/src/third/thirdjs/output/third-output.js] + + +//// [/src/third/thirdjs/output/third-output.js.map] + + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: +/lib/tsc --b /src/third --clean +exitCode:: ExitStatus.Success + + //// [/src/2/second-output.d.ts] unlink //// [/src/2/second-output.d.ts.map] unlink //// [/src/2/second-output.js] unlink diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js index a63b0b971f3ce..aa3a94fa1cbf7 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/non-module-projects-without-prepend.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, "module": "none", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first" }, + { "path": "../second" }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/first_PART1.d.ts] interface TheFirst { none: any; @@ -70,28 +201,6 @@ function f() { //// [/src/first/first_part3.js.map] {"version":3,"file":"first_part3.js","sourceRoot":"","sources":["first_part3.ts"],"names":[],"mappings":"AAAA,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - //// [/src/first/tsconfig.tsbuildinfo] { "program": { @@ -184,24 +293,6 @@ var C = (function () { //// [/src/second/second_part2.js.map] {"version":3,"file":"second_part2.js","sourceRoot":"","sources":["second_part2.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/second/tsconfig.tsbuildinfo] { "program": { @@ -258,29 +349,6 @@ c.doSomething(); //// [/src/third/third_part1.js.map] {"version":3,"file":"third_part1.js","sourceRoot":"","sources":["third_part1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, "module": "none", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first" }, - { "path": "../second" }, - ] -} - - //// [/src/third/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js index 71fd3e3fe5f52..e1227348f0c87 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -256,26 +387,3 @@ c.doSomething(); //// [/src/third/thirdjs/output/third-output.js.map] {"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js index 101b6835a66b8..8c2acb2f7d5d2 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js @@ -1,4 +1,333 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/2/second-output.d.ts] +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +//# sourceMappingURL=second-output.d.ts.map + +//// [/src/2/second-output.d.ts.map] +{"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd"} + +//// [/src/2/second-output.js] +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +//# sourceMappingURL=second-output.js.map + +//// [/src/2/second-output.js.map] +{"version":3,"file":"second-output.js","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAIA,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} + +//// [/src/2/second-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/first/bin/first-output.d.ts] +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +//# sourceMappingURL=first-output.d.ts.map + +//// [/src/first/bin/first-output.d.ts.map] + + +//// [/src/first/bin/first-output.js] + + +//// [/src/first/bin/first-output.js.map] + + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/thirdjs/output/third-output.d.ts] +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +declare var c: C; +//# sourceMappingURL=third-output.d.ts.map + +//// [/src/third/thirdjs/output/third-output.d.ts.map] +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} + +//// [/src/third/thirdjs/output/third-output.js] +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +var c = new C(); +c.doSomething(); +//# sourceMappingURL=third-output.js.map + +//// [/src/third/thirdjs/output/third-output.js.map] +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "../..", + "sourceFiles": [ + "../../third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "../../../first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "../../../2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "../../../first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "../../../2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,13 +347,43 @@ [12:00:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.js] file written with same contents //// [/src/first/bin/first-output.js.map] file written with same contents -//// [/src/first/bin/first-output.tsbuildinfo] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + //// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] ====================================================================== File:: /src/first/bin/first-output.js diff --git a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js index e9007f59a9bf1..798bda4b7bc0b 100644 --- a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/third --clean exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js index f325ef7008a6f..5548636885833 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/baseline-sectioned-sourcemaps.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -396,20 +413,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js index 5eabef2db8069..eb1b8fb117809 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +54,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -570,22 +589,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js index 9185f9ac0e2ac..95ac0b8bfd263 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +53,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -459,21 +477,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js index 5f2c9410a2ed0..639edc231612c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/shebang-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +53,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -403,21 +421,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js index 83bb109249d97..b8b28d2725002 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/strict-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -426,20 +443,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js index e2c254da707b6..7fe09ee9e3445 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -39,8 +56,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3280,20 +3297,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js index 8a7c483b3df46..3e7036f487431 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -35,8 +52,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -403,20 +420,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hola, world"; interface NoJsForHereEither { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js index e98afcd7bf013..865dbb68c1dc4 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-changes/triple-slash-refs-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hola, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +55,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] /// interface TheFirst { @@ -467,20 +484,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hola, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js index 9d1086253f086..79c0d10aa9f01 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/baseline-sectioned-sourcemaps.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -290,20 +307,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js index c458b4d6c26ba..258ae115c35c0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +59,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -443,22 +462,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js index fcf4acba7643a..518d7f044a19f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { }console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -288,20 +305,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { }console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js index f7393a4d6e6d8..8656390abe226 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -609,22 +628,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js index 57471226054cc..496c7c571a9cc 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +}console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -421,22 +440,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -}console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var __rest = (this && this.__rest) || function (s, e) { var t = {}; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js index 4cfbde10e5a6f..2a031af0472cd 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -352,21 +370,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js index 9b82c4526ae4b..c36fadfb3dd85 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/multiple-prologues-in-different-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -298,20 +315,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; "myPrologue"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js index e7a673b3d9d0c..37979f999a015 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1, "/src/2/second-output.d.ts": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -294,21 +312,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] #!someshebang first first_PART1 var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js index d804a95c447e1..171d9579b2100 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/shebang-in-only-one-dependency-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] #!someshebang second second_part1 var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js index e4bcbaaab178e..b128b719b6c06 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -320,20 +337,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js index e48734c69cce5..70b92d29f253e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/strict-in-one-dependency.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] "use strict"; var s = "Hello, world"; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index 9b0d7049b4f8c..92e1b523086d0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2306,20 +2323,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js index ba145a9ef7a7f..0767c3a71b080 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index d0b67eb0aff6a..57e56038845c2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2406,20 +2423,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 1b6673e4e7304..134c1ad2a1599 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js index 5e66dbb2d5973..3a3f6c7438345 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -44,8 +61,8 @@ readFiles:: { "/src/third/thirdjs/output/third-output.js.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1, "/src/third/thirdjs/output/third-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2328,20 +2345,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 4625eada85d79..c0127ea74f0e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.js] var s = "Hello, world"; console.log(s); @@ -2406,20 +2423,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js index 8fe5f69f1b64d..a701eb86ea86f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -275,20 +292,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js index b3539f7ef4de2..e6dcbd14cbc63 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -297,20 +314,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js index 2aa1254929858..78f0f24504224 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -41,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -331,20 +348,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js index aeb73f5fabbb5..12db12bb0a354 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/triple-slash-refs-in-one-project.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js index 73a71564615d3..da9400a26a25a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-final-project-is-not-composite-but-uses-project-references.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -16,8 +33,8 @@ [12:04:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -266,20 +283,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.d.ts] file written with same contents //// [/src/third/thirdjs/output/third-output.d.ts.map] file written with same contents //// [/src/third/thirdjs/output/third-output.d.ts.map.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js index 39068288c814a..80402d5a3435c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-declaration-doesnt-change/when-source-files-are-empty-in-the-own-file.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +console.log(s); + + + +Output:: /lib/tsc --b /src/third --verbose [12:04:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] file written with same contents //// [/src/first/bin/first-output.d.ts.map.baseline.txt] file written with same contents @@ -268,20 +285,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -console.log(s); - //// [/src/third/thirdjs/output/third-output.js] var s = "Hello, world"; console.log(s); diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js index 0d1d7c16c3cc2..1b794cbf61085 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -429,20 +446,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js index b0ebcadfcead4..6ac490f423654 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +37,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;AEbD,iBAAS,CAAC,WAET"} @@ -542,22 +561,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAE/B;ACbD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js index 39bd3016afe78..b643b821abf1e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} @@ -629,20 +646,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACHnD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AACD,iBAAS,yBAAyB,SAEjC;ACbD,cAAM,CAAC;IACH,WAAW;CAGd;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACNrD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B;AACD,iBAAS,sBAAsB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js index 2151bb6619e09..416f702fff33b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;AEXtC,iBAAS,CAAC,WAET"} @@ -407,20 +424,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AAGD,iBAAS,uBAAuB,SAAM;ACXtC,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,iBAAS,wBAAwB,CAAC,GAAG,GAAG,MAAM,EAAE,QAAK;ACZrD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC;AAEhB,iBAAS,uBAAuB,SAE/B"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js index 88b5e1c9d679f..debe24623bbc1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-all-projects.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue5" +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +59,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AEVD,iBAAS,CAAC,WAET"} @@ -486,22 +505,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue5" -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAEA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACVD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACHD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js index a464c3addc444..fb7dd90b89f35 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/multiple-prologues-in-different-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue5" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +36,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -432,21 +450,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue5" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACDD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACLD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js index 3550da7cfd328..0a819de05c56b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-all-projects.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +58,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -454,21 +472,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js index 56730581e4488..b7381cb1c7394 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/strict-in-one-dependency.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +36,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AETD,iBAAS,CAAC,WAET"} @@ -412,21 +430,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts.map] {"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AACA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACTD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index a9fa587f9ca34..acec88a3aff46 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEM,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACxC;AACD,kBAAU,OAAO,CAAC;IACC,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACtD;AACc,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC5C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1469,20 +1486,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js index d1109391c2609..10f63b9eb0935 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -359,20 +376,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js index a8cc6f446fcdf..dca90f7005e81 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -44,8 +61,8 @@ readFiles:: { "/src/third/thirdjs/output/third-output.js.map": 1, "/src/third/thirdjs/output/third-output.d.ts": 1, "/src/third/thirdjs/output/third-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACvC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1491,20 +1508,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 6bebc8ccdf23a..b60a84801ae04 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -22,8 +39,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts.map] {"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../first/first_PART1.ts","../first/first_part3.ts","../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;AAED,cAAM,OAAO;;IAEK,IAAI,EAAE,MAAM,CAAC;IACb,MAAM;IACN,IAAI,CAAC,IACM,MAAM,CADK;IACtB,IAAI,CAAC,CAAC,KAAK,MAAM,EAAK;CACvC;AACD,kBAAU,OAAO,CAAC;IACA,MAAa,CAAC;KAAI;IAClB,SAAgB,GAAG,SAAK;IACxB,UAAiB,aAAa,CAAC;QAAE,MAAa,CAAC;SAAG;KAAE;IACpD,UAAiB,SAAS,CAAC,SAAS,CAAC;QAAE,MAAa,SAAS;SAAG;KAAE;IAClE,MAAM,QAAQ,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC;IAC3C,KAAY,YAAY,GAAG,SAAS,CAAC;IAC9B,MAAM,aAAa,KAAK,CAAC;IAChC,KAAY,YAAY;QAAG,CAAC,IAAA;QAAE,CAAC,IAAA;QAAE,CAAC,IAAA;KAAE;CACrD;AACa,cAAM,SAAS;CAAG;AAClB,iBAAS,WAAW,SAAK;AACzB,kBAAU,iBAAiB,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AACzD,kBAAU,aAAa,CAAC,SAAS,CAAC;IAAE,MAAa,SAAS;KAAG;CAAE;AAC/D,OAAO,cAAc,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpD,aAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,QAAA,MAAM,aAAa,KAAK,CAAC;AACzB,aAAK,YAAY;IAAG,CAAC,IAAA;IAAE,CAAC,IAAA;IAAE,CAAC,IAAA;CAAE;ACpC3C,cAAM,CAAC;IACH,WAAW;CAGd"} @@ -1469,20 +1486,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js index 91983831dbe7a..ba01c95b0602a 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:08:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +35,8 @@ [12:08:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -359,20 +376,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js index a2e37c11323bd..2509f130b7c05 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/incremental-headers-change-without-dts-changes/stripInternal.js @@ -1,4 +1,21 @@ -//// [/lib/incremental-headers-change-without-dts-changesOutput.txt] +Input:: +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + + + +Output:: /lib/tsc --b /src/third --verbose [12:12:00 AM] Projects in this build: * src/first/tsconfig.json @@ -40,8 +57,8 @@ readFiles:: { "/src/2/second-output.d.ts": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/first/bin/first-output.d.ts] file written with same contents //// [/src/first/bin/first-output.d.ts.map] {"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} @@ -381,20 +398,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js index 289cfde3950fb..0847f3a0a31ee 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/baseline-sectioned-sourcemaps.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +169,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js index f69a5b700e869..edcd6e049c397 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/declarationMap-and-sourceMap-disabled.js @@ -1,4 +1,133 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + + + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +147,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -872,29 +1001,3 @@ var C = (function () { }()); -//// [/src/third/third_part1.ts] - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - - - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js index 339e70b555226..4071641ef473e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-all-projects.js @@ -1,4 +1,141 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +175,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1196,38 +1333,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2544,10 +2649,3 @@ declare function forthirdthird_part1Rest(): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js index b10fa4a4954af..f44f525faccac 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/emitHelpers-in-only-one-dependency-project.js @@ -1,4 +1,137 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { } + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +151,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1041,36 +1174,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { } - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js index a8b4f0e8e0ce4..c79711d5c6a15 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-all-projects.js @@ -1,4 +1,150 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} +function firstfirst_part3Spread(...b: number[]) { } +firstfirst_part3Spread(...[10, 20, 30]); + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} +function forsecondsecond_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + +function secondsecond_part2Spread(...b: number[]) { } +secondsecond_part2Spread(...[10, 20, 30]); + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} +function thirdthird_part1Spread(...b: number[]) { } +thirdthird_part1Spread(...[10, 20, 30]); + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +164,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1616,97 +1762,6 @@ declare function firstfirst_part3Spread(...b: number[]): void; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/first/first_part3.ts] -function f() { - return "JS does hoists"; -} -function firstfirst_part3Spread(...b: number[]) { } -firstfirst_part3Spread(...[10, 20, 30]); - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} -function forsecondsecond_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part2.ts] -class C { - doSomething() { - console.log("something got done"); - } -} - -function secondsecond_part2Spread(...b: number[]) { } -secondsecond_part2Spread(...[10, 20, 30]); - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -3528,36 +3583,3 @@ declare function thirdthird_part1Spread(...b: number[]): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} -function thirdthird_part1Spread(...b: number[]) { } -thirdthird_part1Spread(...[10, 20, 30]); - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js index 763700712d5fc..a25738af1de97 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-emitHelpers-in-different-projects.js @@ -1,4 +1,142 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); +function forfirstfirst_PART1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +function secondsecond_part1Spread(...b: number[]) { } +secondsecond_part1Spread(...[10, 20, 30]); + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "downlevelIteration": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); +function forthirdthird_part1Rest() { +const { b, ...rest } = { a: 10, b: 30, yy: 30 }; +} + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +156,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1229,57 +1367,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); -function forfirstfirst_PART1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -function secondsecond_part1Spread(...b: number[]) { } -secondsecond_part1Spread(...[10, 20, 30]); - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "downlevelIteration": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2689,10 +2776,3 @@ declare function forthirdthird_part1Rest(): void; ====================================================================== -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); -function forthirdthird_part1Rest() { -const { b, ...rest } = { a: 10, b: 30, yy: 30 }; -} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js index 7bbf44148287d..15c99fb44246c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-all-projects.js @@ -1,4 +1,140 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +"myPrologue" +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +"myPrologue" +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +"myPrologue2"; +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +"myPrologue3"; +"myPrologue"; +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +174,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1022,85 +1158,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -"myPrologue" -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -"myPrologue" -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/second_part2.ts] -"myPrologue2"; -class C { - doSomething() { - console.log("something got done"); - } -} - - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -2126,33 +2183,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -"myPrologue3"; -"myPrologue"; -var c = new C(); -c.doSomething(); - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js index f2cd75a0ae191..b724195549b48 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/multiple-prologues-in-different-projects.js @@ -1,4 +1,137 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +"myPrologue" +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +"myPrologue2"; +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +151,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -949,52 +1082,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -"myPrologue" -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/second_part2.ts] -"myPrologue2"; -class C { - doSomething() { - console.log("something got done"); - } -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1970,26 +2057,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js index 262b41d24b38d..2c2c0ef14e563 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-all-projects.js @@ -1,4 +1,139 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +#!someshebang first first_PART1 +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +#!someshebang first first_part2 +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +#!someshebang second second_part1 +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +#!someshebang third third_part1 +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +173,8 @@ readFiles:: { "/src/2/second-output.js": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -863,41 +998,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -#!someshebang first first_PART1 -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/first_part2.ts] -#!someshebang first first_part2 -console.log(f()); - - -//// [/src/second/second_part1.ts] -#!someshebang second second_part1 -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang first first_PART1 interface TheFirst { @@ -1798,9 +1898,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -#!someshebang third third_part1 -var c = new C(); -c.doSomething(); - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js index 8687412e9bd52..5038a130e3c30 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/shebang-in-only-one-dependency-project.js @@ -1,4 +1,136 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +#!someshebang second second_part1 +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +150,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] #!someshebang second second_part1 declare namespace N { @@ -836,21 +968,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/second_part1.ts] -#!someshebang second second_part1 -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - //// [/src/third/thirdjs/output/third-output.d.ts] #!someshebang second second_part1 interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js index a15ca0afbb99b..efcacf4962e47 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-all-projects.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +169,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -910,46 +1041,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; @@ -1869,26 +1960,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js index 104742266163b..3de22165d36ee 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/strict-in-one-dependency.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": true, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -860,24 +991,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": true, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] interface TheFirst { none: any; diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js index 10a077332c44f..22dc66e618dac 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-baseline-when-internal-is-inside-another-internal.js @@ -1,4 +1,163 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +namespace ts { + /* @internal */ + /** + * Subset of properties from SourceFile that are used in multiple utility functions + */ + export interface SourceFileLike { + readonly text: string; + lineMap?: ReadonlyArray; + /* @internal */ + getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; + } + + /* @internal */ + export interface RedirectInfo { + /** Source file this redirects to. */ + readonly redirectTarget: SourceFile; + /** + * Source file for the duplicate package. This will not be used by the Program, + * but we need to keep this around so we can watch for changes in underlying. + */ + readonly unredirected: SourceFile; + } + + // Source files are declarations when they are external modules. + export interface SourceFile { + someProp: string; + } +}interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +177,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1177,47 +1336,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -namespace ts { - /* @internal */ - /** - * Subset of properties from SourceFile that are used in multiple utility functions - */ - export interface SourceFileLike { - readonly text: string; - lineMap?: ReadonlyArray; - /* @internal */ - getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; - } - - /* @internal */ - export interface RedirectInfo { - /** Source file this redirects to. */ - readonly redirectTarget: SourceFile; - /** - * Source file for the duplicate package. This will not be used by the Program, - * but we need to keep this around so we can watch for changes in underlying. - */ - readonly unredirected: SourceFile; - } - - // Source files are declarations when they are external modules. - export interface SourceFile { - someProp: string; - } -}interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare namespace ts { interface SourceFile { @@ -2226,27 +2344,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index b29a853610f87..0cbe00147124c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3259,78 +3417,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5573,27 +5659,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js index 120b30f17626d..a5bf02c619829 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-comment.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2933,59 +3090,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5264,27 +5368,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 338777d51e5ed..826b0f65121d6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] /**@internal*/ interface TheFirst { none: any; @@ -3501,100 +3659,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5937,27 +6001,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 0b266514ac806..93f781c02b9f8 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/**@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /**@internal*/ constructor() { } + /**@internal*/ prop: string; + /**@internal*/ method() { } + /**@internal*/ get c() { return 10; } + /**@internal*/ set c(val: number) { } +} +namespace normalN { + /**@internal*/ export class C { } + /**@internal*/ export function foo() {} + /**@internal*/ export namespace someNamespace { export class C {} } + /**@internal*/ export namespace someOther.something { export class someClass {} } + /**@internal*/ export import someImport = someNamespace.C; + /**@internal*/ export type internalType = internalC; + /**@internal*/ export const internalConst = 10; + /**@internal*/ export enum internalEnum { a, b, c } +} +/**@internal*/ class internalC {} +/**@internal*/ function internalfoo() {} +/**@internal*/ namespace internalNamespace { export class someClass {} } +/**@internal*/ namespace internalOther.something { export class someClass {} } +/**@internal*/ import internalImport = internalNamespace.someClass; +/**@internal*/ type internalType = internalC; +/**@internal*/ const internalConst = 10; +/**@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -3169,99 +3326,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/**@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /**@internal*/ constructor() { } - /**@internal*/ prop: string; - /**@internal*/ method() { } - /**@internal*/ get c() { return 10; } - /**@internal*/ set c(val: number) { } -} -namespace normalN { - /**@internal*/ export class C { } - /**@internal*/ export function foo() {} - /**@internal*/ export namespace someNamespace { export class C {} } - /**@internal*/ export namespace someOther.something { export class someClass {} } - /**@internal*/ export import someImport = someNamespace.C; - /**@internal*/ export type internalType = internalC; - /**@internal*/ export const internalConst = 10; - /**@internal*/ export enum internalEnum { a, b, c } -} -/**@internal*/ class internalC {} -/**@internal*/ function internalfoo() {} -/**@internal*/ namespace internalNamespace { export class someClass {} } -/**@internal*/ namespace internalOther.something { export class someClass {} } -/**@internal*/ import internalImport = internalNamespace.someClass; -/**@internal*/ type internalType = internalC; -/**@internal*/ const internalConst = 10; -/**@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5640,27 +5704,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js index 29faf13444f9e..b81b83505ad72 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-few-members-of-enum-are-internal.js @@ -1,4 +1,158 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +enum TokenFlags { + None = 0, + /* @internal */ + PrecedingLineBreak = 1 << 0, + /* @internal */ + PrecedingJSDocComment = 1 << 1, + /* @internal */ + Unterminated = 1 << 2, + /* @internal */ + ExtendedUnicodeEscape = 1 << 3, + Scientific = 1 << 4, + Octal = 1 << 5, + HexSpecifier = 1 << 6, + BinarySpecifier = 1 << 7, + OctalSpecifier = 1 << 8, + /* @internal */ + ContainsSeparator = 1 << 9, + /* @internal */ + BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, + /* @internal */ + NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator +} +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +172,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1373,42 +1527,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -enum TokenFlags { - None = 0, - /* @internal */ - PrecedingLineBreak = 1 << 0, - /* @internal */ - PrecedingJSDocComment = 1 << 1, - /* @internal */ - Unterminated = 1 << 2, - /* @internal */ - ExtendedUnicodeEscape = 1 << 3, - Scientific = 1 << 4, - Octal = 1 << 5, - HexSpecifier = 1 << 6, - BinarySpecifier = 1 << 7, - OctalSpecifier = 1 << 8, - /* @internal */ - ContainsSeparator = 1 << 9, - /* @internal */ - BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier, - /* @internal */ - NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator -} -interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - //// [/src/third/thirdjs/output/third-output.d.ts] declare enum TokenFlags { None = 0, @@ -2716,27 +2834,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js index 182887cdc815a..4ac5d22491475 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +196,8 @@ readFiles:: { "/src/2/second-output.js": 1, "/src/2/second-output.js.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3279,78 +3437,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5593,27 +5679,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js index 219f5fd1756ed..04c58f90e11e2 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-when-prepend-is-completely-internal.js @@ -1,4 +1,49 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/* @internal */ const A = 1; + +//// [/src/first/first_part2.ts] + + +//// [/src/first/first_part3.ts] + + +//// [/src/first/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} + +//// [/src/second/second_part1.ts] + + +//// [/src/second/second_part2.ts] + + +//// [/src/second/tsconfig.json] + + +//// [/src/third/third_part1.ts] +const B = 2; + +//// [/src/third/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -13,8 +58,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/first/bin/first-output.d.ts] declare const A = 1; //# sourceMappingURL=first-output.d.ts.map @@ -147,12 +192,6 @@ internal: (0-20) declare const A = 1; ====================================================================== -//// [/src/first/first_PART1.ts] -/* @internal */ const A = 1; - -//// [/src/first/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} - //// [/src/third/thirdjs/output/third-output.d.ts] declare const B = 2; @@ -302,9 +341,3 @@ declare const B = 2; ====================================================================== -//// [/src/third/third_part1.ts] -const B = 2; - -//// [/src/third/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"declarationMap":false,"stripInternal":true,"sourceMap":true,"outFile":"./thirdjs/output/third-output.js"},"references":[{"path":"../first","prepend":true}],"files":["/src/third/third_part1.ts"]} - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index d93d93328562f..67c31ad38fd76 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -1,4 +1,162 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../first", "prepend": true } + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +176,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] interface TheFirst { none: any; @@ -3359,100 +3517,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../first", "prepend": true } - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5795,27 +5859,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js index 29cca87802bf0..eef87379bc71c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal-with-comments-emit-enabled.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": false, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +175,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -3033,99 +3190,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/first/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "outFile": "./bin/first-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "first_PART1.ts", - "first_part2.ts", - "first_part3.ts" - ], - "references": [ - ] -} - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - -//// [/src/second/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "../2/second-output.js", - "skipDefaultLibCheck": true - }, - "references": [ - ] -} - - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5504,27 +5568,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": false, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js index 08beb4b6a4493..e9b253dd41bf5 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/stripInternal.js @@ -1,4 +1,161 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +/*@internal*/ interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + +class normalC { + /*@internal*/ constructor() { } + /*@internal*/ prop: string; + /*@internal*/ method() { } + /*@internal*/ get c() { return 10; } + /*@internal*/ set c(val: number) { } +} +namespace normalN { + /*@internal*/ export class C { } + /*@internal*/ export function foo() {} + /*@internal*/ export namespace someNamespace { export class C {} } + /*@internal*/ export namespace someOther.something { export class someClass {} } + /*@internal*/ export import someImport = someNamespace.C; + /*@internal*/ export type internalType = internalC; + /*@internal*/ export const internalConst = 10; + /*@internal*/ export enum internalEnum { a, b, c } +} +/*@internal*/ class internalC {} +/*@internal*/ function internalfoo() {} +/*@internal*/ namespace internalNamespace { export class someClass {} } +/*@internal*/ namespace internalOther.something { export class someClass {} } +/*@internal*/ import internalImport = internalNamespace.someClass; +/*@internal*/ type internalType = internalC; +/*@internal*/ const internalConst = 10; +/*@internal*/ enum internalEnum { a, b, c } + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "stripInternal": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -38,8 +195,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -2953,59 +3110,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_PART1.ts] -/*@internal*/ interface TheFirst { - none: any; -} - -const s = "Hello, world"; - -interface NoJsForHereEither { - none: any; -} - -console.log(s); - - -//// [/src/second/second_part1.ts] -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - -class normalC { - /*@internal*/ constructor() { } - /*@internal*/ prop: string; - /*@internal*/ method() { } - /*@internal*/ get c() { return 10; } - /*@internal*/ set c(val: number) { } -} -namespace normalN { - /*@internal*/ export class C { } - /*@internal*/ export function foo() {} - /*@internal*/ export namespace someNamespace { export class C {} } - /*@internal*/ export namespace someOther.something { export class someClass {} } - /*@internal*/ export import someImport = someNamespace.C; - /*@internal*/ export type internalType = internalC; - /*@internal*/ export const internalConst = 10; - /*@internal*/ export enum internalEnum { a, b, c } -} -/*@internal*/ class internalC {} -/*@internal*/ function internalfoo() {} -/*@internal*/ namespace internalNamespace { export class someClass {} } -/*@internal*/ namespace internalOther.something { export class someClass {} } -/*@internal*/ import internalImport = internalNamespace.someClass; -/*@internal*/ type internalType = internalC; -/*@internal*/ const internalConst = 10; -/*@internal*/ enum internalEnum { a, b, c } - //// [/src/third/thirdjs/output/third-output.d.ts] declare const s = "Hello, world"; interface NoJsForHereEither { @@ -5284,27 +5388,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "stripInternal": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js index 1b87c4b808c78..cad3db56ff2a1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-all-projects.js @@ -1,4 +1,150 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +/// +const first_part2Const = new firstfirst_part2(); +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tripleRef.d.ts] +declare class firstfirst_part2 { } + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +/// +const second_part1Const = new secondsecond_part1(); +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tripleRef.d.ts] +declare class secondsecond_part1 { } + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +/// +const third_part1Const = new thirdthird_part1(); +var c = new C(); +c.doSomething(); + + +//// [/src/third/tripleRef.d.ts] +declare class thirdthird_part1 { } + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -41,8 +187,8 @@ readFiles:: { "/src/2/second-output.js.map": 1, "/src/first/bin/first-output.d.ts.map": 1, "/src/2/second-output.d.ts.map": 1 -} - +} + //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -986,34 +1132,6 @@ declare function f(): string; ====================================================================== -//// [/src/first/first_part2.ts] -/// -const first_part2Const = new firstfirst_part2(); -console.log(f()); - - -//// [/src/first/tripleRef.d.ts] -declare class firstfirst_part2 { } - -//// [/src/second/second_part1.ts] -/// -const second_part1Const = new secondsecond_part1(); -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/tripleRef.d.ts] -declare class secondsecond_part1 { } - //// [/src/third/thirdjs/output/third-output.d.ts] /// /// @@ -2102,13 +2220,3 @@ declare var c: C; ====================================================================== -//// [/src/third/third_part1.ts] -/// -const third_part1Const = new thirdthird_part1(); -var c = new C(); -c.doSomething(); - - -//// [/src/third/tripleRef.d.ts] -declare class thirdthird_part1 { } - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js index ee1fd0fdde62c..939185954d7ef 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/triple-slash-refs-in-one-project.js @@ -1,4 +1,140 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +/// +const second_part1Const = new secondsecond_part1(); +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tripleRef.d.ts] +declare class secondsecond_part1 { } + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +154,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] /// declare const second_part1Const: secondsecond_part1; @@ -895,25 +1031,6 @@ declare function f(): string; ====================================================================== -//// [/src/second/second_part1.ts] -/// -const second_part1Const = new secondsecond_part1(); -namespace N { - // Comment text -} - -namespace N { - function f() { - console.log('testing'); - } - - f(); -} - - -//// [/src/second/tripleRef.d.ts] -declare class secondsecond_part1 { } - //// [/src/third/thirdjs/output/third-output.d.ts] /// interface TheFirst { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js index cdb14cd5eebb7..de5c71fc3e94b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-incremental.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "incremental": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1719,26 +1850,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "incremental": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js index 213a9f7d07ef7..5ae9007d3c60d 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-is-not-composite-but-uses-project-references.js @@ -1,4 +1,135 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +149,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1565,26 +1696,3 @@ sourceFile:../../third_part1.ts --- >>>//# sourceMappingURL=third-output.js.map -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js index 6cffcd70b6d2d..6fed22e3f836d 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-final-project-specifies-tsBuildInfoFile.js @@ -1,4 +1,136 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "tsBuildInfoFile": "./thirdjs/output/third.tsbuildinfo", + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:00:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +150,8 @@ [12:00:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1719,27 +1851,3 @@ declare var c: C; ====================================================================== -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "tsBuildInfoFile": "./thirdjs/output/third.tsbuildinfo", - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - diff --git a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js index fa65982a75d39..facf822c736d6 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/initial-build/when-source-files-are-empty-in-the-own-file.js @@ -1,4 +1,133 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); + + +//// [/src/first/first_part2.ts] +console.log(f()); + + +//// [/src/first/first_part3.ts] +function f() { + return "JS does hoists"; +} + +//// [/src/first/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "first_PART1.ts", + "first_part2.ts", + "first_part3.ts" + ], + "references": [ + ] +} + + +//// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} + + +//// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} + + +//// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} + + +//// [/src/third/third_part1.ts] + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: /lib/tsc --b /src/third --verbose [12:01:00 AM] Projects in this build: * src/first/tsconfig.json @@ -18,8 +147,8 @@ [12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/2/second-output.d.ts] declare namespace N { } @@ -1619,6 +1748,3 @@ declare class C { ====================================================================== -//// [/src/third/third_part1.ts] - - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js index 24d84a1cd194c..c78b4a1dc080b 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/builds-correctly.js @@ -1,8 +1,65 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/src/main /src/src/other -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" } + ] +} + +//// [/src/src/other/other.ts] +export const Other = 0; + +//// [/src/src/other/tsconfig.json] +{ + "extends": "../../tsconfig.base.json" +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} + + +Output:: +/lib/tsc --b /src/src/main /src/src/other +exitCode:: ExitStatus.Success + + //// [/src/dist/main/a.d.ts] export {}; diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js index a976119dce6f3..997d1c50a47b9 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js @@ -1,4 +1,61 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" } + ] +} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.json] +{ + "extends": "../../tsconfig.base.json" +} + +//// [/src/tsconfig.base.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} + + + +Output:: /lib/tsc --b /src/src/main --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.json @@ -21,8 +78,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/dist/other.d.ts] export declare const Other = 0; @@ -66,17 +123,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/tsconfig.base.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - - "outDir": "./dist/", - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js index 2e7587aa91a3a..f122c25b5c52a 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-error-for-same-tsbuildinfo-file.js @@ -1,4 +1,43 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other"}]} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} + +//// [/src/tsconfig.base.json] + + + + +Output:: /lib/tsc --b /src/src/main --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.json @@ -21,8 +60,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/dist/other.d.ts] export declare const Other = 0; @@ -64,9 +103,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/src/main/tsconfig.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other"}]} - -//// [/src/src/other/tsconfig.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} - diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js index 022c2f30fd3a4..a61de07968d9a 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/initial-build/reports-no-error-when-tsbuildinfo-differ.js @@ -1,4 +1,43 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/main/a.ts] +import { b } from './b'; +const a = b; + +//// [/src/src/main/b.ts] +export const b = 0; + + +//// [/src/src/main/tsconfig.main.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other/tsconfig.other.json"}]} + +//// [/src/src/other/other.ts] +export const Other = 0; + + +//// [/src/src/other/tsconfig.other.json] +{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} + +//// [/src/tsconfig.base.json] + + + + +Output:: /lib/tsc --b /src/src/main/tsconfig.main.json --verbose [12:00:00 AM] Projects in this build: * src/src/other/tsconfig.other.json @@ -13,8 +52,8 @@ [12:00:00 AM] Building project '/src/src/main/tsconfig.main.json'... exitCode:: ExitStatus.Success - - + + //// [/src/dist/a.d.ts] export {}; @@ -118,11 +157,3 @@ exports.Other = 0; "version": "FakeTSVersion" } -//// [/src/src/main/tsconfig.json] unlink -//// [/src/src/main/tsconfig.main.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"},"references":[{"path":"../other/tsconfig.other.json"}]} - -//// [/src/src/other/tsconfig.json] unlink -//// [/src/src/other/tsconfig.other.json] -{"compilerOptions":{"composite":true,"outDir":"../../dist/"}} - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js index 139570834a21f..5be549694cfda 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/files-containing-json-file.js @@ -1,8 +1,62 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withFiles.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: +/lib/tsc --b /src/tsconfig_withFiles.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js index a31f08c508f74..99547b7cab508 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js @@ -1,4 +1,75 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/main/index.ts] +import { foo } from '../strings/foo.json'; + +console.log(foo); + +//// [/src/main/tsconfig.json] +{ + "extends": "../tsconfig.json", + "include": [ + "./**/*.ts" + ], + "references": [ + { + "path": "../strings/tsconfig.json" + } + ] +} + +//// [/src/strings/foo.json] +{ + "foo": "bar baz" +} + +//// [/src/strings/tsconfig.json] +{ + "extends": "../tsconfig.json", + "include": [ "foo.json" ], + "references": [] +} + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "rootDir": "./", + "composite": true, + "resolveJsonModule": true, + "strict": true, + "esModuleInterop": true + }, + "references": [ + { + "path": "./strings/tsconfig.json" + }, + { + "path": "./main/tsconfig.json" + } + ], + "files": [] +} + + + + +Output:: /lib/tsc --b src/tsconfig.json --verbose [12:01:00 AM] Projects in this build: * src/strings/tsconfig.json @@ -14,8 +85,8 @@ [12:01:00 AM] Building project '/src/main/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/main/index.d.ts] export {}; diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js index 49e254138b890..c3260fe00e4bc 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-and-files.js @@ -1,8 +1,65 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeAndFiles.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +//// [/src/tsconfig_withIncludeAndFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeAndFiles.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js index b5f046a1b433f..65a6887df6724 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -1,8 +1,60 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeOfJson.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/index.json] +{"hello":"world"} +//// [/src/src/index.ts] +import hello from "./index.json" + +export default hello.hello +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeOfJson.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/index.d.ts] declare const _default: string; export default _default; @@ -68,12 +120,3 @@ exports["default"] = index_json_1["default"].hello; "version": "FakeTSVersion" } -//// [/src/src/hello.json] unlink -//// [/src/src/index.json] -{"hello":"world"} - -//// [/src/src/index.ts] -import hello from "./index.json" - -export default hello.hello - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js index 9268ee2246294..25917941f674d 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-of-json-along-with-other-include.js @@ -1,8 +1,62 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tsconfig_withIncludeOfJson.json -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} + + + +Output:: +/lib/tsc --b /src/tsconfig_withIncludeOfJson.json +exitCode:: ExitStatus.Success + + //// [/src/dist/src/hello.json] { "hello": "world" diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js index 67924de06f72c..e1d0659797c0f 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/include-only.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] + + +//// [/src/tsconfig_withInclude.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b /src/tsconfig_withInclude.json src/src/index.ts:1:19 - error TS6307: File '/src/src/hello.json' is not listed within the file list of project '/src/tsconfig_withInclude.json'. Projects must list all files or use an 'include' pattern. @@ -9,5 +63,5 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js index 5c1186b2faef4..7b35e358f8031 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, "sourceMap": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -8,8 +62,8 @@ [12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... exitCode:: ExitStatus.Success - - + + //// [/src/dist/src/hello.json] { "hello": "world" @@ -81,20 +135,3 @@ exports["default"] = hello_json_1["default"].hello; "version": "FakeTSVersion" } -//// [/src/tsconfig_withFiles.json] -{ - "compilerOptions": { - "composite": true, "sourceMap": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "outDir": "dist", - "skipDefaultLibCheck": true - }, - "files": [ - "src/index.ts", "src/hello.json" - ] -} - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js index 61e439430dc23..2c70739288407 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js @@ -1,4 +1,58 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/src/hello.json] +{ + "hello": "world" +} + +//// [/src/src/index.ts] +import hello from "./hello.json" + +export default hello.hello + +//// [/src/tsconfig_withFiles.json] +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} + +//// [/src/tsconfig_withInclude.json] + + +//// [/src/tsconfig_withIncludeAndFiles.json] + + +//// [/src/tsconfig_withIncludeOfJson.json] + + + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:01:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -8,8 +62,8 @@ [12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... exitCode:: ExitStatus.Success - - + + //// [/src/src/index.d.ts] declare const _default: string; export default _default; @@ -25,23 +79,6 @@ var hello_json_1 = __importDefault(require("./hello.json")); exports["default"] = hello_json_1["default"].hello; -//// [/src/tsconfig_withFiles.json] -{ - "compilerOptions": { - "composite": true, - "moduleResolution": "node", - "module": "commonjs", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - - "skipDefaultLibCheck": true - }, - "files": [ - "src/index.ts", "src/hello.json" - ] -} - //// [/src/tsconfig_withFiles.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js index 9bfe73167f461..d6bfcf431e0b1 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b src/tsconfig.json --verbose [12:04:00 AM] Projects in this build: * src/strings/tsconfig.json @@ -10,5 +13,5 @@ [12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js index 059fd1042cc34..193cfa9caec2e 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:04:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -6,5 +9,5 @@ [12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js index d412d147ce925..e60bde489d03e 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose [12:04:00 AM] Projects in this build: * src/tsconfig_withFiles.json @@ -6,5 +9,5 @@ [12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js index 300f31f413b57..1e2a206e17709 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/Detects-type-only-changes-in-upstream-projects.js @@ -1,4 +1,13 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "WELCOME PLANET"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:08:00 AM] Projects in this build: * src/core/tsconfig.json @@ -20,8 +29,8 @@ [12:08:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] file written with same contents //// [/src/core/index.d.ts.map] {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAyB,CAAC;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} @@ -37,12 +46,6 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/index.ts] -export const someString: string = "WELCOME PLANET"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js index 9ee7bc33fcd6e..43a0e676cf006 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js @@ -1,4 +1,14 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: /lib/tsc --b /src/tests --listEmittedFiles TSFILE: /src/core/index.js TSFILE: /src/core/index.d.ts.map @@ -12,8 +22,8 @@ TSFILE: /src/tests/index.js TSFILE: /src/tests/index.d.ts TSFILE: /src/tests/tsconfig.tsbuildinfo exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -42,13 +52,6 @@ var someClass = /** @class */ (function () { exports.someClass = someClass; -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js index 22bef1c92e992..84343bc826207 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js @@ -1,4 +1,14 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: /lib/tsc --b /src/tests --listFiles /lib/lib.d.ts /src/core/anotherModule.ts @@ -14,8 +24,8 @@ /src/logic/index.d.ts /src/tests/index.ts exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -44,13 +54,6 @@ var someClass = /** @class */ (function () { exports.someClass = someClass; -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js index 0bfd4788da259..841221ea1494e 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-from-start-if-force-option-is-set.js @@ -1,4 +1,7 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --verbose --force [12:16:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +21,8 @@ [12:16:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] file written with same contents //// [/src/core/anotherModule.d.ts.map] file written with same contents //// [/src/core/anotherModule.js] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js index 095f8f11c33bb..0b48c31bc5009 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tests/tsconfig.base.json] +{"compilerOptions":{}} + + + +Output:: /lib/tsc --b /src/tests --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,13 +20,10 @@ [12:04:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.base.json] -{"compilerOptions":{}} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js index 2cb39bf369c47..97ae68cfe6df4 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-tsconfig-changes.js @@ -1,4 +1,22 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, "target": "es3", + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: /lib/tsc --b /src/tests --verbose [12:20:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,25 +32,10 @@ [12:20:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, "target": "es3", - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - } -} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js index dfcae27b84e93..27da1c1711d89 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js @@ -1,4 +1,14 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: /lib/tsc --b /src/tests --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -36,8 +46,8 @@ readFiles:: { "/src/tests/tsconfig.tsbuildinfo": 1, "/src/tests/index.ts": 1, "/src/tests/index.d.ts": 1 -} - +} + //// [/src/core/index.d.ts] export declare const someString: string; export declare function leftPad(s: string, n: number): string; @@ -201,13 +211,6 @@ var someClass = /** @class */ (function () { exports.someClass = someClass; -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js index e9ec98fc4b081..ce3b289a39020 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js @@ -1,4 +1,15 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, "declaration": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: /lib/tsc --b /src/core --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +19,8 @@ [12:04:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; @@ -22,14 +33,6 @@ export declare function multiply(a: number, b: number): number; //// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, "declaration": true, - "skipDefaultLibCheck": true - } -} - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js index ac73290258cea..60a833c3ff71a 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": true + } +} + + + +Output:: /lib/tsc --b /src/tests --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,8 +33,8 @@ [12:04:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] "use strict"; @@ -48,22 +67,6 @@ var mod = __importStar(require("../core/anotherModule")); exports.m = mod; -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": true - } -} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js index d469852c88a19..5b8479da87374 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js @@ -1,4 +1,23 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:12:00 AM] Projects in this build: * src/core/tsconfig.json @@ -29,8 +48,8 @@ readFiles:: { "/src/tests/index.ts": 1, "/src/logic/decls/index.d.ts": 1, "/src/tests/index.d.ts": 1 -} - +} + //// [/src/logic/decls/index.d.ts] export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; @@ -40,22 +59,6 @@ export declare const m: typeof mod; //// [/src/logic/index.js] file written with same contents //// [/src/logic/index.js.map] file written with same contents //// [/src/logic/index.js.map.baseline.txt] file written with same contents -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "declarationDir": "decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - //// [/src/logic/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js index d52890fbfb689..36a0c3297386c 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js @@ -1,4 +1,15 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "module": "amd" + } +} + + + +Output:: /lib/tsc --b /src/core --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +19,8 @@ [12:04:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -32,14 +43,6 @@ define(["require", "exports"], function (require, exports) { }); -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, - "module": "amd" - } -} - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js index 2ec6f3962a0aa..45558c7e97038 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js @@ -1,4 +1,17 @@ -//// [/lib/incremental-declaration-changesOutput.txt] +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, +"listFiles": true, +"listEmittedFiles": true, + "target": "es5", + } +} + + + +Output:: /lib/tsc --b /src/core --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -16,8 +29,8 @@ TSFILE: /src/core/tsconfig.tsbuildinfo /src/core/index.ts /src/core/some_decl.d.ts exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -36,16 +49,6 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, -"listFiles": true, -"listEmittedFiles": true, - "target": "es5", - } -} - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js index ae9b4a03c3bf9..2e5afd1dfdd16 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/Only-builds-the-leaf-node-project.js @@ -1,4 +1,10 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/tests/index.ts] +const m = 10; + + + +Output:: /lib/tsc --b /src/tests --verbose [12:04:00 AM] Projects in this build: * src/core/tsconfig.json @@ -14,8 +20,8 @@ [12:04:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/tests/index.d.ts] declare const m = 10; @@ -24,9 +30,6 @@ declare const m = 10; var m = 10; -//// [/src/tests/index.ts] -const m = 10; - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js index ff5990493339f..74292ffd7a679 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/indicates-that-it-would-skip-builds-during-a-dry-build.js @@ -1,4 +1,7 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --dry [12:12:00 AM] Project '/src/core/tsconfig.json' is up to date @@ -7,5 +10,5 @@ [12:12:00 AM] Project '/src/tests/tsconfig.json' is up to date exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js index 1c2f36d6e8d6c..7c8b7a03dc36c 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js @@ -1,12 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +class someClass { } + + + +Output:: /lib/tsc --b /src/tests --listEmittedFiles TSFILE: /src/core/index.js TSFILE: /src/core/index.d.ts.map TSFILE: /src/core/index.d.ts TSFILE: /src/core/tsconfig.tsbuildinfo exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] file written with same contents //// [/src/core/index.d.ts.map] file written with same contents //// [/src/core/index.js] @@ -25,13 +35,6 @@ var someClass = /** @class */ (function () { }()); -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js index 44b55e94c8c28..a7574676d9d19 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js @@ -1,12 +1,22 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +class someClass { } + + + +Output:: /lib/tsc --b /src/tests --listFiles /lib/lib.d.ts /src/core/anotherModule.ts /src/core/index.ts /src/core/some_decl.d.ts exitCode:: ExitStatus.Success - - + + //// [/src/core/index.d.ts] file written with same contents //// [/src/core/index.d.ts.map] file written with same contents //// [/src/core/index.js] @@ -25,13 +35,6 @@ var someClass = /** @class */ (function () { }()); -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js index 3cd1d156e4ee4..62fc8327d6ea0 100644 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js @@ -1,4 +1,14 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +class someClass { } + + + +Output:: /lib/tsc --b /src/tests --verbose [12:08:00 AM] Projects in this build: * src/core/tsconfig.json @@ -31,8 +41,8 @@ readFiles:: { "/src/core/index.d.ts": 1, "/src/logic/tsconfig.tsbuildinfo": 1, "/src/tests/tsconfig.tsbuildinfo": 1 -} - +} + //// [/src/core/index.d.ts] file written with same contents //// [/src/core/index.d.ts.map] file written with same contents //// [/src/core/index.d.ts.map.baseline.txt] file written with same contents @@ -52,13 +62,6 @@ var someClass = /** @class */ (function () { }()); -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js index 41183f37ea46a..7a9434e048898 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js @@ -1,8 +1,106 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests --force -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests --force +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js index e2ada1a35ed78..70f20909ef304 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-declarationDir-is-specified.js @@ -1,8 +1,94 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"declarationDir":"out/decls"},"references":[{"path":"../core"}]} +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -103,9 +189,6 @@ import * as mod from '../core/anotherModule'; export declare const m: typeof mod; -//// [/src/logic/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"declarationDir":"out/decls"},"references":[{"path":"../core"}]} - //// [/src/logic/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js index 3883d2ddaadb4..e238ffb0a4aa6 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-outDir-is-specified.js @@ -1,8 +1,94 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"outDir":"outDir"},"references":[{"path":"../core"}]} +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -156,9 +242,6 @@ exports.m = mod; "version": "FakeTSVersion" } -//// [/src/logic/tsconfig.json] -{"compilerOptions":{"composite":true,"declaration":true,"sourceMap":true,"outDir":"outDir"},"references":[{"path":"../core"}]} - //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js index 8a70a3ceb5d80..bfb3843cfcc7a 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js @@ -1,4 +1,64 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +68,8 @@ [12:00:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -44,13 +104,3 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true - } -} - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js b/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js index f277322de2f7f..aa5fd83bd9c2b 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/can-detect-when-and-what-to-rebuild.js @@ -1,4 +1,268 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.d.ts] + + +//// [/src/core/anotherModule.d.ts.map] + + +//// [/src/core/anotherModule.js] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.d.ts] + + +//// [/src/core/index.d.ts.map] + + +//// [/src/core/index.js] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] + + +//// [/src/logic/index.js] + + +//// [/src/logic/index.js.map] + + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] + + +//// [/src/tests/index.js] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -12,5 +276,5 @@ [12:01:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js index 00946a2c55ce3..20dc07826060f 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-build-downstream-projects-if-upstream-projects-have-errors.js @@ -1,4 +1,94 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.muitply(); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -26,8 +116,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -106,12 +196,3 @@ exports.multiply = multiply; "version": "FakeTSVersion" } -//// [/src/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.muitply(); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js index c66ceddb85bc2..b3d5781bcf8bf 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/does-not-write-any-files-in-a-dry-build.js @@ -1,4 +1,71 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --dry [12:00:00 AM] A non-dry build would build project '/src/core/tsconfig.json' @@ -7,5 +74,5 @@ [12:00:00 AM] A non-dry build would build project '/src/tests/tsconfig.json' exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js index 249ab29b363eb..059f8a4801472 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --listEmittedFiles TSFILE: /src/core/anotherModule.js TSFILE: /src/core/anotherModule.d.ts.map @@ -15,8 +113,8 @@ TSFILE: /src/tests/index.js TSFILE: /src/tests/index.d.ts TSFILE: /src/tests/tsconfig.tsbuildinfo exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js index 96f192f37765c..be2ed648a951f 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --listFiles /lib/lib.d.ts /src/core/anotherModule.ts @@ -14,8 +112,8 @@ /src/logic/index.d.ts /src/tests/index.ts exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js index 0eca4604f6dde..c02004f88fdb4 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js @@ -1,4 +1,105 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.base.json] +{"compilerOptions":{"target":"es3"}} + +//// [/src/tests/tsconfig.json] +{ + "extends": "./tsconfig.base.json", "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +119,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -191,24 +292,6 @@ var mod = require("../core/anotherModule"); exports.m = mod; -//// [/src/tests/tsconfig.base.json] -{"compilerOptions":{"target":"es3"}} - -//// [/src/tests/tsconfig.json] -{ - "extends": "./tsconfig.base.json", "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - } -} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js index de8181610b633..cb9a240024f16 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js @@ -1,8 +1,117 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/tests --clean -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/core/anotherModule.d.ts] + + +//// [/src/core/anotherModule.d.ts.map] + + +//// [/src/core/anotherModule.js] + + +//// [/src/core/anotherModule.ts] + + +//// [/src/core/index.d.ts] + + +//// [/src/core/index.d.ts.map] + + +//// [/src/core/index.js] + + +//// [/src/core/index.ts] + + +//// [/src/core/some_decl.d.ts] + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/core/tsconfig.tsbuildinfo] + + +//// [/src/logic/index.d.ts] +//// [/src/logic/index.js] + + +//// [/src/logic/index.js.map] + + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] + + +//// [/src/tests/index.d.ts] + + +//// [/src/tests/index.js] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/tests/tsconfig.tsbuildinfo] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/tests --clean +exitCode:: ExitStatus.Success + + //// [/src/core/anotherModule.d.ts] unlink //// [/src/core/anotherModule.d.ts.map] unlink //// [/src/core/anotherModule.js] unlink diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js index 6212d153248d4..492fd4efecd63 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js @@ -1,4 +1,102 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -33,8 +131,8 @@ readFiles:: { "/src/tests/tsconfig.tsbuildinfo": 1, "/src/tests/index.ts": 1, "/src/logic/index.d.ts": 1 -} - +} + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js index aac58a3f56560..1d724d20489bd 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js @@ -1,4 +1,62 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +66,8 @@ [12:01:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -28,14 +86,6 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, - "skipDefaultLibCheck": true - } -} - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js index 9af3e1cf132fe..2626ba8b449ef 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js @@ -1,4 +1,103 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": false + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -18,8 +117,8 @@ [12:01:00 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -191,22 +290,6 @@ var mod = require("../core/anotherModule"); exports.m = mod; -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": false - } -} - //// [/src/tests/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js index 4884d46e47ee0..d8ca4ee482d19 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-logic-specifies-tsBuildInfoFile.js @@ -1,4 +1,103 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "ownFile.tsbuildinfo", + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/tests --verbose [12:00:00 AM] Projects in this build: * src/core/tsconfig.json @@ -33,8 +132,8 @@ readFiles:: { "/src/tests/tsconfig.tsbuildinfo": 1, "/src/tests/index.ts": 1, "/src/logic/index.d.ts": 1 -} - +} + //// [/src/core/anotherModule.d.ts] export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map @@ -465,22 +564,6 @@ sourceFile:index.ts "version": "FakeTSVersion" } -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "tsBuildInfoFile": "ownFile.tsbuildinfo", - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js index 94ae61d2a9057..d07f6d2c59bad 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js @@ -1,4 +1,62 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/core/anotherModule.ts] +export const World = "hello"; + + +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; + + +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "module": "commonjs" + } +} + +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: /lib/tsc --b /src/core --verbose [12:01:00 AM] Projects in this build: * src/core/tsconfig.json @@ -8,8 +66,8 @@ [12:01:00 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -28,14 +86,6 @@ function multiply(a, b) { return a * b; } exports.multiply = multiply; -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, - "module": "commonjs" - } -} - //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js index 75961f46ab3cd..9e48191d3e515 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js @@ -1,23 +1,4 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --b /src/core --verbose -[12:01:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist - -[12:01:00 AM] Building project '/src/core/tsconfig.json'... - -TSFILE: /src/core/anotherModule.js -TSFILE: /src/core/index.js -TSFILE: /src/core/tsconfig.tsbuildinfo -/lib/lib.esnext.d.ts -/lib/lib.esnext.full.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - +Input:: //// [/lib/lib.d.ts] /// /// @@ -41,14 +22,18 @@ declare const console: { log(msg: any): void; }; /// /// -//// [/src/core/anotherModule.js] +//// [/src/core/anotherModule.ts] export const World = "hello"; -//// [/src/core/index.js] -export const someString = "HELLO WORLD"; -export function leftPad(s, n) { return s + n; } -export function multiply(a, b) { return a * b; } +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + +//// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -61,6 +46,56 @@ export function multiply(a, b) { return a * b; } } } +//// [/src/logic/index.ts] + + +//// [/src/logic/tsconfig.json] + + +//// [/src/tests/index.ts] + + +//// [/src/tests/tsconfig.json] + + +//// [/src/ui/index.ts] + + +//// [/src/ui/tsconfig.json] + + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:01:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist + +[12:01:00 AM] Building project '/src/core/tsconfig.json'... + +TSFILE: /src/core/anotherModule.js +TSFILE: /src/core/index.js +TSFILE: /src/core/tsconfig.tsbuildinfo +/lib/lib.esnext.d.ts +/lib/lib.esnext.full.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +export const World = "hello"; + + +//// [/src/core/index.js] +export const someString = "HELLO WORLD"; +export function leftPad(s, n) { return s + n; } +export function multiply(a, b) { return a * b; } + + //// [/src/core/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js index 447a8dbcc1f5d..7d4047dec18ae 100644 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js @@ -1,8 +1,11 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --force exitCode:: ExitStatus.Success - - + + //// [/src/core/anotherModule.d.ts] file written with same contents //// [/src/core/anotherModule.d.ts.map] file written with same contents //// [/src/core/anotherModule.js] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js index b0b052304a231..9fe2a59e8827e 100644 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js +++ b/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --clean exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js index ac7c9eb5d8614..736fc2c937f48 100644 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --b /src/tests --verbose [12:16:00 AM] Projects in this build: * src/core/tsconfig.json @@ -19,5 +22,5 @@ readFiles:: { "/src/core/tsconfig.tsbuildinfo": 1, "/src/logic/tsconfig.tsbuildinfo": 1, "/src/tests/tsconfig.tsbuildinfo": 1 -} - +} + diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js index 0e68255cabfe1..074880d05ba20 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js @@ -1,4 +1,61 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from 'a'; +export const b = new A(); + +//// [/src/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/src/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{"compilerOptions":{"composite":true,"moduleResolution":"classic"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -11,8 +68,8 @@ /src/refs/a.d.ts /src/c.ts exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare class A { } @@ -43,10 +100,6 @@ var a_1 = require("a"); exports.b = new a_1.A(); -//// [/src/b.ts] -import {A} from 'a'; -export const b = new A(); - //// [/src/c.js] "use strict"; exports.__esModule = true; @@ -86,9 +139,6 @@ a_1.X; "version": "FakeTSVersion" } -//// [/src/tsconfig.b.json] -{"compilerOptions":{"composite":true,"moduleResolution":"classic"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} - //// [/src/tsconfig.b.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js index f80b631171b88..42a9feff5eec9 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/builds-correctly.js @@ -1,4 +1,73 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from '@ref/a'; +export const b = new A(); + + +//// [/src/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/src/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{ + "compilerOptions": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ "./*" ] + } + }, + "files": [ "b.ts" ], + "references": [ { "path": "tsconfig.a.json" } ] +} + + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -11,8 +80,8 @@ /src/refs/a.d.ts /src/c.ts exitCode:: ExitStatus.Success - - + + //// [/src/a.d.ts] export declare class A { } diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index 5430929d96f66..10a5f43474c07 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/initial-build/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -1,4 +1,56 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/a.ts] +export class A {} + + +//// [/src/b.ts] +import {A} from 'a'; +export const b = new A(); + +//// [/src/c.ts] + + +//// [/src/refs/a.d.ts] + + +//// [/src/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/src/tsconfig.b.json] +{"compilerOptions":{"composite":true,"moduleResolution":"node"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + +//// [/src/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + + + +Output:: /lib/tsc --b /src/tsconfig.c.json --listFiles /lib/lib.d.ts /src/a.ts @@ -13,8 +65,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/a.d.ts] export declare class A { } @@ -32,10 +84,6 @@ var A = /** @class */ (function () { exports.A = A; -//// [/src/b.ts] -import {A} from 'a'; -export const b = new A(); - //// [/src/tsconfig.a.tsbuildinfo] { "program": { @@ -66,6 +114,3 @@ export const b = new A(); "version": "FakeTSVersion" } -//// [/src/tsconfig.b.json] -{"compilerOptions":{"composite":true,"moduleResolution":"node"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} - diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js index 2e58a44def153..a0c00c62dc5ff 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-and-tsbuildinfo-as-null-on-command-line-but-has-tsbuild-info-in-config.js @@ -1,8 +1,42 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite false --p src/project --tsBuildInfoFile null -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite false --p src/project --tsBuildInfoFile null +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js index 085086aefac88..5b9300a30db29 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js @@ -1,4 +1,38 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + "tsBuildInfoFile": "tsconfig.json.tsbuildinfo" + }, + "include": [ + "src/**/*.ts" + ] +} + + + +Output:: /lib/tsc --composite false --p src/project src/project/tsconfig.json:6:9 - error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'. @@ -9,8 +43,8 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated - - + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js index 9386b09ca07e7..cab79a8011fa5 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line.js @@ -1,8 +1,41 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite false --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite false --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js index 585e7240af0e7..917419c89e0d5 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-null-on-command-line.js @@ -1,8 +1,41 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --composite null --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "composite": true, + }, + "include": [ + "src/**/*.ts" + ] +} + + +Output:: +/lib/tsc --composite null --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js index 6d9d31aeb5b23..689fb4849c337 100644 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js @@ -1,4 +1,11 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: /lib/tsc --incremental -p src exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +21,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -81,7 +88,3 @@ console.log("hi"); "version": "FakeTSVersion" } -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js index 9923f0c48c3b6..7e86f002f45c7 100644 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js @@ -1,4 +1,13 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: /lib/tsc --incremental -p src exitCode:: ExitStatus.Success Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -14,8 +23,8 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + //// [/src/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -83,9 +92,3 @@ console.log("hi"); "version": "FakeTSVersion" } -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js index b73173d64766c..36e0f66240fb9 100644 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js +++ b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js @@ -1,11 +1,14 @@ -//// [/lib/incremental-declaration-doesnt-changeOutput.txt] -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success - - +Input:: //// [/src/project/src/main.d.ts] export const x = 10;export const xy = 100; + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js index cfa497cc1f171..7233ef14aa985 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js @@ -1,8 +1,40 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +//// [/src/project/src/main.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + }, + "include": [ + "src/**/*.ts" + ] +} + + + +Output:: +/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo +exitCode:: ExitStatus.Success + + //// [/src/project/.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js index a52e9281efb41..ed14d28cce10e 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js @@ -1,8 +1,37 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --p src/project --rootDir src/project/src -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +//// [/src/project/src/main.ts] +export const x = 10; + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outDir": "dist", + }, +} + + +Output:: +/lib/tsc --p src/project --rootDir src/project/src +exitCode:: ExitStatus.Success + + //// [/src/project/dist/main.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js index 9e4c4058d265f..fedbd3226acce 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js @@ -1,8 +1,38 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; +//// [/src/project/src/main.ts] +export const x = 10; + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outDir": "./built", + "rootDir": "./" + }, +} + + +Output:: +/lib/tsc --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/built/src/main.js] "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js index d89c6dde708a8..d9f7c4c5d12a5 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -1,4 +1,44 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --incremental -p src src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,9 +62,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; - + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js index e3bba0fddb45f..6416598c8ba64 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js @@ -1,4 +1,46 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/shared/types/db.ts] +export interface A { + name: string; +} + +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +; + +//// [/src/src/other.ts] +console.log("hi"); +export { } + +//// [/src/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + + +Output:: /lib/tsc --incremental -p src src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -27,5 +69,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js index fce0d7c659459..934a88a286caa 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js @@ -1,8 +1,35 @@ -//// [/lib/initial-buildOutput.txt] -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/another.d.ts] +export const y = 10; +//// [/src/project/src/main.d.ts] +export const x = 10; +//// [/src/project/tsconfig.json] +{} + + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + //// [/src/project/tsconfig.tsbuildinfo] { "program": { diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js index b8bd5ebd76ab6..d0248f2f19ce3 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js index 8c858da7594be..32ae4d7118679 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --p src/project --rootDir src/project/src exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js index 6dd851d6f1fcb..e8d5d417eb7eb 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --p src/project exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js index 35e8db9e4a1e3..11f0fb20c8648 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --incremental -p src src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,5 +25,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js index 93fd71e9c2e6b..5f80229a49f2c 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js @@ -1,4 +1,7 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --incremental -p src src/src/main.ts:4:1 - error TS1005: ',' expected. @@ -27,5 +30,5 @@ Semantic diagnostics in builder refreshed for:: /src/shared/types/db.ts /src/src/main.ts /src/src/other.ts - - + + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js index c85dc67540d29..de92cd31eb4d9 100644 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js +++ b/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js @@ -1,5 +1,8 @@ -//// [/lib/no-change-runOutput.txt] +Input:: + + +Output:: /lib/tsc --incremental --p src/project exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js b/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js index 7ef3574626b0a..682f708232638 100644 --- a/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js +++ b/tests/baselines/reference/tsc/listFilesOnly/initial-build/combined-with-watch.js @@ -1,6 +1,15 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + +//// [/src/test.ts] + + + + +Output:: /lib/tsc /src/test.ts --watch --listFilesOnly error TS6370: Options 'watch' and 'listFilesOnly' cannot be combined. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + diff --git a/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js b/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js index 6a97401e56070..5bdaee4b00882 100644 --- a/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js +++ b/tests/baselines/reference/tsc/listFilesOnly/initial-build/loose-file.js @@ -1,7 +1,28 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/test.ts] +export const x = 1; + + + +Output:: /lib/tsc /src/test.ts --listFilesOnly /lib/lib.d.ts /src/test.ts exitCode:: ExitStatus.Success - - + + diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index e8a58a1673e3a..5c89f9c9dbe42 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -1,4 +1,10 @@ -//// [/lib/initial-buildOutput.txt] +Input:: +//// [/lib/lib.d.ts] + + + + +Output:: /lib/tsc Version FakeTSVersion Syntax: tsc [options] [file...] @@ -46,5 +52,5 @@ Options: --esModuleInterop Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. @ Insert command line options and files from a file. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - + + From 25d7928f948b045b390713c857e1da56272c8a54 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 28 May 2020 18:49:57 -0700 Subject: [PATCH 5/7] Add helper to baseline serialized invocations of tsc on incremental edits --- .../tsbuild/containerOnlyReferenced.ts | 2 +- .../unittests/tsbuild/emitDeclarationOnly.ts | 14 +- src/testRunner/unittests/tsbuild/helpers.ts | 164 +++- .../inferredTypeFromTransitiveModule.ts | 6 +- .../tsbuild/javascriptProjectEmit.ts | 2 +- .../unittests/tsbuild/lateBoundSymbol.ts | 2 +- .../unittests/tsbuild/noEmitOnError.ts | 32 +- src/testRunner/unittests/tsbuild/outFile.ts | 2 +- .../unittests/tsbuild/resolveJsonModule.ts | 6 +- src/testRunner/unittests/tsbuild/sample.ts | 22 +- src/testRunner/unittests/tsc/helpers.ts | 14 +- src/testRunner/unittests/tsc/incremental.ts | 67 +- ...ter-initial-build-doesnt-build-anything.js | 24 + ...ter-initial-build-doesnt-build-anything.js | 21 - ...-emitDeclarationOnly-and-declarationMap.js | 129 ---- ...import-project-with-emitDeclarationOnly.js | 122 --- ...mports-project-with-emitDeclarationOnly.js | 107 --- ...mports-project-with-emitDeclarationOnly.js | 97 --- ...-emitDeclarationOnly-and-declarationMap.js | 132 ++++ ...import-project-with-emitDeclarationOnly.js | 125 +++ ...mports-project-with-emitDeclarationOnly.js | 211 +++++ ...-transitive-module-with-isolatedModules.js | 119 --- .../inferred-type-from-transitive-module.js | 119 --- ...hange-in-signature-with-isolatedModules.js | 34 - ...-transitive-module-with-isolatedModules.js | 122 +++ .../inferred-type-from-transitive-module.js | 122 +++ ...hange-in-signature-with-isolatedModules.js | 37 + ...rojects-and-concatenates-them-correctly.js | 257 ------- ...rojects-and-concatenates-them-correctly.js | 260 +++++++ ...s-merged-and-contains-late-bound-member.js | 86 --- ...s-merged-and-contains-late-bound-member.js | 89 +++ .../semantic-errors-with-incremental.js | 89 --- .../semantic-errors.js | 42 - .../syntax-errors-with-incremental.js | 93 --- .../syntax-errors.js | 46 -- .../semantic-errors-with-incremental.js | 135 ++++ .../initial-build/semantic-errors.js | 88 +++ .../syntax-errors-with-incremental.js | 140 ++++ .../initial-build/syntax-errors.js | 93 +++ .../semantic-errors-with-incremental.js | 29 - .../no-change-run/semantic-errors.js | 29 - .../syntax-errors-with-incremental.js | 30 - .../no-change-run/syntax-errors.js | 30 - .../outFile/initial-build/clean-projects.js | 11 + .../outFile/no-change-run/clean-projects.js | 8 - ...ting-json-module-from-project-reference.js | 20 + .../initial-build/sourcemap.js | 16 + .../initial-build/without-outDir.js | 16 + ...ting-json-module-from-project-reference.js | 17 - .../no-change-run/sourcemap.js | 13 - .../no-change-run/without-outDir.js | 13 - .../listEmittedFiles.js | 226 ------ .../listFiles.js | 228 ------ ...uilds-when-extended-config-file-changes.js | 92 --- .../incremental-declaration-changes/sample.js | 383 ---------- .../when-declaration-option-changes.js | 78 -- .../when-esModuleInterop-option-changes.js | 136 ---- ...en-logic-config-changes-declaration-dir.js | 184 ----- .../when-module-option-changes.js | 87 --- .../when-target-option-changes.js | 101 --- .../listEmittedFiles.js | 82 -- .../listFiles.js | 82 -- .../sample.js | 108 --- .../always-builds-under-with-force-option.js | 25 + .../sample1/initial-build/listEmittedFiles.js | 321 ++++++++ .../sample1/initial-build/listFiles.js | 323 ++++++++ ...uilds-when-extended-config-file-changes.js | 95 +++ .../removes-all-files-it-built.js | 11 + .../tsbuild/sample1/initial-build/sample.js | 720 ++++++++++++++++++ .../when-declaration-option-changes.js | 81 ++ .../when-esModuleInterop-option-changes.js | 139 ++++ .../when-module-option-changes.js | 90 +++ .../when-target-option-changes.js | 104 +++ .../always-builds-under-with-force-option.js | 22 - .../removes-all-files-it-built.js | 8 - .../tsbuild/sample1/no-change-run/sample.js | 26 - .../with-noEmitOnError-semantic-errors.js | 90 --- .../with-noEmitOnError-syntax-errors.js | 94 --- .../with-only-dts-files.js | 47 -- ...g-filename-for-buildinfo-on-commandline.js | 11 + .../when-passing-rootDir-from-commandline.js | 11 + ...when-passing-rootDir-is-in-the-tsconfig.js | 11 + .../with-noEmitOnError-semantic-errors.js | 145 ++++ .../with-noEmitOnError-syntax-errors.js | 154 ++++ .../initial-build/with-only-dts-files.js | 61 ++ ...g-filename-for-buildinfo-on-commandline.js | 8 - .../when-passing-rootDir-from-commandline.js | 8 - ...when-passing-rootDir-is-in-the-tsconfig.js | 8 - .../with-noEmitOnError-semantic-errors.js | 29 - .../with-noEmitOnError-syntax-errors.js | 34 - .../no-change-run/with-only-dts-files.js | 8 - 91 files changed, 4177 insertions(+), 3798 deletions(-) delete mode 100644 tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js delete mode 100644 tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js delete mode 100644 tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js delete mode 100644 tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js delete mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js delete mode 100644 tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js delete mode 100644 tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js delete mode 100644 tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js delete mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js delete mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js delete mode 100644 tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js delete mode 100644 tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js diff --git a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts index 93304fd95b6c4..8ccfbe5fe4742 100644 --- a/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts +++ b/src/testRunner/unittests/tsbuild/containerOnlyReferenced.ts @@ -1,6 +1,6 @@ namespace ts { describe("unittests:: tsbuild:: when containerOnly project is referenced", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "containerOnlyReferenced", subScenario: "verify that subsequent builds after initial build doesnt build anything", fs: () => loadProjectFromDisk("tests/projects/containerOnlyReferenced"), diff --git a/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts index e7dff56ab9fa9..c673cd11bcd6a 100644 --- a/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts +++ b/src/testRunner/unittests/tsbuild/emitDeclarationOnly.ts @@ -9,7 +9,7 @@ namespace ts { }); function verifyEmitDeclarationOnly(disableMap?: true) { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: `only dts output in circular import project with emitDeclarationOnly${disableMap ? "" : " and declarationMap"}`, fs: () => projFs, scenario: "emitDeclarationOnly", @@ -26,7 +26,7 @@ namespace ts { verifyEmitDeclarationOnly(); verifyEmitDeclarationOnly(/*disableMap*/ true); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: `only dts output in non circular imports project with emitDeclarationOnly`, fs: () => projFs, scenario: "emitDeclarationOnly", @@ -36,17 +36,17 @@ namespace ts { replaceText(fs, "/src/src/a.ts", `import { B } from "./b";`, `export class B { prop = "hello"; }`); }, incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsChange, - modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), - - }, { buildKind: BuildKind.IncrementalDtsUnchanged, modifyFs: fs => replaceText(fs, "/src/src/a.ts", "export interface A {", `class C { } export interface A {`), }, + { + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: fs => replaceText(fs, "/src/src/a.ts", "b: B;", "b: B; foo: any;"), + + }, ], }); }); diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index b887b21cbbf24..c2bd7c5aa8a6e 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -260,6 +260,42 @@ interface Symbol { sys.writeFile(`${buildInfoPath}.baseline.txt`, text); } + interface VerifyIncrementalCorrectness { + scenario: TscCompile["scenario"]; + subScenario: TscCompile["subScenario"]; + commandLineArgs: TscCompile["commandLineArgs"]; + modifyFs: TscCompile["modifyFs"]; + incrementalModifyFs: TscIncremental["modifyFs"]; + tick: () => void; + baseFs: vfs.FileSystem; + newSys: TscCompileSystem; + } + function verifyIncrementalCorrectness(input: () => VerifyIncrementalCorrectness) { + it(`Verify emit output file text is same when built clean`, () => { + const { + scenario, subScenario, commandLineArgs, + modifyFs, incrementalModifyFs, + tick, baseFs, newSys + } = input(); + const sys = tscCompile({ + scenario, + subScenario, + fs: () => baseFs.makeReadonly(), + commandLineArgs, + modifyFs: fs => { + tick(); + if (modifyFs) modifyFs(fs); + incrementalModifyFs(fs); + }, + }); + for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { + const expectedText = sys.readFile(outputFile); + const actualText = newSys.readFile(outputFile); + assert.equal(actualText, expectedText, `File: ${outputFile}`); + } + }); + } + export interface TscIncremental { buildKind: BuildKind; modifyFs: (fs: vfs.FileSystem) => void; @@ -351,30 +387,120 @@ interface Symbol { newSys = undefined!; }); verifyTscBaseline(() => newSys); - it(`Verify emit output file text is same when built clean`, () => { - const sys = tscCompile({ - scenario, - subScenario, - fs: () => baseFs.makeReadonly(), - commandLineArgs, - modifyFs: fs => { - tick(); - if (modifyFs) modifyFs(fs); - incrementalModifyFs(fs); - }, - }); - - for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { - const expectedText = sys.readFile(outputFile); - const actualText = newSys.readFile(outputFile); - assert.equal(actualText, expectedText, `File: ${outputFile}`); - } - }); + verifyIncrementalCorrectness(() => ({ + scenario, + subScenario, + baseFs, + newSys, + commandLineArgs, + incrementalModifyFs, + modifyFs, + tick + })); }); } }); } + export function verifyTscSerializedIncrementalEdits(input: VerifyTsBuildInput) { + verifyTscSerializedIncrementalEditsWorker(input); + if (input.baselineIncremental) { + verifyTscSerializedIncrementalEditsWorker({ + ...input, + subScenario: `${input.subScenario} with incremental`, + commandLineArgs: [...input.commandLineArgs, "--incremental"], + }); + } + } + function verifyTscSerializedIncrementalEditsWorker({ + subScenario, fs, scenario, commandLineArgs, + baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, + incrementalScenarios + }: VerifyTsBuildInputWorker) { + describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario} serializedEdits`, () => { + Debug.assert(!!incrementalScenarios.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); + let tick: () => void; + let sys: TscCompileSystem; + let baseFs: vfs.FileSystem; + let incrementalSys: TscCompileSystem[]; + before(() => { + ({ fs: baseFs, tick } = getFsWithTime(fs())); + sys = tscCompile({ + scenario, + subScenario, + fs: () => baseFs.makeReadonly(), + commandLineArgs, + modifyFs: fs => { + if (modifyFs) modifyFs(fs); + tick(); + }, + baselineSourceMap, + baselineReadFileCalls, + baselinePrograms + }); + incrementalScenarios.forEach(( + { buildKind, modifyFs, subScenario: incrementalSubScenario, commandLineArgs: incrementalCommandLineArgs }, + index + ) => { + Debug.assert(buildKind !== BuildKind.Initial, "Incremental edit cannot be initial compilation"); + tick(); + (incrementalSys || (incrementalSys = [])).push(tscCompile({ + scenario, + subScenario: incrementalSubScenario || subScenario, + buildKind, + fs: () => index === 0 ? sys.vfs : incrementalSys[index - 1].vfs, + commandLineArgs: incrementalCommandLineArgs || commandLineArgs, + modifyFs: fs => { + tick(); + modifyFs(fs); + tick(); + }, + baselineSourceMap, + baselineReadFileCalls, + baselinePrograms + })); + }); + }); + after(() => { + baseFs = undefined!; + sys = undefined!; + tick = undefined!; + incrementalSys = undefined!; + }); + describe("serializedBuilde", () => { + verifyTscBaseline(() => ({ + baseLine: () => { + const { file, text } = sys.baseLine(); + const texts: string[] = [text]; + incrementalSys.forEach((sys, index) => { + const incrementalScenario = incrementalScenarios[index]; + texts.push(""); + texts.push(`Change:: ${incrementalScenario.subScenario || incrementalScenario.buildKind}`); + texts.push(sys.baseLine().text); + }); + return { file, text: texts.join("\r\n") }; + } + })); + }); + describe("incremental correctness", () => { + incrementalScenarios.forEach((_, index) => verifyIncrementalCorrectness(() => ({ + scenario, + subScenario, + baseFs, + newSys: incrementalSys[index], + commandLineArgs, + incrementalModifyFs: fs => { + for (let i = 0; i <= index; i++) { + incrementalScenarios[i].modifyFs(fs); + } + }, + modifyFs, + tick + }))); + }); + }); + } + export function enableStrict(fs: vfs.FileSystem, path: string) { replaceText(fs, path, `"strict": false`, `"strict": true`); } diff --git a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts index eb3658d14ccaa..f5037f304cef0 100644 --- a/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts +++ b/src/testRunner/unittests/tsbuild/inferredTypeFromTransitiveModule.ts @@ -8,7 +8,7 @@ namespace ts { projFs = undefined!; }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "inferredTypeFromTransitiveModule", subScenario: "inferred type from transitive module", fs: () => projFs, @@ -19,7 +19,7 @@ namespace ts { }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "inferred type from transitive module with isolatedModules", fs: () => projFs, scenario: "inferredTypeFromTransitiveModule", @@ -31,7 +31,7 @@ namespace ts { }] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "inferredTypeFromTransitiveModule", subScenario: "reports errors in files affected by change in signature with isolatedModules", fs: () => projFs, diff --git a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts index 2f8284849cfae..450da2cd14f92 100644 --- a/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts +++ b/src/testRunner/unittests/tsbuild/javascriptProjectEmit.ts @@ -183,7 +183,7 @@ namespace ts { fs: () => projFs, commandLineArgs: ["-b", "/src"] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "javascriptProjectEmit", subScenario: `modifies outfile js projects and concatenates them correctly`, fs: () => projFs, diff --git a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts index 15ac34c222c0c..5ea071a0ca2bf 100644 --- a/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts +++ b/src/testRunner/unittests/tsbuild/lateBoundSymbol.ts @@ -1,6 +1,6 @@ namespace ts { describe("unittests:: tsbuild:: lateBoundSymbol:: interface is merged and contains late bound member", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "interface is merged and contains late bound member", fs: () => loadProjectFromDisk("tests/projects/lateBoundSymbol"), scenario: "lateBoundSymbol", diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index da718ec4fe600..75e17f66203e9 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -8,15 +8,20 @@ namespace ts { projFs = undefined!; }); - function verifyNoEmitOnError(subScenario: string, incrementalScenario: TscIncremental, modifyFs?: TscIncremental["modifyFs"]) { - verifyTscIncrementalEdits({ + function verifyNoEmitOnError(subScenario: string, fixModifyFs: TscIncremental["modifyFs"], modifyFs?: TscIncremental["modifyFs"]) { + verifyTscSerializedIncrementalEdits({ scenario: "noEmitOnError", subScenario, fs: () => projFs, modifyFs, commandLineArgs: ["--b", "/src/tsconfig.json"], incrementalScenarios: [ - incrementalScenario, + noChangeRun, + { + subScenario: "Fix error", + buildKind: BuildKind.IncrementalDtsChange, + modifyFs: fixModifyFs, + }, noChangeRun, ], baselinePrograms: true, @@ -24,19 +29,20 @@ namespace ts { }); } - verifyNoEmitOnError("syntax errors", { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + verifyNoEmitOnError( + "syntax errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`, "utf-8") - }); + ); - verifyNoEmitOnError("semantic errors", { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; -const a: string = "hello";`, "utf-8") - }, fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; -const a: string = 10;`, "utf-8")); + verifyNoEmitOnError( + "semantic errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8"), + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8") + ); }); } diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index a9f6621564c22..58d130d2ea973 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -169,7 +169,7 @@ namespace ts { return fs; } - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "outFile", subScenario: "clean projects", fs: getOutFileFsAfterBuild, diff --git a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts index ab13e84eefdf2..4b8c999f46cc3 100644 --- a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts +++ b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts @@ -51,7 +51,7 @@ export default hello.hello`); commandLineArgs: ["--b", "/src/tsconfig_withIncludeAndFiles.json"], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "sourcemap", fs: () => projFs, @@ -60,7 +60,7 @@ export default hello.hello`); incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "without outDir", fs: () => projFs, @@ -71,7 +71,7 @@ export default hello.hello`); }); describe("unittests:: tsbuild:: with resolveJsonModule option on project importJsonFromProjectReference", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "resolveJsonModule", subScenario: "importing json module from project reference", fs: () => loadProjectFromDisk("tests/projects/importJsonFromProjectReference"), diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index 55f629e38eb31..4550595ded23c 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -65,7 +65,7 @@ namespace ts { }); describe("clean builds", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "removes all files it built", fs: getSampleFsAfterBuild, @@ -98,7 +98,7 @@ namespace ts { }); describe("force builds", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "always builds under with force option", fs: () => projFs, @@ -201,7 +201,7 @@ namespace ts { ); }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "rebuilds when extended config file changes", fs: () => projFs, @@ -367,19 +367,19 @@ export class someClass { }`), { buildKind: BuildKind.IncrementalDtsUnchanged, modifyFs: fs => appendText(fs, "/src/core/index.ts", ` -class someClass { }`), +class someClass2 { }`), } ]; describe("lists files", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "listFiles", fs: () => projFs, commandLineArgs: ["--b", "/src/tests", "--listFiles"], incrementalScenarios: coreChanges }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "sample1", subScenario: "listEmittedFiles", fs: () => projFs, @@ -389,7 +389,7 @@ class someClass { }`), }); describe("emit output", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "sample", fs: () => projFs, scenario: "sample1", @@ -419,7 +419,7 @@ class someClass { }`), baselineReadFileCalls: true }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when declaration option changes", fs: () => projFs, scenario: "sample1", @@ -436,7 +436,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when target option changes", fs: () => projFs, scenario: "sample1", @@ -462,7 +462,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when module option changes", fs: () => projFs, scenario: "sample1", @@ -479,7 +479,7 @@ class someClass { }`), }], }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ subScenario: "when esModuleInterop option changes", fs: () => projFs, scenario: "sample1", diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index 9257578ffd7d7..d546d685571bf 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -1,7 +1,7 @@ namespace ts { export type TscCompileSystem = fakes.System & { writtenFiles: Map; - baseLine(): void; + baseLine(): { file: string; text: string; }; }; export enum BuildKind { @@ -128,20 +128,24 @@ namespace ts { inputFs.diff(/*base*/ undefined, { baseIsNotShadowRoot: true }) : inputFs.diff(initialFs, { includeChangedFileWithSameContent: true }); const patch = fs.diff(inputFs, { includeChangedFileWithSameContent: true }); - Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, `Input:: + return { + file: `${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${buildKind || BuildKind.Initial}/${subScenario.split(" ").join("-")}.js`, + text: `Input:: ${baseFsPatch ? vfs.formatPatch(baseFsPatch) : ""} Output:: ${sys.output.join("")} -${patch ? vfs.formatPatch(patch) : ""}`); +${patch ? vfs.formatPatch(patch) : ""}` + }; }; return sys; } - export function verifyTscBaseline(sys: () => TscCompileSystem) { + export function verifyTscBaseline(sys: () => { baseLine: TscCompileSystem["baseLine"]; }) { it(`Generates files matching the baseline`, () => { - sys().baseLine(); + const { file, text } = sys().baseLine(); + Harness.Baseline.runBaseline(file, text); }); } diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index 8b616194f5956..b231b439858dc 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -1,6 +1,6 @@ namespace ts { describe("unittests:: tsc:: incremental::", () => { - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing filename for buildinfo on commandline", fs: () => loadProjectFromFiles({ @@ -20,7 +20,7 @@ namespace ts { incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing rootDir from commandline", fs: () => loadProjectFromFiles({ @@ -37,7 +37,7 @@ namespace ts { incrementalScenarios: noChangeOnlyRuns }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "with only dts files", fs: () => loadProjectFromFiles({ @@ -55,7 +55,7 @@ namespace ts { ] }); - verifyTscIncrementalEdits({ + verifyTscSerializedIncrementalEdits({ scenario: "incremental", subScenario: "when passing rootDir is in the tsconfig", fs: () => loadProjectFromFiles({ @@ -81,41 +81,40 @@ namespace ts { after(() => { projFs = undefined!; }); - verifyTscIncrementalEdits({ - scenario: "incremental", - subScenario: "with noEmitOnError syntax errors", - fs: () => projFs, - commandLineArgs: ["--incremental", "-p", "src"], - incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + + function verifyNoEmitOnError(subScenario: string, fixModifyFs: TscIncremental["modifyFs"], modifyFs?: TscIncremental["modifyFs"]) { + verifyTscSerializedIncrementalEdits({ + scenario: "incremental", + subScenario, + fs: () => projFs, + commandLineArgs: ["--incremental", "-p", "src"], + modifyFs, + incrementalScenarios: [ + noChangeRun, + { + buildKind: BuildKind.IncrementalDtsUnchanged, + modifyFs: fixModifyFs + }, + noChangeRun, + ], + baselinePrograms: true + }); + } + verifyNoEmitOnError( + "with noEmitOnError syntax errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`, "utf-8") - }, - noChangeRun, - ], - baselinePrograms: true - }); + ); - verifyTscIncrementalEdits({ - scenario: "incremental", - subScenario: "with noEmitOnError semantic errors", - fs: () => projFs, - commandLineArgs: ["--incremental", "-p", "src"], - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + verifyNoEmitOnError( + "with noEmitOnError semantic errors", + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8"), + fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a: string = 10;`, "utf-8"), - incrementalScenarios: [ - { - buildKind: BuildKind.IncrementalDtsUnchanged, - modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; -const a: string = "hello";`, "utf-8") - }, - noChangeRun, - ], - baselinePrograms: true - }); + ); }); }); } diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index 664e43d863851..ec854279fbfdc 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/initial-build/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -220,3 +220,27 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/src/folder/tsconfig.json + * src/src/folder2/tsconfig.json + * src/src/tsconfig.json + * src/tests/tsconfig.json + * src/tsconfig.json + +[12:04:00 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' + +[12:04:00 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js deleted file mode 100644 index 97a1127a6149d..0000000000000 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/no-change-run/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ /dev/null @@ -1,21 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/src/folder/tsconfig.json - * src/src/folder2/tsconfig.json - * src/src/tsconfig.json - * src/tests/tsconfig.json - * src/tsconfig.json - -[12:04:00 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' - -[12:04:00 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js deleted file mode 100644 index 1cc9486f0a255..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ /dev/null @@ -1,129 +0,0 @@ -Input:: -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} -//# sourceMappingURL=a.d.ts.map - -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/b.d.ts.map] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/c.d.ts.map] file written with same contents -//// [/src/lib/index.d.ts] file written with same contents -//// [/src/lib/index.d.ts.map] file written with same contents -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - }, - "./src/a.ts": { - "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "-11119001497-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/index.ts": { - "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "14762544269-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "exportedModulesMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts", - "./src/index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js deleted file mode 100644 index 2b27b1f8c1543..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,122 +0,0 @@ -Input:: -//// [/src/src/a.ts] -import { B } from "./b"; - -export interface A { - b: B; foo: any; -} - - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/index.d.ts] file written with same contents -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/a.ts": { - "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "-7639584379-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/index.ts": { - "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "exportedModulesMap": { - "./src/a.ts": [ - "./src/b.ts" - ], - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ], - "./src/index.ts": [ - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts", - "./src/index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js deleted file mode 100644 index a7f794c0d4164..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-changes/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,107 +0,0 @@ -Input:: -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -export interface A { - b: B; foo: any; -} - - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] -export declare class B { - prop: string; -} -export interface A { - b: B; - foo: any; -} -//# sourceMappingURL=a.d.ts.map - -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAElC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} - -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/b.d.ts.map] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/c.d.ts.map] file written with same contents -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/a.ts": { - "version": "7973388544-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B; foo: any;\n}\n", - "signature": "3224647069-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "exportedModulesMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js deleted file mode 100644 index 01b72909bac58..0000000000000 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/incremental-declaration-doesnt-change/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ /dev/null @@ -1,97 +0,0 @@ -Input:: -//// [/src/src/a.ts] -export class B { prop = "hello"; } - -class C { } -export interface A { - b: B; -} - - - - -Output:: -/lib/tsc --b /src --verbose -[12:08:00 AM] Projects in this build: - * src/tsconfig.json - -[12:08:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' - -[12:08:00 AM] Building project '/src/tsconfig.json'... - -[12:08:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/lib/a.d.ts] file written with same contents -//// [/src/lib/a.d.ts.map] -{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/a.ts": { - "version": "6651905050-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}\n", - "signature": "-14608980923-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", - "affectsGlobalScope": false - }, - "./src/c.ts": { - "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", - "affectsGlobalScope": false - }, - "./src/b.ts": { - "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "target": 1, - "module": 1, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./lib", - "composite": true, - "strict": true, - "esModuleInterop": true, - "alwaysStrict": true, - "rootDir": "./src", - "emitDeclarationOnly": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "exportedModulesMap": { - "./src/b.ts": [ - "./src/c.ts" - ], - "./src/c.ts": [ - "./src/a.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/a.ts", - "./src/b.ts", - "./src/c.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 99dbafc18ed99..bdd01d10a9ac4 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -208,3 +208,135 @@ export { C } from "./c"; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map + +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/b.d.ts.map] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/c.d.ts.map] file written with same contents +//// [/src/lib/index.d.ts] file written with same contents +//// [/src/lib/index.d.ts.map] file written with same contents +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + }, + "./src/a.ts": { + "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "-11119001497-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/index.ts": { + "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "signature": "14762544269-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "exportedModulesMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index f88d72cce381c..e9f89ff381603 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -195,3 +195,128 @@ export { C } from "./c"; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +import { B } from "./b"; + +export interface A { + b: B; foo: any; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/index.d.ts] file written with same contents +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/a.ts": { + "version": "-14761736732-import { B } from \"./b\";\n\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "-7639584379-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/index.ts": { + "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", + "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "exportedModulesMap": { + "./src/a.ts": [ + "./src/b.ts" + ], + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ], + "./src/index.ts": [ + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index 9264f15be5c08..e779646d81116 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/initial-build/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -173,3 +173,214 @@ export interface C { "version": "FakeTSVersion" } + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] file written with same contents +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} + +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/a.ts": { + "version": "6651905050-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}\n", + "signature": "-14608980923-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "exportedModulesMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-changes +Input:: +//// [/src/src/a.ts] +export class B { prop = "hello"; } + +class C { } +export interface A { + b: B; foo: any; +} + + + + +Output:: +/lib/tsc --b /src --verbose +[12:07:00 AM] Projects in this build: + * src/tsconfig.json + +[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' + +[12:07:00 AM] Building project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/lib/a.d.ts] +export declare class B { + prop: string; +} +export interface A { + b: B; + foo: any; +} +//# sourceMappingURL=a.d.ts.map + +//// [/src/lib/a.d.ts.map] +{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;CAChB"} + +//// [/src/lib/b.d.ts] file written with same contents +//// [/src/lib/b.d.ts.map] file written with same contents +//// [/src/lib/c.d.ts] file written with same contents +//// [/src/lib/c.d.ts.map] file written with same contents +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/a.ts": { + "version": "5380514971-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}\n", + "signature": "3224647069-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n//# sourceMappingURL=a.d.ts.map", + "affectsGlobalScope": false + }, + "./src/c.ts": { + "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", + "signature": "-21569163793-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n//# sourceMappingURL=c.d.ts.map", + "affectsGlobalScope": false + }, + "./src/b.ts": { + "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", + "signature": "25318058868-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n//# sourceMappingURL=b.d.ts.map", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "target": 1, + "module": 1, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./lib", + "composite": true, + "strict": true, + "esModuleInterop": true, + "alwaysStrict": true, + "rootDir": "./src", + "emitDeclarationOnly": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "exportedModulesMap": { + "./src/b.ts": [ + "./src/c.ts" + ], + "./src/c.ts": [ + "./src/a.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/a.ts", + "./src/b.ts", + "./src/c.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js deleted file mode 100644 index 1afafe2064ea1..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module-with-isolatedModules.js +++ /dev/null @@ -1,119 +0,0 @@ -Input:: -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/obj/bar.d.ts] -declare const _default: () => void; -export default _default; - - -//// [/src/obj/bar.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = foo()(function foobar() { -}); - - -//// [/src/obj/index.d.ts] -import { LazyAction } from './bundling'; -export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; - - -//// [/src/obj/lazyIndex.d.ts] file written with same contents -//// [/src/obj/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../bar.ts": { - "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", - "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", - "affectsGlobalScope": false - }, - "../bundling.ts": { - "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", - "affectsGlobalScope": false - }, - "../global.d.ts": { - "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "affectsGlobalScope": true - }, - "../lazyindex.ts": { - "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6224542381-export { default as bar } from './bar';\r\n", - "affectsGlobalScope": false - }, - "../index.ts": { - "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "target": 1, - "declaration": true, - "outDir": "./", - "incremental": true, - "isolatedModules": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../bar.ts", - "../bundling.ts", - "../global.d.ts", - "../index.ts", - "../lazyindex.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js deleted file mode 100644 index 3c3d4a97ac77d..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/inferred-type-from-transitive-module.js +++ /dev/null @@ -1,119 +0,0 @@ -Input:: -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/obj/bar.d.ts] -declare const _default: () => void; -export default _default; - - -//// [/src/obj/bar.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = foo()(function foobar() { -}); - - -//// [/src/obj/index.d.ts] -import { LazyAction } from './bundling'; -export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; - - -//// [/src/obj/lazyIndex.d.ts] file written with same contents -//// [/src/obj/lazyIndex.js] file written with same contents -//// [/src/obj/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../bar.ts": { - "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", - "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", - "affectsGlobalScope": false - }, - "../bundling.ts": { - "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", - "affectsGlobalScope": false - }, - "../global.d.ts": { - "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", - "affectsGlobalScope": true - }, - "../lazyindex.ts": { - "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6224542381-export { default as bar } from './bar';\r\n", - "affectsGlobalScope": false - }, - "../index.ts": { - "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "target": 1, - "declaration": true, - "outDir": "./", - "incremental": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../bundling.ts", - "../lazyindex.ts" - ], - "../lazyindex.ts": [ - "../bar.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../bar.ts", - "../bundling.ts", - "../global.d.ts", - "../index.ts", - "../lazyindex.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js deleted file mode 100644 index effff0c513e90..0000000000000 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/incremental-declaration-changes/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ /dev/null @@ -1,34 +0,0 @@ -Input:: -//// [/src/bar.ts] -interface RawAction { - (...args: any[]): Promise | void; -} -interface ActionFactory { - (target: T): T; -} -declare function foo(): ActionFactory; -export default foo()(function foobar(): void { -}); - - - -Output:: -/lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. - -4 bar("hello"); -   ~~~~~~~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped - - diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js index 5a2aad4b9172e..2dba5700c2f17 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module-with-isolatedModules.js @@ -223,3 +223,125 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/obj/bar.d.ts] +declare const _default: () => void; +export default _default; + + +//// [/src/obj/bar.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + + +//// [/src/obj/index.d.ts] +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + + +//// [/src/obj/lazyIndex.d.ts] file written with same contents +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "isolatedModules": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + "../lazyindex.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js index 1e2b45bc6f7d4..e2dfbce4ab8d2 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/inferred-type-from-transitive-module.js @@ -222,3 +222,125 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/obj/bar.d.ts] +declare const _default: () => void; +export default _default; + + +//// [/src/obj/bar.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = foo()(function foobar() { +}); + + +//// [/src/obj/index.d.ts] +import { LazyAction } from './bundling'; +export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; + + +//// [/src/obj/lazyIndex.d.ts] file written with same contents +//// [/src/obj/lazyIndex.js] file written with same contents +//// [/src/obj/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../bar.ts": { + "version": "747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});", + "signature": "-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n", + "affectsGlobalScope": false + }, + "../bundling.ts": { + "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n", + "affectsGlobalScope": false + }, + "../global.d.ts": { + "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "signature": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", + "affectsGlobalScope": true + }, + "../lazyindex.ts": { + "version": "-6956449754-export { default as bar } from './bar';\n", + "signature": "-6224542381-export { default as bar } from './bar';\r\n", + "affectsGlobalScope": false + }, + "../index.ts": { + "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "target": 1, + "declaration": true, + "outDir": "./", + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../bundling.ts", + "../lazyindex.ts" + ], + "../lazyindex.ts": [ + "../bar.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../bar.ts", + "../bundling.ts", + "../global.d.ts", + "../index.ts", + "../lazyindex.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index d513f6fefbf46..abc2adbd836a1 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/initial-build/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -227,3 +227,40 @@ bar_2.default("hello"); "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/bar.ts] +interface RawAction { + (...args: any[]): Promise | void; +} +interface ActionFactory { + (target: T): T; +} +declare function foo(): ActionFactory; +export default foo()(function foobar(): void { +}); + + + +Output:: +/lib/tsc --b /src --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. + +4 bar("hello"); +   ~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js deleted file mode 100644 index 93e5af380e7b8..0000000000000 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/incremental-declaration-doesnt-change/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ /dev/null @@ -1,257 +0,0 @@ -Input:: -//// [/src/sub-project/index.js] -/** - * @typedef {Nominal} MyNominal - */ -const c = /** @type {*} */(undefined); - - - - -Output:: -/lib/tsc -b /src -exitCode:: ExitStatus.Success - - -//// [/src/sub-project/sub-project.d.ts] file written with same contents -//// [/src/sub-project/sub-project.js] -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - - -//// [/src/sub-project/sub-project.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "./index.js" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 84, - "kind": "prepend", - "data": "../common/common.js", - "texts": [ - { - "pos": 0, - "end": 84, - "kind": "text" - } - ] - }, - { - "pos": 84, - "end": 187, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 64, - "kind": "prepend", - "data": "../common/common.d.ts", - "texts": [ - { - "pos": 0, - "end": 64, - "kind": "text" - } - ] - }, - { - "pos": 64, - "end": 220, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/src/sub-project/sub-project.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/sub-project/sub-project.js ----------------------------------------------------------------------- -prepend: (0-84):: ../common/common.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-84) -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ - ----------------------------------------------------------------------- -text: (84-187) -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - -====================================================================== -====================================================================== -File:: /src/sub-project/sub-project.d.ts ----------------------------------------------------------------------- -prepend: (0-64):: ../common/common.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-64) -type Nominal = T & { - [Symbol.species]: Name; -}; - ----------------------------------------------------------------------- -text: (64-220) -/** - * @typedef {Nominal} MyNominal - */ -declare const c: any; -type MyNominal = string & { - [Symbol.species]: "MyNominal"; -}; - -====================================================================== - -//// [/src/sub-project-2/sub-project-2.js] -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); -var variable = { - key: /** @type {MyNominal} */ ('value') -}; -/** - * @return {keyof typeof variable} - */ -function getVar() { - return 'key'; -} - - -//// [/src/sub-project-2/sub-project-2.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "./index.js" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 187, - "kind": "prepend", - "data": "../sub-project/sub-project.js", - "texts": [ - { - "pos": 0, - "end": 187, - "kind": "text" - } - ] - }, - { - "pos": 187, - "end": 343, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 220, - "kind": "prepend", - "data": "../sub-project/sub-project.d.ts", - "texts": [ - { - "pos": 0, - "end": 220, - "kind": "text" - } - ] - }, - { - "pos": 220, - "end": 377, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/src/sub-project-2/sub-project-2.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/sub-project-2/sub-project-2.js ----------------------------------------------------------------------- -prepend: (0-187):: ../sub-project/sub-project.js texts:: 1 ->>-------------------------------------------------------------------- -text: (0-187) -/** - * @template T, Name - * @typedef {T & {[Symbol.species]: Name}} Nominal - */ -/** - * @typedef {Nominal} MyNominal - */ -var c = /** @type {*} */ (undefined); - ----------------------------------------------------------------------- -text: (187-343) -var variable = { - key: /** @type {MyNominal} */ ('value') -}; -/** - * @return {keyof typeof variable} - */ -function getVar() { - return 'key'; -} - -====================================================================== -====================================================================== -File:: /src/sub-project-2/sub-project-2.d.ts ----------------------------------------------------------------------- -prepend: (0-220):: ../sub-project/sub-project.d.ts texts:: 1 ->>-------------------------------------------------------------------- -text: (0-220) -type Nominal = T & { - [Symbol.species]: Name; -}; -/** - * @typedef {Nominal} MyNominal - */ -declare const c: any; -type MyNominal = string & { - [Symbol.species]: "MyNominal"; -}; - ----------------------------------------------------------------------- -text: (220-377) -/** - * @return {keyof typeof variable} - */ -declare function getVar(): keyof typeof variable; -declare namespace variable { - const key: MyNominal; -} - -====================================================================== - diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js index 6960991ab6a91..83bfb329b9aa9 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/initial-build/modifies-outfile-js-projects-and-concatenates-them-correctly.js @@ -454,3 +454,263 @@ declare namespace variable { ====================================================================== + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/sub-project/index.js] +/** + * @typedef {Nominal} MyNominal + */ +const c = /** @type {*} */(undefined); + + + + +Output:: +/lib/tsc -b /src +exitCode:: ExitStatus.Success + + +//// [/src/sub-project/sub-project.d.ts] file written with same contents +//// [/src/sub-project/sub-project.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + + +//// [/src/sub-project/sub-project.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "./index.js" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 84, + "kind": "prepend", + "data": "../common/common.js", + "texts": [ + { + "pos": 0, + "end": 84, + "kind": "text" + } + ] + }, + { + "pos": 84, + "end": 187, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 64, + "kind": "prepend", + "data": "../common/common.d.ts", + "texts": [ + { + "pos": 0, + "end": 64, + "kind": "text" + } + ] + }, + { + "pos": 64, + "end": 220, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/sub-project/sub-project.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/sub-project/sub-project.js +---------------------------------------------------------------------- +prepend: (0-84):: ../common/common.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-84) +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ + +---------------------------------------------------------------------- +text: (84-187) +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + +====================================================================== +====================================================================== +File:: /src/sub-project/sub-project.d.ts +---------------------------------------------------------------------- +prepend: (0-64):: ../common/common.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-64) +type Nominal = T & { + [Symbol.species]: Name; +}; + +---------------------------------------------------------------------- +text: (64-220) +/** + * @typedef {Nominal} MyNominal + */ +declare const c: any; +type MyNominal = string & { + [Symbol.species]: "MyNominal"; +}; + +====================================================================== + +//// [/src/sub-project-2/sub-project-2.js] +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); +var variable = { + key: /** @type {MyNominal} */ ('value') +}; +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} + + +//// [/src/sub-project-2/sub-project-2.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "./index.js" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 187, + "kind": "prepend", + "data": "../sub-project/sub-project.js", + "texts": [ + { + "pos": 0, + "end": 187, + "kind": "text" + } + ] + }, + { + "pos": 187, + "end": 343, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 220, + "kind": "prepend", + "data": "../sub-project/sub-project.d.ts", + "texts": [ + { + "pos": 0, + "end": 220, + "kind": "text" + } + ] + }, + { + "pos": 220, + "end": 377, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/src/sub-project-2/sub-project-2.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/sub-project-2/sub-project-2.js +---------------------------------------------------------------------- +prepend: (0-187):: ../sub-project/sub-project.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-187) +/** + * @template T, Name + * @typedef {T & {[Symbol.species]: Name}} Nominal + */ +/** + * @typedef {Nominal} MyNominal + */ +var c = /** @type {*} */ (undefined); + +---------------------------------------------------------------------- +text: (187-343) +var variable = { + key: /** @type {MyNominal} */ ('value') +}; +/** + * @return {keyof typeof variable} + */ +function getVar() { + return 'key'; +} + +====================================================================== +====================================================================== +File:: /src/sub-project-2/sub-project-2.d.ts +---------------------------------------------------------------------- +prepend: (0-220):: ../sub-project/sub-project.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-220) +type Nominal = T & { + [Symbol.species]: Name; +}; +/** + * @typedef {Nominal} MyNominal + */ +declare const c: any; +type MyNominal = string & { + [Symbol.species]: "MyNominal"; +}; + +---------------------------------------------------------------------- +text: (220-377) +/** + * @return {keyof typeof variable} + */ +declare function getVar(): keyof typeof variable; +declare namespace variable { + const key: MyNominal; +} + +====================================================================== + diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js deleted file mode 100644 index 156b519da628b..0000000000000 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/incremental-declaration-doesnt-change/interface-is-merged-and-contains-late-bound-member.js +++ /dev/null @@ -1,86 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { HKT } from "./hkt"; - -const sym = Symbol(); - -declare module "./hkt" { - interface HKT { - [sym]: { a: T } - } -} - -type A = HKT[typeof sym]; - - - -Output:: -/lib/tsc --b /src/tsconfig.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig.json - -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' - -[12:04:00 AM] Building project '/src/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/src/main.js] -"use strict"; -exports.__esModule = true; -var sym = Symbol(); - - -//// [/src/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/globals.d.ts": { - "version": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", - "signature": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", - "affectsGlobalScope": true - }, - "./src/hkt.ts": { - "version": "675797797-export interface HKT { }", - "signature": "2373810515-export interface HKT {\r\n}\r\n", - "affectsGlobalScope": false - }, - "./src/main.ts": { - "version": "-27494779858-import { HKT } from \"./hkt\";\r\n\r\nconst sym = Symbol();\r\n\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: { a: T }\r\n }\r\n}\r\n\r\ntype A = HKT[typeof sym];", - "signature": "-7779857705-declare const sym: unique symbol;\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: {\r\n a: T;\r\n };\r\n }\r\n}\r\nexport {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "rootDir": "./src", - "incremental": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./src/main.ts": [ - "./src/hkt.ts" - ] - }, - "exportedModulesMap": { - "./src/main.ts": [ - "./src/hkt.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../lib/lib.d.ts", - "./src/globals.d.ts", - "./src/hkt.ts", - "./src/main.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js index eb6fb704a1870..d5bd2b0c8d7c3 100644 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js +++ b/tests/baselines/reference/tsbuild/lateBoundSymbol/initial-build/interface-is-merged-and-contains-late-bound-member.js @@ -120,3 +120,92 @@ var x = 10; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { HKT } from "./hkt"; + +const sym = Symbol(); + +declare module "./hkt" { + interface HKT { + [sym]: { a: T } + } +} + +type A = HKT[typeof sym]; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig.json + +[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' + +[12:04:00 AM] Building project '/src/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/src/main.js] +"use strict"; +exports.__esModule = true; +var sym = Symbol(); + + +//// [/src/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/globals.d.ts": { + "version": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "signature": "-1994196675-interface SymbolConstructor {\n (description?: string | number): symbol;\n}\ndeclare var Symbol: SymbolConstructor;", + "affectsGlobalScope": true + }, + "./src/hkt.ts": { + "version": "675797797-export interface HKT { }", + "signature": "2373810515-export interface HKT {\r\n}\r\n", + "affectsGlobalScope": false + }, + "./src/main.ts": { + "version": "-27494779858-import { HKT } from \"./hkt\";\r\n\r\nconst sym = Symbol();\r\n\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: { a: T }\r\n }\r\n}\r\n\r\ntype A = HKT[typeof sym];", + "signature": "-7779857705-declare const sym: unique symbol;\r\ndeclare module \"./hkt\" {\r\n interface HKT {\r\n [sym]: {\r\n a: T;\r\n };\r\n }\r\n}\r\nexport {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "rootDir": "./src", + "incremental": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "exportedModulesMap": { + "./src/main.ts": [ + "./src/hkt.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../lib/lib.d.ts", + "./src/globals.d.ts", + "./src/hkt.ts", + "./src/main.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js deleted file mode 100644 index 2751ddcc4bc6c..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors-with-incremental.js +++ /dev/null @@ -1,89 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - - - -Output:: -/lib/tsc --b /src/tsconfig.json --incremental -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/src/dev-build/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../shared/types/db.ts": { - "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", - "affectsGlobalScope": false - }, - "../src/main.ts": { - "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - }, - "../src/other.ts": { - "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "outDir": "./", - "noEmitOnError": true, - "incremental": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../src/main.ts": [ - "../shared/types/db.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../shared/types/db.ts", - "../src/main.ts", - "../src/other.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js deleted file mode 100644 index efc202b1259ce..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/semantic-errors.js +++ /dev/null @@ -1,42 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - - - -Output:: -/lib/tsc --b /src/tsconfig.json -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js deleted file mode 100644 index 4c1695671faa6..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors-with-incremental.js +++ /dev/null @@ -1,93 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - - - -Output:: -/lib/tsc --b /src/tsconfig.json --incremental -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/src/dev-build/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../shared/types/db.ts": { - "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", - "affectsGlobalScope": false - }, - "../src/main.ts": { - "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - }, - "../src/other.ts": { - "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "outDir": "./", - "noEmitOnError": true, - "incremental": true, - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../src/main.ts": [ - "../shared/types/db.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../shared/types/db.ts", - "../src/main.ts", - "../src/other.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js deleted file mode 100644 index 71c86e5347232..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/incremental-declaration-doesnt-change/syntax-errors.js +++ /dev/null @@ -1,46 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - - - -Output:: -/lib/tsc --b /src/tsconfig.json -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js index d3cb5a3c1eac4..091e9d94ba8bb 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors-with-incremental.js @@ -64,3 +64,138 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js index e1faa9bb5fa9f..28638f81468e1 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/semantic-errors.js @@ -64,3 +64,91 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js index 65f93aa39c7fe..0999c10855235 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors-with-incremental.js @@ -67,3 +67,143 @@ Program files:: No cached semantic diagnostics in the builder:: + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json --incremental +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js index 44a28736d1798..0bac27e919f51 100644 --- a/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmitOnError/initial-build/syntax-errors.js @@ -67,3 +67,96 @@ Program files:: No cached semantic diagnostics in the builder:: + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +No cached semantic diagnostics in the builder:: + + + + +Change:: Fix error +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tsconfig.json +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js deleted file mode 100644 index a289053008946..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors-with-incremental.js +++ /dev/null @@ -1,29 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tsconfig.json --incremental -src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js deleted file mode 100644 index 2545c2f0db6d9..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/semantic-errors.js +++ /dev/null @@ -1,29 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tsconfig.json -src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js deleted file mode 100644 index 72c5a8f5fcb3d..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors-with-incremental.js +++ /dev/null @@ -1,30 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tsconfig.json --incremental -src/src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - - src/src/main.ts:2:11 - 2 const a = { -    ~ - The parser expected to find a '}' to match the '{' token here. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -No cached semantic diagnostics in the builder:: - - diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js deleted file mode 100644 index 35191fdd7c8fa..0000000000000 --- a/tests/baselines/reference/tsbuild/noEmitOnError/no-change-run/syntax-errors.js +++ /dev/null @@ -1,30 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tsconfig.json -src/src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - - src/src/main.ts:2:11 - 2 const a = { -    ~ - The parser expected to find a '}' to match the '{' token here. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -No cached semantic diagnostics in the builder:: - - diff --git a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js index f1187c0e9156b..0c604bb21b384 100644 --- a/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/initial-build/clean-projects.js @@ -150,3 +150,14 @@ exitCode:: ExitStatus.Success //// [/src/third/thirdjs/output/third-output.js] unlink //// [/src/third/thirdjs/output/third-output.js.map] unlink //// [/src/third/thirdjs/output/third-output.tsbuildinfo] unlink + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/third --clean +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js deleted file mode 100644 index 798bda4b7bc0b..0000000000000 --- a/tests/baselines/reference/tsbuild/outFile/no-change-run/clean-projects.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/third --clean -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js index 99547b7cab508..6efbfbbf25467 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/importing-json-module-from-project-reference.js @@ -177,3 +177,23 @@ console.log(foo_json_1.foo); "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig.json --verbose +[12:04:00 AM] Projects in this build: + * src/strings/tsconfig.json + * src/main/tsconfig.json + * src/tsconfig.json + +[12:04:00 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' + +[12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js index 7b35e358f8031..0d39b0a6f2901 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/sourcemap.js @@ -135,3 +135,19 @@ exports["default"] = hello_json_1["default"].hello; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig_withFiles.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig_withFiles.json + +[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js index 2c70739288407..6c0344367f713 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/initial-build/without-outDir.js @@ -124,3 +124,19 @@ exports["default"] = hello_json_1["default"].hello; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/tsconfig_withFiles.json --verbose +[12:04:00 AM] Projects in this build: + * src/tsconfig_withFiles.json + +[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js deleted file mode 100644 index d6bfcf431e0b1..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/importing-json-module-from-project-reference.js +++ /dev/null @@ -1,17 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b src/tsconfig.json --verbose -[12:04:00 AM] Projects in this build: - * src/strings/tsconfig.json - * src/main/tsconfig.json - * src/tsconfig.json - -[12:04:00 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' - -[12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js deleted file mode 100644 index 193cfa9caec2e..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/sourcemap.js +++ /dev/null @@ -1,13 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig_withFiles.json - -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js deleted file mode 100644 index e60bde489d03e..0000000000000 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/no-change-run/without-outDir.js +++ /dev/null @@ -1,13 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:04:00 AM] Projects in this build: - * src/tsconfig_withFiles.json - -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' - -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js deleted file mode 100644 index 43a0e676cf006..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listEmittedFiles.js +++ /dev/null @@ -1,226 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --listEmittedFiles -TSFILE: /src/core/index.js -TSFILE: /src/core/index.d.ts.map -TSFILE: /src/core/index.d.ts -TSFILE: /src/core/tsconfig.tsbuildinfo -TSFILE: /src/logic/index.js.map -TSFILE: /src/logic/index.js -TSFILE: /src/logic/index.d.ts -TSFILE: /src/logic/tsconfig.tsbuildinfo -TSFILE: /src/tests/index.js -TSFILE: /src/tests/index.d.ts -TSFILE: /src/tests/tsconfig.tsbuildinfo -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js deleted file mode 100644 index 84343bc826207..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/listFiles.js +++ /dev/null @@ -1,228 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --listFiles -/lib/lib.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -/lib/lib.d.ts -/src/core/index.d.ts -/src/core/anotherModule.d.ts -/src/logic/index.ts -/lib/lib.d.ts -/src/core/index.d.ts -/src/core/anotherModule.d.ts -/src/logic/index.d.ts -/src/tests/index.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js deleted file mode 100644 index 0b48c31bc5009..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/rebuilds-when-extended-config-file-changes.js +++ /dev/null @@ -1,92 +0,0 @@ -Input:: -//// [/src/tests/tsconfig.base.json] -{"compilerOptions":{}} - - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js deleted file mode 100644 index 27da1c1711d89..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/sample.js +++ /dev/null @@ -1,383 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' - -[12:04:00 AM] Building project '/src/logic/tsconfig.json'... - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/core/anotherModule.ts": 1, - "/src/core/index.ts": 1, - "/src/core/some_decl.d.ts": 1, - "/src/core/index.d.ts": 2, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/logic/index.ts": 1, - "/src/core/anotherModule.d.ts": 1, - "/src/logic/index.d.ts": 1, - "/src/tests/tsconfig.tsbuildinfo": 1, - "/src/tests/index.ts": 1, - "/src/tests/index.d.ts": 1 -} - -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; -export declare class someClass { -} -//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.d.ts.map] -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} - -//// [/src/core/index.d.ts.map.baseline.txt] -=================================================================== -JsFile: index.d.ts -mapUrl: index.d.ts.map -sourceRoot: -sources: index.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:/src/core/index.d.ts -sourceFile:index.ts -------------------------------------------------------------------- ->>>export declare const someString: string; -1 > -2 >^^^^^^^^^^^^^^^ -3 > ^^^^^^ -4 > ^^^^^^^^^^ -5 > ^^ -6 > ^^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >export -3 > const -4 > someString -5 > : -6 > string = "HELLO WORLD" -7 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 16) Source(1, 8) + SourceIndex(0) -3 >Emitted(1, 22) Source(1, 14) + SourceIndex(0) -4 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) -5 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) -6 >Emitted(1, 40) Source(1, 48) + SourceIndex(0) -7 >Emitted(1, 41) Source(1, 49) + SourceIndex(0) ---- ->>>export declare function leftPad(s: string, n: number): string; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^ -4 > ^ -5 > ^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^ -11> ^^^^^^ -12> ^^^^^^^^^^ -13> ^^-> -1-> - > -2 >export function -3 > leftPad -4 > ( -5 > s -6 > : -7 > string -8 > , -9 > n -10> : -11> number -12> ) { return s + n; } -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 25) Source(2, 17) + SourceIndex(0) -3 >Emitted(2, 32) Source(2, 24) + SourceIndex(0) -4 >Emitted(2, 33) Source(2, 25) + SourceIndex(0) -5 >Emitted(2, 34) Source(2, 26) + SourceIndex(0) -6 >Emitted(2, 36) Source(2, 28) + SourceIndex(0) -7 >Emitted(2, 42) Source(2, 34) + SourceIndex(0) -8 >Emitted(2, 44) Source(2, 36) + SourceIndex(0) -9 >Emitted(2, 45) Source(2, 37) + SourceIndex(0) -10>Emitted(2, 47) Source(2, 39) + SourceIndex(0) -11>Emitted(2, 53) Source(2, 45) + SourceIndex(0) -12>Emitted(2, 63) Source(2, 64) + SourceIndex(0) ---- ->>>export declare function multiply(a: number, b: number): number; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^ -11> ^^^^^^ -12> ^^^^^^^^^^ -1-> - > -2 >export function -3 > multiply -4 > ( -5 > a -6 > : -7 > number -8 > , -9 > b -10> : -11> number -12> ) { return a * b; } -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 25) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 33) Source(3, 25) + SourceIndex(0) -4 >Emitted(3, 34) Source(3, 26) + SourceIndex(0) -5 >Emitted(3, 35) Source(3, 27) + SourceIndex(0) -6 >Emitted(3, 37) Source(3, 29) + SourceIndex(0) -7 >Emitted(3, 43) Source(3, 35) + SourceIndex(0) -8 >Emitted(3, 45) Source(3, 37) + SourceIndex(0) -9 >Emitted(3, 46) Source(3, 38) + SourceIndex(0) -10>Emitted(3, 48) Source(3, 40) + SourceIndex(0) -11>Emitted(3, 54) Source(3, 46) + SourceIndex(0) -12>Emitted(3, 64) Source(3, 65) + SourceIndex(0) ---- ->>>export declare class someClass { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^ -1 > - > - > -2 >export class -3 > someClass -1 >Emitted(4, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(4, 22) Source(5, 14) + SourceIndex(0) -3 >Emitted(4, 31) Source(5, 23) + SourceIndex(0) ---- ->>>} -1 >^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > { } -1 >Emitted(5, 2) Source(5, 27) + SourceIndex(0) ---- ->>>//# sourceMappingURL=index.d.ts.map - -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); -exports.someClass = someClass; - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/index.js.map.baseline.txt] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js deleted file mode 100644 index ce3b289a39020..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-declaration-option-changes.js +++ /dev/null @@ -1,78 +0,0 @@ -Input:: -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, "declaration": true, - "skipDefaultLibCheck": true - } -} - - - -Output:: -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.d.ts] -export declare const World = "hello"; - - -//// [/src/core/anotherModule.js] file written with same contents -//// [/src/core/index.d.ts] -export declare const someString: string; -export declare function leftPad(s: string, n: number): string; -export declare function multiply(a: number, b: number): number; - - -//// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "declaration": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js deleted file mode 100644 index 60a833c3ff71a..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-esModuleInterop-option-changes.js +++ /dev/null @@ -1,136 +0,0 @@ -Input:: -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": true - } -} - - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' - -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -exports.__esModule = true; -exports.m = void 0; -var c = __importStar(require("../core/index")); -var logic = __importStar(require("../logic/index")); -c.leftPad("", 10); -logic.getSecondsInDay(); -var mod = __importStar(require("../core/anotherModule")); -exports.m = mod; - - -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "esModuleInterop": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js deleted file mode 100644 index 5b8479da87374..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-logic-config-changes-declaration-dir.js +++ /dev/null @@ -1,184 +0,0 @@ -Input:: -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "declarationDir": "decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:12:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:12:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:12:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist - -[12:12:00 AM] Building project '/src/logic/tsconfig.json'... - -[12:12:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' - -[12:12:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/logic/index.ts": 1, - "/src/core/index.d.ts": 1, - "/src/core/anotherModule.d.ts": 1, - "/src/tests/tsconfig.tsbuildinfo": 1, - "/src/tests/index.ts": 1, - "/src/logic/decls/index.d.ts": 1, - "/src/tests/index.d.ts": 1 -} - -//// [/src/logic/decls/index.d.ts] -export declare function getSecondsInDay(): number; -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/index.js.map.baseline.txt] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationDir": "./decls", - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../core/index.d.ts": { - "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "../core/anothermodule.d.ts": { - "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "../logic/decls/index.d.ts": { - "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": { - "../logic/decls/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/decls/index.d.ts" - ] - }, - "exportedModulesMap": { - "../logic/decls/index.d.ts": [ - "../core/anothermodule.d.ts" - ], - "./index.ts": [ - "../core/anothermodule.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../core/anothermodule.d.ts", - "../core/index.d.ts", - "../logic/decls/index.d.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js deleted file mode 100644 index 36a0c3297386c..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-module-option-changes.js +++ /dev/null @@ -1,87 +0,0 @@ -Input:: -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, - "module": "amd" - } -} - - - -Output:: -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - exports.__esModule = true; - exports.World = void 0; - exports.World = "hello"; -}); - - -//// [/src/core/index.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - exports.__esModule = true; - exports.multiply = exports.leftPad = exports.someString = void 0; - exports.someString = "HELLO WORLD"; - function leftPad(s, n) { return s + n; } - exports.leftPad = leftPad; - function multiply(a, b) { return a * b; } - exports.multiply = multiply; -}); - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "module": 2, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js deleted file mode 100644 index 45558c7e97038..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-changes/when-target-option-changes.js +++ /dev/null @@ -1,101 +0,0 @@ -Input:: -//// [/src/core/tsconfig.json] -{ - "compilerOptions": { - "incremental": true, -"listFiles": true, -"listEmittedFiles": true, - "target": "es5", - } -} - - - -Output:: -/lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: - * src/core/tsconfig.json - -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' - -[12:04:00 AM] Building project '/src/core/tsconfig.json'... - -TSFILE: /src/core/anotherModule.js -TSFILE: /src/core/index.js -TSFILE: /src/core/tsconfig.tsbuildinfo -/lib/lib.d.ts -/lib/lib.esnext.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.World = void 0; -exports.World = "hello"; - - -//// [/src/core/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "8926001564-/// \n/// ", - "signature": "8926001564-/// \n/// ", - "affectsGlobalScope": false - }, - "../../lib/lib.esnext.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-8396256275-export declare const World = \"hello\";\r\n", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "incremental": true, - "listFiles": true, - "listEmittedFiles": true, - "target": 1, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../../lib/lib.esnext.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js deleted file mode 100644 index 7c8b7a03dc36c..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listEmittedFiles.js +++ /dev/null @@ -1,82 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --listEmittedFiles -TSFILE: /src/core/index.js -TSFILE: /src/core/index.d.ts.map -TSFILE: /src/core/index.d.ts -TSFILE: /src/core/tsconfig.tsbuildinfo -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listEmittedFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js deleted file mode 100644 index a7574676d9d19..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/listFiles.js +++ /dev/null @@ -1,82 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --listFiles -/lib/lib.d.ts -/src/core/anotherModule.ts -/src/core/index.ts -/src/core/some_decl.d.ts -exitCode:: ExitStatus.Success - - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "listFiles": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js b/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js deleted file mode 100644 index 62fc8327d6ea0..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/incremental-declaration-doesnt-change/sample.js +++ /dev/null @@ -1,108 +0,0 @@ -Input:: -//// [/src/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -class someClass { } - - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:08:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:08:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' - -[12:08:00 AM] Building project '/src/core/tsconfig.json'... - -[12:08:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... - -[12:08:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies - -[12:08:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... - -[12:08:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies - -[12:08:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/core/anotherModule.ts": 1, - "/src/core/index.ts": 1, - "/src/core/some_decl.d.ts": 1, - "/src/core/index.d.ts": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/tests/tsconfig.tsbuildinfo": 1 -} - -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.d.ts.map.baseline.txt] file written with same contents -//// [/src/core/index.js] -"use strict"; -exports.__esModule = true; -exports.multiply = exports.leftPad = exports.someString = void 0; -exports.someString = "HELLO WORLD"; -function leftPad(s, n) { return s + n; } -exports.leftPad = leftPad; -function multiply(a, b) { return a * b; } -exports.multiply = multiply; -var someClass = /** @class */ (function () { - function someClass() { - } - return someClass; -}()); - - -//// [/src/core/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./anothermodule.ts": { - "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", - "affectsGlobalScope": false - }, - "./index.ts": { - "version": "-16698397488-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nclass someClass { }", - "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", - "affectsGlobalScope": false - }, - "./some_decl.d.ts": { - "version": "-9253692965-declare const dts: any;\r\n", - "signature": "-9253692965-declare const dts: any;\r\n", - "affectsGlobalScope": true - } - }, - "options": { - "composite": true, - "declaration": true, - "declarationMap": true, - "skipDefaultLibCheck": true, - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./anothermodule.ts", - "./index.ts", - "./some_decl.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js index 7a9434e048898..a0017e70e29ac 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/always-builds-under-with-force-option.js @@ -338,3 +338,28 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --force +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.d.ts] file written with same contents +//// [/src/core/anotherModule.d.ts.map] file written with same contents +//// [/src/core/anotherModule.js] file written with same contents +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] file written with same contents +//// [/src/core/tsconfig.tsbuildinfo] file written with same contents +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js index 059f8a4801472..6b3e4cf2275c3 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listEmittedFiles.js @@ -355,3 +355,324 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --listEmittedFiles +TSFILE: /src/core/index.js +TSFILE: /src/core/index.d.ts.map +TSFILE: /src/core/index.d.ts +TSFILE: /src/core/tsconfig.tsbuildinfo +TSFILE: /src/logic/index.js.map +TSFILE: /src/logic/index.js +TSFILE: /src/logic/index.d.ts +TSFILE: /src/logic/tsconfig.tsbuildinfo +TSFILE: /src/tests/index.js +TSFILE: /src/tests/index.d.ts +TSFILE: /src/tests/tsconfig.tsbuildinfo +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --listEmittedFiles +TSFILE: /src/core/index.js +TSFILE: /src/core/index.d.ts.map +TSFILE: /src/core/index.d.ts +TSFILE: /src/core/tsconfig.tsbuildinfo +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listEmittedFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js index be2ed648a951f..f0dd8ab79c1c5 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/listFiles.js @@ -354,3 +354,326 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --listFiles +/lib/lib.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +/lib/lib.d.ts +/src/core/index.d.ts +/src/core/anotherModule.d.ts +/src/logic/index.ts +/lib/lib.d.ts +/src/core/index.d.ts +/src/core/anotherModule.d.ts +/src/logic/index.d.ts +/src/tests/index.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --listFiles +/lib/lib.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "listFiles": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js index c02004f88fdb4..82d71147e005a 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/rebuilds-when-extended-config-file-changes.js @@ -359,3 +359,98 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/tests/tsconfig.base.json] +{"compilerOptions":{}} + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js index cb9a240024f16..4c29fd368109e 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/removes-all-files-it-built.js @@ -126,3 +126,14 @@ exitCode:: ExitStatus.Success //// [/src/tests/index.d.ts] unlink //// [/src/tests/index.js] unlink //// [/src/tests/tsconfig.tsbuildinfo] unlink + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --clean +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js index 492fd4efecd63..895cc477a0f80 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/sample.js @@ -645,3 +645,723 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' + +[12:04:00 AM] Building project '/src/logic/tsconfig.json'... + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/core/anotherModule.ts": 1, + "/src/core/index.ts": 1, + "/src/core/some_decl.d.ts": 1, + "/src/core/index.d.ts": 2, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/logic/index.ts": 1, + "/src/core/anotherModule.d.ts": 1, + "/src/logic/index.d.ts": 1, + "/src/tests/tsconfig.tsbuildinfo": 1, + "/src/tests/index.ts": 1, + "/src/tests/index.d.ts": 1 +} + +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +export declare class someClass { +} +//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.d.ts.map] +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"} + +//// [/src/core/index.d.ts.map.baseline.txt] +=================================================================== +JsFile: index.d.ts +mapUrl: index.d.ts.map +sourceRoot: +sources: index.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:/src/core/index.d.ts +sourceFile:index.ts +------------------------------------------------------------------- +>>>export declare const someString: string; +1 > +2 >^^^^^^^^^^^^^^^ +3 > ^^^^^^ +4 > ^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >export +3 > const +4 > someString +5 > : +6 > string = "HELLO WORLD" +7 > ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 16) Source(1, 8) + SourceIndex(0) +3 >Emitted(1, 22) Source(1, 14) + SourceIndex(0) +4 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) +5 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) +6 >Emitted(1, 40) Source(1, 48) + SourceIndex(0) +7 >Emitted(1, 41) Source(1, 49) + SourceIndex(0) +--- +>>>export declare function leftPad(s: string, n: number): string; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^^^^^^^^^^ +13> ^^-> +1-> + > +2 >export function +3 > leftPad +4 > ( +5 > s +6 > : +7 > string +8 > , +9 > n +10> : +11> number +12> ) { return s + n; } +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 25) Source(2, 17) + SourceIndex(0) +3 >Emitted(2, 32) Source(2, 24) + SourceIndex(0) +4 >Emitted(2, 33) Source(2, 25) + SourceIndex(0) +5 >Emitted(2, 34) Source(2, 26) + SourceIndex(0) +6 >Emitted(2, 36) Source(2, 28) + SourceIndex(0) +7 >Emitted(2, 42) Source(2, 34) + SourceIndex(0) +8 >Emitted(2, 44) Source(2, 36) + SourceIndex(0) +9 >Emitted(2, 45) Source(2, 37) + SourceIndex(0) +10>Emitted(2, 47) Source(2, 39) + SourceIndex(0) +11>Emitted(2, 53) Source(2, 45) + SourceIndex(0) +12>Emitted(2, 63) Source(2, 64) + SourceIndex(0) +--- +>>>export declare function multiply(a: number, b: number): number; +1-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^ +4 > ^ +5 > ^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^ +11> ^^^^^^ +12> ^^^^^^^^^^ +1-> + > +2 >export function +3 > multiply +4 > ( +5 > a +6 > : +7 > number +8 > , +9 > b +10> : +11> number +12> ) { return a * b; } +1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 25) Source(3, 17) + SourceIndex(0) +3 >Emitted(3, 33) Source(3, 25) + SourceIndex(0) +4 >Emitted(3, 34) Source(3, 26) + SourceIndex(0) +5 >Emitted(3, 35) Source(3, 27) + SourceIndex(0) +6 >Emitted(3, 37) Source(3, 29) + SourceIndex(0) +7 >Emitted(3, 43) Source(3, 35) + SourceIndex(0) +8 >Emitted(3, 45) Source(3, 37) + SourceIndex(0) +9 >Emitted(3, 46) Source(3, 38) + SourceIndex(0) +10>Emitted(3, 48) Source(3, 40) + SourceIndex(0) +11>Emitted(3, 54) Source(3, 46) + SourceIndex(0) +12>Emitted(3, 64) Source(3, 65) + SourceIndex(0) +--- +>>>export declare class someClass { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^ +1 > + > + > +2 >export class +3 > someClass +1 >Emitted(4, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(4, 22) Source(5, 14) + SourceIndex(0) +3 >Emitted(4, 31) Source(5, 23) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > { } +1 >Emitted(5, 2) Source(5, 27) + SourceIndex(0) +--- +>>>//# sourceMappingURL=index.d.ts.map + +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/index.js.map.baseline.txt] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +class someClass2 { } + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:07:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:07:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' + +[12:07:00 AM] Building project '/src/core/tsconfig.json'... + +[12:07:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... + +[12:07:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies + +[12:07:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... + +[12:07:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies + +[12:07:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/core/anotherModule.ts": 1, + "/src/core/index.ts": 1, + "/src/core/some_decl.d.ts": 1, + "/src/core/index.d.ts": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/tests/tsconfig.tsbuildinfo": 1 +} + +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.d.ts.map.baseline.txt] file written with same contents +//// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; +var someClass = /** @class */ (function () { + function someClass() { + } + return someClass; +}()); +exports.someClass = someClass; +var someClass2 = /** @class */ (function () { + function someClass2() { + } + return someClass2; +}()); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: when logic config changes declaration dir +Input:: +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationDir": "decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:10:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:10:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:10:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist + +[12:10:00 AM] Building project '/src/logic/tsconfig.json'... + +[12:10:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' + +[12:10:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/logic/index.ts": 1, + "/src/core/index.d.ts": 1, + "/src/core/anotherModule.d.ts": 1, + "/src/tests/tsconfig.tsbuildinfo": 1, + "/src/tests/index.ts": 1, + "/src/logic/decls/index.d.ts": 1, + "/src/tests/index.d.ts": 1 +} + +//// [/src/logic/decls/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/index.js.map.baseline.txt] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./decls", + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-2069755619-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/decls/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:13:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:13:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:13:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' + +[12:13:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' + +exitCode:: ExitStatus.Success +readFiles:: { + "/src/tests/tsconfig.json": 1, + "/src/core/tsconfig.json": 1, + "/src/logic/tsconfig.json": 1, + "/src/core/tsconfig.tsbuildinfo": 1, + "/src/logic/tsconfig.tsbuildinfo": 1, + "/src/tests/tsconfig.tsbuildinfo": 1 +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js index 1d724d20489bd..cd113fbc18468 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-declaration-option-changes.js @@ -128,3 +128,84 @@ exports.multiply = multiply; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, "declaration": true, + "skipDefaultLibCheck": true + } +} + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.d.ts] +export declare const World = "hello"; + + +//// [/src/core/anotherModule.js] file written with same contents +//// [/src/core/index.d.ts] +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; + + +//// [/src/core/index.js] file written with same contents +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "declaration": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js index 2626ba8b449ef..880936cc65094 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-esModuleInterop-option-changes.js @@ -357,3 +357,142 @@ exports.m = mod; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": true + } +} + + + +Output:: +/lib/tsc --b /src/tests --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' + +[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' + +[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' + +[12:04:00 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +exports.__esModule = true; +exports.m = void 0; +var c = __importStar(require("../core/index")); +var logic = __importStar(require("../logic/index")); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = __importStar(require("../core/anotherModule")); +exports.m = mod; + + +//// [/src/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "esModuleInterop": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js index d07f6d2c59bad..d381b6f5d29a8 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-module-option-changes.js @@ -128,3 +128,93 @@ exports.multiply = multiply; "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "module": "amd" + } +} + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; + exports.World = void 0; + exports.World = "hello"; +}); + + +//// [/src/core/index.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; + exports.multiply = exports.leftPad = exports.someString = void 0; + exports.someString = "HELLO WORLD"; + function leftPad(s, n) { return s + n; } + exports.leftPad = leftPad; + function multiply(a, b) { return a * b; } + exports.multiply = multiply; +}); + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "module": 2, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js index 9e48191d3e515..8c02694d28772 100644 --- a/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/initial-build/when-target-option-changes.js @@ -146,3 +146,107 @@ export function multiply(a, b) { return a * b; } "version": "FakeTSVersion" } + + +Change:: incremental-declaration-changes +Input:: +//// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, +"listFiles": true, +"listEmittedFiles": true, + "target": "es5", + } +} + + + +Output:: +/lib/tsc --b /src/core --verbose +[12:04:00 AM] Projects in this build: + * src/core/tsconfig.json + +[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' + +[12:04:00 AM] Building project '/src/core/tsconfig.json'... + +TSFILE: /src/core/anotherModule.js +TSFILE: /src/core/index.js +TSFILE: /src/core/tsconfig.tsbuildinfo +/lib/lib.d.ts +/lib/lib.esnext.d.ts +/src/core/anotherModule.ts +/src/core/index.ts +/src/core/some_decl.d.ts +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.World = void 0; +exports.World = "hello"; + + +//// [/src/core/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; + + +//// [/src/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "8926001564-/// \n/// ", + "signature": "8926001564-/// \n/// ", + "affectsGlobalScope": false + }, + "../../lib/lib.esnext.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "incremental": true, + "listFiles": true, + "listEmittedFiles": true, + "target": 1, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../../lib/lib.esnext.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js deleted file mode 100644 index 7d4047dec18ae..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/always-builds-under-with-force-option.js +++ /dev/null @@ -1,22 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tests --force -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.d.ts] file written with same contents -//// [/src/core/anotherModule.d.ts.map] file written with same contents -//// [/src/core/anotherModule.js] file written with same contents -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.tsbuildinfo] file written with same contents -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js deleted file mode 100644 index 9fe2a59e8827e..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/removes-all-files-it-built.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tests --clean -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js b/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js deleted file mode 100644 index 736fc2c937f48..0000000000000 --- a/tests/baselines/reference/tsbuild/sample1/no-change-run/sample.js +++ /dev/null @@ -1,26 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --b /src/tests --verbose -[12:16:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:16:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' - -[12:16:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' - -[12:16:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' - -exitCode:: ExitStatus.Success -readFiles:: { - "/src/tests/tsconfig.json": 1, - "/src/core/tsconfig.json": 1, - "/src/logic/tsconfig.json": 1, - "/src/core/tsconfig.tsbuildinfo": 1, - "/src/logic/tsconfig.tsbuildinfo": 1, - "/src/tests/tsconfig.tsbuildinfo": 1 -} - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js deleted file mode 100644 index 689fb4849c337..0000000000000 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-semantic-errors.js +++ /dev/null @@ -1,90 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - - - -Output:: -/lib/tsc --incremental -p src -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/src/dev-build/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../shared/types/db.ts": { - "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", - "affectsGlobalScope": false - }, - "../src/main.ts": { - "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - }, - "../src/other.ts": { - "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "outDir": "./", - "noEmitOnError": true, - "incremental": true, - "project": "..", - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../src/main.ts": [ - "../shared/types/db.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../shared/types/db.ts", - "../src/main.ts", - "../src/other.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js deleted file mode 100644 index 7e86f002f45c7..0000000000000 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-noEmitOnError-syntax-errors.js +++ /dev/null @@ -1,94 +0,0 @@ -Input:: -//// [/src/src/main.ts] -import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -}; - - - -Output:: -/lib/tsc --incremental -p src -exitCode:: ExitStatus.Success -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - -//// [/src/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/src/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/src/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/src/dev-build/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../shared/types/db.ts": { - "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", - "affectsGlobalScope": false - }, - "../src/main.ts": { - "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - }, - "../src/other.ts": { - "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "-4882119183-export {};\r\n", - "affectsGlobalScope": false - } - }, - "options": { - "outDir": "./", - "noEmitOnError": true, - "incremental": true, - "project": "..", - "configFilePath": "../tsconfig.json" - }, - "referencedMap": { - "../src/main.ts": [ - "../shared/types/db.ts" - ] - }, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "../shared/types/db.ts", - "../src/main.ts", - "../src/other.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js deleted file mode 100644 index 36e0f66240fb9..0000000000000 --- a/tests/baselines/reference/tsc/incremental/incremental-declaration-doesnt-change/with-only-dts-files.js +++ /dev/null @@ -1,47 +0,0 @@ -Input:: -//// [/src/project/src/main.d.ts] -export const x = 10;export const xy = 100; - - - -Output:: -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success - - -//// [/src/project/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "./src/another.d.ts": { - "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;", - "affectsGlobalScope": false - }, - "./src/main.d.ts": { - "version": "-10808461502-export const x = 10;export const xy = 100;", - "signature": "-10808461502-export const x = 10;export const xy = 100;", - "affectsGlobalScope": false - } - }, - "options": { - "incremental": true, - "project": "./", - "configFilePath": "./tsconfig.json" - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.d.ts", - "./src/another.d.ts", - "./src/main.d.ts" - ] - }, - "version": "FakeTSVersion" -} - diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js index 7233ef14aa985..cff14598d83c1 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-filename-for-buildinfo-on-commandline.js @@ -75,3 +75,14 @@ exports.x = void 0; exports.x = 10; + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js index ed14d28cce10e..acefac7c6bde8 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-from-commandline.js @@ -71,3 +71,14 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --p src/project --rootDir src/project/src +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js index fedbd3226acce..b832ef32ee437 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-passing-rootDir-is-in-the-tsconfig.js @@ -72,3 +72,14 @@ exports.x = 10; "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --p src/project +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js index d9f7c4c5d12a5..f9209ae7cce24 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -64,3 +64,148 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js index 6416598c8ba64..bf88e9a634f61 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js @@ -71,3 +71,157 @@ Semantic diagnostics in builder refreshed for:: /src/src/other.ts + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +src/src/main.ts:4:1 - error TS1005: ',' expected. + +4 ; +  ~ + + src/src/main.ts:2:11 + 2 const a = { +    ~ + The parser expected to find a '}' to match the '{' token here. + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/src/main.ts] +import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +}; + + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + + +//// [/src/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/src/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/src/dev-build/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-9621097780-export interface A {\r\n name: string;\r\n}", + "signature": "-6245214333-export interface A {\r\n name: string;\r\n}\r\n", + "affectsGlobalScope": false + }, + "../src/main.ts": { + "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + }, + "../src/other.ts": { + "version": "11373096570-console.log(\"hi\");\r\nexport { }", + "signature": "-4882119183-export {};\r\n", + "affectsGlobalScope": false + } + }, + "options": { + "outDir": "./", + "noEmitOnError": true, + "incremental": true, + "project": "..", + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + }, + "version": "FakeTSVersion" +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental -p src +exitCode:: ExitStatus.Success +Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] +Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} +Program files:: +/lib/lib.d.ts +/src/shared/types/db.ts +/src/src/main.ts +/src/src/other.ts + +Semantic diagnostics in builder refreshed for:: + + diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js index 934a88a286caa..b9d82d9664d1b 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-only-dts-files.js @@ -66,3 +66,64 @@ exitCode:: ExitStatus.Success "version": "FakeTSVersion" } + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + + + +Change:: incremental-declaration-doesnt-change +Input:: +//// [/src/project/src/main.d.ts] +export const x = 10;export const xy = 100; + + + +Output:: +/lib/tsc --incremental --p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/another.d.ts": { + "version": "-13729955264-export const y = 10;", + "signature": "-13729955264-export const y = 10;", + "affectsGlobalScope": false + }, + "./src/main.d.ts": { + "version": "-10808461502-export const x = 10;export const xy = 100;", + "signature": "-10808461502-export const x = 10;export const xy = 100;", + "affectsGlobalScope": false + } + }, + "options": { + "incremental": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./src/another.d.ts", + "./src/main.d.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js deleted file mode 100644 index d0248f2f19ce3..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-filename-for-buildinfo-on-commandline.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --incremental --p src/project --tsBuildInfoFile src/project/.tsbuildinfo -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js deleted file mode 100644 index 32ae4d7118679..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-from-commandline.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --p src/project --rootDir src/project/src -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js b/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js deleted file mode 100644 index e8d5d417eb7eb..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/when-passing-rootDir-is-in-the-tsconfig.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --p src/project -exitCode:: ExitStatus.Success - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js deleted file mode 100644 index 11f0fb20c8648..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-semantic-errors.js +++ /dev/null @@ -1,29 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --incremental -p src -src/src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js deleted file mode 100644 index 5f80229a49f2c..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-noEmitOnError-syntax-errors.js +++ /dev/null @@ -1,34 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --incremental -p src -src/src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - - src/src/main.ts:2:11 - 2 const a = { -    ~ - The parser expected to find a '}' to match the '{' token here. - - -Found 1 error. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] -Program options: {"outDir":"/src/dev-build","noEmitOnError":true,"incremental":true,"project":"/src","configFilePath":"/src/tsconfig.json"} -Program files:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/shared/types/db.ts -/src/src/main.ts -/src/src/other.ts - - diff --git a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js b/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js deleted file mode 100644 index de92cd31eb4d9..0000000000000 --- a/tests/baselines/reference/tsc/incremental/no-change-run/with-only-dts-files.js +++ /dev/null @@ -1,8 +0,0 @@ -Input:: - - -Output:: -/lib/tsc --incremental --p src/project -exitCode:: ExitStatus.Success - - From bfbc38816bc7ba7b34736d485871d28b0ba89526 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 29 May 2020 12:51:42 -0700 Subject: [PATCH 6/7] Input and output in watch mode --- src/testRunner/unittests/tsbuild/watchMode.ts | 351 +++++++------- .../unittests/tscWatch/consoleClearing.ts | 30 +- src/testRunner/unittests/tscWatch/emit.ts | 196 ++++---- .../unittests/tscWatch/emitAndErrorUpdates.ts | 54 ++- .../forceConsistentCasingInFileNames.ts | 16 +- src/testRunner/unittests/tscWatch/helpers.ts | 81 +++- .../unittests/tscWatch/incremental.ts | 13 +- .../unittests/tscWatch/programUpdates.ts | 432 +++++++++--------- .../unittests/tscWatch/resolutionCache.ts | 106 +++-- .../unittests/tscWatch/watchEnvironment.ts | 171 ++++--- .../reports-syntax-errors-in-config-file.js | 82 ++-- .../demo/updates-with-bad-reference.js | 6 +- .../demo/updates-with-circular-reference.js | 208 ++++----- ...mit-any-files-on-error-with-incremental.js | 182 ++++---- .../does-not-emit-any-files-on-error.js | 76 +-- .../creates-solution-in-watch-mode.js | 158 +++---- .../incremental-updates-in-verbose-mode.js | 304 ++++++------ .../when-file-with-no-error-changes.js | 82 ++-- ...ing-errors-only-changed-file-is-emitted.js | 92 ++-- .../when-file-with-no-error-changes.js | 6 +- ...ixing-error-files-all-files-are-emitted.js | 76 +-- .../when-preserveWatchOutput-is-not-used.js | 162 +++---- ...veWatchOutput-is-passed-on-command-line.js | 160 +++---- ...tches-config-files-that-are-not-present.js | 178 ++++---- ...e-down-stream-project-and-then-fixes-it.js | 202 ++++---- ...ncing-project-even-for-non-local-change.js | 160 ++++--- ...le-is-added,-and-its-subsequent-updates.js | 266 ++++++----- ...hanges-and-reports-found-errors-message.js | 374 ++++++++------- ...not-start-build-of-referencing-projects.js | 192 ++++---- ...le-is-added,-and-its-subsequent-updates.js | 266 ++++++----- ...hanges-and-reports-found-errors-message.js | 374 ++++++++------- ...not-start-build-of-referencing-projects.js | 192 ++++---- ...hen-noUnusedParameters-changes-to-false.js | 14 +- .../reexport/Reports-errors-correctly.js | 230 +++++----- ...rough-indirect-symlink-moduleCaseChange.js | 60 +-- ...ibling-package-through-indirect-symlink.js | 60 +-- ...ther-symlinked-package-moduleCaseChange.js | 58 +-- ...age-with-indirect-link-moduleCaseChange.js | 40 +- ...er-symlinked-package-with-indirect-link.js | 40 +- ...gh-source-and-another-symlinked-package.js | 58 +-- .../createWatchOfConfigFile.js | 20 +- ...Result-on-WatchCompilerHostOfConfigFile.js | 20 +- .../consoleClearing/with---diagnostics.js | 20 +- .../with---extendedDiagnostics.js | 20 +- .../with---preserveWatchOutput.js | 20 +- ...---diagnostics-or---extendedDiagnostics.js | 20 +- ...ms-correctly-in-incremental-compilation.js | 46 +- ...s-deleted-and-created-as-part-of-change.js | 20 +- ...ndles-new-lines-carriageReturn-lineFeed.js | 28 +- .../handles-new-lines-lineFeed.js | 28 +- .../should-emit-specified-file.js | 70 +-- ...elf-if-'--isolatedModules'-is-specified.js | 82 ++-- ...-if-'--out'-or-'--outFile'-is-specified.js | 114 ++--- ...should-be-up-to-date-with-deleted-files.js | 84 ++-- ...-be-up-to-date-with-newly-created-files.js | 96 ++-- ...-to-date-with-the-reference-map-changes.js | 158 ++++--- ...les-referencing-it-if-its-shape-changed.js | 100 ++-- ...should-detect-changes-in-non-root-files.js | 66 +-- .../should-detect-non-existing-code-file.js | 56 ++- .../should-detect-removed-code-file.js | 42 +- ...ll-files-if-a-global-file-changed-shape.js | 86 ++-- ...ould-return-cascaded-affected-file-list.js | 148 +++--- ...fine-for-files-with-circular-references.js | 52 ++- .../config-does-not-have-out-or-outFile.js | 30 +- .../config-has-out.js | 26 +- .../config-has-outFile.js | 26 +- ...ltiple-declaration-files-in-the-program.js | 36 +- ...ltiple-declaration-files-in-the-program.js | 42 +- ...-recursive-directory-watcher-is-invoked.js | 32 +- ...es-errors-when-deep-import-file-changes.js | 96 ++-- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 90 ++-- ...n-there-are-circular-import-and-exports.js | 128 +++--- ...here-are-no-circular-import-and-exports.js | 120 ++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../with-noEmitOnError.js | 66 +-- ...es-errors-when-deep-import-file-changes.js | 116 ++--- ...import-through-declaration-file-changes.js | 30 +- ...g-a-deep-multilevel-import-that-changes.js | 166 +++---- ...n-there-are-circular-import-and-exports.js | 142 +++--- ...here-are-no-circular-import-and-exports.js | 134 +++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../with-noEmitOnError.js | 96 ++-- ...es-errors-when-deep-import-file-changes.js | 96 ++-- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 90 ++-- ...n-there-are-circular-import-and-exports.js | 128 +++--- ...here-are-no-circular-import-and-exports.js | 120 ++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../default/with-noEmitOnError.js | 66 +-- ...es-errors-when-deep-import-file-changes.js | 128 +++--- ...import-through-declaration-file-changes.js | 32 +- ...g-a-deep-multilevel-import-that-changes.js | 170 +++---- ...n-there-are-circular-import-and-exports.js | 152 +++--- ...here-are-no-circular-import-and-exports.js | 142 +++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../defaultAndD/with-noEmitOnError.js | 96 ++-- ...es-errors-when-deep-import-file-changes.js | 94 ++-- ...import-through-declaration-file-changes.js | 22 +- ...g-a-deep-multilevel-import-that-changes.js | 88 ++-- ...n-there-are-circular-import-and-exports.js | 126 ++--- ...here-are-no-circular-import-and-exports.js | 118 ++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../isolatedModules/with-noEmitOnError.js | 66 +-- ...es-errors-when-deep-import-file-changes.js | 128 +++--- ...import-through-declaration-file-changes.js | 32 +- ...g-a-deep-multilevel-import-that-changes.js | 168 +++---- ...n-there-are-circular-import-and-exports.js | 150 +++--- ...here-are-no-circular-import-and-exports.js | 140 +++--- .../with-noEmitOnError-with-incremental.js | 150 +++--- .../isolatedModulesAndD/with-noEmitOnError.js | 96 ++-- ...nging-module-name-with-different-casing.js | 54 ++- ...hen-renaming-file-with-different-casing.js | 44 +- ...al-with-circular-references-incremental.js | 80 ++-- ...remental-with-circular-references-watch.js | 128 +++--- .../own-file-emit-with-errors-incremental.js | 80 ++-- .../own-file-emit-with-errors-watch.js | 114 ++--- ...wn-file-emit-without-errors-incremental.js | 62 +-- .../own-file-emit-without-errors-watch.js | 102 +++-- .../with---out-incremental.js | 44 +- .../module-compilation/with---out-watch.js | 80 ++-- .../own-file-emit-with-errors-incremental.js | 80 ++-- .../own-file-emit-with-errors-watch.js | 114 ++--- ...eters-that-are-not-relative-incremental.js | 62 +-- ...-parameters-that-are-not-relative-watch.js | 102 +++-- ...without-commandline-options-incremental.js | 62 +-- .../without-commandline-options-watch.js | 102 +++-- ...declaration-file-is-deleted-incremental.js | 80 ++-- ...lobal-declaration-file-is-deleted-watch.js | 112 ++--- .../incremental/with---out-incremental.js | 44 +- .../tscWatch/incremental/with---out-watch.js | 76 +-- ...nerated-when-the-config-file-has-errors.js | 12 +- ...configFile-contents-when-options-change.js | 14 +- ...rs-document-is-not-contained-in-project.js | 10 +- ...rts-errors-when-the-config-file-changes.js | 16 +- ...nostics-when-'--noUnusedLabels'-changes.js | 16 +- ...-a-configured-program-without-file-list.js | 24 +- ...hould-remove-the-module-not-found-error.js | 38 +- ...has-changed-(new-file-in-list-of-files).js | 24 +- ...ot-files-has-changed-(new-file-on-disk).js | 24 +- ...config-file-name-with-difference-casing.js | 12 +- ...-when-set-of-root-files-was-not-changed.js | 32 +- ...iles-are-reflected-in-project-structure.js | 74 +-- .../config-file-includes-the-file.js | 42 +- .../programUpdates/config-file-is-deleted.js | 22 +- ...s-changes-in-lib-section-of-config-file.js | 16 +- ...te-configured-project-without-file-list.js | 20 +- .../create-watch-without-config-file.js | 18 +- ...eleted-files-affect-project-structure-2.js | 86 ++-- .../deleted-files-affect-project-structure.js | 86 ++-- ...iles-explicitly-excluded-in-config-file.js | 20 +- .../handle-recreated-files-correctly.js | 30 +- ...se-they-were-added-with-tripleSlashRefs.js | 26 +- ...esnt-have-errors,-they-are-not-reported.js | 12 +- ...ndle-@types-if-input-file-list-is-empty.js | 4 +- ...e-tolerated-without-crashing-the-server.js | 4 +- ...tore-the-states-for-configured-projects.js | 66 +-- ...estore-the-states-for-inferred-projects.js | 62 +-- ...rors-correctly-with-file-not-in-rootDir.js | 32 +- ...s-errors-correctly-with-isolatedModules.js | 46 +- ...non-existing-directories-in-config-file.js | 12 +- ...ting-files-specified-in-the-config-file.js | 12 +- .../declarationDir-is-specified.js | 56 +-- ...-outDir-and-declarationDir-is-specified.js | 56 +-- .../when-outDir-is-specified.js | 40 +- .../with-outFile.js | 34 +- .../without-outDir-or-outFile-is-specified.js | 40 +- ...odule-resolution-changes-in-config-file.js | 28 +- .../should-reflect-change-in-config-file.js | 24 +- ...errors-and-still-try-to-build-a-project.js | 20 +- ...when-file-changes-from-global-to-module.js | 50 +- ...-from-config-file-path-if-config-exists.js | 12 +- ...tes-diagnostics-and-emit-for-decorators.js | 96 ++-- ...it-when-useDefineForClassFields-changes.js | 52 ++- ...mit-when-importsNotUsedAsValues-changes.js | 78 ++-- ...on-emit-is-disabled-in-compiler-options.js | 12 +- .../with-default-options.js | 22 +- .../with-skipDefaultLibCheck.js | 22 +- .../with-skipLibCheck.js | 22 +- .../with-default-options.js | 34 +- .../with-skipDefaultLibCheck.js | 34 +- .../with-skipLibCheck.js | 34 +- ...when-ambient-modules-of-program-changes.js | 24 +- ...orceConsistentCasingInFileNames-changes.js | 40 +- ...s-errors-when-noErrorTruncation-changes.js | 14 +- ...es-errors-when-strictNullChecks-changes.js | 18 +- ...solution-when-resolveJsonModule-changes.js | 18 +- ...and-new-file-is-added-as-part-of-change.js | 22 +- ...ibCheck-and-skipDefaultLibCheck-changes.js | 22 +- ...-file-is-changed-but-its-content-havent.js | 28 +- .../watch-with-configFile.js | 16 +- .../watch-without-configFile.js | 16 +- ...are-global-and-installed-at-later-point.js | 18 +- .../with-modules-linked-to-sibling-folder.js | 14 +- ...cluded-file-with-ambient-module-changes.js | 18 +- ...le-resolution-changes-to-ambient-module.js | 18 +- ...der-that-already-contains-@types-folder.js | 18 +- ...rogram-with-files-from-external-library.js | 50 +- ...polling-when-renaming-file-in-subfolder.js | 18 +- ...rectory-when-renaming-file-in-subfolder.js | 18 +- ...tchFile-when-renaming-file-in-subfolder.js | 18 +- ...ymlinks-to-folders-in-recursive-folders.js | 14 +- .../with-non-synchronous-watch-directory.js | 34 +- .../using-dynamic-priority-polling.js | 28 +- .../with-fallbackPolling-option.js | 20 +- .../with-watchDirectory-option.js | 20 +- ...th-watchFile-as-watch-options-to-extend.js | 20 +- .../watchOptions/with-watchFile-option.js | 20 +- 208 files changed, 8479 insertions(+), 7357 deletions(-) diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index 1c12631c2f32d..3c17690a4eb1b 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -93,14 +93,16 @@ namespace ts.tscWatch { return result; } - function changeFile(sys: WatchedSystem, fileName: string, content: string, caption: string) { - sys.writeFile(fileName, content); - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - return caption; + function changeFile(fileName: string | (() => string), content: string | (() => string), caption: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(isString(fileName) ? fileName : fileName(), isString(content) ? content : content()), + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds core + }; } - function changeCore(sys: WatchedSystem, content: string, caption: string) { - return changeFile(sys, core[1].path, content, caption); + function changeCore(content: () => string, caption: string) { + return changeFile(() => core[1].path, content, caption); } let core: SubProjectFiles; @@ -161,6 +163,13 @@ namespace ts.tscWatch { return system; }); + const buildTests: TscWatchCompileChange = { + caption: "Build Tests", + change: noop, + // Build tests + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; + describe("validates the changes and watched files", () => { const newFileWithoutExtension = "newFile"; const newFile: File = { @@ -169,16 +178,12 @@ namespace ts.tscWatch { }; function verifyProjectChanges(subScenario: string, allFilesGetter: () => readonly File[]) { - function buildLogicOrUpdateTimeStamps(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic or updates timestamps - return "Build logic or update time stamps"; - } + const buildLogicOrUpdateTimeStamps: TscWatchCompileChange = { + caption: "Build logic or update time stamps", + change: noop, + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds logic or updates timestamps + }; - function buildTests(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Build tests - sys.checkTimeoutQueueLength(0); - return "Build Tests"; - } verifyTscWatch({ scenario, subScenario: `${subScenario}/change builds changes and reports found errors message`, @@ -188,24 +193,26 @@ namespace ts.tscWatch { { currentDirectory: projectsLocation } ), changes: [ - sys => changeCore(sys, `${core[1].content} + changeCore(() => `${core[1].content} export class someClass { }`, "Make change to core"), buildLogicOrUpdateTimeStamps, buildTests, // Another change requeues and builds it - sys => changeCore(sys, core[1].content, "Revert core file"), + changeCore(() => core[1].content, "Revert core file"), buildLogicOrUpdateTimeStamps, buildTests, - sys => { - const change1 = `${core[1].content} + { + caption: "Make two changes", + change: sys => { + const change1 = `${core[1].content} export class someClass { }`; - sys.writeFile(core[1].path, change1); - assert.equal(sys.writtenFiles.size, 1); - sys.writtenFiles.clear(); - sys.writeFile(core[1].path, `${change1} + sys.writeFile(core[1].path, change1); + assert.equal(sys.writtenFiles.size, 1); + sys.writtenFiles.clear(); + sys.writeFile(core[1].path, `${change1} export class someClass2 { }`); - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - return "Make two changes"; + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds core }, buildLogicOrUpdateTimeStamps, buildTests, @@ -221,15 +228,15 @@ export class someClass2 { }`); { currentDirectory: projectsLocation } ), changes: [ - sys => changeCore(sys, `${core[1].content} + changeCore(() => `${core[1].content} function foo() { }`, "Make local change to core"), buildLogicOrUpdateTimeStamps, buildTests ] }); - function changeNewFile(sys: WatchedSystem, newFileContent: string) { - return changeFile(sys, newFile.path, newFileContent, "Change to new File and build core"); + function changeNewFile(newFileContent: string) { + return changeFile(newFile.path, newFileContent, "Change to new File and build core"); } verifyTscWatch({ scenario, @@ -240,10 +247,10 @@ function foo() { }`, "Make local change to core"), { currentDirectory: projectsLocation } ), changes: [ - sys => changeNewFile(sys, newFile.content), + changeNewFile(newFile.content), buildLogicOrUpdateTimeStamps, buildTests, - sys => changeNewFile(sys, `${newFile.content} + changeNewFile(`${newFile.content} export class someClass2 { }`), buildLogicOrUpdateTimeStamps, buildTests @@ -285,16 +292,12 @@ export class someClass2 { }`), { currentDirectory: projectsLocation } ), changes: [ - sys => { - sys.writeFile(logic[0].path, logic[0].content); - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - return "Write logic tsconfig and build logic"; + { + caption: "Write logic tsconfig and build logic", + change: sys => sys.writeFile(logic[0].path, logic[0].content), + timeouts: checkSingleTimeoutQueueLengthAndRun, // Builds logic }, - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // Builds tests - sys.checkTimeoutQueueLength(0); - return "Build tests"; - } + buildTests ] }); @@ -309,11 +312,12 @@ export class someClass2 { }`), after(() => { coreIndex = undefined!; }); - function buildLogic(sys: WatchedSystem) { - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - sys.checkTimeoutQueueLength(0); - return "Build logic"; - } + const buildLogic: TscWatchCompileChange = { + caption: "Build logic", + change: noop, + // Builds logic + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; verifyTscWatch({ scenario, subScenario: "when referenced using prepend builds referencing project even for non local change", @@ -339,10 +343,10 @@ export class someClass2 { }`), return createWatchedSystem([libFile, coreTsConfig, coreIndex, logicTsConfig, logicIndex], { currentDirectory: projectsLocation }); }, changes: [ - sys => changeCore(sys, `${coreIndex.content} + changeCore(() => `${coreIndex.content} function myFunc() { return 10; }`, "Make non local change and build core"), buildLogic, - sys => changeCore(sys, `${coreIndex.content} + changeCore(() => `${coreIndex.content} function myFunc() { return 100; }`, "Make local change and build core"), buildLogic, ] @@ -390,19 +394,23 @@ createSomeObject().message;` return createWatchedSystem(files, { currentDirectory: `${projectsLocation}/${project}` }); }, changes: [ - sys => { + { + caption: "Introduce error", // Change message in library to message2 - sys.writeFile(libraryTs.path, libraryTs.content.replace(/message/g, "message2")); - sys.checkTimeoutQueueLengthAndRun(1); // Build library - sys.checkTimeoutQueueLengthAndRun(1); // Build App - return "Introduce error"; + change: sys => sys.writeFile(libraryTs.path, libraryTs.content.replace(/message/g, "message2")), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // Build library + sys.checkTimeoutQueueLengthAndRun(1); // Build App + }, }, - sys => { + { + caption: "Fix error", // Revert library changes - sys.writeFile(libraryTs.path, libraryTs.content); - sys.checkTimeoutQueueLengthAndRun(1); // Build library - sys.checkTimeoutQueueLengthAndRun(1); // Build App - return "Fix error"; + change: sys => sys.writeFile(libraryTs.path, libraryTs.content), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // Build library + sys.checkTimeoutQueueLengthAndRun(1); // Build App + }, }, ] }); @@ -417,21 +425,19 @@ createSomeObject().message;` commandLineArgs: ["-b", "-w", `${project}/${SubProject.tests}`, ...buildOptions], sys: () => createWatchedSystem(allFiles, { currentDirectory: projectsLocation }), changes: [ - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -let y: string = 10;`); - - sys.checkTimeoutQueueLengthAndRun(1); // Builds logic - sys.checkTimeoutQueueLength(0); - return "change logic"; + { + caption: "change logic", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +let y: string = 10;`), + // Builds logic + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, }, - sys => { - sys.writeFile(core[1].path, `${core[1].content} -let x: string = 10;`); - - sys.checkTimeoutQueueLengthAndRun(1); // Builds core - sys.checkTimeoutQueueLength(0); - return "change core"; + { + caption: "change core", + change: sys => sys.writeFile(core[1].path, `${core[1].content} +let x: string = 10;`), + // Builds core + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, } ] }); @@ -468,18 +474,18 @@ let x: string = 10;`); sys.checkTimeoutQueueLength(0); } - function fixError(sys: WatchedSystem) { + const fixError: TscWatchCompileChange = { + caption: "Fix error in fileWithError", // Fix error - sys.writeFile(fileWithError.path, fileWithFixedError.content); - incrementalBuild(sys); - return "Fix error in fileWithError"; - } + change: sys => sys.writeFile(fileWithError.path, fileWithFixedError.content), + timeouts: incrementalBuild + }; - function changeFileWithoutError(sys: WatchedSystem) { - sys.writeFile(fileWithoutError.path, fileWithoutError.content.replace(/myClass/g, "myClass2")); - incrementalBuild(sys); - return "Change fileWithoutError"; - } + const changeFileWithoutError: TscWatchCompileChange = { + caption: "Change fileWithoutError", + change: sys => sys.writeFile(fileWithoutError.path, fileWithoutError.content.replace(/myClass/g, "myClass2")), + timeouts: incrementalBuild + }; verifyTscWatch({ scenario, @@ -508,11 +514,11 @@ let x: string = 10;`); }); describe("when reporting errors on introducing error", () => { - function introduceError(sys: WatchedSystem) { - sys.writeFile(fileWithError.path, fileWithError.content); - incrementalBuild(sys); - return "Introduce error"; - } + const introduceError: TscWatchCompileChange = { + caption: "Introduce error", + change: sys => sys.writeFile(fileWithError.path, fileWithError.content), + timeouts: incrementalBuild, + }; verifyTscWatch({ scenario, @@ -1122,19 +1128,23 @@ export function gfoo() { commandLineArgs: ["-b", "-w", `${project}/${SubProject.tests}`, "-verbose"], sys: () => createWatchedSystem(allFiles, { currentDirectory: projectsLocation }), changes: [ - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -function someFn() { }`); - sys.checkTimeoutQueueLengthAndRun(1); // build logic - sys.checkTimeoutQueueLengthAndRun(1); // build tests - return "Make non dts change"; + { + caption: "Make non dts change", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +function someFn() { }`), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build logic + sys.checkTimeoutQueueLengthAndRun(1); // build tests + }, }, - sys => { - sys.writeFile(logic[1].path, `${logic[1].content} -export function someFn() { }`); - sys.checkTimeoutQueueLengthAndRun(1); // build logic - sys.checkTimeoutQueueLengthAndRun(1); // build tests - return "Make dts change"; + { + caption: "Make dts change", + change: sys => sys.writeFile(logic[1].path, `${logic[1].content} +export function someFn() { }`), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build logic + sys.checkTimeoutQueueLengthAndRun(1); // build tests + }, } ], }); @@ -1159,14 +1169,14 @@ export function someFn() { }`); return createWatchedSystem([index, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ + { + caption: "Change tsconfig to set noUnusedParameters to false", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noUnusedParameters: false } - })); - sys.runQueuedTimeoutCallbacks(); - return "Change tsconfig to set noUnusedParameters to false"; + })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1216,14 +1226,16 @@ export function someFn() { }`); return sys; }, changes: [ - sys => { - sys.writeFile(coreFiles[0].path, coreFiles[0].content); - sys.checkTimeoutQueueLengthAndRun(1); // build core - sys.checkTimeoutQueueLengthAndRun(1); // build animals - sys.checkTimeoutQueueLengthAndRun(1); // build zoo - sys.checkTimeoutQueueLengthAndRun(1); // build solution - sys.checkTimeoutQueueLength(0); - return "Fix error"; + { + caption: "Fix error", + change: sys => sys.writeFile(coreFiles[0].path, coreFiles[0].content), + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // build core + sys.checkTimeoutQueueLengthAndRun(1); // build animals + sys.checkTimeoutQueueLengthAndRun(1); // build zoo + sys.checkTimeoutQueueLengthAndRun(1); // build solution + sys.checkTimeoutQueueLength(0); + }, } ] }); @@ -1239,13 +1251,13 @@ ${coreFiles[1].content}`); return sys; }, changes: [ - sys => { - sys.writeFile(coreFiles[1].path, ` + { + caption: "Prepend a line", + change: sys => sys.writeFile(coreFiles[1].path, ` import * as A from '../animals'; -${coreFiles[1].content}`); - sys.checkTimeoutQueueLengthAndRun(1); // build core - sys.checkTimeoutQueueLength(0); - return "Prepend a line"; +${coreFiles[1].content}`), + // build core + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, } ] }); @@ -1260,6 +1272,21 @@ ${coreFiles[1].content}`); }); describe("unittests:: tsbuild:: watchMode:: with noEmitOnError", () => { + function change(caption: string, content: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, content), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; + } + + const noChange: TscWatchCompileChange = { + caption: "No change", + change: sys => sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${projectsLocation}/noEmitOnError/src/main.ts`)!), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout, + }; verifyTscWatch({ scenario: "noEmitOnError", subScenario: "does not emit any files on error", @@ -1274,36 +1301,28 @@ ${coreFiles[1].content}`); ), changes: [ noChange, - sys => change(sys, "Fix Syntax error", `import { A } from "../shared/types/db"; + change("Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`), - sys => change(sys, "Semantic Error", `import { A } from "../shared/types/db"; + change("Semantic Error", `import { A } from "../shared/types/db"; const a: string = 10;`), noChange, - sys => change(sys, "Fix Semantic Error", `import { A } from "../shared/types/db"; + change("Fix Semantic Error", `import { A } from "../shared/types/db"; const a: string = "hello";`), noChange, ], baselineIncremental: true }); - - function change(sys: WatchedSystem, caption: string, content: string) { - sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, content); - sys.checkTimeoutQueueLengthAndRun(1); // build project - sys.checkTimeoutQueueLength(0); - return caption; - } - - function noChange(sys: WatchedSystem) { - sys.writeFile(`${projectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${projectsLocation}/noEmitOnError/src/main.ts`)!); - sys.checkTimeoutQueueLengthAndRun(1); // build project - sys.checkTimeoutQueueLength(0); - return "No change"; - } }); describe("unittests:: tsbuild:: watchMode:: with reexport when referenced project reexports definitions from another file", () => { + function build(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); // build src/pure + sys.checkTimeoutQueueLengthAndRun(1); // build src/main + sys.checkTimeoutQueueLengthAndRun(1); // build src + sys.checkTimeoutQueueLength(0); + } verifyTscWatch({ scenario: "reexport", subScenario: "Reports errors correctly", @@ -1321,27 +1340,25 @@ const a: string = "hello";`), { currentDirectory: `${projectsLocation}/reexport` } ), changes: [ - sys => { - replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "// ", ""); - sys.checkTimeoutQueueLengthAndRun(1); // build src/pure - sys.checkTimeoutQueueLengthAndRun(1); // build src/main - sys.checkTimeoutQueueLengthAndRun(1); // build src - sys.checkTimeoutQueueLength(0); - return "Introduce error"; + { + caption: "Introduce error", + change: sys => replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "// ", ""), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "bar: ", "// bar: "); - sys.checkTimeoutQueueLengthAndRun(1); // build src/pure - sys.checkTimeoutQueueLengthAndRun(1); // build src/main - sys.checkTimeoutQueueLengthAndRun(1); // build src - sys.checkTimeoutQueueLength(0); - return "Fix error"; + { + caption: "Fix error", + change: sys => replaceFileText(sys, `${projectsLocation}/reexport/src/pure/session.ts`, "bar: ", "// bar: "), + timeouts: build } ] }); }); describe("unittests:: tsbuild:: watchMode:: configFileErrors:: reports syntax errors in config file", () => { + function build(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); // build the project + sys.checkTimeoutQueueLength(0); + } verifyTscWatch({ scenario: "configFileErrors", subScenario: "reports syntax errors in config file", @@ -1368,33 +1385,29 @@ const a: string = "hello";`), ), commandLineArgs: ["--b", "-w"], changes: [ - sys => { - replaceFileText(sys, `${projectRoot}/tsconfig.json`, ",", `, - "declaration": true,`); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports syntax errors after change to config file"; + { + caption: "reports syntax errors after change to config file", + change: sys => replaceFileText(sys, `${projectRoot}/tsconfig.json`, ",", `, + "declaration": true,`), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectRoot}/a.ts`, "foo", "fooBar"); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports syntax errors after change to ts file"; + { + caption: "reports syntax errors after change to ts file", + change: sys => replaceFileText(sys, `${projectRoot}/a.ts`, "foo", "fooBar"), + timeouts: build, }, - sys => { - replaceFileText(sys, `${projectRoot}/tsconfig.json`, "", ""); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "reports error when there is no change to tsconfig file"; + { + caption: "reports error when there is no change to tsconfig file", + change: sys => replaceFileText(sys, `${projectRoot}/tsconfig.json`, "", ""), + timeouts: build, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ + { + caption: "builds after fixing config file errors", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { composite: true, declaration: true }, files: ["a.ts", "b.ts"] - })); - sys.checkTimeoutQueueLengthAndRun(1); // build the project - sys.checkTimeoutQueueLength(0); - return "builds after fixing config file errors"; + })), + timeouts: build, } ] }); diff --git a/src/testRunner/unittests/tscWatch/consoleClearing.ts b/src/testRunner/unittests/tscWatch/consoleClearing.ts index 66476b6a31776..c874c32e04b31 100644 --- a/src/testRunner/unittests/tscWatch/consoleClearing.ts +++ b/src/testRunner/unittests/tscWatch/consoleClearing.ts @@ -6,11 +6,11 @@ namespace ts.tscWatch { content: "" }; - function makeChangeToFile(sys: WatchedSystem) { - sys.modifyFile(file.path, "//"); - sys.runQueuedTimeoutCallbacks(); - return "Comment added to file f"; - } + const makeChangeToFile: TscWatchCompileChange[] = [{ + caption: "Comment added to file f", + change: sys => sys.modifyFile(file.path, "//"), + timeouts: runQueuedTimeoutCallbacks, + }]; function checkConsoleClearingUsingCommandLineOptions(subScenario: string, commandLineOptions?: string[]) { verifyTscWatch({ @@ -18,9 +18,7 @@ namespace ts.tscWatch { subScenario, commandLineArgs: ["--w", file.path, ...commandLineOptions || emptyArray], sys: () => createWatchedSystem([file, libFile]), - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, }); } @@ -39,20 +37,16 @@ namespace ts.tscWatch { }; const files = [file, configFile, libFile]; it("using createWatchOfConfigFile ", () => { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - createWatchedSystem(files) - ); - const watch = createWatchOfConfigFile(configFile.path, sys); + const baseline = createBaseline(createWatchedSystem(files)); + const watch = createWatchOfConfigFile(configFile.path, baseline.sys); // Initially console is cleared if --preserveOutput is not provided since the config file is yet to be parsed runWatchBaseline({ scenario, subScenario: "when preserveWatchOutput is true in config file/createWatchOfConfigFile", commandLineArgs: ["--w", "-p", configFile.path], - sys, + ...baseline, getPrograms: () => [[watch.getCurrentProgram().getProgram(), watch.getCurrentProgram()]], - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, watchOrSolution: watch }); }); @@ -61,9 +55,7 @@ namespace ts.tscWatch { subScenario: "when preserveWatchOutput is true in config file/when createWatchProgram is invoked with configFileParseResult on WatchCompilerHostOfConfigFile", commandLineArgs: ["--w", "-p", configFile.path], sys: () => createWatchedSystem(files), - changes: [ - makeChangeToFile - ], + changes: makeChangeToFile, }); }); }); diff --git a/src/testRunner/unittests/tscWatch/emit.ts b/src/testRunner/unittests/tscWatch/emit.ts index 98be86a0f7392..be2d95738829b 100644 --- a/src/testRunner/unittests/tscWatch/emit.ts +++ b/src/testRunner/unittests/tscWatch/emit.ts @@ -22,10 +22,10 @@ namespace ts.tscWatch { return createWatchedSystem([f1, f2, config, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/a.ts", "let x = 11"); - sys.runQueuedTimeoutCallbacks(); - return "Make change in the file"; + { + caption: "Make change in the file", + change: sys => sys.writeFile("/a/a.ts", "let x = 11"), + timeouts: runQueuedTimeoutCallbacks } ] }); @@ -145,20 +145,20 @@ namespace ts.tscWatch { function modifyModuleFile1Shape(sys: WatchedSystem) { sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { };`); } - function changeModuleFile1Shape(sys: WatchedSystem) { - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export function Foo() { };`"; - } + const changeModuleFile1Shape: TscWatchCompileChange = { + caption: "Change the content of moduleFile1 to `export var T: number;export function Foo() { };`", + change: modifyModuleFile1Shape, + timeouts: checkSingleTimeoutQueueLengthAndRun, + }; verifyTscWatchEmit({ subScenario: "should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", changes: [ changeModuleFile1Shape, - sys => { - sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { console.log('hi'); };`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };`"; + { + caption: "Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };`", + change: sys => sys.writeFile(moduleFile1Path, `export var T: number;export function Foo() { console.log('hi'); };`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -166,29 +166,31 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with the reference map changes", changes: [ - sys => { - sys.writeFile(file1Consumer1Path, `export let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change file1Consumer1 content to `export let y = Foo();`"; + { + caption: "Change file1Consumer1 content to `export let y = Foo();`", + change: sys => sys.writeFile(file1Consumer1Path, `export let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, changeModuleFile1Shape, - sys => { - sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Add the import statements back to file1Consumer1"; + { + caption: "Add the import statements back to file1Consumer1", + change: sys => sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(moduleFile1Path, `export let y = Foo();`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };`"; + { + caption: "Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };`", + change: sys => sys.writeFile(moduleFile1Path, `export let y = Foo();`), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { + { + caption: "Multiple file edits in one go", // Change file1Consumer1 content to `export let y = Foo();` // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "Multiple file edits in one go"; + change: sys => { + sys.writeFile(file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); + modifyModuleFile1Shape(sys); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -196,11 +198,13 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with deleted files", changes: [ - sys => { - modifyModuleFile1Shape(sys); - sys.deleteFile(file1Consumer2Path); - sys.checkTimeoutQueueLengthAndRun(1); - return "change moduleFile1 shape and delete file1Consumer2"; + { + caption: "change moduleFile1 shape and delete file1Consumer2", + change: sys => { + modifyModuleFile1Shape(sys); + sys.deleteFile(file1Consumer2Path); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -208,11 +212,13 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should be up-to-date with newly created files", changes: [ - sys => { - sys.writeFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); - modifyModuleFile1Shape(sys); - sys.checkTimeoutQueueLengthAndRun(1); - return "change moduleFile1 shape and create file1Consumer3"; + { + caption: "change moduleFile1 shape and create file1Consumer3", + change: sys => { + sys.writeFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); + modifyModuleFile1Shape(sys); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -222,10 +228,10 @@ namespace ts.tscWatch { configObj: { files: [file1Consumer1Path] }, changes: [ changeModuleFile1Shape, - sys => { - sys.appendFile(moduleFile1Path, "var T1: number;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1 internal, and verify only file1 is affected"; + { + caption: "change file1 internal, and verify only file1 is affected", + change: sys => sys.appendFile(moduleFile1Path, "var T1: number;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -233,10 +239,10 @@ namespace ts.tscWatch { verifyTscWatchEmit({ subScenario: "should return all files if a global file changed shape", changes: [ - sys => { - sys.appendFile(globalFilePath, "var T2: string;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change shape of global file"; + { + caption: "change shape of global file", + change: sys => sys.appendFile(globalFilePath, "var T2: string;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -264,17 +270,19 @@ namespace ts.tscWatch { content: `import {y} from "./file1Consumer1";` }], changes: [ - sys => { - sys.appendFile(file1Consumer1Path, "export var T: number;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1Consumer1"; + { + caption: "change file1Consumer1", + change: sys => sys.appendFile(file1Consumer1Path, "export var T: number;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, changeModuleFile1Shape, - sys => { - sys.appendFile(file1Consumer1Path, "export var T2: number;"); - sys.writeFile(moduleFile1Path, `export var T2: number;export function Foo() { };`); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1Consumer1 and moduleFile1"; + { + caption: "change file1Consumer1 and moduleFile1", + change: sys => { + sys.appendFile(file1Consumer1Path, "export var T2: number;"); + sys.writeFile(moduleFile1Path, `export var T2: number;export function Foo() { };`); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -295,10 +303,10 @@ export var t2 = 10;` ], firstReloadFileList: [libFile.path, "/a/b/file1.ts", "/a/b/file2.ts", configFilePath], changes: [ - sys => { - sys.appendFile("/a/b/file1.ts", "export var t3 = 10;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "change file1"; + { + caption: "change file1", + change: sys => sys.appendFile("/a/b/file1.ts", "export var t3 = 10;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -312,10 +320,10 @@ export var x = Foo();` }], firstReloadFileList: [libFile.path, "/a/b/referenceFile1.ts", moduleFile1Path, configFilePath], changes: [ - sys => { - sys.deleteFile(moduleFile1Path); - sys.checkTimeoutQueueLengthAndRun(1); - return "delete moduleFile1"; + { + caption: "delete moduleFile1", + change: sys => sys.deleteFile(moduleFile1Path), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -329,15 +337,15 @@ export var x = Foo();` }], firstReloadFileList: [libFile.path, "/a/b/referenceFile1.ts", configFilePath], changes: [ - sys => { - sys.appendFile("/a/b/referenceFile1.ts", "export var yy = Foo();"); - sys.checkTimeoutQueueLengthAndRun(1); - return "edit refereceFile1"; + { + caption: "edit refereceFile1", + change: sys => sys.appendFile("/a/b/referenceFile1.ts", "export var yy = Foo();"), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(moduleFile2Path, "export var Foo4 = 10;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "create moduleFile2"; + { + caption: "create moduleFile2", + change: sys => sys.writeFile(moduleFile2Path, "export var Foo4 = 10;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -360,10 +368,10 @@ export var x = Foo();` { newLine } ), changes: [ - sys => { - sys.appendFile("/a/app.ts", newLine + "var z = 3;"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append a line"; + { + caption: "Append a line", + change: sys => sys.appendFile("/a/app.ts", newLine + "var z = 3;"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -398,10 +406,10 @@ export var x = Foo();` return createWatchedSystem([file1, file2, file3, configFile, libFile]); }, changes: [ - sys => { - sys.appendFile("/a/b/f1.ts", "export function foo2() { return 2; }"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append content to f1"; + { + caption: "Append content to f1", + change: sys => sys.appendFile("/a/b/f1.ts", "export function foo2() { return 2; }"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -427,10 +435,10 @@ export var x = Foo();` return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.appendFile("/user/someone/projects/myproject/file3.ts", "function foo2() { return 2; }"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Append content to file3"; + { + caption: "Append content to file3", + change: sys => sys.appendFile("/user/someone/projects/myproject/file3.ts", "function foo2() { return 2; }"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ], }); @@ -457,10 +465,10 @@ export var x = Foo();` return createWatchedSystem(files, { currentDirectory: projectLocation, useCaseSensitiveFileNames: true }); }, changes: [ - sys => { - sys.appendFile("/home/username/project/app/file.ts", "\nvar b = 10;", { invokeFileDeleteCreateAsPartInsteadOfChange: true }); - sys.runQueuedTimeoutCallbacks(); - return "file is deleted and then created to modify content"; + { + caption: "file is deleted and then created to modify content", + change: sys => sys.appendFile("/home/username/project/app/file.ts", "\nvar b = 10;", { invokeFileDeleteCreateAsPartInsteadOfChange: true }), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -496,14 +504,14 @@ export var x = Foo();` return createWatchedSystem([configFile, file1, file2, libFile]); }, changes: [ - sys => { - sys.modifyFile( + { + caption: "Modify typescript file", + change: sys => sys.modifyFile( "/a/rootFolder/project/Scripts/TypeScript.ts", "var zz30 = 100;", { invokeDirectoryWatcherInsteadOfFileChanged: true }, - ); - sys.runQueuedTimeoutCallbacks(); - return "Modify typescript file"; + ), + timeouts: runQueuedTimeoutCallbacks, } ], }); diff --git a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts index 488aa865c88fc..d4da16b41fc2f 100644 --- a/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts +++ b/src/testRunner/unittests/tscWatch/emitAndErrorUpdates.ts @@ -97,10 +97,10 @@ console.log(b.c.d);` subScenario: `deepImportChanges/${subScenario}`, files: () => [aFile, bFile, cFile], changes: [ - sys => { - sys.writeFile(cFile.path, cFile.content.replace("d", "d2")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property d to d2 of class C"; + { + caption: "Rename property d to d2 of class C", + change: sys => sys.writeFile(cFile.path, cFile.content.replace("d", "d2")), + timeouts: runQueuedTimeoutCallbacks, } ], }); @@ -197,10 +197,10 @@ getPoint().c.x;` subScenario: "file not exporting a deep multilevel import that changes", files: () => [aFile, bFile, cFile, dFile, eFile], changes: [ - sys => { - sys.writeFile(aFile.path, aFile.content.replace("x2", "x")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property x2 to x of interface Coords"; + { + caption: "Rename property x2 to x of interface Coords", + change: sys => sys.writeFile(aFile.path, aFile.content.replace("x2", "x")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -260,10 +260,10 @@ export class Data { files: () => [lib1ToolsInterface, lib1ToolsPublic, app, lib2Public, lib1Public, ...files], configFile: () => config, changes: [ - sys => { - sys.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")); - sys.runQueuedTimeoutCallbacks(); - return "Rename property title to title2 of interface ITest"; + { + caption: "Rename property title to title2 of interface ITest", + change: sys => sys.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -303,6 +303,20 @@ export class Data2 { }); describe("with noEmitOnError", () => { + function change(caption: string, content: string): TscWatchCompileChange { + return { + caption, + change: sys => sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, content), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRun + }; + } + const noChange: TscWatchCompileChange = { + caption: "No change", + change: sys => sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`)!), + // build project + timeouts: checkSingleTimeoutQueueLengthAndRun, + }; verifyEmitAndErrorUpdates({ subScenario: "with noEmitOnError", currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError`, @@ -312,29 +326,19 @@ export class Data2 { configFile: () => TestFSWithWatch.getTsBuildProjectFile("noEmitOnError", "tsconfig.json"), changes: [ noChange, - sys => change(sys, "Fix Syntax error", `import { A } from "../shared/types/db"; + change("Fix Syntax error", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' };`), - sys => change(sys, "Semantic Error", `import { A } from "../shared/types/db"; + change("Semantic Error", `import { A } from "../shared/types/db"; const a: string = 10;`), noChange, - sys => change(sys, "Fix Semantic Error", `import { A } from "../shared/types/db"; + change("Fix Semantic Error", `import { A } from "../shared/types/db"; const a: string = "hello";`), noChange, ], baselineIncremental: true }); - function change(sys: WatchedSystem, caption: string, content: string) { - sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, content); - sys.checkTimeoutQueueLengthAndRun(1); // build project - return caption; - } - function noChange(sys: WatchedSystem) { - sys.writeFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`, sys.readFile(`${TestFSWithWatch.tsbuildProjectsLocation}/noEmitOnError/src/main.ts`)!); - sys.checkTimeoutQueueLengthAndRun(1); // build project - return "No change"; - } }); }); } diff --git a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts index cae63450b0860..5d0741eba30ce 100644 --- a/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts +++ b/src/testRunner/unittests/tscWatch/forceConsistentCasingInFileNames.ts @@ -28,10 +28,10 @@ namespace ts.tscWatch { verifyConsistentFileNames({ subScenario: "when changing module name with different casing", changes: [ - sys => { - sys.writeFile(anotherFile.path, anotherFile.content.replace("./logger", "./Logger")); - sys.runQueuedTimeoutCallbacks(); - return "Change module name from logger to Logger"; + { + caption: "Change module name from logger to Logger", + change: sys => sys.writeFile(anotherFile.path, anotherFile.content.replace("./logger", "./Logger")), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -39,10 +39,10 @@ namespace ts.tscWatch { verifyConsistentFileNames({ subScenario: "when renaming file with different casing", changes: [ - sys => { - sys.renameFile(loggerFile.path, `${projectRoot}/Logger.ts`); - sys.runQueuedTimeoutCallbacks(); - return "Change name of file from logger to Logger"; + { + caption: "Change name of file from logger to Logger", + change: sys => sys.renameFile(loggerFile.path, `${projectRoot}/Logger.ts`), + timeouts: runQueuedTimeoutCallbacks, } ] }); diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 9da489529d35c..e0c612963be33 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -270,11 +270,28 @@ namespace ts.tscWatch { return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations, moduleName); } - export type TscWatchCompileChange = ( - sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles, - programs: readonly CommandLineProgram[], - watchOrSolution: ReturnType - ) => string; + export function runQueuedTimeoutCallbacks(sys: WatchedSystem) { + sys.runQueuedTimeoutCallbacks(); + } + + export function checkSingleTimeoutQueueLengthAndRun(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); + } + + export function checkSingleTimeoutQueueLengthAndRunAndVerifyNoTimeout(sys: WatchedSystem) { + sys.checkTimeoutQueueLengthAndRun(1); + sys.checkTimeoutQueueLength(0); + } + + export interface TscWatchCompileChange { + caption: string; + change: (sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles) => void; + timeouts: ( + sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles, + programs: readonly CommandLineProgram[], + watchOrSolution: ReturnType + ) => void; + } export interface TscWatchCheckOptions { baselineSourceMap?: boolean; } @@ -290,10 +307,8 @@ namespace ts.tscWatch { export type SystemSnap = ReturnType; function tscWatchCompile(input: TscWatchCompile) { - it("Generates files matching the baseline", () => { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - fakes.patchHostForBuildInfoReadWrite(input.sys()) - ); + it("tsc-watch:: Generates files matching the baseline", () => { + const { sys, baseline, oldSnap } = createBaseline(input.sys()); const { scenario, subScenario, commandLineArgs, changes, @@ -312,6 +327,8 @@ namespace ts.tscWatch { subScenario, commandLineArgs, sys, + baseline, + oldSnap, getPrograms, baselineSourceMap, changes, @@ -320,31 +337,54 @@ namespace ts.tscWatch { }); } - export interface RunWatchBaseline extends TscWatchCompileBase { + export interface Baseline { + baseline: string[]; + sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; + oldSnap: SystemSnap; + } + + export function createBaseline(system: WatchedSystem): Baseline { + const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( + fakes.patchHostForBuildInfoReadWrite(system) + ); + const baseline: string[] = []; + baseline.push("Input::"); + sys.diff(baseline); + return { sys, baseline, oldSnap: sys.snap() }; + } + + export function applyChange(sys: Baseline["sys"], baseline: Baseline["baseline"], change: TscWatchCompileChange["change"], caption?: TscWatchCompileChange["caption"]) { + const oldSnap = sys.snap(); + baseline.push(`Change::${caption ? " " + caption : ""}`, ""); + change(sys); + baseline.push("Input::"); + sys.diff(baseline, oldSnap); + return sys.snap(); + } + + export interface RunWatchBaseline extends Baseline, TscWatchCompileBase { sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; getPrograms: () => readonly CommandLineProgram[]; watchOrSolution: ReturnType; } export function runWatchBaseline({ scenario, subScenario, commandLineArgs, - getPrograms, sys, + getPrograms, sys, baseline, oldSnap, baselineSourceMap, changes, watchOrSolution }: RunWatchBaseline) { - const baseline: string[] = []; baseline.push(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}`); let programs = watchBaseline({ baseline, getPrograms, sys, - oldSnap: undefined, + oldSnap, baselineSourceMap }); - for (const change of changes) { - const oldSnap = sys.snap(); - const caption = change(sys, programs, watchOrSolution); - baseline.push(`Change:: ${caption}`, ""); + for (const { caption, change, timeouts } of changes) { + oldSnap = applyChange(sys, baseline, change, caption); + timeouts(sys, programs, watchOrSolution); programs = watchBaseline({ baseline, getPrograms, @@ -366,19 +406,16 @@ namespace ts.tscWatch { }); } - export interface WatchBaseline extends TscWatchCheckOptions { - baseline: string[]; - sys: TestFSWithWatch.TestServerHostTrackingWrittenFiles; + export interface WatchBaseline extends Baseline, TscWatchCheckOptions { getPrograms: () => readonly CommandLineProgram[]; - oldSnap: SystemSnap | undefined; } export function watchBaseline({ baseline, getPrograms, sys, oldSnap, baselineSourceMap }: WatchBaseline) { if (baselineSourceMap) generateSourceMapBaselineFiles(sys); - sys.diff(baseline, oldSnap); sys.serializeOutput(baseline); const programs = baselinePrograms(baseline, getPrograms); sys.serializeWatches(baseline); baseline.push(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}`, ""); + sys.diff(baseline, oldSnap); sys.writtenFiles.forEach((value, key) => { assert.equal(value, 1, `Expected to write file ${key} only once`); }); diff --git a/src/testRunner/unittests/tscWatch/incremental.ts b/src/testRunner/unittests/tscWatch/incremental.ts index 34de6c4d7b15d..d8a61636e141b 100644 --- a/src/testRunner/unittests/tscWatch/incremental.ts +++ b/src/testRunner/unittests/tscWatch/incremental.ts @@ -28,26 +28,21 @@ namespace ts.tscWatch { { subScenario, files, optionsToExtend, modifyFs }: VerifyIncrementalWatchEmitInput, incremental: boolean ) { - const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles( - fakes.patchHostForBuildInfoReadWrite(createWatchedSystem(files(), { currentDirectory: project })) - ); + const { sys, baseline, oldSnap } = createBaseline(createWatchedSystem(files(), { currentDirectory: project })); if (incremental) sys.exit = exitCode => sys.exitCode = exitCode; const argsToPass = [incremental ? "-i" : "-w", ...(optionsToExtend || emptyArray)]; - const baseline: string[] = []; baseline.push(`${sys.getExecutingFilePath()} ${argsToPass.join(" ")}`); const { cb, getPrograms } = commandLineCallbacks(sys); - build(/*oldSnap*/ undefined); + build(oldSnap); if (modifyFs) { - const oldSnap = sys.snap(); - modifyFs(sys); - baseline.push(`Change::`, ""); + const oldSnap = applyChange(sys, baseline, modifyFs); build(oldSnap); } Harness.Baseline.runBaseline(`${isBuild(argsToPass) ? "tsbuild/watchMode" : "tscWatch"}/incremental/${subScenario.split(" ").join("-")}-${incremental ? "incremental" : "watch"}.js`, baseline.join("\r\n")); - function build(oldSnap: SystemSnap | undefined) { + function build(oldSnap: SystemSnap) { const closer = executeCommandLine( sys, cb, diff --git a/src/testRunner/unittests/tscWatch/programUpdates.ts b/src/testRunner/unittests/tscWatch/programUpdates.ts index 7e6660805e043..343c8221bf30d 100644 --- a/src/testRunner/unittests/tscWatch/programUpdates.ts +++ b/src/testRunner/unittests/tscWatch/programUpdates.ts @@ -86,10 +86,10 @@ namespace ts.tscWatch { commandLineArgs: ["-w", "-p", configFilePath], sys: () => createWatchedSystem([commonFile1, libFile, configFile]), changes: [ - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "Create commonFile2"; + { + caption: "Create commonFile2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -122,15 +122,15 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.deleteFile(commonFile2.path); - sys.checkTimeoutQueueLengthAndRun(1); - return "delete file2"; + { + caption: "delete file2", + change: sys => sys.deleteFile(commonFile2.path), + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "recreate file2"; + { + caption: "recreate file2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -148,10 +148,10 @@ namespace ts.tscWatch { return createWatchedSystem([file1, libFile]); }, changes: [ - sys => { - sys.writeFile(commonFile2.path, commonFile2.content); - sys.checkTimeoutQueueLengthAndRun(1); - return "create file2"; + { + caption: "create file2", + change: sys => sys.writeFile(commonFile2.path, commonFile2.content), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -171,13 +171,13 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "Change config", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": {}, "files": ["${commonFile1.path}"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change config"; + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -190,20 +190,20 @@ namespace ts.tscWatch { const configFile: File = { path: configFilePath, content: `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }` + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }` }; return createWatchedSystem([libFile, commonFile1, commonFile2, configFile]); }, changes: [ - sys => { - sys.modifyFile(configFilePath, `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config without changing content"; + { + caption: "Modify config without changing content", + change: sys => sys.modifyFile(configFilePath, `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -226,19 +226,19 @@ namespace ts.tscWatch { return createWatchedSystem([libFile, aTs, tsconfig]); }, changes: [ - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Disable allowUnsusedLabels", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { allowUnusedLabels: false } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Disable allowUnsusedLabels"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun }, - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable allowUnsusedLabels", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { allowUnusedLabels: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable allowUnsusedLabels"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -269,19 +269,20 @@ export class A { return createWatchedSystem([libFile, aTs, bTs, tsconfig]); }, changes: [ - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable experimentalDecorators", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable experimentalDecorators"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, + }, - sys => { - sys.modifyFile("/tsconfig.json", JSON.stringify({ + { + caption: "Enable emitDecoratorMetadata", + change: sys => sys.modifyFile("/tsconfig.json", JSON.stringify({ compilerOptions: { target: "es6", importsNotUsedAsValues: "error", experimentalDecorators: true, emitDecoratorMetadata: true } - })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Enable emitDecoratorMetadata"; + })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -336,15 +337,15 @@ export class A { return createWatchedSystem([libFile, file1, nodeModuleFile, classicModuleFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFile.path, `{ + { + caption: "Change module resolution to classic", + change: sys => sys.writeFile(configFile.path, `{ "compilerOptions": { "moduleResolution": "classic" }, "files": ["/a/b/file1.ts"] - }`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change module resolution to classic"; + }`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -389,11 +390,11 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { + { + caption: "Modify f2 to include f3", // now inferred project should inclule file3 - sys.modifyFile("/a/b/f2.ts", `export * from "../c/f3"`); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify f2 to include f3"; + change: sys => sys.modifyFile("/a/b/f2.ts", `export * from "../c/f3"`), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -418,10 +419,10 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.deleteFile("/a/b/f2.ts"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete f2"; + { + caption: "Delete f2", + change: sys => sys.deleteFile("/a/b/f2.ts"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -446,10 +447,10 @@ export class A { return createWatchedSystem([file1, file2, file3, libFile]); }, changes: [ - sys => { - sys.deleteFile("/a/b/f2.ts"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete f2"; + { + caption: "Delete f2", + change: sys => sys.deleteFile("/a/b/f2.ts"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -519,10 +520,10 @@ export class A { return createWatchedSystem([file1, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/f2.ts", "let y = 1"); - sys.checkTimeoutQueueLengthAndRun(1); - return "Write f2"; + { + caption: "Write f2", + change: sys => sys.writeFile("/a/b/f2.ts", "let y = 1"), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -547,10 +548,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config to make f2 as root too"; + { + caption: "Modify config to make f2 as root too", + change: sys => sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -575,10 +576,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] })); - sys.checkTimeoutQueueLengthAndRun(1); - return "Modify config to set outFile option"; + { + caption: "Modify config to set outFile option", + change: sys => sys.writeFile(configFilePath, JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] })), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -599,10 +600,10 @@ export class A { return createWatchedSystem([file1, file2, libFile, configFile]); }, changes: [ - sys => { - sys.deleteFile(configFilePath); - sys.checkTimeoutQueueLengthAndRun(1); - return "Delete config file"; + { + caption: "Delete config file", + change: sys => sys.deleteFile(configFilePath), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -661,8 +662,9 @@ declare const eval: any` return createWatchedSystem([libES5, libES2015Promise, app, config1], { executingFilePath: "/compiler/tsc.js" }); }, changes: [ - sys => { - sys.writeFile("/src/tsconfig.json", JSON.stringify( + { + caption: "Change the lib in config", + change: sys => sys.writeFile("/src/tsconfig.json", JSON.stringify( { compilerOptions: { module: "commonjs", @@ -675,9 +677,8 @@ declare const eval: any` ] } }) - ); - sys.checkTimeoutQueueLengthAndRun(1); - return "Change the lib in config"; + ), + timeouts: checkSingleTimeoutQueueLengthAndRun, } ] }); @@ -706,17 +707,19 @@ declare const eval: any` changes: emptyArray }); - function changeModuleFileToModuleFile1(sys: WatchedSystem) { - sys.renameFile("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); - sys.deleteFile("/a/b/moduleFile.js"); - sys.runQueuedTimeoutCallbacks(); - return "Rename moduleFile to moduleFile1"; - } - function changeModuleFile1ToModuleFile(sys: WatchedSystem) { - sys.renameFile("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"); - sys.runQueuedTimeoutCallbacks(); - return "Rename moduleFile1 back to moduleFile"; - } + const changeModuleFileToModuleFile1: TscWatchCompileChange = { + caption: "Rename moduleFile to moduleFile1", + change: sys => { + sys.renameFile("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); + sys.deleteFile("/a/b/moduleFile.js"); + }, + timeouts: runQueuedTimeoutCallbacks + }; + const changeModuleFile1ToModuleFile: TscWatchCompileChange = { + caption: "Rename moduleFile1 back to moduleFile", + change: sys => sys.renameFile("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"), + timeouts: runQueuedTimeoutCallbacks, + }; verifyTscWatch({ scenario, @@ -797,10 +800,10 @@ declare const eval: any` return createWatchedSystem([file1, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/moduleFile.ts", "export function bar() { }"); - sys.runQueuedTimeoutCallbacks(); - return "Create module file"; + { + caption: "Create module file", + change: sys => sys.writeFile("/a/b/moduleFile.ts", "export function bar() { }"), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -860,22 +863,22 @@ declare const eval: any` return createWatchedSystem([file, configFile, libFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "change config file to add error", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": { "haha": 123 } - }`); - sys.runQueuedTimeoutCallbacks(); - return "change config file to add error"; + }`), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(configFilePath, `{ + { + caption: "change config file to remove error", + change: sys => sys.writeFile(configFilePath, `{ "compilerOptions": { } - }`); - sys.runQueuedTimeoutCallbacks(); - return "change config file to remove error"; + }`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -964,16 +967,16 @@ declare const eval: any` return createWatchedSystem([file, libFile, configFile]); }, changes: [ - sys => { - sys.writeFile(configFilePath, ` + { + caption: "Remove the comment from config file", + change: sys => sys.writeFile(configFilePath, ` { "compilerOptions": { "inlineSourceMap": true, "mapRoot": "./" } -}`); - sys.runQueuedTimeoutCallbacks(); - return "Remove the comment from config file"; +}`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -1046,15 +1049,16 @@ function two() { return createWatchedSystem([file, libFile]); }, changes: [ - sys => { - sys.writeFile("/a/b/file.ts", `function one() {} + { + caption: "Change file to module", + change: sys => sys.writeFile("/a/b/file.ts", `function one() {} export function two() { return function three() { one(); } -}`); - sys.runQueuedTimeoutCallbacks(); - return "Change file to module"; +}`), + timeouts: runQueuedTimeoutCallbacks, + } ] }); @@ -1076,18 +1080,20 @@ export function two() { return createWatchedSystem([file, libFile, configFile]); }, changes: [ - sys => { - sys.renameFile("/home/username/project/src/file1.ts", "/home/username/project/src/file2.ts"); - sys.runQueuedTimeoutCallbacks(); - return "Rename file1 to file2"; + { + caption: "Rename file1 to file2", + change: sys => sys.renameFile("/home/username/project/src/file1.ts", "/home/username/project/src/file2.ts"), + timeouts: runQueuedTimeoutCallbacks, } ] }); - function changeParameterTypeOfBFile(sys: WatchedSystem, parameterName: string, toType: string) { - replaceFileText(sys, `${projectRoot}/b.ts`, new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`); - sys.runQueuedTimeoutCallbacks(); - return `Changed ${parameterName} type to ${toType}`; + function changeParameterTypeOfBFile(parameterName: string, toType: string): TscWatchCompileChange { + return { + caption: `Changed ${parameterName} type to ${toType}`, + change: sys => replaceFileText(sys, `${projectRoot}/b.ts`, new RegExp(`${parameterName}\: [a-z]*`), `${parameterName}: ${toType}`), + timeouts: runQueuedTimeoutCallbacks, + }; } verifyTscWatch({ @@ -1120,10 +1126,10 @@ export default test;` return createWatchedSystem([aFile, bFile, libFile, tsconfigFile], { currentDirectory: projectRoot }); }, changes: [ - sys => changeParameterTypeOfBFile(sys, "x", "string"), - sys => changeParameterTypeOfBFile(sys, "x", "number"), - sys => changeParameterTypeOfBFile(sys, "y", "string"), - sys => changeParameterTypeOfBFile(sys, "y", "number"), + changeParameterTypeOfBFile("x", "string"), + changeParameterTypeOfBFile("x", "number"), + changeParameterTypeOfBFile("y", "string"), + changeParameterTypeOfBFile("y", "number"), ] }); @@ -1144,20 +1150,20 @@ foo().hello` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strictNullChecks: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable strict null checks"; + { + caption: "Enable strict null checks", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strictNullChecks: true } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strict: true, alwaysStrict: false } })); // Avoid changing 'alwaysStrict' or must re-bind - sys.runQueuedTimeoutCallbacks(); - return "Set always strict false"; + { + caption: "Set always strict false", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { strict: true, alwaysStrict: false } })), // Avoid changing 'alwaysStrict' or must re-bind + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: {} })); - sys.runQueuedTimeoutCallbacks(); - return "Disable strict"; + { + caption: "Disable strict", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: {} })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1187,10 +1193,10 @@ v === 'foo';` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noErrorTruncation: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable noErrorTruncation"; + { + caption: "Enable noErrorTruncation", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { noErrorTruncation: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1212,10 +1218,10 @@ class D extends C { prop = 1; }` return createWatchedSystem([aFile, config, libFile]); }, changes: [ - sys => { - sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { target: "es6", useDefineForClassFields: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable useDefineForClassFields"; + { + caption: "Enable useDefineForClassFields", + change: sys => sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { target: "es6", useDefineForClassFields: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1241,20 +1247,20 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, bFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "remove" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "remove"'; + { + caption: 'Set to "remove"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "remove" } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "error" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "error"'; + { + caption: 'Set to "error"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "error" } })), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "preserve" } })); - sys.runQueuedTimeoutCallbacks(); - return 'Set to "preserve"'; + { + caption: 'Set to "preserve"', + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { importsNotUsedAsValues: "preserve" } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1280,10 +1286,10 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, bFile, config, libFile], { useCaseSensitiveFileNames: false }); }, changes: [ - sys => { - sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { forceConsistentCasingInFileNames: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable forceConsistentCasingInFileNames"; + { + caption: "Enable forceConsistentCasingInFileNames", + change: sys => sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { forceConsistentCasingInFileNames: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1308,10 +1314,10 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, jsonFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { moduleResolution: "node", resolveJsonModule: true } })); - sys.runQueuedTimeoutCallbacks(); - return "Enable resolveJsonModule"; + { + caption: "Enable resolveJsonModule", + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, JSON.stringify({ compilerOptions: { moduleResolution: "node", resolveJsonModule: true } })), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1334,18 +1340,18 @@ export function f(p: C) { return p; }` return createWatchedSystem([aFile, config, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { + { + caption: "Create b.ts with same content", // Create bts with same file contents - sys.writeFile(`${projectRoot}/b.ts`, `declare module 'a' { + change: sys => sys.writeFile(`${projectRoot}/b.ts`, `declare module 'a' { type foo = number; -}`); - sys.runQueuedTimeoutCallbacks(); - return "Create b.ts with same content"; +}`), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.deleteFile(`${projectRoot}/b.ts`); - sys.runQueuedTimeoutCallbacks(); - return "Delete b.ts"; + { + caption: "Delete b.ts", + change: sys => sys.deleteFile(`${projectRoot}/b.ts`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1372,15 +1378,15 @@ interface Document { commandLineArgs: ["-w", aFile.path, ...commandLineOptions], sys: () => createWatchedSystem([aFile, libFileWithDocument], { currentDirectory: projectRoot }), changes: [ - sys => { - sys.writeFile(aFile.path, aFile.content.replace(fieldWithoutReadonly, "var x: string;")); - sys.runQueuedTimeoutCallbacks(); - return "Remove document declaration from file"; + { + caption: "Remove document declaration from file", + change: sys => sys.writeFile(aFile.path, aFile.content.replace(fieldWithoutReadonly, "var x: string;")), + timeouts: runQueuedTimeoutCallbacks, }, - sys => { - sys.writeFile(aFile.path, aFile.content); - sys.runQueuedTimeoutCallbacks(); - return "Rever the file to contain document declaration"; + { + caption: "Rever the file to contain document declaration", + change: sys => sys.writeFile(aFile.path, aFile.content), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1413,11 +1419,13 @@ var y: number; }); }); - function changeWhenLibCheckChanges(sys: WatchedSystem, compilerOptions: CompilerOptions) { + function changeWhenLibCheckChanges(compilerOptions: CompilerOptions): TscWatchCompileChange { const configFileContent = JSON.stringify({ compilerOptions }); - sys.writeFile(`${projectRoot}/tsconfig.json`, configFileContent); - sys.runQueuedTimeoutCallbacks(); - return `Changing config to ${configFileContent}`; + return { + caption: `Changing config to ${configFileContent}`, + change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, configFileContent), + timeouts: runQueuedTimeoutCallbacks, + }; } verifyTscWatch({ @@ -1452,12 +1460,12 @@ interface Document { return createWatchedSystem([aFile, bFile, configFile, libFileWithDocument], { currentDirectory: projectRoot }); }, changes: [ - sys => changeWhenLibCheckChanges(sys, { skipLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, { skipDefaultLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, {}), - sys => changeWhenLibCheckChanges(sys, { skipDefaultLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, { skipLibCheck: true }), - sys => changeWhenLibCheckChanges(sys, {}), + changeWhenLibCheckChanges({ skipLibCheck: true }), + changeWhenLibCheckChanges({ skipDefaultLibCheck: true }), + changeWhenLibCheckChanges({}), + changeWhenLibCheckChanges({ skipDefaultLibCheck: true }), + changeWhenLibCheckChanges({ skipLibCheck: true }), + changeWhenLibCheckChanges({}), ] }); @@ -1486,10 +1494,10 @@ const b: string = a;` return createWatchedSystem([aFile, bFile, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/a.ts`, `export const a: number = 1`); - sys.runQueuedTimeoutCallbacks(); - return "Change shape of a"; + { + caption: "Change shape of a", + change: sys => sys.writeFile(`${projectRoot}/a.ts`, `export const a: number = 1`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); @@ -1519,12 +1527,12 @@ const b: string = a;` return createWatchedSystem([aFile, bFile, configFile, libFile], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.writeFile(`${projectRoot}/a.ts`, ` + { + caption: "Make changes to file a", + change: sys => sys.writeFile(`${projectRoot}/a.ts`, ` -import { x } from "../b";`); - sys.runQueuedTimeoutCallbacks(); - return "Make changes to file a"; +import { x } from "../b";`), + timeouts: runQueuedTimeoutCallbacks, }, ] }); diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index f04d481746355..9de81f08410f2 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -185,26 +185,28 @@ namespace ts.tscWatch { content: `import * as fs from "fs";` }, libFile], { currentDirectory: "/a/b" }), changes: [ - sys => { - sys.ensureFileOrFolder({ - path: "/a/b/node_modules/@types/node/package.json", - content: ` + { + caption: "npm install node types", + change: sys => { + sys.ensureFileOrFolder({ + path: "/a/b/node_modules/@types/node/package.json", + content: ` { "main": "" } ` - }); - sys.ensureFileOrFolder({ - path: "/a/b/node_modules/@types/node/index.d.ts", - content: ` + }); + sys.ensureFileOrFolder({ + path: "/a/b/node_modules/@types/node/index.d.ts", + content: ` declare module "fs" { export interface Stats { isFile(): boolean; } }` - }); - sys.runQueuedTimeoutCallbacks(); - return "npm install node types"; + }); + }, + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -235,16 +237,16 @@ declare module "url" { return createWatchedSystem([root, file, libFile], { currentDirectory: "/a/b" }); }, changes: [ - sys => { - sys.appendFile("/a/b/bar.d.ts", ` + { + caption: "Add fs definition", + change: sys => sys.appendFile("/a/b/bar.d.ts", ` declare module "fs" { export interface Stats { isFile(): boolean; } } -`); - sys.runQueuedTimeoutCallbacks(); - return "Add fs definition"; +`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -282,10 +284,10 @@ declare module "fs" { return createWatchedSystem([file1, file2, module1, libFile, configFile], { currentDirectory: "/a/b/projects/myProject/" }); }, changes: [ - sys => { - sys.appendFile("/a/b/projects/myProject/src/file1.ts", "\n;"); - sys.runQueuedTimeoutCallbacks(); - return "Add new line to file1"; + { + caption: "Add new line to file1", + change: sys => sys.appendFile("/a/b/projects/myProject/src/file1.ts", "\n;"), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -306,10 +308,10 @@ declare module "fs" { return createWatchedSystem([file, libFile, module], { currentDirectory: projectRoot }); }, changes: [ - sys => { - sys.renameFolder(`${projectRoot}/node_modules2`, `${projectRoot}/node_modules`); - sys.runQueuedTimeoutCallbacks(); - return "npm install"; + { + caption: "npm install", + change: sys => sys.renameFolder(`${projectRoot}/node_modules2`, `${projectRoot}/node_modules`), + timeouts: runQueuedTimeoutCallbacks, } ] }); @@ -336,14 +338,13 @@ declare module "fs" { return createWatchedSystem([libFile, file1, file2, config]); }, changes: [ - sys => { - const npmCacheFile: File = { + { + caption: "npm install file and folder that start with '.'", + change: sys => sys.ensureFileOrFolder({ path: `${projectRoot}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, content: JSON.stringify({ something: 10 }) - }; - sys.ensureFileOrFolder(npmCacheFile); - sys.checkTimeoutQueueLength(0); - return "npm install file and folder that start with '.'"; + }), + timeouts: sys => sys.checkTimeoutQueueLength(0), } ] }); @@ -373,30 +374,35 @@ declare module "fs" { return createWatchedSystem([app, tsconfig, libFile]); }, changes: [ - sys => { - sys.ensureFileOrFolder({ - path: `${projectRoot}/node_modules/@myapp/ts-types/package.json`, - content: JSON.stringify({ - version: "1.65.1", - types: "types/somefile.define.d.ts" - }) - }); - sys.ensureFileOrFolder({ - path: `${projectRoot}/node_modules/@myapp/ts-types/types/somefile.define.d.ts`, - content: ` + { + caption: "npm install ts-types", + change: sys => { + sys.ensureFileOrFolder({ + path: `${projectRoot}/node_modules/@myapp/ts-types/package.json`, + content: JSON.stringify({ + version: "1.65.1", + types: "types/somefile.define.d.ts" + }) + }); + sys.ensureFileOrFolder({ + path: `${projectRoot}/node_modules/@myapp/ts-types/types/somefile.define.d.ts`, + content: ` declare namespace myapp { function component(str: string): number; }` - }); - sys.checkTimeoutQueueLengthAndRun(1); - return "npm install ts-types"; + }); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - (sys, [[oldProgram, oldBuilderProgram]], watchorSolution) => { - sys.checkTimeoutQueueLength(0); - const newProgram = (watchorSolution as Watch).getProgram(); - assert.strictEqual(newProgram, oldBuilderProgram, "No change so builder program should be same"); - assert.strictEqual(newProgram.getProgram(), oldProgram, "No change so program should be same"); - return "No change, just check program"; + { + caption: "No change, just check program", + change: noop, + timeouts: (sys, [[oldProgram, oldBuilderProgram]], watchorSolution) => { + sys.checkTimeoutQueueLength(0); + const newProgram = (watchorSolution as Watch).getProgram(); + assert.strictEqual(newProgram, oldBuilderProgram, "No change so builder program should be same"); + assert.strictEqual(newProgram.getProgram(), oldProgram, "No change so program should be same"); + } } ] }); diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index 3df1e2f4aea94..3e61757125387 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -17,43 +17,51 @@ namespace ts.tscWatch { return createWatchedSystem([file1, libFile], { environmentVariables }); }, changes: [ - (sys, programs) => { - const initialProgram = programs[0][0]; - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - for (let index = 0; index < mediumPollingIntervalThreshold; index++) { - // Transition libFile and file1 to low priority queue - sys.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(programs[0][0], initialProgram); - } - return "Time spent to Transition libFile and file1 to low priority queue"; + { + caption: "Time spent to Transition libFile and file1 to low priority queue", + change: noop, + timeouts: (sys, programs) => { + const initialProgram = programs[0][0]; + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + for (let index = 0; index < mediumPollingIntervalThreshold; index++) { + // Transition libFile and file1 to low priority queue + sys.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(programs[0][0], initialProgram); + } + return; + }, }, - sys => { + { + caption: "Make change to file", // Make a change to file - sys.writeFile("/a/username/project/typescript.ts", "var zz30 = 100;"); - + change: sys => sys.writeFile("/a/username/project/typescript.ts", "var zz30 = 100;"), // During this timeout the file would be detected as unchanged - sys.checkTimeoutQueueLengthAndRun(1); - return "Make change to file"; + timeouts: checkSingleTimeoutQueueLengthAndRun, }, - sys => { + { + caption: "Callbacks: medium priority + high priority queue and scheduled program update", + change: noop, // Callbacks: medium priority + high priority queue and scheduled program update - sys.checkTimeoutQueueLengthAndRun(3); // This should detect change in the file - return "Callbacks: medium priority + high priority queue and scheduled program update"; + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(3), }, - (sys, programs) => { - const initialProgram = programs[0][0]; - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; - for (let fileUnchangeDetected = 1; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { - // For high + Medium/low polling interval - sys.checkTimeoutQueueLengthAndRun(2); - assert.deepEqual(programs[0][0], initialProgram); - } + { + caption: "Polling queues polled and everything is in the high polling queue", + change: noop, + timeouts: (sys, programs) => { + const initialProgram = programs[0][0]; + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; + for (let fileUnchangeDetected = 1; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { + // For high + Medium/low polling interval + sys.checkTimeoutQueueLengthAndRun(2); + assert.deepEqual(programs[0][0], initialProgram); + } - // Everything goes in high polling interval queue - sys.checkTimeoutQueueLengthAndRun(1); - return "Polling queues polled and everything is in the high polling queue"; + // Everything goes in high polling interval queue + sys.checkTimeoutQueueLengthAndRun(1); + return; + }, } ] }); @@ -85,16 +93,19 @@ namespace ts.tscWatch { return createWatchedSystem(files, { environmentVariables }); }, changes: [ - sys => { + { + caption: "Rename file1 to file2", // Rename the file: - sys.renameFile(file.path, file.path.replace("file1.ts", "file2.ts")); - if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { - // With dynamic polling the fs change would be detected only by running timeouts + change: sys => sys.renameFile(file.path, file.path.replace("file1.ts", "file2.ts")), + timeouts: sys => { + if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { + // With dynamic polling the fs change would be detected only by running timeouts + sys.runQueuedTimeoutCallbacks(); + } + // Delayed update program sys.runQueuedTimeoutCallbacks(); - } - // Delayed update program - sys.runQueuedTimeoutCallbacks(); - return "Rename file1 to file2"; + return; + }, }, ], }); @@ -173,51 +184,65 @@ namespace ts.tscWatch { return createWatchedSystem(files, { runWithoutRecursiveWatches: true }); }, changes: [ - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // To update directory callbacks for file1.js output - sys.checkTimeoutQueueLengthAndRun(1); // Update program again - sys.checkTimeoutQueueLength(0); - return "Pending updates because of file1.js creation"; + { + caption: "Pending updates because of file1.js creation", + change: noop, + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // To update directory callbacks for file1.js output + sys.checkTimeoutQueueLengthAndRun(1); // Update program again + sys.checkTimeoutQueueLength(0); + }, }, - sys => { + { + caption: "Remove directory node_modules", // Remove directory node_modules - sys.deleteFolder(`${projectRoot}/node_modules`, /*recursive*/ true); - sys.checkTimeoutQueueLength(2); // 1. For updating program and 2. for updating child watches - sys.runQueuedTimeoutCallbacks(sys.getNextTimeoutId() - 2); // Update program - return "Remove directory node_modules"; + change: sys => sys.deleteFolder(`${projectRoot}/node_modules`, /*recursive*/ true), + timeouts: sys => { + sys.checkTimeoutQueueLength(2); // 1. For updating program and 2. for updating child watches + sys.runQueuedTimeoutCallbacks(sys.getNextTimeoutId() - 2); // Update program + }, }, - sys => { - sys.checkTimeoutQueueLengthAndRun(1); // To update directory watchers - sys.checkTimeoutQueueLengthAndRun(1); // To Update program - sys.checkTimeoutQueueLength(0); - return "Pending directory watchers and program update"; + { + caption: "Pending directory watchers and program update", + change: noop, + timeouts: sys => { + sys.checkTimeoutQueueLengthAndRun(1); // To update directory watchers + sys.checkTimeoutQueueLengthAndRun(1); // To Update program + sys.checkTimeoutQueueLength(0); + }, }, - sys => { + { + caption: "Start npm install", // npm install - sys.createDirectory(`${projectRoot}/node_modules`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "Start npm install"; + change: sys => sys.createDirectory(`${projectRoot}/node_modules`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure + }, + { + caption: "npm install folder creation of file2", + change: sys => sys.createDirectory(`${projectRoot}/node_modules/file2`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure }, - sys => { - sys.createDirectory(`${projectRoot}/node_modules/file2`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "npm install folder creation of file2"; + { + caption: "npm install index file in file2", + change: sys => sys.writeFile(`${projectRoot}/node_modules/file2/index.d.ts`, `export const x = 10;`), + timeouts: sys => sys.checkTimeoutQueueLength(1), // To update folder structure }, - sys => { - sys.writeFile(`${projectRoot}/node_modules/file2/index.d.ts`, `export const x = 10;`); - sys.checkTimeoutQueueLength(1); // To update folder structure - return "npm install index file in file2"; + { + caption: "Updates the program", + change: noop, + timeouts: sys => { + sys.runQueuedTimeoutCallbacks(); + sys.checkTimeoutQueueLength(1); // To Update the program + }, }, - sys => { - sys.runQueuedTimeoutCallbacks(); - sys.checkTimeoutQueueLength(1); // To Update the program - return "Updates the program"; + { + caption: "Pending updates", + change: noop, + timeouts: sys => { + sys.runQueuedTimeoutCallbacks(); + sys.checkTimeoutQueueLength(0); + }, }, - sys => { - sys.runQueuedTimeoutCallbacks(); - sys.checkTimeoutQueueLength(0); - return "Pending updates"; - } ], }); }); diff --git a/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js index 3503ac50610c1..b97c1cad60c6c 100644 --- a/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/watchMode/configFileErrors/reports-syntax-errors-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --b -w +Input:: //// [/user/username/projects/myproject/a.ts] export function foo() { } @@ -30,6 +30,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js --b -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -68,8 +69,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports syntax errors after change to config file +Input:: //// [/user/username/projects/myproject/tsconfig.json] { "compilerOptions": { @@ -121,8 +124,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports syntax errors after change to ts file +Input:: //// [/user/username/projects/myproject/a.ts] export function fooBar() { } @@ -165,8 +170,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: reports error when there is no change to tsconfig file +Input:: //// [/user/username/projects/myproject/tsconfig.json] file written with same contents Output:: @@ -207,11 +214,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: builds after fixing config file errors +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"composite":true,"declaration":true},"files":["a.ts","b.ts"]} + +Output:: +>> Screen clear +[12:00:43 AM] File change detected. Starting incremental compilation... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/a.js] "use strict"; exports.__esModule = true; @@ -273,38 +318,3 @@ export declare function bar(): void; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js index f598c1b8cc8a1..a22633150842a 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-bad-reference.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -143,6 +143,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:46 AM] Starting compilation in watch mode... @@ -267,8 +268,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Prepend a line +Input:: //// [/user/username/projects/demo/core/utilities.ts] import * as A from '../animals'; @@ -385,3 +388,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js index fff5bf9d47fab..fb9c967dde619 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -147,6 +147,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:46 AM] Starting compilation in watch mode... @@ -201,8 +202,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error +Input:: //// [/user/username/projects/demo/core/tsconfig.json] { "extends": "../tsconfig-base.json", @@ -212,6 +215,108 @@ Change:: Fix error } } + +Output:: +>> Screen clear +[12:00:52 AM] File change detected. Starting incremental compilation... + + +[12:00:53 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist + + +[12:00:54 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... + + +[12:01:06 AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/animal.js' does not exist + + +[12:01:07 AM] Building project '/user/username/projects/demo/animals/tsconfig.json'... + + +[12:01:25 AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/zoo.js' does not exist + + +[12:01:26 AM] Building project '/user/username/projects/demo/zoo/tsconfig.json'... + + +[12:01:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/demo/core/utilities.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/core/utilities.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/core/utilities.ts + +Program root files: ["/user/username/projects/demo/animals/animal.ts","/user/username/projects/demo/animals/dog.ts","/user/username/projects/demo/animals/index.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/animals","rootDir":"/user/username/projects/demo/animals","watch":true,"configFilePath":"/user/username/projects/demo/animals/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/animals/animal.ts +/user/username/projects/demo/animals/index.ts +/user/username/projects/demo/lib/core/utilities.d.ts +/user/username/projects/demo/animals/dog.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/animals/animal.ts +/user/username/projects/demo/animals/index.ts +/user/username/projects/demo/lib/core/utilities.d.ts +/user/username/projects/demo/animals/dog.ts + +Program root files: ["/user/username/projects/demo/zoo/zoo.ts"] +Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/zoo","rootDir":"/user/username/projects/demo/zoo","watch":true,"configFilePath":"/user/username/projects/demo/zoo/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/demo/lib/animals/animal.d.ts +/user/username/projects/demo/lib/animals/dog.d.ts +/user/username/projects/demo/lib/animals/index.d.ts +/user/username/projects/demo/zoo/zoo.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/demo/lib/animals/animal.d.ts +/user/username/projects/demo/lib/animals/dog.d.ts +/user/username/projects/demo/lib/animals/index.d.ts +/user/username/projects/demo/zoo/zoo.ts + +WatchedFiles:: +/user/username/projects/demo/animals/tsconfig.json: + {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/animals/animal.ts: + {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250} +/user/username/projects/demo/animals/dog.ts: + {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250} +/user/username/projects/demo/animals/index.ts: + {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250} +/user/username/projects/demo/zoo/tsconfig.json: + {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/zoo/zoo.ts: + {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250} +/user/username/projects/demo/core/tsconfig.json: + {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250} +/user/username/projects/demo/core/utilities.ts: + {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250} +/user/username/projects/demo/tsconfig.json: + {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/demo/animals: + {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/demo/zoo: + {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/demo/core: + {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/demo/lib/core/utilities.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -500,104 +605,3 @@ export declare function createZoo(): Array; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:52 AM] File change detected. Starting incremental compilation... - - -[12:00:53 AM] Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist - - -[12:00:54 AM] Building project '/user/username/projects/demo/core/tsconfig.json'... - - -[12:01:06 AM] Project 'animals/tsconfig.json' is out of date because output file 'lib/animals/animal.js' does not exist - - -[12:01:07 AM] Building project '/user/username/projects/demo/animals/tsconfig.json'... - - -[12:01:25 AM] Project 'zoo/tsconfig.json' is out of date because output file 'lib/zoo/zoo.js' does not exist - - -[12:01:26 AM] Building project '/user/username/projects/demo/zoo/tsconfig.json'... - - -[12:01:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/demo/core/utilities.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/core/utilities.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/core/utilities.ts - -Program root files: ["/user/username/projects/demo/animals/animal.ts","/user/username/projects/demo/animals/dog.ts","/user/username/projects/demo/animals/index.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/animals","rootDir":"/user/username/projects/demo/animals","watch":true,"configFilePath":"/user/username/projects/demo/animals/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/animals/animal.ts -/user/username/projects/demo/animals/index.ts -/user/username/projects/demo/lib/core/utilities.d.ts -/user/username/projects/demo/animals/dog.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/animals/animal.ts -/user/username/projects/demo/animals/index.ts -/user/username/projects/demo/lib/core/utilities.d.ts -/user/username/projects/demo/animals/dog.ts - -Program root files: ["/user/username/projects/demo/zoo/zoo.ts"] -Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/zoo","rootDir":"/user/username/projects/demo/zoo","watch":true,"configFilePath":"/user/username/projects/demo/zoo/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/demo/lib/animals/animal.d.ts -/user/username/projects/demo/lib/animals/dog.d.ts -/user/username/projects/demo/lib/animals/index.d.ts -/user/username/projects/demo/zoo/zoo.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/demo/lib/animals/animal.d.ts -/user/username/projects/demo/lib/animals/dog.d.ts -/user/username/projects/demo/lib/animals/index.d.ts -/user/username/projects/demo/zoo/zoo.ts - -WatchedFiles:: -/user/username/projects/demo/animals/tsconfig.json: - {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/animals/animal.ts: - {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250} -/user/username/projects/demo/animals/dog.ts: - {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250} -/user/username/projects/demo/animals/index.ts: - {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250} -/user/username/projects/demo/zoo/tsconfig.json: - {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/zoo/zoo.ts: - {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250} -/user/username/projects/demo/core/tsconfig.json: - {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250} -/user/username/projects/demo/core/utilities.ts: - {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250} -/user/username/projects/demo/tsconfig.json: - {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/demo/animals: - {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/demo/zoo: - {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/demo/core: - {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js index b74b840cbba6f..49d3e41dac119 100644 --- a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose --incremental +Input:: //// [/user/username/projects/noEmitOnError/tsconfig.json] { "compilerOptions": { @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -97,8 +98,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -155,14 +158,64 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:46 AM] File change detected. Starting incremental compilation... + + +[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + + +[12:01:07 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -231,18 +284,32 @@ console.log("hi"); } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:46 AM] File change detected. Starting incremental compilation... +[12:01:11 AM] File change detected. Starting incremental compilation... -[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist +[12:01:12 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:13 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:07 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:14 AM] Found 1 error. Watching for file changes. @@ -255,10 +322,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts /user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -278,22 +342,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:11 AM] File change detected. Starting incremental compilation... +[12:01:18 AM] File change detected. Starting incremental compilation... -[12:01:12 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' +[12:01:19 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:01:13 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:20 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -302,7 +365,7 @@ Output::    ~ -[12:01:14 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 1 error. Watching for file changes. @@ -315,7 +378,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -335,28 +397,30 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... +[12:01:25 AM] File change detected. Starting incremental compilation... -[12:01:19 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' +[12:01:26 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' -[12:01:20 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... +[12:01:27 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:35 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... -[12:01:21 AM] Found 1 error. Watching for file changes. +[12:01:36 AM] Found 0 errors. Watching for file changes. @@ -369,6 +433,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -388,12 +453,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; @@ -451,60 +510,10 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... - - -[12:01:26 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts' - - -[12:01:27 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... - - -[12:01:35 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... - - -[12:01:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time Output:: >> Screen clear @@ -551,3 +560,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js index c598b9182d532..3f9230a5b4505 100644 --- a/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuild/watchMode/noEmitOnError/does-not-emit-any-files-on-error.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose +Input:: //// [/user/username/projects/noEmitOnError/tsconfig.json] { "compilerOptions": { @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js -b -w -verbose Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -97,8 +98,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -155,33 +158,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - Output:: >> Screen clear @@ -230,8 +216,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -287,8 +294,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -340,20 +349,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time Output:: >> Screen clear @@ -402,12 +405,19 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time Output:: >> Screen clear @@ -454,3 +464,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js index 5fd42a03d2b1e..cd80c65f8063e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/creates-solution-in-watch-mode.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -335,80 +414,3 @@ export declare const m: typeof mod; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js index e6d02561f46e7..a3e8d46335c00 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/incremental-updates-in-verbose-mode.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests -verbose +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,109 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests -verbose +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:00:46 AM] Projects in this build: + * sample1/core/tsconfig.json + * sample1/logic/tsconfig.json + * sample1/tests/tsconfig.json + + +[12:00:47 AM] Project 'sample1/core/tsconfig.json' is out of date because output file 'sample1/core/anotherModule.js' does not exist + + +[12:00:48 AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... + + +[12:01:03 AM] Project 'sample1/logic/tsconfig.json' is out of date because output file 'sample1/logic/index.js' does not exist + + +[12:01:04 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... + + +[12:01:13 AM] Project 'sample1/tests/tsconfig.json' is out of date because output file 'sample1/tests/index.js' does not exist + + +[12:01:14 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... + + +[12:01:21 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,51 +439,41 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - +Change:: Make non dts change -[12:00:46 AM] Projects in this build: - * sample1/core/tsconfig.json - * sample1/logic/tsconfig.json - * sample1/tests/tsconfig.json +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; +function someFn() { } -[12:00:47 AM] Project 'sample1/core/tsconfig.json' is out of date because output file 'sample1/core/anotherModule.js' does not exist - -[12:00:48 AM] Building project '/user/username/projects/sample1/core/tsconfig.json'... +Output:: +>> Screen clear +[12:01:25 AM] File change detected. Starting incremental compilation... -[12:01:03 AM] Project 'sample1/logic/tsconfig.json' is out of date because output file 'sample1/logic/index.js' does not exist +[12:01:26 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' -[12:01:04 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[12:01:27 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... -[12:01:13 AM] Project 'sample1/tests/tsconfig.json' is out of date because output file 'sample1/tests/index.js' does not exist +[12:01:40 AM] Project 'sample1/tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:01:14 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... +[12:01:42 AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:43 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: @@ -390,27 +483,8 @@ Program files:: /user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts /user/username/projects/sample1/logic/index.ts -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -437,18 +511,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make non dts change - -//// [/user/username/projects/sample1/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.multiply(10, 15); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - -function someFn() { } - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AAErB,SAAS,MAAM,KAAK,CAAC"} @@ -526,24 +588,38 @@ function someFn() { } //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Make dts change + +Input:: +//// [/user/username/projects/sample1/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + +export function someFn() { } + + Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:47 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' +[12:01:48 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' -[12:01:27 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... +[12:01:49 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... -[12:01:40 AM] Project 'sample1/tests/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:02:02 AM] Project 'sample1/tests/tsconfig.json' is out of date because oldest output 'sample1/tests/index.js' is older than newest input 'sample1/logic/tsconfig.json' -[12:01:42 AM] Updating output timestamps of project '/user/username/projects/sample1/tests/tsconfig.json'... +[12:02:03 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... -[12:01:43 AM] Found 0 errors. Watching for file changes. +[12:02:13 AM] Found 0 errors. Watching for file changes. @@ -558,6 +634,19 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/logic/index.ts +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -584,18 +673,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make dts change - -//// [/user/username/projects/sample1/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.multiply(10, 15); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - -export function someFn() { } - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC;AAErB,SAAgB,MAAM,KAAK,CAAC;AAA5B,wBAA4B"} @@ -745,74 +822,3 @@ export declare function someFn(): void; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:01:47 AM] File change detected. Starting incremental compilation... - - -[12:01:48 AM] Project 'sample1/logic/tsconfig.json' is out of date because oldest output 'sample1/logic/index.js' is older than newest input 'sample1/core' - - -[12:01:49 AM] Building project '/user/username/projects/sample1/logic/tsconfig.json'... - - -[12:02:02 AM] Project 'sample1/tests/tsconfig.json' is out of date because oldest output 'sample1/tests/index.js' is older than newest input 'sample1/logic/tsconfig.json' - - -[12:02:03 AM] Building project '/user/username/projects/sample1/tests/tsconfig.json'... - - -[12:02:13 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js index d66ab70fb50b8..c2315cd4bfe5d 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,45 @@ export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] {"compilerOptions":{"composite":true}} + +/a/lib/tsc.js -b -w app +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -98,45 +137,9 @@ export declare class myClass { } -Output:: ->> Screen clear -[12:00:25 AM] Starting compilation in watch mode... - - -[12:00:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Introduce error +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } @@ -185,8 +188,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change fileWithoutError +Input:: //// [/user/username/projects/solution/app/fileWithoutError.ts] export class myClass2 { } @@ -231,3 +236,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js index 223193c538321..23ac559509ecf 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,45 @@ export class myClass { } //// [/user/username/projects/solution/app/tsconfig.json] {"compilerOptions":{"composite":true}} + +/a/lib/tsc.js -b -w app +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:36 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -98,45 +137,9 @@ export declare class myClass { } -Output:: ->> Screen clear -[12:00:25 AM] Starting compilation in watch mode... - - -[12:00:36 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Introduce error +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } @@ -185,19 +188,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error in fileWithError +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } }; -//// [/user/username/projects/solution/app/fileWithError.js] file written with same contents -//// [/user/username/projects/solution/app/fileWithError.d.ts] file written with same contents -//// [/user/username/projects/solution/app/fileWithoutError.js] file changed its modified time -//// [/user/username/projects/solution/app/fileWithoutError.d.ts] file changed its modified time -//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] file written with same contents Output:: >> Screen clear @@ -233,3 +233,9 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/solution/app/fileWithError.js] file written with same contents +//// [/user/username/projects/solution/app/fileWithError.d.ts] file written with same contents +//// [/user/username/projects/solution/app/fileWithoutError.js] file changed its modified time +//// [/user/username/projects/solution/app/fileWithoutError.d.ts] file changed its modified time +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] file written with same contents diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js index c160065ad043b..a8ad89b91a7de 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,6 +25,7 @@ export class myClass { } {"compilerOptions":{"composite":true}} +/a/lib/tsc.js -b -w app Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -68,8 +69,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change fileWithoutError +Input:: //// [/user/username/projects/solution/app/fileWithoutError.ts] export class myClass2 { } @@ -114,3 +117,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js index 84345785f33a5..4b4808833f4a3 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w app +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,6 +25,7 @@ export class myClass { } {"compilerOptions":{"composite":true}} +/a/lib/tsc.js -b -w app Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -68,14 +69,52 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix error in fileWithError +Input:: //// [/user/username/projects/solution/app/fileWithError.ts] export var myClassWithError = class { tags() { } }; + +Output:: +>> Screen clear +[12:00:30 AM] File change detected. Starting incremental compilation... + + +[12:00:41 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/solution/app/fileWithError.ts +/user/username/projects/solution/app/fileWithoutError.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/solution/app/fileWithError.ts + +WatchedFiles:: +/user/username/projects/solution/app/tsconfig.json: + {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} +/user/username/projects/solution/app/filewitherror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} +/user/username/projects/solution/app/filewithouterror.ts: + {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/solution/app: + {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/solution/app/fileWithError.js] "use strict"; exports.__esModule = true; @@ -149,38 +188,3 @@ export declare class myClass { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:30 AM] File change detected. Starting incremental compilation... - - -[12:00:41 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/solution/app/fileWithError.ts","/user/username/projects/solution/app/fileWithoutError.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/solution/app/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/solution/app/fileWithError.ts -/user/username/projects/solution/app/fileWithoutError.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/solution/app/fileWithError.ts - -WatchedFiles:: -/user/username/projects/solution/app/tsconfig.json: - {"fileName":"/user/username/projects/solution/app/tsconfig.json","pollingInterval":250} -/user/username/projects/solution/app/filewitherror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithError.ts","pollingInterval":250} -/user/username/projects/solution/app/filewithouterror.ts: - {"fileName":"/user/username/projects/solution/app/fileWithoutError.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/solution/app: - {"directoryName":"/user/username/projects/solution/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js index c4cf7aea6bdc4..bc2e4ee3c41c9 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,85 +415,9 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: change logic +Input:: //// [/user/username/projects/sample1/logic/index.ts] import * as c from '../core/index'; export function getSecondsInDay() { @@ -478,8 +481,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change core +Input:: //// [/user/username/projects/sample1/core/index.ts] export const someString: string = "HELLO WORLD"; export function leftPad(s: string, n: number) { return s + n; } @@ -544,3 +549,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js index f836aad9bfcf8..093a9c384ccd0 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests --preserveWatchOutput +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,84 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests --preserveWatchOutput +Output:: +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -339,84 +417,9 @@ export declare const m: typeof mod; } -Output:: -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: change logic +Input:: //// [/user/username/projects/sample1/logic/index.ts] import * as c from '../core/index'; export function getSecondsInDay() { @@ -479,8 +482,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change core +Input:: //// [/user/username/projects/sample1/core/index.ts] export const someString: string = "HELLO WORLD"; export function leftPad(s: string, n: number) { return s + n; } @@ -544,3 +549,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js index e14efa913b00a..eec0beb497d5e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/watches-config-files-that-are-not-present.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -67,6 +67,54 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +error TS5083: Cannot read file '/user/username/projects/sample1/logic/tsconfig.json'. + + +[12:00:52 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -141,29 +189,44 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - +Change:: Write logic tsconfig and build logic -error TS5083: Cannot read file '/user/username/projects/sample1/logic/tsconfig.json'. - +Input:: +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} -[12:00:52 AM] Found 1 error. Watching for file changes. + + +Output:: +>> Screen clear +[12:00:55 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -178,32 +241,19 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} FsWatches:: FsWatchesRecursive:: /user/username/projects/sample1/core: {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined -Change:: Write logic tsconfig and build logic - -//// [/user/username/projects/sample1/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -282,25 +332,30 @@ export declare const m: typeof mod; } +Change:: Build Tests + +Input:: + Output:: ->> Screen clear -[12:00:55 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -328,8 +383,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build tests - //// [/user/username/projects/sample1/tests/index.js] "use strict"; exports.__esModule = true; @@ -414,50 +467,3 @@ export declare const m: typeof mod; "version": "FakeTSVersion" } - -Output:: -[12:01:10 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index c565eae22341d..62fc2cb496bc0 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w App +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -36,6 +36,59 @@ createSomeObject().message; //// [/user/username/projects/sample1/App/tsconfig.json] {"references":[{"path":"../Library"}]} + +/a/lib/tsc.js -b -w App +Output:: +>> Screen clear +[12:00:29 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/Library/library.ts"] +Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/sample1/Library/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.ts + +Program root files: ["/user/username/projects/sample1/App/app.ts"] +Program options: {"watch":true,"configFilePath":"/user/username/projects/sample1/App/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.d.ts +/user/username/projects/sample1/App/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/Library/library.d.ts +/user/username/projects/sample1/App/app.ts + +WatchedFiles:: +/user/username/projects/sample1/library/tsconfig.json: + {"fileName":"/user/username/projects/sample1/Library/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/library/library.ts: + {"fileName":"/user/username/projects/sample1/Library/library.ts","pollingInterval":250} +/user/username/projects/sample1/app/tsconfig.json: + {"fileName":"/user/username/projects/sample1/App/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/app/app.ts: + {"fileName":"/user/username/projects/sample1/App/app.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/library: + {"directoryName":"/user/username/projects/sample1/library","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/app: + {"directoryName":"/user/username/projects/sample1/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -94,12 +147,41 @@ library_1.createSomeObject().message; +Change:: Introduce error + +Input:: +//// [/user/username/projects/sample1/Library/library.ts] + +interface SomeObject +{ + message2: string; +} + +export function createSomeObject(): SomeObject +{ + return { + message2: "new Object" + }; +} + + Output:: >> Screen clear -[12:00:29 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? + +2 createSomeObject().message; +   ~~~~~~~ + + Library/library.d.ts:2:5 + 2 message2: string; +    ~~~~~~~~ + 'message2' is declared here. + + +[12:00:52 AM] Found 1 error. Watching for file changes. @@ -110,7 +192,6 @@ Program files:: /user/username/projects/sample1/Library/library.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/sample1/Library/library.ts Program root files: ["/user/username/projects/sample1/App/app.ts"] @@ -121,7 +202,6 @@ Program files:: /user/username/projects/sample1/App/app.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/sample1/Library/library.d.ts /user/username/projects/sample1/App/app.ts @@ -145,22 +225,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Introduce error - -//// [/user/username/projects/sample1/Library/library.ts] - -interface SomeObject -{ - message2: string; -} - -export function createSomeObject(): SomeObject -{ - return { - message2: "new Object" - }; -} - //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -212,23 +276,30 @@ export {}; } -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - +Change:: Fix error -App/app.ts:2:20 - error TS2551: Property 'message' does not exist on type 'SomeObject'. Did you mean 'message2'? +Input:: +//// [/user/username/projects/sample1/Library/library.ts] -2 createSomeObject().message; -   ~~~~~~~ +interface SomeObject +{ + message: string; +} - Library/library.d.ts:2:5 - 2 message2: string; -    ~~~~~~~~ - 'message2' is declared here. +export function createSomeObject(): SomeObject +{ + return { + message: "new Object" + }; +} + + +Output:: +>> Screen clear +[12:00:56 AM] File change detected. Starting incremental compilation... -[12:00:52 AM] Found 1 error. Watching for file changes. +[12:01:09 AM] Found 0 errors. Watching for file changes. @@ -272,22 +343,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error - -//// [/user/username/projects/sample1/Library/library.ts] - -interface SomeObject -{ - message: string; -} - -export function createSomeObject(): SomeObject -{ - return { - message: "new Object" - }; -} - //// [/user/username/projects/sample1/Library/library.js] "use strict"; exports.__esModule = true; @@ -339,52 +394,3 @@ export {}; } //// [/user/username/projects/sample1/App/app.js] file written with same contents - -Output:: ->> Screen clear -[12:00:56 AM] File change detected. Starting incremental compilation... - - -[12:01:09 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/Library/library.ts"] -Program options: {"composite":true,"watch":true,"configFilePath":"/user/username/projects/sample1/Library/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/Library/library.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/Library/library.ts - -Program root files: ["/user/username/projects/sample1/App/app.ts"] -Program options: {"watch":true,"configFilePath":"/user/username/projects/sample1/App/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/Library/library.d.ts -/user/username/projects/sample1/App/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/Library/library.d.ts -/user/username/projects/sample1/App/app.ts - -WatchedFiles:: -/user/username/projects/sample1/library/tsconfig.json: - {"fileName":"/user/username/projects/sample1/Library/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/library/library.ts: - {"fileName":"/user/username/projects/sample1/Library/library.ts","pollingInterval":250} -/user/username/projects/sample1/app/tsconfig.json: - {"fileName":"/user/username/projects/sample1/App/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/app/app.ts: - {"fileName":"/user/username/projects/sample1/App/app.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/library: - {"directoryName":"/user/username/projects/sample1/library","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/app: - {"directoryName":"/user/username/projects/sample1/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js index 250df5a8c5858..07f697f9b41d7 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/when-referenced-using-prepend-builds-referencing-project-even-for-non-local-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/logic +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,6 +24,54 @@ function foo() { return 10; } //// [/user/username/projects/sample1/logic/index.ts] function bar() { return foo() + 1 }; + +/a/lib/tsc.js -b -w sample1/logic +Output:: +>> Screen clear +[12:00:29 AM] Starting compilation in watch mode... + + +[12:00:46 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.ts + +No cached semantic diagnostics in the builder:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } @@ -173,12 +221,17 @@ declare function bar(): number; ====================================================================== +Change:: Make non local change and build core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +function foo() { return 10; } +function myFunc() { return 10; } + + Output:: >> Screen clear -[12:00:29 AM] Starting compilation in watch mode... - - -[12:00:46 AM] Found 0 errors. Watching for file changes. +[12:00:50 AM] File change detected. Starting incremental compilation... @@ -190,15 +243,6 @@ Program files:: No cached semantic diagnostics in the builder:: -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts - -No cached semantic diagnostics in the builder:: - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -219,12 +263,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make non local change and build core - -//// [/user/username/projects/sample1/core/index.ts] -function foo() { return 10; } -function myFunc() { return 10; } - //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } function myFunc() { return 10; } @@ -283,17 +321,21 @@ declare function myFunc(): number; ====================================================================== +Change:: Build logic + +Input:: + Output:: ->> Screen clear -[12:00:50 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] Found 0 errors. Watching for file changes. -Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts No cached semantic diagnostics in the builder:: @@ -317,8 +359,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic - //// [/user/username/projects/sample1/logic/index.js] function foo() { return 10; } function myFunc() { return 10; } @@ -419,17 +459,25 @@ declare function bar(): number; ====================================================================== +Change:: Make local change and build core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +function foo() { return 10; } +function myFunc() { return 100; } + + Output:: -[12:01:15 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:19 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/logic/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/core/index.ts No cached semantic diagnostics in the builder:: @@ -453,12 +501,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change and build core - -//// [/user/username/projects/sample1/core/index.ts] -function foo() { return 10; } -function myFunc() { return 100; } - //// [/user/username/projects/sample1/core/index.js] function foo() { return 10; } function myFunc() { return 100; } @@ -513,19 +555,14 @@ declare function myFunc(): number; ====================================================================== -Output:: ->> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... - +Change:: Build logic +Input:: -Program root files: ["/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"outFile":"/user/username/projects/sample1/core/index.js","watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.ts +Output:: +[12:01:42 AM] Found 0 errors. Watching for file changes. + -No cached semantic diagnostics in the builder:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -547,8 +584,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic - //// [/user/username/projects/sample1/logic/index.js] function foo() { return 10; } function myFunc() { return 100; } @@ -643,28 +678,3 @@ declare function bar(): number; ====================================================================== - -Output:: -[12:01:42 AM] Found 0 errors. Watching for file changes. - - - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js index c8ffc76842469..5fd88649e9ecc 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,56 +381,29 @@ export declare const m: typeof mod; } +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; + + Output:: >> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:04 AM] Found 0 errors. Watching for file changes. +[12:01:07 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -368,6 +420,8 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/newfile.ts: + {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} FsWatches:: @@ -379,8 +433,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] file changed its modified time @@ -428,9 +480,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -443,22 +492,21 @@ export declare const newFileConst = 30; -Output:: ->> Screen clear -[12:01:07 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -488,22 +536,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Change:: Build Tests + +Input:: + Output:: +[12:01:18 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: @@ -535,27 +589,34 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file changed its modified time //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; +export class someClass2 { } + + Output:: -[12:01:18 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:22 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -585,8 +646,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] file changed its modified time @@ -634,10 +693,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; -export class someClass2 { } - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -658,57 +713,9 @@ export declare class someClass2 { -Output:: ->> Screen clear -[12:01:22 AM] File change detected. Starting incremental compilation... - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/core/newfile.ts: - {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build logic or update time stamps -//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time -//// [/user/username/projects/sample1/logic/index.js] file changed its modified time -//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: @@ -750,11 +757,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time +//// [/user/username/projects/sample1/logic/index.js] file changed its modified time +//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time + Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:35 AM] Found 0 errors. Watching for file changes. @@ -799,3 +809,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js index eb9dd27fdac81..de2f6106cf2d3 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,12 +381,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... +Change:: Make change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } -[12:01:04 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... @@ -319,40 +406,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -379,15 +434,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -453,21 +499,23 @@ export declare class someClass { } -Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -495,8 +543,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -556,19 +602,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:01:40 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -596,8 +650,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -668,23 +720,31 @@ Change:: Build Tests } +Change:: Revert core file + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + Output:: -[12:01:40 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:44 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -712,14 +772,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Revert core file - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -777,21 +829,23 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:01:44 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -819,8 +873,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -880,19 +932,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:16 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -920,8 +980,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -992,23 +1050,33 @@ Change:: Build Tests } +Change:: Make two changes + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +export class someClass2 { } + + Output:: -[12:02:16 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:02:23 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1036,16 +1104,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make two changes - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } -export class someClass2 { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -1119,21 +1177,23 @@ export declare class someClass2 { } -Output:: ->> Screen clear -[12:02:23 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1161,8 +1221,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -1222,19 +1280,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:55 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1262,8 +1328,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1333,47 +1397,3 @@ Change:: Build Tests "version": "FakeTSVersion" } - -Output:: -[12:02:55 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js index 0744db21d00e1..cb40c0a0dc55f 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -75,6 +75,85 @@ import * as mod from '../core/anotherModule'; export const m = mod; + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:04 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -302,12 +381,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... +Change:: Make local change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +function foo() { } -[12:01:04 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:08 AM] File change detected. Starting incremental compilation... @@ -319,40 +406,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -379,15 +434,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -function foo() { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/index.js] @@ -441,21 +487,11 @@ function foo() { } } -Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - - +Change:: Build logic or update time stamps -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +Input:: -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +Output:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -483,46 +519,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -Output:: - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:21 AM] Found 0 errors. Watching for file changes. @@ -554,3 +558,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js index 94885a516bd15..bb1232e55ef4e 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,56 +415,29 @@ export declare const m: typeof mod; } +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; + + Output:: >> Screen clear -[12:00:45 AM] Starting compilation in watch mode... - - -[12:01:14 AM] Found 0 errors. Watching for file changes. +[12:01:17 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts - -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -402,6 +454,8 @@ WatchedFiles:: {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} /user/username/projects/sample1/tests/index.ts: {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/newfile.ts: + {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} FsWatches:: @@ -413,8 +467,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -466,9 +518,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -484,22 +533,21 @@ export declare const newFileConst = 30; //# sourceMappingURL=newfile.d.ts.map -Output:: ->> Screen clear -[12:01:17 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -529,22 +577,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Change:: Build Tests + +Input:: + Output:: +[12:01:30 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: @@ -576,27 +630,34 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file changed its modified time //// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Change:: Change to new File and build core + +Input:: +//// [/user/username/projects/sample1/core/newfile.ts] +export const newFileConst = 30; +export class someClass2 { } + + Output:: -[12:01:30 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:34 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/newfile.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/core/newfile.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -626,8 +687,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change to new File and build core - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -679,10 +738,6 @@ Change:: Change to new File and build core "version": "FakeTSVersion" } -//// [/user/username/projects/sample1/core/newfile.ts] -export const newFileConst = 30; -export class someClass2 { } - //// [/user/username/projects/sample1/core/newfile.js] "use strict"; exports.__esModule = true; @@ -706,57 +761,9 @@ export declare class someClass2 { //# sourceMappingURL=newfile.d.ts.map -Output:: ->> Screen clear -[12:01:34 AM] File change detected. Starting incremental compilation... - - - -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts","/user/username/projects/sample1/core/newfile.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts -/user/username/projects/sample1/core/newfile.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/newfile.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} -/user/username/projects/sample1/core/newfile.ts: - {"fileName":"/user/username/projects/sample1/core/newfile.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build logic or update time stamps -//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time -//// [/user/username/projects/sample1/logic/index.js] file changed its modified time -//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: @@ -798,11 +805,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time +//// [/user/username/projects/sample1/logic/index.js] file changed its modified time +//// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time + Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:50 AM] Found 0 errors. Watching for file changes. @@ -847,3 +857,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js index dfa539292388a..2aebe30724b6c 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,12 +415,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... +Change:: Make change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +export class someClass { } -[12:01:14 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... @@ -353,40 +440,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -413,15 +468,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -493,21 +539,23 @@ export declare class someClass { } -Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -535,8 +583,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -596,19 +642,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:01:53 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -636,8 +690,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -708,23 +760,31 @@ Change:: Build Tests } +Change:: Revert core file + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + + + Output:: -[12:01:53 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:01:57 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -752,14 +812,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Revert core file - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -823,21 +875,23 @@ export declare function multiply(a: number, b: number): number; } -Output:: ->> Screen clear -[12:01:57 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -865,8 +919,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -926,19 +978,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:02:32 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -966,8 +1026,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1038,23 +1096,33 @@ Change:: Build Tests } +Change:: Make two changes + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } + +export class someClass { } +export class someClass2 { } + + Output:: -[12:02:32 AM] Found 0 errors. Watching for file changes. +>> Screen clear +[12:02:39 AM] File change detected. Starting incremental compilation... -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1082,16 +1150,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make two changes - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -export class someClass { } -export class someClass2 { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -1171,21 +1229,23 @@ export declare class someClass2 { } -Output:: ->> Screen clear -[12:02:39 AM] File change detected. Starting incremental compilation... - +Change:: Build logic or update time stamps +Input:: -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Output:: + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/logic/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1213,8 +1273,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file written with same contents //// [/user/username/projects/sample1/logic/index.js] file written with same contents //// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents @@ -1274,19 +1332,27 @@ Change:: Build logic or update time stamps } +Change:: Build Tests + +Input:: + Output:: +[12:03:14 AM] Found 0 errors. Watching for file changes. + -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} Program files:: /a/lib/lib.d.ts /user/username/projects/sample1/core/index.d.ts /user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts Semantic diagnostics in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/logic/index.ts +/user/username/projects/sample1/tests/index.ts WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -1314,8 +1380,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build Tests - //// [/user/username/projects/sample1/tests/index.js] file written with same contents //// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] @@ -1385,47 +1449,3 @@ Change:: Build Tests "version": "FakeTSVersion" } - -Output:: -[12:03:14 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/tests/index.ts - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js index 4b2e9af0cb73a..a6153548cd719 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w sample1/tests +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -101,6 +101,85 @@ export function run() { } + +/a/lib/tsc.js -b -w sample1/tests +Output:: +>> Screen clear +[12:00:45 AM] Starting compilation in watch mode... + + +[12:01:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] +Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/anotherModule.ts +/user/username/projects/sample1/core/index.ts + +Program root files: ["/user/username/projects/sample1/logic/index.ts"] +Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.ts + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +WatchedFiles:: +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.ts: + {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/index.ts: + {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/core: + {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/logic: + {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/sample1/core/anotherModule.js] "use strict"; exports.__esModule = true; @@ -336,12 +415,20 @@ export declare const m: typeof mod; } -Output:: ->> Screen clear -[12:00:45 AM] Starting compilation in watch mode... +Change:: Make local change to core + +Input:: +//// [/user/username/projects/sample1/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } +function foo() { } -[12:01:14 AM] Found 0 errors. Watching for file changes. + +Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... @@ -353,40 +440,8 @@ Program files:: /user/username/projects/sample1/core/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts /user/username/projects/sample1/core/index.ts -Program root files: ["/user/username/projects/sample1/logic/index.ts"] -Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.ts - -Program root files: ["/user/username/projects/sample1/tests/index.ts"] -Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/index.d.ts -/user/username/projects/sample1/core/anotherModule.d.ts -/user/username/projects/sample1/logic/index.d.ts -/user/username/projects/sample1/tests/index.ts - WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} @@ -413,15 +468,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Make local change to core - -//// [/user/username/projects/sample1/core/index.ts] -export const someString: string = "HELLO WORLD"; -export function leftPad(s: string, n: number) { return s + n; } -export function multiply(a: number, b: number) { return a * b; } - -function foo() { } - //// [/user/username/projects/sample1/core/anotherModule.js] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/anotherModule.d.ts] file changed its modified time @@ -479,21 +525,11 @@ function foo() { } } -Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - - +Change:: Build logic or update time stamps -Program root files: ["/user/username/projects/sample1/core/anotherModule.ts","/user/username/projects/sample1/core/index.ts"] -Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/core/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/sample1/core/anotherModule.ts -/user/username/projects/sample1/core/index.ts +Input:: -Semantic diagnostics in builder refreshed for:: -/user/username/projects/sample1/core/index.ts +Output:: WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -521,46 +557,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Build logic or update time stamps - //// [/user/username/projects/sample1/logic/index.js.map] file changed its modified time //// [/user/username/projects/sample1/logic/index.js] file changed its modified time //// [/user/username/projects/sample1/logic/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] file changed its modified time -Output:: - -WatchedFiles:: -/user/username/projects/sample1/core/tsconfig.json: - {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/core/anothermodule.ts: - {"fileName":"/user/username/projects/sample1/core/anotherModule.ts","pollingInterval":250} -/user/username/projects/sample1/core/index.ts: - {"fileName":"/user/username/projects/sample1/core/index.ts","pollingInterval":250} -/user/username/projects/sample1/logic/tsconfig.json: - {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/logic/index.ts: - {"fileName":"/user/username/projects/sample1/logic/index.ts","pollingInterval":250} -/user/username/projects/sample1/tests/tsconfig.json: - {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} -/user/username/projects/sample1/tests/index.ts: - {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/sample1/core: - {"directoryName":"/user/username/projects/sample1/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/sample1/logic: - {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Build Tests -//// [/user/username/projects/sample1/tests/index.js] file changed its modified time -//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time -//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time +Input:: Output:: [12:01:34 AM] Found 0 errors. Watching for file changes. @@ -592,3 +596,7 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/sample1/logic","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file changed its modified time +//// [/user/username/projects/sample1/tests/index.d.ts] file changed its modified time +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js b/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js index d84a2f6f8498b..e17f9571ecbad 100644 --- a/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js +++ b/tests/baselines/reference/tsbuild/watchMode/programUpdates/works-when-noUnusedParameters-changes-to-false.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w +Input:: //// [/user/username/projects/myproject/index.ts] const fn = (a: string, b: string) => b; @@ -19,6 +19,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -b -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -58,15 +59,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Change tsconfig to set noUnusedParameters to false +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"noUnusedParameters":false}} -//// [/user/username/projects/myproject/index.js] -var fn = function (a, b) { return b; }; - - Output:: >> Screen clear @@ -100,3 +99,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/index.js] +var fn = function (a, b) { return b; }; + + diff --git a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js index 6001eeaf1f720..279cc4d73d511 100644 --- a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js +++ b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -b -w -verbose src +Input:: //// [/user/username/projects/reexport/src/tsconfig.json] { "files": [], @@ -63,93 +63,8 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/user/username/projects/reexport/out/pure/session.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/reexport/out/pure/session.d.ts] -export interface Session { - foo: number; -} - - -//// [/user/username/projects/reexport/out/pure/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./session"), exports); - - -//// [/user/username/projects/reexport/out/pure/index.d.ts] -export * from "./session"; - - -//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] -{ - "program": { - "fileInfos": { - "../../../../../../a/lib/lib.d.ts": { - "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "affectsGlobalScope": true - }, - "../../src/pure/session.ts": { - "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", - "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", - "affectsGlobalScope": false - }, - "../../src/pure/index.ts": { - "version": "-5356193041-export * from \"./session\";\n", - "signature": "-5356193041-export * from \"./session\";\n", - "affectsGlobalScope": false - } - }, - "options": { - "composite": true, - "outDir": "..", - "rootDir": "../../src", - "watch": true, - "configFilePath": "../../src/pure/tsconfig.json" - }, - "referencedMap": { - "../../src/pure/index.ts": [ - "../../src/pure/session.ts" - ] - }, - "exportedModulesMap": { - "../../src/pure/index.ts": [ - "../../src/pure/session.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../a/lib/lib.d.ts", - "../../src/pure/index.ts", - "../../src/pure/session.ts" - ] - }, - "version": "FakeTSVersion" -} - -//// [/user/username/projects/reexport/out/main/index.js] -"use strict"; -exports.__esModule = true; -exports.session = void 0; -exports.session = { - foo: 1 -}; - - +/a/lib/tsc.js -b -w -verbose src Output:: >> Screen clear [12:00:35 AM] Starting compilation in watch mode... @@ -227,25 +142,37 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Introduce error - -//// [/user/username/projects/reexport/src/pure/session.ts] -export interface Session { - foo: number; - bar: number; -} +//// [/user/username/projects/reexport/out/pure/session.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/reexport/out/pure/session.js] file written with same contents //// [/user/username/projects/reexport/out/pure/session.d.ts] export interface Session { foo: number; - bar: number; } -//// [/user/username/projects/reexport/out/pure/index.js] file written with same contents -//// [/user/username/projects/reexport/out/pure/index.d.ts] file written with same contents +//// [/user/username/projects/reexport/out/pure/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./session"), exports); + + +//// [/user/username/projects/reexport/out/pure/index.d.ts] +export * from "./session"; + + //// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] { "program": { @@ -256,8 +183,8 @@ export interface Session { "affectsGlobalScope": true }, "../../src/pure/session.ts": { - "version": "4223553457-export interface Session {\n foo: number;\n bar: number;\n}\n", - "signature": "309257137-export interface Session {\n foo: number;\n bar: number;\n}\n", + "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", + "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", "affectsGlobalScope": false }, "../../src/pure/index.ts": { @@ -292,6 +219,26 @@ export interface Session { "version": "FakeTSVersion" } +//// [/user/username/projects/reexport/out/main/index.js] +"use strict"; +exports.__esModule = true; +exports.session = void 0; +exports.session = { + foo: 1 +}; + + + +Change:: Introduce error + +Input:: +//// [/user/username/projects/reexport/src/pure/session.ts] +export interface Session { + foo: number; + bar: number; +} + + Output:: >> Screen clear @@ -373,19 +320,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix error - -//// [/user/username/projects/reexport/src/pure/session.ts] -export interface Session { - foo: number; - // bar: number; -} - - //// [/user/username/projects/reexport/out/pure/session.js] file written with same contents //// [/user/username/projects/reexport/out/pure/session.d.ts] export interface Session { foo: number; + bar: number; } @@ -401,8 +340,8 @@ export interface Session { "affectsGlobalScope": true }, "../../src/pure/session.ts": { - "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", - "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", + "version": "4223553457-export interface Session {\n foo: number;\n bar: number;\n}\n", + "signature": "309257137-export interface Session {\n foo: number;\n bar: number;\n}\n", "affectsGlobalScope": false }, "../../src/pure/index.ts": { @@ -437,7 +376,17 @@ export interface Session { "version": "FakeTSVersion" } -//// [/user/username/projects/reexport/out/main/index.js] file changed its modified time + +Change:: Fix error + +Input:: +//// [/user/username/projects/reexport/src/pure/session.ts] +export interface Session { + foo: number; + // bar: number; +} + + Output:: >> Screen clear @@ -510,3 +459,60 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/reexport/src/main","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/reexport/out/pure/session.js] file written with same contents +//// [/user/username/projects/reexport/out/pure/session.d.ts] +export interface Session { + foo: number; +} + + +//// [/user/username/projects/reexport/out/pure/index.js] file written with same contents +//// [/user/username/projects/reexport/out/pure/index.d.ts] file written with same contents +//// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../src/pure/session.ts": { + "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", + "signature": "-1218067212-export interface Session {\n foo: number;\n}\n", + "affectsGlobalScope": false + }, + "../../src/pure/index.ts": { + "version": "-5356193041-export * from \"./session\";\n", + "signature": "-5356193041-export * from \"./session\";\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "outDir": "..", + "rootDir": "../../src", + "watch": true, + "configFilePath": "../../src/pure/tsconfig.json" + }, + "referencedMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "exportedModulesMap": { + "../../src/pure/index.ts": [ + "../../src/pure/session.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../src/pure/index.ts", + "../../src/pure/session.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/reexport/out/main/index.js] file changed its modified time diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js index 29eefb2d8e1d2..8372a0e49f098 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p pkg3 --listFiles +Input:: //// [/user/username/projects/myProject/pkg1/dist/index.d.ts] export * from './types'; @@ -54,35 +54,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/pkg3/dist/keys.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ADMIN = void 0; -var pkg2_1 = require("@raymondfeng/pkg2"); -exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); - - -//// [/user/username/projects/myproject/pkg3/dist/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./keys"), exports); - - -//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] -export * from './keys'; - - +/a/lib/tsc.js -p pkg3 --listFiles Output:: pkg3/src/keys.ts:2:14 - error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. @@ -127,3 +100,32 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + +//// [/user/username/projects/myproject/pkg3/dist/keys.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ADMIN = void 0; +var pkg2_1 = require("@raymondfeng/pkg2"); +exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); + + +//// [/user/username/projects/myproject/pkg3/dist/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keys"), exports); + + +//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] +export * from './keys'; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index 40045b6d167ce..fa89367600821 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p pkg3 --listFiles +Input:: //// [/user/username/projects/myproject/pkg1/dist/index.d.ts] export * from './types'; @@ -54,35 +54,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/pkg3/dist/keys.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ADMIN = void 0; -var pkg2_1 = require("@raymondfeng/pkg2"); -exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); - - -//// [/user/username/projects/myproject/pkg3/dist/index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./keys"), exports); - - -//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] -export * from './keys'; - - +/a/lib/tsc.js -p pkg3 --listFiles Output:: pkg3/src/keys.ts:2:14 - error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. @@ -127,3 +100,32 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + +//// [/user/username/projects/myproject/pkg3/dist/keys.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ADMIN = void 0; +var pkg2_1 = require("@raymondfeng/pkg2"); +exports.ADMIN = pkg2_1.MetadataAccessor.create('1'); + + +//// [/user/username/projects/myproject/pkg3/dist/index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./keys"), exports); + + +//// [/user/username/projects/myproject/pkg3/dist/index.d.ts] +export * from './keys'; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js index 200576b32ee3a..bc7e8af7206fa 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myProject/plugin-two/index.d.ts] declare const _default: { features: { @@ -84,34 +84,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/action.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/action.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export {}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== @@ -232,3 +206,31 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/action.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/action.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export {}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js index 81fe39fd8b1ed..410f1819da657 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myProject/plugin-two/package.json] {"name":"plugin-two","version":"0.1.3","main":"dist/commonjs/index.js"} @@ -86,25 +86,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== @@ -246,3 +229,22 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js index 7f302be902467..57a6e2a29d554 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myproject/plugin-two/package.json] {"name":"plugin-two","version":"0.1.3","main":"dist/commonjs/index.js"} @@ -86,25 +86,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== @@ -246,3 +229,22 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js index 5507612f3f539..df60d073c68cb 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -p plugin-one --listFiles +Input:: //// [/user/username/projects/myproject/plugin-two/index.d.ts] declare const _default: { features: { @@ -84,34 +84,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/plugin-one/action.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.actions = void 0; -var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib -var action = typescript_fsa_1.actionCreatorFactory("somekey"); -var featureOne = action("feature-one"); -exports.actions = { featureOne: featureOne }; - - -//// [/user/username/projects/myproject/plugin-one/action.d.ts] -export declare const actions: { - featureOne: import("typescript-fsa").ActionCreator<{ - route: string; - }>; -}; - - -//// [/user/username/projects/myproject/plugin-one/index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/plugin-one/index.d.ts] -export {}; - - +/a/lib/tsc.js -p plugin-one --listFiles Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== @@ -232,3 +206,31 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.Success + +//// [/user/username/projects/myproject/plugin-one/action.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.actions = void 0; +var typescript_fsa_1 = require("typescript-fsa"); // Include version of shared lib +var action = typescript_fsa_1.actionCreatorFactory("somekey"); +var featureOne = action("feature-one"); +exports.actions = { featureOne: featureOne }; + + +//// [/user/username/projects/myproject/plugin-one/action.d.ts] +export declare const actions: { + featureOne: import("typescript-fsa").ActionCreator<{ + route: string; + }>; +}; + + +//// [/user/username/projects/myproject/plugin-one/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/plugin-one/index.d.ts] +export {}; + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js index 257725597b612..7a210ce679eee 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/createWatchOfConfigFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /tsconfig.json +Input:: //// [/f.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w -p /tsconfig.json Output:: >> Screen clear 12:00:13 AM - Starting compilation in watch mode... @@ -57,15 +55,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: @@ -100,3 +99,8 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js index ce3b8b51fd559..638585acff3b7 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/when-preserveWatchOutput-is-true-in-config-file/when-createWatchProgram-is-invoked-with-configFileParseResult-on-WatchCompilerHostOfConfigFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /tsconfig.json +Input:: //// [/f.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w -p /tsconfig.json Output:: [12:00:13 AM] Starting compilation in watch mode... @@ -56,15 +54,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: [12:00:19 AM] File change detected. Starting incremental compilation... @@ -98,3 +97,8 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js index 9bd26bdd33102..a5046dc3b6268 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---diagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --diagnostics +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --diagnostics Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -59,15 +57,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: FileWatcher:: Triggered with /f.ts 1:: WatchInfo: /f.ts 250 undefined Source file @@ -111,3 +110,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js index 494fd1c50bfb9..e32c88bce6f10 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---extendedDiagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --extendedDiagnostics +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --extendedDiagnostics Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -63,15 +61,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: FileWatcher:: Triggered with /f.ts 1:: WatchInfo: /f.ts 250 undefined Source file @@ -115,3 +114,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js b/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js index 7c5d64a46eaad..891223f155f0f 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/with---preserveWatchOutput.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts --preserveWatchOutput +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts --preserveWatchOutput Output:: [12:00:11 AM] Starting compilation in watch mode... @@ -49,15 +47,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: [12:00:17 AM] File change detected. Starting incremental compilation... @@ -87,3 +86,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js b/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js index 8a05fb065fe33..94b8416f381cb 100644 --- a/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js +++ b/tests/baselines/reference/tscWatch/consoleClearing/without---diagnostics-or---extendedDiagnostics.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /f.ts +Input:: //// [/f.ts] @@ -15,10 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/f.js] - - +/a/lib/tsc.js --w /f.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -50,15 +48,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/f.js] + + + Change:: Comment added to file f +Input:: //// [/f.ts] // -//// [/f.js] -// - - Output:: >> Screen clear @@ -89,3 +88,8 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/f.js] +// + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js index 78777939a7ddd..f1b6c97c8f797 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/elides-const-enums-correctly-in-incremental-compilation.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/someone/projects/myproject/file3.ts +Input:: //// [/user/someone/projects/myproject/file1.ts] export const enum E1 { V = 1 } @@ -21,23 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/someone/projects/myproject/file1.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/someone/projects/myproject/file2.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/someone/projects/myproject/file3.js] -"use strict"; -exports.__esModule = true; -var v = 1 /* V */; - - +/a/lib/tsc.js -w /user/someone/projects/myproject/file3.ts Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -77,19 +62,30 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append content to file3 +//// [/user/someone/projects/myproject/file1.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/someone/projects/myproject/file2.js] +"use strict"; +exports.__esModule = true; -//// [/user/someone/projects/myproject/file3.ts] -import { E2 } from "./file2"; const v: E2 = E2.V;function foo2() { return 2; } //// [/user/someone/projects/myproject/file3.js] "use strict"; exports.__esModule = true; var v = 1 /* V */; -function foo2() { return 2; } +Change:: Append content to file3 + +Input:: +//// [/user/someone/projects/myproject/file3.ts] +import { E2 } from "./file2"; const v: E2 = E2.V;function foo2() { return 2; } + + Output:: >> Screen clear [12:00:33 AM] File change detected. Starting incremental compilation... @@ -125,3 +121,11 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/user/someone/projects/myproject/file3.js] +"use strict"; +exports.__esModule = true; +var v = 1 /* V */; +function foo2() { return 2; } + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js index 0d3b4bcaf3383..3d6d3d79aa10b 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/file-is-deleted-and-created-as-part-of-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/home/username/project/app/file.ts] var a = 10; @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/home/username/project/app/file.js] -var a = 10; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -60,13 +57,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: file is deleted and then created to modify content - //// [/home/username/project/app/file.js] var a = 10; -var b = 10; + +Change:: file is deleted and then created to modify content + +Input:: //// [/home/username/project/app/file.ts] var a = 10; var b = 10; @@ -108,3 +106,9 @@ FsWatchesRecursive:: {"directoryName":"/home/username/project/app","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/home/username/project/app/file.js] +var a = 10; +var b = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js index 335e12e9e470d..20c6a009f25f4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-carriageReturn-lineFeed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/app.ts +Input:: //// [/a/app.ts] var x = 1; var y = 2; @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/app.js] -var x = 1; -var y = 2; - - +/a/lib/tsc.js --w /a/app.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -53,20 +49,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append a line - -//// [/a/app.ts] +//// [/a/app.js] var x = 1; var y = 2; -var z = 3; -//// [/a/app.js] + + +Change:: Append a line + +Input:: +//// [/a/app.ts] var x = 1; var y = 2; var z = 3; - Output:: >> Screen clear [12:00:17 AM] File change detected. Starting incremental compilation... @@ -97,3 +94,10 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/app.js] +var x = 1; +var y = 2; +var z = 3; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js index 00aa33efabf42..3affb2f761b18 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/handles-new-lines-lineFeed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/app.ts +Input:: //// [/a/app.ts] var x = 1; var y = 2; @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/app.js] -var x = 1; -var y = 2; - - +/a/lib/tsc.js --w /a/app.ts Output:: >> Screen clear [12:00:11 AM] Starting compilation in watch mode... @@ -53,19 +49,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/app.js] +var x = 1; +var y = 2; + + + Change:: Append a line +Input:: //// [/a/app.ts] var x = 1; var y = 2; var z = 3; -//// [/a/app.js] -var x = 1; -var y = 2; -var z = 3; - - Output:: >> Screen clear @@ -97,3 +94,10 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/app.js] +var x = 1; +var y = 2; +var z = 3; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js b/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js index 5ad8a6aa4acdb..de797479444d9 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-file-content/should-emit-specified-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] export function Foo() { return 10; } @@ -24,30 +24,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/f1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { return 10; } -exports.Foo = Foo; - - -//// [/a/b/f2.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -var f1_1 = require("./f1"); -exports.y = f1_1.Foo(); - - -//// [/a/b/f3.js] -"use strict"; -exports.__esModule = true; -var f2_1 = require("./f2"); -var x = f2_1.y; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -93,22 +71,36 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Append content to f1 - -//// [/a/b/f1.ts] -export function Foo() { return 10; }export function foo2() { return 2; } - //// [/a/b/f1.js] "use strict"; exports.__esModule = true; -exports.foo2 = exports.Foo = void 0; +exports.Foo = void 0; function Foo() { return 10; } exports.Foo = Foo; -function foo2() { return 2; } -exports.foo2 = foo2; -//// [/a/b/f2.js] file written with same contents +//// [/a/b/f2.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +var f1_1 = require("./f1"); +exports.y = f1_1.Foo(); + + +//// [/a/b/f3.js] +"use strict"; +exports.__esModule = true; +var f2_1 = require("./f2"); +var x = f2_1.y; + + + +Change:: Append content to f1 + +Input:: +//// [/a/b/f1.ts] +export function Foo() { return 10; }export function foo2() { return 2; } + Output:: >> Screen clear @@ -152,3 +144,15 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] +"use strict"; +exports.__esModule = true; +exports.foo2 = exports.Foo = void 0; +function Foo() { return 10; } +exports.Foo = Foo; +function foo2() { return 2; } +exports.foo2 = foo2; + + +//// [/a/b/f2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js index f425ed918a255..17b2952fe28eb 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--isolatedModules'-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -122,20 +91,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -192,3 +186,13 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js index 654a5287ff796..0e9d053d18cb2 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-always-return-the-file-itself-if-'--out'-or-'--outFile'-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,55 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/out.js] -System.register("moduleFile1", [], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function Foo() { } - exports_1("Foo", Foo); - return { - setters: [], - execute: function () { - ; - } - }; -}); -System.register("file1Consumer1", [], function (exports_2, context_2) { - "use strict"; - var y; - var __moduleName = context_2 && context_2.id; - return { - setters: [], - execute: function () { - exports_2("y", y = 10); - } - }; -}); -System.register("file1Consumer2", [], function (exports_3, context_3) { - "use strict"; - var z; - var __moduleName = context_3 && context_3.id; - return { - setters: [], - execute: function () { - z = 10; - } - }; -}); -System.register("moduleFile2", [], function (exports_4, context_4) { - "use strict"; - var Foo4; - var __moduleName = context_4 && context_4.id; - return { - setters: [], - execute: function () { - exports_4("Foo4", Foo4 = 10); - } - }; -}); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -126,15 +79,9 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/out.js] System.register("moduleFile1", [], function (exports_1, context_1) { "use strict"; - var T; var __moduleName = context_1 && context_1.id; function Foo() { } exports_1("Foo", Foo); @@ -181,6 +128,13 @@ System.register("moduleFile2", [], function (exports_4, context_4) { +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + + Output:: >> Screen clear [12:00:30 AM] File change detected. Starting incremental compilation... @@ -227,3 +181,53 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/out.js] +System.register("moduleFile1", [], function (exports_1, context_1) { + "use strict"; + var T; + var __moduleName = context_1 && context_1.id; + function Foo() { } + exports_1("Foo", Foo); + return { + setters: [], + execute: function () { + ; + } + }; +}); +System.register("file1Consumer1", [], function (exports_2, context_2) { + "use strict"; + var y; + var __moduleName = context_2 && context_2.id; + return { + setters: [], + execute: function () { + exports_2("y", y = 10); + } + }; +}); +System.register("file1Consumer2", [], function (exports_3, context_3) { + "use strict"; + var z; + var __moduleName = context_3 && context_3.id; + return { + setters: [], + execute: function () { + z = 10; + } + }; +}); +System.register("moduleFile2", [], function (exports_4, context_4) { + "use strict"; + var Foo4; + var __moduleName = context_4 && context_4.id; + return { + setters: [], + execute: function () { + exports_4("Foo4", Foo4 = 10); + } + }; +}); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js index b9334c889d04e..5b286f6357394 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-deleted-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,21 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change moduleFile1 shape and delete file1Consumer2 - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change moduleFile1 shape and delete file1Consumer2 + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + //// [/a/b/file1Consumer2.ts] deleted Output:: @@ -178,3 +171,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js index 89bee1b3be94d..6ae491b9df7d9 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-newly-created-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,32 +85,48 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change moduleFile1 shape and create file1Consumer3 - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents -//// [/a/b/file1Consumer3.ts] -import {Foo} from "./moduleFile1"; let y = Foo(); +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; -//// [/a/b/file1Consumer3.js] + +//// [/a/b/file1Consumer2.js] "use strict"; exports.__esModule = true; -var moduleFile1_1 = require("./moduleFile1"); -var y = moduleFile1_1.Foo(); +var z = 10; + + +//// [/a/b/globalFile3.js] +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change moduleFile1 shape and create file1Consumer3 + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer3.ts] +import {Foo} from "./moduleFile1"; let y = Foo(); + Output:: >> Screen clear @@ -196,3 +181,22 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/file1Consumer3.js] +"use strict"; +exports.__esModule = true; +var moduleFile1_1 = require("./moduleFile1"); +var y = moduleFile1_1.Foo(); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js index 3560a191d7768..4e200416778df 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-be-up-to-date-with-the-reference-map-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,19 +85,46 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change file1Consumer1 content to `export let y = Foo();` +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; -//// [/a/b/file1Consumer1.ts] -export let y = Foo(); //// [/a/b/file1Consumer1.js] "use strict"; exports.__esModule = true; exports.y = void 0; -exports.y = Foo(); +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; +Change:: Change file1Consumer1 content to `export let y = Foo();` + +Input:: +//// [/a/b/file1Consumer1.ts] +export let y = Foo(); + + Output:: >> Screen clear [12:00:38 AM] File change detected. Starting incremental compilation... @@ -183,21 +179,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = Foo(); + + + Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -254,18 +249,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer2.js] file written with same contents + Change:: Add the import statements back to file1Consumer1 +Input:: //// [/a/b/file1Consumer1.ts] import {Foo} from "./moduleFile1";let y = Foo(); -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -var moduleFile1_1 = require("./moduleFile1"); -var y = moduleFile1_1.Foo(); - - Output:: >> Screen clear @@ -315,20 +315,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +var moduleFile1_1 = require("./moduleFile1"); +var y = moduleFile1_1.Foo(); + + + Change:: Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export let y = Foo(); -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = Foo(); - - -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -398,24 +398,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Multiple file edits in one go - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - -//// [/a/b/file1Consumer1.ts] file written with same contents //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; +exports.y = void 0; +exports.y = Foo(); //// [/a/b/file1Consumer1.js] file written with same contents //// [/a/b/file1Consumer2.js] file written with same contents +Change:: Multiple file edits in one go + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + +//// [/a/b/file1Consumer1.ts] file written with same contents + Output:: >> Screen clear [12:01:22 AM] File change detected. Starting incremental compilation... @@ -465,3 +465,15 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js index fed646679e551..53f8d7c6ac2fb 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-contains-only-itself-if-a-module-file's-shape-didn't-change,-and-all-files-referencing-it-if-its-shape-changed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,22 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -183,20 +175,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { console.log('hi'); }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; exports.Foo = exports.T = void 0; -function Foo() { console.log('hi'); } +function Foo() { } exports.Foo = Foo; ; +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { console.log('hi'); }; + Output:: >> Screen clear @@ -251,3 +247,13 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { console.log('hi'); } +exports.Foo = Foo; +; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js index bebd7d6595d0d..580e8ee8ffaa4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-changes-in-non-root-files.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,23 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -86,21 +71,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { }; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T = void 0; +exports.Foo = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + + +Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { }; + Output:: >> Screen clear @@ -140,11 +133,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1 internal, and verify only file1 is affected - -//// [/a/b/moduleFile1.ts] -export var T: number;export function Foo() { };var T1: number; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; @@ -152,9 +140,16 @@ exports.Foo = exports.T = void 0; function Foo() { } exports.Foo = Foo; ; -var T1; +//// [/a/b/file1Consumer1.js] file written with same contents + +Change:: change file1 internal, and verify only file1 is affected + +Input:: +//// [/a/b/moduleFile1.ts] +export var T: number;export function Foo() { };var T1: number; + Output:: >> Screen clear @@ -192,3 +187,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T = void 0; +function Foo() { } +exports.Foo = Foo; +; +var T1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js index 368843aa14d68..3367268c18f38 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-non-existing-code-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -19,15 +19,8 @@ export var x = Foo(); //// [/a/b/tsconfig.json] {} -//// [/a/b/referenceFile1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -/// -exports.x = Foo(); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -79,22 +72,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: edit refereceFile1 - -//// [/a/b/referenceFile1.ts] -/// -export var x = Foo();export var yy = Foo(); - //// [/a/b/referenceFile1.js] "use strict"; exports.__esModule = true; -exports.yy = exports.x = void 0; +exports.x = void 0; /// exports.x = Foo(); -exports.yy = Foo(); +Change:: edit refereceFile1 + +Input:: +//// [/a/b/referenceFile1.ts] +/// +export var x = Foo();export var yy = Foo(); + + Output:: >> Screen clear [12:00:21 AM] File change detected. Starting incremental compilation... @@ -151,19 +145,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/referenceFile1.js] +"use strict"; +exports.__esModule = true; +exports.yy = exports.x = void 0; +/// +exports.x = Foo(); +exports.yy = Foo(); + + + Change:: create moduleFile2 -//// [/a/b/referenceFile1.js] file written with same contents +Input:: //// [/a/b/moduleFile2.ts] export var Foo4 = 10; -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - Output:: >> Screen clear @@ -216,3 +213,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/referenceFile1.js] file written with same contents +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js index 382a051e09fe5..bb58296521954 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-detect-removed-code-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -22,24 +22,8 @@ export function Foo() { }; //// [/a/b/tsconfig.json] {} -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/referenceFile1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -/// -exports.x = Foo(); - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -87,9 +71,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/referenceFile1.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +/// +exports.x = Foo(); + + + Change:: delete moduleFile1 -//// [/a/b/referenceFile1.js] file written with same contents +Input:: //// [/a/b/moduleFile1.ts] deleted Output:: @@ -141,3 +143,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/referenceFile1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js index 5644e04edd8ce..3a98bd3751764 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-all-files-if-a-global-file-changed-shape.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -30,39 +30,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -116,19 +85,45 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change shape of global file +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; -//// [/a/b/globalFile3.ts] -interface GlobalFoo { age: number }var T2: string; -//// [/a/b/moduleFile1.js] file written with same contents -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents //// [/a/b/globalFile3.js] -var T2; -//// [/a/b/moduleFile2.js] file written with same contents +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change shape of global file + +Input:: +//// [/a/b/globalFile3.ts] +interface GlobalFoo { age: number }var T2: string; + Output:: >> Screen clear @@ -182,3 +177,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] file written with same contents +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents +//// [/a/b/globalFile3.js] +var T2; + + +//// [/a/b/moduleFile2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js index 560e738af08bb..3d873bcaeab2b 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-return-cascaded-affected-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile1.ts] export function Foo() { }; @@ -33,44 +33,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/file1Consumer1Consumer1.ts] import {y} from "./file1Consumer1"; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 10; - - -//// [/a/b/file1Consumer1Consumer1.js] -"use strict"; -exports.__esModule = true; - - -//// [/a/b/file1Consumer2.js] -"use strict"; -exports.__esModule = true; -var z = 10; - - -//// [/a/b/globalFile3.js] - - -//// [/a/b/moduleFile2.js] -"use strict"; -exports.__esModule = true; -exports.Foo4 = void 0; -exports.Foo4 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -128,19 +92,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1Consumer1 +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = void 0; +function Foo() { } +exports.Foo = Foo; +; -//// [/a/b/file1Consumer1.ts] -import {Foo} from "./moduleFile1"; export var y = 10;export var T: number; //// [/a/b/file1Consumer1.js] "use strict"; exports.__esModule = true; -exports.T = exports.y = void 0; +exports.y = void 0; exports.y = 10; -//// [/a/b/file1Consumer1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer1Consumer1.js] +"use strict"; +exports.__esModule = true; + + +//// [/a/b/file1Consumer2.js] +"use strict"; +exports.__esModule = true; +var z = 10; + + +//// [/a/b/globalFile3.js] + + +//// [/a/b/moduleFile2.js] +"use strict"; +exports.__esModule = true; +exports.Foo4 = void 0; +exports.Foo4 = 10; + + + +Change:: change file1Consumer1 + +Input:: +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10;export var T: number; + Output:: >> Screen clear @@ -194,22 +189,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.T = exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer1Consumer1.js] file written with same contents + Change:: Change the content of moduleFile1 to `export var T: number;export function Foo() { };` +Input:: //// [/a/b/moduleFile1.ts] export var T: number;export function Foo() { }; -//// [/a/b/moduleFile1.js] -"use strict"; -exports.__esModule = true; -exports.Foo = exports.T = void 0; -function Foo() { } -exports.Foo = Foo; -; - - -//// [/a/b/file1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -264,32 +258,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1Consumer1 and moduleFile1 - -//// [/a/b/moduleFile1.ts] -export var T2: number;export function Foo() { }; - -//// [/a/b/file1Consumer1.ts] -import {Foo} from "./moduleFile1"; export var y = 10;export var T: number;export var T2: number; - //// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; -exports.Foo = exports.T2 = void 0; +exports.Foo = exports.T = void 0; function Foo() { } exports.Foo = Foo; ; -//// [/a/b/file1Consumer1.js] -"use strict"; -exports.__esModule = true; -exports.T2 = exports.T = exports.y = void 0; -exports.y = 10; +//// [/a/b/file1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents + +Change:: change file1Consumer1 and moduleFile1 +Input:: +//// [/a/b/moduleFile1.ts] +export var T2: number;export function Foo() { }; + +//// [/a/b/file1Consumer1.ts] +import {Foo} from "./moduleFile1"; export var y = 10;export var T: number;export var T2: number; -//// [/a/b/file1Consumer1Consumer1.js] file written with same contents -//// [/a/b/file1Consumer2.js] file written with same contents Output:: >> Screen clear @@ -344,3 +333,22 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/moduleFile1.js] +"use strict"; +exports.__esModule = true; +exports.Foo = exports.T2 = void 0; +function Foo() { } +exports.Foo = Foo; +; + + +//// [/a/b/file1Consumer1.js] +"use strict"; +exports.__esModule = true; +exports.T2 = exports.T = exports.y = void 0; +exports.y = 10; + + +//// [/a/b/file1Consumer1Consumer1.js] file written with same contents +//// [/a/b/file1Consumer2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js index f1b6699c15ad6..c174eb5dbef8c 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js +++ b/tests/baselines/reference/tscWatch/emit/emit-for-configured-projects/should-work-fine-for-files-with-circular-references.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,23 +23,8 @@ export var t2 = 10; //// [/a/b/tsconfig.json] {} -//// [/a/b/file2.js] -"use strict"; -exports.__esModule = true; -exports.t2 = void 0; -/// -exports.t2 = 10; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -exports.t1 = void 0; -/// -exports.t1 = 10; - - +/a/lib/tsc.js --w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -81,23 +66,31 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: change file1 +//// [/a/b/file2.js] +"use strict"; +exports.__esModule = true; +exports.t2 = void 0; +/// +exports.t2 = 10; -//// [/a/b/file1.ts] -/// -export var t1 = 10;export var t3 = 10; -//// [/a/b/file2.js] file written with same contents //// [/a/b/file1.js] "use strict"; exports.__esModule = true; -exports.t3 = exports.t1 = void 0; +exports.t1 = void 0; /// exports.t1 = 10; -exports.t3 = 10; +Change:: change file1 + +Input:: +//// [/a/b/file1.ts] +/// +export var t1 = 10;export var t3 = 10; + + Output:: >> Screen clear [12:00:25 AM] File change detected. Starting incremental compilation... @@ -137,3 +130,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file2.js] file written with same contents +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +exports.t3 = exports.t1 = void 0; +/// +exports.t1 = 10; +exports.t3 = 10; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js index 8f4987a5c2da9..d4c53518f35f4 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-does-not-have-out-or-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,15 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/a.js] -var x = 1; - - -//// [/a/b.js] -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -71,15 +64,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/a.js] +var x = 1; + + +//// [/a/b.js] +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/a.js] -var x = 11; - - Output:: >> Screen clear @@ -119,3 +118,8 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/a.js] +var x = 11; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js index abdb4c96f95c3..99b1aa3893d50 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-out.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/out.js] -var x = 1; -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -65,16 +61,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/out.js] +var x = 1; +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/out.js] -var x = 11; -var y = 1; - - Output:: >> Screen clear @@ -113,3 +111,9 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/out.js] +var x = 11; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js index 13ae6e640e25f..058d1dd761d11 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/config-has-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/tsconfig.json +Input:: //// [/a/a.ts] let x = 1 @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/out.js] -var x = 1; -var y = 1; - - +/a/lib/tsc.js --w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -65,16 +61,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/out.js] +var x = 1; +var y = 1; + + + Change:: Make change in the file +Input:: //// [/a/a.ts] let x = 11 -//// [/a/out.js] -var x = 11; -var y = 1; - - Output:: >> Screen clear @@ -113,3 +111,9 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/out.js] +var x = 11; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js index 981e805e512f0..249c18eb769de 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/with---outFile-and-multiple-declaration-files-in-the-program.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/project/tsconfig.json +Input:: //// [/a/b/output/AnotherDependency/file1.d.ts] declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } } @@ -27,23 +27,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/project/tsconfig.json] {"compilerOptions":{"outFile":"../output/common.js","target":"es5"},"files":["/a/b/output/AnotherDependency/file1.d.ts","/a/b/dependencies/file2.d.ts","/a/b/project/src/main.ts","/a/b/project/src/main2.ts"]} -//// [/a/b/output/common.js] -var Main; -(function (Main) { - function fooBar() { } - Main.fooBar = fooBar; -})(Main || (Main = {})); -var main; -(function (main) { - var file4; - (function (file4) { - function foo(a) { } - file4.foo = foo; - })(file4 = main.file4 || (main.file4 = {})); -})(main || (main = {})); - - +/a/lib/tsc.js --w -p /a/b/project/tsconfig.json Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -91,3 +76,20 @@ FsWatchesRecursive:: {"directoryName":"/a/b/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/output/common.js] +var Main; +(function (Main) { + function fooBar() { } + Main.fooBar = fooBar; +})(Main || (Main = {})); +var main; +(function (main) { + var file4; + (function (file4) { + function foo(a) { } + file4.foo = foo; + })(file4 = main.file4 || (main.file4 = {})); +})(main || (main = {})); + + diff --git a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js index 576e836605f60..c1a9b5adeadef 100644 --- a/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js +++ b/tests/baselines/reference/tscWatch/emit/emit-with-outFile-or-out-setting/without---outFile-and-multiple-declaration-files-in-the-program.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/project/tsconfig.json +Input:: //// [/a/b/output/AnotherDependency/file1.d.ts] declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } } @@ -27,26 +27,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/project/tsconfig.json] {"compilerOptions":{"outDir":"../output","target":"es5"},"files":["/a/b/output/AnotherDependency/file1.d.ts","/a/b/dependencies/file2.d.ts","/a/b/project/src/main.ts","/a/b/project/src/main2.ts"]} -//// [/a/b/output/main.js] -var Main; -(function (Main) { - function fooBar() { } - Main.fooBar = fooBar; -})(Main || (Main = {})); - - -//// [/a/b/output/main2.js] -var main; -(function (main) { - var file4; - (function (file4) { - function foo(a) { } - file4.foo = foo; - })(file4 = main.file4 || (main.file4 = {})); -})(main || (main = {})); - - +/a/lib/tsc.js --w -p /a/b/project/tsconfig.json Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -99,3 +81,23 @@ FsWatchesRecursive:: {"directoryName":"/a/b/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/output/main.js] +var Main; +(function (Main) { + function fooBar() { } + Main.fooBar = fooBar; +})(Main || (Main = {})); + + +//// [/a/b/output/main2.js] +var main; +(function (main) { + var file4; + (function (file4) { + function foo(a) { } + file4.foo = foo; + })(file4 = main.file4 || (main.file4 = {})); +})(main || (main = {})); + + diff --git a/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js b/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js index 83c28e293c699..ab135cdcb547e 100644 --- a/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js +++ b/tests/baselines/reference/tscWatch/emit/when-module-emit-is-specified-as-node/when-instead-of-filechanged-recursive-directory-watcher-is-invoked.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /a/rootFolder/project/tsconfig.json +Input:: //// [/a/rootFolder/project/tsconfig.json] {"compilerOptions":{"module":"none","allowJs":true,"outDir":"Static/scripts/"},"include":["Scripts/**/*"]} @@ -21,15 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/rootFolder/project/Static/scripts/Javascript.js] -var zz = 10; - - -//// [/a/rootFolder/project/Static/scripts/TypeScript.js] -var z = 10; - - +/a/lib/tsc.js --w --p /a/rootFolder/project/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -71,16 +64,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify typescript file +//// [/a/rootFolder/project/Static/scripts/Javascript.js] +var zz = 10; -//// [/a/rootFolder/project/Scripts/TypeScript.ts] -var zz30 = 100; -//// [/a/rootFolder/project/Static/scripts/Javascript.js] file written with same contents //// [/a/rootFolder/project/Static/scripts/TypeScript.js] -var zz30 = 100; +var z = 10; + +Change:: Modify typescript file + +Input:: +//// [/a/rootFolder/project/Scripts/TypeScript.ts] +var zz30 = 100; + Output:: >> Screen clear @@ -122,3 +120,9 @@ FsWatchesRecursive:: {"directoryName":"/a/rootfolder/project/scripts","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/rootFolder/project/Static/scripts/Javascript.js] file written with same contents +//// [/a/rootFolder/project/Static/scripts/TypeScript.js] +var zz30 = 100; + + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js index d76c98d99bfec..678f442c81778 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,28 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; -//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -180,3 +169,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 463c9de0544c7..cbfbf3d44b125 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -143,3 +146,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js index ab5afbce6a0d1..657185cbc021b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,8 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -242,3 +243,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 03e43850ee96a..ced09b7bee581 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,74 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -273,3 +274,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index d9199bcceeff8..861edfaf54824 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,70 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -248,3 +249,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js index 3502ea656ffed..573187027d65f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,14 +148,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -222,12 +270,26 @@ console.log("hi"); } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:04 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. @@ -264,16 +326,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -282,7 +343,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:10 AM] Found 1 error. Watching for file changes. @@ -295,7 +356,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -319,22 +379,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:14 AM] File change detected. Starting incremental compilation... -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 0 errors. Watching for file changes. @@ -347,6 +406,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -370,12 +430,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -432,50 +486,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - - -[12:01:21 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -518,3 +531,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js index ff3d37d1756f4..506e4dbccaa26 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,33 +148,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - Output:: >> Screen clear @@ -215,8 +201,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -270,8 +277,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -321,18 +330,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - Output:: >> Screen clear @@ -376,8 +381,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -420,3 +433,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 58a0005b30727..c1499426dfe62 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,22 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +[12:00:55 AM] Found 0 errors. Watching for file changes. @@ -105,10 +162,8 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -132,14 +187,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -161,46 +208,3 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -[12:00:55 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 5e8a348d78390..982a89273f3ab 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,8 +83,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -147,3 +150,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 236386fd3c440..1bb82e91064ac 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,11 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents Output:: >> Screen clear @@ -284,3 +273,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 8fd7efd32500b..e3932bd535b8b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,81 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents Output:: >> Screen clear @@ -320,3 +314,13 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 76c72db2a767e..02b7ae21fec85 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,77 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents Output:: >> Screen clear @@ -286,3 +280,13 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js index e9b5c0f582db9..7366de158e26b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,14 +148,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -237,12 +285,26 @@ export {}; } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. @@ -279,16 +341,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -297,7 +358,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:16 AM] Found 1 error. Watching for file changes. @@ -310,7 +371,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -334,22 +394,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:20 AM] File change detected. Starting incremental compilation... -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:30 AM] Found 0 errors. Watching for file changes. @@ -362,6 +421,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -385,12 +445,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -449,50 +503,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... - - -[12:01:30 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -535,3 +548,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js index 81d56e023aeb1..5c49133a9b39f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,47 +148,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - Output:: >> Screen clear @@ -229,8 +201,43 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -284,8 +291,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -335,19 +344,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Output:: >> Screen clear @@ -391,8 +395,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -435,3 +448,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 98bae9be0b240..f3453be352cc5 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,28 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; -//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -187,3 +176,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 885f76b281a30..8f3711da6535a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -150,3 +153,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js index 39be95277fede..341a037d53973 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,8 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -226,3 +227,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index e927c312aca2d..7da3a7dbe7b08 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,74 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -285,3 +286,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 96f39107d7d48..9f3185b89fc4a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,70 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents Output:: >> Screen clear @@ -259,3 +260,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js index 60123ba64603c..4c54f4a3dcf5a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -95,8 +96,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -151,14 +154,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -227,12 +275,26 @@ console.log("hi"); } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:04 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. @@ -269,16 +331,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -287,7 +348,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:10 AM] Found 1 error. Watching for file changes. @@ -300,7 +361,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -324,22 +384,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:14 AM] File change detected. Starting incremental compilation... -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 0 errors. Watching for file changes. @@ -352,6 +411,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -375,12 +435,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -436,50 +490,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - - -[12:01:21 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -522,3 +535,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js index c98673a9e5459..1d9f4c72e4d04 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -39,6 +39,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -95,8 +96,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -151,33 +154,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - Output:: >> Screen clear @@ -221,8 +207,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -276,8 +283,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -327,18 +336,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - Output:: >> Screen clear @@ -382,8 +387,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -426,3 +439,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 753bb12c9089f..c7c400db6feae 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,28 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. + +4 console.log(b.c.d); +   ~ + + +[12:00:58 AM] Found 1 error. Watching for file changes. @@ -105,7 +168,6 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts /user/username/projects/myproject/a.ts @@ -132,14 +194,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -162,53 +216,3 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - - -[12:00:58 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index 1aed7b22bc0e4..439545f26df85 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,15 +83,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { d2: number; } -//// [/user/username/projects/myproject/a.d.ts] file written with same contents Output:: >> Screen clear @@ -155,3 +157,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 3ab5d9765474b..a82d079b1ff45 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,13 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents Output:: >> Screen clear @@ -270,3 +257,20 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents +//// [/user/username/projects/myproject/d.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 18c3f4e5ea19d..fb0b270d9dfec 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,86 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -337,3 +326,18 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 9f9528102adb4..71b8c163bbca7 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,81 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -301,3 +291,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js index 71fbb59e88bfb..c39991c7ecb7c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,14 +148,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -236,12 +284,26 @@ export {}; } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. @@ -278,16 +340,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -296,7 +357,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:16 AM] Found 1 error. Watching for file changes. @@ -309,7 +370,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -333,22 +393,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:20 AM] File change detected. Starting incremental compilation... -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:30 AM] Found 0 errors. Watching for file changes. @@ -361,6 +420,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -384,12 +444,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -447,50 +501,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... - - -[12:01:30 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -533,3 +546,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js index 3ee3f8f7fe5a0..abfaf05f87ddb 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,47 +148,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - Output:: >> Screen clear @@ -229,8 +201,43 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -284,8 +291,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -335,19 +344,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Output:: >> Screen clear @@ -391,8 +395,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -435,3 +448,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 9befd300cb59f..99e300fde170d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,42 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - this.d = 1; - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.B = void 0; -var c_1 = require("./c"); -var B = /** @class */ (function () { - function B() { - this.c = new c_1.C(); - } - return B; -}()); -exports.B = B; - - -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -115,27 +81,51 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; exports.C = void 0; var C = /** @class */ (function () { function C() { - this.d2 = 1; + this.d = 1; } return C; }()); exports.C = C; +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.B = void 0; +var c_1 = require("./c"); +var B = /** @class */ (function () { + function B() { + this.c = new c_1.C(); + } + return B; +}()); +exports.B = B; + + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + Output:: >> Screen clear @@ -186,3 +176,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + this.d2 = 1; + } + return C; +}()); +exports.C = C; + + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index d2a6bdb3d1760..8d5b58eb79166 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,15 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -90,8 +83,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { @@ -150,3 +153,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js index 16443b207d4ed..51bd8f1d19a6c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,47 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -161,8 +122,50 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + + Change:: Rename property x2 to x of interface Coords +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -173,7 +176,6 @@ export interface Coords { y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -225,3 +227,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 1c96e77804b39..9012a45cbe34b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:00:54 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -152,73 +213,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:00:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents Output:: >> Screen clear @@ -284,3 +286,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 950359dda9e4e..1fd4cc8df5be6 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:00:50 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -134,69 +191,14 @@ exports.App = App; -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:00:50 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents Output:: >> Screen clear @@ -258,3 +260,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js index c497b7cf5da36..fae85fec53efc 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,14 +148,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:00 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -222,12 +270,26 @@ console.log("hi"); } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:04 AM] File change detected. Starting incremental compilation... -[12:01:00 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:05 AM] Found 1 error. Watching for file changes. @@ -264,16 +326,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:04 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -282,7 +343,7 @@ Output::    ~ -[12:01:05 AM] Found 1 error. Watching for file changes. +[12:01:10 AM] Found 1 error. Watching for file changes. @@ -295,7 +356,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -319,22 +379,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:14 AM] File change detected. Starting incremental compilation... -[12:01:10 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 0 errors. Watching for file changes. @@ -347,6 +406,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -370,12 +430,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -432,50 +486,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - - -[12:01:21 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -518,3 +531,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js index 83915898829c2..3e4e7d9ebc884 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,33 +148,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - Output:: >> Screen clear @@ -215,8 +201,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -270,8 +277,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -321,18 +330,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - Output:: >> Screen clear @@ -376,8 +381,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -420,3 +433,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js index 246ed8ea68640..670907d8c8b8e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,6 +34,53 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:25 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] +Program options: {"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -87,12 +134,28 @@ export {}; +Change:: Rename property d to d2 of class C + +Input:: +//// [/user/username/projects/myproject/c.ts] +export class C +{ + d2 = 1; +} + + Output:: >> Screen clear -[12:00:25 AM] Starting compilation in watch mode... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:38 AM] Found 0 errors. Watching for file changes. +a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. + +4 console.log(b.c.d); +   ~ + + +[12:00:55 AM] Found 1 error. Watching for file changes. @@ -105,7 +168,6 @@ Program files:: /user/username/projects/myproject/a.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts /user/username/projects/myproject/a.ts @@ -132,14 +194,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property d to d2 of class C - -//// [/user/username/projects/myproject/c.ts] -export class C -{ - d2 = 1; -} - //// [/user/username/projects/myproject/c.js] "use strict"; exports.__esModule = true; @@ -161,53 +215,3 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents - -Output:: ->> Screen clear -[12:00:42 AM] File change detected. Starting incremental compilation... - - -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - - -[12:00:55 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts"] -Program options: {"isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js index d3d3612e5869d..99797e241d431 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/updates-errors-when-deep-import-through-declaration-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] import {B} from './b'; declare var console: any; @@ -34,19 +34,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -var b_1 = require("./b"); -var b = new b_1.B(); -console.log(b.c.d); - - -//// [/user/username/projects/myproject/a.d.ts] -export {}; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -94,15 +83,28 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var b = new b_1.B(); +console.log(b.c.d); + + +//// [/user/username/projects/myproject/a.d.ts] +export {}; + + + Change:: Rename property d to d2 of class C +Input:: //// [/user/username/projects/myproject/c.d.ts] export class C { d2: number; } -//// [/user/username/projects/myproject/a.d.ts] file written with same contents Output:: >> Screen clear @@ -155,3 +157,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index a34115616e14c..b0941f6d5c530 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/a.ts] export interface Point { name: string; @@ -49,77 +49,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/myproject/b.d.ts] -import { Point } from "./a"; -export interface PointWrapper extends Point { -} - - -//// [/user/username/projects/myproject/c.js] -"use strict"; -exports.__esModule = true; -exports.getPoint = void 0; -function getPoint() { - return { - name: "test", - c: { - x: 1, - y: 2 - } - }; -} -exports.getPoint = getPoint; -; - - -//// [/user/username/projects/myproject/c.d.ts] -import { PointWrapper } from "./b"; -export declare function getPoint(): PointWrapper; - - -//// [/user/username/projects/myproject/d.js] -"use strict"; -exports.__esModule = true; -var c_1 = require("./c"); -c_1.getPoint().c.x; - - -//// [/user/username/projects/myproject/d.d.ts] -export {}; - - -//// [/user/username/projects/myproject/e.js] -"use strict"; -exports.__esModule = true; -require("./d"); - - -//// [/user/username/projects/myproject/e.d.ts] -import "./d"; - - +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -191,20 +122,81 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename property x2 to x of interface Coords +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; -//// [/user/username/projects/myproject/a.ts] + +//// [/user/username/projects/myproject/a.d.ts] export interface Point { name: string; c: Coords; } export interface Coords { - x: number; + x2: number; y: number; -} +} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/myproject/b.d.ts] +import { Point } from "./a"; +export interface PointWrapper extends Point { +} + + +//// [/user/username/projects/myproject/c.js] +"use strict"; +exports.__esModule = true; +exports.getPoint = void 0; +function getPoint() { + return { + name: "test", + c: { + x: 1, + y: 2 + } + }; +} +exports.getPoint = getPoint; +; + + +//// [/user/username/projects/myproject/c.d.ts] +import { PointWrapper } from "./b"; +export declare function getPoint(): PointWrapper; + + +//// [/user/username/projects/myproject/d.js] +"use strict"; +exports.__esModule = true; +var c_1 = require("./c"); +c_1.getPoint().c.x; + + +//// [/user/username/projects/myproject/d.d.ts] +export {}; + + +//// [/user/username/projects/myproject/e.js] +"use strict"; +exports.__esModule = true; +require("./d"); + + +//// [/user/username/projects/myproject/e.d.ts] +import "./d"; + + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] export interface Point { name: string; c: Coords; @@ -212,12 +204,8 @@ export interface Point { export interface Coords { x: number; y: number; -} - +} -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents Output:: >> Screen clear @@ -269,3 +257,19 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents +//// [/user/username/projects/myproject/d.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index e793fd4f72b8d..6ac5eafcfdda2 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -54,6 +54,67 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -192,85 +253,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:39 AM] Starting compilation in watch mode... - - -[12:01:08 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -336,3 +326,17 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 8eed0ceda00ab..fdfdf054d5326 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title: string; @@ -48,6 +48,63 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } + +/a/lib/tsc.js --w +Output:: +>> Screen clear +[12:00:37 AM] Starting compilation in watch mode... + + +[12:01:02 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/myproject/lib1/tools/tools.interface.js] "use strict"; exports.__esModule = true; @@ -165,80 +222,14 @@ export declare class App { -Output:: ->> Screen clear -[12:00:37 AM] Starting compilation in watch mode... - - -[12:01:02 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","isolatedModules":true,"declaration":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: Rename property title to title2 of interface ITest +Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] export interface ITest { title2: string; } -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Output:: >> Screen clear @@ -300,3 +291,16 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents +//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/app.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js index 2c19d3533c8be..ff43939b2d827 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --incremental +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w --incremental Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,14 +148,59 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; + +Output:: +>> Screen clear +[12:00:41 AM] File change detected. Starting incremental compilation... + + +[12:01:06 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] +Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +WatchedFiles:: +/user/username/projects/noemitonerror/tsconfig.json: + {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} +/user/username/projects/noemitonerror/shared/types/db.ts: + {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/main.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} +/user/username/projects/noemitonerror/src/other.ts: + {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/noemitonerror/node_modules/@types: + {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/noemitonerror: + {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] "use strict"; exports.__esModule = true; @@ -237,12 +285,26 @@ export {}; } +Change:: Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = 10; + + Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +2 const a: string = 10; +   ~ + + +[12:01:11 AM] Found 1 error. Watching for file changes. @@ -279,16 +341,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Semantic Error -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = 10; +Change:: No change +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: >> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -297,7 +358,7 @@ Output::    ~ -[12:01:11 AM] Found 1 error. Watching for file changes. +[12:01:16 AM] Found 1 error. Watching for file changes. @@ -310,7 +371,6 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -334,22 +394,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: No change -//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents +Change:: Fix Semantic Error + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +const a: string = "hello"; + Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... - - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ +[12:01:20 AM] File change detected. Starting incremental compilation... -[12:01:16 AM] Found 1 error. Watching for file changes. +[12:01:30 AM] Found 0 errors. Watching for file changes. @@ -362,6 +421,7 @@ Program files:: /user/username/projects/noEmitOnError/src/other.ts Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts WatchedFiles:: /user/username/projects/noemitonerror/tsconfig.json: @@ -385,12 +445,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error - -//// [/user/username/projects/noEmitOnError/src/main.ts] -import { A } from "../shared/types/db"; -const a: string = "hello"; - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; exports.__esModule = true; @@ -449,50 +503,9 @@ var a = "hello"; } -Output:: ->> Screen clear -[12:01:20 AM] File change detected. Starting incremental compilation... - - -[12:01:30 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"isolatedModules":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/noEmitOnError/src/main.ts - -WatchedFiles:: -/user/username/projects/noemitonerror/tsconfig.json: - {"fileName":"/user/username/projects/noEmitOnError/tsconfig.json","pollingInterval":250} -/user/username/projects/noemitonerror/shared/types/db.ts: - {"fileName":"/user/username/projects/noEmitOnError/shared/types/db.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/main.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/main.ts","pollingInterval":250} -/user/username/projects/noemitonerror/src/other.ts: - {"fileName":"/user/username/projects/noEmitOnError/src/other.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/noemitonerror/node_modules/@types: - {"directoryName":"/user/username/projects/noEmitOnError/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/noemitonerror: - {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -535,3 +548,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js index 7a37b658c044e..4c37c0c9949cf 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/user/username/projects/noEmitOnError/shared/types/db.ts] export interface A { name: string; @@ -33,6 +33,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; +/a/lib/tsc.js --w Output:: >> Screen clear [12:00:31 AM] Starting compilation in watch mode... @@ -89,8 +90,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -145,47 +148,16 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Syntax error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' }; -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] -"use strict"; -exports.__esModule = true; - - -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = { - lastName: 'sdsd' -}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] -"use strict"; -exports.__esModule = true; -console.log("hi"); - - -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - Output:: >> Screen clear @@ -229,8 +201,43 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +exports.__esModule = true; + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = { + lastName: 'sdsd' +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +exports.__esModule = true; +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + + Change:: Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = 10; @@ -284,8 +291,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -335,19 +344,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Fix Semantic Error +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; const a: string = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] -"use strict"; -exports.__esModule = true; -var a = "hello"; - - -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents Output:: >> Screen clear @@ -391,8 +395,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +exports.__esModule = true; +var a = "hello"; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents + Change:: No change +Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: @@ -435,3 +448,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/noemitonerror","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js index a3b100ebb2fd0..846b40f92ed59 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-changing-module-name-with-different-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/logger.ts] export class logger { } @@ -21,26 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/logger.js] -"use strict"; -exports.__esModule = true; -exports.logger = void 0; -var logger = /** @class */ (function () { - function logger() { - } - return logger; -}()); -exports.logger = logger; - - -//// [/user/username/projects/myproject/another.js] -"use strict"; -exports.__esModule = true; -var logger_1 = require("./logger"); -new logger_1.logger(); - - +/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -82,18 +64,32 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change module name from logger to Logger +//// [/user/username/projects/myproject/logger.js] +"use strict"; +exports.__esModule = true; +exports.logger = void 0; +var logger = /** @class */ (function () { + function logger() { + } + return logger; +}()); +exports.logger = logger; -//// [/user/username/projects/myproject/another.ts] -import { logger } from "./Logger"; new logger(); //// [/user/username/projects/myproject/another.js] "use strict"; exports.__esModule = true; -var Logger_1 = require("./Logger"); -new Logger_1.logger(); +var logger_1 = require("./logger"); +new logger_1.logger(); + +Change:: Change module name from logger to Logger + +Input:: +//// [/user/username/projects/myproject/another.ts] +import { logger } from "./Logger"; new logger(); + Output:: >> Screen clear @@ -139,3 +135,11 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/another.js] +"use strict"; +exports.__esModule = true; +var Logger_1 = require("./Logger"); +new Logger_1.logger(); + + diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js index 2eb2a2a367c1d..da71904a3e9dc 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/when-renaming-file-with-different-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/logger.ts] export class logger { } @@ -21,26 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/logger.js] -"use strict"; -exports.__esModule = true; -exports.logger = void 0; -var logger = /** @class */ (function () { - function logger() { - } - return logger; -}()); -exports.logger = logger; - - -//// [/user/username/projects/myproject/another.js] -"use strict"; -exports.__esModule = true; -var logger_1 = require("./logger"); -new logger_1.logger(); - - +/a/lib/tsc.js --w --p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -82,8 +64,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/logger.js] +"use strict"; +exports.__esModule = true; +exports.logger = void 0; +var logger = /** @class */ (function () { + function logger() { + } + return logger; +}()); +exports.logger = logger; + + +//// [/user/username/projects/myproject/another.js] +"use strict"; +exports.__esModule = true; +var logger_1 = require("./logger"); +new logger_1.logger(); + + + Change:: Change name of file from logger to Logger +Input:: //// [/user/username/projects/myproject/Logger.ts] file was renamed from file /user/username/projects/myproject/logger.ts Output:: @@ -129,3 +132,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js index 365c6f2a18c40..20b55b9b93e8d 100644 --- a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -42,6 +42,35 @@ export { C } from "./c"; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"target":"es5","module":"commonjs","declaration":true,"emitDeclarationOnly":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/c.d.ts] import { A } from "./a"; export interface C { @@ -151,6 +180,18 @@ export { C } from "./c"; } +Change:: + +Input:: +//// [/users/username/projects/project/a.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + + Output:: @@ -164,7 +205,6 @@ Program files:: /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/c.ts /users/username/projects/project/b.ts /users/username/projects/project/a.ts @@ -178,16 +218,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/a.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - //// [/users/username/projects/project/c.d.ts] file written with same contents //// [/users/username/projects/project/b.d.ts] file written with same contents //// [/users/username/projects/project/a.d.ts] @@ -280,29 +310,3 @@ export interface A { "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js index 05a0761a77f37..effba9ef87ed9 100644 --- a/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/incremental-with-circular-references-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -42,6 +42,57 @@ export { C } from "./c"; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"target":"es5","module":"commonjs","declaration":true,"emitDeclarationOnly":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:27 AM] Starting compilation in watch mode... + + +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/c.ts +/users/username/projects/project/b.ts +/users/username/projects/project/a.ts +/users/username/projects/project/index.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/a.ts: + {"fileName":"/users/username/projects/project/a.ts","pollingInterval":250} +/users/username/projects/project/b.ts: + {"fileName":"/users/username/projects/project/b.ts","pollingInterval":250} +/users/username/projects/project/c.ts: + {"fileName":"/users/username/projects/project/c.ts","pollingInterval":250} +/users/username/projects/project/index.ts: + {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/c.d.ts] import { A } from "./a"; export interface C { @@ -152,12 +203,24 @@ export { C } from "./c"; } +Change:: + +Input:: +//// [/users/username/projects/project/a.ts] +import { B } from "./b"; +export interface A { + b: B; + foo: any; +} + + + Output:: >> Screen clear -[12:00:27 AM] Starting compilation in watch mode... +[12:00:42 AM] Starting compilation in watch mode... -[12:00:38 AM] Found 0 errors. Watching for file changes. +[12:00:58 AM] Found 0 errors. Watching for file changes. @@ -171,7 +234,6 @@ Program files:: /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/c.ts /users/username/projects/project/b.ts /users/username/projects/project/a.ts @@ -201,16 +263,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/a.ts] -import { B } from "./b"; -export interface A { - b: B; - foo: any; -} - - //// [/users/username/projects/project/c.d.ts] file written with same contents //// [/users/username/projects/project/b.d.ts] file written with same contents //// [/users/username/projects/project/a.d.ts] @@ -304,51 +356,3 @@ export interface A { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:42 AM] Starting compilation in watch mode... - - -[12:00:58 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/a.ts","/users/username/projects/project/b.ts","/users/username/projects/project/c.ts","/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"target":1,"module":1,"declaration":true,"emitDeclarationOnly":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/c.ts -/users/username/projects/project/b.ts -/users/username/projects/project/a.ts -/users/username/projects/project/index.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/a.ts: - {"fileName":"/users/username/projects/project/a.ts","pollingInterval":250} -/users/username/projects/project/b.ts: - {"fileName":"/users/username/projects/project/b.ts","pollingInterval":250} -/users/username/projects/project/c.ts: - {"fileName":"/users/username/projects/project/c.ts","pollingInterval":250} -/users/username/projects/project/index.ts: - {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js index 38683519ba85b..90c3ae77f08e4 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,40 @@ export const y: string = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -i +Output:: +file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 export const y: string = 20; +   ~ + + + +Found 1 error. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -88,6 +122,13 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +export const z = 10; + + Output:: file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -108,9 +149,7 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts WatchedFiles:: @@ -120,11 +159,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated -Change:: - -//// [/users/username/projects/project/file1.ts] -export const z = 10; - //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -182,33 +216,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: -file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 export const y: string = 20; -   ~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file1.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js index 6b5182eb320b7..9dd7e5107581a 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,55 @@ export const y: string = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 export const y: string = 20; +   ~ + + +[12:00:30 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -89,9 +138,16 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +export const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -100,7 +156,7 @@ Output::    ~ -[12:00:30 AM] Found 1 error. Watching for file changes. +[12:00:41 AM] Found 1 error. Watching for file changes. @@ -112,9 +168,7 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts /users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts WatchedFiles:: /users/username/projects/project/tsconfig.json: @@ -136,11 +190,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file1.ts] -export const z = 10; - //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -199,48 +248,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -file2.ts:1:14 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 export const y: string = 20; -   ~ - - -[12:00:41 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file1.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js index 56905961a52bd..84c54399ab0e0 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -76,6 +101,13 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +export const z = 10; + + Output:: @@ -87,8 +119,6 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts /users/username/projects/project/file2.ts WatchedFiles:: @@ -99,11 +129,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -export const z = 10; - //// [/users/username/projects/project/file2.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -149,24 +174,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js index 3e47a20b302bc..4dc9c9bac62ec 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-without-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -77,12 +120,19 @@ define(["require", "exports"], function (require, exports) { } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +export const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:41 AM] Found 0 errors. Watching for file changes. @@ -94,8 +144,6 @@ Program files:: /users/username/projects/project/file2.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts /users/username/projects/project/file2.ts WatchedFiles:: @@ -118,11 +166,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -export const z = 10; - //// [/users/username/projects/project/file2.js] define(["require", "exports"], function (require, exports) { "use strict"; @@ -169,42 +212,3 @@ define(["require", "exports"], function (require, exports) { "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:41 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js index 45a1509e76e76..54598288bb73c 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,28 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd","outFile":"out.js"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/out.js] define("file1", ["require", "exports"], function (require, exports) { "use strict"; @@ -77,23 +99,3 @@ define("file2", ["require", "exports"], function (require, exports) { ====================================================================== - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js index 35d0ead9ec197..1e53b7ef91e02 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/with---out-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,46 @@ export const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"module":"amd","outFile":"out.js"}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:28 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/out.js] define("file1", ["require", "exports"], function (require, exports) { "use strict"; @@ -77,41 +117,3 @@ define("file2", ["require", "exports"], function (require, exports) { ====================================================================== - -Output:: ->> Screen clear -[12:00:23 AM] Starting compilation in watch mode... - - -[12:00:28 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"module":2,"outFile":"/users/username/projects/project/out.js","watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js index f18ae0b753a34..b4d69bd3cf76a 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,40 @@ const x = 10; //// [/users/username/projects/project/file2.ts] const y: string = 20; + +/a/lib/tsc.js -i +Output:: +file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 const y: string = 20; +   ~ + + + +Found 1 error. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + //// [/users/username/projects/project/file1.js] var x = 10; @@ -77,6 +111,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +const z = 10; + + Output:: file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -109,11 +150,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated -Change:: - -//// [/users/username/projects/project/file1.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] var z = 10; @@ -166,35 +202,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: -file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 const y: string = 20; -   ~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js index a89fd0ac73be0..ee0119a60f240 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,55 @@ const x = 10; //// [/users/username/projects/project/file2.ts] const y: string = 20; + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. + +1 const y: string = 20; +   ~ + + +[12:00:30 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -78,9 +127,16 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file1.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. @@ -89,7 +145,7 @@ Output::    ~ -[12:00:30 AM] Found 1 error. Watching for file changes. +[12:00:44 AM] Found 1 error. Watching for file changes. @@ -125,11 +181,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file1.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] var z = 10; @@ -183,50 +234,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -file2.ts:1:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -1 const y: string = 20; -   ~ - - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js index c0f957dbfc787..e0b106a3661bd 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i -p tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i -p tsconfig.json +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] var x = 10; @@ -66,6 +91,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: @@ -89,11 +121,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -135,26 +162,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js index 436fedacfabd5..048847f50ab15 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/with-commandline-parameters-that-are-not-relative-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w -p tsconfig.json +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -67,12 +110,19 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:44 AM] Found 0 errors. Watching for file changes. @@ -108,11 +158,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -155,44 +200,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:44 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"project":"/users/username/projects/project/tsconfig.json","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js index 340a0870acc7f..cfe0d394096f8 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,31 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/file1.js] var x = 10; @@ -65,6 +90,13 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: @@ -88,11 +120,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.Success -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -133,26 +160,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js index d6403f05f9832..a13bc347bf484 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-without-errors/without-commandline-options-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,49 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/file1.ts: + {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} +/users/username/projects/project/file2.ts: + {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/file1.js] var x = 10; @@ -66,12 +109,19 @@ var y = 20; } +Change:: + +Input:: +//// [/users/username/projects/project/file2.ts] +const z = 10; + + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:34 AM] Starting compilation in watch mode... -[12:00:30 AM] Found 0 errors. Watching for file changes. +[12:00:44 AM] Found 0 errors. Watching for file changes. @@ -107,11 +157,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - -//// [/users/username/projects/project/file2.ts] -const z = 10; - //// [/users/username/projects/project/file1.js] file written with same contents //// [/users/username/projects/project/file2.js] var z = 10; @@ -153,44 +198,3 @@ var z = 10; "version": "FakeTSVersion" } - -Output:: ->> Screen clear -[12:00:34 AM] Starting compilation in watch mode... - - -[12:00:44 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/file1.ts: - {"fileName":"/users/username/projects/project/file1.ts","pollingInterval":250} -/users/username/projects/project/file2.ts: - {"fileName":"/users/username/projects/project/file2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js index 9912192f03220..b23aae24c4e93 100644 --- a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,6 +23,31 @@ console.log(Config.value); //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/index.js] console.log(Config.value); @@ -63,19 +88,30 @@ console.log(Config.value); } +Change:: + +Input:: +//// [/users/username/projects/project/globals.d.ts] deleted + Output:: +index.ts:1:13 - error TS2304: Cannot find name 'Config'. + +1 console.log(Config.value); +   ~~~~~~ + + +Found 1 error. + -Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] + +Program root files: ["/users/username/projects/project/index.ts"] Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts WatchedFiles:: @@ -84,9 +120,7 @@ FsWatches:: FsWatchesRecursive:: -exitCode:: ExitStatus.Success - -Change:: +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/users/username/projects/project/index.js] file written with same contents //// [/users/username/projects/project/tsconfig.tsbuildinfo] @@ -130,33 +164,3 @@ Change:: "version": "FakeTSVersion" } -//// [/users/username/projects/project/globals.d.ts] deleted - -Output:: -index.ts:1:13 - error TS2304: Cannot find name 'Config'. - -1 console.log(Config.value); -   ~~~~~~ - - - -Found 1 error. - - - -Program root files: ["/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/index.ts - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js index 844cd06bc43eb..937711368678d 100644 --- a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -23,6 +23,49 @@ console.log(Config.value); //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true}} + +/a/lib/tsc.js -w +Output:: +>> Screen clear +[12:00:23 AM] Starting compilation in watch mode... + + +[12:00:28 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] +Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/users/username/projects/project/globals.d.ts +/users/username/projects/project/index.ts + +WatchedFiles:: +/users/username/projects/project/tsconfig.json: + {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} +/users/username/projects/project/globals.d.ts: + {"fileName":"/users/username/projects/project/globals.d.ts","pollingInterval":250} +/users/username/projects/project/index.ts: + {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/users/username/projects/project/node_modules/@types: + {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/users/username/projects/project: + {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + //// [/users/username/projects/project/index.js] console.log(Config.value); @@ -64,32 +107,38 @@ console.log(Config.value); } +Change:: + +Input:: +//// [/users/username/projects/project/globals.d.ts] deleted + Output:: >> Screen clear -[12:00:23 AM] Starting compilation in watch mode... +[12:00:30 AM] Starting compilation in watch mode... -[12:00:28 AM] Found 0 errors. Watching for file changes. +index.ts:1:13 - error TS2304: Cannot find name 'Config'. + +1 console.log(Config.value); +   ~~~~~~ +[12:00:37 AM] Found 1 error. Watching for file changes. + -Program root files: ["/users/username/projects/project/globals.d.ts","/users/username/projects/project/index.ts"] + +Program root files: ["/users/username/projects/project/index.ts"] Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} Program files:: /a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts Semantic diagnostics in builder refreshed for:: -/a/lib/lib.d.ts -/users/username/projects/project/globals.d.ts /users/username/projects/project/index.ts WatchedFiles:: /users/username/projects/project/tsconfig.json: {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/globals.d.ts: - {"fileName":"/users/username/projects/project/globals.d.ts","pollingInterval":250} /users/username/projects/project/index.ts: {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} /a/lib/lib.d.ts: @@ -105,8 +154,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: - //// [/users/username/projects/project/index.js] file written with same contents //// [/users/username/projects/project/tsconfig.tsbuildinfo] { @@ -150,46 +197,3 @@ Change:: "version": "FakeTSVersion" } -//// [/users/username/projects/project/globals.d.ts] deleted - -Output:: ->> Screen clear -[12:00:30 AM] Starting compilation in watch mode... - - -index.ts:1:13 - error TS2304: Cannot find name 'Config'. - -1 console.log(Config.value); -   ~~~~~~ - - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/users/username/projects/project/index.ts"] -Program options: {"incremental":true,"watch":true,"configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/index.ts - -Semantic diagnostics in builder refreshed for:: -/users/username/projects/project/index.ts - -WatchedFiles:: -/users/username/projects/project/tsconfig.json: - {"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250} -/users/username/projects/project/index.ts: - {"fileName":"/users/username/projects/project/index.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/users/username/projects/project/node_modules/@types: - {"directoryName":"/users/username/projects/project/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/users/username/projects/project: - {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js b/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js index 755aae38414ce..8752fcfc950da 100644 --- a/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/with---out-incremental.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -i +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,6 +21,28 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"outFile":"out.js"}} + +/a/lib/tsc.js -i +Output:: + + +Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] +Program options: {"incremental":true,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} +Program files:: +/a/lib/lib.d.ts +/users/username/projects/project/file1.ts +/users/username/projects/project/file2.ts + +No cached semantic diagnostics in the builder:: + +WatchedFiles:: + +FsWatches:: + +FsWatchesRecursive:: + +exitCode:: ExitStatus.Success + //// [/users/username/projects/project/out.js] var x = 10; var y = 20; @@ -57,23 +79,3 @@ var y = 20; ====================================================================== - -Output:: - - -Program root files: ["/users/username/projects/project/file1.ts","/users/username/projects/project/file2.ts"] -Program options: {"incremental":true,"outFile":"/users/username/projects/project/out.js","configFilePath":"/users/username/projects/project/tsconfig.json"} -Program files:: -/a/lib/lib.d.ts -/users/username/projects/project/file1.ts -/users/username/projects/project/file2.ts - -No cached semantic diagnostics in the builder:: - -WatchedFiles:: - -FsWatches:: - -FsWatchesRecursive:: - -exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tscWatch/incremental/with---out-watch.js b/tests/baselines/reference/tscWatch/incremental/with---out-watch.js index 48f323ca94904..74d8a0e7d8fad 100644 --- a/tests/baselines/reference/tscWatch/incremental/with---out-watch.js +++ b/tests/baselines/reference/tscWatch/incremental/with---out-watch.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,43 +21,8 @@ const y = 20; //// [/users/username/projects/project/tsconfig.json] {"compilerOptions":{"incremental":true,"outFile":"out.js"}} -//// [/users/username/projects/project/out.js] -var x = 10; -var y = 20; - - -//// [/users/username/projects/project/out.tsbuildinfo] -{ - "bundle": { - "commonSourceDirectory": "./", - "sourceFiles": [ - "./file1.ts", - "./file2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 24, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion" -} - -//// [/users/username/projects/project/out.tsbuildinfo.baseline.txt] -====================================================================== -File:: /users/username/projects/project/out.js ----------------------------------------------------------------------- -text: (0-24) -var x = 10; -var y = 20; - -====================================================================== - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -95,3 +60,40 @@ FsWatchesRecursive:: {"directoryName":"/users/username/projects/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/users/username/projects/project/out.js] +var x = 10; +var y = 20; + + +//// [/users/username/projects/project/out.tsbuildinfo] +{ + "bundle": { + "commonSourceDirectory": "./", + "sourceFiles": [ + "./file1.ts", + "./file2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 24, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion" +} + +//// [/users/username/projects/project/out.tsbuildinfo.baseline.txt] +====================================================================== +File:: /users/username/projects/project/out.js +---------------------------------------------------------------------- +text: (0-24) +var x = 10; +var y = 20; + +====================================================================== + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js b/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js index 383145eb54d45..8c7c69a022520 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Configure-file-diagnostics-events-are-generated-when-the-config-file-has-errors.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -23,11 +23,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -76,3 +73,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js b/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js index a1ba8d3cd229c..997998994b27d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Options-Diagnostic-locations-reported-correctly-with-changes-in-configFile-contents-when-options-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -26,11 +26,8 @@ interface Array { length: number; [n: number]: T; } } } -//// [/a/b/app.js] -var x = 10; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQSJ9 - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -84,8 +81,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/app.js] +var x = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXBwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQSJ9 + + Change:: Remove the comment from config file +Input:: //// [/a/b/tsconfig.json] { @@ -148,3 +151,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js b/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js index 554a671cc9219..8c83002697e72 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Proper-errors-document-is-not-contained-in-project.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] @@ -18,10 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] { -//// [/a/b/app.js] - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -69,3 +67,7 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js b/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js index 65754c1610855..fde76a8484b63 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Reports-errors-when-the-config-file-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,8 +57,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/app.js] +var x = 10; + + + Change:: change config file to add error +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -111,8 +114,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: change config file to remove error +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -154,3 +159,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js b/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js index 594cd2eb8fabf..385e212c21511 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/Updates-diagnostics-when-'--noUnusedLabels'-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -18,11 +18,8 @@ label: while (1) {} //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":true}} -//// [/a.js] -label: while (1) { } - - +/a/lib/tsc.js -w -p /tsconfig.json Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -58,8 +55,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a.js] +label: while (1) { } + + + Change:: Disable allowUnsusedLabels +Input:: //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":false}} @@ -105,8 +108,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Enable allowUnsusedLabels +Input:: //// [/tsconfig.json] {"compilerOptions":{"allowUnusedLabels":true}} @@ -145,3 +150,4 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js b/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js index f8c37664c82c0..74d384d0d8bd4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js +++ b/tests/baselines/reference/tscWatch/programUpdates/add-new-files-to-a-configured-program-without-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,16 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + + Change:: Create commonFile2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 -//// [/a/b/commonFile2.js] -var y = 1; - - Output:: >> Screen clear @@ -111,3 +109,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js b/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js index 28536787baa6f..b7cd480a70459 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js +++ b/tests/baselines/reference/tscWatch/programUpdates/add-the-missing-module-file-for-inferred-project-should-remove-the-module-not-found-error.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file1.ts +Input:: //// [/a/b/file1.ts] import * as T from "./moduleFile"; T.bar(); @@ -15,14 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w /a/b/file1.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -62,20 +56,20 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + Change:: Create module file -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile.ts] export function bar() { } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; - - Output:: >> Screen clear @@ -110,3 +104,13 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js index 05b4dff88047c..dbca0e6dee9f9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-in-list-of-files).js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -21,11 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts"]} -//// [/a/b/f1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -61,16 +58,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + + Change:: Modify config to make f2 as root too +Input:: //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts","f2.ts"]} -//// [/a/b/f1.js] file written with same contents -//// [/a/b/f2.js] -var y = 1; - - Output:: >> Screen clear @@ -110,3 +108,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents +//// [/a/b/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js index 9ce22191c99f4..481bb09e67e25 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-correctly-update-configured-project-when-set-of-root-files-has-changed-(new-file-on-disk).js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/f1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -60,16 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + + Change:: Write f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] let y = 1 -//// [/a/b/f2.js] -var y = 1; - - Output:: >> Screen clear @@ -111,3 +109,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents +//// [/a/b/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js b/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js index 4b09ae0d84c00..ea62b80683445 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-handle-tsconfig-file-name-with-difference-casing.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /A/B/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 1 @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"include":["app.ts"]} -//// [/A/B/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /A/B/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -57,3 +54,8 @@ FsWatchesRecursive:: {"directoryName":"/A/B/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/A/B/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js b/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js index 54c0a0a507672..b38bb0fcc1a2c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js +++ b/tests/baselines/reference/tscWatch/programUpdates/can-update-configured-project-when-set-of-root-files-was-not-changed.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1 @@ -21,15 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {"compilerOptions":{},"files":["f1.ts","f2.ts"]} -//// [/a/b/f1.js] -var x = 1; - - -//// [/a/b/f2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -69,17 +62,22 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify config to set outFile option +//// [/a/b/f1.js] +var x = 1; -//// [/a/b/tsconfig.json] -{"compilerOptions":{"outFile":"out.js"},"files":["f1.ts","f2.ts"]} -//// [/a/b/out.js] -var x = 1; +//// [/a/b/f2.js] var y = 1; +Change:: Modify config to set outFile option + +Input:: +//// [/a/b/tsconfig.json] +{"compilerOptions":{"outFile":"out.js"},"files":["f1.ts","f2.ts"]} + + Output:: >> Screen clear [12:00:26 AM] File change detected. Starting incremental compilation... @@ -115,3 +113,9 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/out.js] +var x = 1; +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js index b5479b072793b..cdd141acda896 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,30 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/f2.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 1; - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -80,12 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Modify f2 to include f3 +//// [/a/b/f2.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 1; -//// [/a/b/f2.ts] -export * from "../c/f3" -//// [/a/b/f2.js] +//// [/a/b/f1.js] "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -98,16 +78,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); }; exports.__esModule = true; -__exportStar(require("../c/f3"), exports); +__exportStar(require("./f2"), exports); -//// [/a/b/f1.js] file written with same contents -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; +Change:: Modify f2 to include f3 + +Input:: +//// [/a/b/f2.ts] +export * from "../c/f3" Output:: @@ -147,3 +126,28 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] file written with same contents +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js b/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js index c12d28459fa22..8bffb59231bb6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/config-file-includes-the-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/c/tsconfig.json +Input:: //// [/a/b/f1.ts] export let x = 5 @@ -24,26 +24,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/c/tsconfig.json] {"compilerOptions":{},"files":["f2.ts","f3.ts"]} -//// [/a/b/f1.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 5; - - -//// [/a/c/f2.js] -"use strict"; -exports.__esModule = true; - - -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - +/a/lib/tsc.js -w -p /a/c/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -86,3 +68,23 @@ FsWatchesRecursive:: {"directoryName":"/a/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 5; + + +//// [/a/c/f2.js] +"use strict"; +exports.__esModule = true; + + +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js b/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js index 73d445952b7c5..3147228ef6c39 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js +++ b/tests/baselines/reference/tscWatch/programUpdates/config-file-is-deleted.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/f1.ts] let x = 1; @@ -21,15 +21,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/tsconfig.json] {} -//// [/a/b/f1.js] -var x = 1; - - -//// [/a/b/f2.js] -var y = 2; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -71,8 +64,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/f1.js] +var x = 1; + + +//// [/a/b/f2.js] +var y = 2; + + + Change:: Delete config file +Input:: //// [/a/b/tsconfig.json] deleted Output:: @@ -103,3 +106,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + diff --git a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js index 3763be7ba6d47..2ea212b52861d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/correctly-handles-changes-in-lib-section-of-config-file.js @@ -1,4 +1,4 @@ -/compiler/tsc.js -w -p /src/tsconfig.json +Input:: //// [/compiler/lib.es5.d.ts] /// interface Boolean {} @@ -22,11 +22,8 @@ var x: Promise; //// [/src/tsconfig.json] {"compilerOptions":{"module":"commonjs","target":"es5","noImplicitAny":true,"sourceMap":false,"lib":["es5"]}} -//// [/src/app.js] -var x; - - +/compiler/tsc.js -w -p /src/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -70,12 +67,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/src/app.js] +var x; + + + Change:: Change the lib in config +Input:: //// [/src/tsconfig.json] {"compilerOptions":{"module":"commonjs","target":"es5","noImplicitAny":true,"sourceMap":false,"lib":["es5","es2015.promise"]}} -//// [/src/app.js] file written with same contents Output:: >> Screen clear @@ -117,3 +119,5 @@ FsWatchesRecursive:: {"directoryName":"/src/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/src/app.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js b/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js index bc2124b1e496d..4bb5744fad1bb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js +++ b/tests/baselines/reference/tscWatch/programUpdates/create-configured-project-without-file-list.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/tsconfig.json] { @@ -30,15 +30,8 @@ let y = 1 //// [/a/b/e/f3.ts] let z = 1 -//// [/a/b/c/f1.js] -var x = 1; - - -//// [/a/b/d/f2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -79,3 +72,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/c/f1.js] +var x = 1; + + +//// [/a/b/d/f2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js index 0fe8f7ca2c816..665e8faa7bed1 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/create-watch-without-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/c/app.ts +Input:: //// [/a/b/c/app.ts] import {f} from "./module" @@ -21,14 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/c/app.js] -"use strict"; -exports.__esModule = true; -var module_1 = require("./module"); -console.log(module_1.f); - - +/a/lib/tsc.js -w /a/b/c/app.ts Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -77,3 +71,11 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/c/app.js] +"use strict"; +exports.__esModule = true; +var module_1 = require("./module"); +console.log(module_1.f); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js index 0d56470f85eb6..1475c4730da93 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts /a/c/f3.ts --noImplicitAny +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,46 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - -//// [/a/b/f2.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("../c/f3"), exports); - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts /a/c/f3.ts --noImplicitAny Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -100,9 +62,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./f2"), exports); + + + Change:: Delete f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] deleted Output:: @@ -145,3 +147,5 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js index 6973c5ff627cb..e2b1478004eff 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/f1.ts --noImplicitAny +Input:: //// [/a/b/f1.ts] export * from "./f2" @@ -21,46 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/c/f3.js] -"use strict"; -exports.__esModule = true; -exports.y = void 0; -exports.y = 1; - - -//// [/a/b/f2.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("../c/f3"), exports); - - -//// [/a/b/f1.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; -exports.__esModule = true; -__exportStar(require("./f2"), exports); - - +/a/lib/tsc.js -w /a/b/f1.ts --noImplicitAny Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -100,9 +62,49 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/c/f3.js] +"use strict"; +exports.__esModule = true; +exports.y = void 0; +exports.y = 1; + + +//// [/a/b/f2.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("../c/f3"), exports); + + +//// [/a/b/f1.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +exports.__esModule = true; +__exportStar(require("./f2"), exports); + + + Change:: Delete f2 -//// [/a/b/f1.js] file written with same contents +Input:: //// [/a/b/f2.ts] deleted Output:: @@ -142,3 +144,5 @@ FsWatchesRecursive:: {"directoryName":"/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/f1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js index 820146d84146b..c593913bad2ab 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/files-explicitly-excluded-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -27,15 +27,8 @@ let t = 1; "exclude": ["/a/c"] } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -76,3 +69,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js index 2a5c379d7ead6..e4ee4063e16a4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js +++ b/tests/baselines/reference/tscWatch/programUpdates/handle-recreated-files-correctly.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -71,9 +64,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: delete file2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] deleted Output:: @@ -112,10 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] file written with same contents + Change:: recreate file2 -//// [/a/b/commonFile1.js] file written with same contents -//// [/a/b/commonFile2.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 @@ -160,3 +163,6 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js b/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js index a14b42fb5a897..f1351053e1555 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js +++ b/tests/baselines/reference/tscWatch/programUpdates/handles-the-missing-files---that-were-added-to-program-because-they-were-added-with-tripleSlashRefs.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/commonFile1.ts +Input:: //// [/a/b/commonFile1.ts] /// let x = y @@ -16,12 +16,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/commonFile1.js] -/// -var x = y; - - +/a/lib/tsc.js -w /a/b/commonFile1.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -67,16 +63,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +/// +var x = y; + + + Change:: create file2 -//// [/a/b/commonFile1.js] file written with same contents +Input:: //// [/a/b/commonFile2.ts] let y = 1 -//// [/a/b/commonFile2.js] -var y = 1; - - Output:: >> Screen clear @@ -112,3 +110,9 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js b/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js index 41c2dc2f15990..60769793c9aa4 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js +++ b/tests/baselines/reference/tscWatch/programUpdates/if-config-file-doesnt-have-errors,-they-are-not-reported.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 10 @@ -20,11 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 10; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -61,3 +58,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js index dc4c73a43daef..19e51cd2be441 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js +++ b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-able-to-handle-@types-if-input-file-list-is-empty.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/tsconfig.json +Input:: //// [/a/app.ts] let x = 1 @@ -25,6 +25,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -w -p /a/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -57,3 +58,4 @@ FsWatchesRecursive:: {"directoryName":"/a/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js index d5aceb0fc031c..7c42ae36622a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js +++ b/tests/baselines/reference/tscWatch/programUpdates/non-existing-directories-listed-in-config-file-input-array-should-be-tolerated-without-crashing-the-server.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/file1.ts] let t = 10; @@ -22,6 +22,7 @@ interface String { charAt: any; } interface Array { length: number; [n: number]: T; } +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -57,3 +58,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b/something","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js index 0a26775551849..281cd8f1500d3 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js +++ b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-configured-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; @@ -21,23 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -79,13 +64,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename moduleFile to moduleFile1 - -//// [/a/b/file1.js] file written with same contents -//// [/a/b/moduleFile1.ts] -export function bar() { }; - -//// [/a/b/moduleFile1.js] +//// [/a/b/moduleFile.js] "use strict"; exports.__esModule = true; exports.bar = void 0; @@ -94,6 +73,20 @@ exports.bar = bar; ; +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + +Change:: Rename moduleFile to moduleFile1 + +Input:: +//// [/a/b/moduleFile1.ts] +export function bar() { }; + //// [/a/b/moduleFile.ts] deleted //// [/a/b/moduleFile.js] deleted @@ -147,13 +140,8 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename moduleFile1 back to moduleFile - //// [/a/b/file1.js] file written with same contents -//// [/a/b/moduleFile.ts] -export function bar() { }; - -//// [/a/b/moduleFile.js] +//// [/a/b/moduleFile1.js] "use strict"; exports.__esModule = true; exports.bar = void 0; @@ -162,6 +150,13 @@ exports.bar = bar; ; + +Change:: Rename moduleFile1 back to moduleFile + +Input:: +//// [/a/b/moduleFile.ts] +export function bar() { }; + //// [/a/b/moduleFile1.ts] deleted Output:: @@ -203,3 +198,14 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js index f5074478f1ed7..a7176047b19b3 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js +++ b/tests/baselines/reference/tscWatch/programUpdates/rename-a-module-file-and-rename-back-should-restore-the-states-for-inferred-projects.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file1.ts +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; @@ -18,23 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; -var T = require("./moduleFile"); -T.bar(); - - +/a/lib/tsc.js -w /a/b/file1.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -70,9 +55,26 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; +var T = require("./moduleFile"); +T.bar(); + + + Change:: Rename moduleFile to moduleFile1 -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile1.ts] export function bar() { }; @@ -117,21 +119,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] file written with same contents + Change:: Rename moduleFile1 back to moduleFile -//// [/a/b/file1.js] file written with same contents +Input:: //// [/a/b/moduleFile.ts] export function bar() { }; -//// [/a/b/moduleFile.js] -"use strict"; -exports.__esModule = true; -exports.bar = void 0; -function bar() { } -exports.bar = bar; -; - - //// [/a/b/moduleFile1.ts] deleted Output:: @@ -167,3 +162,14 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/b/moduleFile.js] +"use strict"; +exports.__esModule = true; +exports.bar = void 0; +function bar() { } +exports.bar = bar; +; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js index 25944808c930b..9dae5b72d6415 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js +++ b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-file-not-in-rootDir.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import { x } from "../b"; @@ -21,19 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/lib/b.js] -"use strict"; -exports.__esModule = true; -exports.x = void 0; -exports.x = 10; - - -//// [/user/username/projects/myproject/lib/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -81,14 +70,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/b.js] +"use strict"; +exports.__esModule = true; +exports.x = void 0; +exports.x = 10; + + +//// [/user/username/projects/myproject/lib/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Make changes to file a +Input:: //// [/user/username/projects/myproject/a.ts] import { x } from "../b"; -//// [/user/username/projects/myproject/lib/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -134,3 +136,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js index e0ca8774e8a03..34abbb6c26af9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js +++ b/tests/baselines/reference/tscWatch/programUpdates/reports-errors-correctly-with-isolatedModules.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] export const a: string = ""; @@ -22,21 +22,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -exports.a = void 0; -exports.a = ""; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -var a_1 = require("./a"); -var b = a_1.a; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -78,17 +65,26 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Change shape of a - -//// [/user/username/projects/myproject/a.ts] -export const a: number = 1 - //// [/user/username/projects/myproject/a.js] "use strict"; exports.__esModule = true; exports.a = void 0; -exports.a = 1; +exports.a = ""; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +var a_1 = require("./a"); +var b = a_1.a; + + + +Change:: Change shape of a +Input:: +//// [/user/username/projects/myproject/a.ts] +export const a: number = 1 Output:: @@ -136,3 +132,11 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +exports.a = void 0; +exports.a = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js index 1250de66a8d8f..6956eefabadbb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-handle-non-existing-directories-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/tsconfig.json +Input:: //// [/a/src/app.ts] let x = 1; @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/src/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/tsconfig.json Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -61,3 +58,8 @@ FsWatchesRecursive:: {"directoryName":"/a/src","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/src/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js index 221058a3b08db..0ea531d36e9ab 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-ignore-non-existing-files-specified-in-the-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -27,11 +27,8 @@ interface Array { length: number; [n: number]: T; } ] } -//// [/a/b/commonFile1.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -69,3 +66,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js index 3ba97be0f14e7..f950d8d330a3d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -91,33 +91,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/decls/file1.d.ts] -export declare const c = 30; - - -//// [/user/username/projects/myproject/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - -//// [/user/username/projects/myproject/decls/src/file2.d.ts] -export declare const d = 30; - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -160,3 +135,30 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/decls/file1.d.ts] +export declare const c = 30; + + +//// [/user/username/projects/myproject/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + +//// [/user/username/projects/myproject/decls/src/file2.d.ts] +export declare const d = 30; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js index 637cf598966a8..f42ca90642cae 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -91,33 +91,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/decls/file1.d.ts] -export declare const c = 30; - - -//// [/user/username/projects/myproject/build/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - -//// [/user/username/projects/myproject/decls/src/file2.d.ts] -export declare const d = 30; - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -160,3 +135,30 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/decls/file1.d.ts] +export declare const c = 30; + + +//// [/user/username/projects/myproject/build/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + +//// [/user/username/projects/myproject/decls/src/file2.d.ts] +export declare const d = 30; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js index 0e126eb1e1b8a..27f7ee5540ce7 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,25 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/build/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -151,3 +134,22 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/build/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js index a0a613282c1cb..8ccdecf74f3cf 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/with-outFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,22 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/build/outFile.js] -define("file1", ["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); -define("src/file2", ["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -145,3 +131,19 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/build/outFile.js] +define("file1", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); +define("src/file2", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js index 7eec5119a937c..6607ad9b4557e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/file1.ts] export const c = 30; @@ -90,25 +90,8 @@ interface Array { length: number; [n: number]: T; } } -//// [/user/username/projects/myproject/file1.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.c = void 0; - exports.c = 30; -}); - - -//// [/user/username/projects/myproject/src/file2.js] -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.d = void 0; - exports.d = 30; -}); - - +/a/lib/tsc.js -w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -151,3 +134,22 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = 30; +}); + + +//// [/user/username/projects/myproject/src/file2.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = 30; +}); + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js index bcd52553d3a26..4b86525e95d89 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-properly-handle-module-resolution-changes-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -29,12 +29,8 @@ export interface T {} "files": ["/a/b/file1.ts"] } -//// [/a/b/file1.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -76,8 +72,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file1.js] +"use strict"; +exports.__esModule = true; + + + Change:: Change module resolution to classic +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": { @@ -86,12 +89,6 @@ Change:: Change module resolution to classic "files": ["/a/b/file1.ts"] } -//// [/a/b/file1.js] file written with same contents -//// [/a/module1.js] -"use strict"; -exports.__esModule = true; - - Output:: >> Screen clear @@ -132,3 +129,10 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/file1.js] file written with same contents +//// [/a/module1.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js b/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js index aad3af9641372..569755bec0ad2 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-reflect-change-in-config-file.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -24,15 +24,8 @@ let y = 1 "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -72,15 +65,24 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: Change config +Input:: //// [/a/b/tsconfig.json] { "compilerOptions": {}, "files": ["/a/b/commonFile1.ts"] } -//// [/a/b/commonFile1.js] file written with same contents Output:: >> Screen clear @@ -115,3 +117,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js b/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js index 5daca3fac5e91..266ba8c22eeb9 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-tolerate-config-file-errors-and-still-try-to-build-a-project.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/commonFile1.ts] let x = 1 @@ -27,15 +27,8 @@ interface Array { length: number; [n: number]: T; } "someOtherProperty": {} } -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -82,3 +75,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js b/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js index 28658ce6bfb6d..376ccfa6b83c1 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js +++ b/tests/baselines/reference/tscWatch/programUpdates/shouldnt-report-error-about-unused-function-incorrectly-when-file-changes-from-global-to-module.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/file.ts --noUnusedLocals +Input:: //// [/a/b/file.ts] function one() {} function two() { @@ -20,16 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/file.js] -function one() { } -function two() { - return function three() { - one(); - }; -} - - +/a/lib/tsc.js -w /a/b/file.ts --noUnusedLocals Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -61,8 +53,19 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/file.js] +function one() { } +function two() { + return function three() { + one(); + }; +} + + + Change:: Change file to module +Input:: //// [/a/b/file.ts] function one() {} export function two() { @@ -71,19 +74,6 @@ export function two() { } } -//// [/a/b/file.js] -"use strict"; -exports.__esModule = true; -exports.two = void 0; -function one() { } -function two() { - return function three() { - one(); - }; -} -exports.two = two; - - Output:: >> Screen clear @@ -114,3 +104,17 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/file.js] +"use strict"; +exports.__esModule = true; +exports.two = void 0; +function one() { } +function two() { + return function three() { + one(); + }; +} +exports.two = two; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js b/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js index f3f9980ec6ee6..4b8bd538da9b5 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js +++ b/tests/baselines/reference/tscWatch/programUpdates/types-should-load-from-config-file-path-if-config-exists.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/b/app.ts] let x = 1 @@ -21,11 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/app.js] -var x = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:25 AM] Starting compilation in watch mode... @@ -66,3 +63,8 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/app.js] +var x = 1; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js index dcb283b1626cc..c9eae41a5e3a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-for-decorators.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -25,29 +25,8 @@ export class B {} //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error"}} -//// [/b.js] -export class B { -} - - -//// [/a.js] -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import './b'; -let A = class A { - constructor(p) { } -}; -A = __decorate([ - ((_) => { }) -], A); -export { A }; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -99,8 +78,32 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/b.js] +export class B { +} + + +//// [/a.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +import './b'; +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }) +], A); +export { A }; + + + Change:: Enable experimentalDecorators +Input:: //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true}} @@ -150,33 +153,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Enable emitDecoratorMetadata +Input:: //// [/tsconfig.json] {"compilerOptions":{"target":"es6","importsNotUsedAsValues":"error","experimentalDecorators":true,"emitDecoratorMetadata":true}} -//// [/b.js] file written with same contents -//// [/a.js] -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -import { B } from './b'; -let A = class A { - constructor(p) { } -}; -A = __decorate([ - ((_) => { }), - __metadata("design:paramtypes", [B]) -], A); -export { A }; - - Output:: >> Screen clear @@ -216,3 +199,26 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/b.js] file written with same contents +//// [/a.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { B } from './b'; +let A = class A { + constructor(p) { } +}; +A = __decorate([ + ((_) => { }), + __metadata("design:paramtypes", [B]) +], A); +export { A }; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js index 0e2e3b2a407c6..faaefae32a897 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-diagnostics-and-emit-when-useDefineForClassFields-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a.ts] class C { get prop() { return 1; } } class D extends C { prop = 1; } @@ -19,19 +19,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a.js] -class C { - get prop() { return 1; } -} -class D extends C { - constructor() { - super(...arguments); - this.prop = 1; - } -} - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -73,11 +62,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Enable useDefineForClassFields - -//// [/tsconfig.json] -{"compilerOptions":{"target":"es6","useDefineForClassFields":true}} - //// [/a.js] class C { get prop() { return 1; } @@ -85,17 +69,19 @@ class C { class D extends C { constructor() { super(...arguments); - Object.defineProperty(this, "prop", { - enumerable: true, - configurable: true, - writable: true, - value: 1 - }); + this.prop = 1; } } +Change:: Enable useDefineForClassFields + +Input:: +//// [/tsconfig.json] +{"compilerOptions":{"target":"es6","useDefineForClassFields":true}} + + Output:: >> Screen clear [12:00:20 AM] File change detected. Starting incremental compilation... @@ -136,3 +122,21 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a.js] +class C { + get prop() { return 1; } +} +class D extends C { + constructor() { + super(...arguments); + Object.defineProperty(this, "prop", { + enumerable: true, + configurable: true, + writable: true, + value: 1 + }); + } +} + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js index 0a8654e0e8af0..2b98765e7340c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-and-emit-when-importsNotUsedAsValues-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] export class C {} @@ -22,27 +22,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - } - return C; -}()); -exports.C = C; - - -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.f = void 0; -function f(p) { return p; } -exports.f = f; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -84,13 +65,33 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + } + return C; +}()); +exports.C = C; + + +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.f = void 0; +function f(p) { return p; } +exports.f = f; + + + Change:: Set to "remove" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"remove"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -133,21 +134,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents + Change:: Set to "error" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"error"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] -"use strict"; -exports.__esModule = true; -exports.f = void 0; -require("./a"); -function f(p) { return p; } -exports.f = f; - - Output:: >> Screen clear @@ -196,13 +191,23 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] +"use strict"; +exports.__esModule = true; +exports.f = void 0; +require("./a"); +function f(p) { return p; } +exports.f = f; + + + Change:: Set to "preserve" +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"importsNotUsedAsValues":"preserve"}} -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/b.js] file written with same contents Output:: >> Screen clear @@ -244,3 +249,6 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js index d62fc0c146401..e2399e591432e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-correctly-when-declaration-emit-is-disabled-in-compiler-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import test from './b'; test(4, 5); @@ -26,6 +26,7 @@ interface Array { length: number; [n: number]: T; } {"compilerOptions":{"module":"commonjs","noEmit":true,"strict":true}} +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -67,8 +68,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed x type to string +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: string, y: number) { return x + y / 5; @@ -122,8 +125,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed x type to number +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: number) { return x + y / 5; @@ -171,8 +176,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed y type to string +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: string) { return x + y / 5; @@ -232,8 +239,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changed y type to number +Input:: //// [/user/username/projects/myproject/b.ts] function test(x: number, y: number) { return x + y / 5; @@ -280,3 +289,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js index 6a02e56478e85..674187b400ebb 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-default-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -75,8 +71,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -84,7 +87,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -119,8 +121,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -130,7 +135,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -176,3 +180,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js index 27a39ad5f9c85..e7e117d2bb7ca 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipDefaultLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -69,8 +65,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -78,7 +81,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -112,8 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -123,7 +128,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -162,3 +166,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js index 09ed3add077b9..a17bb0d71dd9c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-module-file-with-global-definitions-changes/with-skipLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -24,12 +24,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -69,8 +65,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -78,7 +81,6 @@ var x: string; var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -112,8 +114,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] export {} declare global { @@ -123,7 +128,6 @@ interface Document { var y: number; } -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -162,3 +166,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js index 9f620946381a7..9e7cabec7d4b2 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-default-options.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -71,17 +68,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -116,18 +114,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -173,3 +174,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js index 82a34f7f07ed7..26197fbed5039 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipDefaultLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipDefaultLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -65,17 +62,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -109,18 +107,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -159,3 +160,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js index d169086a9efe4..6fdf9db37840a 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-in-lib-file/when-non-module-file-changes/with-skipLibCheck.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -21,11 +21,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] -var y; - - +/a/lib/tsc.js -w /user/username/projects/myproject/a.ts --skipLibCheck Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -65,17 +62,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var y; + + + Change:: Remove document declaration from file +Input:: //// [/user/username/projects/myproject/a.ts] var x: string; var y: number; -//// [/user/username/projects/myproject/a.js] -var x; -var y; - - Output:: >> Screen clear @@ -109,18 +107,21 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +var x; +var y; + + + Change:: Rever the file to contain document declaration +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; } var y: number; -//// [/user/username/projects/myproject/a.js] -var y; - - Output:: >> Screen clear @@ -159,3 +160,8 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +var y; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js index 1258794a1ff4e..8b67e172bac26 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-ambient-modules-of-program-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare module 'a' { type foo = number; @@ -20,10 +20,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -61,17 +59,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] + + + Change:: Create b.ts with same content -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/b.ts] declare module 'a' { type foo = number; } -//// [/user/username/projects/myproject/b.js] - - Output:: >> Screen clear @@ -136,9 +135,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/b.js] + + + Change:: Delete b.ts -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/b.ts] deleted Output:: @@ -177,3 +181,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js index 39846bc903905..43b900800db31 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a.ts] export class C {} @@ -21,24 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a.js] -"use strict"; -exports.__esModule = true; -exports.C = void 0; -var C = /** @class */ (function () { - function C() { - } - return C; -}()); -exports.C = C; - - -//// [/b.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -78,8 +62,27 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a.js] +"use strict"; +exports.__esModule = true; +exports.C = void 0; +var C = /** @class */ (function () { + function C() { + } + return C; +}()); +exports.C = C; + + +//// [/b.js] +"use strict"; +exports.__esModule = true; + + + Change:: Enable forceConsistentCasingInFileNames +Input:: //// [/tsconfig.json] {"compilerOptions":{"forceConsistentCasingInFileNames":true}} @@ -125,3 +128,4 @@ FsWatchesRecursive:: {"directoryName":"","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js index 26e2b95740d30..4cd2f3fec0e4d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-noErrorTruncation-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare var v: { reallyLongPropertyName1: string | number | boolean | object | symbol | bigint; @@ -27,11 +27,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -v === 'foo'; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -75,8 +72,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +v === 'foo'; + + + Change:: Enable noErrorTruncation +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"noErrorTruncation":true}} @@ -123,3 +126,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js index 56496aadaed0d..bf48d4bb0305f 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] declare function foo(): null | { hello: any }; foo().hello @@ -19,11 +19,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -foo().hello; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -61,8 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +foo().hello; + + + Change:: Enable strict null checks +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"strictNullChecks":true}} @@ -110,8 +113,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Set always strict false +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"strict":true,"alwaysStrict":false}} @@ -159,8 +164,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Disable strict +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -201,3 +208,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js index d669ad19c971e..5fa7e3d226fea 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/updates-moduleResolution-when-resolveJsonModule-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] import * as data from './data.json' @@ -21,12 +21,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -74,12 +70,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: Enable resolveJsonModule +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"moduleResolution":"node","resolveJsonModule":true}} -//// [/user/username/projects/myproject/a.js] file written with same contents Output:: >> Screen clear @@ -125,3 +127,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js b/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js index e51a3a1bfbc47..3e02860609b1c 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js +++ b/tests/baselines/reference/tscWatch/programUpdates/watched-files-when-file-is-deleted-and-new-file-is-added-as-part-of-change.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /home/username/project/tsconfig.json +Input:: //// [/home/username/project/src/file1.ts] var a = 10; @@ -18,11 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/home/username/project/tsconfig.json] {} -//// [/home/username/project/src/file1.js] -var a = 10; - - +/a/lib/tsc.js -w -p /home/username/project/tsconfig.json Output:: >> Screen clear [12:00:21 AM] Starting compilation in watch mode... @@ -60,15 +57,17 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/home/username/project/src/file1.js] +var a = 10; + + + Change:: Rename file1 to file2 +Input:: //// [/home/username/project/src/file2.ts] var a = 10; -//// [/home/username/project/src/file2.js] -var a = 10; - - //// [/home/username/project/src/file1.ts] deleted Output:: @@ -107,3 +106,8 @@ FsWatchesRecursive:: {"directoryName":"/home/username/project","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/home/username/project/src/file2.js] +var a = 10; + + diff --git a/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js b/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js index ee1196dc4cb2a..4221bac04f8a6 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js +++ b/tests/baselines/reference/tscWatch/programUpdates/when-skipLibCheck-and-skipDefaultLibCheck-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/user/username/projects/myproject/a.ts] interface Document { fullscreen: boolean; @@ -28,10 +28,8 @@ interface Document { readonly fullscreen: boolean; } -//// [/user/username/projects/myproject/a.js] - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -91,8 +89,13 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] + + + Change:: Changing config to {"compilerOptions":{"skipLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipLibCheck":true}} @@ -143,8 +146,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipDefaultLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipDefaultLibCheck":true}} @@ -201,8 +206,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -264,8 +271,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipDefaultLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipDefaultLibCheck":true}} @@ -321,8 +330,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{"skipLibCheck":true}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{"skipLibCheck":true}} @@ -373,8 +384,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Changing config to {"compilerOptions":{}} +Input:: //// [/user/username/projects/myproject/tsconfig.json] {"compilerOptions":{}} @@ -436,3 +449,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js b/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js index f1bd9f9249f00..80c355787ea67 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js +++ b/tests/baselines/reference/tscWatch/programUpdates/works-correctly-when-config-file-is-changed-but-its-content-havent.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -20,19 +20,12 @@ let y = 1 //// [/a/b/tsconfig.json] { - "compilerOptions": {}, - "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] - } - -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - + "compilerOptions": {}, + "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] + } +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -72,8 +65,18 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + + Change:: Modify config without changing content +Input:: //// [/a/b/tsconfig.json] file changed its modified time Output:: @@ -111,3 +114,4 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js index 4ce614c9b47ce..45aef15dcb94a 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-with-configFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/test.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -70,8 +66,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/test.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install file and folder that start with '.' +Input:: //// [/user/username/projects/myproject/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts] {"something":10} @@ -99,3 +102,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js index 9cc74754ada77..feac89681480f 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/ignores-changes-in-node_modules-that-start-with-dot/watch-without-configFile.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /user/username/projects/myproject/test.ts +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/test.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /user/username/projects/myproject/test.ts Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -64,8 +60,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/test.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install file and folder that start with '.' +Input:: //// [/user/username/projects/myproject/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts] {"something":10} @@ -87,3 +90,4 @@ FsWatchesRecursive:: {"directoryName":"/user","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js b/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js index 5efdeb8a51f1c..cc54ce3b6d9fb 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/when-types-in-compiler-option-are-global-and-installed-at-later-point.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/user/username/projects/myproject/lib/app.ts] myapp.component("hello"); @@ -18,11 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/user/username/projects/myproject/lib/app.js] -myapp.component("hello"); - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:23 AM] Starting compilation in watch mode... @@ -61,9 +58,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/app.js] +myapp.component("hello"); + + + Change:: npm install ts-types -//// [/user/username/projects/myproject/lib/app.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/@myapp/ts-types/package.json] {"version":"1.65.1","types":"types/somefile.define.d.ts"} @@ -115,8 +117,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/lib/app.js] file written with same contents + Change:: No change, just check program +Input:: Output:: @@ -139,3 +144,4 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js b/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js index 09189652cdbbb..e48b55e02cd5a 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/with-modules-linked-to-sibling-folder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -28,12 +28,8 @@ export * from './other'; //// [/user/username/projects/myproject/linked-package/dist/other.d.ts] export declare const Foo = "BAR"; -//// [/user/username/projects/myproject/main/index.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w Output:: >> Screen clear [12:00:39 AM] Starting compilation in watch mode... @@ -84,3 +80,9 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/main/index.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js index e1ee3c43a7981..2014f8e515324 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-included-file-with-ambient-module-changes.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/b/foo.ts /a/b/bar.d.ts +Input:: //// [/a/b/foo.ts] import * as fs from "fs"; @@ -27,12 +27,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/foo.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /a/b/foo.ts /a/b/bar.d.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -78,8 +74,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/foo.js] +"use strict"; +exports.__esModule = true; + + + Change:: Add fs definition +Input:: //// [/a/b/bar.d.ts] declare module "url" { @@ -95,7 +98,6 @@ declare module "fs" { } -//// [/a/b/foo.js] file written with same contents Output:: >> Screen clear @@ -134,3 +136,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/foo.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js index 63a69f1c92124..e374a0d0dc510 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-module-resolution-changes-to-ambient-module.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w /a/b/foo.ts +Input:: //// [/a/b/foo.ts] import * as fs from "fs"; @@ -15,12 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/b/foo.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js -w /a/b/foo.ts Output:: >> Screen clear [12:00:13 AM] Starting compilation in watch mode... @@ -62,9 +58,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/b/foo.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install node types -//// [/a/b/foo.js] file written with same contents +Input:: //// [/a/b/node_modules/@types/node/package.json] { @@ -116,3 +118,5 @@ FsWatchesRecursive:: {"directoryName":"/a/b/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/foo.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js index 5292d5cbd3464..7d12e796d5a99 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-renaming-node_modules-folder-that-already-contains-@types-folder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /user/username/projects/myproject/a.ts +Input:: //// [/user/username/projects/myproject/a.ts] import * as q from "qqq"; @@ -18,12 +18,8 @@ interface Array { length: number; [n: number]: T; } //// [/user/username/projects/myproject/node_modules2/@types/qqq/index.d.ts] export {} -//// [/user/username/projects/myproject/a.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w /user/username/projects/myproject/a.ts Output:: >> Screen clear [12:00:27 AM] Starting compilation in watch mode... @@ -65,9 +61,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/a.js] +"use strict"; +exports.__esModule = true; + + + Change:: npm install -//// [/user/username/projects/myproject/a.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/@types/qqq/index.d.ts] export {} @@ -110,3 +112,5 @@ FsWatchesRecursive:: {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js b/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js index 89679dca449b6..2ed6c5df30e9c 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/works-when-reusing-program-with-files-from-external-library.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/b/projects/myProject/src +Input:: //// [/a/b/projects/myProject/src/file1.ts] import module1 = require("module1"); module1("hello"); @@ -26,21 +26,8 @@ interface Array { length: number; [n: number]: T; } //// [/a/b/projects/myProject/src/tsconfig.json] {"compilerOptions":{"allowJs":true,"rootDir":".","outDir":"../dist","moduleResolution":"node","maxNodeModuleJsDepth":1}} -//// [/a/b/projects/myProject/dist/file1.js] -"use strict"; -exports.__esModule = true; -var module1 = require("module1"); -module1("hello"); - - -//// [/a/b/projects/myProject/dist/file2.js] -"use strict"; -exports.__esModule = true; -var module11 = require("module1"); -module11("hello"); - - +/a/lib/tsc.js --w -p /a/b/projects/myProject/src Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -92,21 +79,29 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Add new line to file1 - -//// [/a/b/projects/myProject/src/file1.ts] -import module1 = require("module1"); -module1("hello"); -; - //// [/a/b/projects/myProject/dist/file1.js] "use strict"; exports.__esModule = true; var module1 = require("module1"); module1("hello"); -; +//// [/a/b/projects/myProject/dist/file2.js] +"use strict"; +exports.__esModule = true; +var module11 = require("module1"); +module11("hello"); + + + +Change:: Add new line to file1 + +Input:: +//// [/a/b/projects/myProject/src/file1.ts] +import module1 = require("module1"); +module1("hello"); +; + Output:: >> Screen clear @@ -155,3 +150,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b/projects/myproject/src","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/projects/myProject/dist/file1.js] +"use strict"; +exports.__esModule = true; +var module1 = require("module1"); +module1("hello"); +; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js index a06ca8733cea7..d82be755b8ec9 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-dynamic-polling-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -55,12 +53,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -96,3 +96,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js index 2a79ce7e351e0..8d0b6caa2c622 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-non-recursive-watchDirectory-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -61,12 +59,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -108,3 +108,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js index 6fa14c6d54db3..a3384144c857d 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/uses-watchFile-when-renaming-file-in-subfolder.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /a/username/project/tsconfig.json +Input:: //// [/a/username/project/src/file1.ts] @@ -18,10 +18,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/src/file1.js] - - +/a/lib/tsc.js --w -p /a/username/project/tsconfig.json Output:: >> Screen clear [12:00:19 AM] Starting compilation in watch mode... @@ -61,12 +59,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Rename file1 to file2 +//// [/a/username/project/src/file1.js] -//// [/a/username/project/src/file2.ts] -//// [/a/username/project/src/file2.js] +Change:: Rename file1 to file2 + +Input:: +//// [/a/username/project/src/file2.ts] //// [/a/username/project/src/file1.ts] deleted @@ -108,3 +108,7 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/username/project/src/file2.js] + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index 7c71ca719af84..70099b8e28b28 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -28,12 +28,8 @@ export {} //// [/home/user/projects/myproject/node_modules/b] symlink(/home/user/projects/myproject/node_modules/realb) //// [/home/user/projects/myproject/node_modules/reala/node_modules/b] symlink(/home/user/projects/myproject/node_modules/b) //// [/home/user/projects/myproject/node_modules/realb/node_modules/a] symlink(/home/user/projects/myproject/node_modules/a) -//// [/home/user/projects/myproject/src/file.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w Output:: [12:00:45 AM] Starting compilation in watch mode... @@ -145,3 +141,9 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/home/user/projects/myproject/src/file.js] +"use strict"; +exports.__esModule = true; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js index a69d068cc9db5..2a49142932e80 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,12 +21,8 @@ export const x = 10; //// [/user/username/projects/myproject/tsconfig.json] {} -//// [/user/username/projects/myproject/src/file1.js] -"use strict"; -exports.__esModule = true; - - +/a/lib/tsc.js --w -p /user/username/projects/myproject/tsconfig.json Output:: >> Screen clear [12:00:29 AM] Starting compilation in watch mode... @@ -74,8 +70,15 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/src/file1.js] +"use strict"; +exports.__esModule = true; + + + Change:: Pending updates because of file1.js creation +Input:: Output:: >> Screen clear @@ -121,9 +124,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Remove directory node_modules -//// [/user/username/projects/myproject/src/file1.js] file written with same contents +Input:: //// [/user/username/projects/myproject/node_modules/file2/index.d.ts] deleted Output:: @@ -172,8 +176,11 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/src/file1.js] file written with same contents + Change:: Pending directory watchers and program update +Input:: Output:: >> Screen clear @@ -220,8 +227,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Start npm install +Input:: Output:: @@ -247,8 +256,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: npm install folder creation of file2 +Input:: Output:: @@ -274,8 +285,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: npm install index file in file2 +Input:: //// [/user/username/projects/myproject/node_modules/file2/index.d.ts] export const x = 10; @@ -304,8 +317,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Updates the program +Input:: Output:: @@ -333,9 +348,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Pending updates -//// [/user/username/projects/myproject/src/file1.js] file written with same contents +Input:: Output:: >> Screen clear @@ -382,3 +398,5 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/src/file1.js] file written with same contents diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js index a5a414e5bc047..ecc281833ef12 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchFile/using-dynamic-priority-polling.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js --w /a/username/project/typescript.ts +Input:: //// [/a/username/project/typescript.ts] var z = 10; @@ -15,11 +15,8 @@ interface RegExp {} interface String { charAt: any; } interface Array { length: number; [n: number]: T; } -//// [/a/username/project/typescript.js] -var z = 10; - - +/a/lib/tsc.js --w /a/username/project/typescript.ts Output:: >> Screen clear [12:00:15 AM] Starting compilation in watch mode... @@ -47,8 +44,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/username/project/typescript.js] +var z = 10; + + + Change:: Time spent to Transition libFile and file1 to low priority queue +Input:: Output:: @@ -60,8 +63,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + Change:: Make change to file +Input:: //// [/a/username/project/typescript.ts] var zz30 = 100; @@ -76,12 +81,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -Change:: Callbacks: medium priority + high priority queue and scheduled program update - -//// [/a/username/project/typescript.js] -var zz30 = 100; +Change:: Callbacks: medium priority + high priority queue and scheduled program update +Input:: Output:: >> Screen clear @@ -110,8 +113,14 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/a/username/project/typescript.js] +var zz30 = 100; + + + Change:: Polling queues polled and everything is in the high polling queue +Input:: Output:: @@ -122,3 +131,4 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js index af9d83b410c1e..0fae6f910f811 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-fallbackPolling-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"fallbackPolling":"PriorityInterval"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js index c602b4405029f..c7f1f7684a7d7 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchDirectory-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"watchDirectory":"UseFsEvents"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatches:: FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js index 6da07d029e0e3..5642ce423754a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-as-watch-options-to-extend.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json --watchFile UseFsEvents +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json --watchFile UseFsEvents Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js index 1a34046c57268..04fc286ceec81 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchOptions/with-watchFile-option.js @@ -1,4 +1,4 @@ -/a/lib/tsc.js -w -p /a/b/tsconfig.json +Input:: //// [/a/lib/lib.d.ts] /// interface Boolean {} @@ -21,15 +21,8 @@ let y = 1 //// [/a/b/tsconfig.json] {"watchOptions":{"watchFile":"UseFsEvents"}} -//// [/a/b/commonFile1.js] -var x = 1; - - -//// [/a/b/commonFile2.js] -var y = 1; - - +/a/lib/tsc.js -w -p /a/b/tsconfig.json Output:: >> Screen clear [12:00:17 AM] Starting compilation in watch mode... @@ -70,3 +63,12 @@ FsWatchesRecursive:: {"directoryName":"/a/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} exitCode:: ExitStatus.undefined + +//// [/a/b/commonFile1.js] +var x = 1; + + +//// [/a/b/commonFile2.js] +var y = 1; + + From 65fae6463b630eda9ed1f11fbf8f839231d59c56 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 2 Jun 2020 11:09:07 -0700 Subject: [PATCH 7/7] Update src/testRunner/unittests/tsbuild/helpers.ts Co-authored-by: Wesley Wigham --- src/testRunner/unittests/tsbuild/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index c2bd7c5aa8a6e..f6b1572ed8bd8 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -467,7 +467,8 @@ interface Symbol { tick = undefined!; incrementalSys = undefined!; }); - describe("serializedBuilde", () => { + describe("serializedBuild", () => { + verifyTscBaseline(() => ({ baseLine: () => { const { file, text } = sys.baseLine();