Skip to content

Commit

Permalink
Merge pull request #31 from rwjblue/use-broccoli
Browse files Browse the repository at this point in the history
Update build system to Broccoli + Ember CLI.
  • Loading branch information
machty committed Jul 25, 2014
2 parents d82c38b + b5aa50d commit dbbcad2
Show file tree
Hide file tree
Showing 25 changed files with 916 additions and 3,088 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/dist/*.debug.*
tmp/
bower_components/
dist/
/.bundle

.bundle/
Expand Down
4 changes: 2 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"ok",
"strictEqual",
"module",
"expect",
"expect"
],

"node" : false,
"browser" : true,

"esnext": true,
"boss" : true,
"curly": false,
"debug": false,
Expand Down
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js

before_script:
- npm install -g bower
- npm install
- bower install

script:
- ./node_modules/.bin/ember test
67 changes: 67 additions & 0 deletions Brocfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
var pickFiles = require('broccoli-static-compiler');
var transpileES6 = require('broccoli-es6-module-transpiler');
var mergeTrees = require('broccoli-merge-trees');
var concat = require('broccoli-concat');
var writeFile = require('broccoli-file-creator');
var jshint = require('broccoli-jshint');

var libTree = pickFiles('lib', {
srcDir: '/',
destDir: '/'
});

var jsHintLib = jshint(libTree);

var libTreeAMD = transpileES6(libTree, {
moduleName: true
});

var libTreeCJS = transpileES6(libTree, {
type: 'cjs'
});

libTreeCJS = pickFiles(libTreeCJS, {
srcDir: '/',
destDir: '/cjs'
});

libTreeAMD = concat(libTreeAMD, {
wrapInEval: false,
inputFiles: ['**/*.js'],
outputFile: '/route-recognizer.amd.js'
});

var iifeStart = writeFile('iife-start', '(function(global) {');
var iifeStop = writeFile('iife-stop', '\nglobal.RouteRecognizer = require("route-recognizer")["default"];\n})(window);');

var loader = pickFiles('bower_components/loader.js', {
srcDir: '/',
destDir: '/',
files: ['loader.js']
});

var libTreeGlobal = concat(mergeTrees([loader, iifeStart, iifeStop, libTreeAMD]), {
wrapInEval: false,
inputFiles: ['iife-start', 'loader.js', 'route-recognizer.amd.js', 'iife-stop'],
outputFile: '/route-recognizer.js'
});

var qunitFiles = pickFiles('bower_components/qunit/qunit', {
srcDir: '/',
destDir: '/qunit'
});

var testFiles = pickFiles('tests', {
srcDir: '/',
destDir: '/'
});

var jsHintTest = jshint(testFiles);

var tests = concat(mergeTrees([jsHintLib, jsHintTest, testFiles], {overwrite: true}), {
wrapInEval: false,
inputFiles: ['**/*.js'],
outputFile: '/tests.js'
});

module.exports = mergeTrees([qunitFiles, testFiles, libTreeAMD, libTreeCJS, libTreeGlobal, tests]);
6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

27 changes: 0 additions & 27 deletions Gemfile.lock

This file was deleted.

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,36 @@ dynamic segments. The recognizer will prefer fewer star
segments and prefer using them for less of the match (and,
consequently, using dynamic and static segments for more
of the match).

# Building / Running Tests

This project uses Ember CLI and Broccoli for building and testing.

## Getting Started

Run the following commands to get going:

```bash
npm install
bower install
```

The above assumes that you have `bower` installed globally (you can install
via `npm install -g bower` if you do not).

## Running Tests

Run the following:

```
npm start
```

At this point you can navigate to the url specified in the Testem UI (usually
http://localhost:7357/). As you change the project the tests will rerun.

## Building

```
npm run build
```
149 changes: 0 additions & 149 deletions Rakefile

This file was deleted.

6 changes: 5 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@
"bower_components",
"test",
"tests"
]
],
"devDependencies": {
"qunit": "~1.14.0",
"loader.js": "stefanpenner/loader.js#7f79173fd5c61dc256af9aa01c56d50ebfec10fe"
}
}
Loading

0 comments on commit dbbcad2

Please sign in to comment.