Switch to ghu and eslint.

This commit is contained in:
Lars Jung 2015-11-18 17:27:16 +01:00
parent 5d0770ca36
commit 0c6143704a
67 changed files with 192 additions and 307 deletions

5
.babelrc Normal file
View file

@ -0,0 +1,5 @@
{
"presets": [
"es2015"
]
}

View file

@ -12,7 +12,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
[{package.json,.travis.yml,.eslintrc}]
[{package.json,.travis.yml,.eslintrc,.babelrc}]
indent_size = 2

View file

@ -1,3 +1,3 @@
build/*
node_modules/*
**/vendor/*
**/build/**
**/node_modules/**
**/vendor/**

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
build
local
node_modules
npm-debug.log

2
ghu Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env sh
node -r babel-core/register ghu.js "$@"

158
ghu.js Normal file
View file

@ -0,0 +1,158 @@
import {resolve, join} from 'path';
import dateformat from 'dateformat';
import ghu from 'ghu';
import {
autoprefixer, babel, cssmin, ife, includeit, jade, jszip,
less, mapfn, newerThan, read, remove, run, uglify, watch, wrap, write
} from 'ghu';
const ROOT = resolve(__dirname);
const SRC = join(ROOT, 'src');
const BUILD = join(ROOT, 'build');
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.jade', '');
ghu.defaults('release');
ghu.before(runtime => {
runtime.pkg = Object.assign({}, require('./package.json'));
const res = run.sync(`git rev-list v${runtime.pkg.version}..HEAD`, {silent: true});
if (res.code === 0) {
const hashes = res.stdout.split(/\r?\n/).filter(x => x);
if (hashes.length) {
const counter = ('000' + hashes.length).substr(-3);
const hash = hashes[0].substr(0, 7);
const stamp = dateformat(Date.now(), 'yyyy-mm-dd-HH-MM-ss');
runtime.pkg.version += `+${counter}~${hash}~${stamp}`;
}
}
runtime.comment = `${runtime.pkg.name} v${runtime.pkg.version} - ${runtime.pkg.homepage}`;
runtime.commentJs = `/* ${runtime.comment} */\n`;
runtime.commentHtml = `<!-- ${runtime.comment} -->`;
console.log(runtime.comment);
});
ghu.task('force-production', 'ensure :production flag is set', runtime => {
if (!runtime.args.production) {
runtime.args.production = true;
console.log('forcing production mode');
}
});
ghu.task('clean', 'delete build folder', () => {
return remove(BUILD);
});
ghu.task('lint', 'lint all JavaScript files with eslint', () => {
return run('eslint .', {stdio: 'inherit'});
});
ghu.task('build:scripts', runtime => {
return read(`${SRC}/_h5ai/public/js/*.js`)
.then(newerThan(mapper, `${SRC}/_h5ai/public/js/**`))
.then(includeit())
// .then(babel({compact: false}))
.then(ife(() => runtime.args.production, uglify()))
.then(wrap(runtime.commentJs))
.then(write(mapper, {overwrite: true}));
});
ghu.task('build:styles', runtime => {
return read(`${SRC}/_h5ai/public/css/*.less`)
.then(newerThan(mapper, `${SRC}/_h5ai/public/css/**`))
.then(includeit())
.then(less())
.then(autoprefixer())
.then(ife(() => runtime.args.production, cssmin()))
.then(wrap(runtime.commentJs))
.then(write(mapper, {overwrite: true}));
});
ghu.task('build:pages', runtime => {
return read(`${SRC}: **/*.jade, ! **/*.tpl.jade`)
.then(newerThan(mapper, `${SRC}/**/*.tpl.jade`))
.then(jade({pkg: runtime.pkg}))
.then(wrap('', runtime.commentHtml))
.then(write(mapper, {overwrite: true}));
});
ghu.task('build:copy', runtime => {
const mapperRoot = mapfn.p(ROOT, join(BUILD, '_h5ai'));
return Promise.all([
read(`${SRC}/**/conf/*.json`)
.then(newerThan(mapper))
.then(wrap(runtime.commentJs))
.then(write(mapper, {overwrite: true, cluster: true})),
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.jade, ! **/conf/*.json`)
.then(newerThan(mapper))
.then(write(mapper, {overwrite: true, cluster: true})),
read(`${ROOT}/*.md`)
.then(newerThan(mapperRoot))
.then(write(mapperRoot, {overwrite: true, cluster: true}))
]);
});
ghu.task('build:tests', ['build:scripts', 'build:styles'], 'build the test suite', runtime => {
return Promise.all([
read(`${ROOT}/test/scripts.js`)
.then(newerThan(`${BUILD}/test/scripts.js`))
.then(includeit())
.then(write(`${BUILD}/test/scripts.js`, {overwrite: true})),
read(`${ROOT}/test/styles.less`)
.then(newerThan(`${BUILD}/test/styles.css`))
.then(includeit())
.then(less())
.then(autoprefixer())
.then(write(`${BUILD}/test/styles.css`, {overwrite: true})),
read(`${ROOT}/test/index.html.jade`)
.then(newerThan(`${BUILD}/test/index.html`))
.then(jade({pkg: runtime.pkg}))
.then(write(`${BUILD}/test/index.html`, {overwrite: true})),
read(`${BUILD}/_h5ai/public/js/scripts.js`)
.then(newerThan(`${BUILD}/test/h5ai-scripts.js`))
.then(write(`${BUILD}/test/h5ai-scripts.js`, {overwrite: true})),
read(`${BUILD}/_h5ai/public/css/styles.css`)
.then(newerThan(`${BUILD}/test/h5ai-styles.css`))
.then(write(`${BUILD}/test/h5ai-styles.css`, {overwrite: true}))
]).then(() => {
console.log(`browse to file://${BUILD}/test/index.html to run the test suite`);
});
});
ghu.task('build', ['build:scripts', 'build:styles', 'build:pages', 'build:copy', 'build:tests'],
'build all updated files, optionally use :production');
ghu.task('deploy', ['build'], 'deploy to a specified path with :dest=/some/path', runtime => {
if (typeof runtime.args.dest !== 'string') {
throw new Error('no destination path (e.g. :dest=/some/path)');
}
console.log(`deploy to ${runtime.args.dest}`);
const mapperDeploy = mapfn.p(BUILD, resolve(runtime.args.dest));
return read(`${BUILD}/_h5ai/**`)
.then(newerThan(mapperDeploy))
.then(write(mapperDeploy, {overwrite: true, cluster: true}));
});
ghu.task('watch', runtime => {
return watch([SRC], () => ghu.run(runtime.sequence.filter(x => x !== 'watch'), runtime.args, true));
});
ghu.task('release', ['force-production', 'clean', 'build'], 'create a zipball', runtime => {
const target = join(BUILD, `${runtime.pkg.name}-${runtime.pkg.version}.zip`);
return read(`${BUILD}/_h5ai/**`)
.then(jszip({dir: BUILD, level: 9}))
.then(write(target, {overwrite: true}));
});

View file

@ -1,243 +0,0 @@
import fq from 'fquery';
import dateformat from 'dateformat';
import {join, resolve} from 'path';
import webpack from 'webpack';
import {spawnSync} from 'child_process';
const loadPlugins = () => {
const pkg = require('./package.json');
const deps = [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {})];
const plugs = deps.filter(name => name.startsWith('fquery-'));
plugs.forEach(plug => fq.plugin(plug));
};
loadPlugins();
const root = resolve(__dirname);
const src = join(root, 'src');
const build = join(root, 'build');
function once(fn) {
let getter = () => {
const value = fn();
getter = () => value;
return value;
};
return () => getter();
}
function run(cmd, {info = true, stdout = true, stderr = true, liberal = false, local = true} = {}) {
const stdio = ['ignore', stdout ? 1 : 'pipe', stderr ? 2 : 'pipe'];
if (info) {
fq.report({type: 'info', method: 'run', message: cmd});
}
const precmd = local ? 'PATH=./node_modules/.bin:$PATH;' : '';
const res = spawnSync('sh', ['-c', precmd + cmd], {
cwd: root,
stdio,
encoding: 'utf-8'
});
if (res.status !== 0 && !liberal) {
fq.report({type: 'err', method: 'run', message: `${cmd} [${res.status}] ${String(res.error)}`});
}
return res;
}
const getStamp = once(() => {
const stamp = new Date();
stamp.human = dateformat(stamp, 'yyyy-mm-dd HH:MM:ss');
stamp.id = stamp.human.replace(/\D/g, '-');
stamp.sha1 = fq.getHash(stamp.id);
return stamp;
});
const getPackage = once(() => {
const pkg = require('./package.json');
const res = run(`git rev-list v${pkg.version}..HEAD`, {info: false, stdout: false, stderr: false, liberal: true});
if (res.status === 0) {
const hashes = fq._.compact(res.stdout.split(/\r?\n/));
if (hashes.length) {
pkg.version += `+${hashes.length}~${hashes[0].substr(0, 7)}`;
}
}
return pkg;
});
const getComment = once(() => {
const pkg = getPackage();
return `${pkg.name} v${pkg.version} - ${getStamp().human}`;
});
const getHeader = once(() => `/* ${getComment()} */\n`);
function formatWebpackStats(stats, len) {
const json = stats.toJson();
const align = (s, i) => ` ${s}`.substr(-i);
const cmp = (a, b) => a < b ? -1 : a > b ? 1 : 0;
const sortBy = (arr, selector = x => x) => Array.from(arr).sort((a, b) => cmp(selector(a), selector(b)));
let res = sortBy(json.modules, x => x.size);
if (len) {
res = 'stats\n' + res.slice(-len).map(r => {
return `${align(`[${r.id}]`, 7)}${align(r.size, 10)} ${r.name}`;
}).join('\n');
res += `\n\n${align(json.modules.length, 7)}${align(json.assets[0].size, 10)} ${json.assets[0].name}`;
} else {
res = `modules: ${json.modules.length}, bytes: ${json.assets[0].size}, bundle: ${json.assets[0].name}`;
}
return res;
}
module.exports = suite => {
suite.defaults('release');
suite.target('clean', [], 'delete build folder').task(() => {
fq(build, {dirs: true}).delete();
});
suite.target('lint', [], 'lint all JavaScript files with eslint').task(() => {
run(`eslint ${src}/_h5ai/public/js`);
});
suite.target('build:scripts').task(done => {
const mapSrc = fq.map.p(src, build);
const scriptsChanged = fq(`${src}: _h5ai/public/js/scripts.js`)
.newerThan(mapSrc, fq(`${src}: _h5ai/public/js/**`)).length > 0;
if (!scriptsChanged) {
done();
return;
}
const webpackConfig = {
context: src,
entry: './_h5ai/public/js/scripts.js',
output: {
path: build,
filename: '_h5ai/public/js/scripts.js'
},
module: {
loaders: [
{
include: [src],
loader: 'babel',
query: {
cacheDirectory: true
}
}
]
}
};
if (!suite.args.production) {
webpackConfig.output.pathinfo = true;
webpackConfig.devtool = '#inline-source-map';
}
webpack(webpackConfig, (err, stats) => {
if (err) {
fq.report({type: 'err', method: 'scripts', message: err});
}
// console.log(stats.toString({colors: true}));
fq.report({type: 'info', method: 'webpack', message: formatWebpackStats(stats, 10)});
fq(`${build}: _h5ai/public/js/scripts.js`)
.if(suite.args.production, function applyuglifyjs() {
this.uglifyjs(); // eslint-disable-line no-invalid-this
})
.wrap(getHeader())
.write(mapSrc, true);
done();
});
});
suite.target('build', [], 'build all updated files, optionally use :uncompressed (e.g. mkr -b build :uncompressed)').task(() => {
const env = {pkg: getPackage()};
const mapSrc = fq.map.p(src, build).s('.less', '.css').s('.jade', '');
const mapRoot = fq.map.p(root, join(build, '_h5ai'));
fq(`${src}: _h5ai/public/js/*.js`)
.newerThan(mapSrc, fq(`${src}: _h5ai/public/js/**`))
.includeit()
.if(!suite.args.uncompressed, function applyuglifyjs() {
this.uglifyjs(); // eslint-disable-line no-invalid-this
})
.wrap(getHeader())
.write(mapSrc, true);
fq(`${src}: _h5ai/public/css/*.less`)
.newerThan(mapSrc, fq(`${src}: _h5ai/public/css/**`))
.includeit()
.less()
.autoprefixer()
.if(!suite.args.uncompressed, function applycssmin() {
this.cssmin(); // eslint-disable-line no-invalid-this
})
.wrap(getHeader())
.write(mapSrc, true);
fq(`${src}: **/*.jade, ! **/*.tpl.jade`)
.newerThan(mapSrc)
.jade(env)
.write(mapSrc, true);
fq(`${src}: **, ! _h5ai/public/js/**, ! _h5ai/public/css/**, ! **/*.jade`)
.newerThan(mapSrc)
.handlebars(env)
.write(mapSrc, true);
fq(`${root}: *.md`)
.newerThan(mapRoot)
.write(mapRoot, true);
fq.report({type: 'info', message: getComment()});
});
suite.target('deploy', ['build'], 'deploy to a specified path (e.g. mkr -b deploy :dest=/some/path)').task(() => {
if (!fq._.isString(suite.args.dest)) {
fq.report({type: 'err', message: 'no destination path (e.g. mkr -b deploy :dest=/some/path)'});
}
const mapper = fq.map.p(build, resolve(suite.args.dest));
fq(`${build}: _h5ai/**`)
.newerThan(mapper)
.write(mapper, true);
});
// suite.target('release', ['clean', 'lint', 'build'], 'create a zipball').task(() => {
suite.target('release', ['clean', 'build'], 'create a zipball').task(() => {
const pkg = getPackage();
const target = join(build, `${pkg.name}-${pkg.version}.zip`);
fq(`${build}: **`)
.jszip({dir: build, level: 9})
.write(target, true);
});
suite.target('build-test', [], 'build a test suite').task(() => {
fq(`${src}/_h5ai/public/css/styles.less`)
.includeit()
.less()
.autoprefixer()
.write(`${build}/test/h5ai-styles.css`, true);
fq(`${src}/_h5ai/public/js/scripts.js`)
.includeit()
.write(`${build}/test/h5ai-scripts.js`, true);
fq(`${root}/test/styles.less`)
.includeit()
.less()
.autoprefixer()
.write(`${build}/test/styles.css`, true);
fq(`${root}/test/scripts.js`)
.includeit()
.write(`${build}/test/scripts.js`, true);
fq(`${root}/test/index.html.jade`)
.jade({pkg: getPackage()})
.write(`${build}/test/index.html`, true);
fq.report({type: 'info', message: `browse to file://${build}/test/index.html`});
});
};

View file

@ -12,29 +12,19 @@
"url": "https://github.com/lrsjng/h5ai.git"
},
"scripts": {
"build": "mkr -b release",
"build-test": "mkr -b build-test"
"lint": "eslint .",
"ghu": "node -r babel-core/register ghu.js",
"build": "npm run -s ghu release"
},
"devDependencies": {
"babel": "^5.8.23",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.3.2",
"dateformat": "^1.0.11",
"eslint": "^1.7.3",
"fquery": "^0.16.4",
"fquery-autoprefixer": "^0.3.0",
"fquery-cssmin": "^0.3.1",
"fquery-gethash": "^0.3.0",
"fquery-handlebars": "^0.3.0",
"fquery-includeit": "^0.3.0",
"fquery-jade": "^0.6.0",
"fquery-jszip": "^0.5.1",
"fquery-less": "^0.3.0",
"fquery-uglifyjs": "^0.3.0",
"mkr": "^0.10.0",
"webpack": "^1.12.2"
"babel-core": "6.1.2",
"babel-eslint": "4.1.3",
"babel-preset-es2015": "6.1.2",
"dateformat": "1.0.11",
"eslint": "1.7.3",
"ghu": "0.1.1"
},
"engines": {
"node": "4.x"
"node": ">=5.0.0"
}
}

View file

@ -1,10 +1,3 @@
/*
h5ai {{pkg.version}}
{{pkg.homepage}}
Options
*/
{
/*
Password hash.
@ -29,7 +22,7 @@ Options
"resources": {
"scripts": [],
"styles": [
"//fonts.googleapis.com/css?family=Ubuntu:300,400,700|Ubuntu+Mono:400,700"
"//fonts.googleapis.com/css?family=Ubuntu:300,400,700%7CUbuntu+Mono:400,700"
]
},

View file

@ -1,10 +1,3 @@
/*
h5ai {{pkg.version}}
{{pkg.homepage}}
File types mapped to file extensions
*/
{
"ar": ["*.tar.bz2", "*.crx"],
"ar-apk": ["*.apk"],

View file

@ -1,10 +1,8 @@
extends ./page.tpl.jade
block init
- var title = 'index - powered by h5ai v' + pkg.version + ' (' + pkg.homepage + ')'
- var module = 'index'
block body
div#fallback <?= $fallback_html; ?>

View file

@ -1,12 +1,10 @@
extends ./page.tpl.jade
block init
- var title = 'h5ai info page - v' + pkg.version
- var module = 'info'
block body
div#content
h1#header
a(href='#{pkg.homepage}') h5ai

View file

@ -1,4 +1,4 @@
/*! HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */
/* HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */
/*
* What follows is the result of much research on cross-browser styling.

View file

@ -1,4 +1,4 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/* normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font family to sans-serif.

View file

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<path fill="#ecd214" stroke="#ecd214" stroke-width="1" d="M 14.1875 4.6875 C 13.09018 4.6875104 12.199333 4.9405471 11.5625 5.46875 C 10.925664 5.9871904 10.624999 6.7055265 10.625 7.625 C 10.624999 8.0651846 10.696787 8.4682415 10.84375 8.78125 C 11.000508 9.0942712 11.192562 9.3375261 11.4375 9.5625 C 11.692232 9.7874849 11.989182 9.9997477 12.3125 10.15625 C 12.645612 10.302981 12.991037 10.435342 13.34375 10.5625 C 13.696455 10.679886 14.006917 10.810341 14.28125 10.9375 C 14.555575 11.054885 14.782593 11.165778 14.96875 11.3125 C 15.164694 11.449448 15.308271 11.605183 15.40625 11.78125 C 15.514016 11.957323 15.562494 12.16171 15.5625 12.40625 C 15.562494 12.817085 15.428715 13.150022 15.125 13.375 C 14.821273 13.599981 14.322474 13.718751 13.65625 13.71875 C 13.019412 13.718751 12.481931 13.646727 12.03125 13.5 C 11.580565 13.353276 11.23328 13.209228 10.96875 13.0625 L 10.40625 14.5625 C 10.52382 14.630973 10.679049 14.724461 10.875 14.8125 C 11.070949 14.890754 11.297967 14.952993 11.5625 15.03125 C 11.836828 15.109504 12.157087 15.169839 12.5 15.21875 C 12.852707 15.277443 13.234955 15.3125 13.65625 15.3125 C 14.910321 15.3125 15.853361 15.061368 16.5 14.5625 C 17.156424 14.053851 17.499993 13.325734 17.5 12.40625 C 17.499993 11.92695 17.418407 11.551332 17.28125 11.21875 C 17.144079 10.876394 16.952025 10.557047 16.6875 10.3125 C 16.432759 10.058181 16.132095 9.8635762 15.75 9.6875 C 15.377691 9.5016528 14.948821 9.3010768 14.46875 9.125 C 14.194416 9.0271889 13.922635 8.9201051 13.6875 8.8125 C 13.462155 8.7049074 13.270101 8.5959189 13.09375 8.46875 C 12.92719 8.3415943 12.785469 8.2190145 12.6875 8.0625 C 12.599319 7.896218 12.562497 7.693737 12.5625 7.46875 C 12.562497 7.0970525 12.694418 6.7991744 12.96875 6.59375 C 13.252873 6.3883426 13.656575 6.2812588 14.15625 6.28125 C 14.577537 6.2812588 14.983096 6.3396915 15.375 6.4375 C 15.776691 6.5353258 16.13563 6.6891556 16.46875 6.875 L 17.03125 5.375 C 16.747117 5.2087206 16.374665 5.0432042 15.875 4.90625 C 15.385121 4.7595342 14.82433 4.6875104 14.1875 4.6875 z M 6.9375 4.9375 L 6.9375 11.625 C 6.9374954 12.387977 6.8153722 12.936987 6.53125 13.25 C 6.2471196 13.563017 5.7832845 13.718751 5.15625 13.71875 C 4.7839439 13.718751 4.4250043 13.646727 4.0625 13.5 C 3.7097899 13.343494 3.4011857 13.166291 3.15625 13 L 2.5 14.46875 C 2.7547338 14.674167 3.1234709 14.876648 3.59375 15.0625 C 4.0738243 15.238567 4.6346149 15.3125 5.28125 15.3125 C 5.9768667 15.3125 6.5493124 15.217103 7 15.03125 C 7.460476 14.845398 7.829213 14.604047 8.09375 14.28125 C 8.3680731 13.958455 8.5484718 13.555398 8.65625 13.125 C 8.7640159 12.694607 8.8124936 12.248871 8.8125 11.75 L 8.8125 4.9375 L 6.9375 4.9375 z"/>
<path fill="#fbc02d" stroke="#fbc02d" stroke-width="1" d="M 14.1875 4.6875 C 13.09018 4.6875104 12.199333 4.9405471 11.5625 5.46875 C 10.925664 5.9871904 10.624999 6.7055265 10.625 7.625 C 10.624999 8.0651846 10.696787 8.4682415 10.84375 8.78125 C 11.000508 9.0942712 11.192562 9.3375261 11.4375 9.5625 C 11.692232 9.7874849 11.989182 9.9997477 12.3125 10.15625 C 12.645612 10.302981 12.991037 10.435342 13.34375 10.5625 C 13.696455 10.679886 14.006917 10.810341 14.28125 10.9375 C 14.555575 11.054885 14.782593 11.165778 14.96875 11.3125 C 15.164694 11.449448 15.308271 11.605183 15.40625 11.78125 C 15.514016 11.957323 15.562494 12.16171 15.5625 12.40625 C 15.562494 12.817085 15.428715 13.150022 15.125 13.375 C 14.821273 13.599981 14.322474 13.718751 13.65625 13.71875 C 13.019412 13.718751 12.481931 13.646727 12.03125 13.5 C 11.580565 13.353276 11.23328 13.209228 10.96875 13.0625 L 10.40625 14.5625 C 10.52382 14.630973 10.679049 14.724461 10.875 14.8125 C 11.070949 14.890754 11.297967 14.952993 11.5625 15.03125 C 11.836828 15.109504 12.157087 15.169839 12.5 15.21875 C 12.852707 15.277443 13.234955 15.3125 13.65625 15.3125 C 14.910321 15.3125 15.853361 15.061368 16.5 14.5625 C 17.156424 14.053851 17.499993 13.325734 17.5 12.40625 C 17.499993 11.92695 17.418407 11.551332 17.28125 11.21875 C 17.144079 10.876394 16.952025 10.557047 16.6875 10.3125 C 16.432759 10.058181 16.132095 9.8635762 15.75 9.6875 C 15.377691 9.5016528 14.948821 9.3010768 14.46875 9.125 C 14.194416 9.0271889 13.922635 8.9201051 13.6875 8.8125 C 13.462155 8.7049074 13.270101 8.5959189 13.09375 8.46875 C 12.92719 8.3415943 12.785469 8.2190145 12.6875 8.0625 C 12.599319 7.896218 12.562497 7.693737 12.5625 7.46875 C 12.562497 7.0970525 12.694418 6.7991744 12.96875 6.59375 C 13.252873 6.3883426 13.656575 6.2812588 14.15625 6.28125 C 14.577537 6.2812588 14.983096 6.3396915 15.375 6.4375 C 15.776691 6.5353258 16.13563 6.6891556 16.46875 6.875 L 17.03125 5.375 C 16.747117 5.2087206 16.374665 5.0432042 15.875 4.90625 C 15.385121 4.7595342 14.82433 4.6875104 14.1875 4.6875 z M 6.9375 4.9375 L 6.9375 11.625 C 6.9374954 12.387977 6.8153722 12.936987 6.53125 13.25 C 6.2471196 13.563017 5.7832845 13.718751 5.15625 13.71875 C 4.7839439 13.718751 4.4250043 13.646727 4.0625 13.5 C 3.7097899 13.343494 3.4011857 13.166291 3.15625 13 L 2.5 14.46875 C 2.7547338 14.674167 3.1234709 14.876648 3.59375 15.0625 C 4.0738243 15.238567 4.6346149 15.3125 5.28125 15.3125 C 5.9768667 15.3125 6.5493124 15.217103 7 15.03125 C 7.460476 14.845398 7.829213 14.604047 8.09375 14.28125 C 8.3680731 13.958455 8.5484718 13.555398 8.65625 13.125 C 8.7640159 12.694607 8.8124936 12.248871 8.8125 11.75 L 8.8125 4.9375 L 6.9375 4.9375 z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<g fill="#3f51b5" transform="matrix(0.02460339,0,0,0.02460339,1.0508613,-2.0358995)">
<g fill="#5c6bc0" transform="matrix(0.02460339,0,0,0.02460339,1.0508613,-2.0358995)">
<path d="m 635.0385,526.8108 c 35.909,12.563 53.856,34.088 53.856,64.543 0,20.046 -7.443,35.957 -22.296,47.725 -14.838,11.776 -36.005,19.084 -63.557,19.084 -27.552,0 -53.037,-7.983 -76.51,-21.088 0.254,-6.95 2.091,-14.575 5.463,-22.852 3.372,-8.277 7.363,-14.853 11.936,-19.656 21.573,11.211 40.346,16.826 56.281,16.826 7.531,0 13.358,-1.264 17.414,-3.809 4.063,-2.536 6.083,-5.94 6.083,-10.217 0,-8.039 -6.226,-14.051 -18.638,-18.058 l -22.296,-8.421 c -33.73,-12.293 -50.596,-32.323 -50.596,-60.146 0,-20.316 7.085,-36.418 21.255,-48.33 14.17,-11.895 33.269,-22.137 57.283,-22.137 11.88,0 24.96,1.67 39.272,5.01 14.297,3.348 26.042,11.594 35.218,16.125 0.541,7.49 -0.962,15.712 -4.452,24.665 -3.515,8.961 -7.824,15.306 -12.969,19.052 -22.685,-10.162 -41.562,-15.243 -56.686,-15.243 -5.415,0 -9.494,1.201 -12.357,3.618 -2.831,2.41 -4.223,5.478 -4.223,9.224 0,6.417 5.121,11.49 15.386,15.235 l 25.133,8.85 z"/>
<path d="m 455.6835,526.8108 c 35.909,12.563 53.848,34.088 53.848,64.543 0,20.046 -7.443,35.957 -22.272,47.725 -14.853,11.776 -36.028,19.084 -63.572,19.084 -27.528,0 -53.045,-7.983 -76.51,-21.088 0.254,-6.95 2.091,-14.575 5.47,-22.852 3.372,-8.277 7.347,-14.853 11.936,-19.656 21.597,11.211 40.362,16.826 56.289,16.826 7.538,0 13.366,-1.264 17.406,-3.809 4.048,-2.536 6.083,-5.94 6.083,-10.217 0,-8.039 -6.226,-14.051 -18.638,-18.058 l -22.281,-8.421 c -33.738,-12.293 -50.611,-32.323 -50.611,-60.146 0,-20.316 7.085,-36.418 21.27,-48.33 14.162,-11.895 33.253,-22.137 57.267,-22.137 11.872,0 24.984,1.67 39.265,5.01 14.313,3.348 26.042,11.594 35.225,16.125 0.541,7.49 -0.962,15.712 -4.452,24.665 -3.507,8.961 -7.824,15.306 -12.961,19.052 -22.694,-10.162 -41.571,-15.243 -56.702,-15.243 -5.407,0 -9.502,1.201 -12.349,3.618 -2.823,2.41 -4.23,5.478 -4.23,9.224 0,6.417 5.128,11.49 15.394,15.235 l 25.125,8.85 z"/>
<path d="m 324.8885,529.6408 c 0,-12.293 -1.956,-23.656 -5.868,-34.089 -3.904,-10.432 -9.51,-19.378 -16.794,-26.868 -7.292,-7.49 -16.126,-13.367 -26.511,-17.645 -10.401,-4.27 -22.074,-10.711 -35.027,-10.711 -15.387,0 -28.816,6.966 -40.282,12.317 -11.466,5.344 -20.913,12.691 -28.332,22.05 -7.435,9.366 -12.969,20.388 -16.611,33.086 -3.642,12.699 -5.463,26.534 -5.463,41.499 0,15.49 1.479,29.818 4.453,42.914 2.966,13.08 8.03,24.435 15.18,34.073 7.156,9.621 16.467,17.104 27.941,22.439 11.474,5.344 25.715,9.447 42.716,9.447 31.305,0 57.752,-9.065 79.348,-24.292 -2.139,-15.49 -7.657,-27.807 -16.523,-36.896 -11.029,4.142 -20.786,7.108 -29.246,8.93 -8.468,1.798 -15.935,2.704 -22.383,2.704 -12.906,0 -22.193,-3.284 -27.83,-9.915 -5.631,-6.608 -8.72,-14.424 -9.267,-26.296 h 105.265 c 3.477,-11.243 5.234,-26.438 5.234,-42.747 z m -110.9,2.776 c 0.802,-13.645 3.292,-28.244 7.435,-34.255 4.151,-6.019 10.504,-9.025 19.083,-9.025 8.835,0 15.466,3.197 19.879,9.614 4.422,6.417 6.631,19.346 6.631,29.237 l 0.008,4.429 h -53.036 l 0,0 z"/>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
<path fill="#a2607a" d="M12.078 10h2.3V6.007h2.32V10H19l-3.46 3.993zM1 13.993V6.007h2.32l2.355 2.917L8.03 6.007h2.32v7.986H8.03V9.398l-2.355 2.887L3.32 9.398v4.595z"/>
<path fill="#ad1457" d="M12.078 10h2.3V6.007h2.32V10H19l-3.46 3.993zM1 13.993V6.007h2.32l2.355 2.917L8.03 6.007h2.32v7.986H8.03V9.398l-2.355 2.887L3.32 9.398v4.595z"/>
</svg>

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

View file

@ -4,7 +4,7 @@ modulejs.define('view/topbar', ['$', 'view/root'], function ($, root) {
'<div id="topbar">' +
'<div id="toolbar"/>' +
'<div id="flowbar"/>' +
'<a id="backlink" href="http://larsjung.de/h5ai/" title="powered by h5ai - http://larsjung.de/h5ai/">' +
'<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/">' +
'<div>powered</div>' +
'<div>by h5ai</div>' +
'</a>' +

View file

@ -25,7 +25,7 @@
modulejs.define('marked', function () { return win.marked; });
modulejs.define('prism', function () { return win.Prism; });
// @include 'inc/**/*.js'
// @include 'lib/**/*.js'
modulejs.require('boot');
}());

