Kevin Ansfield 2017-03-28 11:29:18 +01:00 committed by GitHub
parent e43ef8c7b5
commit 054fa71202
5 changed files with 197 additions and 731 deletions

View File

@ -1,9 +1,10 @@
/* eslint-env node */ /* eslint-env node */
'use strict';
module.exports = function (environment) { module.exports = function (environment) {
var ENV = { let ENV = {
modulePrefix: 'ghost-admin', modulePrefix: 'ghost-admin',
environment: environment, environment,
rootURL: '/', rootURL: '/',
locationType: 'trailing-hash', locationType: 'trailing-hash',
EmberENV: { EmberENV: {

View File

@ -1,25 +1,24 @@
/* eslint-disable */ /* eslint-env node */
/* global require, module */ 'use strict';
var EmberApp = require('ember-cli/lib/broccoli/ember-app'), const EmberApp = require('ember-cli/lib/broccoli/ember-app');
concat = require('broccoli-concat'), const concat = require('broccoli-concat');
mergeTrees = require('broccoli-merge-trees'), const mergeTrees = require('broccoli-merge-trees');
uglify = require('broccoli-uglify-js'), const uglify = require('broccoli-uglify-js');
CleanCSS = require('broccoli-clean-css'), const CleanCSS = require('broccoli-clean-css');
environment = EmberApp.env(), const environment = EmberApp.env();
isProduction = environment === 'production', const isProduction = environment === 'production';
disabled = {enabled: false}, let assetLocation, codemirrorAssets;
assetLocation, codemirrorAssets;
assetLocation = function (fileName) { assetLocation = function (fileName) {
if (isProduction) { if (isProduction) {
fileName = fileName.replace('.', '.min.'); fileName = fileName.replace('.', '.min.');
} }
return '/assets/' + fileName; return `/assets/${fileName}`;
}; };
codemirrorAssets = function () { codemirrorAssets = function () {
var codemirrorFiles = [ let codemirrorFiles = [
'lib/codemirror.css', 'lib/codemirror.css',
'theme/xq-light.css', 'theme/xq-light.css',
'lib/codemirror.js', 'lib/codemirror.js',
@ -37,15 +36,15 @@ codemirrorAssets = function () {
public: { public: {
include: codemirrorFiles, include: codemirrorFiles,
destDir: '/', destDir: '/',
processTree: function (tree) { processTree(tree) {
var jsTree = concat(tree, { let jsTree = concat(tree, {
outputFile: 'assets/codemirror/codemirror.js', outputFile: 'assets/codemirror/codemirror.js',
headerFiles: ['lib/codemirror.js'], headerFiles: ['lib/codemirror.js'],
inputFiles: ['mode/**/*'], inputFiles: ['mode/**/*'],
sourceMapConfig: {enabled: false} sourceMapConfig: {enabled: false}
}); });
var cssTree = concat(tree, { let cssTree = concat(tree, {
outputFile: 'assets/codemirror/codemirror.css', outputFile: 'assets/codemirror/codemirror.css',
inputFiles: ['**/*.css'] inputFiles: ['**/*.css']
}); });
@ -62,7 +61,7 @@ codemirrorAssets = function () {
}; };
function postcssPlugins() { function postcssPlugins() {
var plugins = [{ let plugins = [{
module: require('postcss-easy-import') module: require('postcss-easy-import')
}, { }, {
module: require('postcss-custom-properties') module: require('postcss-custom-properties')
@ -85,7 +84,7 @@ function postcssPlugins() {
} }
module.exports = function (defaults) { module.exports = function (defaults) {
var app = new EmberApp(defaults, { let app = new EmberApp(defaults, {
'ember-cli-babel': { 'ember-cli-babel': {
optional: ['es6.spec.symbols'], optional: ['es6.spec.symbols'],
includePolyfill: true includePolyfill: true
@ -179,7 +178,7 @@ module.exports = function (defaults) {
app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js'); app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js');
if (app.env === 'test') { if (app.env === 'test') {
app.import(app.bowerDirectory + '/jquery.simulate.drag-sortable/jquery.simulate.drag-sortable.js', {type: 'test'}); app.import(`${app.bowerDirectory}/jquery.simulate.drag-sortable/jquery.simulate.drag-sortable.js`, {type: 'test'});
} }
return app.toTree(); return app.toTree();

View File

@ -23,7 +23,7 @@
"coverage": "cat ./coverage/lcov.info | coveralls" "coverage": "cat ./coverage/lcov.info | coveralls"
}, },
"engines": { "engines": {
"node": "~0.12.0 || ^4.2.0" "node": ">= 4"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "6.7.7", "autoprefixer": "6.7.7",
@ -41,7 +41,7 @@
"csscomb": "4.0.1", "csscomb": "4.0.1",
"cssnano": "3.10.0", "cssnano": "3.10.0",
"ember-ajax": "2.5.6", "ember-ajax": "2.5.6",
"ember-cli": "2.11.1", "ember-cli": "2.12.1",
"ember-cli-active-link-wrapper": "0.3.2", "ember-cli-active-link-wrapper": "0.3.2",
"ember-cli-app-version": "2.0.2", "ember-cli-app-version": "2.0.2",
"ember-cli-babel": "5.2.4", "ember-cli-babel": "5.2.4",

View File

@ -9,16 +9,13 @@ import fileUpload from './file-upload';
registerPowerSelectHelpers(); registerPowerSelectHelpers();
export default function startApp(attrs) { export default function startApp(attrs) {
let application;
let attributes = assign({}, config.APP); let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override; attributes = assign(attributes, attrs); // use defaults, but you can override;
run(function () { return run(() => {
application = Application.create(attributes); let application = Application.create(attributes);
application.setupForTesting(); application.setupForTesting();
application.injectTestHelpers(); application.injectTestHelpers();
return application;
}); });
return application;
} }

File diff suppressed because it is too large Load Diff