Extract slug-auth npm package #244

Merged
erik merged 1 commit from feat/task-46a00d5d-slug-auth-package into main 2026-06-29 11:34:47 -05:00
Owner

Summary

  • Add @evcraddock/slug-auth workspace package with token/API-key helpers, magic-link delivery helpers, passkey helpers, auth logging helpers, and site-owned storage interfaces.
  • Update template-site auth modules to consume package exports while preserving local wrappers for database access, admin policy, delivery behavior, sessions, passkeys, and settings/UI integration.
  • Add generated-site dependency mapping for @evcraddock/slug-auth@0.1.0.
  • Add @evcraddock/slug-auth to the Forgejo npm package release workflow choices.
  • Document package exports, storage interfaces, local auth customization points, and security patch expectations.

Verification

  • npm run build --workspaces
  • npm run typecheck --workspaces
  • npm test --workspace @evcraddock/slug-auth
  • npm test --workspace @slugkit/template-site -- src/auth src/routes/__tests__/auth.test.ts src/routes/__tests__/admin-passkeys.test.ts src/api/__tests__/auth-check.test.ts src/api/__tests__/bearer-auth.test.ts
  • npm test --workspace @evcraddock/slug-cli -- commands.test.ts
  • npm run package:pack:dry-run -- --workspace @evcraddock/slug-auth
  • npm run package:release -- --workspace @evcraddock/slug-auth --dry-run
  • ./scripts/pre-pr.sh

Task: #task-46a00d5d

## Summary - Add `@evcraddock/slug-auth` workspace package with token/API-key helpers, magic-link delivery helpers, passkey helpers, auth logging helpers, and site-owned storage interfaces. - Update template-site auth modules to consume package exports while preserving local wrappers for database access, admin policy, delivery behavior, sessions, passkeys, and settings/UI integration. - Add generated-site dependency mapping for `@evcraddock/slug-auth@0.1.0`. - Add `@evcraddock/slug-auth` to the Forgejo npm package release workflow choices. - Document package exports, storage interfaces, local auth customization points, and security patch expectations. ## Verification - `npm run build --workspaces` - `npm run typecheck --workspaces` - `npm test --workspace @evcraddock/slug-auth` - `npm test --workspace @slugkit/template-site -- src/auth src/routes/__tests__/auth.test.ts src/routes/__tests__/admin-passkeys.test.ts src/api/__tests__/auth-check.test.ts src/api/__tests__/bearer-auth.test.ts` - `npm test --workspace @evcraddock/slug-cli -- commands.test.ts` - `npm run package:pack:dry-run -- --workspace @evcraddock/slug-auth` - `npm run package:release -- --workspace @evcraddock/slug-auth --dry-run` - `./scripts/pre-pr.sh` Task: #task-46a00d5d
feat: extract slug auth package
All checks were successful
CI / build-lint-test (pull_request) Successful in 57s
729c6ef012
Task: #task-46a00d5d
Author
Owner

Review summary

PR #244 extracts reusable auth primitives into @evcraddock/slug-auth while preserving generated-site ownership of storage, admin policy, routes, sessions, and UI wrappers. The package exposes explicit repository interfaces plus token/API-key, magic-link, passkey, and logging helpers, and the template consumes those exports through the local workspace link.

Acceptance criteria

  • @evcraddock/slug-auth exists as a workspace package — packages/slug-auth includes package metadata, TS configs, README, public exports, and tests.
  • Template site consumes @evcraddock/slug-auth through the local workspace link during monorepo development — template/site/package.json declares @evcraddock/slug-auth: 0.1.0, which npm links locally in the workspace.
  • Template-site auth behavior remains unchanged — existing auth, passkey, API-key, and bearer-auth tests pass, along with full pre-PR/CI.
  • Generated sites created after release depend on the published package — generated-site dependency mapping now includes @evcraddock/slug-auth@0.1.0.
  • Local wrappers preserve database and policy customization points — template auth wrappers remain in template/site/src/auth/* for DB access, admin policy, delivery behavior, sessions, and passkey route integration.
  • Public exports and storage interfaces are documented and tested — package README documents exports and repository interfaces; package tests cover token/API-key helpers, magic-link/SMTP helpers, passkey helpers, and storage interface exports.
  • Package is published and post-publish install/import verification succeeds — not applicable until after this implementation PR is merged; this PR adds the release workflow choice needed to publish.
  • ./scripts/pre-pr.sh passes — verified locally and Forgejo CI run #342 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-auth and verify install/import before closing the task.

Verdict

Approved. Stop at the human merge gate.

### Review summary PR #244 extracts reusable auth primitives into `@evcraddock/slug-auth` while preserving generated-site ownership of storage, admin policy, routes, sessions, and UI wrappers. The package exposes explicit repository interfaces plus token/API-key, magic-link, passkey, and logging helpers, and the template consumes those exports through the local workspace link. ### Acceptance criteria - [x] `@evcraddock/slug-auth` exists as a workspace package — `packages/slug-auth` includes package metadata, TS configs, README, public exports, and tests. - [x] Template site consumes `@evcraddock/slug-auth` through the local workspace link during monorepo development — `template/site/package.json` declares `@evcraddock/slug-auth: 0.1.0`, which npm links locally in the workspace. - [x] Template-site auth behavior remains unchanged — existing auth, passkey, API-key, and bearer-auth tests pass, along with full pre-PR/CI. - [x] Generated sites created after release depend on the published package — generated-site dependency mapping now includes `@evcraddock/slug-auth@0.1.0`. - [x] Local wrappers preserve database and policy customization points — template auth wrappers remain in `template/site/src/auth/*` for DB access, admin policy, delivery behavior, sessions, and passkey route integration. - [x] Public exports and storage interfaces are documented and tested — package README documents exports and repository interfaces; package tests cover token/API-key helpers, magic-link/SMTP helpers, passkey helpers, and storage interface exports. - [ ] Package is published and post-publish install/import verification succeeds — not applicable until after this implementation PR is merged; this PR adds the release workflow choice needed to publish. - [x] `./scripts/pre-pr.sh` passes — verified locally and Forgejo CI run #342 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-auth` and verify install/import before closing the task. ### Verdict Approved. Stop at the human merge gate.
erik merged commit 9b8d6a6f6e into main 2026-06-29 11:34:47 -05:00
erik deleted branch feat/task-46a00d5d-slug-auth-package 2026-06-29 11:34:47 -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!244
No description provided.