You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-18Lines changed: 7 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,16 @@
2
2
3
3
## Next
4
4
5
-
## v5.3.0-beta.6 (2016-01-15)
5
+
## v5.3.0 (2016-01-15)
6
+
* FEAT: Updated to natively support and include TypeScript 1.7.
7
+
* FEAT: Added support for `--noLib`, `--emitBOM`, `--locale`, `--suppressExcessPropertyErrors`, `--stripInternal`, and `--allowSyntheticDefaultImports`.
8
+
* FEAT: Added support for `es6` and `es2015` as module options.
9
+
* FIX: Revised all integration tests to account for its behavior (generally, the change to how `removeComments` works with /// references).
6
10
* FIX: Will now resolve templates prior to updating the globs in a tsconfig.json file (#303) - thanks for the report @nsgundy.
7
-
8
-
## v5.3.0-beta.5 (2016-01-14)
9
-
* FIX: Will now provide a warning when a grunt-ts task-level keyword is used as a target name (#319) - thanks for the report @jounii.
10
-
11
-
## v5.3.0-beta.4 (2016-01-14)
12
-
* FIX: Transformed HTML files will be automatically added to the compilation context if they match the glob (#255).
13
-
* FIX: resolved issue in v5.3.0-beta.3 - will now error again if `html` is specified without an `src` or a glob.
14
-
15
-
## v5.3.0-beta.3 (2015-12-26)
11
+
* FIX: Will now provide a warning when a grunt-ts task-level keyword (such as "watch") is used as a target name (#319) - thanks for the report @jounii.
12
+
* FIX: Transformed HTML files will be automatically added to the compilation context if they match a glob (#255).
16
13
* FIX: Use of `outDir` in the Gruntfile now works when otherwise getting the configuration from tsconfig.json. (Thanks, @gilamran (#312)).
17
-
* NOTE: No longer warns when `html` is used without a source. This needs to wait on #255.
18
14
* FIX: Certain conditions (such as the specified tsconfig.json not found or VS project resolution errors) caused grunt-ts to hard-quit during options resolution. These are now properly surfaced as errors, and the main quit path will be followed.
19
-
20
-
## v5.3.0-beta.2 (2015-12-06)
21
-
* FEAT: Updated to TypeScript 1.7 and revised all integration tests to account for its behavior (generally, the change to how `removeComments` works).
22
-
* FEAT: Added support for `--noLib`, `--emitBOM`, `--locale`, `--suppressExcessPropertyErrors`, `--stripInternal`, and `--allowSyntheticDefaultImports`.
23
-
* FEAT: Added support for `es6` and `es2015` as module options.
24
-
25
-
## v5.3.0-beta.1 (2015-12-06)
26
15
* FIX: Improved detection of if newLine parameter is redundant for TSC. This should make the functionality work more consistently if `grunt.util.linefeed` is used. Thanks to @Maks3w for the report.
Copy file name to clipboardExpand all lines: README.md
+105-7Lines changed: 105 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
Grunt-ts is an npm package that handles TypeScript compilation work in GruntJS build scripts. It provides a [Grunt-compatible wrapper](#support-for-tsc-switches) for the `tsc` command-line compiler, and provides some [additional functionality](#grunt-ts-gruntfilejs-options) that improves the TypeScript development workflow. Grunt-ts supports compiling against [tsconfig.json](#tsconfig) or even a [Visual Studio project](#vs) directly. Grunt-ts is itself written in [TypeScript](./tasks/ts.ts).
8
8
9
9
### Latest Changes
10
-
Latest release is `5.2.0`, which supports TypeScript 1.6 and contains bugfixes.
10
+
Latest release is `5.3.0`, which supports TypeScript 1.7 and contains some enhancements and bugfixes.
11
11
12
12
[Full changelog is here](CHANGELOG.md).
13
13
@@ -59,6 +59,7 @@ Grunt-ts provides explicit support for most `tsc` switches. Any arbitrary switc
59
59
60
60
|`tsc` switch|name in grunt-ts|description|
61
61
|:----:|:----:|:-----|
62
+
|--allowSyntheticDefaultImports|[allowSyntheticDefaultImports](#allowsyntheticdefaultimports)|Allows use "default" ES6 module import syntax with pre-ES6 libraries that don't have a default (on by default with SystemJS)|
62
63
|--declaration|[declaration](#declaration)|Generates a `.d.ts` definitions file for compiled TypeScript files|
63
64
|--emitDecoratorMetadata|[emitDecoratorMetadata](#emitdecoratormetadata)|Emit metadata for type/parameter decorators.|
64
65
|--experimentalAsyncFunctions|[experimentalAsyncFunctions](#experimentalasyncfunctions)|Enables experimental support for ES7 async functions|
@@ -67,6 +68,7 @@ Grunt-ts provides explicit support for most `tsc` switches. Any arbitrary switc
67
68
|--inlineSources|[inlineSources](#inlinesources)|Emit the TypeScript source alongside the sourcemaps within a single file; requires `--inlineSourceMap` to be set.|
68
69
|--isolatedModules|[isolatedModules](#isolatedmodules)|Ensures that the output is safe to only emit single files by making cases that break single-file transpilation an error|
69
70
|--jsx|[jsx](#jsx)|Specifies the JSX code generation style: 'preserve' or 'react'|
71
+
|--locale|[locale](#locale)|Specify locale for error messages.|
70
72
|--mapRoot LOCATION|[mapRoot](#maproot)|Specifies the location where debugger should locate map files instead of generated locations.|
71
73
|--module KIND|[module](#module)|Specify module style for code generation|
|--suppressImplicitAnyIndexErrors|[suppressImplicitAnyIndexErrors](#suppressimplicitanyindexerrors)|Specifies the location where debugger should locate TypeScript files instead of source locations.|
87
92
|--target VERSION|[target](#target)|Specify ECMAScript target version: `'es3'`, `'es5'`, or `'es6'`|
88
93
@@ -94,6 +99,7 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
94
99
|grunt-ts property|where to define|description|
95
100
|:----|:----|:-----|
96
101
|[additionalFlags](#additionalflags)|option|`string` - allows passing arbitrary strings to the compiler. This is intended to enable compatibility with features not supported directly by grunt-ts.|
102
+
|[allowSyntheticDefaultImports](#allowsyntheticdefaultimports)|option|`true`, `false` (default) - Allows use "default" ES6 module import syntax with pre-ES6 libraries that don't have a default (on by default with SystemJS and not required to specify).|
97
103
|[comments](#comments)|option|`true`, `false` (default) - include comments in emitted JS.|
|[compiler](#compiler)|option|`string` - path to custom compiler|
@@ -114,6 +120,7 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
114
120
|[inlineSources](#inlinesources)|option|`true`, `false` (default) Emit the TypeScript source alongside the sourcemaps within a single file; If enabled, will automatically enable `inlineSourceMap` and `sourceMap`.|
115
121
|[isolatedModules](#isolatedmodules)|option|`true`, `false` (default) Ensures that the output is safe to only emit single files by making cases that break single-file transpilation an error.|
116
122
|[jsx](#jsx)|option|`'preserve'`, `'react'`, (TypeScript default is `'react'`). If `'preserve'`, TypeScript will emit `.jsx`; if `'react'`, TypeScript will transpile and emit `.js` files.|
123
+
|[locale](#locale)|option|`string` - specify locale for error messages|
117
124
|[mapRoot](#maproot)|option|`string` - root for referencing `.js.map` files in JS|
118
125
|[module](#module)|option|default to be nothing, If you want to set it you set it to either `'amd'` or `'commonjs'`|
119
126
|[moduleResolution](#moduleresolution)|option|`'classic'` or `'node'`. This was introduced in TypeScript 1.6. The default is `'node'` if not passed. [More details here](https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#adjustments-in-module-resolution-logic).|
@@ -122,6 +129,7 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
122
129
|[noEmitHelpers](#noemithelpers)|option|`true`, `false` (default) - If passed as `true`, TypeScript will not generate custom helper functions like `__extends` in compiled output|
123
130
|[noEmitOnError](#noemithelpers)|option|`true`, `false` (default) - If passed as `true`, TypeScript will not emit JS if there is an error (see also [failOnTypeErrors](#failontypeerrors))|
124
131
|[noImplicitAny](#noimplicitany)|option|`true`, `false` (default) - enable for stricter type checking|
132
+
|[noLib](#nolib)|option|`true`, `false` (default) - do not automatically include lib.d.ts in compilation context|
125
133
|[noResolve](#noresolve)|option|`true`, `false` (default) - for deprecated version of TypeScript|
126
134
|[options](#grunt-ts-target-options)|target||
127
135
|[out](#out)|target|`string` - instruct `tsc` to concatenate output to this file.|
@@ -132,6 +140,8 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
132
140
|[rootDir](#rootdir)|option|`string` - Allows override of common root folder calculated by `--outDir`.|
133
141
|[sourceRoot](#sourceroot)|option|`string` - root for referencing TS files in `.js.map`|
134
142
|[sourceMap](#sourcemap)|option|`true` (default), `false` - indicates if source maps should be generated (`.js.map`)|
143
+
|[stripInternal](#stripinternal)|option|`true`, `false` (default) - does not emit members marked as @internal.|
144
+
|[suppressExcessPropertyErrors](#suppressexcesspropertyerrors)|option|`false` (default), `true` - indicates if TypeScript should disable strict object literal assignment checking (experimental)|
135
145
|[suppressImplicitAnyIndexErrors](#suppressimplicitanyindexerrors)|option|`false` (default), `true` - indicates if TypeScript should allow access to properties of an object by string indexer when `--noImplicitAny` is active, even if TypeScript doesn't know about them.|
136
146
|[src](#src)|target|`string` or `string[]` - glob of TypeScript files to compile.|
137
147
|[target](#target)|option|`'es5'` (default), `'es3'`, or `'es6'` - targeted ECMAScript version|
@@ -249,11 +259,6 @@ grunt.initConfig({
249
259
250
260
This section allows global configuration for the grunt-ts task. All [target-specific options](#grunt-ts-target-options) are supported. If a target also has options set, the target's options override the global task options.
251
261
252
-
<!--
253
-
#### nolib
254
-
255
-
Specify this option if you do not want the lib.d.ts to be loaded by the TypeScript compiler.
256
-
-->
257
262
258
263
#### out
259
264
@@ -406,6 +411,23 @@ grunt.initConfig({
406
411
});
407
412
````
408
413
414
+
#### allowSyntheticDefaultImports
415
+
416
+
Allows use of ES6 "default" import syntax with pre-ES6 modules when not using SystemJS. If using module format "amd", "commonjs" or "umd", the following import syntax for jQuery will give the error "Module 'jquery' has no default export" when exporting to "amd", "commonjs", or "umd" format: `import * as $ from 'jquery';`. In that case, passing allowSyntheticDefaultImports will eliminate this error. NOTE: This is the default behavior when SystemJS module format is used (`module: "system"`). This switch (and behavior) requires TypeScript 1.8 or higher. See [this issue](https://github.com/Microsoft/TypeScript/issues/5285) for more details.
417
+
418
+
````javascript
419
+
grunt.initConfig({
420
+
ts: {
421
+
default: {
422
+
options: {
423
+
allowSyntheticDefaultImports:true,
424
+
module:'umd'
425
+
}
426
+
}
427
+
}
428
+
});
429
+
````
430
+
409
431
#### compile
410
432
411
433
````javascript
@@ -808,6 +830,21 @@ grunt.initConfig({
808
830
});
809
831
````
810
832
833
+
#### locale
834
+
835
+
Specify culture string for error messages - will pass the `--locale` switch. Requires appropriate TypeScript error messages file to be present (see TypeScript documentation for more details).
Specifies if TypeScript should emit AMD, CommonJS, SystemJS, "ES6", or UMD-style external modules. Has no effect if internal modules are used. Note - this should not be used in combination with `out`[prior to TypeScript 1.8](https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#option-to-concatenate-amd-and-system-modules-into-a-single-output-file) because the TypeScript compiler does not support concatenation of external modules; consider using a module bundler like WebPack, Browserify, or Require's r.js to concatenate external modules.
@@ -966,6 +1003,26 @@ grunt.initConfig({
966
1003
});
967
1004
````
968
1005
1006
+
#### noLib
1007
+
1008
+
````javascript
1009
+
true|false (default)
1010
+
````
1011
+
1012
+
Specify this option if you do not want the lib.d.ts to be loaded by the TypeScript compiler. Generally this is used to allow you to manually specify your own lib.d.ts.
1013
+
1014
+
````javascript
1015
+
grunt.initConfig({
1016
+
ts: {
1017
+
default: {
1018
+
options: {
1019
+
noLib:true
1020
+
}
1021
+
}
1022
+
}
1023
+
});
1024
+
````
1025
+
969
1026
#### noResolve
970
1027
971
1028
````javascript
@@ -1076,6 +1133,47 @@ grunt.initConfig({
1076
1133
});
1077
1134
````
1078
1135
1136
+
#### stripInternal
1137
+
1138
+
Use stripInternal to prevent the emit of members marked as @internal via a comment. For example:
1139
+
1140
+
```typescript
1141
+
/*@internal*/
1142
+
exportclassMyClass {
1143
+
}
1144
+
```
1145
+
1146
+
````javascript
1147
+
grunt.initConfig({
1148
+
ts: {
1149
+
default: {
1150
+
options: {
1151
+
sourceRoot:"/dev"
1152
+
}
1153
+
}
1154
+
}
1155
+
});
1156
+
````
1157
+
1158
+
#### suppressExcessPropertyErrors
1159
+
1160
+
````javascript
1161
+
true|false (default)
1162
+
````
1163
+
1164
+
Set to true to disable strict object literal assignment checking (experimental). See https://github.com/Microsoft/TypeScript/pull/4484 for more details.
0 commit comments