@yosr-ai/template-next-fullstack 0.1.0-alpha.4 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @yosr-ai/template-next-fullstack
2
2
 
3
+ ## 0.1.0-alpha.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Note times show in the viewer's timezone; release waits up to 5 minutes for the registry; test cleanup retries on macOS.
8
+
3
9
  ## 0.1.0-alpha.4
4
10
 
5
11
  ### Patch Changes
@@ -1,11 +1,6 @@
1
1
  import type { Note } from "@domain/notes/note-schema";
2
2
 
3
- function noteWhen(createdAt: Date): string {
4
- return new Intl.DateTimeFormat(undefined, {
5
- dateStyle: "medium",
6
- timeStyle: "short",
7
- }).format(createdAt);
8
- }
3
+ import { NoteWhen } from "./note-when";
9
4
 
10
5
  export function NoteList({ notes }: { notes: Note[] }) {
11
6
  if (notes.length === 0) {
@@ -17,12 +12,10 @@ export function NoteList({ notes }: { notes: Note[] }) {
17
12
  {notes.map((note) => (
18
13
  <li key={note.id} className="rounded-md border p-3">
19
14
  <p className="font-medium">{note.title}</p>
20
- <time
21
- dateTime={note.createdAt.toISOString()}
15
+ <NoteWhen
16
+ iso={note.createdAt.toISOString()}
22
17
  className="text-xs text-muted-foreground"
23
- >
24
- {noteWhen(note.createdAt)}
25
- </time>
18
+ />
26
19
  </li>
27
20
  ))}
28
21
  </ul>
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ import { useSyncExternalStore } from "react";
4
+
5
+ import { formatNoteWhen } from "@domain/notes/format-note-when";
6
+
7
+ function subscribe(): () => void {
8
+ return () => {};
9
+ }
10
+
11
+ /** Renders a note time in the viewer's timezone on the client; ISO on the server. */
12
+ export function NoteWhen({
13
+ iso,
14
+ className,
15
+ }: {
16
+ iso: string;
17
+ className?: string;
18
+ }) {
19
+ const label = useSyncExternalStore(
20
+ subscribe,
21
+ () => formatNoteWhen(iso),
22
+ () => iso,
23
+ );
24
+
25
+ return (
26
+ <time dateTime={iso} className={className}>
27
+ {label}
28
+ </time>
29
+ );
30
+ }
@@ -0,0 +1,19 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ import { formatNoteWhen } from "./format-note-when";
4
+
5
+ describe("formatNoteWhen", () => {
6
+ const iso = "2026-06-15T12:00:00.000Z";
7
+
8
+ it("formats with medium date and short time in a fixed timezone", () => {
9
+ const utc = formatNoteWhen(iso, "UTC");
10
+ expect(utc.length).toBeGreaterThan(0);
11
+ expect(utc).toMatch(/2026/);
12
+ });
13
+
14
+ it("changes the clock face when the timezone changes", () => {
15
+ const utc = formatNoteWhen(iso, "UTC");
16
+ const tokyo = formatNoteWhen(iso, "Asia/Tokyo");
17
+ expect(tokyo).not.toBe(utc);
18
+ });
19
+ });
@@ -0,0 +1,8 @@
1
+ /** Format a note timestamp for display (viewer timezone when timeZone is omitted). */
2
+ export function formatNoteWhen(iso: string, timeZone?: string): string {
3
+ return new Intl.DateTimeFormat(undefined, {
4
+ dateStyle: "medium",
5
+ timeStyle: "short",
6
+ ...(timeZone === undefined ? {} : { timeZone }),
7
+ }).format(new Date(iso));
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yosr-ai/template-next-fullstack",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Yosr Seed next-fullstack template.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "../../../docs/engineering/schemas/seed.template.schema.json",
3
3
  "schemaVersion": "0.1",
4
4
  "name": "next-fullstack",
5
- "version": "0.1.0-alpha.4",
5
+ "version": "0.1.0-alpha.5",
6
6
  "title": "Next.js full-stack (TypeScript)",
7
7
  "description": "Prototype of Yosr Seed's first base template (Next.js + TypeScript, Tailwind + shadcn/ui, Vitest + Playwright smoke test). Implemented: base files with the ADR 0006 defaults, the orm-drizzle and orm-prisma overlays (database=postgres), database=none (base without either overlay), deploy=docker (standalone image, compose Postgres only when database=postgres), Auth.js, Clerk, tRPC, Stripe, and a recorded AI delta for domain-features. x-prototype.stubbedFeatures is empty. Dependency versions pinned from the npm registry on 2026-10-19 (Prisma adapter on 2026-10-28, Clerk on 2026-10-28, tRPC on 2026-10-29, Stripe on 2026-10-29).",
8
8
  "license": "MIT",