From 28c09f47241d8fc852a3df8ef46f1b6f5ce2f072 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 19:30:05 +0000 Subject: [PATCH 1/2] deps: bump builtins from 1.0.3 to 5.0.0 Bumps [builtins](https://github.com/juliangruber/builtins) from 1.0.3 to 5.0.0. - [Release notes](https://github.com/juliangruber/builtins/releases) - [Commits](https://github.com/juliangruber/builtins/compare/v1.0.3...v5.0.0) --- updated-dependencies: - dependency-name: builtins dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e69b63..4d76db5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "test" }, "dependencies": { - "builtins": "^1.0.3" + "builtins": "^5.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", From 3b3f14b097da5ce7b24a1591a02d2a0255f579ea Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 29 Mar 2022 12:36:00 -0700 Subject: [PATCH 2/2] fix: new syntax for builtins Credit: @rzhade3 and @brettz9 --- lib/index.js | 2 +- test/index.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 7cea134..dcf217c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -52,7 +52,7 @@ var validate = module.exports = function (name) { // Generate warnings for stuff that used to be allowed // core module names like http, events, util, etc - builtins.forEach(function (builtin) { + builtins({ version: '*' }).forEach(function (builtin) { if (name.toLowerCase() === builtin) { warnings.push(builtin + ' is a core module name') } diff --git a/test/index.js b/test/index.js index 1485755..f05b0bb 100644 --- a/test/index.js +++ b/test/index.js @@ -87,6 +87,11 @@ test('validate-npm-package-name', function (t) { validForOldPackages: true, warnings: ['http is a core module name'] }) + t.deepEqual(validate('process'), { + validForNewPackages: false, + validForOldPackages: true, + warnings: ['process is a core module name'] }) + // Long Package Names /* eslint-disable-next-line max-len */