Package slug-template for npm init use #247

Merged
erik merged 2 commits from feat/task-dce4aca3-slug-template-package into main 2026-06-30 06:50:44 -05:00
Owner

Summary

  • Add @evcraddock/slug-template as the default package-backed Slugkit site template.
  • Ship template metadata, included Slugkit package versions, copy filters, placeholder rules, and template root helpers.
  • Build the package by copying the canonical template/site source into dist/template with generated-site filters applied.
  • Update slug init to consume the template package by default and reserve --template for future named/external template packages while preserving --template-dir and --template-url overrides.
  • Keep generated sites standalone with published @evcraddock/slug-* dependency versions and no CLI source.
  • Add @evcraddock/slug-template to the npm package release workflow choices and update docs.

Verification

  • npm run typecheck --workspaces
  • npm run build
  • npm test --workspace @evcraddock/slug-template
  • npm test --workspace @evcraddock/slug-cli -- commands.test.ts
  • npm run package:pack:dry-run -- --workspace @evcraddock/slug-template
  • npm run package:release -- --workspace @evcraddock/slug-template --dry-run
  • packaged-template slug init smoke test from built CLI
  • ./scripts/pre-pr.sh

Task: #task-dce4aca3

Note: template/site/src/styles/public.css has an unrelated pre-existing local working tree change and is intentionally not included in this PR.

## Summary - Add `@evcraddock/slug-template` as the default package-backed Slugkit site template. - Ship template metadata, included Slugkit package versions, copy filters, placeholder rules, and template root helpers. - Build the package by copying the canonical `template/site` source into `dist/template` with generated-site filters applied. - Update `slug init` to consume the template package by default and reserve `--template` for future named/external template packages while preserving `--template-dir` and `--template-url` overrides. - Keep generated sites standalone with published `@evcraddock/slug-*` dependency versions and no CLI source. - Add `@evcraddock/slug-template` to the npm package release workflow choices and update docs. ## Verification - `npm run typecheck --workspaces` - `npm run build` - `npm test --workspace @evcraddock/slug-template` - `npm test --workspace @evcraddock/slug-cli -- commands.test.ts` - `npm run package:pack:dry-run -- --workspace @evcraddock/slug-template` - `npm run package:release -- --workspace @evcraddock/slug-template --dry-run` - packaged-template `slug init` smoke test from built CLI - `./scripts/pre-pr.sh` Task: #task-dce4aca3 Note: `template/site/src/styles/public.css` has an unrelated pre-existing local working tree change and is intentionally not included in this PR.
feat: package slug template
All checks were successful
CI / build-lint-test (pull_request) Successful in 1m2s
23d7059c3e
Task: #task-dce4aca3
Author
Owner

Review summary

PR #247 packages the default Slugkit template as @evcraddock/slug-template, updates slug init to use the package-backed template contract by default, and leaves room for future named/external templates through --template while preserving explicit --template-dir and --template-url overrides.

Acceptance criteria

  • @evcraddock/slug-template exists as a workspace package — packages/slug-template includes package metadata, README, TS configs, public exports, build copy script, and tests.
  • slug init consumes the template package rather than relying only on ad hoc in-repo paths — default resolution now uses getTemplateRoot() from @evcraddock/slug-template when no explicit local/remote override is provided.
  • Generated sites created after release use published @evcraddock/slug-* dependency versions — package metadata exports GENERATED_SITE_SLUGKIT_DEPENDENCIES, and CLI replacement keeps generated manifests on published semver versions.
  • Generated sites do not contain CLI source — existing CLI init checks remain, and copy filters are centralized in the template package.
  • Template metadata records included package versions — getTemplateMetadata() exposes included Slugkit package versions, compatibility, copy filters, and placeholder rules.
  • Package is published and post-publish slug init verification succeeds — not applicable until after merge; release workflow choice is added.
  • ./scripts/pre-pr.sh passes — verified locally; Forgejo CI run #356 passed.

Blocking issues

None for merging this implementation PR.

Warnings

  • Post-merge release still required: dispatch the Forgejo npm package release workflow for @evcraddock/slug-template and verify post-publish slug init behavior before closing the task.
  • The working tree has an unrelated local template/site/src/styles/public.css change that is intentionally excluded from the PR.

Verdict

Approved. Stop at the human merge gate.

### Review summary PR #247 packages the default Slugkit template as `@evcraddock/slug-template`, updates `slug init` to use the package-backed template contract by default, and leaves room for future named/external templates through `--template` while preserving explicit `--template-dir` and `--template-url` overrides. ### Acceptance criteria - [x] `@evcraddock/slug-template` exists as a workspace package — `packages/slug-template` includes package metadata, README, TS configs, public exports, build copy script, and tests. - [x] `slug init` consumes the template package rather than relying only on ad hoc in-repo paths — default resolution now uses `getTemplateRoot()` from `@evcraddock/slug-template` when no explicit local/remote override is provided. - [x] Generated sites created after release use published `@evcraddock/slug-*` dependency versions — package metadata exports `GENERATED_SITE_SLUGKIT_DEPENDENCIES`, and CLI replacement keeps generated manifests on published semver versions. - [x] Generated sites do not contain CLI source — existing CLI init checks remain, and copy filters are centralized in the template package. - [x] Template metadata records included package versions — `getTemplateMetadata()` exposes included Slugkit package versions, compatibility, copy filters, and placeholder rules. - [ ] Package is published and post-publish `slug init` verification succeeds — not applicable until after merge; release workflow choice is added. - [x] `./scripts/pre-pr.sh` passes — verified locally; Forgejo CI run #356 passed. ### Blocking issues None for merging this implementation PR. ### Warnings - Post-merge release still required: dispatch the Forgejo npm package release workflow for `@evcraddock/slug-template` and verify post-publish `slug init` behavior before closing the task. - The working tree has an unrelated local `template/site/src/styles/public.css` change that is intentionally excluded from the PR. ### Verdict Approved. Stop at the human merge gate.
chore: refresh generated template css
All checks were successful
CI / build-lint-test (pull_request) Successful in 1m0s
0de7195214
Task: #task-dce4aca3
erik merged commit 4318d561f8 into main 2026-06-30 06:50:44 -05:00
erik deleted branch feat/task-dce4aca3-slug-template-package 2026-06-30 06:50:44 -05:00
Sign in to join this conversation.
No reviewers
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!247
No description provided.