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

[Feature request] Make dart run support remote package #4052

Open
hyiso opened this issue Nov 20, 2023 · 8 comments
Open

[Feature request] Make dart run support remote package #4052

hyiso opened this issue Nov 20, 2023 · 8 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@hyiso
Copy link

hyiso commented Nov 20, 2023

Make dart run support remote package like the npx tool in frontend community.

Currently, dart run <package> only support package in project (dev) dependencies.

It's inconvenient for template creating tool as one does not want to install the tool globally.

@mraleph mraleph transferred this issue from dart-lang/sdk Nov 20, 2023
@sigurdm
Copy link
Contributor

sigurdm commented Nov 20, 2023

Yeah - we have played with this idea quite some. Nice to hear a request for it.

We want to do something in this direction (Maybe it will be dart global run or something else, but with an implicit installation).

We cannot currently promise any timeline.

@parlough
Copy link
Member

@sigurdm @bkonyi Is this something that could be explored soon? I'd be happy to help with the implementation if there is a preferred direction. Whether a dart pub global subcommand, a flag for dart run, a new dart global parent command, etc.

I'd like to publish some tools to use to simplify various instructions in the Dart and Flutter docs, such as configuring lints, and not requiring a separate activation/installation step would be helpful.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 18, 2024

cc @jonasfj

@sigurdm
Copy link
Contributor

sigurdm commented Nov 18, 2024

I think we'd be happy to discuss this more.

Though why don't you install those tools as dev-dependencies of the dart-docs (i guess site-www) package? That way they'll be versioned along with the package.

We have dart run package:executable for running tools from (dev-)dependencies - I think that is much preferable.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 18, 2024

I think our biggest worry currently is, that without a prior installation step, there is really no way of validating that you are running what you think you are - making it easier to inject bad behavior.

@parlough
Copy link
Member

parlough commented Nov 18, 2024

Oh sorry, I meant for developers reading/referencing the docs. So they can copy and run a single command from the docs to complete the relevant steps.

Similar to how dart pub add has been very useful to replace telling developers to "Add package: ^1.0.0 to your pubspec.yaml file."

@sigurdm
Copy link
Contributor

sigurdm commented Nov 18, 2024

Oh sorry, I meant for developers reading/referencing the docs. So they can copy and run a single command from the docs to complete the relevant steps.

Ah - gotcha! sorry I completely misread that.

@sigurdm
Copy link
Contributor

sigurdm commented Nov 18, 2024

I think one option would be to submit lockfiles with packages and run with those lock-files.

This is what cargo does (at least can do) https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

Or there could be a way to pulish lock-files alone, and then point pub to them.

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

3 participants