mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-23 11:37:03 -04:00
Switch file names from jade to pug.
This commit is contained in:
parent
3a2e61b163
commit
f0a9937dc6
8 changed files with 57 additions and 7 deletions
|
@ -16,7 +16,7 @@ trim_trailing_whitespace = true
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
|
||||||
[{*.md,*.jade}]
|
[{*.md,*.jade,*.pug}]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
|
||||||
|
|
8
ghu.js
8
ghu.js
|
@ -9,7 +9,7 @@ const SRC = join(ROOT, 'src');
|
||||||
const TEST = join(ROOT, 'test');
|
const TEST = join(ROOT, 'test');
|
||||||
const BUILD = join(ROOT, 'build');
|
const BUILD = join(ROOT, 'build');
|
||||||
|
|
||||||
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.jade', '');
|
const mapper = mapfn.p(SRC, BUILD).s('.less', '.css').s('.pug', '');
|
||||||
|
|
||||||
ghu.defaults('release');
|
ghu.defaults('release');
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ ghu.task('build:styles', runtime => {
|
||||||
});
|
});
|
||||||
|
|
||||||
ghu.task('build:pages', runtime => {
|
ghu.task('build:pages', runtime => {
|
||||||
return read(`${SRC}: **/*.jade, ! **/*.tpl.jade`)
|
return read(`${SRC}: **/*.pug, ! **/*.tpl.pug`)
|
||||||
.then(newerThan(mapper, `${SRC}/**/*.tpl.jade`))
|
.then(newerThan(mapper, `${SRC}/**/*.tpl.pug`))
|
||||||
.then(pug({pkg: runtime.pkg}))
|
.then(pug({pkg: runtime.pkg}))
|
||||||
.then(wrap('', runtime.commentHtml))
|
.then(wrap('', runtime.commentHtml))
|
||||||
.then(write(mapper, {overwrite: true}));
|
.then(write(mapper, {overwrite: true}));
|
||||||
|
@ -104,7 +104,7 @@ ghu.task('build:copy', runtime => {
|
||||||
.then(wrap(runtime.commentJs))
|
.then(wrap(runtime.commentJs))
|
||||||
.then(write(mapper, {overwrite: true, cluster: true})),
|
.then(write(mapper, {overwrite: true, cluster: true})),
|
||||||
|
|
||||||
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.jade, ! **/conf/*.json`)
|
read(`${SRC}: **, ! **/*.js, ! **/*.less, ! **/*.pug, ! **/conf/*.json`)
|
||||||
.then(newerThan(mapper))
|
.then(newerThan(mapper))
|
||||||
.then(each(obj => {
|
.then(each(obj => {
|
||||||
if (/index\.php$/.test(obj.source)) {
|
if (/index\.php$/.test(obj.source)) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
extends ./page.tpl.jade
|
extends ./page.tpl.pug
|
||||||
|
|
||||||
block init
|
block init
|
||||||
- var title = 'index - powered by h5ai v' + pkg.version + ' (' + pkg.homepage + ')'
|
- var title = 'index - powered by h5ai v' + pkg.version + ' (' + pkg.homepage + ')'
|
|
@ -1,4 +1,4 @@
|
||||||
extends ./page.tpl.jade
|
extends ./page.tpl.pug
|
||||||
|
|
||||||
block init
|
block init
|
||||||
- var title = 'h5ai info page - v' + pkg.version
|
- var title = 'h5ai info page - v' + pkg.version
|
|
@ -2,6 +2,8 @@ const {test} = require('scar');
|
||||||
const {pinHtml} = require('./util/pin');
|
const {pinHtml} = require('./util/pin');
|
||||||
|
|
||||||
require('./tests/premisses');
|
require('./tests/premisses');
|
||||||
|
require('./tests/unit/core/event');
|
||||||
|
require('./tests/unit/core/format');
|
||||||
|
|
||||||
pinHtml();
|
pinHtml();
|
||||||
|
|
||||||
|
|
22
test/tests/unit/core/event.js
Normal file
22
test/tests/unit/core/event.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
const {test, assert} = require('scar');
|
||||||
|
const event = require('../../../../src/_h5ai/public/js/lib/core/event');
|
||||||
|
|
||||||
|
test('event is object', () => {
|
||||||
|
assert.equal(typeof event, 'object');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('event has the right props', () => {
|
||||||
|
assert.deepEqual(Object.keys(event), ['sub', 'unsub', 'pub']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('event.sub is function', () => {
|
||||||
|
assert.equal(typeof event.sub, 'function');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('event.unsub is function', () => {
|
||||||
|
assert.equal(typeof event.unsub, 'function');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('event.pub is function', () => {
|
||||||
|
assert.equal(typeof event.pub, 'function');
|
||||||
|
});
|
26
test/tests/unit/core/format.js
Normal file
26
test/tests/unit/core/format.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
const {test, assert} = require('scar');
|
||||||
|
const format = require('../../../../src/_h5ai/public/js/lib/core/format');
|
||||||
|
|
||||||
|
test('format is object', () => {
|
||||||
|
assert.equal(typeof format, 'object');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('format has the right props', () => {
|
||||||
|
assert.deepEqual(Object.keys(format), ['setDefaultMetric', 'formatSize', 'setDefaultDateFormat', 'formatDate']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('format.setDefaultMetric is function', () => {
|
||||||
|
assert.equal(typeof format.setDefaultMetric, 'function');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('format.formatSize is function', () => {
|
||||||
|
assert.equal(typeof format.formatSize, 'function');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('format.setDefaultDateFormat is function', () => {
|
||||||
|
assert.equal(typeof format.setDefaultDateFormat, 'function');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('format.formatDate is function', () => {
|
||||||
|
assert.equal(typeof format.formatDate, 'function');
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue