clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Create `clarinet devnet ...` commands

Open MicaiahReid opened this issue 1 year ago • 2 comments

I'll attempt to summarize my discussion with @lgalabru on a vision for expanding clarinet integrate into a few new commands. Here are the main efforts this will entail:

  • [x] #1102
  • [x] Add clarinet devnet start command. This be the same as clarinet integrate
  • [ ] [Breaking] Remove clarinet integrate command
  • [ ] Add the clarinet devnet start --package=Package.json startup option

Add clarinet devnet start command / Remove clarinet integrate

The clarinet integrate command isn't really self-explanatory in terms of what it actually does, and it doesn't fit the usual pattern for clarinet commands: clarinet noun verb. Changing to clarinet devnet start fits this pattern and clearly indicates that a devnet will be started.

Add the clarinet devnet package command

This idea originally came from #1059. This command will essentially package up all of the pieces of a project that are required to start a devnet and put them in one JSON file. This will make it easy for the platform team to extract the relevant data from a user's project to hand off to the devnet API. It will also make the next option possible.

Note: We also were considering clarinet devnet export rather than package, please comment if you have any opinions on the command name

Add the clarinet devnet start --package=Package.json startup option

This new --package flag will allow a user to start a devnet using only a clarinet project package (created from clarinet devnet package). The user can then start a devnet without having to run clarinet integrate from a specific directory - they just need the package file, and it has everything they need.

MicaiahReid avatar Jul 25 '23 13:07 MicaiahReid

@MicaiahReid: Woot! I love the thoughtful thinking behind aligning on the clarinet <noun> <verb> conventions—big fan. Doing these as part of v2.0 would be a great way to consolidate and tighten up the related loose DevEx.

As a suggestion, perhaps, we can consider not removing clarinet integrate right away but deprecating it for a few minor releases on the v2.x line. The additional time can make it is easy for developers to migrate their scripts and automation with the v2.0 upgrade. Being more empathetic on this could be helpful to developers.

Aside from being vocal and transparent about these changes in the release notes, blogs, etc., we can share the deprecation more directly as part of the CLI DevEx. For instance, after upgrading to v2.x, if a dev continues to rely on clarinet integrate, we could spit out a WARN message .. something like:

╭─sabbyanandan ~/hiro
╰─$ clarinet --version
clarinet 2.0.0

╭─sabbyanandan ~/hiro
╰─$ clarinet integrate

WARN: The use of `clarinet integrate` is not recommended, given this command is deprecated in v2.x and will be removed soon. Please switch to `clarinet devnet start` instead. You can read more about the reasoning and benefits in the documentation at: https://docs.hiro.so/clarinet/awesome-sauce.
...
...
Computing deployment plan
note: using existing deployments/default.devnet-plan.yaml
...
...

sabbyanandan avatar Jul 25 '23 15:07 sabbyanandan

@sabbyanandan Yes, I'm definitely a fan of giving devs notice! Waiting until v3 to remove clarinet integrate sounds like a great plan.

MicaiahReid avatar Jul 25 '23 16:07 MicaiahReid