From 8f384b667f12c181ef336da6a79cec2d1189702c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 6 Apr 2020 14:54:56 -0700 Subject: [PATCH] Add all the files from composite project as dependencies as any change in them can result in errors resulting in changes to the own output of the file --- src/index.ts | 189 +++++++++++++----- src/instances.ts | 87 +++++--- src/interfaces.ts | 10 + src/servicesHost.ts | 89 +++++---- src/watch-run.ts | 40 ++-- .../projectReferencesMultiple/app.ts | 5 + .../projectReferencesMultiple/common/index.ts | 3 + .../common/tsconfig.json | 5 + .../expectedOutput-3.8/bundle.js | 123 ++++++++++++ .../expectedOutput-3.8/output.txt | 36 ++++ .../expectedOutput-3.8/patch0/bundle.js | 124 ++++++++++++ .../expectedOutput-3.8/patch0/output.txt | 21 ++ .../expectedOutput-3.8/patch1/bundle.js | 137 +++++++++++++ .../expectedOutput-3.8/patch1/output.txt | 12 ++ .../expectedOutput-3.8/patch2/bundle.js | 137 +++++++++++++ .../expectedOutput-3.8/patch2/output.txt | 9 + .../expectedOutput-3.8/patch3/bundle.js | 137 +++++++++++++ .../expectedOutput-3.8/patch3/output.txt | 11 + .../expectedOutput-3.8/patch4/bundle.js | 137 +++++++++++++ .../expectedOutput-3.8/patch4/output.txt | 9 + .../expectedOutput-3.8/patch5/bundle.js | 137 +++++++++++++ .../expectedOutput-3.8/patch5/output.txt | 11 + .../expectedOutput-transpile-3.8/bundle.js | 137 +++++++++++++ .../expectedOutput-transpile-3.8/output.txt | 13 ++ .../patch0/output.txt | 10 + .../patch1/output.txt | 7 + .../patch3/output.txt | 10 + .../patch4/output.txt | 7 + .../patch5/output.txt | 10 + .../indirectWithError/fileWithError.ts | 3 + .../indirectWithError/index.ts | 5 + .../indirectWithError/tsconfig.json | 5 + .../lib/fileWithError.ts | 3 + .../projectReferencesMultiple/lib/index.ts | 5 + .../lib/tsconfig.json | 5 + .../patch0/lib/fileWithError.ts | 3 + .../patch1/indirectWithError/fileWithError.ts | 3 + .../patch2/unreferenced/index.ts | 3 + .../patch3/unreferencedIndirect/index.ts | 3 + .../patch4/unreferencedIndirect/index.ts | 3 + .../patch5/unreferenced/index.ts | 3 + .../projectReferencesMultiple/tsconfig.json | 10 + .../unreferenced/index.ts | 3 + .../unreferenced/tsconfig.json | 8 + .../unreferencedIndirect/index.ts | 3 + .../unreferencedIndirect/tsconfig.json | 5 + .../projectReferencesMultiple/utils/index.ts | 4 + .../utils/tsconfig.json | 9 + .../webpack.config.js | 21 ++ .../patch0/output.txt | 2 +- .../patch2/output.txt | 10 +- .../patch3/output.txt | 2 +- .../patch0/output.txt | 2 +- .../patch2/output.txt | 10 +- .../patch3/output.txt | 2 +- .../expectedOutput-3.8/patch0/output.txt | 2 +- .../patch0/output.txt | 2 +- .../expectedOutput-3.8/patch1/output.txt | 2 +- .../patch0/output.txt | 2 +- .../patch1/output.txt | 2 +- .../expectedOutput-3.8/patch0/output.txt | 3 +- .../expectedOutput-3.8/patch1/output.txt | 2 +- .../patch0/output.txt | 2 +- .../patch1/output.txt | 2 +- .../expectedOutput-3.8/patch1/output.txt | 2 +- .../patch0/output.txt | 2 +- .../patch1/output.txt | 2 +- .../expectedOutput-3.8/patch0/output.txt | 5 +- .../patch0/output.txt | 2 +- .../expectedOutput-3.8/patch0/output.txt | 2 +- .../patch0/output.txt | 2 +- .../expectedOutput-3.8/patch0/output.txt | 3 +- .../expectedOutput-3.8/patch3/output.txt | 3 +- .../patch0/output.txt | 2 +- .../patch2/output.txt | 10 +- .../patch3/output.txt | 2 +- .../patch0/output.txt | 2 +- .../patch2/output.txt | 10 +- .../patch3/output.txt | 2 +- 79 files changed, 1703 insertions(+), 165 deletions(-) create mode 100644 test/comparison-tests/projectReferencesMultiple/app.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/common/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/common/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/bundle.js create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch0/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch1/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch3/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch4/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch5/output.txt create mode 100644 test/comparison-tests/projectReferencesMultiple/indirectWithError/fileWithError.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/indirectWithError/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/indirectWithError/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/lib/fileWithError.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/lib/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/lib/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/patch0/lib/fileWithError.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/patch1/indirectWithError/fileWithError.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/patch2/unreferenced/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/patch3/unreferencedIndirect/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/patch4/unreferencedIndirect/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/patch5/unreferenced/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/unreferenced/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/unreferenced/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/utils/index.ts create mode 100644 test/comparison-tests/projectReferencesMultiple/utils/tsconfig.json create mode 100644 test/comparison-tests/projectReferencesMultiple/webpack.config.js diff --git a/src/index.ts b/src/index.ts index be22b18a0..77b10cd79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,8 @@ import { getInputFileNameFromOutput, getTypeScriptInstance, initializeInstance, - isReferencedFile + isReferencedFile, + reportTranspileErrors } from './instances'; import { LoaderOptions, @@ -45,9 +46,8 @@ function loader(this: webpack.loader.LoaderContext, contents: string) { callback(new Error(instanceOrError.error.message)); return; } - const instance = instanceOrError.instance!; - buildSolutionReferences(instance, this, instance.log); + buildSolutionReferences(instance, this); successLoader(this, contents, callback, instance); } @@ -58,6 +58,7 @@ function successLoader( instance: TSInstance ) { initializeInstance(loaderContext, instance); + reportTranspileErrors(instance, loaderContext); const rawFilePath = path.normalize(loaderContext.resourcePath); const filePath = @@ -470,65 +471,70 @@ function getEmit( loaderContext.clearDependencies(); loaderContext.addDependency(rawFilePath); - const allDefinitionFiles = isReferencedFile(instance, filePath) - ? [] - : [...instance.files.keys()].filter( - defFilePath => - defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) && - // Remove the project reference d.ts as we are adding dependency for .ts later - // This removed extra build pass (resulting in new stats object in initial build) - (!instance.solutionBuilderHost || - instance.solutionBuilderHost.getOutputFileFromReferencedProject( - defFilePath - ) !== undefined) - ); + const dependencies: string[] = []; + const addDependency = (file: string) => { + file = path.resolve(file); + loaderContext.addDependency(file); + dependencies.push(file); + }; // Make this file dependent on *all* definition files in the program - const addDependency = loaderContext.addDependency.bind(loaderContext); - allDefinitionFiles.forEach(addDependency); + if (!isReferencedFile(instance, filePath)) { + for (const defFilePath of instance.files.keys()) { + if ( + defFilePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) && + // Remove the project reference d.ts as we are adding dependency for .ts later + // This removed extra build pass (resulting in new stats object in initial build) + (!instance.solutionBuilderHost || + instance.solutionBuilderHost.getOutputFileFromReferencedProject( + defFilePath + ) !== undefined) + ) { + addDependency(defFilePath); + } + } + } // Additionally make this file dependent on all imported files const fileDependencies = instance.dependencyGraph[filePath]; - const additionalDependencies = - fileDependencies === undefined - ? [] - : fileDependencies.map(({ resolvedFileName, originalFileName }) => { - const projectReference = getAndCacheProjectReference( + if (fileDependencies) { + for (const { resolvedFileName, originalFileName } of fileDependencies) { + const projectReference = getAndCacheProjectReference( + resolvedFileName, + instance + ); + // In the case of dependencies that are part of a project reference, + // the real dependency that webpack should watch is the JS output file. + if (projectReference !== undefined) { + addDependency( + getAndCacheOutputJSFileName( resolvedFileName, + projectReference, instance - ); - // In the case of dependencies that are part of a project reference, - // the real dependency that webpack should watch is the JS output file. - if (projectReference !== undefined) { - return getAndCacheOutputJSFileName( - resolvedFileName, - projectReference, - instance - ); - } - return ( - getInputFileNameFromOutput( - instance, - path.resolve(resolvedFileName) - ) || originalFileName - ); - }); - - if (additionalDependencies.length > 0) { - additionalDependencies.forEach(addDependency); + ) + ); + } else { + addDependency( + getInputFileNameFromOutput( + instance, + path.resolve(resolvedFileName) + ) || originalFileName + ); + } + } } - loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = allDefinitionFiles - .concat(additionalDependencies) - .map( - defFilePath => - defFilePath + - '@' + - ( - instance.files.get(defFilePath) || - instance.otherFiles.get(defFilePath) || { version: '?' } - ).version - ); + addDependenciesFromSolutionBuilder(instance, filePath, addDependency); + + loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = dependencies.map( + defFilePath => + defFilePath + + '@' + + ( + instance.files.get(defFilePath) || + instance.otherFiles.get(defFilePath) || { version: '?' } + ).version + ); const outputFile = outputFiles .filter(file => file.name.match(constants.jsJsx)) @@ -540,10 +546,81 @@ function getEmit( .pop(); const sourceMapText = sourceMapFile === undefined ? undefined : sourceMapFile.text; - return { outputText, sourceMapText }; } +function addDependenciesFromSolutionBuilder( + instance: TSInstance, + filePath: string, + addDependency: (file: string) => void +) { + if (!instance.solutionBuilderHost) { + return; + } + // Add all the input files from the references as + const resolvedFilePath = path.resolve(filePath); + for (const [ + configFile, + configInfo + ] of instance.solutionBuilderHost.configFileInfo.entries()) { + if ( + !configInfo.config || + !configInfo.config.projectReferences || + !configInfo.config.projectReferences.length + ) { + continue; + } + if (configInfo.outputFileNames) { + if (!configInfo.outputFileNames.has(resolvedFilePath)) { + continue; + } + } else if ( + !configInfo.config.fileNames.some( + f => path.resolve(f) === resolvedFilePath + ) + ) { + continue; + } + + // This is the config for the input file + const seenMap = new Map(); + seenMap.set(configFile, true); + + // Depend on all the dts files from the program + if (configInfo.dtsFiles) { + configInfo.dtsFiles.forEach(addDependency); + } + + // Add dependencies to all the input files from the project reference files since building them + const queue = configInfo.config.projectReferences.slice(); + while (true) { + const currentRef = queue.pop(); + if (!currentRef) { + break; + } + const refConfigFile = path.resolve( + instance.compiler.resolveProjectReferencePath(currentRef) + ); + if (seenMap.has(refConfigFile)) { + continue; + } + const refConfigInfo = instance.solutionBuilderHost.configFileInfo.get( + refConfigFile + ); + if (!refConfigInfo) { + continue; + } + seenMap.set(refConfigFile, true); + if (refConfigInfo.config) { + refConfigInfo.config.fileNames.forEach(addDependency); + if (refConfigInfo.config.projectReferences) { + queue.push(...refConfigInfo.config.projectReferences); + } + } + } + } +} + /** * Transpile file */ @@ -564,6 +641,10 @@ function getTranspilationEmit( fileName }); + addDependenciesFromSolutionBuilder(instance, fileName, file => + loaderContext.addDependency(path.resolve(file)) + ); + // _module.errors is not available inside happypack - see https://github.com/TypeStrong/ts-loader/issues/336 if ( !instance.loaderOptions.happyPackMode && diff --git a/src/instances.ts b/src/instances.ts index 0df6db1eb..a5e5d50bf 100644 --- a/src/instances.ts +++ b/src/instances.ts @@ -168,6 +168,7 @@ function successfulTypeScriptInstance( transformers: {} as typescript.CustomTransformers, // this is only set temporarily, custom transformers are created further down colors, initialSetupPending: true, + reportTranspileErrors: true, configFilePath, configParseResult, log @@ -273,24 +274,14 @@ export function initializeInstance( }) : instance.compiler.createProgram([], instance.compilerOptions)); - // happypack does not have _module.errors - see https://github.com/TypeStrong/ts-loader/issues/336 - if (!instance.loaderOptions.happyPackMode) { - const solutionErrors: WebpackError[] = getSolutionErrors( - instance, - loader.context - ); - const diagnostics = program.getOptionsDiagnostics(); - const errors = formatErrors( - diagnostics, - instance.loaderOptions, - instance.colors, - instance.compiler, - { file: instance.configFilePath || 'tsconfig.json' }, - loader.context + instance.transformers = getCustomTransformers(program); + // Setup watch run for solution building + if (instance.solutionBuilderHost) { + loader._compiler.hooks.watchRun.tapAsync( + 'ts-loader', + makeWatchRun(instance) ); - loader._module.errors.push(...solutionErrors, ...errors); } - instance.transformers = getCustomTransformers(program); } else { if (!loader._compiler.hooks) { throw new Error( @@ -307,7 +298,6 @@ export function initializeInstance( // If there is api available for watch, use it instead of language service instance.watchHost = makeWatchHost( getScriptRegexp(instance), - instance.log, loader, instance, instance.configParseResult.projectReferences @@ -322,7 +312,6 @@ export function initializeInstance( } else { instance.servicesHost = makeServicesHost( getScriptRegexp(instance), - instance.log, loader, instance, instance.loaderOptions.experimentalFileCaching, @@ -364,21 +353,46 @@ function getScriptRegexp(instance: TSInstance) { : /\.tsx?$/i; } +export function reportTranspileErrors( + instance: TSInstance, + loader: webpack.loader.LoaderContext +) { + if (!instance.reportTranspileErrors) { + return; + } + instance.reportTranspileErrors = false; + // happypack does not have _module.errors - see https://github.com/TypeStrong/ts-loader/issues/336 + if (!instance.loaderOptions.happyPackMode) { + const solutionErrors: WebpackError[] = getSolutionErrors( + instance, + loader.context + ); + const diagnostics = instance.program!.getOptionsDiagnostics(); + const errors = formatErrors( + diagnostics, + instance.loaderOptions, + instance.colors, + instance.compiler, + { file: instance.configFilePath || 'tsconfig.json' }, + loader.context + ); + loader._module.errors.push(...solutionErrors, ...errors); + } +} + export function buildSolutionReferences( instance: TSInstance, - loader: webpack.loader.LoaderContext, - log: logger.Logger + loader: webpack.loader.LoaderContext ) { if (!supportsSolutionBuild(instance)) { return; } if (!instance.solutionBuilderHost) { // Use solution builder - log.logInfo('Using SolutionBuilder api'); + instance.log.logInfo('Using SolutionBuilder api'); const scriptRegex = getScriptRegexp(instance); instance.solutionBuilderHost = makeSolutionBuilderHost( scriptRegex, - log, loader, instance ); @@ -387,8 +401,35 @@ export function buildSolutionReferences( [instance.configFilePath!], { verbose: true } ); + instance.solutionBuilder!.buildReferences(instance.configFilePath!); + ensureAllReferences(instance); + } else { + instance.solutionBuilderHost.buildReferences(); + } +} + +function ensureAllReferences(instance: TSInstance) { + // Return result from the json without errors so that the extra errors from config are digested here + const rootConfigInfo = instance.solutionBuilderHost!.configFileInfo.get( + instance.configFilePath! + ); + for (const configInfo of instance.solutionBuilderHost!.configFileInfo.values()) { + if (configInfo === rootConfigInfo || !configInfo.config) { + continue; + } + // Load all the input files + configInfo.config.fileNames.forEach(file => { + const resolvedFileName = path.resolve(file); + const existing = instance.otherFiles.get(resolvedFileName); + if (!existing) { + instance.otherFiles.set(resolvedFileName, { + version: 1, + text: instance.compiler.sys.readFile(file), + modifiedTime: instance.compiler.sys.getModifiedTime!(file) + }); + } + }); } - instance.solutionBuilder!.buildReferences(instance.configFilePath!); } export function forEachResolvedProjectReference( diff --git a/src/interfaces.ts b/src/interfaces.ts index 31be0111f..7a56191d7 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -91,12 +91,21 @@ export interface SolutionBuilderWithWatchHost diagnostics: SolutionDiagnostics; outputFiles: Map; tsbuildinfos: Map; + configFileInfo: Map; outputAffectingInstanceVersion: Map; getOutputFileFromReferencedProject( outputFileName: string ): OutputFile | false | undefined; getInputFileNameFromOutput(outputFileName: string): string | undefined; getOutputFilesFromReferencedProjectInput(inputFileName: string): OutputFile[]; + buildReferences(): void; +} + +export interface ConfigFileInfo { + config: typescript.ParsedCommandLine | undefined; + outputFileNames?: Map; + tsbuildInfoFile?: string; + dtsFiles?: string[]; } export interface OutputFile extends typescript.OutputFile { @@ -145,6 +154,7 @@ export interface TSInstance { hasUnaccountedModifiedFiles?: boolean; changedFilesList?: boolean; + reportTranspileErrors?: boolean; solutionBuilderHost?: SolutionBuilderWithWatchHost; solutionBuilder?: typescript.SolutionBuilder< typescript.EmitAndSemanticDiagnosticsBuilderProgram diff --git a/src/servicesHost.ts b/src/servicesHost.ts index de245e7e6..f63d6cf29 100644 --- a/src/servicesHost.ts +++ b/src/servicesHost.ts @@ -7,6 +7,7 @@ import * as constants from './constants'; import { getOutputFileNames } from './instances'; import { Action, + ConfigFileInfo, CustomResolveModuleName, CustomResolveTypeReferenceDirective, FormatDiagnosticsHost, @@ -24,7 +25,6 @@ import { WatchHost, WebpackError } from './interfaces'; -import * as logger from './logger'; import { makeResolver } from './resolver'; import { formatErrors, readFile, unorderedRemoveItem } from './utils'; @@ -52,7 +52,6 @@ function readFileWithInstance( */ export function makeServicesHost( scriptRegex: RegExp, - log: logger.Logger, loader: webpack.loader.LoaderContext, instance: TSInstance, enableFileCaching: boolean, @@ -218,8 +217,8 @@ export function makeServicesHost( getDefaultLibFileName: (options: typescript.CompilerOptions) => compiler.getDefaultLibFilePath(options), getNewLine: () => newLine, - trace: log.log, - log: log.log, + trace: instance.log.log, + log: instance.log.log, // used for (/// ) see https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/250#issuecomment-485061329 resolveTypeReferenceDirectives: resolvers.resolveTypeReferenceDirectives, @@ -299,12 +298,7 @@ function makeResolvers( }; } -function createWatchFactory( - beforeCallbacks?: ( - key: string, - cb: typescript.FileWatcherCallback[] | typescript.DirectoryWatcherCallback[] - ) => void -): WatchFactory { +function createWatchFactory(): WatchFactory { const watchedFiles: WatchCallbacks< typescript.FileWatcherCallback > = new Map(); @@ -338,9 +332,6 @@ function createWatchFactory( // The array copy is made to ensure that even if one of the callback removes the callbacks, // we dont miss any callbacks following it const cbs = callbacks.slice(); - if (beforeCallbacks) { - beforeCallbacks(key, cbs); - } for (const cb of cbs) { cb(fileName, eventKind as typescript.FileWatcherEventKind); } @@ -467,7 +458,6 @@ export function updateFileWithText( */ export function makeWatchHost( scriptRegex: RegExp, - log: logger.Logger, loader: webpack.loader.LoaderContext, instance: TSInstance, projectReferences?: ReadonlyArray @@ -550,7 +540,7 @@ export function makeWatchHost( depth ), realpath: dirPath => compiler.sys.resolvePath(path.normalize(dirPath)), - trace: logData => log.log(logData), + trace: logData => instance.log.log(logData), watchFile, watchDirectory, @@ -634,18 +624,11 @@ function normalizeSlashes(file: string): string { return file.replace(/\\/g, '/'); } -interface ConfigFileInfo { - config: typescript.ParsedCommandLine | undefined; - outputFileNames?: Map; - tsbuildInfoFile?: string; -} - /** * Create the TypeScript Watch host */ export function makeSolutionBuilderHost( scriptRegex: RegExp, - log: logger.Logger, loader: webpack.loader.LoaderContext, instance: TSInstance ): SolutionBuilderWithWatchHost { @@ -696,17 +679,17 @@ export function makeSolutionBuilderHost( } else { diagnostics.global.push(d); } - log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); + instance.log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); }; const reportSolutionBuilderStatus = (d: typescript.Diagnostic) => - log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); + instance.log.logInfo(compiler.formatDiagnostic(d, formatDiagnosticHost)); const reportWatchStatus = ( d: typescript.Diagnostic, newLine: string, _options: typescript.CompilerOptions ) => - log.logInfo( + instance.log.logInfo( `${compiler.flattenDiagnosticMessageText( d.messageText, compiler.sys.newLine @@ -715,6 +698,7 @@ export function makeSolutionBuilderHost( const tsbuildinfos = new Map(); const outputFiles = new Map(); const outputAffectingInstanceVersion = new Map(); + let timeoutId: [(...args: any[]) => void, any[]] | undefined; const configFileInfo = new Map(); const solutionBuilderHost: SolutionBuilderWithWatchHost = { @@ -726,7 +710,7 @@ export function makeSolutionBuilderHost( reportWatchStatus ), diagnostics, - ...createWatchFactory(beforeWatchCallbacks), + ...createWatchFactory(), // Overrides getCurrentDirectory, // behave as if there is no tsbuild info on disk since we want to generate all outputs in memory and only use those @@ -793,10 +777,7 @@ export function makeSolutionBuilderHost( fileExists: fileName => { const outputFile = getOutputFileFromReferencedProject(fileName); if (outputFile !== undefined) { - return true; - } - if (isOutputFromReferencedProject(fileName)) { - return false; + return !!outputFile; } const existing = instance.files.get(path.resolve(fileName)) || @@ -822,19 +803,27 @@ export function makeSolutionBuilderHost( } return false; }, - setTimeout: undefined, - clearTimeout: undefined, + afterProgramEmitAndDiagnostics: transpileOnly ? undefined : storeDtsFiles, + setTimeout: (callback, _time, ...args) => { + timeoutId = [callback, args]; + return timeoutId; + }, + clearTimeout: _timeoutId => { + timeoutId = undefined; + }, outputFiles, tsbuildinfos, + configFileInfo, outputAffectingInstanceVersion, getOutputFileFromReferencedProject, getInputFileNameFromOutput: fileName => { const result = getInputFileNameFromOutput(fileName); return typeof result === 'string' ? result : undefined; }, - getOutputFilesFromReferencedProjectInput + getOutputFilesFromReferencedProjectInput, + buildReferences }; - solutionBuilderHost.trace = logData => log.logInfo(logData); + solutionBuilderHost.trace = logData => instance.log.logInfo(logData); solutionBuilderHost.getParsedCommandLine = file => { const config = getParsedCommandLine(compiler, instance.loaderOptions, file); configFileInfo.set(path.resolve(file), { config }); @@ -861,10 +850,40 @@ export function makeSolutionBuilderHost( return solutionBuilderHost; - function beforeWatchCallbacks() { + function buildReferences() { + if (!timeoutId) { + return; + } diagnostics.global.length = 0; diagnostics.perFile.clear(); diagnostics.transpileErrors.length = 0; + + while (timeoutId) { + const [callback, args] = timeoutId; + timeoutId = undefined; + callback(...args); + } + } + + function storeDtsFiles( + builderProgram: typescript.EmitAndSemanticDiagnosticsBuilderProgram + ) { + const program = builderProgram.getProgram(); + for (const configInfo of configFileInfo.values()) { + if ( + !configInfo.config || + program.getRootFileNames() !== configInfo.config.fileNames || + program.getCompilerOptions() !== configInfo.config.options || + program.getProjectReferences() !== configInfo.config.projectReferences + ) { + continue; + } + configInfo.dtsFiles = program + .getSourceFiles() + .map(file => path.resolve(file.fileName)) + .filter(fileName => fileName.match(constants.dtsDtsxOrDtsDtsxMapRegex)); + return; + } } function findOutputFile(fileName: string) { diff --git a/src/watch-run.ts b/src/watch-run.ts index 737070f62..5a9df90d6 100644 --- a/src/watch-run.ts +++ b/src/watch-run.ts @@ -15,26 +15,30 @@ export function makeWatchRun(instance: TSInstance) { return (compiler: webpack.Compiler, callback: () => void) => { const times = compiler.fileTimestamps; - for (const [filePath, date] of times) { - if ( - date > (lastTimes.get(filePath) || startTime) && - filePath.match(constants.tsTsxJsJsxRegex) !== null - ) { - continue; + if (instance.loaderOptions.transpileOnly) { + instance.reportTranspileErrors = true; + } else { + for (const [filePath, date] of times) { + if ( + date > (lastTimes.get(filePath) || startTime) && + filePath.match(constants.tsTsxJsJsxRegex) !== null + ) { + continue; + } + + lastTimes.set(filePath, date); + updateFile(instance, filePath); } - lastTimes.set(filePath, date); - updateFile(instance, filePath); - } - - // On watch update add all known dts files expect the ones in node_modules - // (skip @types/* and modules with typings) - for (const filePath of instance.files.keys()) { - if ( - filePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) !== null && - filePath.match(constants.nodeModules) === null - ) { - updateFile(instance, filePath); + // On watch update add all known dts files expect the ones in node_modules + // (skip @types/* and modules with typings) + for (const filePath of instance.files.keys()) { + if ( + filePath.match(constants.dtsDtsxOrDtsDtsxMapRegex) !== null && + filePath.match(constants.nodeModules) === null + ) { + updateFile(instance, filePath); + } } } diff --git a/test/comparison-tests/projectReferencesMultiple/app.ts b/test/comparison-tests/projectReferencesMultiple/app.ts new file mode 100644 index 000000000..0bce1f52e --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/app.ts @@ -0,0 +1,5 @@ +import { lib } from './lib'; +import { utils } from "./utils"; + +console.log(lib.one, lib.two, lib.three); +utils(); diff --git a/test/comparison-tests/projectReferencesMultiple/common/index.ts b/test/comparison-tests/projectReferencesMultiple/common/index.ts new file mode 100644 index 000000000..cee4c5145 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/common/index.ts @@ -0,0 +1,3 @@ +export function common() { + return 30; +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/common/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/common/tsconfig.json new file mode 100644 index 000000000..7f8ad846d --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/common/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "composite": true, + } +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/bundle.js new file mode 100644 index 000000000..8c836ba39 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/bundle.js @@ -0,0 +1,123 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesMultiple//lib//index.ts. The most common cause for this is having errors when building referenced projects./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:87:18)/n at successLoader (c://github//ts-loader//dist//index.js:73:9)/n at Object.loader (c://github//ts-loader//dist//index.js:24:5)\");\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesMultiple//utils//index.ts. The most common cause for this is having errors when building referenced projects./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:87:18)/n at successLoader (c://github//ts-loader//dist//index.js:73:9)/n at Object.loader (c://github//ts-loader//dist//index.js:24:5)\");\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/output.txt new file mode 100644 index 000000000..bee6c0c9e --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/output.txt @@ -0,0 +1,36 @@ + Asset Size Chunks Chunk Names + bundle.js 5.52 KiB main [emitted] main + ../common/index.d.ts 43 bytes [emitted] + ../unreferencedIndirect/index.d.ts 57 bytes [emitted] + ../unreferenced/index.d.ts 49 bytes [emitted] + ../common/tsconfig.tsbuildinfo 67.4 KiB [emitted] +../unreferencedIndirect/tsconfig.tsbuildinfo 67.4 KiB [emitted] + ../unreferenced/tsconfig.tsbuildinfo 67.4 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./lib/index.ts] 483 bytes {main} [built] [failed] [1 error] +[./utils/index.ts] 485 bytes {main} [built] [failed] [1 error] + +ERROR in ./lib/index.ts +Module build failed (from /index.js): +Error: TypeScript emitted no output for lib\index.ts. The most common cause for this is having errors when building referenced projects. + at makeSourceMapAndFinish (dist\index.js:87:18) + at successLoader (dist\index.js:73:9) + at Object.loader (dist\index.js:24:5) + @ ./app.ts 3:12-28 + +ERROR in ./utils/index.ts +Module build failed (from /index.js): +Error: TypeScript emitted no output for utils\index.ts. The most common cause for this is having errors when building referenced projects. + at makeSourceMapAndFinish (dist\index.js:87:18) + at successLoader (dist\index.js:73:9) + at Object.loader (dist\index.js:24:5) + @ ./app.ts 4:14-32 + +ERROR in lib\fileWithError.ts +[tsl] ERROR in lib\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. + +ERROR in indirectWithError\fileWithError.ts +[tsl] ERROR in indirectWithError\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/bundle.js new file mode 100644 index 000000000..3680c1295 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/bundle.js @@ -0,0 +1,124 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("throw new Error(\"Module build failed (from c:/github/ts-loader/index.js):/nError: TypeScript emitted no output for c://github//ts-loader//.test//projectReferencesMultiple//utils//index.ts. The most common cause for this is having errors when building referenced projects./n at makeSourceMapAndFinish (c://github//ts-loader//dist//index.js:87:18)/n at successLoader (c://github//ts-loader//dist//index.js:73:9)/n at Object.loader (c://github//ts-loader//dist//index.js:24:5)\");\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/output.txt new file mode 100644 index 000000000..c09e07d33 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch0/output.txt @@ -0,0 +1,21 @@ + Asset Size Chunks Chunk Names + bundle.js 5.14 KiB main [emitted] main + ../lib/fileWithError.d.ts 40 bytes [emitted] + ../lib/index.d.ts 89 bytes [emitted] +../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./lib/index.ts] 104 bytes {main} [built] +[./utils/index.ts] 485 bytes {main} [built] [failed] [1 error] + +ERROR in ./utils/index.ts +Module build failed (from /index.js): +Error: TypeScript emitted no output for utils\index.ts. The most common cause for this is having errors when building referenced projects. + at makeSourceMapAndFinish (dist\index.js:87:18) + at successLoader (dist\index.js:73:9) + at Object.loader (dist\index.js:24:5) + @ ./app.ts 4:14-32 + +ERROR in indirectWithError\fileWithError.ts +[tsl] ERROR in indirectWithError\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/bundle.js new file mode 100644 index 000000000..3141fcd5f --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nfunction common() {\r\n return 30;\r\n}\r\nexports.common = common;\r\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\r\nfunction utils() {\r\n common_1.common();\r\n}\r\nexports.utils = utils;\r\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/output.txt new file mode 100644 index 000000000..ca3ffe5a0 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch1/output.txt @@ -0,0 +1,12 @@ + Asset Size Chunks Chunk Names + bundle.js 5.24 KiB main [emitted] main + ../indirectWithError/fileWithError.d.ts 40 bytes [emitted] + ../indirectWithError/index.d.ts 89 bytes [emitted] + ../utils/index.d.ts 40 bytes [emitted] +../indirectWithError/tsconfig.tsbuildinfo 67.8 KiB [emitted] + ../utils/tsconfig.tsbuildinfo 68 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./common/index.ts] 109 bytes {main} [built] +[./lib/index.ts] 104 bytes {main} +[./utils/index.ts] 152 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/bundle.js new file mode 100644 index 000000000..3141fcd5f --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nfunction common() {\r\n return 30;\r\n}\r\nexports.common = common;\r\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\r\nfunction utils() {\r\n common_1.common();\r\n}\r\nexports.utils = utils;\r\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/output.txt new file mode 100644 index 000000000..37d274632 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch2/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 5.24 KiB main [emitted] main + ../unreferenced/index.d.ts 49 bytes [emitted] +../unreferenced/tsconfig.tsbuildinfo 67.4 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./common/index.ts] 109 bytes {main} +[./lib/index.ts] 104 bytes {main} +[./utils/index.ts] 152 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/bundle.js new file mode 100644 index 000000000..3141fcd5f --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nfunction common() {\r\n return 30;\r\n}\r\nexports.common = common;\r\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\r\nfunction utils() {\r\n common_1.common();\r\n}\r\nexports.utils = utils;\r\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/output.txt new file mode 100644 index 000000000..346fffd8c --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch3/output.txt @@ -0,0 +1,11 @@ + Asset Size Chunks Chunk Names +bundle.js 5.24 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./common/index.ts] 109 bytes {main} +[./lib/index.ts] 104 bytes {main} +[./utils/index.ts] 152 bytes {main} + +ERROR in unreferencedIndirect\index.ts +[tsl] ERROR in unreferencedIndirect\index.ts(2,3) + TS2322: Type '"i am unreferencedIndirect now is error"' is not assignable to type 'number'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/bundle.js new file mode 100644 index 000000000..3141fcd5f --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nfunction common() {\r\n return 30;\r\n}\r\nexports.common = common;\r\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\r\nfunction utils() {\r\n common_1.common();\r\n}\r\nexports.utils = utils;\r\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/output.txt new file mode 100644 index 000000000..5bf7aafad --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch4/output.txt @@ -0,0 +1,9 @@ + Asset Size Chunks Chunk Names + bundle.js 5.24 KiB main [emitted] main + ../unreferencedIndirect/index.d.ts 57 bytes [emitted] +../unreferencedIndirect/tsconfig.tsbuildinfo 67.4 KiB [emitted] +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./common/index.ts] 109 bytes {main} +[./lib/index.ts] 104 bytes {main} +[./utils/index.ts] 152 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/bundle.js new file mode 100644 index 000000000..3141fcd5f --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nexports.__esModule = true;\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nfunction common() {\r\n return 30;\r\n}\r\nexports.common = common;\r\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nexports.lib = {\r\n one: 1,\r\n two: 2,\r\n three: 3\r\n};\r\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\nexports.__esModule = true;\r\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\r\nfunction utils() {\r\n common_1.common();\r\n}\r\nexports.utils = utils;\r\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/output.txt new file mode 100644 index 000000000..142ed9fd4 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-3.8/patch5/output.txt @@ -0,0 +1,11 @@ + Asset Size Chunks Chunk Names +bundle.js 5.24 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 182 bytes {main} [built] +[./common/index.ts] 109 bytes {main} +[./lib/index.ts] 104 bytes {main} +[./utils/index.ts] 152 bytes {main} + +ERROR in unreferenced\index.ts +[tsl] ERROR in unreferenced\index.ts(2,3) + TS2322: Type '"i am unreferenced with error"' is not assignable to type 'number'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/bundle.js b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/bundle.js new file mode 100644 index 000000000..8415e05ce --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/bundle.js @@ -0,0 +1,137 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./app.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./app.ts": +/*!****************!*\ + !*** ./app.ts ***! + \****************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ./lib */ \"./lib/index.ts\");\nvar utils_1 = __webpack_require__(/*! ./utils */ \"./utils/index.ts\");\nconsole.log(lib_1.lib.one, lib_1.lib.two, lib_1.lib.three);\nutils_1.utils();\n\n\n//# sourceURL=webpack:///./app.ts?"); + +/***/ }), + +/***/ "./common/index.ts": +/*!*************************!*\ + !*** ./common/index.ts ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction common() {\n return 30;\n}\nexports.common = common;\n\n\n//# sourceURL=webpack:///./common/index.ts?"); + +/***/ }), + +/***/ "./lib/index.ts": +/*!**********************!*\ + !*** ./lib/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lib = {\n one: 1,\n two: 2,\n three: 3\n};\n\n\n//# sourceURL=webpack:///./lib/index.ts?"); + +/***/ }), + +/***/ "./utils/index.ts": +/*!************************!*\ + !*** ./utils/index.ts ***! + \************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar common_1 = __webpack_require__(/*! ../common */ \"./common/index.ts\");\nfunction utils() {\n common_1.common();\n}\nexports.utils = utils;\n\n\n//# sourceURL=webpack:///./utils/index.ts?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/output.txt new file mode 100644 index 000000000..15cb08751 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/output.txt @@ -0,0 +1,13 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main [emitted] main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] [2 errors] +[./common/index.ts] 139 bytes {main} [built] +[./lib/index.ts] 133 bytes {main} [built] +[./utils/index.ts] 181 bytes {main} [built] + +ERROR in [tsl] ERROR in indirectWithError\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. + +ERROR in [tsl] ERROR in lib\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch0/output.txt new file mode 100644 index 000000000..2e775726d --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch0/output.txt @@ -0,0 +1,10 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] [1 error] +[./common/index.ts] 139 bytes {main} +[./lib/index.ts] 133 bytes {main} +[./utils/index.ts] 181 bytes {main} + +ERROR in [tsl] ERROR in indirectWithError\fileWithError.ts(2,5) + TS2322: Type 'false' is not assignable to type 'string'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch1/output.txt new file mode 100644 index 000000000..7103d84df --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch1/output.txt @@ -0,0 +1,7 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] +[./common/index.ts] 139 bytes {main} +[./lib/index.ts] 133 bytes {main} +[./utils/index.ts] 181 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch3/output.txt new file mode 100644 index 000000000..449b2a89a --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch3/output.txt @@ -0,0 +1,10 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] [1 error] +[./common/index.ts] 139 bytes {main} +[./lib/index.ts] 133 bytes {main} +[./utils/index.ts] 181 bytes {main} + +ERROR in [tsl] ERROR in unreferencedIndirect\index.ts(2,3) + TS2322: Type '"i am unreferencedIndirect now is error"' is not assignable to type 'number'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch4/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch4/output.txt new file mode 100644 index 000000000..13e89eef3 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch4/output.txt @@ -0,0 +1,7 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] +[./common/index.ts] 139 bytes {main} +[./lib/index.ts] 133 bytes {main} +[./utils/index.ts] 181 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch5/output.txt b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch5/output.txt new file mode 100644 index 000000000..783ffc726 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/expectedOutput-transpile-3.8/patch5/output.txt @@ -0,0 +1,10 @@ + Asset Size Chunks Chunk Names +bundle.js 5.35 KiB main main +Entrypoint main = bundle.js +[./app.ts] 218 bytes {main} [built] [1 error] +[./common/index.ts] 139 bytes {main} +[./lib/index.ts] 133 bytes {main} +[./utils/index.ts] 181 bytes {main} + +ERROR in [tsl] ERROR in unreferenced\index.ts(2,3) + TS2322: Type '"i am unreferenced with error"' is not assignable to type 'number'. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/indirectWithError/fileWithError.ts b/test/comparison-tests/projectReferencesMultiple/indirectWithError/fileWithError.ts new file mode 100644 index 000000000..0df3311ab --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/indirectWithError/fileWithError.ts @@ -0,0 +1,3 @@ +export function foo(): string { + return false; +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/indirectWithError/index.ts b/test/comparison-tests/projectReferencesMultiple/indirectWithError/index.ts new file mode 100644 index 000000000..669ca7b3d --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/indirectWithError/index.ts @@ -0,0 +1,5 @@ +export const lib = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesMultiple/indirectWithError/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/indirectWithError/tsconfig.json new file mode 100644 index 000000000..b3df08516 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/indirectWithError/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "composite": true + } +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/lib/fileWithError.ts b/test/comparison-tests/projectReferencesMultiple/lib/fileWithError.ts new file mode 100644 index 000000000..0df3311ab --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/lib/fileWithError.ts @@ -0,0 +1,3 @@ +export function foo(): string { + return false; +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/lib/index.ts b/test/comparison-tests/projectReferencesMultiple/lib/index.ts new file mode 100644 index 000000000..669ca7b3d --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/lib/index.ts @@ -0,0 +1,5 @@ +export const lib = { + one: 1, + two: 2, + three: 3 +}; diff --git a/test/comparison-tests/projectReferencesMultiple/lib/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/lib/tsconfig.json new file mode 100644 index 000000000..b3df08516 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/lib/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "composite": true + } +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/patch0/lib/fileWithError.ts b/test/comparison-tests/projectReferencesMultiple/patch0/lib/fileWithError.ts new file mode 100644 index 000000000..9c7ffaa4a --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch0/lib/fileWithError.ts @@ -0,0 +1,3 @@ +export function foo(): string { + return "hello world"; +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/patch1/indirectWithError/fileWithError.ts b/test/comparison-tests/projectReferencesMultiple/patch1/indirectWithError/fileWithError.ts new file mode 100644 index 000000000..950dc3761 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch1/indirectWithError/fileWithError.ts @@ -0,0 +1,3 @@ +export function foo(): string { + return "hello i fixed this error"; +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/patch2/unreferenced/index.ts b/test/comparison-tests/projectReferencesMultiple/patch2/unreferenced/index.ts new file mode 100644 index 000000000..14345b5e2 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch2/unreferenced/index.ts @@ -0,0 +1,3 @@ +export function unreferenced() { + return "i am unreferenced without error"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/patch3/unreferencedIndirect/index.ts b/test/comparison-tests/projectReferencesMultiple/patch3/unreferencedIndirect/index.ts new file mode 100644 index 000000000..6813358de --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch3/unreferencedIndirect/index.ts @@ -0,0 +1,3 @@ +export function unreferencedIndirect(): number { + return "i am unreferencedIndirect now is error"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/patch4/unreferencedIndirect/index.ts b/test/comparison-tests/projectReferencesMultiple/patch4/unreferencedIndirect/index.ts new file mode 100644 index 000000000..3e6f53212 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch4/unreferencedIndirect/index.ts @@ -0,0 +1,3 @@ +export function unreferencedIndirect() { + return "i am unreferencedIndirect now fixed error"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/patch5/unreferenced/index.ts b/test/comparison-tests/projectReferencesMultiple/patch5/unreferenced/index.ts new file mode 100644 index 000000000..cfa941c30 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/patch5/unreferenced/index.ts @@ -0,0 +1,3 @@ +export function unreferenced(): number { + return "i am unreferenced with error"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/tsconfig.json new file mode 100644 index 000000000..97f04b7ee --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/tsconfig.json @@ -0,0 +1,10 @@ +{ +"files": [ + "./app.ts" + ], + "references": [ + { "path": "./lib" }, + { "path": "./utils" }, + { "path": "./unreferenced" }, + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/unreferenced/index.ts b/test/comparison-tests/projectReferencesMultiple/unreferenced/index.ts new file mode 100644 index 000000000..3601112f7 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/unreferenced/index.ts @@ -0,0 +1,3 @@ +export function unreferenced() { + return "i am unreferenced"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/unreferenced/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/unreferenced/tsconfig.json new file mode 100644 index 000000000..fde6864ed --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/unreferenced/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../unreferencedIndirect" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/index.ts b/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/index.ts new file mode 100644 index 000000000..3ac50dc17 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/index.ts @@ -0,0 +1,3 @@ +export function unreferencedIndirect() { + return "i am unreferencedIndirect"; +} diff --git a/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/tsconfig.json new file mode 100644 index 000000000..b3df08516 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/unreferencedIndirect/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "composite": true + } +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/utils/index.ts b/test/comparison-tests/projectReferencesMultiple/utils/index.ts new file mode 100644 index 000000000..713ee249d --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/utils/index.ts @@ -0,0 +1,4 @@ +import { common } from "../common"; +export function utils() { + common(); +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/utils/tsconfig.json b/test/comparison-tests/projectReferencesMultiple/utils/tsconfig.json new file mode 100644 index 000000000..996b12d7c --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/utils/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true + }, + "references": [ + { "path": "../common" }, + { "path": "../indirectWithError" } + ] +} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesMultiple/webpack.config.js b/test/comparison-tests/projectReferencesMultiple/webpack.config.js new file mode 100644 index 000000000..a8a142774 --- /dev/null +++ b/test/comparison-tests/projectReferencesMultiple/webpack.config.js @@ -0,0 +1,21 @@ +var path = require('path') + +module.exports = { + mode: 'development', + entry: './app.ts', + output: { + filename: 'bundle.js' + }, + resolve: { + extensions: ['.ts', '.js'] + }, + module: { + rules: [ + { test: /\.ts$/, loader: 'ts-loader', options: { projectReferences: true } } + ] + } +} + +// for test harness purposes only, you would not need this in a normal project +module.exports.resolveLoader = { alias: { 'ts-loader': require('path').join(__dirname, "../../../index.js") } } + diff --git a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch0/output.txt index 5bdc311de..9b075a7bc 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.39 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/index.ts] 164 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch2/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch2/output.txt index df2b4fb68..a60242613 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch2/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch2/output.txt @@ -1,5 +1,11 @@ Asset Size Chunks Chunk Names bundle.js 4.43 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} -[./lib/index.ts] 168 bytes {main} [built] \ No newline at end of file +[./app.ts] 205 bytes {main} [built] [2 errors] +[./lib/index.ts] 168 bytes {main} [built] + +ERROR in [tsl] ERROR in lib\index.ts(6,3) + TS1136: Property assignment expected. + +ERROR in [tsl] ERROR in lib\index.ts(7,1) + TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch3/output.txt index 2c28f842b..7ff631214 100644 --- a/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesOutDirWithPackageJson/expectedOutput-transpile-3.8/patch3/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.42 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} +[./app.ts] 205 bytes {main} [built] [./lib/index.ts] 160 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch0/output.txt index 5bdc311de..9b075a7bc 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.39 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/index.ts] 164 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch2/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch2/output.txt index df2b4fb68..a60242613 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch2/output.txt @@ -1,5 +1,11 @@ Asset Size Chunks Chunk Names bundle.js 4.43 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} -[./lib/index.ts] 168 bytes {main} [built] \ No newline at end of file +[./app.ts] 205 bytes {main} [built] [2 errors] +[./lib/index.ts] 168 bytes {main} [built] + +ERROR in [tsl] ERROR in lib\index.ts(6,3) + TS1136: Property assignment expected. + +ERROR in [tsl] ERROR in lib\index.ts(7,1) + TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch3/output.txt index 2c28f842b..7ff631214 100644 --- a/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch/expectedOutput-transpile-3.8/patch3/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.42 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} +[./app.ts] 205 bytes {main} [built] [./lib/index.ts] 160 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt index 1b5e06e91..d769864b2 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-3.8/patch0/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 89 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-transpile-3.8/patch0/output.txt index 89950814d..4a8c14dee 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 225 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt index 4137e4207..8e5f8001c 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-3.8/patch1/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch0/output.txt index 82d28664a..ac0689b76 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 136 bytes {main} [./lib/index.ts] 238 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch1/output.txt index 724ac0f9a..a26fe5f90 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt/expectedOutput-transpile-3.8/patch1/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.91 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 238 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt index e17a418d1..55acfba32 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -1,8 +1,9 @@ Asset Size Chunks Chunk Names bundle.js 4.82 KiB main [emitted] main - ../app.d.ts 11 bytes [emitted] + ../app.d.ts 12 bytes [emitted] ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] + ../tsconfig.tsbuildinfo 65.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 107 bytes {main} diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt index 4036a0cf2..ade960709 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-3.8/patch1/output.txt @@ -5,6 +5,6 @@ ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 82d28664a..ac0689b76 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 136 bytes {main} [./lib/index.ts] 238 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt index 724ac0f9a..a26fe5f90 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_Composite_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.91 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 238 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt index 4137e4207..8e5f8001c 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-3.8/patch1/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 211 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 82d28664a..ac0689b76 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 136 bytes {main} [./lib/index.ts] 238 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt index 724ac0f9a..a26fe5f90 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFilesAlreadyBuilt_WatchApi/expectedOutput-transpile-3.8/patch1/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.91 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 238 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt index 5bf34afaf..65bb5f0d0 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -1,10 +1,11 @@ Asset Size Chunks Chunk Names bundle.js 4.82 KiB main [emitted] main - ../app.d.ts 11 bytes [emitted] + ../app.d.ts 12 bytes [emitted] ../lib/helper.d.ts 111 bytes [emitted] ../lib/index.d.ts 89 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] + ../tsconfig.tsbuildinfo 65.4 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 89950814d..4a8c14dee 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 225 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt index 1b5e06e91..d769864b2 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -4,6 +4,6 @@ ../lib/index.d.ts 89 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.8 KiB [emitted] Entrypoint main = bundle.js -[./app.ts] 131 bytes {main} +[./app.ts] 131 bytes {main} [built] [./lib/helper.ts] 121 bytes {main} [built] [./lib/index.ts] 197 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 89950814d..4a8c14dee 100644 --- a/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatchRefWithTwoFiles_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,6 +1,6 @@ Asset Size Chunks Chunk Names bundle.js 4.9 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/helper.ts] 149 bytes {main} [built] [./lib/index.ts] 225 bytes {main} \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt index 5a6e0995f..ba8ecb89e 100644 --- a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch0/output.txt @@ -1,8 +1,9 @@ Asset Size Chunks Chunk Names bundle.js 4.33 KiB main [emitted] main - ../app.d.ts 11 bytes [emitted] + ../app.d.ts 12 bytes [emitted] ../lib/index.d.ts 108 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.4 KiB [emitted] + ../tsconfig.tsbuildinfo 65.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 131 bytes {main} [built] [./lib/index.ts] 136 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch3/output.txt index 70bea34ef..9756f11a2 100644 --- a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-3.8/patch3/output.txt @@ -1,8 +1,9 @@ Asset Size Chunks Chunk Names bundle.js 4.36 KiB main [emitted] main - ../app.d.ts 11 bytes [emitted] + ../app.d.ts 12 bytes [emitted] ../lib/index.d.ts 127 bytes [emitted] ../lib/tsconfig.tsbuildinfo 67.4 KiB [emitted] + ../tsconfig.tsbuildinfo 65.4 KiB [emitted] Entrypoint main = bundle.js [./app.ts] 169 bytes {main} [built] [./lib/index.ts] 132 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 5bdc311de..9b075a7bc 100644 --- a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.39 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/index.ts] 164 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt index df2b4fb68..a60242613 100644 --- a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt @@ -1,5 +1,11 @@ Asset Size Chunks Chunk Names bundle.js 4.43 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} -[./lib/index.ts] 168 bytes {main} [built] \ No newline at end of file +[./app.ts] 205 bytes {main} [built] [2 errors] +[./lib/index.ts] 168 bytes {main} [built] + +ERROR in [tsl] ERROR in lib\index.ts(6,3) + TS1136: Property assignment expected. + +ERROR in [tsl] ERROR in lib\index.ts(7,1) + TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt index 2c28f842b..7ff631214 100644 --- a/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch_Composite_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.42 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} +[./app.ts] 205 bytes {main} [built] [./lib/index.ts] 160 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt index 5bdc311de..9b075a7bc 100644 --- a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt +++ b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch0/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.39 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 167 bytes {main} +[./app.ts] 167 bytes {main} [built] [./lib/index.ts] 164 bytes {main} [built] \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt index df2b4fb68..a60242613 100644 --- a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt +++ b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch2/output.txt @@ -1,5 +1,11 @@ Asset Size Chunks Chunk Names bundle.js 4.43 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} -[./lib/index.ts] 168 bytes {main} [built] \ No newline at end of file +[./app.ts] 205 bytes {main} [built] [2 errors] +[./lib/index.ts] 168 bytes {main} [built] + +ERROR in [tsl] ERROR in lib\index.ts(6,3) + TS1136: Property assignment expected. + +ERROR in [tsl] ERROR in lib\index.ts(7,1) + TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt index 2c28f842b..7ff631214 100644 --- a/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt +++ b/test/comparison-tests/projectReferencesWatch_WatchApi/expectedOutput-transpile-3.8/patch3/output.txt @@ -1,5 +1,5 @@ Asset Size Chunks Chunk Names bundle.js 4.42 KiB main [emitted] main Entrypoint main = bundle.js -[./app.ts] 205 bytes {main} +[./app.ts] 205 bytes {main} [built] [./lib/index.ts] 160 bytes {main} [built] \ No newline at end of file