While we'll likely put gulp or like back in, drop it

This was put in place a long while ago and lacks the usage documentaiton
for use with this repo.  For now, I will remove it from the repo.

We obviously need to bring this or something similar back.  But there's
no reason to keep this when it is not being used.
This commit is contained in:
Sachi King 2017-04-25 01:18:43 +10:00
parent 10cc96b726
commit b18c102982
16 changed files with 0 additions and 520 deletions

View file

@ -1,88 +0,0 @@
const templatePath = 'pinaxcon/templates/';
const staticRoot = 'static/';
const staticSource = staticRoot + 'src/';
const staticBuild = staticRoot + '_build/';
const staticDist = staticRoot + 'dist/';
const npmRoot = 'node_modules/';
exports = module.exports = {
staticUrlRoot: '/site_media/static',
paths: {
source: staticSource,
build: staticBuild,
dist: staticDist
},
watch: {
styles: [
staticSource + 'less/**/*.less'
],
scripts: [
staticSource + 'js/**/*.js'
]
},
templates: {
destination: templatePath,
manifestPath: staticBuild + 'manifest.json',
scriptsTemplate: staticSource + 'hbs/_scripts.hbs',
stylesTemplate: staticSource + 'hbs/_styles.hbs',
},
fonts: {
sources: [
npmRoot + 'font-awesome/fonts/**.*',
npmRoot + 'bootstrap/fonts/**.*',
],
dist: staticDist + 'fonts/'
},
styles: {
source: staticSource + 'less/site.less',
dist: staticBuild + 'css/',
npmPaths: [
npmRoot + 'bootstrap/less',
npmRoot + 'font-awesome/less',
npmRoot
]
},
scripts: {
main: staticSource + 'js/site.js',
source: [
staticSource + 'js/**/*'
],
dist: staticBuild + 'js/'
},
images: {
sources: [
staticSource + 'images/**.*'
],
dist: staticDist + 'images/'
},
manifest: {
source: [
staticBuild + '**/*.css',
staticBuild + '**/*.js'
]
},
test: {
all: 'test/**/*.test.js',
req: 'test/req/*.test.js',
components: 'test/components/*.test.js'
},
xo: {
source: [
'tasks/**/*.js',
staticSource + '**/*.js'
]
},
optimize: {
css: {
source: staticDist + 'css/*.css',
options: {},
dist: staticDist + 'css/'
},
js: {
source: staticDist + 'js/*.js',
options: {},
dist: staticDist + 'js/'
}
}
};

View file

@ -1,17 +0,0 @@
/**
* Dependencies
*/
const path = require('path');
const browserify = require('browserify');
const babelify = require('babelify');
const source = require('vinyl-source-stream');
/**
* Module body / Expose
*/
module.exports = (entry, config) => {
config = config || {};
const built = browserify(entry)
.transform(babelify);
return built.bundle().pipe(source(path.basename(entry)));
};

View file

@ -1,12 +0,0 @@
/**
* Dependencies
*/
const del = require('del');
/**
* Module body / Expose
*/
module.exports = (entry, config) => {
config = config || {};
return del(entry, config);
};

View file

@ -1,12 +0,0 @@
/**
* Dependencies
*/
const cleanup = require('gulp-cleanup');
/**
* Module body / Expose
*/
module.exports = config => {
config = config || {};
return cleanup();
};

View file

@ -1,12 +0,0 @@
/**
* Dependencies
*/
const gulp = require('gulp');
/**
* Module body
*/
module.exports = (entry, config) => {
config = config || {};
return gulp.src(entry, config);
};

View file

@ -1,19 +0,0 @@
/**
* Dependencies
*/
const gulp = require('gulp');
const less = require('gulp-less');
const prefix = require('gulp-autoprefixer');
/**
* Module body
*/
module.exports = (entry, config) => {
config = config || {};
config.less = config.less || {};
config.autoprefixer = config.autoprefixer || {};
return gulp.src(entry)
.pipe(less(config.less))
.pipe(prefix(config.autoprefixer));
};

View file

@ -1,26 +0,0 @@
/**
* Dependencies
*/
const fs = require('fs');
const gulp = require('gulp');
const handlebars = require('gulp-compile-handlebars');
const path = require('path');
const rename = require('gulp-rename');
/**
* Module body / Expose
*/
module.exports = (manifestPath, scriptSourceTemplate, staticRoot) => {
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
const handlebarOpts = {
helpers: {
assetPath: (path, context) => {
return [staticRoot, context.data.root[path]].join('/');
}
}
};
const outputFile = path.basename(scriptSourceTemplate).replace('.hbs', '.html');
return gulp.src(scriptSourceTemplate)
.pipe(handlebars(manifest, handlebarOpts))
.pipe(rename(outputFile));
};

