Extract slug-api npm package #233

Closed
opened 2026-06-28 22:33:12 -05:00 by erik · 3 comments
Owner

Goal

Create @evcraddock/slug-api for reusable Hono API helpers for Slugkit-compatible management APIs while keeping generated sites in control of route composition, services, and persistence.

Requirements

  • Implement the work described in docs/npm-specs/04-slug-api.md.
  • Create packages/slug-api with TypeScript build, tests, README, package metadata, and public exports.
  • Extract standard JSON response helpers, Slugkit error serialization, not-implemented responses, OpenAPI serving helpers, metadata/health route helpers where generic, and bearer-auth middleware composition helpers.
  • Update the template site to consume @evcraddock/slug-api via workspace:*.
  • Keep local wrapper/route modules under template/site/src/api/* where they expose route composition, site services, or customization points.
  • Ensure generated sites created after release depend on the published @evcraddock/slug-api package version.
  • Publish the package to npm and verify post-publish install/mount/import behavior.

Acceptance criteria

  • @evcraddock/slug-api exists as a workspace package.
  • Template site consumes @evcraddock/slug-api via workspace:*.
  • Template-site Slugkit API behavior remains unchanged.
  • Generated sites created after release depend on the published @evcraddock/slug-api package.
  • Local API route modules preserve customization escape hatches.
  • Public exports are documented and tested.
  • Package is published and post-publish mount/import verification succeeds.
  • ./scripts/pre-pr.sh passes.

Dependencies

  • task-46a00d5d
## Goal Create `@evcraddock/slug-api` for reusable Hono API helpers for Slugkit-compatible management APIs while keeping generated sites in control of route composition, services, and persistence. ## Requirements - Implement the work described in `docs/npm-specs/04-slug-api.md`. - Create `packages/slug-api` with TypeScript build, tests, README, package metadata, and public exports. - Extract standard JSON response helpers, Slugkit error serialization, not-implemented responses, OpenAPI serving helpers, metadata/health route helpers where generic, and bearer-auth middleware composition helpers. - Update the template site to consume `@evcraddock/slug-api` via `workspace:*`. - Keep local wrapper/route modules under `template/site/src/api/*` where they expose route composition, site services, or customization points. - Ensure generated sites created after release depend on the published `@evcraddock/slug-api` package version. - Publish the package to npm and verify post-publish install/mount/import behavior. ## Acceptance criteria - [ ] `@evcraddock/slug-api` exists as a workspace package. - [ ] Template site consumes `@evcraddock/slug-api` via `workspace:*`. - [ ] Template-site Slugkit API behavior remains unchanged. - [ ] Generated sites created after release depend on the published `@evcraddock/slug-api` package. - [ ] Local API route modules preserve customization escape hatches. - [ ] Public exports are documented and tested. - [ ] Package is published and post-publish mount/import verification succeeds. - [ ] `./scripts/pre-pr.sh` passes. ## Dependencies - task-46a00d5d
Author
Owner

Synced from todu comment by @todu on 2026-06-29T17:09:20.737Z

Review update

  • PR: #245 is open with Forgejo CI run #348 passing.
  • Result: approved for merge.
  • Verified: @evcraddock/slug-api package extraction, template API wrapper integration, generated-site dependency mapping, package pack/release dry-runs, ./scripts/pre-pr.sh, and Forgejo CI build-lint-test passed.
  • Follow-up: after merge, publish @evcraddock/slug-api@0.1.0 through Forgejo CI and verify post-publish install/mount/import before task closure.
_Synced from todu comment by @todu on 2026-06-29T17:09:20.737Z_ ### Review update - PR: #245 is open with Forgejo CI run #348 passing. - Result: approved for merge. - Verified: `@evcraddock/slug-api` package extraction, template API wrapper integration, generated-site dependency mapping, package pack/release dry-runs, `./scripts/pre-pr.sh`, and Forgejo CI `build-lint-test` passed. - Follow-up: after merge, publish `@evcraddock/slug-api@0.1.0` through Forgejo CI and verify post-publish install/mount/import before task closure.
Author
Owner

Synced from todu comment by @todu on 2026-06-29T17:19:45.337Z

Update

  • Merged PR #245 into main.
  • Published @evcraddock/slug-api@0.1.0 through Forgejo CI.
  • Verified npm view @evcraddock/slug-api@0.1.0 version returns 0.1.0.
  • Verified a temporary project can install/import @evcraddock/slug-api@0.1.0, mount registerHealthRoute in a Hono app, and receive the expected JSON health response.
  • Forgejo release workflow run #351 passed after npm registry propagation completed.
_Synced from todu comment by @todu on 2026-06-29T17:19:45.337Z_ ### Update - Merged PR #245 into `main`. - Published `@evcraddock/slug-api@0.1.0` through Forgejo CI. - Verified `npm view @evcraddock/slug-api@0.1.0 version` returns `0.1.0`. - Verified a temporary project can install/import `@evcraddock/slug-api@0.1.0`, mount `registerHealthRoute` in a Hono app, and receive the expected JSON health response. - Forgejo release workflow run #351 passed after npm registry propagation completed.
erik 2026-06-29 21:05:26 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-30T02:01:55.032Z

Completed

  • Merged PR #245 into main, adding @evcraddock/slug-api under packages/slug-api with package metadata, README, TypeScript build config, public exports, and tests.
  • Updated the template site to consume @evcraddock/slug-api@0.1.0 through npm workspace linking while preserving local API route modules for route composition, site services, and customization points.
  • Updated generated-site dependency handling so future generated sites depend on published @evcraddock/slug-api@0.1.0.
  • Verified template API behavior through focused API tests, full ./scripts/pre-pr.sh, PR CI, and post-merge push CI.
  • Published @evcraddock/slug-api@0.1.0 through Forgejo CI and verified npm view plus temporary install/import and Hono route mounting.
_Synced from todu comment by @todu on 2026-06-30T02:01:55.032Z_ ### Completed - Merged PR #245 into `main`, adding `@evcraddock/slug-api` under `packages/slug-api` with package metadata, README, TypeScript build config, public exports, and tests. - Updated the template site to consume `@evcraddock/slug-api@0.1.0` through npm workspace linking while preserving local API route modules for route composition, site services, and customization points. - Updated generated-site dependency handling so future generated sites depend on published `@evcraddock/slug-api@0.1.0`. - Verified template API behavior through focused API tests, full `./scripts/pre-pr.sh`, PR CI, and post-merge push CI. - Published `@evcraddock/slug-api@0.1.0` through Forgejo CI and verified npm view plus temporary install/import and Hono route mounting.
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#233
No description provided.