Skip to content

Commit 9c09ac5

Browse files
committed
document 5.3
1 parent 6ce0883 commit 9c09ac5

File tree

2 files changed

+112
-25
lines changed

2 files changed

+112
-25
lines changed

CHANGELOG.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,16 @@
22

33
## Next
44

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).
610
* 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).
1613
* 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.
1814
* 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)
2615
* 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.
2716

2817
## v5.2.0 (2015-11-21)

README.md

Lines changed: 105 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
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).
88

99
### 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.
1111

1212
[Full changelog is here](CHANGELOG.md).
1313

@@ -59,6 +59,7 @@ Grunt-ts provides explicit support for most `tsc` switches. Any arbitrary switc
5959

6060
|`tsc` switch|name in grunt-ts|description|
6161
|:----:|:----:|:-----|
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)|
6263
|--declaration|[declaration](#declaration)|Generates a `.d.ts` definitions file for compiled TypeScript files|
6364
|--emitDecoratorMetadata|[emitDecoratorMetadata](#emitdecoratormetadata)|Emit metadata for type/parameter decorators.|
6465
|--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
6768
|--inlineSources|[inlineSources](#inlinesources)|Emit the TypeScript source alongside the sourcemaps within a single file; requires `--inlineSourceMap` to be set.|
6869
|--isolatedModules|[isolatedModules](#isolatedmodules)|Ensures that the output is safe to only emit single files by making cases that break single-file transpilation an error|
6970
|--jsx|[jsx](#jsx)|Specifies the JSX code generation style: 'preserve' or 'react'|
71+
|--locale|[locale](#locale)|Specify locale for error messages.|
7072
|--mapRoot LOCATION|[mapRoot](#maproot)|Specifies the location where debugger should locate map files instead of generated locations.|
7173
|--module KIND|[module](#module)|Specify module style for code generation|
7274
|--moduleResolution KIND|[moduleResolution](#moduleresolution)|Specifies module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6).|
@@ -75,6 +77,7 @@ Grunt-ts provides explicit support for most `tsc` switches. Any arbitrary switc
7577
|--noEmitHelpers|[noEmitHelpers](#noemithelpers)|Do not generate custom helper functions like `__extends` in compiled output.|
7678
|--noEmitOnError|[noEmitOnError](#noemitonerror)|Do not emit JavaScript if there is a compilation error|
7779
|--noImplicitAny|[noImplicitAny](#noimplicitany)|Warn on expressions and declarations with an implied `any` type.|
80+
|--noLib|[noLib](#nolib)|Do not automatically include lib.d.ts is compilation context.|
7881
|--noResolve|[noResolve](#noresolve)|Do not add triple-slash references or module import targets to the compilation context.|
7982
|--out FILE|[out](#out)|Concatenate and emit output to a single file.|
8083
|--outDir DIRECTORY|[outDir](#outdir)|Redirect output structure to the directory.|
@@ -83,6 +86,8 @@ Grunt-ts provides explicit support for most `tsc` switches. Any arbitrary switc
8386
|--rootDir|[rootDir](#rootdir)|Allows override of common root folder calculated by `--outDir`.|
8487
|--sourceMap|[sourceMap](#sourcemap)|Generates corresponding `.map` file|
8588
|--sourceRoot LOCATION|[sourceRoot](#sourceroot)|Specifies the location where debugger should locate TypeScript files instead of source locations.|
89+
|--stripInternal|[stripInternal](#stripinternal)|does not emit members marked as @internal.|
90+
|--suppressExcessPropertyErrors|[suppressExcessPropertyErrors](#suppressexcesspropertyerrors)|Disables strict object literal assignment checking (experimental).|
8691
|--suppressImplicitAnyIndexErrors|[suppressImplicitAnyIndexErrors](#suppressimplicitanyindexerrors)|Specifies the location where debugger should locate TypeScript files instead of source locations.|
8792
|--target VERSION|[target](#target)|Specify ECMAScript target version: `'es3'`, `'es5'`, or `'es6'`|
8893

@@ -94,6 +99,7 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
9499
|grunt-ts property|where to define|description|
95100
|:----|:----|:-----|
96101
|[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).|
97103
|[comments](#comments)|option|`true`, `false` (default) - include comments in emitted JS.|
98104
|[compile](#compile)|option|`true` (default), `false` - compile TypeScript code.|
99105
|[compiler](#compiler)|option|`string` - path to custom compiler|
@@ -114,6 +120,7 @@ For file ordering, look at [JavaScript Generation](#javascript-generation).
114120
|[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`.|
115121
|[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.|
116122
|[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|
117124
|[mapRoot](#maproot)|option|`string` - root for referencing `.js.map` files in JS|
118125
|[module](#module)|option|default to be nothing, If you want to set it you set it to either `'amd'` or `'commonjs'`|
119126
|[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).
122129
|[noEmitHelpers](#noemithelpers)|option|`true`, `false` (default) - If passed as `true`, TypeScript will not generate custom helper functions like `__extends` in compiled output|
123130
|[noEmitOnError](#noemithelpers)|option|`true`, `false` (default) - If passed as `true`, TypeScript will not emit JS if there is an error (see also [failOnTypeErrors](#failontypeerrors))|
124131
|[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|
125133
|[noResolve](#noresolve)|option|`true`, `false` (default) - for deprecated version of TypeScript|
126134
|[options](#grunt-ts-target-options)|target||
127135
|[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).
132140
|[rootDir](#rootdir)|option|`string` - Allows override of common root folder calculated by `--outDir`.|
133141
|[sourceRoot](#sourceroot)|option|`string` - root for referencing TS files in `.js.map`|
134142
|[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)|
135145
|[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.|
136146
|[src](#src)|target|`string` or `string[]` - glob of TypeScript files to compile.|
137147
|[target](#target)|option|`'es5'` (default), `'es3'`, or `'es6'` - targeted ECMAScript version|
@@ -249,11 +259,6 @@ grunt.initConfig({
249259

250260
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.
251261

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-
-->
257262

258263
#### out
259264

@@ -406,6 +411,23 @@ grunt.initConfig({
406411
});
407412
````
408413

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+
409431
#### compile
410432

411433
````javascript
@@ -808,6 +830,21 @@ grunt.initConfig({
808830
});
809831
````
810832

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).
836+
837+
````javascript
838+
grunt.initConfig({
839+
ts: {
840+
default: {
841+
options: {
842+
locale: "ja-jp"
843+
}
844+
}
845+
}
846+
});
847+
````
811848

812849
#### mapRoot
813850

@@ -829,7 +866,7 @@ grunt.initConfig({
829866
#### module
830867

831868
````javascript
832-
"amd" (default) | "commonjs" | "system" | "umd" | "es6" | "es2015" | ""
869+
"amd" | "commonjs" | "system" | "umd" | "es6" | "es2015" | "" (default)
833870
````
834871

835872
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({
9661003
});
9671004
````
9681005

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+
9691026
#### noResolve
9701027

9711028
````javascript
@@ -1076,6 +1133,47 @@ grunt.initConfig({
10761133
});
10771134
````
10781135

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+
export class MyClass {
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.
1165+
1166+
````javascript
1167+
grunt.initConfig({
1168+
ts: {
1169+
default: {
1170+
options: {
1171+
suppressExcessPropertyErrors: true
1172+
}
1173+
}
1174+
}
1175+
});
1176+
````
10791177

10801178
#### suppressImplicitAnyIndexErrors
10811179

0 commit comments

Comments
 (0)