Skip to content

Commit

Permalink
Remove bower. Upgrade to latest QUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
John Ratcliff committed Dec 18, 2018
1 parent e601acc commit ac3b623
Show file tree
Hide file tree
Showing 28 changed files with 839 additions and 973 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -17,5 +17,4 @@ sauce_connect.log
spec/qunit_spec.js

dist
bower_components
npm-debug.log
1 change: 0 additions & 1 deletion .npmignore
@@ -1,6 +1,5 @@
lib
tests
bower_components
tmp
Brocfile.js
VANILLA_HANDLEBARS.md
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -14,9 +14,7 @@ before_install:
- "npm install -g npm@^2"

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

script:
- npm test
Expand Down
15 changes: 6 additions & 9 deletions Brocfile.js
Expand Up @@ -8,8 +8,7 @@ const minify = process.env.NODE_ENV === 'production';
const includeTests = process.env.NODE_ENV === 'test';
const babelDefaultOptions = {
plugins: [],
presets: [
]
presets: []
};

if (minify) {
Expand Down Expand Up @@ -43,12 +42,10 @@ function buildMainBundle() {
});
}

// const trees = [buildMainBundle()];
const trees = [buildMainBundle()];

// if (includeTests) {
// trees.push(testBundle());
// }

// module.exports = mergeTrees(trees);
if (includeTests) {
trees.push(testBundle);
}

module.exports = mergeTrees([buildMainBundle(), testBundle]);
module.exports = mergeTrees(trees);
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -121,7 +121,6 @@ Clone the repo, then run:

```
npm install
bower install
ember build -e production
```

Expand Down
35 changes: 0 additions & 35 deletions bower.json

This file was deleted.

70 changes: 8 additions & 62 deletions lib/build/test-bundle.js
Expand Up @@ -19,17 +19,16 @@ const multiEntry = require('rollup-plugin-multi-entry');
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const broccoliStew = require('broccoli-stew');
const concat = require('broccoli-concat');
const babel = require('rollup-plugin-babel');
const sourceBundle = require('./source-bundle');

const outputDir = '/';

function buildTestTree(){
const supportFiles = new Funnel('tests', {
include: ['**/*.js']
include: ['**/*.js'],
exclude: ['unit/*']
});
const testTree = new Rollup(supportFiles, {
const integrationTestTree = new Rollup(supportFiles, {
rollup: {
input: ['**/*-test.js'],
output: {
Expand All @@ -44,68 +43,21 @@ function buildTestTree(){
external: ['emblem']
}
});

const nonJsTree = new Funnel('tests', {
exclude: ['**/*.js']
});
const testAssetsTree = mergeTrees([nonJsTree, buildTestSupportTree()]);

const fullTestBundle = mergeTrees([
testTree,
testAssetsTree
integrationTestTree,
nonJsTree,
buildTestSupportTree()
]);

return broccoliStew.mv(fullTestBundle, outputDir + 'tests');

// // Or should this be before assets?
// return new Rollup(namespacedTestTree, {
// rollup: {
// input: 'emblem.js',
// output: [
// {
// file: 'cjs/tests.js',
// sourceMap: false,
// format: 'cjs'
// },
// {
// file: 'emblem-tests.amd.js',
// sourceMap: false,
// format: 'amd'
// }
// ],
// plugins: [
// babel(babelDefaultOptions)
// ]
// }
// });


// rewrite .coffee files to .js files
// testTree = broccoliCoffee(testTree, {bare:true});

// // transpile modules to amd
// const amdTestTree = new ModuleTranspiler(testTree, { format: 'amd' });

// // combine AMD files
// amdTestTree = concat(amdTestTree, {
// inputFiles: ['**/*.js'],
// outputFile: outputDir + 'emblem-tests.amd.js',
// wrapInFunction: false
// });

// const cjsTestTree = new ModuleTranspiler(testTree, { format: 'cjs' });

// cjsTestTree = broccoliStew.mv(cjsTestTree, outputDir + 'cjs/tests');

// testTree = mergeTrees([amdTestTree, testAssetsTree]);
// // put tests in 'tests/'
// testTree = broccoliStew.mv(testTree, outputDir + 'tests');

// return mergeTrees([ cjsTestTree, testTree ]);
}

function buildTestSupportTree(){
const qUnitTree = new Funnel('bower_components/qunit', {
const qUnitTree = new Funnel('node_modules/qunit', {
srcDir: 'qunit',
destDir: 'qunit'
});
Expand All @@ -126,17 +78,11 @@ function buildTestSupportTree(){
destDir: 'jquery'
});

// const emberTree = new Funnel('bower_components/ember', {
// include: ['ember.js'],
// destDir: 'ember'
// });

return mergeTrees([
qUnitTree,
loaderTree,
handlebarsTree,
jQueryTree,
// emberTree
jQueryTree
]);
}

Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -18,15 +18,14 @@
"node": ">=0.4.7"
},
"dependencies": {
"broccoli-inject-livereload": "^1.0.0",
"handlebars": ">=2.0.0",
"optimist": "^0.3.7",
"rollup-plugin-multi-entry": "^2.1.0"
"optimist": "^0.3.7"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.0",
"@invisible/pegjs-import": "^1.1.1",
"broccoli-inject-livereload": "^1.0.0",
"StringScanner": "~0.0.3",
"babel-preset-minify": "^0.5.0",
"broccoli": "^2.0.1",
Expand All @@ -38,9 +37,12 @@
"broccoli-rollup": "^2.1.1",
"broccoli-stew": "^2.0.1",
"chalk": "^2.4.1",
"jquery": "^3.3.1",
"loader.js": "4.7.0",
"pegjs": "0.10.0",
"qunit": "2.8.0",
"rollup-plugin-babel": "^4.1.0",
"rollup-plugin-multi-entry": "^2.1.0",
"rsvp": "^4.8.4",
"testem": "^2.14.0"
},
Expand All @@ -49,7 +51,6 @@
"emblem": "bin/emblem"
},
"scripts": {
"pretest": "ember build",
"test": "bin/run-tests.js",
"start": "ember test --server",
"build": "ember build"
Expand Down
33 changes: 0 additions & 33 deletions tests/-index-full-ember.html

This file was deleted.

30 changes: 0 additions & 30 deletions tests/-index.html

This file was deleted.

13 changes: 1 addition & 12 deletions tests/index.html
Expand Up @@ -16,21 +16,10 @@
<script src="../emblem.amd.js"></script>

<script>
// This is a hack to make the emblem AMD module work with the ES6 imports
window.emblem = require('emblem');
</script>
<!-- <script src="ember/ember.js"></script> -->
<!-- <script src="emblem-tests.amd.js"></script> -->

<script src="tests.js"></script>

<!-- <script>
// FIXME ember-cli should do this
require('support/integration-assertions');
for (moduleName in requirejs.entries) {
if (moduleName.match(/[-_]test$/)) {
require(moduleName);
}
}
</script> -->
</body>
</html>

0 comments on commit ac3b623

Please sign in to comment.