From bd867da83bd7164ba9bab6c88fb792b6af07747b Mon Sep 17 00:00:00 2001 From: "E.T" Date: Mon, 22 Apr 2024 15:11:07 +0200 Subject: [PATCH] remove postinstall script that breaks npm install (#15) --- CHANGELOG.md | 7 +++++++ lib/checkUpdates.js | 43 ------------------------------------------- package.json | 4 +--- 3 files changed, 8 insertions(+), 46 deletions(-) delete mode 100644 lib/checkUpdates.js diff --git a/CHANGELOG.md b/CHANGELOG.md index f36dedf..220891b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2024-04-22 + +### Fixed + +- Removed logic to automatically detect out of date stylelint plugins. Unfortunately, this [fails in an +unrecoverable way with the latest versions of some stylelint plugins](https://github.com/nodejs/node/issues/33460), breaking `npm install`. + ## [2.0.0] - 2022-10-03 ## Added diff --git a/lib/checkUpdates.js b/lib/checkUpdates.js deleted file mode 100644 index a711f0a..0000000 --- a/lib/checkUpdates.js +++ /dev/null @@ -1,43 +0,0 @@ -const pkg = require('../package.json'); - -const getInstalledVersion = ({ name, version }) => { - const installedVersion = require(`${name}/package.json`).version; - return version === installedVersion ? false : installedVersion; -}; - -const getVersionNumber = string => { - const semver = /[~^><=x]/gi; - return string.replace(semver, ''); -}; - -const checkUpdates = () => { - console.log(`\nstylelint-config-apostrophe:\n - Checking for stylelint-config updates...`); - - const { dependencies } = pkg; - - const availableUpdates = {}; - - Object.keys(dependencies).forEach(dependency => { - const name = dependency; - const version = getVersionNumber(dependencies[dependency]); - - const updateAvailable = getInstalledVersion({ - name, - version - }); - if (updateAvailable) { - availableUpdates[name] = updateAvailable; - } - }); - - if (Object.keys(availableUpdates).length) { - console.log(` - Updates available for the following configs: \n -${JSON.stringify(availableUpdates, null, 4)}\n`); - } else { - console.log(' 🎉 Stylelint config is up to date.'); - } -}; - -module.exports.check = checkUpdates(); diff --git a/package.json b/package.json index c65dac1..3d31941 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,11 @@ { "name": "stylelint-config-apostrophe", - "version": "2.0.0", + "version": "2.0.1", "description": "stylelint configuration for apostrophe and related core modules", "main": "index.js", "scripts": { - "check": "node ./lib/checkUpdates", "compare": "node ./lib/index", "test": "eslint . && npx mocha && npm run stylelint", - "postinstall": "npm run check", "stylelint": "npx stylelint 'test/*.scss' --custom-syntax postcss-scss --config stylelintrc.json" }, "repository": {