generator-white-label 3.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -81
- package/app/README.md +19 -0
- package/app/assets/font/opensans/stylesheet.css +20 -60
- package/app/assets/image/demo/fallback.avif +0 -0
- package/app/assets/image/demo/fallback.jpg +0 -0
- package/app/assets/image/demo/fallback.webp +0 -0
- package/app/assets/image/demo/large.avif +0 -0
- package/app/assets/image/demo/large.webp +0 -0
- package/app/assets/image/demo/small.avif +0 -0
- package/app/assets/image/demo/small.webp +0 -0
- package/app/assets/markup/element/iframe.hbs +4 -1
- package/app/assets/markup/element/img.hbs +16 -1
- package/app/assets/markup/element/picture.hbs +30 -0
- package/app/assets/markup/modal/modal-example-1.handlebars +1 -1
- package/app/assets/script/api/{facebook.js → facebook.ts} +17 -12
- package/app/assets/script/api/youtube.ts +22 -0
- package/app/assets/script/index.ts +2 -0
- package/app/assets/script/mediator/global.ts +4 -0
- package/app/assets/script/model/singletons/countries.ts +5 -0
- package/app/assets/script/model/singletons/global.ts +5 -0
- package/app/assets/script/model/singletons/states.ts +5 -0
- package/app/assets/script/model/user.ts +4 -0
- package/app/assets/script/toolkit.ts +11 -0
- package/app/assets/script/types.d.ts +16 -0
- package/app/assets/script/utility/ajax.ts +15 -0
- package/app/assets/script/utility/form.ts +119 -0
- package/app/assets/script/utility/{regex.js → regex.ts} +15 -6
- package/app/assets/script/utility/share.ts +77 -0
- package/app/assets/script/utility/string.ts +148 -0
- package/app/assets/script/view/default.tsx +14 -0
- package/app/assets/script/view/toolkit/youtube-player-1.ts +31 -0
- package/app/assets/style/base/_toolkit.scss +25 -25
- package/app/assets/style/base/components/_modal-1.scss +8 -3
- package/app/assets/style/base/components/_tabpanel-1.scss +21 -16
- package/app/assets/style/base/components/_tabpanel-2.scss +11 -6
- package/app/assets/style/base/components/_youtube-player-1.scss +3 -2
- package/app/assets/style/base/elements/_anchors.scss +2 -0
- package/app/assets/style/base/elements/_buttons.scss +7 -3
- package/app/assets/style/base/elements/_fieldsets.scss +2 -0
- package/app/assets/style/base/elements/_inputs.scss +6 -2
- package/app/assets/style/base/elements/_labels.scss +2 -0
- package/app/assets/style/base/elements/_legends.scss +2 -0
- package/app/assets/style/base/elements/_lists.scss +2 -0
- package/app/assets/style/base/elements/_tables.scss +10 -6
- package/app/assets/style/base/layouts/_staggered-1.scss +4 -1
- package/app/assets/style/base/type/_fonts.scss +4 -1
- package/app/assets/style/base/type/_headings.scss +3 -0
- package/app/assets/style/base/type/_text.scss +2 -0
- package/app/assets/style/base/utilities/_accessibility.scss +5 -2
- package/app/assets/style/base/utilities/_functions.scss +62 -9
- package/app/assets/style/global.scss +4 -11
- package/app/assets/style/print.scss +1 -4
- package/app/assets/style/toolkit.scss +37 -37
- package/app/package.json +1 -0
- package/app/toolkit/colors.hbs +11 -11
- package/app/toolkit/components.hbs +16 -16
- package/app/toolkit/elements.hbs +52 -43
- package/app/toolkit/grids.hbs +111 -111
- package/app/toolkit/icons.hbs +2 -2
- package/app/toolkit/index.hbs +6 -6
- package/app/toolkit/type.hbs +4 -4
- package/dist/app/assets/data/coutries.json +992 -0
- package/dist/app/assets/data/states.json +204 -0
- package/dist/app/assets/script/api/facebook.d.ts +8 -0
- package/dist/app/assets/script/api/facebook.js +42 -0
- package/dist/app/assets/script/api/facebook.js.map +1 -0
- package/dist/app/assets/script/api/youtube.d.ts +8 -0
- package/dist/app/assets/script/api/youtube.js +22 -0
- package/dist/app/assets/script/api/youtube.js.map +1 -0
- package/dist/app/assets/script/index.d.ts +2 -0
- package/dist/app/assets/script/index.js +2 -0
- package/dist/app/assets/script/index.js.map +1 -0
- package/dist/app/assets/script/mediator/global.d.ts +4 -0
- package/dist/app/assets/script/mediator/global.js +4 -0
- package/dist/app/assets/script/mediator/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/countries.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/countries.js +5 -0
- package/dist/app/assets/script/model/singletons/countries.js.map +1 -0
- package/dist/app/assets/script/model/singletons/global.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/global.js +5 -0
- package/dist/app/assets/script/model/singletons/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/states.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/states.js +5 -0
- package/dist/app/assets/script/model/singletons/states.js.map +1 -0
- package/dist/app/assets/script/model/user.d.ts +4 -0
- package/dist/app/assets/script/model/user.js +6 -0
- package/dist/app/assets/script/model/user.js.map +1 -0
- package/dist/app/assets/script/toolkit.d.ts +1 -0
- package/dist/app/assets/script/toolkit.js +7 -0
- package/dist/app/assets/script/toolkit.js.map +1 -0
- package/dist/app/assets/script/utility/ajax.d.ts +8 -0
- package/dist/app/assets/script/utility/ajax.js +17 -0
- package/dist/app/assets/script/utility/ajax.js.map +1 -0
- package/dist/app/assets/script/utility/form.d.ts +64 -0
- package/dist/app/assets/script/utility/form.js +111 -0
- package/dist/app/assets/script/utility/form.js.map +1 -0
- package/dist/app/assets/script/utility/regex.d.ts +14 -0
- package/dist/app/assets/script/utility/regex.js +27 -0
- package/dist/app/assets/script/utility/regex.js.map +1 -0
- package/dist/app/assets/script/utility/share.d.ts +68 -0
- package/dist/app/assets/script/utility/share.js +81 -0
- package/dist/app/assets/script/utility/share.js.map +1 -0
- package/dist/app/assets/script/utility/string.d.ts +64 -0
- package/dist/app/assets/script/utility/string.js +135 -0
- package/dist/app/assets/script/utility/string.js.map +1 -0
- package/dist/app/assets/script/view/default.d.ts +11 -0
- package/dist/app/assets/script/view/default.js +15 -0
- package/dist/app/assets/script/view/default.js.map +1 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.d.ts +23 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js +32 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js.map +1 -0
- package/dist/generators/app/index.d.ts +18 -0
- package/dist/generators/app/index.js +59 -0
- package/dist/generators/app/index.js.map +1 -0
- package/dist/scripts/build.d.ts +22 -0
- package/dist/scripts/build.js +158 -0
- package/dist/scripts/build.js.map +1 -0
- package/generators/app/index.js +2 -43
- package/generators/app/index.ts +61 -0
- package/package.json +79 -129
- package/scripts/build.ts +175 -0
- package/tsconfig.site.json +26 -0
- package/.babelrc +0 -14
- package/.editorconfig +0 -13
- package/.eslintrc +0 -64
- package/.htmllintrc +0 -6
- package/.sass-lint.yml +0 -16
- package/.travis.yml +0 -18
- package/app/assets/font/opensans/generator_config.txt +0 -5
- package/app/assets/font/opensans/opensans-bold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-italic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-light-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-lightitalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-regular-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/specimen_files/grid_12-825-55-15.css +0 -129
- package/app/assets/font/opensans/specimen_files/specimen_stylesheet.css +0 -396
- package/app/assets/image/demo/large.jpg +0 -0
- package/app/assets/image/demo/medium.jpg +0 -0
- package/app/assets/image/demo/small.jpg +0 -0
- package/app/assets/image/demo/xlarge.jpg +0 -0
- package/app/assets/image/demo/xxlarge.jpg +0 -0
- package/app/assets/script/api/youtube.js +0 -18
- package/app/assets/script/index.js +0 -6
- package/app/assets/script/mediator/global.js +0 -5
- package/app/assets/script/model/singletons/countries.js +0 -6
- package/app/assets/script/model/singletons/global.js +0 -6
- package/app/assets/script/model/singletons/states.js +0 -6
- package/app/assets/script/model/user.js +0 -5
- package/app/assets/script/toolkit.js +0 -12
- package/app/assets/script/utility/ajax.js +0 -11
- package/app/assets/script/utility/form.js +0 -86
- package/app/assets/script/utility/share.js +0 -52
- package/app/assets/script/utility/string.js +0 -70
- package/app/assets/script/view/default.js +0 -11
- package/app/assets/script/view/toolkit/youtube-player-1.js +0 -17
- package/app/assets/style/base/vendor/_foundation.scss +0 -2
- package/app/assets/test/spec/shareSpec.js +0 -137
- package/app/index.html +0 -40
- package/app/report/istanbul/base.css +0 -213
- package/app/report/istanbul/prettify.css +0 -1
- package/app/report/istanbul/prettify.js +0 -1
- package/app/report/istanbul/sort-arrow-sprite.png +0 -0
- package/app/report/istanbul/sorter.js +0 -158
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.eot +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.svg +0 -288
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/app/report/jsdoc/img/glyphicons-halflings-white.png +0 -0
- package/app/report/jsdoc/img/glyphicons-halflings.png +0 -0
- package/app/report/jsdoc/scripts/docstrap.lib.js +0 -11
- package/app/report/jsdoc/scripts/fulltext-search-ui.js +0 -89
- package/app/report/jsdoc/scripts/fulltext-search.js +0 -36
- package/app/report/jsdoc/scripts/lunr.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/app/report/jsdoc/scripts/prettify/jquery.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/lang-css.js +0 -21
- package/app/report/jsdoc/scripts/prettify/prettify.js +0 -496
- package/app/report/jsdoc/scripts/sunlight.js +0 -1157
- package/app/report/jsdoc/scripts/toc.js +0 -203
- package/app/report/jsdoc/styles/darkstrap.css +0 -960
- package/app/report/jsdoc/styles/prettify-tomorrow.css +0 -132
- package/app/report/jsdoc/styles/site.cerulean.css +0 -7008
- package/app/report/jsdoc/styles/site.cosmo.css +0 -7061
- package/app/report/jsdoc/styles/site.cyborg.css +0 -7048
- package/app/report/jsdoc/styles/site.darkly.css +0 -7171
- package/app/report/jsdoc/styles/site.darkstrap.css +0 -5638
- package/app/report/jsdoc/styles/site.dibs-bootstrap.css +0 -5899
- package/app/report/jsdoc/styles/site.flatly.css +0 -7147
- package/app/report/jsdoc/styles/site.journal.css +0 -6973
- package/app/report/jsdoc/styles/site.lumen.css +0 -7298
- package/app/report/jsdoc/styles/site.paper.css +0 -7623
- package/app/report/jsdoc/styles/site.readable.css +0 -6997
- package/app/report/jsdoc/styles/site.sandstone.css +0 -7035
- package/app/report/jsdoc/styles/site.simplex.css +0 -7023
- package/app/report/jsdoc/styles/site.slate.css +0 -7343
- package/app/report/jsdoc/styles/site.spacelab.css +0 -7055
- package/app/report/jsdoc/styles/site.superhero.css +0 -7131
- package/app/report/jsdoc/styles/site.united.css +0 -6895
- package/app/report/jsdoc/styles/site.yeti.css +0 -7195
- package/app/report/jsdoc/styles/sunlight.dark.css +0 -345
- package/app/report/jsdoc/styles/sunlight.default.css +0 -344
- package/gulp/config.js +0 -224
- package/gulp/tasks/accessibility.js +0 -34
- package/gulp/tasks/build.js +0 -19
- package/gulp/tasks/clean.js +0 -34
- package/gulp/tasks/data.js +0 -22
- package/gulp/tasks/default.js +0 -9
- package/gulp/tasks/deploy.js +0 -225
- package/gulp/tasks/documentation.js +0 -25
- package/gulp/tasks/markup.js +0 -121
- package/gulp/tasks/script.js +0 -92
- package/gulp/tasks/style.js +0 -42
- package/gulp/tasks/unit.js +0 -38
- package/gulp/tasks/watch.js +0 -83
- package/gulpfile.js +0 -8
- package/jsdoc.json +0 -23
- package/karma.conf.js +0 -58
package/gulp/tasks/markup.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// ## Load Modules
|
|
2
|
-
|
|
3
|
-
const gulp = require('gulp');
|
|
4
|
-
const prettify = require('gulp-prettify');
|
|
5
|
-
const handlebars = require('handlebars');
|
|
6
|
-
const handlebarsToHTML = require('gulp-compile-handlebars');
|
|
7
|
-
const handlebarsToJS = require('gulp-handlebars');
|
|
8
|
-
const htmllint = require('gulp-htmllint');
|
|
9
|
-
const rename = require('gulp-rename');
|
|
10
|
-
const wrapper = require('gulp-wrapper');
|
|
11
|
-
const plumber = require('gulp-plumber');
|
|
12
|
-
const data = require('gulp-data');
|
|
13
|
-
const notify = require('gulp-notify');
|
|
14
|
-
const _ = require('lodash');
|
|
15
|
-
|
|
16
|
-
// ## Environment Config
|
|
17
|
-
|
|
18
|
-
const config = require('../config');
|
|
19
|
-
|
|
20
|
-
// ## Markup Task
|
|
21
|
-
// create .html files written to app root
|
|
22
|
-
|
|
23
|
-
gulp.task('markup', ['cleanHTML'], () => {
|
|
24
|
-
'use strict';
|
|
25
|
-
//task
|
|
26
|
-
return gulp.src(config.path.markup.source)
|
|
27
|
-
//support for better error handling
|
|
28
|
-
.pipe(plumber())
|
|
29
|
-
.pipe(data((file) => {
|
|
30
|
-
|
|
31
|
-
let configDataPath = '../../' + config.path.data.globalConfigFile;
|
|
32
|
-
let globalDataPath = '../../' + config.path.data.source + '/' + config.path.data.pageDirectory +
|
|
33
|
-
config.path.data.pageDefaultData;
|
|
34
|
-
let pageData;
|
|
35
|
-
|
|
36
|
-
// page specific json files are optional
|
|
37
|
-
try {
|
|
38
|
-
|
|
39
|
-
pageData = '../../app/' +
|
|
40
|
-
config.path.data.destination + '/' + config.path.data.pageDirectory +
|
|
41
|
-
file.path.split(config.path.root).pop().replace('.hbs', '.json');
|
|
42
|
-
|
|
43
|
-
// prevent node from giving you back cached data, make it go to the disk.
|
|
44
|
-
delete require.cache[require.resolve(pageData)];
|
|
45
|
-
|
|
46
|
-
pageData = require(pageData);
|
|
47
|
-
|
|
48
|
-
} catch(err) {
|
|
49
|
-
pageData = {};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
delete require.cache[require.resolve(configDataPath)];
|
|
53
|
-
delete require.cache[require.resolve(globalDataPath)];
|
|
54
|
-
|
|
55
|
-
//return the data
|
|
56
|
-
return _.extend(
|
|
57
|
-
{},
|
|
58
|
-
require(configDataPath),
|
|
59
|
-
require(globalDataPath),
|
|
60
|
-
pageData
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
}))
|
|
64
|
-
//compile the handlebars templates to html
|
|
65
|
-
.pipe(handlebarsToHTML({}, {
|
|
66
|
-
batch: config.path.markup.partials.source
|
|
67
|
-
}))
|
|
68
|
-
//validate markup
|
|
69
|
-
.pipe(htmllint({
|
|
70
|
-
config: config.path.markup.htmlLint
|
|
71
|
-
}))
|
|
72
|
-
//switch the file extension from .hbs to .html
|
|
73
|
-
.pipe(rename((path) => {
|
|
74
|
-
path.extname = '.html';
|
|
75
|
-
}))
|
|
76
|
-
//validate markup
|
|
77
|
-
.pipe(prettify())
|
|
78
|
-
.pipe(gulp.dest(config.path.root))
|
|
79
|
-
.on('error', notify.onError('markup: <%= error.message %>'));
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// ## markupTemplate Task
|
|
83
|
-
// create precomiled .js templates that return DOM objects
|
|
84
|
-
|
|
85
|
-
gulp.task('markupTemplate', () => {
|
|
86
|
-
'use strict';
|
|
87
|
-
return gulp.src(config.path.markup.partials.watch)
|
|
88
|
-
//support for better error handling
|
|
89
|
-
.pipe(plumber())
|
|
90
|
-
//compile the template to javascript
|
|
91
|
-
.pipe(handlebarsToJS({
|
|
92
|
-
// Pass local handlebars version to keep everything on the same version
|
|
93
|
-
handlebars: handlebars
|
|
94
|
-
}))
|
|
95
|
-
//wrap in define module and register all templates as partials
|
|
96
|
-
.pipe(wrapper({
|
|
97
|
-
getTemplateName: function(file) {
|
|
98
|
-
return file.path.split('markup/').pop().replace('.js', '');
|
|
99
|
-
},
|
|
100
|
-
header: function(file){
|
|
101
|
-
let templateName = this.getTemplateName(file);
|
|
102
|
-
return '(function() {' +
|
|
103
|
-
'var Handlebars = require("handlebars");' +
|
|
104
|
-
'if (typeof Handlebars.templates === \'undefined\') {' +
|
|
105
|
-
'Handlebars.templates = {};'+
|
|
106
|
-
'}' +
|
|
107
|
-
'Handlebars.templates[\'' + templateName + '\'] = Handlebars.template(';
|
|
108
|
-
},
|
|
109
|
-
footer: function(file){
|
|
110
|
-
let templateName = this.getTemplateName(file);
|
|
111
|
-
return ');' +
|
|
112
|
-
'Handlebars.registerPartial(\'' + templateName + '\', Handlebars.templates[\'' + templateName +'\']);' +
|
|
113
|
-
'module.exports = function(data) {' +
|
|
114
|
-
'return new DOMParser().parseFromString(Handlebars.templates[\'' +
|
|
115
|
-
templateName + '\'](data).trim(), "text/html").body.firstChild.cloneNode(true);' +
|
|
116
|
-
'};' +
|
|
117
|
-
'})();';
|
|
118
|
-
}
|
|
119
|
-
}))
|
|
120
|
-
.pipe(gulp.dest(config.path.markup.partials.destination));
|
|
121
|
-
});
|
package/gulp/tasks/script.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const eslint = require('gulp-eslint');
|
|
7
|
-
const plumber = require('gulp-plumber');
|
|
8
|
-
const browserify = require('browserify');
|
|
9
|
-
const notify = require('gulp-notify');
|
|
10
|
-
const modernizr = require('modernizr');
|
|
11
|
-
const fs = require('fs');
|
|
12
|
-
const glob = require('glob');
|
|
13
|
-
|
|
14
|
-
// ## Environment Config
|
|
15
|
-
|
|
16
|
-
const config = require('../config');
|
|
17
|
-
|
|
18
|
-
// ## Script Lint Task
|
|
19
|
-
// make sure the code is all tidy
|
|
20
|
-
|
|
21
|
-
gulp.task('scriptLint', () => {
|
|
22
|
-
|
|
23
|
-
return gulp.src(config.path.script.all)
|
|
24
|
-
//support for better error handling
|
|
25
|
-
.pipe(plumber())
|
|
26
|
-
//lint logic and code style
|
|
27
|
-
.pipe(eslint())
|
|
28
|
-
.pipe(eslint.format())
|
|
29
|
-
.pipe(eslint.failAfterError())
|
|
30
|
-
.on('error', notify.onError('scriptLint: <%= error.message %>'));
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// ## Script Task
|
|
35
|
-
// complile the modules together, first lint .js files, then build modernizr and compile clientside templates
|
|
36
|
-
|
|
37
|
-
gulp.task('script', ['scriptLint', 'markupTemplate', 'scriptModernizr'], callback => {
|
|
38
|
-
|
|
39
|
-
const entries = [];
|
|
40
|
-
const entriesDestination = [];
|
|
41
|
-
const bundleFs = fs.createWriteStream(config.path.script.entriesGlobal);
|
|
42
|
-
|
|
43
|
-
glob(config.path.script.entries, {}, (err, files) => {
|
|
44
|
-
|
|
45
|
-
let i;
|
|
46
|
-
for (i = 0; i < files.length; i++) {
|
|
47
|
-
if (files[i].search('.compiled.js') === -1) {
|
|
48
|
-
entries.push(files[i]);
|
|
49
|
-
entriesDestination.push(files[i].replace('.js', '.compiled.js'));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
browserify({
|
|
54
|
-
transform: [
|
|
55
|
-
'babelify'
|
|
56
|
-
],
|
|
57
|
-
entries: entries,
|
|
58
|
-
debug: (config.path.isProduction ? false : true),
|
|
59
|
-
plugin: [['factor-bundle', {
|
|
60
|
-
outputs: entriesDestination
|
|
61
|
-
}]]
|
|
62
|
-
})
|
|
63
|
-
.bundle()
|
|
64
|
-
.on('error', notify.onError('script: <%= error.message %>'))
|
|
65
|
-
//support for better error handling
|
|
66
|
-
.pipe(plumber())
|
|
67
|
-
.pipe(bundleFs);
|
|
68
|
-
|
|
69
|
-
// all done
|
|
70
|
-
bundleFs.on('finish', function() {
|
|
71
|
-
return callback();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// ## Script Modernizr Task
|
|
79
|
-
// build modernizr for this project.
|
|
80
|
-
// config example: https://github.com/Modernizr/Modernizr/blob/master/lib/config-all.json
|
|
81
|
-
|
|
82
|
-
gulp.task('scriptModernizr', callback => {
|
|
83
|
-
|
|
84
|
-
modernizr.build({
|
|
85
|
-
'feature-detects': [
|
|
86
|
-
'touchevents'
|
|
87
|
-
]
|
|
88
|
-
}, file => {
|
|
89
|
-
fs.writeFile(config.path.script.modernizr, file, callback);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
});
|
package/gulp/tasks/style.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const sassLint = require('gulp-sass-lint');
|
|
7
|
-
const sass = require('gulp-sass');
|
|
8
|
-
const autoprefixer = require('gulp-autoprefixer');
|
|
9
|
-
const notify = require('gulp-notify');
|
|
10
|
-
const plumber = require('gulp-plumber');
|
|
11
|
-
|
|
12
|
-
// ## Environment Config
|
|
13
|
-
|
|
14
|
-
const config = require('../config');
|
|
15
|
-
|
|
16
|
-
// ## Style Task Complilation Logic
|
|
17
|
-
|
|
18
|
-
const styleCompile = () => {
|
|
19
|
-
|
|
20
|
-
return gulp.src(config.path.style.source.scss)
|
|
21
|
-
//support for better error handling
|
|
22
|
-
.pipe(plumber())
|
|
23
|
-
//validate scss
|
|
24
|
-
.pipe(sassLint())
|
|
25
|
-
.pipe(sassLint.format())
|
|
26
|
-
.pipe(sassLint.failOnError())
|
|
27
|
-
//compile sass into css
|
|
28
|
-
.pipe(sass({
|
|
29
|
-
indentWidth: 4,
|
|
30
|
-
sourceComments: true
|
|
31
|
-
}).on('error', sass.logError))
|
|
32
|
-
//add browser prefixes
|
|
33
|
-
.pipe(autoprefixer({
|
|
34
|
-
browsers: ['last 3 versions']
|
|
35
|
-
}))
|
|
36
|
-
.pipe(gulp.dest(config.path.style.destination.watch))
|
|
37
|
-
.on('error', notify.onError('style: <%= error.message %>'));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// ## Style Task
|
|
41
|
-
|
|
42
|
-
gulp.task('style', styleCompile);
|
package/gulp/tasks/unit.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const KarmaServer = require('karma').Server;
|
|
7
|
-
|
|
8
|
-
// ## Environment Config
|
|
9
|
-
|
|
10
|
-
const config = require('../config');
|
|
11
|
-
|
|
12
|
-
// ## Unit Task
|
|
13
|
-
|
|
14
|
-
gulp.task('unit', (done) => {
|
|
15
|
-
|
|
16
|
-
//run unit tests and write out coverage
|
|
17
|
-
return new KarmaServer.start({
|
|
18
|
-
configFile: config.path.script.karma,
|
|
19
|
-
singleRun: true
|
|
20
|
-
}, () => {
|
|
21
|
-
done();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// ## Unit Watch Task
|
|
27
|
-
|
|
28
|
-
gulp.task('unitWatch', (done) => {
|
|
29
|
-
|
|
30
|
-
//run unit tests and write out coverage
|
|
31
|
-
return new KarmaServer.start({
|
|
32
|
-
configFile: config.path.script.karma,
|
|
33
|
-
autoWatch: true
|
|
34
|
-
}, () => {
|
|
35
|
-
done();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
});
|
package/gulp/tasks/watch.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const browsersync = require('browser-sync').create();
|
|
7
|
-
const proxy = require('http-proxy-middleware');
|
|
8
|
-
|
|
9
|
-
// ## Environment Config
|
|
10
|
-
|
|
11
|
-
const config = require('../config');
|
|
12
|
-
|
|
13
|
-
// ## Reload
|
|
14
|
-
|
|
15
|
-
const reload = () => {
|
|
16
|
-
return browsersync.reload();
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// ## Watch Task
|
|
20
|
-
|
|
21
|
-
// these workaround for browsersync and gulp 3.x, when 4.x is released this should be revisted
|
|
22
|
-
gulp.task('markup-watch', ['markup', 'script'], reload);
|
|
23
|
-
gulp.task('style-watch', ['style'], reload);
|
|
24
|
-
gulp.task('script-watch', ['script'], reload);
|
|
25
|
-
gulp.task('image-watch', reload);
|
|
26
|
-
gulp.task('data-watch', ['markup', 'script'], reload);
|
|
27
|
-
|
|
28
|
-
// ### Starup the Browsersync server
|
|
29
|
-
|
|
30
|
-
gulp.task('watch', ['build'], () => {
|
|
31
|
-
|
|
32
|
-
//start up Browsersync
|
|
33
|
-
browsersync.init({
|
|
34
|
-
//proxy: 'localhost'
|
|
35
|
-
server: {
|
|
36
|
-
baseDir: config.path.root,
|
|
37
|
-
middleware: [
|
|
38
|
-
proxy(config.path.service, {
|
|
39
|
-
target: config.path.proxy.target,
|
|
40
|
-
pathRewrite: config.path.proxy.rewrite,
|
|
41
|
-
changeOrigin: true
|
|
42
|
-
})
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
//watch scss
|
|
48
|
-
gulp.watch(
|
|
49
|
-
config.path.style.source.scss,
|
|
50
|
-
['style-watch']
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
//watch js
|
|
54
|
-
gulp.watch(
|
|
55
|
-
config.path.script.all,
|
|
56
|
-
['script-watch']
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
// watch handlebars templates
|
|
60
|
-
gulp.watch(
|
|
61
|
-
config.path.markup.source,
|
|
62
|
-
['markup-watch']
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// watch handlebars partials
|
|
66
|
-
gulp.watch(
|
|
67
|
-
config.path.markup.partials.watch,
|
|
68
|
-
['markup-watch']
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
//watch images
|
|
72
|
-
gulp.watch(
|
|
73
|
-
config.path.image.source,
|
|
74
|
-
['image-watch']
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
//watch data
|
|
78
|
-
gulp.watch(
|
|
79
|
-
config.path.data.sourceGlob,
|
|
80
|
-
['data-watch']
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
});
|
package/gulpfile.js
DELETED
package/jsdoc.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tags": {
|
|
3
|
-
"allowUnknownTags": true
|
|
4
|
-
},
|
|
5
|
-
"opts": {
|
|
6
|
-
"destination": "./app/report/jsdoc"
|
|
7
|
-
},
|
|
8
|
-
"plugins": [
|
|
9
|
-
"plugins/markdown"
|
|
10
|
-
],
|
|
11
|
-
"templates": {
|
|
12
|
-
"cleverLinks": false,
|
|
13
|
-
"monospaceLinks": false,
|
|
14
|
-
"default": {
|
|
15
|
-
"outputSourceFiles": true
|
|
16
|
-
},
|
|
17
|
-
"path": "ink-docstrap",
|
|
18
|
-
"theme": "cerulean",
|
|
19
|
-
"navType": "vertical",
|
|
20
|
-
"linenums": true,
|
|
21
|
-
"dateFormat": "MMMM Do YYYY, h:mm:ss a"
|
|
22
|
-
}
|
|
23
|
-
}
|
package/karma.conf.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
const istanbul = require('browserify-istanbul');
|
|
2
|
-
|
|
3
|
-
module.exports = (karma) => {
|
|
4
|
-
'use strict';
|
|
5
|
-
karma.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: [
|
|
8
|
-
'jasmine',
|
|
9
|
-
'browserify'
|
|
10
|
-
],
|
|
11
|
-
files: [{
|
|
12
|
-
pattern: 'app/assets/script/utility/*.js'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
pattern: 'app/assets/test/spec/*Spec.js'
|
|
16
|
-
}],
|
|
17
|
-
reporters: [
|
|
18
|
-
'progress',
|
|
19
|
-
'coverage'
|
|
20
|
-
],
|
|
21
|
-
preprocessors: {
|
|
22
|
-
'app/assets/script/utility/*.js': [
|
|
23
|
-
'browserify'
|
|
24
|
-
],
|
|
25
|
-
'app/assets/test/spec/*Spec.js': [
|
|
26
|
-
'browserify'
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
browsers: [
|
|
30
|
-
//'Chrome',
|
|
31
|
-
//'Firefox',
|
|
32
|
-
//'Safari',
|
|
33
|
-
'PhantomJS'
|
|
34
|
-
],
|
|
35
|
-
singleRun: false,
|
|
36
|
-
autoWatch: false,
|
|
37
|
-
browserify: {
|
|
38
|
-
debug: true,
|
|
39
|
-
transform: [
|
|
40
|
-
'browserify-shim',
|
|
41
|
-
'babelify',
|
|
42
|
-
istanbul({
|
|
43
|
-
instrumenterConfig: {
|
|
44
|
-
embedSource: true
|
|
45
|
-
},
|
|
46
|
-
ignore: ['**/node_modules/**']
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
coverageReporter: {
|
|
51
|
-
type: 'html',
|
|
52
|
-
dir: 'app/report/istanbul/',
|
|
53
|
-
subdir: '.'
|
|
54
|
-
},
|
|
55
|
-
// If browser does not capture in given timeout [ms], kill it
|
|
56
|
-
captureTimeout: 60000
|
|
57
|
-
});
|
|
58
|
-
};
|