clockworklabs / clockworklabs/SpacetimeDB

cryptic `spacetime init` failure if template name is wrong

Open
#5,124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Using the wrong template name results in an error about a bad repository format:

➜ spacetime init --template next-js my-js-project
A new version of SpacetimeDB is available: v2.3.0 (current: v2.2.0)
Run `spacetime version upgrade` to update.

You are logged in to SpacetimeDB.
Project name: my-js-project
✔ Project path · ./my-js-project
✔ Database name · my-js-project-5o1kj
Template: next-js
Initializing project from template...
Error: Invalid repository format. Use 'owner/repo' or full git clone URL

is there something better we can do here? I don't think it's as simple as "assume it's a template name" since people might try to just type in their repo name as a value. Perhaps two different params? (--template vs --template-repo)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the spacetime init implementation and trace validation of the --template value, then reproduce the command with next-js. Determine how invalid template values are classified and make the failure explain the accepted forms or distinguish template names from repository references; done means the command no longer reports a misleading repository-format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.