Skip to content

Commit

Permalink
Release 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmartineau committed Aug 23, 2016
1 parent 1e61ee5 commit 0c534c6
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 5,390 deletions.
15 changes: 6 additions & 9 deletions .kickoff/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ const config = require('../shared/config');
const path = require('path');
const webpack = require('webpack');

const entryPoints = {};
entryPoints[config.js.distFile] = [`${config.js.srcDir}/${config.js.srcFile}`];

let webpackConfig = {
entry: entryPoints,
entry: config.js.entryPoints,
output: {
path: `${config.js.distDir}`,
publicPath: `${config.js.distDir}`,
filename: '[name]',
publicPath: `${config.js.distDir}/`,
filename: '[name].js',
},
devServer: {
inline: true,
Expand All @@ -23,9 +20,9 @@ let webpackConfig = {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
},
],
},
Expand Down
21 changes: 20 additions & 1 deletion .kickoff/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Global Gulp vars
* Many of the Gulp tasks use these vars. Change as much as you like :)
*/
var pkg = require('../../package.json');


const ConfigOptions = function() {
const config = this;
Expand All @@ -28,9 +30,16 @@ const ConfigOptions = function() {

// Javascript-related vars
config.js = {
srcDir: `${config.srcDir}/js`, // config.js.srcFile
srcDir: `${config.srcDir}/js`, // config.js.srcDir
srcFile: 'script.js', // config.js.srcFile

entryPoints: {
kickoff: `${this.srcDir}/js/script.js`,

// Create more entry-points by adding to this array, e.g.
// foo: `${this.srcDir}/js/bar.js`,
},

distDir: `${config.distDir}/js`, // config.js.distDir
distFile: 'kickoff.js', // config.js.distFile
// Renaming this changes the name of the generated JS file
Expand All @@ -50,6 +59,16 @@ const ConfigOptions = function() {
srcDir: `${config.srcDir}/icons`, // config.icons.srcDir
distDir: `${config.distDir}/img`, // config.icons.distDir
};


// Banners and info
config.misc = {
banner: `/**
* <%= pkg.title %> <%= pkg.version %>
* <%= pkg.homepage %>
*/
`
}
};

module.exports = new ConfigOptions();
34 changes: 13 additions & 21 deletions .kickoff/tasks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const postcss = require('gulp-postcss');
const sass = require('gulp-sass');
const stylelint = require('gulp-stylelint');
const gulpIf = require('gulp-if');
const banner = require('gulp-banner');
var pkg = require('../../package.json');


// PostCSS plugins
const reporter = require('postcss-reporter');
Expand All @@ -25,8 +28,7 @@ gulp.task('css', () => {

return gulp.src([`${config.css.scssDir}/*.scss`])
.pipe(
gulpIf(
process.env.TEST,
gulpIf(process.env.TEST,
stylelint({
reporters: [
{
Expand All @@ -40,8 +42,7 @@ gulp.task('css', () => {


.pipe(
gulpIf(
process.env.TEST,
gulpIf(process.env.TEST,
postcss([
bemLinter(),
doiuse({
Expand All @@ -51,20 +52,14 @@ gulp.task('css', () => {
'node_modules/**'
]
}),
reporter({
clearMessages: true,
})
reporter({ clearMessages: true })
],
{
syntax: scss
})
{ syntax: scss })
)
)

// Init sourcemaps
.pipe(
gulpIf(!process.env.RELEASE, sourcemaps.init())
)
.pipe( gulpIf(!process.env.RELEASE, sourcemaps.init()) )

// Sass Compilation
.pipe(
Expand All @@ -83,22 +78,19 @@ gulp.task('css', () => {

// Compress CSS
.pipe(
gulpIf(
process.env.RELEASE === 'true',
gulpIf(process.env.RELEASE === 'true',
postcss([
cssnano()
])
)
)

.pipe(banner(config.misc.banner, { pkg: pkg }))

// Write sourcemaps
.pipe(
gulpIf(!process.env.RELEASE, sourcemaps.write())
)
.pipe( gulpIf(!process.env.RELEASE, sourcemaps.write()) )

// Write file
.pipe(
gulp.dest(`${config.css.distDir}`)
);
.pipe( gulp.dest(`${config.css.distDir}`) );
});

2 changes: 0 additions & 2 deletions .kickoff/tasks/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const cache = require('gulp-cached');


gulp.task('images', () => {
// process.env.RELEASE = false;

return gulp.src([`${config.img.srcDir}/**/*`])
.pipe(
imagemin()
Expand Down
6 changes: 3 additions & 3 deletions .kickoff/tasks/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const webpackConfig = require('../config/webpack.config.js');

gulp.task('javascript', () => {
// additional webpack config options
const myConfig = Object.create(webpackConfig);
const myConfig = webpackConfig;

// generate source maps for css and js
myConfig.devtool = 'source-map';
// myConfig.devtool = 'source-map';

// myConfig.output.publicPath = './';

Expand All @@ -27,7 +27,7 @@ gulp.task('javascript', () => {
);

// run webpack
webpack(myConfig, (err) => {
return webpack(myConfig, (err) => {
if (err) throw new gutil.PluginError('compile', err);
});
});
7 changes: 1 addition & 6 deletions .kickoff/tasks/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ const gulp = require('gulp');
const runSequence = require('run-sequence');


gulp.task('watcher', () => {

runSequence(
'compile'
);

gulp.task('watcher', ['compile'], () => {
gulp.watch([`${config.css.scssDir}/**/*.scss`], ['css']);
gulp.watch([`${config.icons.srcDir}/**/*`], ['icons']);
gulp.watch([`${config.img.srcDir}/**/*`], ['images']);
Expand Down
Empty file removed assets/dist/css/.gitkeep
Empty file.
Loading

0 comments on commit 0c534c6

Please sign in to comment.