mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Recognize relative path using in outDir property (#9025)
* Recognize relative path using in outDir property * Add projects tests * Add project .json files * Update baselines
This commit is contained in:
+1
-1
@@ -34,7 +34,6 @@ tests/webhost/*.d.ts
|
||||
tests/webhost/webtsc.js
|
||||
tests/cases/**/*.js
|
||||
tests/cases/**/*.js.map
|
||||
tests/cases/**/*.d.ts
|
||||
*.config
|
||||
scripts/debug.bat
|
||||
scripts/run.bat
|
||||
@@ -49,3 +48,4 @@ internal/
|
||||
**/.vs
|
||||
**/.vscode
|
||||
!**/.vscode/tasks.json
|
||||
!tests/cases/projects/projectOption/**/node_modules
|
||||
|
||||
@@ -717,7 +717,7 @@ namespace ts {
|
||||
if (outDir) {
|
||||
exclude.push(outDir);
|
||||
}
|
||||
exclude = map(exclude, normalizeSlashes);
|
||||
exclude = map(exclude, e => getNormalizedAbsolutePath(e, basePath));
|
||||
|
||||
const supportedExtensions = getSupportedExtensions(options);
|
||||
Debug.assert(indexOf(supportedExtensions, ".ts") < indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick");
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with only node_modules in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"a.js",
|
||||
"a.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with only node_modules in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"a.js",
|
||||
"a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js",
|
||||
"OutDir/a.d.ts"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"a.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"OutDir/a.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
|
||||
"baselineCheck": true
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
|
||||
"baselineCheck": true,
|
||||
"declaration": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
|
||||
"baselineCheck": true
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"scenario": "Verify default exclude property with only node_modules in project option",
|
||||
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
|
||||
"baselineCheck": true,
|
||||
"declaration": true
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePath",
|
||||
"baselineCheck": true,
|
||||
"declaration": true
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scenario": "Verify exclude property without using relative path",
|
||||
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePathWithAllowJS",
|
||||
"baselineCheck": true
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "OutDir",
|
||||
"declaration": true
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "OutDir",
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./OutDir",
|
||||
"declaration": true
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./OutDir",
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: string; // Shouldn't error since it is not include in compilation
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./OutDir",
|
||||
"declaration": true
|
||||
},
|
||||
"exclude": [
|
||||
"./node_modules",
|
||||
"./OutDir"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: string; // Shouldn't error since it is not include in compilation
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./OutDir",
|
||||
"allowJs": true
|
||||
},
|
||||
"exclude": [
|
||||
"./node_modules",
|
||||
"./OutDir"
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var test: string; // Shouldn't error since it is not include in compilation
|
||||
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "OutDir",
|
||||
"declaration": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"OutDir"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
declare var test: string; // Shouldn't error since it is not include in compilation
|
||||
+1
@@ -0,0 +1 @@
|
||||
var test = 10;
|
||||
Generated
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// This files shouldn't be included in the compilation
|
||||
declare var test: string;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "OutDir",
|
||||
"allowJs": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"OutDir"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user