From ed5f31b2488365634b5342021eec10e116436ab0 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Mon, 5 Feb 2018 15:52:56 +0000 Subject: [PATCH 1/2] Update grunt-contrib-less to latest version Note that this also updates less to 2.7. This change is required so that variables can be injected by the Less compiler. This is useful for allowing feature flags. --- services/web/npm-shrinkwrap.json | 172 ++++++++++++++++++++++--------- services/web/package.json | 2 +- 2 files changed, 123 insertions(+), 51 deletions(-) diff --git a/services/web/npm-shrinkwrap.json b/services/web/npm-shrinkwrap.json index 904ff9d326..765fc1f03e 100644 --- a/services/web/npm-shrinkwrap.json +++ b/services/web/npm-shrinkwrap.json @@ -3014,27 +3014,15 @@ } }, "grunt-contrib-less": { - "version": "0.9.0", - "from": "grunt-contrib-less@0.9.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-less/-/grunt-contrib-less-0.9.0.tgz", + "version": "1.4.1", + "from": "grunt-contrib-less@1.4.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-less/-/grunt-contrib-less-1.4.1.tgz", "dev": true, "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "from": "ansi-styles@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "dev": true - }, - "chalk": { - "version": "0.4.0", - "from": "chalk@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "dev": true - }, - "strip-ansi": { - "version": "0.1.1", - "from": "strip-ansi@~0.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "async": { + "version": "2.6.0", + "from": "async@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "dev": true } } @@ -3165,12 +3153,6 @@ } } }, - "grunt-lib-contrib": { - "version": "0.6.1", - "from": "grunt-lib-contrib@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/grunt-lib-contrib/-/grunt-lib-contrib-0.6.1.tgz", - "dev": true - }, "grunt-mocha-test": { "version": "0.9.0", "from": "grunt-mocha-test@0.9.0", @@ -3601,6 +3583,13 @@ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "dev": true }, + "image-size": { + "version": "0.5.5", + "from": "image-size@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "dev": true, + "optional": true + }, "import-lazy": { "version": "2.1.0", "from": "import-lazy@>=2.1.0 <3.0.0", @@ -4277,36 +4266,125 @@ } }, "less": { - "version": "1.6.3", - "from": "less@>=1.6.0 <1.7.0", - "resolved": "https://registry.npmjs.org/less/-/less-1.6.3.tgz", + "version": "2.7.3", + "from": "less@>=2.7.1 <2.8.0", + "resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz", "dev": true, "dependencies": { - "clean-css": { - "version": "2.0.8", - "from": "clean-css@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.0.8.tgz", + "ajv": { + "version": "4.11.8", + "from": "ajv@>=4.9.1 <5.0.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "dev": true, "optional": true }, - "commander": { - "version": "2.0.0", - "from": "commander@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.0.0.tgz", + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "dev": true, "optional": true }, - "mime": { - "version": "1.2.11", - "from": "mime@>=1.2.0 <1.3.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "dev": true, "optional": true }, - "mkdirp": { - "version": "0.3.5", - "from": "mkdirp@~0.3.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "from": "form-data@>=2.1.1 <2.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "dev": true, + "optional": true + }, + "har-schema": { + "version": "1.0.5", + "from": "har-schema@>=1.0.5 <2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "from": "har-validator@>=4.2.1 <4.3.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "from": "hawk@>=3.1.3 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "dev": true, + "optional": true + }, + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "dev": true, + "optional": true + }, + "performance-now": { + "version": "0.2.0", + "from": "performance-now@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "dev": true, + "optional": true + }, + "promise": { + "version": "7.3.1", + "from": "promise@>=7.1.1 <8.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "from": "qs@>=6.4.0 <6.5.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "dev": true, + "optional": true + }, + "request": { + "version": "2.81.0", + "from": "request@2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.5.7", + "from": "source-map@>=0.5.3 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "dev": true, "optional": true } @@ -9457,12 +9535,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz" } } - }, - "zlib-browserify": { - "version": "0.0.1", - "from": "zlib-browserify@0.0.1", - "resolved": "https://registry.npmjs.org/zlib-browserify/-/zlib-browserify-0.0.1.tgz", - "dev": true } } } diff --git a/services/web/package.json b/services/web/package.json index f03df3d837..7cb82b05d6 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -102,7 +102,7 @@ "grunt-cli": "^1.2.0", "grunt-contrib-clean": "0.5.0", "grunt-contrib-coffee": "0.10.0", - "grunt-contrib-less": "0.9.0", + "grunt-contrib-less": "1.4.x", "grunt-contrib-requirejs": "0.4.1", "grunt-contrib-watch": "^1.0.0", "grunt-env": "0.4.4", From 3c3bb0a8925ba36fd3f1fc4cdea7b8eb9e8fd085 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 5 Feb 2018 16:20:33 +0000 Subject: [PATCH 2/2] Use globalVars strategy to do v2-specific styling. --- services/web/Gruntfile.coffee | 4 ++++ services/web/public/stylesheets/core/_common-variables.less | 1 - services/web/public/stylesheets/core/ol-variables.less | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/web/Gruntfile.coffee b/services/web/Gruntfile.coffee index a0000360b3..2b8cc27421 100644 --- a/services/web/Gruntfile.coffee +++ b/services/web/Gruntfile.coffee @@ -150,6 +150,8 @@ module.exports = (grunt) -> sourceMap: true sourceMapFilename: "public/stylesheets/style.css.map" sourceMapBasepath: "public/stylesheets" + globalVars: + 'is-overleaf': false files: "public/stylesheets/style.css": "public/stylesheets/style.less" ol: @@ -157,6 +159,8 @@ module.exports = (grunt) -> sourceMap: true sourceMapFilename: "public/stylesheets/ol-style.css.map" sourceMapBasepath: "public/stylesheets" + globalVars: + 'is-overleaf': true files: "public/stylesheets/ol-style.css": "public/stylesheets/ol-style.less" diff --git a/services/web/public/stylesheets/core/_common-variables.less b/services/web/public/stylesheets/core/_common-variables.less index 8b666e7b58..fdd53a4528 100644 --- a/services/web/public/stylesheets/core/_common-variables.less +++ b/services/web/public/stylesheets/core/_common-variables.less @@ -799,7 +799,6 @@ // Custom -@is-overleaf : false; @header-height : 68px; @footer-height : 50px; diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 53f4491aa1..82d930cc72 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -1,7 +1,5 @@ @import "./_common-variables.less"; -@is-overleaf: true; - @font-family-sans-serif: "Lato", sans-serif; @header-height: 68px;