Open cdata opened 7 years ago
Interesting... Yeah, this isnt supported. I kindof assumed that package names would be a single string. I'm now wondering what the best way to address this is.
For context: I'm interested in experimenting with publishing several packages from the Polymer and PolymerElements orgs via gx. Currently Polymer packages published to NPM are scoped to @polymer
, because users have previously published some of our projects to the unscoped names.
@cdata Thats great! I see two options here...
We can just use the unscoped package name for gx purposes (should be fine since its all content addressed). Or we can make gx handle paths as filenames, which means that the package urls would look like: QmFooBar/@polymer/pkgname
Actually, just doing the second option will be really easy...
Though a good bit of the gx tooling assumes that it can find the package.json at HASH/$firstthingitfinds/package.json
. This would break some of that code
It seems like the simplest solution may be to use a directory structure that maps to the package scoping literally.
If that is the case, maybe a gx-npm
or similar helper could traverse the directory structure and create symlinks for scoped packages in their parent directory where appropriate. Does that seem like a reasonable approach?
@cdata Yeah, that could work. The only thing that will be not quite right is some existing gx tooling won't work with scoped packages until we find them and fix them
@cdata Try building gx from latest master, i pushed a commit that should do what you're expecting
NPM supports scopes in package names. When trying to publish a Node module with
gx publish
, publishing fails if the package name has an NPM scope e.g.,@foo/bar
. It results in the following message: