-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Needs Triageneeds an initial reviewneeds an initial review
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When using the node runtime, validating the string "bun" will output:
{
validForNewPackages: true,
validForOldPackages: true
}But when using the Bun runtime, validating the same string will output:
{
validForNewPackages: false,
validForOldPackages: true,
warnings: [ "bun is a core module name" ],
}Because we are checking if the name is included in the builtinModules, and in Bun, the name itself is a core module.
if (builtins.includes(name.toLowerCase())) {
warnings.push(name + ' is a core module name')
}Expected Behavior
The expected behaviour are the following names should be valid NPM package names:
There could be more names but I didn't check them all.
Steps To Reproduce
import validate from 'validate-npm-package-name'
console.log(validate('bun'));
console.log(validate('ws'));Run the above code with Bun.
Environment
- Bun: 1.1.24
Metadata
Metadata
Assignees
Labels
Needs Triageneeds an initial reviewneeds an initial review