From e099e91cb6ff9cbb7912af86d22b91cd855a1ad0 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Fri, 16 Sep 2022 13:05:17 +0100 Subject: [PATCH] fix: remove postinstall script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was needed a few years ago to let people know that without active support I'd (remy) wouldn't feel like there's any actual support to help me maintain this project. Since then (it's been a good few years), there's been a few things come up. Firstly, the `||` breaks (some) powershell users. Not all, I could never replicate the problem myself, but others definitely experience it. Then there was the `npm fund` attempt to support projects. In honesty, this does zero to actually support nodemon. The reality is that people want their tools (and software) for free, so asking users to run an extra step after installing (the `npm fund` bit) and _then_ pick a project they want to support *and then* do the payment thing was just way way too much. I know I don't use it, and I'm positive others don't too. The majority of early supporters of nodemon have been individuals, and I know it was because of the postinstall script I added back in 2018: https://remysharp.com/2018/01/10/open-source-with-a-cap-in-hand Lastly, the vast, vast majority of financial supporters to nodemon in the last 12 months haven't been individuals. Nor have they been companies (with the exceptions being opencollective themselves and Frontend Masters - both, thank you, it means a lot). The recent supporters have come from an…"odd" spot of the internet. Perhaps to help their SEO ranking, I'm not sure, but I am going to take their money as a way of them saying "let's support the many developers who use nodemon by giving it's maintainer financial support". So, long story short: I've removed the postinstall, and hopefully this reduces the noise to you, the amazing day-job developer, and hopefully that odd corner of the web continues their donations, as I'm positive they're not using the `npm fund`! --- bin/postinstall.js | 31 ------------------------------- package.json | 4 +--- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100755 bin/postinstall.js diff --git a/bin/postinstall.js b/bin/postinstall.js deleted file mode 100755 index 34c8194d..00000000 --- a/bin/postinstall.js +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env node - -function main() { - if (process.env.SUPPRESS_SUPPORT || process.env.OPENCOLLECTIVE_HIDE || process.env.CI) { - return; - } - - const message = '\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n'; - - try { - const Configstore = require('configstore'); - const pkg = require(__dirname + '/../package.json'); - const now = Date.now(); - - var week = 1000 * 60 * 60 * 24 * 7; - - // create a Configstore instance with an unique ID e.g. - // Package name and optionally some default values - const conf = new Configstore(pkg.name); - const last = conf.get('lastCheck'); - - if (!last || now - week > last) { - console.log(message); - conf.set('lastCheck', now); - } - } catch (e) { - console.log(message); - } -} - -main(); diff --git a/package.json b/package.json index b22d7dfa..1bf36940 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "commitmsg": "commitlint -e", "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", "lint": "eslint lib/**/*.js", - ":spec": "node_modules/.bin/mocha --timeout 30000 --ui bdd test/**/*.test.js", "test": "npm run lint && npm run spec", "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", "postspec": "npm run clean", @@ -40,8 +39,7 @@ "web": "node web", "semantic-release": "semantic-release", "prepush": "npm run lint", - "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9", - "postinstall": "node bin/postinstall || exit 0" + "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9" }, "devDependencies": { "@commitlint/cli": "^11.0.0",