Download versioned template assets for slug init #127

Closed
opened 2026-06-07 18:51:29 -05:00 by erik · 2 comments
Owner

Goal

Make installed slug init work outside the Slugkit repository by downloading a versioned site template asset from the internet instead of requiring template/site to exist locally.

Requirements

  • Update the release workflow to package template/site as a versioned template tarball asset, for example slugkit-site-template-v<version>.tgz.
  • Attach the template tarball to the matching Forgejo release v<version>.
  • Update slug init so the installed CLI can fetch and extract the template from the matching versioned release asset by default.
  • Keep generated sites owning their copied source after extraction.
  • Do not use mutable main as the default template source.
  • Preserve local development behavior when running from the Slugkit repo with template/site present.
  • Add explicit escape hatches for local/custom template sources, such as --template-url and/or --template-dir.
  • Add tests that cover installed-package/no-local-template behavior and release asset packaging behavior where practical.

Acceptance criteria

  • slug init ./site --name site --site-title "Site" works when slug is installed from npm and no repo-local template/site is available.
  • The release workflow publishes a versioned template tarball asset on the Forgejo release.
  • The default template download URL is versioned and reproducible.
  • Local repo development can still initialize from local template/site without network access.
  • Generated sites contain copied template source and do not depend on the Slugkit repo after initialization.
  • Tests cover remote-template init behavior and local-template fallback/override behavior.

Dependencies

  • task-5fb70842
## Goal Make installed `slug init` work outside the Slugkit repository by downloading a versioned site template asset from the internet instead of requiring `template/site` to exist locally. ## Requirements - Update the release workflow to package `template/site` as a versioned template tarball asset, for example `slugkit-site-template-v<version>.tgz`. - Attach the template tarball to the matching Forgejo release `v<version>`. - Update `slug init` so the installed CLI can fetch and extract the template from the matching versioned release asset by default. - Keep generated sites owning their copied source after extraction. - Do not use mutable `main` as the default template source. - Preserve local development behavior when running from the Slugkit repo with `template/site` present. - Add explicit escape hatches for local/custom template sources, such as `--template-url` and/or `--template-dir`. - Add tests that cover installed-package/no-local-template behavior and release asset packaging behavior where practical. ## Acceptance criteria - [ ] `slug init ./site --name site --site-title "Site"` works when `slug` is installed from npm and no repo-local `template/site` is available. - [ ] The release workflow publishes a versioned template tarball asset on the Forgejo release. - [ ] The default template download URL is versioned and reproducible. - [ ] Local repo development can still initialize from local `template/site` without network access. - [ ] Generated sites contain copied template source and do not depend on the Slugkit repo after initialization. - [ ] Tests cover remote-template init behavior and local-template fallback/override behavior. ## Dependencies - task-5fb70842
Author
Owner

Synced from todu comment by @todu on 2026-06-08T00:11:53.473Z

Completed

  • Merged PR #128, which implements versioned remote template downloads for installed slug init and preserves repo-local template initialization.
  • Added release asset packaging/upload for slugkit-site-template-v<version>.tgz.
  • Added slug init --help, --template-url, and --template-dir.
  • Verified by PR #128 CI (#176 green), independent review approval, and ./scripts/pre-pr.sh passing before merge.
_Synced from todu comment by @todu on 2026-06-08T00:11:53.473Z_ ### Completed - Merged PR #128, which implements versioned remote template downloads for installed `slug init` and preserves repo-local template initialization. - Added release asset packaging/upload for `slugkit-site-template-v<version>.tgz`. - Added `slug init --help`, `--template-url`, and `--template-dir`. - Verified by PR #128 CI (`#176` green), independent review approval, and `./scripts/pre-pr.sh` passing before merge.
Author
Owner

Synced from todu comment by @todu on 2026-06-08T00:08:14.378Z

Review update

  • PR: #128 open with CI green.
  • Result: approved; all 6 acceptance criteria met in review.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-06-08T00:08:14.378Z_ ### Review update - PR: #128 open with CI green. - Result: approved; all 6 acceptance criteria met in review. - Follow-up: waiting for explicit human merge approval.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#127
No description provided.