Skip to content

Commit 69fc1f2

Browse files
committed
fix(): Typings now at the correct place.
1 parent e238e32 commit 69fc1f2

File tree

4 files changed

+25
-44
lines changed

4 files changed

+25
-44
lines changed

addon/ng2/blueprints/ng2/files/src/tsconfig.json

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": false,
4+
"emitDecoratorMetadata": true,
5+
"experimentalDecorators": true,
6+
"mapRoot": "",
7+
"module": "system",
8+
"moduleResolution": "node",
9+
"noEmitOnError": true,
10+
"noImplicitAny": false,
11+
"outDir": "../dist/",
12+
"rootDir": ".",
13+
"sourceMap": true,
14+
"sourceRoot": "/",
15+
"target": "es5"
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="../typings/browser.d.ts" />

addon/ng2/blueprints/ng2/files/tsconfig.json

-23
This file was deleted.

lib/broccoli/angular2-app.js

+7-20
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ var Concat = require('broccoli-concat');
33
var configReplace = require('./broccoli-config-replace');
44
var compileWithTypescript = require('./broccoli-typescript').default;
55
var fs = require('fs');
6-
var glob = require('glob');
76
var Funnel = require('broccoli-funnel');
87
var mergeTrees = require('broccoli-merge-trees');
98
var Project = require('ember-cli/lib/models/project');
109

1110
module.exports = Angular2App;
1211

13-
function Angular2App(defaults, options) {
12+
function Angular2App(defaults, options, additionalPaths) {
1413
this._initProject();
1514
this._notifyAddonIncluded();
1615
this.options = options;
16+
this.additionalPaths = additionalPaths || [];
1717
}
1818

1919
Angular2App.prototype.toTree = function() {
@@ -34,24 +34,11 @@ Angular2App.prototype.toTree = function() {
3434
vendorNpmFiles = vendorNpmFiles.concat(this.options.vendorNpmFiles);
3535
}
3636

37-
var tsConfig = JSON.parse(fs.readFileSync('tsconfig.json', 'utf-8'));
38-
var tsConfigCompilerOptions = tsConfig.compilerOptions;
39-
40-
// `rootFilesPath` is used by the broccoli-typescript to add files to the compilation.
41-
// It is _not_ part of the `tsconfig.json` spec, so it won't be found in
42-
// tsConfigCompilerOptions. This adds the typings manually to the compilation step.
43-
// We pass in all files except those that matches excluded paths.
44-
var exclude = tsConfig.exclude || [];
45-
var files = glob.sync('**/*.ts');
46-
tsConfigCompilerOptions.rootFilePaths = files
47-
.filter(function(x) {
48-
// Remove those who start with paths in the tsconfig exclude list.
49-
return !exclude.some(function(y) { return x.startsWith(y); });
50-
})
51-
.map((function(x) {
52-
// Map them around the current working directory.
53-
return path.join(process.cwd(), x);
54-
}));
37+
var tsConfigCompilerOptions = JSON.parse(fs.readFileSync('src/tsconfig.json', 'utf-8')).compilerOptions;
38+
tsConfigCompilerOptions.rootFilePaths = ['typings.d.ts'].concat(this.additionalPaths)
39+
.map(function(name) {
40+
return path.join(process.cwd(), sourceTree, name)
41+
});
5542

5643
var tsTree = compileWithTypescript(sourceTree, tsConfigCompilerOptions);
5744
var tsSrcTree = new Funnel(sourceTree, {

0 commit comments

Comments
 (0)