diff --git a/package-lock.json b/package-lock.json index 0ac6a9d..a997bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,10 +14,10 @@ ], "devDependencies": { "@nice-move/cli": "^0.11.1", - "@nice-move/eslint-config-base": "^0.9.25", - "@nice-move/prettier-config": "^0.9.9", + "@nice-move/eslint-config-base": "^0.10.0", + "@nice-move/prettier-config": "^0.10.0", "best-shot": "^0.4.6", - "eslint": "^8.55.0", + "eslint": "^8.56.0", "garou": "^0.6.20", "prettier": "^3.1.1" }, @@ -508,9 +508,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -624,23 +624,23 @@ } }, "node_modules/@nice-move/eslint-config-base": { - "version": "0.9.25", - "resolved": "https://registry.npmjs.org/@nice-move/eslint-config-base/-/eslint-config-base-0.9.25.tgz", - "integrity": "sha512-V/FQtOnKaPBYqFLdFB5d+zRwlXg3Er6zHzUXUfXwKekdb05wgJPCOkDL8bv11dMm9H9WmjTrMlS9F7AkuVKJ/g==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nice-move/eslint-config-base/-/eslint-config-base-0.10.0.tgz", + "integrity": "sha512-k5iunQ0nXH12pxee6PBJXT4WmuvcaZg2CqbiiMpyooUKsF6IbU8CJfvXWNTSSOHj4D8hlORXvk0InKnLc/o0DA==", "dev": true, "dependencies": { - "@babel/core": "^7.23.5", + "@babel/core": "^7.23.6", "@babel/eslint-parser": "^7.23.3", "@babel/plugin-syntax-import-attributes": "^7.23.3", "@nice-move/eslint-plugin-html": "0.0.0-beta.4", - "@typescript-eslint/eslint-plugin": "^6.13.2", - "@typescript-eslint/parser": "^6.13.2", + "@typescript-eslint/eslint-plugin": "^6.14.0", + "@typescript-eslint/parser": "^6.14.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-markdown": "^3.0.1", - "eslint-plugin-n": "^16.3.1", + "eslint-plugin-n": "^16.4.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-sonarjs": "^0.23.0", "eslint-plugin-unicorn": "^49.0.0", @@ -649,10 +649,10 @@ "settingz": "^0.2.0" }, "engines": { - "node": "^16.17.0 || ^18.12.0 || ^20.0.0" + "node": "^18.12.0 || ^20.0.0" }, "peerDependencies": { - "eslint": "^8.55.0" + "eslint": "^8.56.0" } }, "node_modules/@nice-move/eslint-plugin-html": { @@ -671,9 +671,9 @@ } }, "node_modules/@nice-move/prettier-config": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/@nice-move/prettier-config/-/prettier-config-0.9.9.tgz", - "integrity": "sha512-VNhOxZ2YjQZosUNtlymh2xqUyeZhwUrOe4w8hQHavK4r3c0J4iV4TkZLbUEc+WYdKVYwl63U1xNFThSeHQomyA==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@nice-move/prettier-config/-/prettier-config-0.10.0.tgz", + "integrity": "sha512-OryOhMeTf2mo8ASRXGz1cUza0spBHaceAq/cdeqY2+3tGzLzUh9IaeXSKwbjZPnSfsAwIgyErzQTUzSFBc8fag==", "dev": true, "dependencies": { "@nice-move/prettier-plugin-package-json": "^0.7.5", @@ -682,7 +682,7 @@ "settingz": "^0.2.0" }, "engines": { - "node": "^16.17.0 || ^18.12.0 || ^20.0.0" + "node": "^18.12.0 || ^20.0.0" }, "peerDependencies": { "prettier": "^2.8.8 || ^3.0.3" @@ -2373,15 +2373,15 @@ } }, "node_modules/eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2427,6 +2427,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-config-airbnb-base": { "version": "15.0.0", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", @@ -2597,13 +2609,14 @@ } }, "node_modules/eslint-plugin-es-x": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.3.0.tgz", - "integrity": "sha512-W9zIs+k00I/I13+Bdkl/zG1MEO07G97XjUSQuH117w620SJ6bHtLUmoMvkGA2oYnI/gNdr+G7BONLyYnFaLLEQ==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.5.0.tgz", + "integrity": "sha512-ODswlDSO0HJDzXU0XvgZ3lF3lS3XAZEossh15Q2UHjwrJggWeBoKqqEsLTZLXl+dh5eOAozG0zRcYtuE35oTuQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.1.2", - "@eslint-community/regexpp": "^4.6.0" + "@eslint-community/regexpp": "^4.6.0", + "eslint-compat-utils": "^0.1.2" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -2635,9 +2648,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", - "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "dependencies": { "array-includes": "^3.1.7", @@ -2656,7 +2669,7 @@ "object.groupby": "^1.0.1", "object.values": "^1.1.7", "semver": "^6.3.1", - "tsconfig-paths": "^3.14.2" + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -2702,14 +2715,14 @@ } }, "node_modules/eslint-plugin-n": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.3.1.tgz", - "integrity": "sha512-w46eDIkxQ2FaTHcey7G40eD+FhTXOdKudDXPUO2n9WNcslze/i/HT2qJ3GXjHngYSGDISIgPNhwGtgoix4zeOw==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.4.0.tgz", + "integrity": "sha512-IkqJjGoWYGskVaJA7WQuN8PINIxc0N/Pk/jLeYT4ees6Fo5lAhpwGsYek6gS9tCUxgDC4zJ+OwY2bY/6/9OMKQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", - "eslint-plugin-es-x": "^7.1.0", + "eslint-plugin-es-x": "^7.5.0", "get-tsconfig": "^4.7.0", "ignore": "^5.2.4", "is-builtin-module": "^3.2.1", @@ -6172,9 +6185,9 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", @@ -6903,7 +6916,7 @@ }, "packages/npm": { "name": "@bring-it/npm", - "version": "0.4.1", + "version": "0.4.2", "license": "MIT", "devDependencies": { "execa": "^8.0.1", diff --git a/package.json b/package.json index 386f7e4..6025df9 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,10 @@ ], "devDependencies": { "@nice-move/cli": "^0.11.1", - "@nice-move/eslint-config-base": "^0.9.25", - "@nice-move/prettier-config": "^0.9.9", + "@nice-move/eslint-config-base": "^0.10.0", + "@nice-move/prettier-config": "^0.10.0", "best-shot": "^0.4.6", - "eslint": "^8.55.0", + "eslint": "^8.56.0", "garou": "^0.6.20", "prettier": "^3.1.1" }, @@ -37,7 +37,7 @@ "node": "^18.0.0 || ^20.0.0", "npm": ">=9.4.0" }, - "packageManager": "npm@10.2.4", + "packageManager": "npm@10.2.5", "eslintConfig": { "extends": "@nice-move/eslint-config-base" }, diff --git a/packages/npm/lib/npm/filter.mjs b/packages/npm/lib/npm/filter.mjs index 2e806bb..4de7051 100644 --- a/packages/npm/lib/npm/filter.mjs +++ b/packages/npm/lib/npm/filter.mjs @@ -4,7 +4,7 @@ import validate from 'validate-npm-package-name'; import { logger } from './logger.mjs'; -export function filter(pkg, env) { +export function filter(pkg) { if (pkg.private) { logger.info('[package is private]', pkg.name); @@ -55,24 +55,5 @@ export function filter(pkg, env) { } } - const { packageManager } = pkg; - - if (pkg.engines?.[packageManager]) { - if (!semver.validRange(pkg.engines[packageManager])) { - logger.warn(`[pkg.engines.${packageManager} isn't valid]`, pkg.pkg); - - return false; - } - - if ( - env.packageManager.version && - !semver.satisfies(env.packageManager.version, pkg.engines[packageManager]) - ) { - logger.warn(`[pkg.engines.${packageManager} isn't match]`, pkg.pkg); - - return false; - } - } - return true; } diff --git a/packages/npm/lib/npm/git.mjs b/packages/npm/lib/npm/git.mjs index 3ad954f..49eb0ec 100644 --- a/packages/npm/lib/npm/git.mjs +++ b/packages/npm/lib/npm/git.mjs @@ -19,10 +19,6 @@ async function doAction(condition, okay, fail) { return false; } -export async function packageManagerVersion(packageManager = 'npm') { - return Exec(packageManager, ['-v']); -} - export function gitSupport() { return doAction( Git('--version').then(Boolean), diff --git a/packages/npm/lib/npm/scan.mjs b/packages/npm/lib/npm/scan.mjs index 2e94f95..afdfc0e 100644 --- a/packages/npm/lib/npm/scan.mjs +++ b/packages/npm/lib/npm/scan.mjs @@ -2,11 +2,7 @@ import { readFile } from 'node:fs/promises'; import { dirname } from 'node:path'; import { filter } from './filter.mjs'; -import { - getFileContentFromLastCommit, - getLastCommitFiles, - packageManagerVersion, -} from './git.mjs'; +import { getFileContentFromLastCommit, getLastCommitFiles } from './git.mjs'; import { logger } from './logger.mjs'; import { readNpmToken } from './token.mjs'; @@ -66,9 +62,7 @@ async function publishReady(list) { for (const item of list) { const okay = await readJSON(item); - const version = await packageManagerVersion(okay.packageManager); - - if (okay && filter(okay, { packageManager: { version } })) { + if (okay && filter(okay)) { io.push(okay); logger.okay('[Publish Allowed]', okay.name); } diff --git a/packages/npm/package.json b/packages/npm/package.json index 02c82ab..eff29fb 100644 --- a/packages/npm/package.json +++ b/packages/npm/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/npm", - "version": "0.4.1", + "version": "0.4.2", "description": "Publish npm packages when needed", "license": "MIT", "author": {