View file

@ -1,36 +0,0 @@
/**
* Dependencies
*/
const path = require('path');
const modules = {};
/**
* Module body
*/
const load = function load(name) {
return require(path.resolve(__dirname, name));
};
const tasks = [
'clean',
'css',
'browserify',
'test',
'xo',
'rev',
'manifest',
'cleanup',
'copy',
'handlebars',
'optimizejs',
'optimizecss'
];
tasks.forEach(task => {
modules[task] = load(task);
});
/**
* Expose
*/
exports = module.exports = modules;

View file

@ -1,13 +0,0 @@
/**
* Dependencies
*/
const rev = require('gulp-rev');
/**
* Module body / Expose
*/
module.exports = config => {
config = config || {};
config.path = config.path || 'manifest.json';
return rev.manifest(config);
};

View file

@ -1,11 +0,0 @@
const gulp = require('gulp');
const nano = require('gulp-cssnano');
const size = require('gulp-size');
module.exports = (source, options, dist) => {
return gulp.src(source)
.pipe(nano(options))
.pipe(gulp.dest(dist))
.pipe(size());
};

View file

@ -1,11 +0,0 @@
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const size = require('gulp-size');
module.exports = (source, options, dist) => {
return gulp.src(source)
.pipe(uglify(options))
.pipe(gulp.dest(dist))
.pipe(size());
};

View file

@ -1,14 +0,0 @@
/**
* Dependencies
*/
const gulp = require('gulp');
const rev = require('gulp-rev');
/**
* Module body / Expose
*/
module.exports = (entry, config) => {
config = config || {};
return gulp.src(entry)
.pipe(rev());
};

View file

@ -1,18 +0,0 @@
/**
* Dependencies
*/
const gulp = require('gulp');
const mocha = require('gulp-mocha');
/**
* Module body / Expose
*/
module.exports = (entry, config) => {
config = config || {};
return gulp.src(entry, config)
.pipe(mocha({
require: [
'babel-register'
]
}));
};

View file

@ -1,14 +0,0 @@
/**
* Dependencies
*/
const gulp = require('gulp');
const xo = require('gulp-xo');
/**
* Module body / Expose
*/
module.exports = (entry, config) => {
config = config || {};
return gulp.src(entry)
.pipe(xo());
};

View file

@ -1,116 +0,0 @@
/**
* Setup
*/
process.title = process.title || 'gulp';
/**
* Dependencies
*/
const path = require('path');
const gulp = require('gulp');
/**
* Setup
*/
const tasks = require(path.resolve(__dirname, 'gulp/tasks'));
const config = require(path.resolve(__dirname, 'gulp/config'));
/**
* Tasks
*/
gulp.task('build:clean', function buildClean() {
tasks.clean(config.paths.build);
return tasks.clean(config.paths.dist);
});
gulp.task('build:styles', function buildStyles() {
return tasks.css(config.styles.source, {less: {paths: config.styles.npmPaths}})
.pipe(gulp.dest(config.styles.dist));
});
gulp.task('build:js', function buildJS() {
return tasks.browserify(config.scripts.main)
.pipe(gulp.dest(config.scripts.dist));
});
gulp.task('manifest', function manifest() {
return tasks.rev(config.manifest.source)
.pipe(gulp.dest(config.paths.dist))
.pipe(tasks.manifest())
.pipe(gulp.dest(config.paths.build));
});
gulp.task('build:copy-icons', function() {
return tasks.copy(config.fonts.sources)
.pipe(gulp.dest(config.fonts.dist));
});
gulp.task('build:copy-images', function() {
return tasks.copy(config.images.sources).pipe(gulp.dest(config.images.dist));
});
gulp.task('build:script-include', function () {
return tasks.handlebars(config.templates.manifestPath, config.templates.scriptsTemplate, config.staticUrlRoot)
.pipe(gulp.dest(config.templates.destination));
});
gulp.task('build:style-include', function () {
return tasks.handlebars(config.templates.manifestPath, config.templates.stylesTemplate, config.staticUrlRoot)
.pipe(gulp.dest(config.templates.destination));
});
gulp.task('test', function test() {
return tasks.test(config.test.all);
});
gulp.task('test:req', function testReq() {
return tasks.test(config.test.req);
});
gulp.task('test:components', function testComponents() {
return tasks.test(config.test.components);
});
gulp.task('xo', function xo() {
return tasks.xo(config.xo.source);
});
gulp.task('optimize:js', function () {
return tasks.optimizejs(config.optimize.js.source, config.optimize.js.options, config.optimize.js.dist);
});
gulp.task('optimize:css', function () {
return tasks.optimizecss(config.optimize.css.source, config.optimize.css.options, config.optimize.css.dist);
});
/**
* Compound Tasks
*/
gulp.task('watch', function watch() {
gulp.watch(config.watch.styles, gulp.series(['build:styles', 'manifest', 'build:style-include']));
gulp.watch(config.watch.scripts, gulp.series(['build:js', 'manifest', 'build:script-include']));
});
gulp.task('build', gulp.series([
'xo',
'build:clean',
gulp.parallel([
'build:styles',
'build:js',
'build:copy-icons',
'build:copy-images'
]),
'manifest',
'build:script-include',
'build:style-include'
]));
gulp.task('default', gulp.series([
'build',
'watch'
]));
gulp.task('release', gulp.series([
'build',
'optimize:js',
'optimize:css'
]));

