From e5ea8165a298b1244560ccc6dced2b751ea5db70 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Tue, 7 Nov 2023 11:31:28 +0100 Subject: [PATCH] chore: WIP - replace `nps` with npm scripts Fixes #5126 --- package-lock.json | 505 ++++++++++++++++++++++++++++++++++++++++++--- package-scripts.js | 311 ++++++++++------------------ package.json | 27 ++- 3 files changed, 607 insertions(+), 236 deletions(-) diff --git a/package-lock.json b/package-lock.json index f69412b755..1e2beca36f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,6 +72,7 @@ "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.30.0", "needle": "^2.5.0", + "npm-run-all2": "^6.1.1", "nps": "^5.10.0", "nyc": "^15.1.0", "pidtree": "^0.5.0", @@ -212,17 +213,89 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.21.0", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", @@ -427,9 +500,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -459,13 +532,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -12667,6 +12740,15 @@ "integrity": "sha512-EjtmtXFUu+wXm6PW3T6RT1ekQUxobC7B5TDCU0CS0212wzpwKiXs6vLun+JI+OoWmmliWdYqnrpjrlK7W3ELdQ==", "dev": true }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -13775,6 +13857,185 @@ "node": ">=4" } }, + "node_modules/npm-run-all2": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-6.1.1.tgz", + "integrity": "sha512-lWLbkPZ5BSdXtN8lR+0rc8caKoPdymycpZksyDEC9MOBvfdwTXZ0uVhb7bMcGeXv2/BKtfQuo6Zn3zfc8rxNXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "cross-spawn": "^7.0.3", + "memorystream": "^0.3.1", + "minimatch": "^9.0.0", + "pidtree": "^0.6.0", + "read-pkg": "^8.0.0", + "shell-quote": "^1.7.3" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "npm-run-all2": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0", + "npm": ">= 8" + } + }, + "node_modules/npm-run-all2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/npm-run-all2/node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/npm-run-all2/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/npm-run-all2/node_modules/normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-run-all2/node_modules/parse-json": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", + "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.21.4", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/parse-json/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/npm-run-all2/node_modules/read-pkg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^6.0.0", + "parse-json": "^7.0.0", + "type-fest": "^4.2.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-all2/node_modules/type-fest": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.6.0.tgz", + "integrity": "sha512-rLjWJzQFOq4xw7MgJrCZ6T1jIOvvYElXT12r+y0CC6u67hegDHaxcPqb2fZHOGlqxugGQPNB1EnTezjBetkwkw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -18712,6 +18973,15 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -22452,12 +22722,71 @@ } }, "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/compat-data": { @@ -22618,9 +22947,9 @@ "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -22641,13 +22970,13 @@ } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -32346,6 +32675,12 @@ } } }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true + }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -33127,6 +33462,122 @@ } } }, + "npm-run-all2": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-run-all2/-/npm-run-all2-6.1.1.tgz", + "integrity": "sha512-lWLbkPZ5BSdXtN8lR+0rc8caKoPdymycpZksyDEC9MOBvfdwTXZ0uVhb7bMcGeXv2/BKtfQuo6Zn3zfc8rxNXA==", + "dev": true, + "requires": { + "ansi-styles": "^6.2.1", + "cross-spawn": "^7.0.3", + "memorystream": "^0.3.1", + "minimatch": "^9.0.0", + "pidtree": "^0.6.0", + "read-pkg": "^8.0.0", + "shell-quote": "^1.7.3" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + }, + "hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "requires": { + "lru-cache": "^10.0.1" + } + }, + "json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true + }, + "lines-and-columns": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.3.tgz", + "integrity": "sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==", + "dev": true + }, + "lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "dev": true + }, + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "requires": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + } + }, + "parse-json": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-7.1.1.tgz", + "integrity": "sha512-SgOTCX/EZXtZxBE5eJ97P4yGM5n37BwRU+YMsH4vNzFqJV/oWFXXCmwFlgWUM4PrakybVOueJJ6pwHqSVhTFDw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.21.4", + "error-ex": "^1.3.2", + "json-parse-even-better-errors": "^3.0.0", + "lines-and-columns": "^2.0.3", + "type-fest": "^3.8.0" + }, + "dependencies": { + "type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true + } + } + }, + "pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true + }, + "read-pkg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-8.1.0.tgz", + "integrity": "sha512-PORM8AgzXeskHO/WEv312k9U03B8K9JSiWF/8N9sUuFjBa+9SF2u6K7VClzXwDXab51jCd8Nd36CNM+zR97ScQ==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.1", + "normalize-package-data": "^6.0.0", + "parse-json": "^7.0.0", + "type-fest": "^4.2.0" + } + }, + "type-fest": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.6.0.tgz", + "integrity": "sha512-rLjWJzQFOq4xw7MgJrCZ6T1jIOvvYElXT12r+y0CC6u67hegDHaxcPqb2fZHOGlqxugGQPNB1EnTezjBetkwkw==", + "dev": true + } + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -36934,6 +37385,12 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", diff --git a/package-scripts.js b/package-scripts.js index 1e4c072973..2e60c51094 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -36,226 +36,136 @@ function test(testName, mochaParams) { module.exports = { scripts: { - build: { - script: `rollup -c ./rollup.config.js`, - description: 'Build browser bundle' - }, - lint: { + testNode: { default: { - script: 'nps lint.code lint.markdown', - description: 'Lint code and Markdown documentation' + script: `nps ${[ + 'testNode.bdd', + 'testNode.tdd', + 'testNode.qunit', + 'testNode.exports', + 'testNode.unit', + 'testNode.integration', + 'testNode.jsapi', + 'testNode.requires', + 'testNode.reporters', + 'testNode.only' + ].join(' ')}`, + description: 'Run Node.js tests' }, - code: { - script: 'eslint . "bin/*"', - description: 'Run ESLint linter' + bdd: { + script: test('bdd', '--ui bdd test/interfaces/bdd.spec'), + description: 'Run Node.js BDD interface tests', + hiddenFromHelp: true }, - markdown: { - script: - 'markdownlint "*.md" "docs/**/*.md" ".github/*.md" "lib/**/*.md" "test/**/*.md" "example/**/*.md"', - description: 'Run markdownlint linter' - } - }, - format: { - default: { - script: 'nps format.eslint && nps format.prettier', - default: 'Format codebase w/ ESLint and Prettier' + tdd: { + script: test('tdd', '--ui tdd test/interfaces/tdd.spec'), + description: 'Run Node.js TDD interface tests', + hiddenFromHelp: true }, - eslint: { - script: 'eslint --fix . "bin/*"', - description: 'Format JavaScript files', + qunit: { + script: test('qunit', '--ui qunit test/interfaces/qunit.spec'), + description: 'Run Node.js QUnit interace tests', hiddenFromHelp: true }, - prettier: { - script: - 'prettier --write "!(package*).json" ".*.json" "lib/**/*.json" "*.yml"', - description: 'Format JSON & YAML files', + exports: { + script: test('exports', '--ui exports test/interfaces/exports.spec'), + description: 'Run Node.js exports interface tests', hiddenFromHelp: true - } - }, - clean: { - script: 'rimraf mocha.js mocha.js.map', - description: 'Clean browser bundle' - }, - test: { - default: { - script: 'nps lint test.node test.browser', - description: 'Run all linters and all tests' }, - node: { + unit: { + script: test( + 'unit', + '"test/unit/*.spec.js" "test/node-unit/**/*.spec.js"' + ), + description: 'Run Node.js unit tests' + }, + integration: { + script: test( + 'integration', + '--parallel --timeout 10000 --slow 3750 "test/integration/**/*.spec.js"' + ), + description: 'Run Node.js integration tests', + hiddenFromHelp: true + }, + jsapi: { + script: 'node test/jsapi', + description: 'Run Node.js Mocha JavaScript API tests', + hiddenFromHelp: true + }, + requires: { + script: test( + 'requires', + [ + '--require coffeescript/register', + '--require test/require/a.js', + '--require test/require/b.coffee', + '--require test/require/c.js', + '--require test/require/d.coffee', + 'test/require/require.spec.js' + ].join(' ') + ), + description: 'Run Node.js --require flag tests', + hiddenFromHelp: true + }, + reporters: { + script: test('reporters', '--timeout 500 "test/reporters/*.spec.js"'), + description: 'Run Node.js reporter tests', + hiddenFromHelp: true + }, + only: { default: { - script: `rimraf .nyc_output && nps ${[ - 'build', - 'test.node.bdd', - 'test.node.tdd', - 'test.node.qunit', - 'test.node.exports', - 'test.node.unit', - 'test.node.integration', - 'test.node.jsapi', - 'test.node.requires', - 'test.node.reporters', - 'test.node.only' - ].join(' ')}`, - description: 'Run Node.js tests' - }, - bdd: { - script: test('bdd', '--ui bdd test/interfaces/bdd.spec'), - description: 'Run Node.js BDD interface tests', - hiddenFromHelp: true - }, - tdd: { - script: test('tdd', '--ui tdd test/interfaces/tdd.spec'), - description: 'Run Node.js TDD interface tests', - hiddenFromHelp: true - }, - qunit: { - script: test('qunit', '--ui qunit test/interfaces/qunit.spec'), - description: 'Run Node.js QUnit interace tests', - hiddenFromHelp: true - }, - exports: { - script: test('exports', '--ui exports test/interfaces/exports.spec'), - description: 'Run Node.js exports interface tests', + script: `nps ${[ + 'testNode.only.bddRequire', + 'testNode.only.globalBdd', + 'testNode.only.globalTdd', + 'testNode.only.globalQunit' + ].join(' ')} `, + description: 'Run Node.js "only" functionality tests', hiddenFromHelp: true }, - unit: { + bddRequire: { script: test( - 'unit', - '"test/unit/*.spec.js" "test/node-unit/**/*.spec.js"' + 'only-bdd-require', + '--ui qunit test/only/bdd-require.spec --no-parallel' ), - description: 'Run Node.js unit tests' + description: 'Run Node.js "only" w/ QUnit interface tests', + hiddenFromHelp: true }, - integration: { + globalBdd: { script: test( - 'integration', - '--parallel --timeout 10000 --slow 3750 "test/integration/**/*.spec.js"' + 'only-global-bdd', + '--ui bdd test/only/global/bdd.spec --no-parallel' ), - description: 'Run Node.js integration tests', - hiddenFromHelp: true - }, - jsapi: { - script: 'node test/jsapi', - description: 'Run Node.js Mocha JavaScript API tests', + description: 'Run Node.js "global only" w/ BDD interface tests', hiddenFromHelp: true }, - requires: { + globalTdd: { script: test( - 'requires', - [ - '--require coffeescript/register', - '--require test/require/a.js', - '--require test/require/b.coffee', - '--require test/require/c.js', - '--require test/require/d.coffee', - 'test/require/require.spec.js' - ].join(' ') + 'only-global-tdd', + '--ui tdd test/only/global/tdd.spec --no-parallel' ), - description: 'Run Node.js --require flag tests', - hiddenFromHelp: true - }, - reporters: { - script: test('reporters', '--timeout 500 "test/reporters/*.spec.js"'), - description: 'Run Node.js reporter tests', - hiddenFromHelp: true - }, - only: { - default: { - script: `nps ${[ - 'test.node.only.bddRequire', - 'test.node.only.globalBdd', - 'test.node.only.globalTdd', - 'test.node.only.globalQunit' - ].join(' ')} `, - description: 'Run Node.js "only" functionality tests', - hiddenFromHelp: true - }, - bddRequire: { - script: test( - 'only-bdd-require', - '--ui qunit test/only/bdd-require.spec --no-parallel' - ), - description: 'Run Node.js "only" w/ QUnit interface tests', - hiddenFromHelp: true - }, - globalBdd: { - script: test( - 'only-global-bdd', - '--ui bdd test/only/global/bdd.spec --no-parallel' - ), - description: 'Run Node.js "global only" w/ BDD interface tests', - hiddenFromHelp: true - }, - globalTdd: { - script: test( - 'only-global-tdd', - '--ui tdd test/only/global/tdd.spec --no-parallel' - ), - description: 'Run Node.js "global only" w/ TDD interface tests', - hiddenFromHelp: true - }, - globalQunit: { - script: test( - 'only-global-qunit', - '--ui qunit test/only/global/qunit.spec --no-parallel' - ), - description: 'Run Node.js "global only" w/ QUnit interface tests', - hiddenFromHelp: true - } - } - }, - browser: { - default: { - script: - 'nps clean build test.browser.unit test.browser.bdd test.browser.tdd test.browser.qunit test.browser.esm test.browser.webpack', - description: 'Run browser tests' - }, - unit: { - script: - 'cross-env NODE_PATH=. karma start ./karma.conf.js --single-run --colors', - description: 'Run browser unit tests' - }, - bdd: { - script: 'cross-env MOCHA_TEST=bdd nps test.browser.unit', - description: 'Run browser BDD interface tests', + description: 'Run Node.js "global only" w/ TDD interface tests', hiddenFromHelp: true }, - tdd: { - script: 'cross-env MOCHA_TEST=tdd nps test.browser.unit', - description: 'Run browser TDD interface tests', - hiddenFromHelp: true - }, - qunit: { - script: 'cross-env MOCHA_TEST=qunit nps test.browser.unit', - description: 'Run browser QUnit interface tests', - hiddenFromHelp: true - }, - esm: { - script: 'cross-env MOCHA_TEST=esm nps test.browser.unit', - description: 'Run browser ES modules support test', - hiddenFromHelp: true - }, - webpack: { - script: - 'webpack --mode development --config ./test/browser-specific/fixtures/webpack/webpack.config.js', - description: 'Run Webpack compat test', + globalQunit: { + script: test( + 'only-global-qunit', + '--ui qunit test/only/global/qunit.spec --no-parallel' + ), + description: 'Run Node.js "global only" w/ QUnit interface tests', hiddenFromHelp: true } } }, - coveralls: { - script: 'nyc report --reporter=text-lcov | coveralls', - description: 'Send code coverage report to coveralls (run during CI)', - hiddenFromHelp: true - }, - 'coverage-report-lcov': { - script: 'nyc report --reporter=lcov', - description: 'Write LCOV report to disk (run tests with COVERAGE=1 first)' - }, - 'coverage-report': { - script: 'nyc report --reporter=html', - description: - 'Output HTML coverage report to coverage/index.html (run tests with COVERAGE=1 first)' - }, + // 'coverage-report-lcov': { + // script: 'nyc report --reporter=lcov', + // description: 'Write LCOV report to disk (run tests with COVERAGE=1 first)' + // }, + // 'coverage-report': { + // script: 'nyc report --reporter=html', + // description: + // 'Output HTML coverage report to coverage/index.html (run tests with COVERAGE=1 first)' + // }, docs: { default: { script: @@ -289,19 +199,6 @@ module.exports = { script: 'jsdoc -c jsdoc.conf.json', description: 'Build API docs' } - }, - updateAuthors: { - script: 'node scripts/update-authors.js', - description: 'Update list of AUTHORS' - }, - linkifyChangelog: { - script: 'node scripts/linkify-changelog.mjs', - description: 'Add/update GitHub links in CHANGELOG.md' - }, - version: { - script: - 'nps updateAuthors && nps linkifyChangelog && git add -A ./AUTHORS ./CHANGELOG.md', - description: 'Tasks to perform when `npm version` is run' } } }; diff --git a/package.json b/package.json index 1408b8715c..ce1eb058b7 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,28 @@ "node": ">= 14.0.0" }, "scripts": { - "lint": "npx eslint . --max-warnings 0", + "build": "rollup -c ./rollup.config.js", + "clean": "rimraf mocha.js mocha.js.map", + "format:eslint": "eslint --fix . 'bin/*'", + "format:prettier": "prettier --write '!(package*).json' '.*.json' 'lib/**/*.json' '*.yml'", + "format": "run-s format:*", + "lint:code": "eslint . 'bin/*' --max-warnings 0", + "lint:markdown": "markdownlint '*.md' 'docs/**/*.md' '.github/*.md' 'lib/**/*.md' 'test/**/*.md' 'example/**/*.md'", + "lint": "run-p lint:*", "prepublishOnly": "nps test clean build", - "start": "nps", - "test": "nps test", - "version": "nps version", - "test:smoke": "node ./bin/mocha --no-config test/smoke/smoke.spec.js" + "test-browser-unit": "cross-env NODE_PATH=. karma start ./karma.conf.js --single-run --colors", + "test-smoke": "node ./bin/mocha --no-config test/smoke/smoke.spec.js", + "test:0-node": "rimraf .nyc_output && run-s clean build && nps testNode", + "test:1-browser:bdd": "cross-env MOCHA_TEST=bdd run-s test-browser-unit", + "test:1-browser:esm": "cross-env MOCHA_TEST=esm run-s test-browser-unit", + "test:1-browser:qunit": "cross-env MOCHA_TEST=qunit run-s test-browser-unit", + "test:1-browser:tdd": "cross-env MOCHA_TEST=tdd run-s test-browser-unit", + "test:1-browser:webpack-compat": "webpack --mode development --config ./test/browser-specific/fixtures/webpack/webpack.config.js", + "test:1-browser": "run-s clean build test:1-browser:*", + "test": "run-s lint test:*", + "version:linkify-changelog": "node scripts/linkify-changelog.mjs", + "version:update-authors": "node scripts/update-authors.js", + "version": "run-p version:*" }, "dependencies": { "ansi-colors": "4.1.1", @@ -110,6 +126,7 @@ "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.30.0", "needle": "^2.5.0", + "npm-run-all2": "^6.1.1", "nps": "^5.10.0", "nyc": "^15.1.0", "pidtree": "^0.5.0",