From 847f6a18a947ea7ab6694e103d6c2d4bcafac16e Mon Sep 17 00:00:00 2001 From: jdalton Date: Sat, 7 Dec 2024 19:26:43 -0500 Subject: [PATCH] Update release script to account for bundled deps --- .gitignore | 1 - packages/npm/assert/package-lock.json | 146 +++++++++++++ packages/npm/deep-equal/package-lock.json | 254 ++++++++++++++++++++++ scripts/release-npm-packages.js | 40 +++- scripts/update-npm-package-publish.js | 15 +- 5 files changed, 445 insertions(+), 11 deletions(-) create mode 100644 packages/npm/assert/package-lock.json create mode 100644 packages/npm/deep-equal/package-lock.json diff --git a/.gitignore b/.gitignore index 8ef0ccd6..32aa63f0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,4 @@ Thumbs.db **/node_modules /*.tsbuildinfo -packages/npm/**/package-lock.json test/**/node_workspaces diff --git a/packages/npm/assert/package-lock.json b/packages/npm/assert/package-lock.json new file mode 100644 index 00000000..c981eea1 --- /dev/null +++ b/packages/npm/assert/package-lock.json @@ -0,0 +1,146 @@ +{ + "name": "@socketregistry/assert", + "version": "1.0.10", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@socketregistry/assert", + "version": "1.0.10", + "bundleDependencies": [ + "@socketregistry/original__assert" + ], + "license": "MIT", + "dependencies": { + "@socketregistry/original__assert": "npm:assert@2.1.0" + }, + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/@socketregistry/original__assert": { + "name": "assert", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, + "node_modules/call-bind": { + "name": "@socketregistry/assert", + "version": "1.0.6-overrides-call-bind", + "resolved": "https://registry.npmjs.org/@socketregistry/assert/-/assert-1.0.6-overrides-call-bind.tgz", + "integrity": "sha512-bpOIS/guz/5UNtmpihjJfa+PXm4L7KjS8PsO0j2G3gPMPtxCqJenL5injNZwGU8DA+/kOUkdVrFTlIafx4oQ7A==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "inBundle": true, + "license": "ISC" + }, + "node_modules/is-arguments": { + "name": "@socketregistry/is-arguments", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-arguments/-/is-arguments-1.0.5.tgz", + "integrity": "sha512-Iozv0wGyOJdNwaidhIMX556q1fzPVBjv6MJb3B3UBRcMhogRiM09zfYngDLslSsp6aHRpqb8mBGf0v+Huet2/w==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-generator-function": { + "name": "@socketregistry/is-generator-function", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-generator-function/-/is-generator-function-1.0.5.tgz", + "integrity": "sha512-70FLcIfYK/Z6C4cE/1cGw15OBb6NboJ3NmjtFnLmuRVA6sBW8+z8Gl/ikrv91OncNrm95yMJMS0qSJQ4rEIgmA==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-nan": { + "name": "@socketregistry/is-nan", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-nan/-/is-nan-1.0.5.tgz", + "integrity": "sha512-G5MLJwXh/wff1iSrrV1BQ6SxjxSzyHp+0bj2wEmY6WErn7uoLDthvLlLyOd+3w+HzHRSLlDb7yWlVhv9qcq+Ow==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-typed-array": { + "name": "@socketregistry/is-typed-array", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-typed-array/-/is-typed-array-1.0.5.tgz", + "integrity": "sha512-HF+CXkeLtPjGSF1p1ML7pj2eaKCCyvn+c2aYLZLHRgojGNlfNdovVilogDVaZgoUVhbFjioONWLGTLfcXH3R5w==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/object-is": { + "name": "@socketregistry/object-is", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/object-is/-/object-is-1.0.5.tgz", + "integrity": "sha512-1wbyo9IBBptFo2TaPgSCDIgqs77zkvCeR+ymUWYEq3O2eB+WdPXOFCcqBKl2fEKbfXNJG4xj4PNd41OF9yu5Fg==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/object.assign": { + "name": "@socketregistry/object.assign", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/object.assign/-/object.assign-1.0.5.tgz", + "integrity": "sha512-fqgSPOiGnHPhKrruvUW61GJzehuguUE01MgaadTOXouRx5TVqsNRGd5oLNhrFNC+HBPacdnposy8xmt1Mh+H7A==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/which-typed-array": { + "name": "@socketregistry/which-typed-array", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/which-typed-array/-/which-typed-array-1.0.5.tgz", + "integrity": "sha512-ErJqzcM65dVIo9O1d3PcMXc4Vk+5PfdbmF2dfr1GdcULepv0+g2wcLcQ0CF3eNqAf7tGyOPgkYrQifBG7qhseQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + } + } +} diff --git a/packages/npm/deep-equal/package-lock.json b/packages/npm/deep-equal/package-lock.json new file mode 100644 index 00000000..e16cd525 --- /dev/null +++ b/packages/npm/deep-equal/package-lock.json @@ -0,0 +1,254 @@ +{ + "name": "@socketregistry/deep-equal", + "version": "1.0.7", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@socketregistry/deep-equal", + "version": "1.0.7", + "bundleDependencies": [ + "@socketregistry/original__deep-equal" + ], + "license": "MIT", + "dependencies": { + "@socketregistry/original__deep-equal": "npm:deep-equal@2.2.3" + }, + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/@socketregistry/original__deep-equal": { + "name": "deep-equal", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-buffer-byte-length": { + "name": "@socketregistry/array-buffer-byte-length", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/array-buffer-byte-length/-/array-buffer-byte-length-1.0.5.tgz", + "integrity": "sha512-nHUtF1H43uc7NzT6Jy+QVeGtrcnI5nG80kqBXMS2vIIawQC8la5hAlviUKCdQtAdHo2duykmGEteQY6vw0CjkQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/call-bind": { + "name": "@socketregistry/deep-equal", + "version": "1.0.3-overrides-call-bind", + "resolved": "https://registry.npmjs.org/@socketregistry/deep-equal/-/deep-equal-1.0.3-overrides-call-bind.tgz", + "integrity": "sha512-hj9onNBwlE230vRyAOwt4i945QcXPIkAue7e2Z9X6K55fn+29ny5ApdglNrYyv/Q/2OBanE5oXE5w8TKSAHYmQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/es-get-iterator": { + "name": "@socketregistry/es-get-iterator", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/es-get-iterator/-/es-get-iterator-1.0.5.tgz", + "integrity": "sha512-rYAhVok1NWHOD067z4yLYFmsph9X2SP2mEOUbE4zrLSu6xHdmscgsUXTQlv/+9Ns+ShfFe3UufdnuKnwuZT0pA==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/get-intrinsic": { + "name": "@socketregistry/deep-equal", + "version": "1.0.3-overrides-get-intrinsic", + "resolved": "https://registry.npmjs.org/@socketregistry/deep-equal/-/deep-equal-1.0.3-overrides-get-intrinsic.tgz", + "integrity": "sha512-roKFpOZJiLzvvyb9glsY/o1O4NdgiKOfcJYbJm7+YqrPnAC4ym+ivSf2A3VMxP6tWxACE9g4swtACDBUsQ8GoQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-arguments": { + "name": "@socketregistry/is-arguments", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-arguments/-/is-arguments-1.0.5.tgz", + "integrity": "sha512-Iozv0wGyOJdNwaidhIMX556q1fzPVBjv6MJb3B3UBRcMhogRiM09zfYngDLslSsp6aHRpqb8mBGf0v+Huet2/w==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-array-buffer": { + "name": "@socketregistry/is-array-buffer", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-array-buffer/-/is-array-buffer-1.0.5.tgz", + "integrity": "sha512-oeAaXGOAtkQeFS8hpf59cEVID6S+/ueIWGnxbnPhlqgWIDGGQ78VD0pBsppz/gLfdOmM/ykP+/Q82TgMkdMWWg==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-date-object": { + "name": "@socketregistry/is-date-object", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-nhf56icD/XXPcI5pstdrbn86DCb6nxqtcca8OzdWdyrZnIIYzn9PSl0j5yeDHReZQrhID9CmYpz50nySuxs49w==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-regex": { + "name": "@socketregistry/is-regex", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-UplgtvnvnL7lCZWwdi5mdnc3jbyMP8LBOpm+xHpCBGMJzFUl342PENahlVtkgExnueXs21FQbjeBxQeQVfpDvQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/is-shared-array-buffer": { + "name": "@socketregistry/is-shared-array-buffer", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/is-shared-array-buffer/-/is-shared-array-buffer-1.0.5.tgz", + "integrity": "sha512-duEc4U1Fs9E1yjMdPCwFBlGFtSPSLSUSsT7JnDD7PXdUfF4Iz1u2I3NdnFD8wzhXJr4e42a+y9eTW8ZyRyE1sA==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/isarray": { + "name": "@socketregistry/isarray", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/isarray/-/isarray-1.0.5.tgz", + "integrity": "sha512-ShtX9jbnTiEl2sXAjCS02ihrjiEStKleX4NgOxUu977jX/PRSS7sGuM2ssN3vCeuzmLphzeCeIXExxR5dcw8bA==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/object-is": { + "name": "@socketregistry/object-is", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/object-is/-/object-is-1.0.5.tgz", + "integrity": "sha512-1wbyo9IBBptFo2TaPgSCDIgqs77zkvCeR+ymUWYEq3O2eB+WdPXOFCcqBKl2fEKbfXNJG4xj4PNd41OF9yu5Fg==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/object-keys": { + "name": "@socketregistry/object-keys", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/object-keys/-/object-keys-1.0.5.tgz", + "integrity": "sha512-WnFTS0sWPWutYLuMENJTKBYYX6LYTDfG48V3KdXzNZvwKhl5i3abKKpw3M8NowgrUwfuPSXxwHUZSWEwrxqtbw==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/object.assign": { + "name": "@socketregistry/object.assign", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/object.assign/-/object.assign-1.0.5.tgz", + "integrity": "sha512-fqgSPOiGnHPhKrruvUW61GJzehuguUE01MgaadTOXouRx5TVqsNRGd5oLNhrFNC+HBPacdnposy8xmt1Mh+H7A==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/regexp.prototype.flags": { + "name": "@socketregistry/regexp.prototype.flags", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/regexp.prototype.flags/-/regexp.prototype.flags-1.0.5.tgz", + "integrity": "sha512-N8O5vDqix1PLAmJwnvbZzHCzD+912YzKm0YzB6+7GZCp7uL3yagY/aK9sR2Dsk2ASUC+BR1F+ZILbAMvRcsP0Q==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/side-channel": { + "name": "@socketregistry/side-channel", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@socketregistry/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-s5DMU7a192OUMvIU3xjfKCu/kpGuKo0hWtCD6h7fhm0CcHS4NqXeTS5+DjDuRTuUowc4PQXzHRA0OZdKuaRAWQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/which-boxed-primitive": { + "name": "@socketregistry/which-boxed-primitive", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/which-boxed-primitive/-/which-boxed-primitive-1.0.5.tgz", + "integrity": "sha512-FF1m2hcRNdMRzsBu0vYtfXu9/9X/HQneamFmtijp0orfDISO5FndtuORqhYixKwUeaZX818FbGY5O5nAW4BR8w==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/which-collection": { + "name": "@socketregistry/which-collection", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/which-collection/-/which-collection-1.0.5.tgz", + "integrity": "sha512-Yob5PapcAWuSFt9xuUR5RI7A7VN0iHLlit6rCNnBGmrW3YPGRg8mKLKpV0ULa72r/UggaN1NsqfybcconGaA3A==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + }, + "node_modules/which-typed-array": { + "name": "@socketregistry/which-typed-array", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@socketregistry/which-typed-array/-/which-typed-array-1.0.5.tgz", + "integrity": "sha512-ErJqzcM65dVIo9O1d3PcMXc4Vk+5PfdbmF2dfr1GdcULepv0+g2wcLcQ0CF3eNqAf7tGyOPgkYrQifBG7qhseQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=18.20.4" + } + } + } +} diff --git a/scripts/release-npm-packages.js b/scripts/release-npm-packages.js index 9d194228..2b0becb9 100644 --- a/scripts/release-npm-packages.js +++ b/scripts/release-npm-packages.js @@ -18,7 +18,7 @@ const { } = constants const yoctoSpinner = require('@socketregistry/yocto-spinner') const { readDirNames } = require('@socketsecurity/registry/lib/fs') -const { runScript } = require('@socketsecurity/registry/lib/npm') +const { execNpm, runScript } = require('@socketsecurity/registry/lib/npm') const { fetchPackageManifest, packPackage, @@ -47,13 +47,17 @@ void (async () => { const packages = [ packageData({ name: '@socketsecurity/registry', path: registryPkgPath }), // Lazily access constants.npmPackageNames. - ...constants.npmPackageNames.map(regPkgName => - packageData({ + ...constants.npmPackageNames.map(regPkgName => { + const pkgPath = path.join(npmPackagesPath, regPkgName) + const pkgJsonPath = path.join(pkgPath, PACKAGE_JSON) + const pkgJson = require(pkgJsonPath) + return packageData({ name: `${PACKAGE_SCOPE}/${regPkgName}`, - path: path.join(npmPackagesPath, regPkgName), - printName: regPkgName + path: pkgPath, + printName: regPkgName, + bundledDependencies: !!pkgJson.bundleDependencies }) - ) + }) ] const prereleasePackages = [] // Chunk packages data to process them in parallel 3 at a time. @@ -73,6 +77,7 @@ void (async () => { prereleasePackages.push( packageData({ name: pkg.name, + bundledDependencies: !!overridesPkgJson.bundleDependencies, path: overridesPkgPath, printName: overridePrintName, tag @@ -81,6 +86,29 @@ void (async () => { } }) packages.push(...prereleasePackages) + const bundledPackages = packages.filter(pkg => pkg.bundledDependencies) + // Chunk bundled package names to process them in parallel 3 at a time. + await pEach(bundledPackages, 3, async pkg => { + // Install bundled dependencies, including overrides. + try { + await execNpm( + [ + 'install', + '--silent', + '--workspaces', + 'false', + '--install-strategy', + 'hoisted' + ], + { + cwd: pkg.path, + stdio: 'ignore' + } + ) + } catch (e) { + console.log(e) + } + }) // Chunk package names to process them in parallel 3 at a time. await pEach( packages, diff --git a/scripts/update-npm-package-publish.js b/scripts/update-npm-package-publish.js index 47ddae29..2051b69a 100644 --- a/scripts/update-npm-package-publish.js +++ b/scripts/update-npm-package-publish.js @@ -49,9 +49,9 @@ void (async () => { const pkgJson = require(pkgJsonPath) return packageData({ name: `${PACKAGE_SCOPE}/${regPkgName}`, + bundledDependencies: !!pkgJson.bundleDependencies, path: pkgPath, - printName: regPkgName, - bundledDependencies: !!pkgJson.bundleDependencies + printName: regPkgName }) }) ] @@ -74,8 +74,8 @@ void (async () => { prereleasePackages.push( packageData({ name: pkg.name, - path: overridesPkgPath, bundledDependencies: !!overridesPkgJson.bundleDependencies, + path: overridesPkgPath, printName: overridePrintName, tag }) @@ -90,7 +90,14 @@ void (async () => { // Install bundled dependencies, including overrides. try { await execNpm( - ['install', '--workspaces', 'false', '--install-strategy', 'hoisted'], + [ + 'install', + '--silent', + '--workspaces', + 'false', + '--install-strategy', + 'hoisted' + ], { cwd: pkg.path, stdio: 'ignore'