Skip to content

Commit 06a21ab

Browse files
committed
Prepare for 1.0.0-beta.1 release.
- Update `broccoli-typescript-compiler` to 2.0.0 (non-beta release). - Drop remaining references to tsconfig from `lib/typescript-preprocessor.js`, since `broccoli-typescript-compiler` now handles that. - Update blueprint for tsconfig: + generate sourcemaps + add `outDir` so sourcemaps work + set target to es2017 (let Babel do its thing) - Update the syntax of index.js to use object method syntax. - Bump the default installed version of TypeScript and the typings. - Bump the version to 1.0.0-beta.1!
1 parent 1205994 commit 06a21ab

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

blueprints/ember-cli-typescript/files/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"compilerOptions": {
3-
"target": "ES6",
3+
"target": "es2017",
44
"allowJs": true,
55
"moduleResolution": "node",
66
"noEmitOnError": false,
77
"noEmit": true,
88
"baseUrl": ".",
9+
"outDir": "dist",
10+
"sourceMap": true,
911
"paths": {
1012
"<%= dasherizedPackageName %>/tests/*": ["tests/*"],
1113
"<%= dasherizedPackageName %>/*": ["app/*"]
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
var path = require('path');
1+
/* eslint-env node */
2+
3+
const path = require('path');
24

35
module.exports = {
46
description: 'Initialize files needed for typescript compilation',
57

6-
files: function() {
8+
files() {
79
return [
810
path.join(this.path, 'files', 'tsconfig.json'),
9-
path.join(this.path, 'files', 'app', 'config', 'environment.d.ts')
11+
path.join(this.path, 'files', 'app', 'config', 'environment.d.ts'),
1012
];
1113
},
1214

13-
mapFile: function() {
15+
mapFile() {
1416
const result = this._super.mapFile.apply(this, arguments);
1517

1618
const tsconfigPattern = `${path.sep}tsconfig.json`;
@@ -24,16 +26,16 @@ module.exports = {
2426
}
2527
},
2628

27-
normalizeEntityName: function() {
29+
normalizeEntityName() {
2830
// Entity name is optional right now, creating this hook avoids an error.
2931
},
3032

31-
afterInstall: function() {
33+
afterInstall() {
3234
return this.addPackagesToProject([
33-
{ name: 'typescript', target: '^2.1' },
34-
{ name: '@types/ember', target: '^2.7.41' },
35+
{ name: 'typescript', target: '^2.4.2' },
36+
{ name: '@types/ember', target: '^2.7.43' },
3537
{ name: '@types/rsvp', target: '^3.3.0' },
3638
{ name: '@types/ember-testing-helpers' },
3739
]);
38-
}
39-
}
40+
},
41+
};

lib/typescript-preprocessor.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
const path = require('path');
1+
/* eslint-env node */
22

33
const debug = require('debug')('ember-cli-typescript');
44
const Funnel = require('broccoli-funnel');
55
const MergeTrees = require('broccoli-merge-trees');
6-
const ts = require('typescript');
76
const tsc = require('broccoli-typescript-compiler').typescript;
87

9-
function readConfig(configFile) {
10-
const result = ts.readConfigFile(configFile, ts.sys.readFile);
11-
if (result.error) {
12-
const message = ts.flattenDiagnosticMessageText(result.error.messageText, '\n');
13-
throw new Error(message);
14-
}
15-
return result.config;
16-
}
17-
188
class TypeScriptPreprocessor {
199
constructor(options) {
2010
debug('creating new instance with options ', options);

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "ember-cli-typescript",
3-
"version": "0.5.0",
3+
"version": "1.0.0-beta.1",
44
"description": "Allow ember apps to use typescript files.",
55
"keywords": [
66
"ember-addon",
77
"typescript"
88
],
99
"license": "MIT",
10-
"author": "Marius Seritan",
10+
"author": "Chris Krycho <chris@chriskrycho.com> (http://www.chriskrycho.com)",
1111
"contributors": [
12+
"Marius Seritan",
1213
"David Gardiner",
1314
"Philip Bjorge"
1415
],
@@ -32,12 +33,12 @@
3233
"broccoli-plugin": "^1.2.1",
3334
"broccoli-source": "^1.1.0",
3435
"broccoli-stew": "^1.4.0",
35-
"broccoli-typescript-compiler": "beta",
36+
"broccoli-typescript-compiler": "^2.0.0",
3637
"debug": "^2.2.0",
3738
"ember-cli-babel": "^6.3.0"
3839
},
3940
"devDependencies": {
40-
"@types/ember": "^2.7.34",
41+
"@types/ember": "^2.7.43",
4142
"broccoli-asset-rev": "^2.4.5",
4243
"ember-cli": "^2.13.3",
4344
"ember-cli-app-version": "^2.0.0",
@@ -57,11 +58,10 @@
5758
"ember-resolver": "^4.0.0",
5859
"ember-source": "~2.13.3",
5960
"loader.js": "^4.2.3",
60-
"typescript": "^2.4.1"
61+
"typescript": "^2.4.2"
6162
},
6263
"peerDependencies": {
63-
"@types/ember": "^2.7.34",
64-
"typescript": "^2.4.1"
64+
"typescript": "^2.4.2"
6565
},
6666
"engines": {
6767
"node": "^4.5 || 6.* || >= 7.*"

0 commit comments

Comments
 (0)