davideicardi / live-plugin-manager

Plugin manager and installer for Node.JS
MIT License
242 stars 44 forks source link

PluginVm.getScopedInfo could not get the correct scope if it contains a dot #76

Open shiny opened 1 year ago

shiny commented 1 year ago

manager.require("@builder.io/utils") would fail because the npm org contains a dot .

In src/PluginVm.ts the regex expression is

const SCOPED_REGEX = /^(@[a-zA-Z0-9-_]+\/[a-zA-Z0-9-_]+)(.*)/;

which is too strict

In npm docs, a correct scope has been described as

A scope follows the usual rules for package names (URL-safe characters, no leading dots or underscores).

https://docs.npmjs.com/cli/v9/using-npm/scope

davideicardi commented 1 year ago

I can confirm, this is a bug. Thank you. I will try to fix that in the future, but PRs are appreciated ;-)