Skip to content

Commit 8264bb4

Browse files
jkurihansl
authored andcommitted
feat(builder): broccoli bump to 1.0
1 parent 3291d19 commit 8264bb4

23 files changed

+329
-1308
lines changed

addon/ng2/blueprints/ng2/files/src/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<script src="vendor/angular2/bundles/http.dev.js"></script>
3333
<script src="vendor/angular2/bundles/router.dev.js"></script>
3434

35-
<script src="thirdparty/libs.js"></script>
3635
<script>
3736
System.config({
3837
packages: {

lib/broccoli/angular2-app.js

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ function Angular2App(defaults, options, additionalPaths) {
1818
}
1919

2020
Angular2App.prototype.toTree = function() {
21-
var sourceTree = 'src';
21+
var sourceDir = 'src';
22+
23+
var sourceTree = new Funnel('src', {
24+
destDir: 'src'
25+
});
26+
27+
var typingsTree = new Funnel('typings', {
28+
include: ['browser.d.ts', 'browser/**'],
29+
destDir: 'typings'
30+
});
31+
2232
var vendorNpmFiles = [
2333
'systemjs/dist/system-polyfills.js',
2434
'systemjs/dist/system.src.js',
@@ -31,28 +41,50 @@ Angular2App.prototype.toTree = function() {
3141
'angular2/bundles/upgrade.dev.js'
3242
];
3343

44+
45+
3446
if (this.options && this.options.vendorNpmFiles) {
3547
vendorNpmFiles = vendorNpmFiles.concat(this.options.vendorNpmFiles);
3648
}
3749

38-
var tsConfigCompilerOptions = JSON.parse(fs.readFileSync('src/tsconfig.json', 'utf-8')).compilerOptions;
39-
tsConfigCompilerOptions.rootFilePaths = ['typings.d.ts'].concat(this.additionalPaths)
40-
.map(function(name) {
41-
return path.join(process.cwd(), sourceTree, name)
50+
var tsconfig = JSON.parse(fs.readFileSync('src/tsconfig.json', 'utf-8'));
51+
var tsConfigCompilerOptions = tsconfig.compilerOptions;
52+
53+
54+
// TODO(i): why do we need these additional paths? remove?
55+
tsConfigCompilerOptions.rootFilePaths = this.additionalPaths.map(function(name) {
56+
return path.join(process.cwd(), sourceDir, name)
4257
});
4358

44-
var tsTree = compileWithTypescript(sourceTree, tsConfigCompilerOptions);
45-
var tsSrcTree = new Funnel(sourceTree, {
59+
// TODO(i): kill rootFilePaths in broccoli-typescript and use tsconfig.json#files instead
60+
tsConfigCompilerOptions.rootFilePaths = tsConfigCompilerOptions.rootFilePaths.
61+
concat(tsconfig.files.map(function(p) {
62+
// TODO(i): this is a hack - for some reason we need to prefix all paths with srcDir because
63+
// tsc's "rootDir" doesn't take effect when resolving "files" paths
64+
return path.join(sourceDir, p);
65+
}));
66+
67+
68+
var srcAndTypingsTree = mergeTrees([sourceTree, typingsTree]);
69+
70+
var tsTree = compileWithTypescript(srcAndTypingsTree, tsConfigCompilerOptions);
71+
72+
tsTree = new Funnel(tsTree, {
73+
srcDir: 'src',
74+
exclude: ['*.d.ts', 'tsconfig.json']
75+
});
76+
77+
var tsSrcTree = new Funnel(sourceDir, {
4678
include: ['**/*.ts'],
4779
allowEmpty: true
4880
});
4981

50-
var jsTree = new Funnel(sourceTree, {
82+
var jsTree = new Funnel(sourceDir, {
5183
include: ['**/*.js'],
5284
allowEmpty: true
5385
});
5486

55-
var assetTree = new Funnel(sourceTree, {
87+
var assetTree = new Funnel(sourceDir, {
5688
include: ['**/*.*'],
5789
exclude: ['**/*.ts', '**/*.js'],
5890
allowEmpty: true

lib/broccoli/broccoli-dest-copy.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

lib/broccoli/broccoli-dest-copy.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/broccoli/broccoli-flatten.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

lib/broccoli/broccoli-flatten.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/broccoli/broccoli-merge-trees.js

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)