generator-white-label 3.0.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/404.hbs +20 -0
- package/app/README.md +19 -0
- package/app/assets/data/view/toolkit/colors.json +17 -0
- package/app/assets/data/view/toolkit/components.json +39 -0
- package/app/assets/data/view/toolkit/elements.json +119 -0
- package/app/assets/data/view/toolkit/grids.json +17 -0
- package/app/assets/data/view/toolkit/icons.json +17 -0
- package/app/assets/data/view/toolkit/index.json +17 -0
- package/app/assets/data/view/toolkit/type.json +17 -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/a.hbs +29 -0
- package/app/assets/markup/element/button.hbs +30 -0
- package/app/assets/markup/element/div.hbs +11 -0
- package/app/assets/markup/element/head.hbs +78 -0
- package/app/assets/markup/element/iframe.hbs +20 -0
- package/app/assets/markup/element/img.hbs +30 -0
- package/app/assets/markup/element/input.hbs +43 -0
- package/app/assets/markup/element/label.hbs +14 -0
- package/app/assets/markup/element/legend.hbs +5 -0
- package/app/assets/markup/element/meta.hbs +11 -0
- package/app/assets/markup/element/nav.hbs +13 -0
- package/app/assets/markup/element/p.hbs +8 -0
- package/app/assets/markup/element/picture.hbs +58 -0
- package/app/assets/markup/element/script.hbs +3 -0
- package/app/assets/markup/element/select.hbs +35 -0
- package/app/assets/markup/element/span.hbs +8 -0
- package/app/assets/markup/element/svg.hbs +11 -0
- package/app/assets/markup/element/table.hbs +50 -0
- package/app/assets/markup/element/textarea.hbs +24 -0
- package/app/assets/markup/element/ul.hbs +13 -0
- package/app/assets/markup/modal/modal-example-1.handlebars +8 -0
- package/app/assets/markup/toolkit/accessibility-skip-to-element-1.handlebars +1 -0
- package/app/assets/markup/toolkit/accessibility-speaker-1.handlebars +1 -0
- package/app/assets/markup/toolkit/anchor-1.handlebars +1 -0
- package/app/assets/markup/toolkit/button-1.handlebars +1 -0
- package/app/assets/markup/toolkit/footer-1.handlebars +3 -0
- package/app/assets/markup/toolkit/header-1.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-1.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-2.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-3.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-4.handlebars +1 -0
- package/app/assets/markup/toolkit/image-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-checkbox-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-error-1.handlebars +8 -0
- package/app/assets/markup/toolkit/input-radio-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-text-1.handlebars +1 -0
- package/app/assets/markup/toolkit/label-1.handlebars +1 -0
- package/app/assets/markup/toolkit/legend-1.handlebars +1 -0
- package/app/assets/markup/toolkit/list-1.handlebars +1 -0
- package/app/assets/markup/toolkit/modal-1.handlebars +4 -0
- package/app/assets/markup/toolkit/nav-1.handlebars +1 -0
- package/app/assets/markup/toolkit/picture-1.handlebars +1 -0
- package/app/assets/markup/toolkit/select-1.handlebars +1 -0
- package/app/assets/markup/toolkit/table-1.handlebars +1 -0
- package/app/assets/markup/toolkit/text-1.handlebars +1 -0
- package/app/assets/markup/toolkit/textarea-1.handlebars +1 -0
- package/app/assets/markup/toolkit/youtube-player-1.handlebars +1 -0
- package/app/assets/script/api/facebook.ts +41 -0
- 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 +31 -15
- package/app/assets/style/base/components/_modal-1.scss +80 -0
- package/app/assets/style/base/components/_sticky-1.scss +19 -0
- package/app/assets/style/base/components/_tabpanel-1.scss +115 -0
- package/app/assets/style/base/components/_tabpanel-2.scss +64 -0
- package/app/assets/style/base/components/_tabpanel-base-1.scss +13 -0
- package/app/assets/style/base/components/_youtube-player-1.scss +16 -0
- package/app/assets/style/base/elements/_anchors.scss +12 -0
- package/app/assets/style/base/elements/_buttons.scss +15 -0
- package/app/assets/style/base/elements/_fieldsets.scss +9 -0
- package/app/assets/style/base/elements/_images.scss +6 -2
- package/app/assets/style/base/elements/_inputs.scss +70 -0
- package/app/assets/style/base/elements/_labels.scss +8 -0
- package/app/assets/style/base/elements/_landmarks.scss +3 -0
- package/app/assets/style/base/elements/_legends.scss +11 -0
- package/app/assets/style/base/elements/_lists.scss +8 -1
- package/app/assets/style/base/elements/_tables.scss +32 -1
- package/app/assets/style/base/layouts/_staggered-1.scss +29 -0
- package/app/assets/style/base/type/_fonts.scss +39 -1
- package/app/assets/style/base/type/_headings.scss +29 -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 +108 -10
- package/app/assets/style/print.scss +2 -3
- package/app/assets/style/toolkit.scss +387 -0
- package/app/index.hbs +21 -0
- package/app/package.json +1 -0
- package/app/toolkit/colors.hbs +102 -0
- package/app/toolkit/components.hbs +261 -0
- package/app/toolkit/elements.hbs +497 -0
- package/app/toolkit/grids.hbs +413 -0
- package/app/toolkit/icons.hbs +87 -0
- package/app/toolkit/index.hbs +144 -0
- package/app/toolkit/type.hbs +120 -0
- 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 +78 -109
- package/scripts/build.ts +175 -0
- package/tsconfig.site.json +26 -0
- package/.babelrc +0 -7
- package/.editorconfig +0 -13
- package/.eslintrc +0 -64
- package/.htmllintrc +0 -6
- package/.npmignore +0 -12
- 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/script/index.js +0 -11
- 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/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/style/base/vendor/_foundation.scss +0 -2
- package/app/assets/test/spec/shareSpec.js +0 -137
- package/app/index.html +0 -43
- package/app/report/istanbul/base.css +0 -213
- package/app/report/istanbul/index.html +0 -93
- 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/istanbul/utility/form.js.html +0 -524
- package/app/report/istanbul/utility/index.html +0 -132
- package/app/report/istanbul/utility/regex.js.html +0 -203
- package/app/report/istanbul/utility/share.js.html +0 -401
- package/app/report/istanbul/utility/string.js.html +0 -446
- package/app/report/jsdoc/DragEvent.html +0 -303
- package/app/report/jsdoc/Event.html +0 -773
- package/app/report/jsdoc/EventPropagators.html +0 -336
- package/app/report/jsdoc/FocusEvent.html +0 -303
- package/app/report/jsdoc/ForEachBookKeeping.html +0 -425
- package/app/report/jsdoc/KeyboardEvent.html +0 -303
- package/app/report/jsdoc/MapBookKeeping.html +0 -457
- package/app/report/jsdoc/MouseEvent.html +0 -303
- package/app/report/jsdoc/ReactClass.html +0 -330
- package/app/report/jsdoc/ReactClassInterface.html +0 -311
- package/app/report/jsdoc/ReactDOMComponent.html +0 -349
- package/app/report/jsdoc/ReactDOMTextComponent.html +0 -348
- package/app/report/jsdoc/ReactMountReady.html +0 -340
- package/app/report/jsdoc/ReactMultiChild.html +0 -330
- package/app/report/jsdoc/ReactOwner.html +0 -351
- package/app/report/jsdoc/ReactReconcileTransaction.html +0 -342
- package/app/report/jsdoc/ReactServerRenderingTransaction.html +0 -376
- package/app/report/jsdoc/ReactServerUpdateQueue.html +0 -382
- package/app/report/jsdoc/TouchEvent.html +0 -303
- package/app/report/jsdoc/Transaction.html +0 -459
- package/app/report/jsdoc/UIEvent.html +0 -303
- package/app/report/jsdoc/WheelEvent.html +0 -303
- package/app/report/jsdoc/classes.list.html +0 -339
- 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/global.html +0 -1653
- 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/index.html +0 -236
- package/app/report/jsdoc/interfaces.list.html +0 -339
- package/app/report/jsdoc/quicksearch.html +0 -31
- 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 -207
- package/gulp/tasks/accessibility.js +0 -34
- package/gulp/tasks/build.js +0 -18
- package/gulp/tasks/clean.js +0 -18
- package/gulp/tasks/data.js +0 -22
- package/gulp/tasks/default.js +0 -9
- package/gulp/tasks/deploy.js +0 -222
- package/gulp/tasks/documentation.js +0 -28
- package/gulp/tasks/markup.js +0 -26
- 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 -77
- package/gulpfile.js +0 -8
- package/jsdoc.json +0 -23
- package/karma.conf.js +0 -58
package/gulp/config.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
(() => {
|
|
2
|
-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
// ## Load Modules
|
|
6
|
-
|
|
7
|
-
const yargs = require('yargs').argv;
|
|
8
|
-
|
|
9
|
-
// ## Environment Config
|
|
10
|
-
|
|
11
|
-
let isProduction;
|
|
12
|
-
if (yargs.production) {
|
|
13
|
-
isProduction = yargs.production;
|
|
14
|
-
} else {
|
|
15
|
-
isProduction = false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// setting the build version
|
|
19
|
-
let version;
|
|
20
|
-
if (yargs.version) {
|
|
21
|
-
version = yargs.version;
|
|
22
|
-
} else {
|
|
23
|
-
//by default set the version to a timestamp
|
|
24
|
-
version = Math.floor(new Date() / 1000);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//setting a www domain for build
|
|
28
|
-
let www;
|
|
29
|
-
//test if www is defined
|
|
30
|
-
if (yargs.www) {
|
|
31
|
-
www = yargs.www + '/';
|
|
32
|
-
} else {
|
|
33
|
-
www = '/';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//setting a cdn domain for build
|
|
37
|
-
let cdn;
|
|
38
|
-
//test if cdn is defined
|
|
39
|
-
if (yargs.cdn) {
|
|
40
|
-
cdn = yargs.cdn + '/release/' + version + '/';
|
|
41
|
-
} else {
|
|
42
|
-
cdn = '/';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//setting a service domain for build
|
|
46
|
-
let service;
|
|
47
|
-
//test if www is defined
|
|
48
|
-
if (yargs.service) {
|
|
49
|
-
service = yargs.service + '/';
|
|
50
|
-
} else {
|
|
51
|
-
service = '/service-endpoint/';
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ## paths
|
|
55
|
-
module.exports = {
|
|
56
|
-
// ## Path Variables
|
|
57
|
-
path: {
|
|
58
|
-
// ### build
|
|
59
|
-
// where to save deployable files
|
|
60
|
-
build: '_deploy',
|
|
61
|
-
root: 'app/',
|
|
62
|
-
version: version,
|
|
63
|
-
www: www,
|
|
64
|
-
cdn: cdn,
|
|
65
|
-
service: service,
|
|
66
|
-
proxy: {
|
|
67
|
-
target: 'http://127.0.0.1:8000/service-endpoint',
|
|
68
|
-
rewrite: {
|
|
69
|
-
'/service-endpoint': '/'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
// is this a production build?
|
|
73
|
-
isProduction: isProduction,
|
|
74
|
-
// ### image
|
|
75
|
-
image: {
|
|
76
|
-
// glob of all image files and directories
|
|
77
|
-
source: [
|
|
78
|
-
'app/assets/image/**'
|
|
79
|
-
],
|
|
80
|
-
// location to save processed images by tasks
|
|
81
|
-
destination: 'assets/image'
|
|
82
|
-
},
|
|
83
|
-
// ### markup
|
|
84
|
-
markup: {
|
|
85
|
-
// htmllint config file
|
|
86
|
-
htmlLint: '.htmllintrc',
|
|
87
|
-
// glob of generated html files
|
|
88
|
-
destination: [
|
|
89
|
-
'app/**/*.html',
|
|
90
|
-
'!app/assets/**',
|
|
91
|
-
'!app/report/**',
|
|
92
|
-
'!app/service/**'
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
// ### font
|
|
96
|
-
font: {
|
|
97
|
-
// glob of fonts
|
|
98
|
-
source: 'app/assets/font/**',
|
|
99
|
-
// where to save fonts
|
|
100
|
-
destination: 'assets/font'
|
|
101
|
-
},
|
|
102
|
-
// ### script
|
|
103
|
-
script: {
|
|
104
|
-
// karma test runner conig file
|
|
105
|
-
karma: __dirname + '/../karma.conf.js',
|
|
106
|
-
// where to save out the modernizr built file
|
|
107
|
-
modernizr: 'node_modules/modernizr/modernizr.js',
|
|
108
|
-
// glob of all js files including gulp and application
|
|
109
|
-
all: [
|
|
110
|
-
'*.js',
|
|
111
|
-
'gulp/tasks/*.js',
|
|
112
|
-
'gulp/*.js',
|
|
113
|
-
'gulp/options/.js',
|
|
114
|
-
'app/assets/script/**',
|
|
115
|
-
'app/assets/test/spec/*.js',
|
|
116
|
-
'app/assets/test/*.js',
|
|
117
|
-
'!app/assets/script/template/**',
|
|
118
|
-
'!app/assets/script/*.compiled.js'
|
|
119
|
-
],
|
|
120
|
-
// glob of only gulp js files for documentation task
|
|
121
|
-
gulp: [
|
|
122
|
-
'*.js',
|
|
123
|
-
'gulp/tasks/*.js',
|
|
124
|
-
'gulp/*.js'
|
|
125
|
-
],
|
|
126
|
-
// glob of only application files for documentation task
|
|
127
|
-
source: [
|
|
128
|
-
'app/assets/script/*.js',
|
|
129
|
-
'app/assets/script/**',
|
|
130
|
-
'!app/assets/script/template/**',
|
|
131
|
-
'!app/assets/script/*.compiled.js'
|
|
132
|
-
],
|
|
133
|
-
// glob js files to be delployed duirng release
|
|
134
|
-
release: 'app/assets/script/*.compiled.js',
|
|
135
|
-
// file to be compliled by browserify
|
|
136
|
-
compile: {
|
|
137
|
-
source: 'app/assets/script/global.js',
|
|
138
|
-
destination: 'app/assets/script',
|
|
139
|
-
filename: 'global.compiled.js'
|
|
140
|
-
},
|
|
141
|
-
// where to save script files in release task
|
|
142
|
-
destination: 'assets/script',
|
|
143
|
-
// common libraries found when browserify builds entries
|
|
144
|
-
entriesGlobal: 'app/assets/script/global.compiled.js',
|
|
145
|
-
// browserify entries
|
|
146
|
-
entries: 'app/assets/script/*.js'
|
|
147
|
-
},
|
|
148
|
-
// ### style
|
|
149
|
-
style: {
|
|
150
|
-
// scsslint config file
|
|
151
|
-
scssLint: '.scss-lint.yml',
|
|
152
|
-
source: {
|
|
153
|
-
// glob of all scss files
|
|
154
|
-
scss: [
|
|
155
|
-
'app/assets/style/*.scss',
|
|
156
|
-
'app/assets/style/**/*.scss'
|
|
157
|
-
],
|
|
158
|
-
// glob of all css files
|
|
159
|
-
css: [
|
|
160
|
-
'app/assets/style/*.css'
|
|
161
|
-
]
|
|
162
|
-
},
|
|
163
|
-
// where to save style files
|
|
164
|
-
destination: {
|
|
165
|
-
watch: 'app/assets/style',
|
|
166
|
-
release: 'assets/style'
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
// ### font
|
|
170
|
-
data: {
|
|
171
|
-
// where to save data returns glob
|
|
172
|
-
sourceGlob: 'app/assets/data/**',
|
|
173
|
-
// where to save data
|
|
174
|
-
source: 'app/assets/data',
|
|
175
|
-
// where to save data
|
|
176
|
-
destination: 'assets/data',
|
|
177
|
-
// global config data
|
|
178
|
-
globalConfig: {
|
|
179
|
-
'www': www,
|
|
180
|
-
'cdn': cdn,
|
|
181
|
-
'service': service,
|
|
182
|
-
'version': version
|
|
183
|
-
},
|
|
184
|
-
// global config file name
|
|
185
|
-
globalConfigFile: 'app/assets/data/config.json',
|
|
186
|
-
pageDirectory: 'view/',
|
|
187
|
-
pageDefaultData: 'global.json'
|
|
188
|
-
},
|
|
189
|
-
// ### release
|
|
190
|
-
release: {
|
|
191
|
-
destination: '/release/',
|
|
192
|
-
copy: [
|
|
193
|
-
'app/sitemap.xml',
|
|
194
|
-
'app/robots.txt',
|
|
195
|
-
'app/favicon.ico'
|
|
196
|
-
]
|
|
197
|
-
},
|
|
198
|
-
// ### report
|
|
199
|
-
report: {
|
|
200
|
-
// where to save code complexity report
|
|
201
|
-
source: 'app/report/**',
|
|
202
|
-
destination: 'report'
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
})();
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const accessibility = require('gulp-accessibility');
|
|
7
|
-
const plumber = require('gulp-plumber');
|
|
8
|
-
const notify = require('gulp-notify');
|
|
9
|
-
|
|
10
|
-
// ## Environment Config
|
|
11
|
-
|
|
12
|
-
const config = require('../config');
|
|
13
|
-
|
|
14
|
-
// ## Accessibility Task
|
|
15
|
-
// dependacy on markup task to have markup compiled
|
|
16
|
-
|
|
17
|
-
gulp.task('accessibility', () => {
|
|
18
|
-
|
|
19
|
-
return gulp.src(config.path.markup.destination)
|
|
20
|
-
//support for better error handling
|
|
21
|
-
.pipe(plumber())
|
|
22
|
-
//show only errors for AAA spec
|
|
23
|
-
.pipe(accessibility({
|
|
24
|
-
accessibilityLevel: 'WCAG2AAA',
|
|
25
|
-
reportLevels: {
|
|
26
|
-
notice: false,
|
|
27
|
-
warning: false,
|
|
28
|
-
error: true,
|
|
29
|
-
verbose: true
|
|
30
|
-
}
|
|
31
|
-
}))
|
|
32
|
-
.on('error', notify.onError('accessibility: <%= error.message %>'));
|
|
33
|
-
|
|
34
|
-
});
|
package/gulp/tasks/build.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const runSequence = require('run-sequence');
|
|
7
|
-
|
|
8
|
-
// ## Build Task
|
|
9
|
-
|
|
10
|
-
gulp.task('build', callback => {
|
|
11
|
-
//runSequence support is only for gulp 3.x, 4.x natively support this functionalty
|
|
12
|
-
return runSequence(
|
|
13
|
-
['data'],
|
|
14
|
-
['markup', 'style', 'script', 'documentation'],
|
|
15
|
-
['accessibility'],
|
|
16
|
-
callback
|
|
17
|
-
);
|
|
18
|
-
});
|
package/gulp/tasks/clean.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const rimraf = require('gulp-rimraf');
|
|
7
|
-
|
|
8
|
-
// ## Environment Config
|
|
9
|
-
|
|
10
|
-
const config = require('../config');
|
|
11
|
-
|
|
12
|
-
// ## cleanDeploy Task
|
|
13
|
-
|
|
14
|
-
gulp.task('cleanDeploy', (done) => {
|
|
15
|
-
'use strict';
|
|
16
|
-
return gulp.src(config.path.build, {read: false})
|
|
17
|
-
.pipe(rimraf());
|
|
18
|
-
});
|
package/gulp/tasks/data.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
|
|
8
|
-
// ## Environment Config
|
|
9
|
-
|
|
10
|
-
const config = require('../config');
|
|
11
|
-
|
|
12
|
-
// ## Data Write Config json Task
|
|
13
|
-
|
|
14
|
-
gulp.task('data', callback => {
|
|
15
|
-
|
|
16
|
-
fs.writeFile(
|
|
17
|
-
config.path.data.globalConfigFile,
|
|
18
|
-
JSON.stringify(config.path.data.globalConfig),
|
|
19
|
-
callback
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
});
|
package/gulp/tasks/default.js
DELETED
package/gulp/tasks/deploy.js
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const htmlmin = require('gulp-htmlmin');
|
|
7
|
-
const sourcemaps = require('gulp-sourcemaps');
|
|
8
|
-
const imagemin = require('gulp-imagemin');
|
|
9
|
-
const uglify = require('gulp-uglify');
|
|
10
|
-
const plumber = require('gulp-plumber');
|
|
11
|
-
const sitemap = require('gulp-sitemap');
|
|
12
|
-
const runSequence = require('run-sequence');
|
|
13
|
-
const cssnano = require('gulp-cssnano');
|
|
14
|
-
const sizereport = require('gulp-sizereport');
|
|
15
|
-
|
|
16
|
-
// ## Environment Config
|
|
17
|
-
|
|
18
|
-
const config = require('../config');
|
|
19
|
-
|
|
20
|
-
// ## Release Task
|
|
21
|
-
// release task dependent on tasks to do code quality checks and build documentation
|
|
22
|
-
|
|
23
|
-
gulp.task('deploy', callback => {
|
|
24
|
-
//runSequence support is only for gulp 3.x, 4.x natively support this functionalty
|
|
25
|
-
return runSequence(
|
|
26
|
-
['cleanDeploy'],
|
|
27
|
-
['data'],
|
|
28
|
-
['markup', 'style', 'script', 'documentation'],
|
|
29
|
-
['accessibility'],
|
|
30
|
-
['copyRoot', 'copyReport', 'copyFonts', 'minifyMarkup', 'copyData', 'minifyStyle', 'minifyScript',
|
|
31
|
-
'minifyImage', 'sitemap'],
|
|
32
|
-
['sizeReportCSS', 'sizeReportJS', 'sizeReportImage'],
|
|
33
|
-
callback
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// ## Copy Root Task
|
|
38
|
-
// copy root dependency files to deploy directory
|
|
39
|
-
gulp.task('copyRoot', () => {
|
|
40
|
-
return gulp.src(config.path.release.copy)
|
|
41
|
-
//support for better error handling
|
|
42
|
-
.pipe(plumber())
|
|
43
|
-
.pipe(gulp.dest(config.path.build));
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// ## Copy Report Task
|
|
48
|
-
// copy report dependency files to deploy directory
|
|
49
|
-
gulp.task('copyReport', () => {
|
|
50
|
-
return gulp.src(config.path.report.source)
|
|
51
|
-
//support for better error handling
|
|
52
|
-
.pipe(plumber())
|
|
53
|
-
.pipe(gulp.dest(config.path.build + '/' + config.path.report.destination));
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// ## Copy Fonts Task
|
|
58
|
-
// copy Font dependency files to deploy directory
|
|
59
|
-
gulp.task('copyFonts', () => {
|
|
60
|
-
return gulp.src(config.path.font.source)
|
|
61
|
-
//support for better error handling
|
|
62
|
-
.pipe(plumber())
|
|
63
|
-
.pipe(gulp.dest(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
64
|
-
config.path.font.destination));
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// ## Minify Markup Task
|
|
69
|
-
// minify and copy markup files to deploy directory
|
|
70
|
-
gulp.task('minifyMarkup', () => {
|
|
71
|
-
return gulp.src(config.path.markup.destination)
|
|
72
|
-
//support for better error handling
|
|
73
|
-
.pipe(plumber())
|
|
74
|
-
//minify
|
|
75
|
-
.pipe(htmlmin({
|
|
76
|
-
collapseWhitespace: true,
|
|
77
|
-
minifyJS: true
|
|
78
|
-
}))
|
|
79
|
-
.pipe(gulp.dest(config.path.build));
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// ## Copy Data Task
|
|
84
|
-
// copy data dependency files to deploy directory
|
|
85
|
-
gulp.task('copyData', () => {
|
|
86
|
-
return gulp.src(config.path.data.sourceGlob)
|
|
87
|
-
//support for better error handling
|
|
88
|
-
.pipe(plumber())
|
|
89
|
-
.pipe(gulp.dest(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
90
|
-
config.path.data.destination));
|
|
91
|
-
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// ## Sitemap Task
|
|
95
|
-
// generate sitemap.xml
|
|
96
|
-
gulp.task('sitemap', () => {
|
|
97
|
-
return gulp.src(config.path.markup.destination)
|
|
98
|
-
.pipe(sitemap({
|
|
99
|
-
siteUrl: config.path.www
|
|
100
|
-
}))
|
|
101
|
-
.pipe(gulp.dest(config.path.build));
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// ## Minify Style Task
|
|
106
|
-
// minify and copy style files to deploy diretory
|
|
107
|
-
gulp.task('minifyStyle', () => {
|
|
108
|
-
return gulp.src(config.path.style.source.css)
|
|
109
|
-
//support for better error handling
|
|
110
|
-
.pipe(plumber())
|
|
111
|
-
.pipe(sourcemaps.init())
|
|
112
|
-
.pipe(cssnano({safe: true}))
|
|
113
|
-
.pipe(sourcemaps.write('.'))
|
|
114
|
-
.pipe(gulp.dest(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
115
|
-
config.path.style.destination.release));
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// ## Minify Script Task
|
|
120
|
-
// minify and copy script files to deploy directory
|
|
121
|
-
gulp.task('minifyScript', () => {
|
|
122
|
-
return gulp.src(config.path.script.release)
|
|
123
|
-
//support for better error handling
|
|
124
|
-
.pipe(plumber())
|
|
125
|
-
.pipe(sourcemaps.init())
|
|
126
|
-
//minify
|
|
127
|
-
.pipe(uglify())
|
|
128
|
-
//write sourcemaps
|
|
129
|
-
.pipe(sourcemaps.write('.'))
|
|
130
|
-
.pipe(gulp.dest(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
131
|
-
config.path.script.destination));
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// ## Minify Image Task
|
|
136
|
-
// minify and copy images to deploy directory
|
|
137
|
-
gulp.task('minifyImage', () => {
|
|
138
|
-
return gulp.src(config.path.image.source)
|
|
139
|
-
//support for better error handling
|
|
140
|
-
.pipe(plumber())
|
|
141
|
-
//minify
|
|
142
|
-
.pipe(imagemin({
|
|
143
|
-
progressive: true,
|
|
144
|
-
multipass: true,
|
|
145
|
-
plugins: [
|
|
146
|
-
{cleanupAttrs: true},
|
|
147
|
-
{cleanupEnableBackground: true},
|
|
148
|
-
{cleanupIDs: true},
|
|
149
|
-
{cleanupNumericValues: true},
|
|
150
|
-
{collapseGroup: true},
|
|
151
|
-
{convertColors: true},
|
|
152
|
-
{convertPathData: true},
|
|
153
|
-
{convertShapeToPath: true},
|
|
154
|
-
{convertStyleToAttrs: true},
|
|
155
|
-
{convertTransform: true},
|
|
156
|
-
{mergePaths: true},
|
|
157
|
-
{moveElemsAttrsToGroup: true},
|
|
158
|
-
{moveGroupAttrsToElems: true},
|
|
159
|
-
{removeComments: true},
|
|
160
|
-
{removeDoctype: true},
|
|
161
|
-
{removeEditorsNSData: true},
|
|
162
|
-
{removeEmptyAttrs: true},
|
|
163
|
-
{removeEmptyContainers: true},
|
|
164
|
-
{removeEmptyText: true},
|
|
165
|
-
{removeHiddenElems: true},
|
|
166
|
-
{removeMetadata: true},
|
|
167
|
-
{removeNonInheritableGroupAttrs: true},
|
|
168
|
-
{removeRasterImages: true},
|
|
169
|
-
{removeTitle: true},
|
|
170
|
-
{removeUnknownsAndDefaults: true},
|
|
171
|
-
{removeUnusedNS: true},
|
|
172
|
-
{removeUselessStrokeAndFill: true},
|
|
173
|
-
{removeViewBox: true},
|
|
174
|
-
{removeXMLProcInst: true},
|
|
175
|
-
{sortAttrs: true},
|
|
176
|
-
{transformsWithOnePath: true}
|
|
177
|
-
]
|
|
178
|
-
}))
|
|
179
|
-
.pipe(gulp.dest(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
180
|
-
config.path.image.destination));
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
// ## CSS Size Report Task
|
|
184
|
-
// check to see how big the files being created are
|
|
185
|
-
gulp.task('sizeReportCSS', () => {
|
|
186
|
-
return gulp.src(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
187
|
-
config.path.style.destination.release + '/*.css')
|
|
188
|
-
.pipe(sizereport({
|
|
189
|
-
gzip: true,
|
|
190
|
-
'*': {
|
|
191
|
-
'maxGzippedSize': 25000
|
|
192
|
-
}
|
|
193
|
-
}));
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// ## JS Size Report Task
|
|
197
|
-
// check to see how big the files being created are
|
|
198
|
-
gulp.task('sizeReportJS', () => {
|
|
199
|
-
return gulp.src(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
200
|
-
config.path.script.destination + '/*.js')
|
|
201
|
-
.pipe(sizereport({
|
|
202
|
-
gzip: true,
|
|
203
|
-
'*': {
|
|
204
|
-
'maxGzippedSize': 200000
|
|
205
|
-
}
|
|
206
|
-
}));
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// ## Markup Size Report Task
|
|
210
|
-
// check to see how big the files being created are
|
|
211
|
-
gulp.task('sizeReportImage', () => {
|
|
212
|
-
return gulp.src(config.path.build + config.path.release.destination + config.path.version + '/' +
|
|
213
|
-
config.path.image.destination + '/**')
|
|
214
|
-
.pipe(plumber())
|
|
215
|
-
.pipe(sizereport({
|
|
216
|
-
gzip: true,
|
|
217
|
-
'*': {
|
|
218
|
-
'maxSize': 1000000,
|
|
219
|
-
'maxGzippedSize': 1000000
|
|
220
|
-
}
|
|
221
|
-
}));
|
|
222
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// ## Load Modules
|
|
4
|
-
|
|
5
|
-
const gulp = require('gulp');
|
|
6
|
-
const jsdoc = require('gulp-jsdoc3');
|
|
7
|
-
|
|
8
|
-
// ## Environment Config
|
|
9
|
-
|
|
10
|
-
const config = require('../config');
|
|
11
|
-
const jsdocConfig = require('../../jsdoc');
|
|
12
|
-
|
|
13
|
-
// ## jsdoc Task
|
|
14
|
-
// runs jsdoc
|
|
15
|
-
gulp.task('jsdoc', (callback) => {
|
|
16
|
-
gulp.src(config.path.script.all, {read: false})
|
|
17
|
-
.pipe(jsdoc(jsdocConfig, callback));
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// ## Documenation Task
|
|
21
|
-
// documentation task runs unit testing coverage and also js documentation
|
|
22
|
-
gulp.task('documentation', [
|
|
23
|
-
'jsdoc',
|
|
24
|
-
'unit'
|
|
25
|
-
], () => {
|
|
26
|
-
'use strict';
|
|
27
|
-
return;
|
|
28
|
-
});
|
package/gulp/tasks/markup.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// ## Load Modules
|
|
2
|
-
|
|
3
|
-
const gulp = require('gulp');
|
|
4
|
-
const htmllint = require('gulp-htmllint');
|
|
5
|
-
const plumber = require('gulp-plumber');
|
|
6
|
-
const notify = require('gulp-notify');
|
|
7
|
-
|
|
8
|
-
// ## Environment Config
|
|
9
|
-
|
|
10
|
-
const config = require('../config');
|
|
11
|
-
|
|
12
|
-
// ## Markup Task
|
|
13
|
-
// create .html files written to app root
|
|
14
|
-
|
|
15
|
-
gulp.task('markup', () => {
|
|
16
|
-
'use strict';
|
|
17
|
-
//task
|
|
18
|
-
return gulp.src(config.path.markup.destination)
|
|
19
|
-
//support for better error handling
|
|
20
|
-
.pipe(plumber())
|
|
21
|
-
//validate markup
|
|
22
|
-
.pipe(htmllint({
|
|
23
|
-
config: config.path.markup.htmlLint
|
|
24
|
-
}))
|
|
25
|
-
.on('error', notify.onError('markup: <%= error.message %>'));
|
|
26
|
-
});
|
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', '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
|
-
});
|