View file

@ -25,7 +25,7 @@ $(function () {
describe('integration tests', function () {
// @include "tests/integration/*.js"
// @include "tests/integration/*/*.js"
// @-include "tests/integration/*/*.js"
});
});

View file

@ -40,6 +40,7 @@
font-weight: bold;
line-height: 32px;
padding: 0 8px;
text-shadow: 0 0 4px @col-text;
&.pass {
background: @col-pass;

View file

@ -97,13 +97,13 @@ describe('module \'' + ID + '\'', function () {
it('#backlink has correct href', function () {
this.applyFn();
assert.strictEqual($('#backlink').attr('href'), 'http://larsjung.de/h5ai/');
assert.strictEqual($('#backlink').attr('href'), 'https://larsjung.de/h5ai/');
});
it('#backlink has correct title', function () {
this.applyFn();
assert.strictEqual($('#backlink').attr('title'), 'powered by h5ai - http://larsjung.de/h5ai/');
assert.strictEqual($('#backlink').attr('title'), 'powered by h5ai - https://larsjung.de/h5ai/');
});
it('#backlink has correct text', function () {

View file

@ -14,7 +14,6 @@ var $mochaProgress = $mochaBar.find('.progress');
function toggleFailureFilter(ev) {
ev.stopImmediatePropagation();
showOnlyFailures = !showOnlyFailures;
@ -27,8 +26,6 @@ function toggleFailureFilter(ev) {
}
function addSuiteStats() {
/*jshint validthis: true */
var $suite = $(this);
var tests = $suite.find('.test').length;
@ -65,16 +62,12 @@ function addSuiteStats() {
}
function fixCodeFormatting() {
/*jshint validthis: true */
var $code = $(this);
$code.text($code.text().trim().replace(/;\n\s*/g, ';\n'));
}
function onEnd() {
/*jshint validthis: true */
var runner = this;
var failed = runner.stats.failures > 0;
var stats = (runner.stats.duration / 1000.0).toFixed(3) + 's';
@ -91,8 +84,6 @@ function onEnd() {
}
function onTest() {
/*jshint validthis: true */
var runner = this;
var percent = 100.0 * runner.stats.tests / runner.total;
var stats = ((new Date().getTime() - runner.stats.start) / 1000.0).toFixed(3) + 's';
@ -105,14 +96,12 @@ function onTest() {
}
function setupMocha() {
window.assert = chai.assert;
mocha.setup('bdd');
$(function () { $mochaBar.appendTo('#mocha'); });
}
function runMocha() {
mocha.run().on('test', onTest).on('end', onEnd);
}