Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for package scopes #1821

Closed
jimsimon opened this issue Mar 8, 2018 · 6 comments
Closed

Add support for package scopes #1821

jimsimon opened this issue Mar 8, 2018 · 6 comments

Comments

@jimsimon
Copy link

jimsimon commented Mar 8, 2018

It'd be great if pub supported package scopes similar to npm. This is very useful for grouping packages from the same main project together. For example, all of the flutter packages could be published under one or more flutter scopes. This is also useful for when developers want to give a package a name that's already been taken (i.e. json_serializer which is a super generic name).

@nex3
Copy link
Member

nex3 commented Mar 8, 2018

@munificent and I talked about this long ago when we were first designing the package repository, but we ended up deciding (and I think this still holds) that there's very little value in having explicit scopes/namespaces that you don't get from just adding a prefix to the package name. flutter.widget doesn't communicate anything more than flutter_widget, and jimsimon.json_serializer definitely communicates less than something that explains the difference like json_auto_serializer.

@nex3 nex3 closed this as completed Mar 8, 2018
@jimsimon
Copy link
Author

jimsimon commented Mar 8, 2018

Aside from namespacing to avoid package name collisions, I think there's another use case for team/company permission management as well. It's a lot more convenient for larger companies to manage permissions for a scope than it is to manage permissions for potentially hundreds of packages individually.

For example, the company I work for has a single npm scope that we publish our packages to. It used to be a pain to manage those permissions for our various packages, but now it's substantially easier.

@nex3
Copy link
Member

nex3 commented Mar 8, 2018

That seems like something that could be done without adding complexity to package names—for example, by allowing packages to be explicitly associated with a team or project.

@jimsimon
Copy link
Author

jimsimon commented Mar 8, 2018

For sure, but with the scope concept you get the benefits of namespacing and easier permission management from one new functional concept. I can open a separate issue for team package management if you'd like.

@nex3
Copy link
Member

nex3 commented Mar 8, 2018

I can open a separate issue for team package management if you'd like.

That would be good; it should go in https://github.com/dart-lang/pub-dartlang-dart, since it's mostly a server-side feature.

@nmccready
Copy link

Scopes in NPM also aid in preventing accidental publishing of a package unless you own that specific scope. Second scopes in NPM allow group permissions which apply to many packages which are provided under that scope. Thus as an open source dev you can have a team of trusted devs which can publish the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants