Pub: Add support for package scopes

Created on 8 Mar 2018  路  5Comments  路  Source: dart-lang/pub

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).

All 5 comments

@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.

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.

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

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crajygemer picture crajygemer  路  24Comments

devoncarew picture devoncarew  路  30Comments

JSanford42 picture JSanford42  路  21Comments

jonasfj picture jonasfj  路  31Comments

wh120 picture wh120  路  24Comments