purescript / purescript/spago

Add `--template` flag to `init` command

Open
#573 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature help wanted new flag UX
Dominant language
PureScript
Stars
831
Forks
137
PR merge metrics
No merged PRs in 30d

Description

As mentioned in this comment on Discourse it would be really nice if Spago could have templates.

Examples from the post for how this could look like:

spago init --template halogen
spago init --template react-basic-hooks
spago init --template cli
... etc.

Opening this issue to track this, I don't have an opinion on how this should be implemented, but looking at previous art (e.g. Stack templates), I feel we could:

  • have each template as a git submodule in the templates folder
  • ..and include all templates in the binary (this is so that you can still make a project if you're offline)
  • ..and optionally try to fetch them if we are online and they have been updated

Contributor guide

Open the contributing guide

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 by tracing the existing spago init command and reviewing the proposed templates folder and git-submodule approach. Clarify how named templates are selected, bundled for offline use, and optionally updated online; done means --template supports the documented examples without breaking ordinary initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.