mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
grunt init, dev
- added grunt-bg-shell - reorganized asset tasks into one location - turn off ember-cli analytics - remove app/config-dev and config-prod - remove qunit from bower.json - remove express from package.json
This commit is contained in:
parent
388a8dd3f0
commit
9e7658f98d
11 changed files with 105 additions and 393 deletions
3
.bowerrc
3
.bowerrc
|
@ -1,3 +1,4 @@
|
||||||
{
|
{
|
||||||
|
"cwd": "core/client/",
|
||||||
"directory": "bower_components"
|
"directory": "bower_components"
|
||||||
}
|
}
|
||||||
|
|
410
Gruntfile.js
410
Gruntfile.js
|
@ -56,8 +56,8 @@ var _ = require('lodash'),
|
||||||
src: [
|
src: [
|
||||||
'core/client/**/*.js',
|
'core/client/**/*.js',
|
||||||
'!core/client/docs/js/*.js',
|
'!core/client/docs/js/*.js',
|
||||||
'!core/client/assets/vendor/**/*.js',
|
'!core/client/bower_components/**/*.js',
|
||||||
'!core/client/tpl/**/*.js'
|
'!core/client/node_modules/**/*.js'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -107,29 +107,12 @@ var _ = require('lodash'),
|
||||||
// Watch files and livereload in the browser during development.
|
// Watch files and livereload in the browser during development.
|
||||||
// See the [grunt dev](#live%20reload) task for how this is used.
|
// See the [grunt dev](#live%20reload) task for how this is used.
|
||||||
watch: {
|
watch: {
|
||||||
shared: {
|
|
||||||
files: ['core/shared/**/*.js'],
|
|
||||||
tasks: ['concat:dev']
|
|
||||||
},
|
|
||||||
emberTemplates: {
|
|
||||||
files: ['core/client/**/*.hbs'],
|
|
||||||
tasks: ['emberTemplates:dev']
|
|
||||||
},
|
|
||||||
ember: {
|
|
||||||
files: ['core/client/**/*.js', 'core/test/client/**/*.js'],
|
|
||||||
tasks: ['clean:tmp', 'transpile', 'concat_sourcemap:dev', 'concat_sourcemap:tests']
|
|
||||||
},
|
|
||||||
sass: {
|
|
||||||
files: [
|
|
||||||
'core/client/assets/sass/**/*.scss'
|
|
||||||
],
|
|
||||||
tasks: ['css']
|
|
||||||
},
|
|
||||||
livereload: {
|
livereload: {
|
||||||
files: [
|
files: [
|
||||||
'content/themes/casper/assets/css/*.css',
|
'content/themes/casper/assets/css/*.css',
|
||||||
'content/themes/casper/assets/js/*.js',
|
'content/themes/casper/assets/js/*.js',
|
||||||
'core/client/assets/css/*.css',
|
'core/client/dist/*.js',
|
||||||
|
'core/client/dist/*.css',
|
||||||
'core/built/scripts/*.js'
|
'core/built/scripts/*.js'
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
|
@ -306,9 +289,47 @@ var _ = require('lodash'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ### grunt-bg-shell
|
||||||
|
// Used to run ember-cli watch in the background
|
||||||
|
bgShell: {
|
||||||
|
ember: {
|
||||||
|
cmd: './node_modules/.bin/ember build --watch',
|
||||||
|
execOpts: {
|
||||||
|
cwd: path.resolve(cwd + '/core/client/')
|
||||||
|
},
|
||||||
|
bg: true,
|
||||||
|
stdout: function (out) {
|
||||||
|
grunt.log.writeln('Ember-cli::'.cyan + out);
|
||||||
|
},
|
||||||
|
stderror: function (error) {
|
||||||
|
grunt.log.error('Ember-cli::'.red + error.red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// ### grunt-shell
|
// ### grunt-shell
|
||||||
// Command line tools where it's easier to run a command directly than configure a grunt plugin
|
// Command line tools where it's easier to run a command directly than configure a grunt plugin
|
||||||
shell: {
|
shell: {
|
||||||
|
ember: {
|
||||||
|
command: function (mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case 'init':
|
||||||
|
return 'echo Installing client dependencies... && npm install';
|
||||||
|
|
||||||
|
case 'prod':
|
||||||
|
return './node_modules/.bin/ember build --environment=production --silent'
|
||||||
|
|
||||||
|
case 'dev':
|
||||||
|
default:
|
||||||
|
return './node_modules/.bin/ember build --silent';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
execOptions: {
|
||||||
|
cwd: path.resolve(cwd + '/core/client/'),
|
||||||
|
stdout: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// #### Run bower install
|
// #### Run bower install
|
||||||
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
||||||
// information.
|
// information.
|
||||||
|
@ -346,135 +367,6 @@ var _ = require('lodash'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// ### grunt-sass
|
|
||||||
// compile sass to css
|
|
||||||
sass: {
|
|
||||||
compress: {
|
|
||||||
options: {
|
|
||||||
outputStyle: 'compressed',
|
|
||||||
sourceMap: true
|
|
||||||
},
|
|
||||||
files: [
|
|
||||||
{dest: path.resolve('core/client/assets/css/<%= pkg.name %>.min.css'), src: path.resolve('core/client/assets/sass/screen.scss')},
|
|
||||||
{dest: path.resolve('core/client/docs/dist/css/<%= pkg.name %>.min.css'), src: path.resolve('core/client/assets/sass/screen.scss')}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-autoprefixer
|
|
||||||
// Autoprefix all the things, for the last 2 versions of major browsers
|
|
||||||
autoprefixer: {
|
|
||||||
options: {
|
|
||||||
silent: true, // suppress logging
|
|
||||||
map: true, // Use and update the sourcemap
|
|
||||||
browsers: ['last 2 versions', '> 1%', 'Explorer 10']
|
|
||||||
},
|
|
||||||
ghost: {
|
|
||||||
src: 'core/client/assets/css/<%= pkg.name %>.min.css',
|
|
||||||
dest: 'core/client/assets/css/<%= pkg.name %>.min.css'
|
|
||||||
},
|
|
||||||
docs: {
|
|
||||||
src: 'core/client/docs/dist/css/<%= pkg.name %>.min.css',
|
|
||||||
dest: 'core/client/docs/dist/css/<%= pkg.name %>.min.css'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-ember-templates
|
|
||||||
// Compiles handlebar templates for ember
|
|
||||||
emberTemplates: {
|
|
||||||
dev: {
|
|
||||||
options: {
|
|
||||||
templateCompilerPath: 'bower_components/ember/ember-template-compiler.js',
|
|
||||||
handlebarsPath: 'bower_components/handlebars/handlebars.js',
|
|
||||||
templateNamespace: 'HTMLBars',
|
|
||||||
templateBasePath: /core\/client\//,
|
|
||||||
templateFileExtensions: /\.hbs/,
|
|
||||||
templateRegistration: function (name, template) {
|
|
||||||
return grunt.config.process('define(\'ghost/') +
|
|
||||||
name + '\', [\'exports\'], function(__exports__){ __exports__[\'default\'] = ' +
|
|
||||||
template + '; });';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
files: {
|
|
||||||
'core/built/scripts/templates-dev.js': 'core/client/templates/**/*.hbs'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
prod: {
|
|
||||||
options: {
|
|
||||||
templateCompilerPath: 'bower_components/ember/ember-template-compiler.js',
|
|
||||||
handlebarsPath: 'bower_components/handlebars/handlebars.js',
|
|
||||||
templateNamespace: 'HTMLBars',
|
|
||||||
templateBasePath: /core\/client\//,
|
|
||||||
templateFileExtensions: /\.hbs/,
|
|
||||||
templateRegistration: function (name, template) {
|
|
||||||
return grunt.config.process('define(\'ghost/') +
|
|
||||||
name + '\', [\'exports\'], function(__exports__){ __exports__[\'default\'] = ' +
|
|
||||||
template + '; });';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
files: {
|
|
||||||
'core/built/scripts/templates.js': 'core/client/templates/**/*.hbs'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-es6-module-transpiler
|
|
||||||
// Compiles Ember es6 modules
|
|
||||||
transpile: {
|
|
||||||
client: {
|
|
||||||
type: 'amd',
|
|
||||||
moduleName: function (path) {
|
|
||||||
return 'ghost/' + path;
|
|
||||||
},
|
|
||||||
files: [{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'core/client/',
|
|
||||||
src: ['**/*.js', '!loader.js', '!config-*.js'],
|
|
||||||
dest: '.tmp/ember-transpiled/'
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
tests: {
|
|
||||||
type: 'amd',
|
|
||||||
moduleName: function (path) {
|
|
||||||
return 'ghost/tests/' + path;
|
|
||||||
},
|
|
||||||
files: [{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'core/test/client/',
|
|
||||||
src: ['**/*.js'],
|
|
||||||
dest: '.tmp/ember-tests-transpiled/'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-concat-sourcemap
|
|
||||||
// Concatenates transpiled ember app
|
|
||||||
concat_sourcemap: {
|
|
||||||
dev: {
|
|
||||||
src: ['.tmp/ember-transpiled/**/*.js', 'core/client/loader.js'],
|
|
||||||
dest: 'core/built/scripts/ghost-dev.js',
|
|
||||||
options: {
|
|
||||||
sourcesContent: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tests: {
|
|
||||||
src: ['.tmp/ember-tests-transpiled/**/*.js'],
|
|
||||||
dest: 'core/built/scripts/ghost-tests.js',
|
|
||||||
options: {
|
|
||||||
sourcesContent: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
prod: {
|
|
||||||
src: ['.tmp/ember-transpiled/**/*.js', 'core/built/scripts/templates.js',
|
|
||||||
'core/client/loader.js'],
|
|
||||||
dest: 'core/built/scripts/ghost.js',
|
|
||||||
options: {
|
|
||||||
sourcesContent: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-docker
|
// ### grunt-docker
|
||||||
// Generate documentation from code
|
// Generate documentation from code
|
||||||
docker: {
|
docker: {
|
||||||
|
@ -496,19 +388,14 @@ var _ = require('lodash'),
|
||||||
built: {
|
built: {
|
||||||
src: [
|
src: [
|
||||||
'core/built/**',
|
'core/built/**',
|
||||||
'core/client/assets/img/contributors/**',
|
'core/client/dist/**',
|
||||||
'core/client/templates/-contributors.hbs'
|
'core/client/public/assets/img/contributors/**',
|
||||||
|
'core/client/app/templates/-contributors.hbs'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
src: ['<%= paths.releaseBuild %>/**']
|
src: ['<%= paths.releaseBuild %>/**']
|
||||||
},
|
},
|
||||||
css: {
|
|
||||||
src: [
|
|
||||||
'core/client/assets/css/**',
|
|
||||||
'core/client/docs/dist/css/**'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
test: {
|
test: {
|
||||||
src: ['content/data/ghost-test.db']
|
src: ['content/data/ghost-test.db']
|
||||||
},
|
},
|
||||||
|
@ -520,37 +407,19 @@ var _ = require('lodash'),
|
||||||
// ### grunt-contrib-copy
|
// ### grunt-contrib-copy
|
||||||
// Copy files into their correct locations as part of building assets, or creating release zips
|
// Copy files into their correct locations as part of building assets, or creating release zips
|
||||||
copy: {
|
copy: {
|
||||||
dev: {
|
jquery: {
|
||||||
files: [{
|
cwd: 'core/client/bower_components/jquery/dist/',
|
||||||
cwd: 'bower_components/jquery/dist/',
|
src: 'jquery.js',
|
||||||
src: 'jquery.js',
|
dest: 'core/built/public/',
|
||||||
dest: 'core/built/public/',
|
expand: true,
|
||||||
expand: true
|
nonull: true
|
||||||
}, {
|
|
||||||
src: 'core/client/config-dev.js',
|
|
||||||
dest: 'core/client/config.js'
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
prod: {
|
|
||||||
files: [{
|
|
||||||
cwd: 'bower_components/jquery/dist/',
|
|
||||||
src: 'jquery.js',
|
|
||||||
dest: 'core/built/public/',
|
|
||||||
expand: true
|
|
||||||
}, {
|
|
||||||
src: 'core/client/config-prod.js',
|
|
||||||
dest: 'core/client/config.js'
|
|
||||||
}]
|
|
||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
files: [{
|
files: [{
|
||||||
cwd: 'bower_components/jquery/dist/',
|
cwd: 'core/client/bower_components/jquery/dist/',
|
||||||
src: 'jquery.js',
|
src: 'jquery.js',
|
||||||
dest: 'core/built/public/',
|
dest: 'core/built/public/',
|
||||||
expand: true
|
expand: true
|
||||||
}, {
|
|
||||||
src: 'core/client/config-prod.js',
|
|
||||||
dest: 'core/client/config.js'
|
|
||||||
}, {
|
}, {
|
||||||
expand: true,
|
expand: true,
|
||||||
src: buildGlob,
|
src: buildGlob,
|
||||||
|
@ -572,84 +441,6 @@ var _ = require('lodash'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// ### grunt-contrib-concat
|
|
||||||
// concatenate multiple JS files into a single file ready for use
|
|
||||||
concat: {
|
|
||||||
dev: {
|
|
||||||
nonull: true,
|
|
||||||
dest: 'core/built/scripts/vendor-dev.js',
|
|
||||||
src: [
|
|
||||||
'bower_components/loader.js/loader.js',
|
|
||||||
'bower_components/jquery/dist/jquery.js',
|
|
||||||
'bower_components/ember/ember.debug.js',
|
|
||||||
'bower_components/ember-data/ember-data.js',
|
|
||||||
'bower_components/ember-resolver/dist/ember-resolver.js',
|
|
||||||
'bower_components/ic-ajax/dist/globals/main.js',
|
|
||||||
'bower_components/ember-load-initializers/ember-load-initializers.js',
|
|
||||||
'bower_components/validator-js/validator.js',
|
|
||||||
'bower_components/codemirror/lib/codemirror.js',
|
|
||||||
'bower_components/codemirror/addon/mode/overlay.js',
|
|
||||||
'bower_components/codemirror/mode/markdown/markdown.js',
|
|
||||||
'bower_components/codemirror/mode/gfm/gfm.js',
|
|
||||||
'bower_components/showdown-ghost/src/showdown.js',
|
|
||||||
'bower_components/moment/moment.js',
|
|
||||||
'bower_components/keymaster/keymaster.js',
|
|
||||||
'bower_components/device/lib/device.js',
|
|
||||||
'bower_components/jquery-ui/ui/jquery-ui.js',
|
|
||||||
'bower_components/jquery-file-upload/js/jquery.fileupload.js',
|
|
||||||
'bower_components/fastclick/lib/fastclick.js',
|
|
||||||
'bower_components/nprogress/nprogress.js',
|
|
||||||
'bower_components/ember-simple-auth/simple-auth.js',
|
|
||||||
'bower_components/ember-simple-auth/simple-auth-oauth2.js',
|
|
||||||
'bower_components/google-caja/html-css-sanitizer-bundle.js',
|
|
||||||
'bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js',
|
|
||||||
'bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js',
|
|
||||||
|
|
||||||
'core/shared/lib/showdown/extensions/ghostimagepreview.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghostgfm.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghostfootnotes.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghosthighlight.js'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
prod: {
|
|
||||||
nonull: true,
|
|
||||||
dest: 'core/built/scripts/vendor.js',
|
|
||||||
src: [
|
|
||||||
'bower_components/loader.js/loader.js',
|
|
||||||
'bower_components/jquery/dist/jquery.js',
|
|
||||||
'bower_components/ember/ember.prod.js',
|
|
||||||
'bower_components/ember-data/ember-data.prod.js',
|
|
||||||
'bower_components/ember-resolver/dist/ember-resolver.js',
|
|
||||||
'bower_components/ic-ajax/dist/globals/main.js',
|
|
||||||
'bower_components/ember-load-initializers/ember-load-initializers.js',
|
|
||||||
'bower_components/validator-js/validator.js',
|
|
||||||
'bower_components/codemirror/lib/codemirror.js',
|
|
||||||
'bower_components/codemirror/addon/mode/overlay.js',
|
|
||||||
'bower_components/codemirror/mode/markdown/markdown.js',
|
|
||||||
'bower_components/codemirror/mode/gfm/gfm.js',
|
|
||||||
'bower_components/showdown-ghost/src/showdown.js',
|
|
||||||
'bower_components/moment/moment.js',
|
|
||||||
'bower_components/keymaster/keymaster.js',
|
|
||||||
'bower_components/device/lib/device.js',
|
|
||||||
'bower_components/jquery-ui/ui/jquery-ui.js',
|
|
||||||
'bower_components/jquery-file-upload/js/jquery.fileupload.js',
|
|
||||||
'bower_components/fastclick/lib/fastclick.js',
|
|
||||||
'bower_components/nprogress/nprogress.js',
|
|
||||||
'bower_components/ember-simple-auth/simple-auth.js',
|
|
||||||
'bower_components/ember-simple-auth/simple-auth-oauth2.js',
|
|
||||||
'bower_components/google-caja/html-css-sanitizer-bundle.js',
|
|
||||||
'bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js',
|
|
||||||
'bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js',
|
|
||||||
|
|
||||||
'core/shared/lib/showdown/extensions/ghostimagepreview.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghostgfm.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghostfootnotes.js',
|
|
||||||
'core/shared/lib/showdown/extensions/ghosthighlight.js'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// ### grunt-contrib-uglify
|
// ### grunt-contrib-uglify
|
||||||
// Minify concatenated javascript files ready for production
|
// Minify concatenated javascript files ready for production
|
||||||
uglify: {
|
uglify: {
|
||||||
|
@ -658,9 +449,7 @@ var _ = require('lodash'),
|
||||||
sourceMap: false
|
sourceMap: false
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
'core/built/public/jquery.min.js': 'core/built/public/jquery.js',
|
'core/built/public/jquery.min.js': 'core/built/public/jquery.js'
|
||||||
'core/built/scripts/vendor.min.js': 'core/built/scripts/vendor.js',
|
|
||||||
'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
release: {
|
release: {
|
||||||
|
@ -668,9 +457,7 @@ var _ = require('lodash'),
|
||||||
sourceMap: false
|
sourceMap: false
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
'core/built/public/jquery.min.js': 'core/built/public/jquery.js',
|
'core/built/public/jquery.min.js': 'core/built/public/jquery.js'
|
||||||
'core/built/scripts/vendor.min.js': 'core/built/scripts/vendor.js',
|
|
||||||
'core/built/scripts/ghost.min.js': 'core/built/scripts/ghost.js'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -992,25 +779,6 @@ var _ = require('lodash'),
|
||||||
['test-setup', 'shell:coverage']
|
['test-setup', 'shell:coverage']
|
||||||
);
|
);
|
||||||
|
|
||||||
// ## Building assets
|
|
||||||
//
|
|
||||||
// Ghost's GitHub repository contains the un-built source code for Ghost. If you're looking for the already
|
|
||||||
// built release zips, you can get these from the [release page](https://github.com/TryGhost/Ghost/releases) on
|
|
||||||
// GitHub or from https://ghost.org/download. These zip files are created using the [grunt release](#release)
|
|
||||||
// task.
|
|
||||||
//
|
|
||||||
// If you want to work on Ghost core, or you want to use the source files from GitHub, then you have to build
|
|
||||||
// the Ghost assets in order to make them work.
|
|
||||||
//
|
|
||||||
// There are a number of grunt tasks available to help with this. Firstly after fetching an updated version of
|
|
||||||
// the Ghost codebase, after running `npm install`, you will need to run [grunt init](#init%20assets).
|
|
||||||
//
|
|
||||||
// For production blogs you will need to run [grunt prod](#production%20assets).
|
|
||||||
//
|
|
||||||
// For updating assets during development, the tasks [grunt](#default%20asset%20build) and
|
|
||||||
// [grunt dev](#live%20reload) are available.
|
|
||||||
//
|
|
||||||
|
|
||||||
// #### Master Warning *(Utility Task)*
|
// #### Master Warning *(Utility Task)*
|
||||||
// Warns git users not ot use the `master` branch in production.
|
// Warns git users not ot use the `master` branch in production.
|
||||||
// `master` is an unstable branch and shouldn't be used in production as you run the risk of ending up with a
|
// `master` is an unstable branch and shouldn't be used in production as you run the risk of ending up with a
|
||||||
|
@ -1024,26 +792,10 @@ var _ = require('lodash'),
|
||||||
console.log('Use the', 'stable'.bold, 'branch for live blogs.', 'Never'.bold, 'master!');
|
console.log('Use the', 'stable'.bold, 'branch for live blogs.', 'Never'.bold, 'master!');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ### Ember Build *(Utility Task)*
|
|
||||||
// All tasks related to building the Ember client code including transpiling ES6 modules and building templates
|
|
||||||
grunt.registerTask('emberBuildDev', 'Build Ember JS & templates for development',
|
|
||||||
['clean:tmp', 'buildAboutPage', 'emberTemplates:dev', 'transpile', 'concat_sourcemap:dev', 'concat_sourcemap:tests']);
|
|
||||||
|
|
||||||
// ### Ember Build *(Utility Task)*
|
|
||||||
// All tasks related to building the Ember client code including transpiling ES6 modules and building templates
|
|
||||||
grunt.registerTask('emberBuildProd', 'Build Ember JS & templates for production',
|
|
||||||
['clean:tmp', 'buildAboutPage', 'emberTemplates:prod', 'transpile', 'concat_sourcemap:prod']);
|
|
||||||
|
|
||||||
// ### CSS Build *(Utility Task)*
|
|
||||||
// Build the CSS files from the SCSS files
|
|
||||||
grunt.registerTask('css', 'Build Client CSS',
|
|
||||||
['sass', 'autoprefixer']);
|
|
||||||
|
|
||||||
// ### Build About Page *(Utility Task)*
|
// ### Build About Page *(Utility Task)*
|
||||||
// Builds the github contributors partial template used on the Settings/About page,
|
// Builds the github contributors partial template used on the Settings/About page,
|
||||||
// and downloads the avatar for each of the users.
|
// and downloads the avatar for each of the users.
|
||||||
// Run by any task that compiles the ember assets (emberBuildDev, emberBuildProd)
|
// Run by any task that compiles the ember assets or manually via `grunt buildAboutPage`.
|
||||||
// or manually via `grunt buildAboutPage`.
|
|
||||||
// Change which version you're working against by setting the "releaseTag" below.
|
// Change which version you're working against by setting the "releaseTag" below.
|
||||||
//
|
//
|
||||||
// Only builds if the contributors template does not exist.
|
// Only builds if the contributors template does not exist.
|
||||||
|
@ -1051,8 +803,8 @@ var _ = require('lodash'),
|
||||||
// `grunt buildAboutPage --force`
|
// `grunt buildAboutPage --force`
|
||||||
grunt.registerTask('buildAboutPage', 'Compile assets for the About Ghost page', function () {
|
grunt.registerTask('buildAboutPage', 'Compile assets for the About Ghost page', function () {
|
||||||
var done = this.async(),
|
var done = this.async(),
|
||||||
templatePath = 'core/client/templates/-contributors.hbs',
|
templatePath = 'core/client/app/templates/-contributors.hbs',
|
||||||
imagePath = 'core/client/assets/img/contributors/',
|
imagePath = 'core/client/public/assets/img/contributors/',
|
||||||
ninetyDaysAgo = Date.now() - (1000 * 60 * 60 * 24 * 90),
|
ninetyDaysAgo = Date.now() - (1000 * 60 * 60 * 24 * 90),
|
||||||
oauthKey = process.env.GITHUB_OAUTH_KEY;
|
oauthKey = process.env.GITHUB_OAUTH_KEY;
|
||||||
|
|
||||||
|
@ -1117,6 +869,25 @@ var _ = require('lodash'),
|
||||||
done(false);
|
done(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ## Building assets
|
||||||
|
//
|
||||||
|
// Ghost's GitHub repository contains the un-built source code for Ghost. If you're looking for the already
|
||||||
|
// built release zips, you can get these from the [release page](https://github.com/TryGhost/Ghost/releases) on
|
||||||
|
// GitHub or from https://ghost.org/download. These zip files are created using the [grunt release](#release)
|
||||||
|
// task.
|
||||||
|
//
|
||||||
|
// If you want to work on Ghost core, or you want to use the source files from GitHub, then you have to build
|
||||||
|
// the Ghost assets in order to make them work.
|
||||||
|
//
|
||||||
|
// There are a number of grunt tasks available to help with this. Firstly after fetching an updated version of
|
||||||
|
// the Ghost codebase, after running `npm install`, you will need to run [grunt init](#init%20assets).
|
||||||
|
//
|
||||||
|
// For production blogs you will need to run [grunt prod](#production%20assets).
|
||||||
|
//
|
||||||
|
// For updating assets during development, the tasks [grunt](#default%20asset%20build) and
|
||||||
|
// [grunt dev](#live%20reload) are available.
|
||||||
|
|
||||||
// ### Init assets
|
// ### Init assets
|
||||||
// `grunt init` - will run an initial asset build for you
|
// `grunt init` - will run an initial asset build for you
|
||||||
//
|
//
|
||||||
|
@ -1129,22 +900,26 @@ var _ = require('lodash'),
|
||||||
// `bower` does have some quirks, such as not running as root. If you have problems please try running
|
// `bower` does have some quirks, such as not running as root. If you have problems please try running
|
||||||
// `grunt init --verbose` to see if there are any errors.
|
// `grunt init --verbose` to see if there are any errors.
|
||||||
grunt.registerTask('init', 'Prepare the project for development',
|
grunt.registerTask('init', 'Prepare the project for development',
|
||||||
['shell:bower', 'update_submodules', 'default']);
|
['shell:ember:init', 'shell:bower', 'update_submodules', 'default']);
|
||||||
|
|
||||||
|
// ### Basic Asset Building
|
||||||
|
// Builds and moves necessary client assets. Prod additionally builds the ember app.
|
||||||
|
grunt.registerTask('assets', 'Basic asset building & moving',
|
||||||
|
['clean:tmp', 'buildAboutPage', 'copy:jquery'])
|
||||||
|
|
||||||
|
// ### Default asset build
|
||||||
|
// `grunt` - default grunt task
|
||||||
|
//
|
||||||
|
// Build assets and dev version of the admin app.
|
||||||
|
grunt.registerTask('default', 'Build JS & templates for development',
|
||||||
|
['assets', 'shell:ember:dev']);
|
||||||
|
|
||||||
// ### Production assets
|
// ### Production assets
|
||||||
// `grunt prod` - will build the minified assets used in production.
|
// `grunt prod` - will build the minified assets used in production.
|
||||||
//
|
//
|
||||||
// It is otherwise the same as running `grunt`, but is only used when running Ghost in the `production` env.
|
// It is otherwise the same as running `grunt`, but is only used when running Ghost in the `production` env.
|
||||||
grunt.registerTask('prod', 'Build JS & templates for production',
|
grunt.registerTask('prod', 'Build JS & templates for production',
|
||||||
['concat:prod', 'copy:prod', 'emberBuildProd', 'uglify:prod', 'master-warn']);
|
['assets', 'shell:ember:prod', 'uglify:prod', 'master-warn']);
|
||||||
|
|
||||||
// ### Default asset build
|
|
||||||
// `grunt` - default grunt task
|
|
||||||
//
|
|
||||||
// Compiles concatenates javascript files for the admin UI into a handful of files instead
|
|
||||||
// of many files, and makes sure the bower dependencies are in the right place.
|
|
||||||
grunt.registerTask('default', 'Build JS & templates for development',
|
|
||||||
['concat:dev', 'copy:dev', 'css', 'emberBuildDev']);
|
|
||||||
|
|
||||||
// ### Live reload
|
// ### Live reload
|
||||||
// `grunt dev` - build assets on the fly whilst developing
|
// `grunt dev` - build assets on the fly whilst developing
|
||||||
|
@ -1158,7 +933,7 @@ var _ = require('lodash'),
|
||||||
//
|
//
|
||||||
// Note that the current implementation of watch only works with casper, not other themes.
|
// Note that the current implementation of watch only works with casper, not other themes.
|
||||||
grunt.registerTask('dev', 'Dev Mode; watch files and restart server on changes',
|
grunt.registerTask('dev', 'Dev Mode; watch files and restart server on changes',
|
||||||
['default', 'express:dev', 'watch']);
|
['assets', 'bgShell:ember', 'express:dev', 'watch']);
|
||||||
|
|
||||||
// ### Release
|
// ### Release
|
||||||
// Run `grunt release` to create a Ghost release zip file.
|
// Run `grunt release` to create a Ghost release zip file.
|
||||||
|
@ -1171,8 +946,7 @@ var _ = require('lodash'),
|
||||||
' - Copy files to release-folder/#/#{version} directory\n' +
|
' - Copy files to release-folder/#/#{version} directory\n' +
|
||||||
' - Clean out unnecessary files (travis, .git*, etc)\n' +
|
' - Clean out unnecessary files (travis, .git*, etc)\n' +
|
||||||
' - Zip files in release-folder to dist-folder/#{version} directory',
|
' - Zip files in release-folder to dist-folder/#{version} directory',
|
||||||
['init', 'concat:prod', 'copy:prod', 'emberBuildProd', 'uglify:release', 'clean:release',
|
['init', 'assets', 'shell:ember:prod', 'uglify:release', 'clean:release', 'copy:release', 'shell:shrinkwrap', 'compress:release']);
|
||||||
'shell:shrinkwrap', 'copy:release', 'compress:release']);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Export the configuration
|
// Export the configuration
|
||||||
|
|
35
bower.json
35
bower.json
|
@ -1,35 +0,0 @@
|
||||||
{
|
|
||||||
"name": "ghost",
|
|
||||||
"dependencies": {
|
|
||||||
"codemirror": "4.0.1",
|
|
||||||
"Countable": "2.0.2",
|
|
||||||
"device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d",
|
|
||||||
"ember": "1.10.0",
|
|
||||||
"ember-data": "1.0.0-beta.14.1",
|
|
||||||
"ember-load-initializers": "git://github.com/stefanpenner/ember-load-initializers.git#0.0.1",
|
|
||||||
"ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e",
|
|
||||||
"ember-simple-auth": "0.7.2",
|
|
||||||
"fastclick": "1.0.0",
|
|
||||||
"handlebars": "2.0.0",
|
|
||||||
"ic-ajax": "1.0.1",
|
|
||||||
"jquery": "1.11.0",
|
|
||||||
"jquery-file-upload": "9.5.6",
|
|
||||||
"jquery-hammerjs": "1.0.1",
|
|
||||||
"jquery-ui": "1.10.4",
|
|
||||||
"jqueryui-touch-punch": "furf/jquery-ui-touch-punch",
|
|
||||||
"keymaster": "git://github.com/madrobby/keymaster#564ea42e07de40da8113a571f17ceae8802672ff",
|
|
||||||
"loader.js": "git://github.com/stefanpenner/loader.js#1.0.0",
|
|
||||||
"moment": "2.8.3",
|
|
||||||
"nanoscroller": "0.8.4",
|
|
||||||
"normalize-scss": "~3.0.1",
|
|
||||||
"nprogress": "0.1.2",
|
|
||||||
"showdown-ghost": "0.3.4",
|
|
||||||
"validator-js": "3.28.0",
|
|
||||||
"google-caja": "5669.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"ember-mocha": "~0.3.0",
|
|
||||||
"ember-cli-test-loader": "dgeb/ember-cli-test-loader#test-agnostic",
|
|
||||||
"ember-cli-shims": "stefanpenner/ember-cli-shims#~0.0.3"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,5 +5,5 @@
|
||||||
|
|
||||||
Setting `disableAnalytics` to true will prevent any data from being sent.
|
Setting `disableAnalytics` to true will prevent any data from being sent.
|
||||||
*/
|
*/
|
||||||
"disableAnalytics": false
|
"disableAnalytics": true
|
||||||
}
|
}
|
||||||
|
|
2
core/client/.gitignore
vendored
2
core/client/.gitignore
vendored
|
@ -18,4 +18,4 @@ testem.log
|
||||||
|
|
||||||
# built by grunt
|
# built by grunt
|
||||||
public/assets/img/contributors/
|
public/assets/img/contributors/
|
||||||
templates/-contributors.hbs
|
app/templates/-contributors.hbs
|
||||||
|
|
|
@ -29,6 +29,7 @@ app.import('bower_components/ember-simple-auth/simple-auth.js');
|
||||||
app.import('bower_components/ember-simple-auth/simple-auth-oauth2.js');
|
app.import('bower_components/ember-simple-auth/simple-auth-oauth2.js');
|
||||||
app.import('bower_components/google-caja/html-css-sanitizer-bundle.js');
|
app.import('bower_components/google-caja/html-css-sanitizer-bundle.js');
|
||||||
app.import('bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js');
|
app.import('bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js');
|
||||||
|
app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js');
|
||||||
|
|
||||||
app.import('vendor/showdown/extensions/ghostgfm.js');
|
app.import('vendor/showdown/extensions/ghostgfm.js');
|
||||||
app.import('vendor/showdown/extensions/ghostimagepreview.js');
|
app.import('vendor/showdown/extensions/ghostimagepreview.js');
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
import Ember from 'ember';
|
|
||||||
function configureApp(App) {
|
|
||||||
if (!App instanceof Ember.Application) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
App.reopen({
|
|
||||||
LOG_ACTIVE_GENERATION: true,
|
|
||||||
LOG_MODULE_RESOLVER: true,
|
|
||||||
LOG_TRANSITIONS: true,
|
|
||||||
LOG_TRANSITIONS_INTERNAL: true,
|
|
||||||
LOG_VIEW_LOOKUPS: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export default configureApp;
|
|
|
@ -1,8 +0,0 @@
|
||||||
import Ember from 'ember';
|
|
||||||
function configureApp(App) {
|
|
||||||
if (!App instanceof Ember.Application) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default configureApp;
|
|
|
@ -3,7 +3,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"codemirror": "4.0.1",
|
"codemirror": "4.0.1",
|
||||||
"Countable": "2.0.2",
|
"Countable": "2.0.2",
|
||||||
"handlebars": "~1.3.0",
|
"handlebars": "2.0.0",
|
||||||
"device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d",
|
"device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d",
|
||||||
"ember": "1.10.0",
|
"ember": "1.10.0",
|
||||||
"ember-data": "1.0.0-beta.14.1",
|
"ember-data": "1.0.0-beta.14.1",
|
||||||
|
@ -12,12 +12,12 @@
|
||||||
"ember-simple-auth": "0.7.2",
|
"ember-simple-auth": "0.7.2",
|
||||||
"fastclick": "1.0.0",
|
"fastclick": "1.0.0",
|
||||||
"google-caja": "5669.0.0",
|
"google-caja": "5669.0.0",
|
||||||
"handlebars": "2.0.0",
|
|
||||||
"ic-ajax": "1.0.1",
|
"ic-ajax": "1.0.1",
|
||||||
"jquery": "^1.11.1",
|
"jquery": "~1.11.2",
|
||||||
"jquery-file-upload": "9.5.6",
|
"jquery-file-upload": "9.5.6",
|
||||||
"jquery-hammerjs": "1.0.1",
|
"jquery-hammerjs": "1.0.1",
|
||||||
"jquery-ui": "1.10.4",
|
"jquery-ui": "1.10.4",
|
||||||
|
"jqueryui-touch-punch": "furf/jquery-ui-touch-punch",
|
||||||
"keymaster": "git://github.com/madrobby/keymaster#564ea42e07de40da8113a571f17ceae8802672ff",
|
"keymaster": "git://github.com/madrobby/keymaster#564ea42e07de40da8113a571f17ceae8802672ff",
|
||||||
"loader.js": "ember-cli/loader.js#1.0.1",
|
"loader.js": "ember-cli/loader.js#1.0.1",
|
||||||
"moment": "2.8.3",
|
"moment": "2.8.3",
|
||||||
|
@ -30,9 +30,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
||||||
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1",
|
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.1",
|
||||||
"ember-mocha": "~0.3.0",
|
"ember-mocha": "~0.3.0"
|
||||||
"ember-qunit": "0.2.8",
|
|
||||||
"ember-qunit-notifications": "0.0.7",
|
|
||||||
"qunit": "~1.17.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
"ember-cli-uglify": "1.0.1",
|
"ember-cli-uglify": "1.0.1",
|
||||||
"ember-data": "1.0.0-beta.14.1",
|
"ember-data": "1.0.0-beta.14.1",
|
||||||
"ember-export-application-global": "^1.0.2",
|
"ember-export-application-global": "^1.0.2",
|
||||||
"express": "^4.8.5",
|
|
||||||
"fs-extra": "0.16.3",
|
"fs-extra": "0.16.3",
|
||||||
"glob": "^4.0.5"
|
"glob": "^4.0.5"
|
||||||
},
|
},
|
||||||
|
|
|
@ -76,23 +76,22 @@
|
||||||
"blanket": "~1.1.6",
|
"blanket": "~1.1.6",
|
||||||
"bower": "~1.3.10",
|
"bower": "~1.3.10",
|
||||||
"grunt": "~0.4.5",
|
"grunt": "~0.4.5",
|
||||||
|
"grunt-bg-shell": "^2.3.1",
|
||||||
"grunt-cli": "~0.1.13",
|
"grunt-cli": "~0.1.13",
|
||||||
"grunt-autoprefixer": "1.0.1",
|
|
||||||
"grunt-concat-sourcemap": "~0.4.3",
|
|
||||||
"grunt-contrib-clean": "~0.6.0",
|
"grunt-contrib-clean": "~0.6.0",
|
||||||
"grunt-contrib-compress": "~0.11.0",
|
"grunt-contrib-compress": "~0.11.0",
|
||||||
"grunt-contrib-concat": "~0.5.0",
|
|
||||||
"grunt-contrib-copy": "~0.5.0",
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
"grunt-contrib-jshint": "~0.10.0",
|
"grunt-contrib-jshint": "~0.10.0",
|
||||||
"grunt-contrib-uglify": "~0.6.0",
|
"grunt-contrib-uglify": "~0.6.0",
|
||||||
"grunt-contrib-watch": "~0.6.1",
|
"grunt-contrib-watch": "~0.6.1",
|
||||||
"grunt-docker": "~0.0.8",
|
"grunt-docker": "~0.0.8",
|
||||||
"grunt-ember-templates": "dgeb/grunt-ember-templates#88594c6",
|
|
||||||
"grunt-es6-module-transpiler": "~0.6.0",
|
|
||||||
"grunt-express-server": "~0.4.19",
|
"grunt-express-server": "~0.4.19",
|
||||||
"grunt-jscs": "~1.2.0",
|
"grunt-jscs": "~1.2.0",
|
||||||
"grunt-mocha-cli": "~1.11.0",
|
"grunt-mocha-cli": "~1.11.0",
|
||||||
|
<<<<<<< HEAD
|
||||||
"grunt-sass": "~0.18.0",
|
"grunt-sass": "~0.18.0",
|
||||||
|
=======
|
||||||
|
>>>>>>> grunt init, dev
|
||||||
"grunt-shell": "~1.1.1",
|
"grunt-shell": "~1.1.1",
|
||||||
"grunt-update-submodules": "~0.4.1",
|
"grunt-update-submodules": "~0.4.1",
|
||||||
"matchdep": "~0.3.0",
|
"matchdep": "~0.3.0",
|
||||||
|
|
Loading…
Add table
Reference in a new issue