From 66520a2780be2a7ca4dc15b001d2262d706026b6 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 09:59:24 -0500 Subject: [PATCH 1/7] Run inline JavaScript through js-babel Signed-off-by: Andrew Welch --- composer.json | 2 +- gulpfile.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2886e85..b67aa6d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "nystudio107/craft", "description": "nystudio107 Craft 3 CMS scaffolding project", - "version": "1.0.3", + "version": "1.0.4", "keywords": [ "craft", "cms", diff --git a/gulpfile.js b/gulpfile.js index 1c8fd62..fb30583 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -146,7 +146,7 @@ gulp.task("components", () => { }); // inline js task - minimize the inline Javascript into _inlinejs in the templates path -gulp.task("js-inline", () => { +gulp.task("js-inline", ["js-babel"], () => { $.fancyLog("-> Copying inline js"); return gulp.src(pkg.globs.inlineJs) .pipe($.plumber({errorHandler: onError})) @@ -167,7 +167,7 @@ gulp.task("js-inline", () => { }); // js task - minimize any distribution Javascript into the public js folder, and add our banner to it -gulp.task("js", ["js-inline", "js-babel"], () => { +gulp.task("js", ["js-inline"], () => { $.fancyLog("-> Building js"); return gulp.src(pkg.globs.distJs) .pipe($.plumber({errorHandler: onError})) From 041341d3ac0ac4c030d53be6bd86e19231c21457 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 09:59:38 -0500 Subject: [PATCH 2/7] Version 1.0.4 Signed-off-by: Andrew Welch --- CHANGELOG.md | 6 ++++++ package.json | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c7419..a5fb489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # nystudio107/craft Change Log +## 1.0.4 - 2017.12.06 +### Changed +* Fixed asset versioning in `sw.js` +* Run all inline JavaScript through `js-babel` for ES6 goodness + + ## 1.0.3 - 2017.12.05 ### Changed * Updated for Craft CMS 3 RC1 release diff --git a/package.json b/package.json index 49430f4..640ab5d 100644 --- a/package.json +++ b/package.json @@ -113,9 +113,9 @@ "./node_modules/fontfaceobserver/fontfaceobserver.js", "./node_modules/loadjs/dist/loadjs.min.js", "./node_modules/tiny-cookie/tiny-cookie.min.js", - "./src/js/tab-handler.js", - "./src/js/register-service-worker.js", - "./src/js/asyncload-site-fonts.js" + "./build/js/tab-handler.js", + "./build/js/register-service-worker.js", + "./build/js/asyncload-site-fonts.js" ], "siteIcon": "./web/img/site/favicon.*" }, From b5f8fa175e0dd7d495cf9b1ca0a84cbcd1c3e89d Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 10:00:11 -0500 Subject: [PATCH 3/7] Fix ServiceWorker asset urls Signed-off-by: Andrew Welch --- templates/sw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/sw.js b/templates/sw.js index eee6eb1..c9e3071 100644 --- a/templates/sw.js +++ b/templates/sw.js @@ -29,9 +29,9 @@ ]; const staticAssets = [ - '{{ baseUrl }}js/lazysizes.min{{staticAssetsVersion}}.js', + '{{ baseUrl }}js/lazysizes.min.{{staticAssetsVersion}}.js', - '{{ baseUrl }}css/site.combined.min{{staticAssetsVersion}}.css' + '{{ baseUrl }}css/site.combined.min.{{staticAssetsVersion}}.css' ]; From d7726df4d48283b212d3c0ccb28e5dfaa4a2294b Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 11:17:20 -0500 Subject: [PATCH 4/7] Add base support for Vue and Axios Signed-off-by: Andrew Welch --- templates/_layouts/_layout.twig | 87 +++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 14 deletions(-) diff --git a/templates/_layouts/_layout.twig b/templates/_layouts/_layout.twig index 6cd22ae..e8be686 100755 --- a/templates/_layouts/_layout.twig +++ b/templates/_layouts/_layout.twig @@ -15,6 +15,7 @@ + {# -- Any tags that should be included in the header #} {% block _head_links %} {% endblock %} @@ -38,6 +39,7 @@ + {# -- Inline CSS block used by templates for Critical CSS #} {% block _inline_css %} {% endblock %} @@ -100,13 +102,18 @@
+ {# -- Info header, including _navbar.twig -- #} {% include "_partials/_info_header.twig" %} - -
- {% block content %} - {% endblock %} -
- + +
+
+ {# -- Primary content block -- #} + {% block content %} + {% endblock %} +
+
+ + {# -- Content that appears below the primary content block -- #} {% block subcontent %} {% endblock %} @@ -115,15 +122,67 @@ {# -- HTML Footer -- #} {% include "_partials/_global_footer.twig" %} - - {# -- Inline JS -- #} - {% block _inline_js %} - {% endblock %} - +
- {% block analytics %} - {% endblock %} + {# -- VueJS & Axios, along with our main app component instantiation -- #} + + + {# -- Inline JS -- #} + {% block _inline_js %} + {% endblock %} + {% endminify %} - + From b9e4e3ed8bc34dbaca9b688eb5c960b69bd06dad Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 11:17:35 -0500 Subject: [PATCH 5/7] Add base support for Vue and Axios Signed-off-by: Andrew Welch --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5fb489..c1f4d47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * Fixed asset versioning in `sw.js` * Run all inline JavaScript through `js-babel` for ES6 goodness +### Added +* Added base VueJS and Axios support ## 1.0.3 - 2017.12.05 ### Changed From 1ce573bd05cf1e8cb0ad9de5c1a27e9e916cd096 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 11:18:55 -0500 Subject: [PATCH 6/7] Added base support for Vue and Axois Signed-off-by: Andrew Welch --- package.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 640ab5d..06ecba3 100644 --- a/package.json +++ b/package.json @@ -113,20 +113,22 @@ "./node_modules/fontfaceobserver/fontfaceobserver.js", "./node_modules/loadjs/dist/loadjs.min.js", "./node_modules/tiny-cookie/tiny-cookie.min.js", - "./build/js/tab-handler.js", - "./build/js/register-service-worker.js", - "./build/js/asyncload-site-fonts.js" + "./src/js/tab-handler.js", + "./src/js/register-service-worker.js", + "./src/js/asyncload-site-fonts.js" ], "siteIcon": "./web/img/site/favicon.*" }, "dependencies": { + "axios": "^0.17.1", "fg-loadcss": "^1.2.0", "fontfaceobserver": "^2.0.5", "lazysizes": "^2.0.6", "loadjs": "^3.3.1", "normalize.css": "^5.0.0", "picturefill": "^3.0.2", - "tiny-cookie": "^1.0.1" + "tiny-cookie": "^1.0.1", + "vue": "^2.5.9" }, "devDependencies": { "babel-plugin-transform-runtime": "^6.15.0", From 6f679ebbfa28f0bf5ac32d66a410f903a5bfa405 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Dec 2017 12:02:06 -0500 Subject: [PATCH 7/7] Add base support for Vue and Axios Signed-off-by: Andrew Welch --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 06ecba3..fee982a 100644 --- a/package.json +++ b/package.json @@ -100,9 +100,11 @@ ], "distJs": [ "./build/js/*.js", + "./node_modules/axios/dist/axios.min.js", "./node_modules/lazysizes/lazysizes.min.js", "./node_modules/lazysizes/plugins/bgset/ls.bgset.min.js", - "./node_modules/picturefill/dist/picturefill.min.js" + "./node_modules/picturefill/dist/picturefill.min.js", + "./node_modules/vue/dist/vue.min.js" ], "babelJs": [ "./src/js/*.js"