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

Symbolic link to test pub packages locally before deploying them #4402

Closed
michaelnjuguna opened this issue Oct 2, 2024 · 6 comments
Closed
Labels
type-enhancement A request for a change that isn't a bug

Comments

@michaelnjuguna
Copy link

A symbolic link similar to npm link in npm that developers can use to test their packages locally before deploying them

@sigurdm sigurdm added needs-info Additional information needed from the issue author type-enhancement A request for a change that isn't a bug labels Oct 3, 2024
@sigurdm
Copy link
Contributor

sigurdm commented Oct 4, 2024

What is the use case?

Does https://dart.dev/tools/pub/dependencies#dependency-overrides solve the problem? It allows to use a local dependency instead of a hosted one.

We also are launching pub workspaces. It also provides ways to test sets of related packages together before publishing.
See preliminary documentation at dart-lang/site-www#6117

@github-actions github-actions bot removed the needs-info Additional information needed from the issue author label Oct 5, 2024
@michaelnjuguna
Copy link
Author

It's use case is that after creating a pub package, the developer can then link the package locally and test it in another project

@sigurdm
Copy link
Contributor

sigurdm commented Oct 10, 2024

Does https://dart.dev/tools/pub/dependencies#dependency-overrides solve the problem? It allows to use a local dependency instead of a hosted one.

@michaelnjuguna
Copy link
Author

It wouldn't hurt to have a CLI option

@sigurdm
Copy link
Contributor

sigurdm commented Oct 11, 2024

Generally we try to avoid having implicit configuration.

Having overrides explicit in the local project is IMO preferable as it makes it more clear what is going (harder to forget to turn it off).

If you want to have an override that is not seen by git status you can use the file pubspec_overrides.yaml to make the override.

To do it from the cli:

$ echo 'dependency_overrides: {foo: {path: path/to/foo}}' > pubspec_overrides.yaml

@sigurdm
Copy link
Contributor

sigurdm commented Oct 11, 2024

Perhaps we should have a command

$ dart pub override <pkg>:<descriptor>

For updating the overrides from the command line...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants