Add --outFile and revert change make --out relative in tsconfig.json

This commit is contained in:
Mohamed Hegazy
2015-08-20 17:37:56 -07:00
parent cfc164b044
commit 00cd8ad745
21 changed files with 379 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
//// [tests/cases/compiler/out-flag2.ts] ////
//// [a.ts]
class A { }
//// [b.ts]
class B { }
//// [c.js]
var A = (function () {
function A() {
}
return A;
})();
var B = (function () {
function B() {
}
return B;
})();
//# sourceMappingURL=c.js.map
//// [c.d.ts]
declare class A {
}
declare class B {
}

View File

@@ -0,0 +1,2 @@
//// [c.js.map]
{"version":3,"file":"c.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":["A","A.constructor","B","B.constructor"],"mappings":"AACA;IAAAA;IAAUC,CAACA;IAADD,QAACA;AAADA,CAACA,AAAX,IAAW;ACDX;IAAAE;IAAUC,CAACA;IAADD,QAACA;AAADA,CAACA,AAAX,IAAW"}

View File

@@ -0,0 +1,104 @@
===================================================================
JsFile: c.js
mapUrl: c.js.map
sourceRoot:
sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts
===================================================================
-------------------------------------------------------------------
emittedFile:c.js
sourceFile:tests/cases/compiler/a.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^->
1->
1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^->
1->class A {
2 > }
1->Emitted(3, 5) Source(2, 11) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(2, 12) + SourceIndex(0) name (A.constructor)
---
>>> return A;
1->^^^^
2 > ^^^^^^^^
1->
2 > }
1->Emitted(4, 5) Source(2, 11) + SourceIndex(0) name (A)
2 >Emitted(4, 13) Source(2, 12) + SourceIndex(0) name (A)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class A { }
1 >Emitted(5, 1) Source(2, 11) + SourceIndex(0) name (A)
2 >Emitted(5, 2) Source(2, 12) + SourceIndex(0) name (A)
3 >Emitted(5, 2) Source(2, 1) + SourceIndex(0)
4 >Emitted(5, 6) Source(2, 12) + SourceIndex(0)
---
-------------------------------------------------------------------
emittedFile:c.js
sourceFile:tests/cases/compiler/b.ts
-------------------------------------------------------------------
>>>var B = (function () {
1->
2 >^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(6, 1) Source(1, 1) + SourceIndex(1)
---
>>> function B() {
1->^^^^
2 > ^^->
1->
1->Emitted(7, 5) Source(1, 1) + SourceIndex(1) name (B)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^->
1->class B {
2 > }
1->Emitted(8, 5) Source(1, 11) + SourceIndex(1) name (B.constructor)
2 >Emitted(8, 6) Source(1, 12) + SourceIndex(1) name (B.constructor)
---
>>> return B;
1->^^^^
2 > ^^^^^^^^
1->
2 > }
1->Emitted(9, 5) Source(1, 11) + SourceIndex(1) name (B)
2 >Emitted(9, 13) Source(1, 12) + SourceIndex(1) name (B)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class B { }
1 >Emitted(10, 1) Source(1, 11) + SourceIndex(1) name (B)
2 >Emitted(10, 2) Source(1, 12) + SourceIndex(1) name (B)
3 >Emitted(10, 2) Source(1, 1) + SourceIndex(1)
4 >Emitted(10, 6) Source(1, 12) + SourceIndex(1)
---
>>>//# sourceMappingURL=c.js.map

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/a.ts ===
class A { }
>A : Symbol(A, Decl(a.ts, 0, 0))
=== tests/cases/compiler/b.ts ===
class B { }
>B : Symbol(B, Decl(b.ts, 0, 0))

View File

@@ -0,0 +1,9 @@
=== tests/cases/compiler/a.ts ===
class A { }
>A : A
=== tests/cases/compiler/b.ts ===
class B { }
>B : B

View File

@@ -0,0 +1,12 @@
error TS5053: Option 'out' cannot be specified with option 'outFile'.
!!! error TS5053: Option 'out' cannot be specified with option 'outFile'.
==== tests/cases/compiler/a.ts (0 errors) ====
// --out and --outFile error
class A { }
==== tests/cases/compiler/b.ts (0 errors) ====
class B { }

View File

@@ -0,0 +1,30 @@
//// [tests/cases/compiler/out-flag3.ts] ////
//// [a.ts]
// --out and --outFile error
class A { }
//// [b.ts]
class B { }
//// [c.js]
// --out and --outFile error
var A = (function () {
function A() {
}
return A;
})();
var B = (function () {
function B() {
}
return B;
})();
//# sourceMappingURL=c.js.map
//// [c.d.ts]
declare class A {
}
declare class B {
}

View File

@@ -0,0 +1,2 @@
//// [c.js.map]
{"version":3,"file":"c.js","sourceRoot":"","sources":["tests/cases/compiler/a.ts","tests/cases/compiler/b.ts"],"names":["A","A.constructor","B","B.constructor"],"mappings":"AACA,4BAA4B;AAE5B;IAAAA;IAAUC,CAACA;IAADD,QAACA;AAADA,CAACA,AAAX,IAAW;ACHX;IAAAE;IAAUC,CAACA;IAADD,QAACA;AAADA,CAACA,AAAX,IAAW"}

View File

@@ -0,0 +1,114 @@
===================================================================
JsFile: c.js
mapUrl: c.js.map
sourceRoot:
sources: tests/cases/compiler/a.ts,tests/cases/compiler/b.ts
===================================================================
-------------------------------------------------------------------
emittedFile:c.js
sourceFile:tests/cases/compiler/a.ts
-------------------------------------------------------------------
>>>// --out and --outFile error
1 >
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
>
2 >// --out and --outFile error
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 29) Source(2, 29) + SourceIndex(0)
---
>>>var A = (function () {
1 >
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
>
1 >Emitted(2, 1) Source(4, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^->
1->
1->Emitted(3, 5) Source(4, 1) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^->
1->class A {
2 > }
1->Emitted(4, 5) Source(4, 11) + SourceIndex(0) name (A.constructor)
2 >Emitted(4, 6) Source(4, 12) + SourceIndex(0) name (A.constructor)
---
>>> return A;
1->^^^^
2 > ^^^^^^^^
1->
2 > }
1->Emitted(5, 5) Source(4, 11) + SourceIndex(0) name (A)
2 >Emitted(5, 13) Source(4, 12) + SourceIndex(0) name (A)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class A { }
1 >Emitted(6, 1) Source(4, 11) + SourceIndex(0) name (A)
2 >Emitted(6, 2) Source(4, 12) + SourceIndex(0) name (A)
3 >Emitted(6, 2) Source(4, 1) + SourceIndex(0)
4 >Emitted(6, 6) Source(4, 12) + SourceIndex(0)
---
-------------------------------------------------------------------
emittedFile:c.js
sourceFile:tests/cases/compiler/b.ts
-------------------------------------------------------------------
>>>var B = (function () {
1->
2 >^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(7, 1) Source(1, 1) + SourceIndex(1)
---
>>> function B() {
1->^^^^
2 > ^^->
1->
1->Emitted(8, 5) Source(1, 1) + SourceIndex(1) name (B)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^->
1->class B {
2 > }
1->Emitted(9, 5) Source(1, 11) + SourceIndex(1) name (B.constructor)
2 >Emitted(9, 6) Source(1, 12) + SourceIndex(1) name (B.constructor)
---
>>> return B;
1->^^^^
2 > ^^^^^^^^
1->
2 > }
1->Emitted(10, 5) Source(1, 11) + SourceIndex(1) name (B)
2 >Emitted(10, 13) Source(1, 12) + SourceIndex(1) name (B)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class B { }
1 >Emitted(11, 1) Source(1, 11) + SourceIndex(1) name (B)
2 >Emitted(11, 2) Source(1, 12) + SourceIndex(1) name (B)
3 >Emitted(11, 2) Source(1, 1) + SourceIndex(1)
4 >Emitted(11, 6) Source(1, 12) + SourceIndex(1)
---
>>>//# sourceMappingURL=c.js.map

View File

@@ -0,0 +1,11 @@
// @target: ES5
// @sourcemap: true
// @declaration: true
// @module: commonjs
// @outFile: c.js
// @Filename: a.ts
class A { }
// @Filename: b.ts
class B { }

View File

@@ -0,0 +1,14 @@
// @target: ES5
// @sourcemap: true
// @declaration: true
// @module: commonjs
// @outFile: c.js
// @out: d.js
// --out and --outFile error
// @Filename: a.ts
class A { }
// @Filename: b.ts
class B { }