Commit Graph

9 Commits

Author SHA1 Message Date
Piotr Sarnacki 647be7e9c0 spacetime init rewrite (#3366)
This is a draft of the new functionality for `spacetime init`. In order
to run it with built-in templates you have to set the path to the config
file:

```
export SPACETIMEDB_CLI_TEMPLATES_FILE=crates/cli/.init-templates.json
```

In the future it will fetch the list from GH.

A few notes:

* the previous functionality of `spacetime init` does not work at the
moment
* the code needs a bit more cleanup and tests before merging
* there is a bit of a mix in how we generate empty server and client
projects. For Rust we use the existing way of generating. For TypeScript
we clone an empty project from the repo. I wanted to play with both ways
of doing things, and I'm still not sure which is better. Generation in
Rust means that the generated code will match the CLI version and not
necessarily whatever is in Git. On the other hand, for the builtin
templates we will be fetching the newest version from GH, which I guess
might also not what we want, ie. we probably want only stable templates.
More discussion is needed here
* we use `spacetimedb` directory for the server files
* I don't particularly like the inability to disable interactive mode
easily. We discussed disabling it by default if all of the required
arguments are passed, but I don't think it's feature proof. For example,
if someone relies on a non-interactive mode, and we add a new required
argument, instead of printing a message `missing --foo`, we will
automatically launch interactive mode, which is harder to debug. That's
why I think I'd prefer to implement `--non-interactive` argument
* it's kind of hard to keep the legacy behaviour. If you don't pass any
arguments, we go into interactive mode. In the legacy version, we would
print required arguments. If someone passes `--lang` or `--project-path`
explicitly, I guess we could run the legacy workflow, but not sure if
it's worth it, as the command was marked as unstable anyway
* the project path defaults to the project name, but I think we should
probably replace change whitespaces to dashes, or at least ask for the
project path with the project name being the default (or both)

---------

Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: = <cloutiertyler@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-10-30 04:26:08 +00:00
Noa e47a8d796f Run smoketests on windows in ci (#2129) 2025-01-16 21:43:38 +00:00
Ingvar Stepanyan 1d6b0a141b [C#] Migrate bench-cs to the new API (#1758) 2024-10-01 00:31:38 +00:00
Ingvar Stepanyan 075efb6167 Tighten package sources in C# smoketests (#1735) 2024-09-28 18:40:36 +00:00
Zeke Foppa 75acefc2f7 C# smoketests use nuget.config (#1500)
Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-15 11:06:36 +00:00
Zeke Foppa b2eb08c9cb Fix C# module smoketests (#1475)
Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-04 12:48:41 +00:00
Ingvar Stepanyan 137f26da5f Restructure NuGet packaging (#1440)
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Signed-off-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2024-06-18 19:48:46 +00:00
Ingvar Stepanyan d1033b5d93 Shared C# codegen for BSATN (#1312)
Signed-off-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: james gilles <jameshgilles@gmail.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-06-07 19:22:02 +00:00
Ingvar Stepanyan 84a7f83086 Simplify C# source generator csproj (#1143)
* Simplify source generator csproj

Apparently custom scripts are no longer necessary, so removing to make maintenance simpler (noticed this while working on yet another source generator).

* Add smoketest based on Ingvar's comment, + run smoketests on Windows

* Whoops, don't mkdtemp outside of debugging

* Make smoketest sillier

* Finish up a print statement

* Revert "Make smoketest sillier"

This reverts commit 135b05b380.

* Resolve versioning issue in a non-silly, professional way.

---------

Co-authored-by: James Gilles <jameshgilles@gmail.com>
2024-04-29 17:20:22 +00:00