From 35320c29f6c30da8755382c6acaf857310f12bfd Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Thu, 25 Jul 2019 19:12:34 -0600 Subject: [PATCH 1/2] Comment on why bourbon-neat is pinned This will actually fail `npm install` if you try upgrading the version. --- .gitignore | 1 - bin/preinstall.js | 17 +++++++++++++++++ package.json | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 bin/preinstall.js diff --git a/.gitignore b/.gitignore index 49f63fe4..d65d2024 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ *.map .ropeproject/ .ruby-version -bin/ dist/ bower_components/ include/ diff --git a/bin/preinstall.js b/bin/preinstall.js new file mode 100755 index 00000000..ed5557de --- /dev/null +++ b/bin/preinstall.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +const package = require('../package.json'); + +// Sorry everyone, this is the closest we can get to commenting on package.json +// dependencies :( +if (package.devDependencies['bourbon-neat'] !== '~1.9') { + // Wyrm is not compatible with Neat 2.0+, and Neat 1.9 at least pins a + // node-sass version that doesn't require Python 2. The changes to Wyrm to + // support Neat 2.0+ are all fairly minor changes, but it deeply affects the + // grid system and might be more of a liability than an old release of Neat. + // See: https://github.com/readthedocs/sphinx_rtd_theme/pull/771 + console.error( + 'bourbon-neat 1.9 is required, Wyrm is not compatible with Neat 2.0+' + ); + process.exit(1); +} diff --git a/package.json b/package.json index 93371e6b..f21b8790 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "private": true, "scripts": { "dev": "webpack-dev-server --open --config webpack.dev.js", - "build": "webpack --config webpack.prod.js" + "build": "webpack --config webpack.prod.js", + "preinstall": "bin/preinstall.js" }, "dependencies": {}, "devDependencies": { From 9b58009a973d8cc24898a50726c09e27e459fce9 Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Fri, 26 Jul 2019 09:35:10 -0600 Subject: [PATCH 2/2] Add a bit more error logging to preinstall check --- bin/preinstall.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/preinstall.js b/bin/preinstall.js index ed5557de..536fe5a3 100755 --- a/bin/preinstall.js +++ b/bin/preinstall.js @@ -11,7 +11,10 @@ if (package.devDependencies['bourbon-neat'] !== '~1.9') { // grid system and might be more of a liability than an old release of Neat. // See: https://github.com/readthedocs/sphinx_rtd_theme/pull/771 console.error( - 'bourbon-neat 1.9 is required, Wyrm is not compatible with Neat 2.0+' + 'bourbon-neat 1.9 is required, Wyrm is not compatible with Neat 2.0+.' + ); + console.error( + 'The expected selector for the bourbon-neat dependency in package.json is "~1.9".' ); process.exit(1); }