live-plugin-manager icon indicating copy to clipboard operation
live-plugin-manager copied to clipboard

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

Open shiny opened this issue 2 years ago • 1 comments

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

shiny avatar May 31 '23 13:05 shiny

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

davideicardi avatar Jun 14 '23 08:06 davideicardi