Support backdated post publishing #251

Merged
erik merged 1 commit from feat/task-aa01a61a-backdated-publishing into main 2026-07-03 16:29:44 -05:00
Owner

Summary

  • Adds optional publishedAt support to the Slugkit posts API create/update/publish flows.
  • Supports date-only or ISO datetime migration inputs, normalized to UTC ISO timestamps.
  • Keeps existing behavior unchanged when publishedAt is omitted.
  • Prevents default ActivityPub follower delivery for explicit backdated/imported create or publish flows.
  • Adds slug post create --published-at and slug post publish --published-at CLI support with validation.
  • Documents the migration/backdating workflow.
  • Bumps @evcraddock/slug-template to 0.1.3 and @evcraddock/slug-cli to 0.6.3.

Verification

  • npm test --workspace @slugkit/template-site -- src/api/__tests__/posts.test.ts
  • npm test --workspace @evcraddock/slug-cli -- commands.test.ts
  • npm run build --workspace @evcraddock/slug-template
  • npm run build --workspace @evcraddock/slug-cli
  • npm test --workspace @evcraddock/slug-template
  • ./scripts/pre-pr.sh
  • npm run package:pack:dry-run -- --workspace @evcraddock/slug-template
  • npm run package:release -- --workspace @evcraddock/slug-template --dry-run
  • npm pack --workspace @evcraddock/slug-cli --dry-run

Task: #task-aa01a61a

## Summary - Adds optional `publishedAt` support to the Slugkit posts API create/update/publish flows. - Supports date-only or ISO datetime migration inputs, normalized to UTC ISO timestamps. - Keeps existing behavior unchanged when `publishedAt` is omitted. - Prevents default ActivityPub follower delivery for explicit backdated/imported create or publish flows. - Adds `slug post create --published-at` and `slug post publish --published-at` CLI support with validation. - Documents the migration/backdating workflow. - Bumps `@evcraddock/slug-template` to `0.1.3` and `@evcraddock/slug-cli` to `0.6.3`. ## Verification - `npm test --workspace @slugkit/template-site -- src/api/__tests__/posts.test.ts` - `npm test --workspace @evcraddock/slug-cli -- commands.test.ts` - `npm run build --workspace @evcraddock/slug-template` - `npm run build --workspace @evcraddock/slug-cli` - `npm test --workspace @evcraddock/slug-template` - `./scripts/pre-pr.sh` - `npm run package:pack:dry-run -- --workspace @evcraddock/slug-template` - `npm run package:release -- --workspace @evcraddock/slug-template --dry-run` - `npm pack --workspace @evcraddock/slug-cli --dry-run` Task: #task-aa01a61a
feat: support backdated post publishing
All checks were successful
CI / build-lint-test (pull_request) Successful in 1m52s
a9f6082177
Task: #task-aa01a61a
erik force-pushed feat/task-aa01a61a-backdated-publishing from a9f6082177
All checks were successful
CI / build-lint-test (pull_request) Successful in 1m52s
to 2b36ebf70e
All checks were successful
CI / build-lint-test (pull_request) Successful in 57s
2026-07-03 16:14:00 -05:00
Compare
Author
Owner

Review summary

PR #251 implements optional backdated publishing for migration/import workflows while preserving existing behavior when publishedAt is omitted.

Acceptance criteria

  • Slugkit posts API spec documents how clients set an explicit publish timestamp — docs/specs/02-posts-routes.md documents optional publishedAt on create/update/publish, date handling, validation, and federation expectations.
  • Template site implements explicit publish timestamp support for articles, links, and notes — template/site/src/posts/posts.ts stores normalized timestamps and template/site/src/api/routes/posts.ts accepts optional publishedAt on create/update/publish.
  • slug CLI can create or publish content with a caller-provided publish date/time — cli/src/commands.ts supports --published-at on create/edit/publish and sends it only when present.
  • Invalid dates are rejected with standardized validation errors — template API maps invalid timestamps to VALIDATION_ERROR; CLI rejects invalid values before requests.
  • Existing publish behavior without an explicit timestamp is unchanged — omitted publishedAt still uses server current time and normal publish delivery path.
  • Migration/backdating behavior is documented, including federation/notification expectations — docs/blog-migration.md, CLI README, and specs state explicit backdated publishing does not notify/federate by default.
  • Tests cover explicit publish timestamps for create/publish paths and CLI argument handling — template posts API tests and CLI command tests cover backdated create/publish and invalid input.

Verification evidence

  • Local ./scripts/pre-pr.sh passed.
  • Forgejo CI run #373 passed.
  • Package dry-runs passed for @evcraddock/slug-template@0.1.3 and @evcraddock/slug-cli@0.6.3.

Blocking issues

None.

Verdict

Approved for merge. Human merge approval still required.

### Review summary PR #251 implements optional backdated publishing for migration/import workflows while preserving existing behavior when `publishedAt` is omitted. ### Acceptance criteria - [x] Slugkit posts API spec documents how clients set an explicit publish timestamp — `docs/specs/02-posts-routes.md` documents optional `publishedAt` on create/update/publish, date handling, validation, and federation expectations. - [x] Template site implements explicit publish timestamp support for articles, links, and notes — `template/site/src/posts/posts.ts` stores normalized timestamps and `template/site/src/api/routes/posts.ts` accepts optional `publishedAt` on create/update/publish. - [x] `slug` CLI can create or publish content with a caller-provided publish date/time — `cli/src/commands.ts` supports `--published-at` on create/edit/publish and sends it only when present. - [x] Invalid dates are rejected with standardized validation errors — template API maps invalid timestamps to `VALIDATION_ERROR`; CLI rejects invalid values before requests. - [x] Existing publish behavior without an explicit timestamp is unchanged — omitted `publishedAt` still uses server current time and normal publish delivery path. - [x] Migration/backdating behavior is documented, including federation/notification expectations — `docs/blog-migration.md`, CLI README, and specs state explicit backdated publishing does not notify/federate by default. - [x] Tests cover explicit publish timestamps for create/publish paths and CLI argument handling — template posts API tests and CLI command tests cover backdated create/publish and invalid input. ### Verification evidence - Local `./scripts/pre-pr.sh` passed. - Forgejo CI run #373 passed. - Package dry-runs passed for `@evcraddock/slug-template@0.1.3` and `@evcraddock/slug-cli@0.6.3`. ### Blocking issues None. ### Verdict Approved for merge. Human merge approval still required.
erik merged commit 77f5e3d166 into main 2026-07-03 16:29:44 -05:00
erik deleted branch feat/task-aa01a61a-backdated-publishing 2026-07-03 16:29: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!251
No description provided.