View file

@ -1,101 +0,0 @@
{
"repository": {
"type": "git",
"url": "https://github.com/pinax/PinaxCon"
},
"scripts": {
"build": "NODE_PATH=. ./node_modules/.bin/gulp release",
"watch": "NODE_PATH=. ./node_modules/.bin/gulp",
"lint": "NODE_PATH=. ./node_modules/.bin/gulp xo",
"test": "./node_modules/.bin/gulp test"
},
"license": "",
"dependencies": {
"bootstrap": "^3.3.6",
"font-awesome": "^4.5.0",
"jquery": "^2.1.4"
},
"babel": {
"presets": [
"stage-1"
],
"plugins": [
"check-es2015-constants",
"transform-es2015-arrow-functions",
"transform-es2015-block-scoped-functions",
"transform-es2015-block-scoping",
"transform-es2015-classes",
"transform-es2015-computed-properties",
"transform-es2015-destructuring",
"transform-es2015-for-of",
"transform-es2015-function-name",
"transform-es2015-literals",
"transform-es2015-modules-commonjs",
"transform-es2015-object-super",
"transform-es2015-parameters",
"transform-es2015-shorthand-properties",
"transform-es2015-spread",
"transform-es2015-sticky-regex",
"transform-es2015-template-literals",
"transform-es2015-typeof-symbol",
"transform-es2015-unicode-regex"
],
"ignore": [
"node_modules/",
"dist/"
]
},
"xo": {
"esnext": true,
"rules": {
"indent": 0,
"no-multi-spaces": 0,
"no-trailing-spaces": 0,
"brace-style": 0,
"babel/object-curly-spacing": 0
}
},
"devDependencies": {
"babel-plugin-check-es2015-constants": "^6.3.13",
"babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
"babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13",
"babel-plugin-transform-es2015-block-scoping": "^6.3.13",
"babel-plugin-transform-es2015-classes": "^6.3.15",
"babel-plugin-transform-es2015-computed-properties": "^6.3.13",
"babel-plugin-transform-es2015-destructuring": "^6.3.15",
"babel-plugin-transform-es2015-for-of": "^6.3.13",
"babel-plugin-transform-es2015-function-name": "^6.3.21",
"babel-plugin-transform-es2015-literals": "^6.3.13",
"babel-plugin-transform-es2015-modules-commonjs": "^6.3.16",
"babel-plugin-transform-es2015-object-super": "^6.3.13",
"babel-plugin-transform-es2015-parameters": "^6.3.26",
"babel-plugin-transform-es2015-shorthand-properties": "^6.3.13",
"babel-plugin-transform-es2015-spread": "^6.3.14",
"babel-plugin-transform-es2015-sticky-regex": "^6.3.13",
"babel-plugin-transform-es2015-template-literals": "^6.3.13",
"babel-plugin-transform-es2015-typeof-symbol": "^6.3.13",
"babel-plugin-transform-es2015-unicode-regex": "^6.3.13",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-1": "^6.3.13",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"browserify-hmr": "^0.3.1",
"del": "^2.2.0",
"fs": "0.0.2",
"gulp": "gulpjs/gulp#4.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-cleanup": "^1.0.0",
"gulp-compile-handlebars": "^0.6.1",
"gulp-cssnano": "^2.0.0",
"gulp-less": "^3.0.5",
"gulp-mocha": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-rev": "^6.0.1",
"gulp-size": "^2.0.0",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.7",
"gulp-xo": "^0.7.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.6.1"
}
}