From 0c75c9a11820d1d43527d163c2559e2696eee477 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Tue, 30 May 2023 12:59:37 -0700 Subject: [PATCH] fix: Ship to NPM without node version restrictions Before packaging for NPM, remove the "engines" section of package.json to avoid unnecessary restrictions on node versions for projects that simply depend on Shaka Player. The "engines" section and its restrictions still make sense for Shaka Player development. Closes #5243 --- .npmignore | 1 + package-lock.json | 61 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 8 +++++++ 3 files changed, 70 insertions(+) diff --git a/.npmignore b/.npmignore index c2f1700186..b5745ee842 100644 --- a/.npmignore +++ b/.npmignore @@ -3,6 +3,7 @@ .gitattributes .gitignore .release-please* +*.backup *.pyc app-engine/ build/ diff --git a/package-lock.json b/package-lock.json index 36c760bd2a..174ab280ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "awesomplete": "^1.1.5", "babel-plugin-istanbul": "^6.1.1", "cajon": "^0.4.4", + "clean-package": "^2.2.0", "code-prettify": "^0.1.0", "codem-isoboxer": "^0.3.7", "color-themes-for-google-code-prettify": "^2.0.4", @@ -3078,6 +3079,18 @@ "node": ">=0.10.0" } }, + "node_modules/clean-package": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-package/-/clean-package-2.2.0.tgz", + "integrity": "sha512-vLv8kRqvh4smPDpqAYFPLEijTppAd/cfCz4yBcUGoVl/JKu6ZWKhlo+G/cAmwlSa29RudfBeuyiNEzas8bTwEQ==", + "dev": true, + "dependencies": { + "dot-prop": "^6.0.1" + }, + "bin": { + "clean-package": "bin/main.js" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -3584,6 +3597,21 @@ "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", "dev": true }, + "node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -5087,6 +5115,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -10867,6 +10904,15 @@ } } }, + "clean-package": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-package/-/clean-package-2.2.0.tgz", + "integrity": "sha512-vLv8kRqvh4smPDpqAYFPLEijTppAd/cfCz4yBcUGoVl/JKu6ZWKhlo+G/cAmwlSa29RudfBeuyiNEzas8bTwEQ==", + "dev": true, + "requires": { + "dot-prop": "^6.0.1" + } + }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -11280,6 +11326,15 @@ "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", "dev": true }, + "dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -12423,6 +12478,12 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", diff --git a/package.json b/package.json index 323e812cdd..8fdfc6beb2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "awesomplete": "^1.1.5", "babel-plugin-istanbul": "^6.1.1", "cajon": "^0.4.4", + "clean-package": "^2.2.0", "code-prettify": "^0.1.0", "codem-isoboxer": "^0.3.7", "color-themes-for-google-code-prettify": "^2.0.4", @@ -95,6 +96,8 @@ }, "license": "Apache-2.0", "scripts": { + "prepack": "clean-package", + "postpack": "clean-package restore", "prepublishOnly": "python build/checkversion.py && python build/all.py --force" }, "dependencies": { @@ -102,5 +105,10 @@ }, "engines": { "node": ">=14" + }, + "clean-package": { + "remove": [ + "engines" + ] } }