Merge pull request #9421 from Microsoft/dontEmitNodeModules

Don't emit any source files found under node_modules
This commit is contained in:
Bill Ticehurst
2016-06-30 19:47:34 -07:00
committed by GitHub
15 changed files with 71 additions and 33 deletions

View File

@@ -8,8 +8,6 @@ export {};
//// [app.ts]
import "A"
//// [index.js]
"use strict";
//// [app.js]
"use strict";
require("A");

View File

@@ -31,9 +31,6 @@ exports.x = 1;
//// [file2.js]
"use strict";
exports.y = 1;
//// [file4.js]
"use strict";
exports.z1 = 1;
//// [file1.js]
"use strict";
var file1_1 = require("folder2/file1");

View File

@@ -1,6 +1,7 @@
define(["require", "exports", "m1"], function (require, exports, m1) {
define(["require", "exports", "m1", "m4"], function (require, exports, m1, m4) {
"use strict";
m1.f1("test");
m1.f2.a = 10;
m1.f2.person.age = "10"; // Error: Should be number
m1.f2.person.age = "10"; // Should error if loaded the .js files correctly
var r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file
});

View File

@@ -1,4 +1,4 @@
maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== index.js (0 errors) ====
@@ -28,11 +28,19 @@ maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to
exports.f2 = m2;
==== entry.d.ts (0 errors) ====
export declare var foo: number;
==== maxDepthIncreased/root.ts (1 errors) ====
import * as m1 from "m1";
import * as m4 from "m4";
m1.f1("test");
m1.f2.a = 10;
m1.f2.person.age = "10"; // Error: Should be number
m1.f2.person.age = "10"; // Should error if loaded the .js files correctly
~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file

View File

@@ -10,6 +10,7 @@
"maxDepthIncreased/node_modules/m2/node_modules/m3/index.js",
"maxDepthIncreased/node_modules/m2/entry.js",
"maxDepthIncreased/node_modules/m1/index.js",
"maxDepthIncreased/node_modules/@types/m4/entry.d.ts",
"maxDepthIncreased/root.ts"
],
"emittedFiles": [

View File

@@ -1,5 +1,7 @@
"use strict";
var m1 = require("m1");
var m4 = require("m4");
m1.f1("test");
m1.f2.a = 10;
m1.f2.person.age = "10"; // Error: Should be number
m1.f2.person.age = "10"; // Should error if loaded the .js files correctly
var r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file

View File

@@ -1,4 +1,4 @@
maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'.
==== index.js (0 errors) ====
@@ -28,11 +28,19 @@ maxDepthIncreased/root.ts(4,1): error TS2322: Type 'string' is not assignable to
exports.f2 = m2;
==== entry.d.ts (0 errors) ====
export declare var foo: number;
==== maxDepthIncreased/root.ts (1 errors) ====
import * as m1 from "m1";
import * as m4 from "m4";
m1.f1("test");
m1.f2.a = 10;
m1.f2.person.age = "10"; // Error: Should be number
m1.f2.person.age = "10"; // Should error if loaded the .js files correctly
~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file

View File

@@ -10,6 +10,7 @@
"maxDepthIncreased/node_modules/m2/node_modules/m3/index.js",
"maxDepthIncreased/node_modules/m2/entry.js",
"maxDepthIncreased/node_modules/m1/index.js",
"maxDepthIncreased/node_modules/@types/m4/entry.d.ts",
"maxDepthIncreased/root.ts"
],
"emittedFiles": [

View File

@@ -0,0 +1 @@
export declare var foo: number;

View File

@@ -0,0 +1,5 @@
{
"types": "entry.d.ts",
"name": "m4",
"version": "1.0.0"
}

View File

@@ -0,0 +1 @@
exports.test = "hello, world";

View File

@@ -0,0 +1,5 @@
{
"name": "m4",
"version": "1.0.0",
"main": "entry.js"
}

View File

@@ -1,4 +1,9 @@
import * as m1 from "m1";
import * as m4 from "m4";
m1.f1("test");
m1.f2.a = 10;
m1.f2.person.age = "10"; // Error: Should be number
m1.f2.person.age = "10"; // Should error if loaded the .js files correctly
let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file