Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #31191 from Microsoft/fileFromNodeModules
Include only files that can be emitted into the source file directory check for composite projects
- Loading branch information
Showing
5 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/compositeWithNodeModulesSourceFile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//// [tests/cases/compiler/compositeWithNodeModulesSourceFile.ts] //// | ||
|
||
//// [index.ts] | ||
export class c { } | ||
|
||
//// [test.ts] | ||
import myModule = require("myModule"); | ||
new myModule.c(); | ||
|
||
|
||
|
||
//// [test.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var myModule = require("myModule"); | ||
new myModule.c(); | ||
|
||
|
||
//// [test.d.ts] | ||
export {}; |
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/compositeWithNodeModulesSourceFile.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
=== /foo/test.ts === | ||
import myModule = require("myModule"); | ||
>myModule : Symbol(myModule, Decl(test.ts, 0, 0)) | ||
|
||
new myModule.c(); | ||
>myModule.c : Symbol(myModule.c, Decl(index.ts, 0, 0)) | ||
>myModule : Symbol(myModule, Decl(test.ts, 0, 0)) | ||
>c : Symbol(myModule.c, Decl(index.ts, 0, 0)) | ||
|
||
|
||
=== /foo/node_modules/myModule/index.ts === | ||
export class c { } | ||
>c : Symbol(c, Decl(index.ts, 0, 0)) | ||
|
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/compositeWithNodeModulesSourceFile.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
=== /foo/test.ts === | ||
import myModule = require("myModule"); | ||
>myModule : typeof myModule | ||
|
||
new myModule.c(); | ||
>new myModule.c() : myModule.c | ||
>myModule.c : typeof myModule.c | ||
>myModule : typeof myModule | ||
>c : typeof myModule.c | ||
|
||
|
||
=== /foo/node_modules/myModule/index.ts === | ||
export class c { } | ||
>c : c | ||
|
13 changes: 13 additions & 0 deletions
13
tests/cases/compiler/compositeWithNodeModulesSourceFile.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @filename: /foo/tsconfig.json | ||
{ | ||
"compilerOptions": { "composite": true }, | ||
"exclude": [ "node_modules" ] | ||
} | ||
|
||
// @filename: /foo/node_modules/myModule/index.ts | ||
export class c { } | ||
|
||
// @filename: /foo/test.ts | ||
import myModule = require("myModule"); | ||
new myModule.c(); | ||
|