dotnet-websharper / dotnet-ws

The `dotnet ws` tool
Apache License 2.0
1 stars 3 forks source link

Implement auto update #5

Open mrtank opened 3 years ago

mrtank commented 3 years ago

Later we can add more functionality, like ws update (updates all WebSharper.* packages and tooling for people not using Paket), ws watch (auto-build on file changes), etc.

Also, on booster: if multiple services are running and current one is not the latest version, we could print a message about it (just for detailed log, not an MSBuild warning)

From #1

That would mean dotnet ws tool can check the latest version from nuget feeds.

Whenever a dotnet ws usage happens in a directory with a WebSharper project in it, a warning should be displayed with the new version number available. Like

An update for template pack WebSharper.Core is available.
    install command: dotnet ws update

Deciding if the current folder have a WebSharper project is the following: If

paket outdated

succeeds, and outputs a line * WebSharper x -> y, than paket update WebSharper.* is issued. Where * is all the packages installed prefixed with WebSharper

If fails,

dotnet list package --outdated

is checked for WebSharper x y z. If it exists dotnet add package WebSharper.* is issued. Where * is all the packages installed prefixed with WebSharper

There would be a --pre flag for dotnet ws update which would add --pre to paket outdated , add --version y to paket update where y would be read from paket outdated, add --include-prerelease to dotnet list package, add --prerelease to dotnet add package.

Jand42 commented 3 years ago

We can also call paket update WebSharper* --filter for an easier single command update, see https://fsprojects.github.io/Paket/paket-update.html

mrtank commented 3 years ago

Yes. That's an option for non-pre. https://github.com/fsprojects/Paket/issues/278 I believe you must specify version if --pre is given. If --pre is given version info for each package have to be read from paket outdated --pre, and issue update with those.

The gist of the problem is with --pre on, that it's possible to have prerelease from different sources.

nuget Example >= 1.2.3 alpha  // At least 1.2.3 including alpha versions.
nuget Example >= 2 beta rc    // At least 2.0 including rc and beta versions.
nuget Example >= 3 rc         // At least 3.0 including rc versions.
nuget Example >= 3 prerelease // At least 3.0 including all prerelease versions

Paket decided to rely on the version in the dependencies file, or update to specific version http://fsprojects.github.io/Paket/nuget-dependencies.html#PreReleases