Skip to content

Commit 6b7a35c

Browse files
committed
Move to Broccoli 1.0
1 parent 0983de3 commit 6b7a35c

24 files changed

+172
-2126
lines changed

ember-cli-build.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
var fs = require('fs');
23
var path = require('path');
34

@@ -12,28 +13,38 @@ var BroccoliSass = require('broccoli-sass');
1213
var broccoliAutoprefixer = require('broccoli-autoprefixer');
1314

1415
const BroccoliTs2Dart = require('./tools/broccoli/broccoli-ts2dart').default;
15-
const BroccoliDestCopy = require('./tools/broccoli/broccoli-dest-copy').default;
1616
const BroccoliDartFmt = require('./tools/broccoli/broccoli-dartfmt').default;
1717
const BroccoliFunnel = require('broccoli-funnel');
18-
const BroccoliSource = require('broccoli-source');
1918

2019
var autoprefixerOptions = require('./build/autoprefixer-options');
2120

21+
/**
22+
* Almost the same as using a plain string for a tree; but unlike a plain
23+
* string, Broccoli won't watch this. Used only internally.
24+
*/
25+
class UnwatchedTree {
26+
constructor(dir) { this.dir = dir; }
27+
read() { return this.dir; }
28+
cleanup() { /* DoNothing */ }
29+
}
30+
31+
2232
module.exports = function(defaults) {
2333
var demoAppCssTree = new BroccoliSass(['src/demo-app'], './demo-app.scss', 'demo-app/demo-app.css');
2434
var demoCssTree = getCssTree('demo-app');
2535
var componentCssTree = getCssTree('components');
2636
var mainCssTree = new BroccoliSass(['src', 'src/core/style'], './main.scss', 'main.css');
27-
var angularAppTree = new Angular2App(defaults);
37+
var angularAppTree = new Angular2App(defaults, {
38+
vendorNpmFiles: []
39+
});
2840

2941
var dartAppTree = getDartTree('src/');
30-
3142
return mergeTrees([
3243
angularAppTree.toTree(),
3344
componentCssTree,
3445
mainCssTree,
3546
demoAppCssTree,
36-
demoCssTree,
47+
demoCssTree
3748
].concat(dartAppTree || []));
3849
};
3950

@@ -50,15 +61,16 @@ function getDartTree(root) {
5061
return null;
5162
}
5263

53-
const ts2dart = new BroccoliTs2Dart(root, {
64+
const ts2dart = new BroccoliTs2Dart([root], {
5465
generateLibraryName: true,
5566
generateSourceMap: false,
5667
translateBuiltins: true,
57-
typingsRoot: '../../typings/browser/ambient/',
58-
additionalFiles: [path.join(process.cwd(), root, 'typings.d.ts')],
68+
basePath: path.join(__dirname, root),
69+
typingsRoot: '../typings/browser/ambient/',
70+
additionalFiles: [path.join(process.cwd(), root, 'typings.d.ts')]
5971
});
6072

61-
const formatter = new BroccoliDartFmt(ts2dart, { dartSDK });
73+
const formatter = new BroccoliDartFmt([ts2dart], { dartSDK });
6274

6375
const dartSources = new BroccoliFunnel(root, {
6476
include: ['**/*.dart'],
@@ -70,16 +82,16 @@ function getDartTree(root) {
7082
formatter
7183
]);
7284

73-
const pubSpecTree = new BroccoliFunnel(new BroccoliSource.UnwatchedDir('.'), {
85+
const pubSpecTree = new BroccoliFunnel(new UnwatchedTree('.'), {
7486
files: ['pubspec.yaml'],
75-
destDir: 'dart',
87+
destDir: 'dart'
7688
});
7789

7890
// Publishes the Dart files and pubspec inside a
7991
return mergeTrees([
80-
dartSources,
8192
pubSpecTree,
82-
new BroccoliDestCopy(formatter, 'dart/lib'),
93+
new BroccoliFunnel(formatter, { destDir: 'dart/lib' }),
94+
allDartFiles
8395
]);
8496
}
8597

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
},
3737
"devDependencies": {
3838
"add-stream": "^1.0.0",
39-
"angular-cli": "^0.0.24",
39+
"angular-cli": "^0.0.28",
4040
"angular-cli-github-pages": "^0.2.0",
4141
"broccoli-autoprefixer": "^4.1.0",
42+
"broccoli-caching-writer": "^2.2.1",
4243
"broccoli-funnel": "^1.0.1",
4344
"broccoli-merge-trees": "^1.1.1",
4445
"broccoli-sass": "^0.7.0",

src/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@
1313
"sourceMap": true,
1414
"sourceRoot": "/",
1515
"target": "es5"
16-
}
16+
},
17+
"files": [
18+
"main.ts",
19+
"typings.d.ts"
20+
]
1721
}

tools/broccoli/angular_builder.d.ts

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

tools/broccoli/angular_builder.ts

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

tools/broccoli/broccoli-check-imports.ts

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

0 commit comments

Comments
 (0)