From ab8541da28f2fad0393d1b61fdc40b35fa726145 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Thu, 9 Feb 2017 22:44:06 +0100 Subject: [PATCH 1/2] Option to remove the javascript-bundle from the page This can be achieved by overriding the partial `base/javascript-libs` with an empty file. --- handlebars/partials/base/javascript-libs.hbs | 7 +++++++ handlebars/templates/index.html.hbs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 handlebars/partials/base/javascript-libs.hbs diff --git a/handlebars/partials/base/javascript-libs.hbs b/handlebars/partials/base/javascript-libs.hbs new file mode 100644 index 0000000..42c50d4 --- /dev/null +++ b/handlebars/partials/base/javascript-libs.hbs @@ -0,0 +1,7 @@ +{{! + This partial is rendered below the `footer`-partial of the page. It includes the + javascript-bundle generated by `customize-engine-uglify`. If you don't want to + include the javascript-bundle, because you do not require the bootstrap-javascript, + you can override this partial with an empty one. +}} + diff --git a/handlebars/templates/index.html.hbs b/handlebars/templates/index.html.hbs index dee8103..6a50cdb 100644 --- a/handlebars/templates/index.html.hbs +++ b/handlebars/templates/index.html.hbs @@ -20,6 +20,6 @@ {{>base/body}} {{>base/footer}} - +{{>base/javascript-libs}} From dad44868f3c2a2ee2f1522ef4dfaa74dd6e91df5 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Tue, 14 Mar 2017 23:59:51 +0100 Subject: [PATCH 2/2] Update dependencies, use Standard as dev-dependency, fix code-style --- .travis.yml | 1 - package.json | 22 ++++++++++++---------- test/main-spec.js | 11 ++++++----- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7d5c1b..843004b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ node_js: - "6" - "7" before_script: - - npm install standard - standard script: - npm install istanbul diff --git a/package.json b/package.json index e94f6c5..7acf63a 100644 --- a/package.json +++ b/package.json @@ -25,21 +25,23 @@ }, "homepage": "https://github.com/bootprint/bootprint-base", "dependencies": { - "bootstrap": "^3.3.2", - "cheerio": "^0.19.0", - "handlebars": "^3.0.0", - "highlight.js": "^8.4.0", + "bootstrap": "^3.3.7", + "cheerio": "^0.22.0", + "handlebars": "^4.0.6", + "highlight.js": "^8", "jquery": "^2", - "json-stable-stringify": "^1.0.0", - "marked": "^0.3.3" + "json-stable-stringify": "^1.0.1", + "marked": "^0.3.6" }, "devDependencies": { "bootprint": "^1.0.0", "chai": "^3.5.0", - "ghooks": "^1.0.3", - "m-io": "^0.3.1", - "mocha": "^2.4.5", - "thoughtful-release": "^0.3.0", + "dirty-chai": "^1.2.2", + "ghooks": "^2.0.0", + "m-io": "^0.5.0", + "mocha": "^3.2.0", + "standard": "^9.0.1", + "thoughtful-release": "^0.3.1", "trace-and-clarify-if-possible": "^1.0.0" }, "peerDependencies": { diff --git a/test/main-spec.js b/test/main-spec.js index 5e850f7..d348b7b 100644 --- a/test/main-spec.js +++ b/test/main-spec.js @@ -5,11 +5,12 @@ * Released under the MIT license. */ -/* global describe */ -/* global it */ -/* global before */ +/* eslint-env mocha */ + +var chai = require('chai') +chai.use(require('dirty-chai')) +var expect = chai.expect -var expect = require('chai').expect var path = require('path') var qfs = require('m-io/fs') var fs = require('fs') @@ -53,7 +54,7 @@ describe('The bootprint-base module', function () { var jqueryIndex = bundle.indexOf('jQuery requires a window with a document') var bootstrapIndex = bundle.indexOf("Bootstrap's JavaScript requires jQuery") - expect(jqueryIndex < bootstrapIndex, 'jQuery must be included before Bootstrap').to.be.true + expect(jqueryIndex < bootstrapIndex, 'jQuery must be included before Bootstrap').to.be.true() }) }) })