dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
212 stars 75 forks source link

Add offline mode #2483

Open RossComputerGuy opened 3 months ago

RossComputerGuy commented 3 months ago

Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
bkonyi commented 1 month ago

Sorry for the delay on this @RossComputerGuy! Overall, this change looks good to me, but we should add some tests before landing.

RossComputerGuy commented 1 month ago

I've gone ahead and rebased it. I will look into getting tests in shortly.

RossComputerGuy commented 1 month ago

Can't figure out how the test should be done, I see there's configuration tests but none invoke read.

bkonyi commented 1 month ago

Can't figure out how the test should be done, I see there's configuration tests but none invoke read.

I think you can either add a test like this or something similar to what's done in this file.

Basically, you'll just want a test that runs webdev serve --no-pub on a project that hasn't had dart pub get invoked to pull down the dependencies. The webdev serve --no-pub should fail to serve the project since there will be unresolved dependencies.

RossComputerGuy commented 1 month ago

Ok, I added the test.