diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4d754ed33e076..e7e5617057dce 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -3849,7 +3849,10 @@ function hasFileWithHigherPriorityExtension(file: string, literalFiles: Map { caseInsensitiveBasePath, ); }); + + describe("sameNamedDeclarations", () => { + baselineMatches( + "same named declarations with include ts", + { include: ["*.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include ts dts", + { include: ["*.ts", "*.d.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include tsx", + { include: ["*.tsx"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include tsx ts", + { include: ["*.tsx", "*.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include ts tsx", + { include: ["*.tsx", "*.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include tsx dts", + { include: ["*.tsx", "*.d.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + baselineMatches( + "same named declarations with include dts tsx", + { include: ["*.tsx", "*.d.ts"] }, + caseInsensitiveHostWithSameFileNamesWithDifferentExtensions, + caseInsensitiveBasePath, + ); + }); }); describe("with files or folders that begin with a .", () => { diff --git a/src/testRunner/unittests/tsbuild/clean.ts b/src/testRunner/unittests/tsbuild/clean.ts index e5643f4c39052..5df00878fa063 100644 --- a/src/testRunner/unittests/tsbuild/clean.ts +++ b/src/testRunner/unittests/tsbuild/clean.ts @@ -1,11 +1,15 @@ import { + noop, +} from "../../_namespaces/ts"; +import { + noChangeRun, verifyTsc, } from "../helpers/tsc"; import { loadProjectFromFiles, } from "../helpers/vfs"; -describe("unittests:: tsbuild - clean", () => { +describe("unittests:: tsbuild - clean::", () => { verifyTsc({ scenario: "clean", subScenario: `file name and output name clashing`, @@ -19,4 +23,26 @@ describe("unittests:: tsbuild - clean", () => { }), }), }); + + verifyTsc({ + scenario: "clean", + subScenario: "tsx with dts emit", + fs: () => + loadProjectFromFiles({ + "/src/project/src/main.tsx": "export const x = 10;", + "/src/project/tsconfig.json": JSON.stringify({ + compilerOptions: { declaration: true }, + include: ["src/**/*.tsx", "src/**/*.ts"], + }), + }), + commandLineArgs: ["--b", "src/project", "-v", "--explainFiles"], + edits: [ + noChangeRun, + { + caption: "clean build", + edit: noop, + commandLineArgs: ["-b", "/src/project", "--clean"], + }, + ], + }); }); diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with json api.js new file mode 100644 index 0000000000000..2919f010225ca --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with json api.js @@ -0,0 +1,78 @@ +config: +{ + "include": [ + "*.tsx", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx", + "c:/dev/m.d.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.d.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with jsonSourceFile api.js new file mode 100644 index 0000000000000..c995a1aaf2909 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include dts tsx with jsonSourceFile api.js @@ -0,0 +1,77 @@ +config: +{ + "include": [ + "*.tsx", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx", + "c:/dev/m.d.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.d.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with json api.js new file mode 100644 index 0000000000000..e720253f033ee --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with json api.js @@ -0,0 +1,78 @@ +config: +{ + "include": [ + "*.ts", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.d.ts", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts", + "*.d.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with jsonSourceFile api.js new file mode 100644 index 0000000000000..f6fe6ac8399c3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts dts with jsonSourceFile api.js @@ -0,0 +1,77 @@ +config: +{ + "include": [ + "*.ts", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.d.ts", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts", + "*.d.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with json api.js new file mode 100644 index 0000000000000..464b696cc30ac --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with json api.js @@ -0,0 +1,79 @@ +config: +{ + "include": [ + "*.tsx", + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/c.tsx", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with jsonSourceFile api.js new file mode 100644 index 0000000000000..dee8f48844ace --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts tsx with jsonSourceFile api.js @@ -0,0 +1,78 @@ +config: +{ + "include": [ + "*.tsx", + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/c.tsx", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts with json api.js new file mode 100644 index 0000000000000..e3d978c412cbc --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts with json api.js @@ -0,0 +1,76 @@ +config: +{ + "include": [ + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.d.ts", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include ts with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include ts with jsonSourceFile api.js new file mode 100644 index 0000000000000..6f79d59013866 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include ts with jsonSourceFile api.js @@ -0,0 +1,75 @@ +config: +{ + "include": [ + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.d.ts", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with json api.js new file mode 100644 index 0000000000000..2919f010225ca --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with json api.js @@ -0,0 +1,78 @@ +config: +{ + "include": [ + "*.tsx", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx", + "c:/dev/m.d.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.d.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with jsonSourceFile api.js new file mode 100644 index 0000000000000..c995a1aaf2909 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx dts with jsonSourceFile api.js @@ -0,0 +1,77 @@ +config: +{ + "include": [ + "*.tsx", + "*.d.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx", + "c:/dev/m.d.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.d.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with json api.js new file mode 100644 index 0000000000000..464b696cc30ac --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with json api.js @@ -0,0 +1,79 @@ +config: +{ + "include": [ + "*.tsx", + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/c.tsx", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with jsonSourceFile api.js new file mode 100644 index 0000000000000..dee8f48844ace --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx ts with jsonSourceFile api.js @@ -0,0 +1,78 @@ +config: +{ + "include": [ + "*.tsx", + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/c.tsx", + "c:/dev/b.ts", + "c:/dev/m.ts", + "c:/dev/n.ts", + "c:/dev/o.ts", + "c:/dev/x.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx", + "*.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with json api.js new file mode 100644 index 0000000000000..371e54a4fc176 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with json api.js @@ -0,0 +1,74 @@ +config: +{ + "include": [ + "*.tsx" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with jsonSourceFile api.js new file mode 100644 index 0000000000000..fa4240db4d5b9 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations with include tsx with jsonSourceFile api.js @@ -0,0 +1,73 @@ +config: +{ + "include": [ + "*.tsx" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.tsx] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/m.d.ts] + + +//// [c:/dev/m.ts] + + +//// [c:/dev/n.d.ts] + + +//// [c:/dev/n.ts] + + +//// [c:/dev/n.tsx] + + +//// [c:/dev/o.ts] + + +//// [c:/dev/x.d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.tsx", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/n.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.tsx" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js b/tests/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js new file mode 100644 index 0000000000000..c5e1dc36c12b1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js @@ -0,0 +1,81 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/main.tsx] +export const x = 10; + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"declaration":true},"include":["src/**/*.tsx","src/**/*.ts"]} + + + +Output:: +/lib/tsc --b src/project -v --explainFiles +[12:00:10 AM] Projects in this build: + * src/project/tsconfig.json + +[12:00:11 AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/src/main.js' does not exist + +[12:00:12 AM] Building project '/src/project/tsconfig.json'... + +lib/lib.d.ts + Default library for target 'es5' +src/project/src/main.tsx + Matched by include pattern 'src/**/*.tsx' in 'src/project/tsconfig.json' +exitCode:: ExitStatus.Success + + +//// [/src/project/src/main.d.ts] +export declare const x = 10; + + +//// [/src/project/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b src/project -v --explainFiles +[12:00:15 AM] Projects in this build: + * src/project/tsconfig.json + +[12:00:16 AM] Project 'src/project/tsconfig.json' is up to date because newest input 'src/project/src/main.tsx' is older than output 'src/project/src/main.js' + +exitCode:: ExitStatus.Success + + + + +Change:: clean build +Input:: + + +Output:: +/lib/tsc -b /src/project --clean +exitCode:: ExitStatus.Success + + +//// [/src/project/src/main.d.ts] unlink +//// [/src/project/src/main.js] unlink