- 
                Notifications
    You must be signed in to change notification settings 
- Fork 645
          New command: spacetime dev
          #3469
        
          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
Conversation
Signed-off-by: John Detter <[email protected]>
…s/SpacetimeDB into drogus/spacetime-init
…s/SpacetimeDB into drogus/spacetime-init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now looks good to me. I've reworked some of the logic to handle some of the more subtle cases especially relating to the server name. One change I've made is that I've made it so that if you don't specify --server  it uses your default server (not maincloud), but I've also made the change to make maincloud the default server. This was one of three options:
- local by default, and spacetime devdoesn't override your default (leads people to usespacetime devwith localhost most of the time)
- local by default, and spacetime devoverrides your default and sends you to maincloud anyway (could be very surprising and could even whoopsie someone's database accidentally)
- maincloud by default, and spacetime devdoesn't override your default (just uses the defaultmaincloud), seems like the best case
We still have one important thing to do for dev after this merges as well:
- Implement spacetime.tomlor some such other config file so that users can specify adatabase_namein some locally not checked in file, so that they don't end up creating a million databases if they just runspacetime deva bunch of times against maincloud. I think we'll need to involve @aasoni in that one because it's relevant to projects and teams and stuff.
Description of Changes
This PR implements a new command for the CLI:
spacetime dev. If run from outside of a project directory, it will callinitin interactive mode to allow user to create a project. If run from a project directory, it will ask for a module to conect to and it will:spacetimedbdirectory and automatically publish to SpacetimeDBOne caveat is that instead of reusing the
logscode I did some repetition cause currently the logs code acquires a lock that lives through await points. It is fixable, but due to limited time I decided to go with a bit of code duplication. It shouldn't be very hard to fix later, though.