@cimplify/cli 0.9.0 → 0.9.1
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/dist/{add-HCVYD33F.mjs → add-ZRSE2STJ.mjs} +1 -1
- package/dist/{chunk-VHXZ4SGF.mjs → chunk-N3YC3V2N.mjs} +2 -2
- package/dist/{chunk-WNZ6N634.mjs → chunk-SS3XKLBR.mjs} +1 -1
- package/dist/{chunk-DE4MI2UK.mjs → chunk-WBNI7PWA.mjs} +18 -18
- package/dist/dispatcher.mjs +9 -9
- package/dist/{doctor-2OIPFMDS.mjs → doctor-JIPUNSOC.mjs} +2 -2
- package/dist/{explain-JBPAC2ZB.mjs → explain-6LPKSOBY.mjs} +1 -1
- package/dist/{introspect-5BX4KGO4.mjs → introspect-TDUKKAZE.mjs} +2 -2
- package/dist/{list-5WLNIKFF.mjs → list-FCBWJ5DY.mjs} +1 -1
- package/dist/{update-6EVYEGKD.mjs → update-7BHT5CL5.mjs} +1 -1
- package/package.json +2 -2
- package/templates/storefront-auto/CLAUDE.md +39 -0
- package/templates/storefront-auto/components/mobile-nav.tsx +58 -48
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/CLAUDE.md +39 -0
- package/templates/storefront-bakery/components/mobile-nav.tsx +58 -48
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/CLAUDE.md +39 -0
- package/templates/storefront-fashion/components/mobile-nav.tsx +58 -48
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/CLAUDE.md +39 -0
- package/templates/storefront-grocery/components/mobile-nav.tsx +58 -48
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/CLAUDE.md +39 -0
- package/templates/storefront-pharmacy/components/mobile-nav.tsx +58 -48
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/CLAUDE.md +39 -0
- package/templates/storefront-restaurant/components/mobile-nav.tsx +58 -48
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/CLAUDE.md +39 -0
- package/templates/storefront-retail/components/mobile-nav.tsx +58 -48
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/CLAUDE.md +39 -0
- package/templates/storefront-services/app/book/book-client.tsx +1 -0
- package/templates/storefront-services/bun.lock +454 -8
- package/templates/storefront-services/components/mobile-nav.tsx +58 -48
- package/templates/storefront-services/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
4
5
|
import Link from "next/link";
|
|
5
6
|
import { brand } from "@/lib/brand";
|
|
6
7
|
|
|
@@ -11,6 +12,9 @@ import { brand } from "@/lib/brand";
|
|
|
11
12
|
*/
|
|
12
13
|
export function MobileNav() {
|
|
13
14
|
const [open, setOpen] = useState(false);
|
|
15
|
+
const [mounted, setMounted] = useState(false);
|
|
16
|
+
|
|
17
|
+
useEffect(() => setMounted(true), []);
|
|
14
18
|
|
|
15
19
|
useEffect(() => {
|
|
16
20
|
if (!open) return;
|
|
@@ -53,61 +57,67 @@ export function MobileNav() {
|
|
|
53
57
|
</svg>
|
|
54
58
|
</button>
|
|
55
59
|
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
className="absolute inset-0 bg-background/80 backdrop-blur-sm"
|
|
63
|
-
/>
|
|
64
|
-
<nav
|
|
65
|
-
id="mobile-nav-drawer"
|
|
66
|
-
aria-label="Mobile navigation"
|
|
67
|
-
className="absolute inset-y-0 right-0 w-[85%] max-w-sm flex flex-col bg-background border-l border-border shadow-2xl"
|
|
68
|
-
>
|
|
69
|
-
<div className="flex items-center justify-between px-6 py-4 border-b border-border">
|
|
70
|
-
<span className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">
|
|
71
|
-
Menu
|
|
72
|
-
</span>
|
|
60
|
+
{/* Portalled: the header carries `backdrop-filter`, which makes it the
|
|
61
|
+
containing block for `position: fixed`, clamping this drawer to the
|
|
62
|
+
header's box. */}
|
|
63
|
+
{open && mounted
|
|
64
|
+
? createPortal(
|
|
65
|
+
<div className="fixed inset-0 z-50 sm:hidden">
|
|
73
66
|
<button
|
|
74
67
|
type="button"
|
|
75
68
|
onClick={() => setOpen(false)}
|
|
76
69
|
aria-label="Close menu"
|
|
77
|
-
className="
|
|
70
|
+
className="absolute inset-0 bg-background/80 backdrop-blur-sm"
|
|
71
|
+
/>
|
|
72
|
+
<nav
|
|
73
|
+
id="mobile-nav-drawer"
|
|
74
|
+
aria-label="Mobile navigation"
|
|
75
|
+
className="absolute inset-y-0 right-0 w-[85%] max-w-sm flex flex-col bg-background border-l border-border shadow-2xl"
|
|
78
76
|
>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
strokeWidth="2"
|
|
86
|
-
strokeLinecap="round"
|
|
87
|
-
strokeLinejoin="round"
|
|
88
|
-
aria-hidden="true"
|
|
89
|
-
>
|
|
90
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
91
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
92
|
-
</svg>
|
|
93
|
-
</button>
|
|
94
|
-
</div>
|
|
95
|
-
<ul className="flex flex-col gap-1 px-3 py-4">
|
|
96
|
-
{brand.header.nav.map((link) => (
|
|
97
|
-
<li key={link.href}>
|
|
98
|
-
<Link
|
|
99
|
-
href={link.href}
|
|
77
|
+
<div className="flex items-center justify-between px-6 py-4 border-b border-border">
|
|
78
|
+
<span className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">
|
|
79
|
+
Menu
|
|
80
|
+
</span>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
100
83
|
onClick={() => setOpen(false)}
|
|
101
|
-
|
|
84
|
+
aria-label="Close menu"
|
|
85
|
+
className="grid place-items-center w-11 h-11 -mr-2 rounded-md text-foreground hover:bg-muted transition-colors"
|
|
102
86
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
87
|
+
<svg
|
|
88
|
+
width="20"
|
|
89
|
+
height="20"
|
|
90
|
+
viewBox="0 0 24 24"
|
|
91
|
+
fill="none"
|
|
92
|
+
stroke="currentColor"
|
|
93
|
+
strokeWidth="2"
|
|
94
|
+
strokeLinecap="round"
|
|
95
|
+
strokeLinejoin="round"
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
>
|
|
98
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
99
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
100
|
+
</svg>
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
<ul className="flex flex-col gap-1 px-3 py-4">
|
|
104
|
+
{brand.header.nav.map((link) => (
|
|
105
|
+
<li key={link.href}>
|
|
106
|
+
<Link
|
|
107
|
+
href={link.href}
|
|
108
|
+
onClick={() => setOpen(false)}
|
|
109
|
+
className="block px-3 py-3 rounded-md text-base font-medium text-foreground hover:bg-muted transition-colors"
|
|
110
|
+
>
|
|
111
|
+
{link.label}
|
|
112
|
+
</Link>
|
|
113
|
+
</li>
|
|
114
|
+
))}
|
|
115
|
+
</ul>
|
|
116
|
+
</nav>
|
|
117
|
+
</div>,
|
|
118
|
+
document.body,
|
|
119
|
+
)
|
|
120
|
+
: null}
|
|
111
121
|
</>
|
|
112
122
|
);
|
|
113
123
|
}
|
|
@@ -21,3 +21,42 @@ That covers ~95% of what merchants ask for. For anything else, follow the `cimpl
|
|
|
21
21
|
- Add `'use cache'`, `cacheTag`, or `cacheLife` anywhere. Use the SDK's `cacheOptions` instead.
|
|
22
22
|
- Use `unstable_cache` — it's gone in Next 16. Use SDK `cacheOptions` or `fetch.next.{revalidate,tags}`.
|
|
23
23
|
- Run `bun test` (Bun's `vi` shim is incomplete) — use `bun run test:run`.
|
|
24
|
+
|
|
25
|
+
## Design bans
|
|
26
|
+
|
|
27
|
+
Not style preferences — these are the tells of a generated site. Grep for them before calling any piece of work done.
|
|
28
|
+
|
|
29
|
+
- **No scroll-down indicators.** No "scroll" label, chevron, arrow, mouse glyph, or bouncing hint under a hero.
|
|
30
|
+
- **No ornament glyphs** — ◆ ◇ ✦ ✧ ❖ as dividers, bullets, or separators. No `01 / 02 / 03` section numbering.
|
|
31
|
+
- No purple/blue gradient washes, glassmorphism-by-default cards, floating badge pills, or emoji in UI copy.
|
|
32
|
+
- No boxed text-button clusters in the navbar — use icons (search, account, cart with count).
|
|
33
|
+
- No border radius unless the brief asks for softness; prefer hairline borders.
|
|
34
|
+
|
|
35
|
+
Reserve glass for surfaces that earn it (navbar, flyouts, overlays) and execute it properly: deep `backdrop-filter` blur **with saturation**, a specular top edge, a soft falling shadow. Never a flat translucent white card.
|
|
36
|
+
|
|
37
|
+
Ask of each screen: does this read as "template with new colours"? If so, it isn't done.
|
|
38
|
+
|
|
39
|
+
## Known traps
|
|
40
|
+
|
|
41
|
+
- **`backdrop-filter` creates a containing block.** A navbar carrying it becomes the containing block for `position: fixed` children, so a fixed mobile drawer gets clamped to the navbar's box and renders transparent. Portal overlays and drawers to `<body>`.
|
|
42
|
+
- **Google Fonts fetches fail at build time in some environments.** Self-host font files in `app/fonts/` rather than depending on a network fetch mid-build.
|
|
43
|
+
- **Never show a slot the booking engine will reject.** Source the availability grid from the strict bookable endpoint, not the general calendar. If a service verifies unavailable or returns zero slots, render a call-the-shop fallback with the real phone number — never an empty grid.
|
|
44
|
+
- **Route media through `lib/media.ts`.** No hardcoded asset URLs in components. Transcode phone video (usually HEVC, unplayable in most browsers) to H.264, and size images down before shipping them.
|
|
45
|
+
|
|
46
|
+
## Verification loop
|
|
47
|
+
|
|
48
|
+
Continuously, not once at the end:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
build → start on PORT 3100 → screenshot at 1440px and 390px → fix → repeat
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Verify on **port 3100**. Dev holds 3000, and a stray verification server there blocks restarts. Kill your own.
|
|
55
|
+
- Read the **full** build output, unfiltered — a hidden page-generation failure ships as "Could not find a production build".
|
|
56
|
+
- Actually look at the screenshots. "It compiled" is not "it looks right".
|
|
57
|
+
- Screenshot interactive states too: nav open, search flyout, chat open, booking flow, mobile menu.
|
|
58
|
+
- Test once per round with reduced motion emulated.
|
|
59
|
+
|
|
60
|
+
## Escalate rather than loop
|
|
61
|
+
|
|
62
|
+
Stop and ask for: the live API key, go-live approval (`--prod`), anything irreversible (deleting CDN assets, domain changes), and dashboard-side changes you cannot make from code — typically staff-to-service assignment when a service returns zero availability while its API fields look identical to a working one. Present the evidence, then carry on with everything else.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
4
5
|
import Link from "next/link";
|
|
5
6
|
import { brand } from "@/lib/brand";
|
|
6
7
|
|
|
@@ -11,6 +12,9 @@ import { brand } from "@/lib/brand";
|
|
|
11
12
|
*/
|
|
12
13
|
export function MobileNav() {
|
|
13
14
|
const [open, setOpen] = useState(false);
|
|
15
|
+
const [mounted, setMounted] = useState(false);
|
|
16
|
+
|
|
17
|
+
useEffect(() => setMounted(true), []);
|
|
14
18
|
|
|
15
19
|
useEffect(() => {
|
|
16
20
|
if (!open) return;
|
|
@@ -53,61 +57,67 @@ export function MobileNav() {
|
|
|
53
57
|
</svg>
|
|
54
58
|
</button>
|
|
55
59
|
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
className="absolute inset-0 bg-background/80 backdrop-blur-sm"
|
|
63
|
-
/>
|
|
64
|
-
<nav
|
|
65
|
-
id="mobile-nav-drawer"
|
|
66
|
-
aria-label="Mobile navigation"
|
|
67
|
-
className="absolute inset-y-0 right-0 w-[85%] max-w-sm flex flex-col bg-background border-l border-border shadow-2xl"
|
|
68
|
-
>
|
|
69
|
-
<div className="flex items-center justify-between px-6 py-4 border-b border-border">
|
|
70
|
-
<span className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">
|
|
71
|
-
Menu
|
|
72
|
-
</span>
|
|
60
|
+
{/* Portalled: the header carries `backdrop-filter`, which makes it the
|
|
61
|
+
containing block for `position: fixed`, clamping this drawer to the
|
|
62
|
+
header's box. */}
|
|
63
|
+
{open && mounted
|
|
64
|
+
? createPortal(
|
|
65
|
+
<div className="fixed inset-0 z-50 sm:hidden">
|
|
73
66
|
<button
|
|
74
67
|
type="button"
|
|
75
68
|
onClick={() => setOpen(false)}
|
|
76
69
|
aria-label="Close menu"
|
|
77
|
-
className="
|
|
70
|
+
className="absolute inset-0 bg-background/80 backdrop-blur-sm"
|
|
71
|
+
/>
|
|
72
|
+
<nav
|
|
73
|
+
id="mobile-nav-drawer"
|
|
74
|
+
aria-label="Mobile navigation"
|
|
75
|
+
className="absolute inset-y-0 right-0 w-[85%] max-w-sm flex flex-col bg-background border-l border-border shadow-2xl"
|
|
78
76
|
>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
strokeWidth="2"
|
|
86
|
-
strokeLinecap="round"
|
|
87
|
-
strokeLinejoin="round"
|
|
88
|
-
aria-hidden="true"
|
|
89
|
-
>
|
|
90
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
91
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
92
|
-
</svg>
|
|
93
|
-
</button>
|
|
94
|
-
</div>
|
|
95
|
-
<ul className="flex flex-col gap-1 px-3 py-4">
|
|
96
|
-
{brand.header.nav.map((link) => (
|
|
97
|
-
<li key={link.href}>
|
|
98
|
-
<Link
|
|
99
|
-
href={link.href}
|
|
77
|
+
<div className="flex items-center justify-between px-6 py-4 border-b border-border">
|
|
78
|
+
<span className="text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground">
|
|
79
|
+
Menu
|
|
80
|
+
</span>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
100
83
|
onClick={() => setOpen(false)}
|
|
101
|
-
|
|
84
|
+
aria-label="Close menu"
|
|
85
|
+
className="grid place-items-center w-11 h-11 -mr-2 rounded-md text-foreground hover:bg-muted transition-colors"
|
|
102
86
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
87
|
+
<svg
|
|
88
|
+
width="20"
|
|
89
|
+
height="20"
|
|
90
|
+
viewBox="0 0 24 24"
|
|
91
|
+
fill="none"
|
|
92
|
+
stroke="currentColor"
|
|
93
|
+
strokeWidth="2"
|
|
94
|
+
strokeLinecap="round"
|
|
95
|
+
strokeLinejoin="round"
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
>
|
|
98
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
99
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
100
|
+
</svg>
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
<ul className="flex flex-col gap-1 px-3 py-4">
|
|
104
|
+
{brand.header.nav.map((link) => (
|
|
105
|
+
<li key={link.href}>
|
|
106
|
+
<Link
|
|
107
|
+
href={link.href}
|
|
108
|
+
onClick={() => setOpen(false)}
|
|
109
|
+
className="block px-3 py-3 rounded-md text-base font-medium text-foreground hover:bg-muted transition-colors"
|
|
110
|
+
>
|
|
111
|
+
{link.label}
|
|
112
|
+
</Link>
|
|
113
|
+
</li>
|
|
114
|
+
))}
|
|
115
|
+
</ul>
|
|
116
|
+
</nav>
|
|
117
|
+
</div>,
|
|
118
|
+
document.body,
|
|
119
|
+
)
|
|
120
|
+
: null}
|
|
111
121
|
</>
|
|
112
122
|
);
|
|
113
123
|
}
|
|
@@ -21,3 +21,42 @@ That covers ~95% of what merchants ask for. For anything else, follow the `cimpl
|
|
|
21
21
|
- Add `'use cache'`, `cacheTag`, or `cacheLife` anywhere. Use the SDK's `cacheOptions` instead.
|
|
22
22
|
- Use `unstable_cache` — it's gone in Next 16. Use SDK `cacheOptions` or `fetch.next.{revalidate,tags}`.
|
|
23
23
|
- Run `bun test` (Bun's `vi` shim is incomplete) — use `bun run test:run`.
|
|
24
|
+
|
|
25
|
+
## Design bans
|
|
26
|
+
|
|
27
|
+
Not style preferences — these are the tells of a generated site. Grep for them before calling any piece of work done.
|
|
28
|
+
|
|
29
|
+
- **No scroll-down indicators.** No "scroll" label, chevron, arrow, mouse glyph, or bouncing hint under a hero.
|
|
30
|
+
- **No ornament glyphs** — ◆ ◇ ✦ ✧ ❖ as dividers, bullets, or separators. No `01 / 02 / 03` section numbering.
|
|
31
|
+
- No purple/blue gradient washes, glassmorphism-by-default cards, floating badge pills, or emoji in UI copy.
|
|
32
|
+
- No boxed text-button clusters in the navbar — use icons (search, account, cart with count).
|
|
33
|
+
- No border radius unless the brief asks for softness; prefer hairline borders.
|
|
34
|
+
|
|
35
|
+
Reserve glass for surfaces that earn it (navbar, flyouts, overlays) and execute it properly: deep `backdrop-filter` blur **with saturation**, a specular top edge, a soft falling shadow. Never a flat translucent white card.
|
|
36
|
+
|
|
37
|
+
Ask of each screen: does this read as "template with new colours"? If so, it isn't done.
|
|
38
|
+
|
|
39
|
+
## Known traps
|
|
40
|
+
|
|
41
|
+
- **`backdrop-filter` creates a containing block.** A navbar carrying it becomes the containing block for `position: fixed` children, so a fixed mobile drawer gets clamped to the navbar's box and renders transparent. Portal overlays and drawers to `<body>`.
|
|
42
|
+
- **Google Fonts fetches fail at build time in some environments.** Self-host font files in `app/fonts/` rather than depending on a network fetch mid-build.
|
|
43
|
+
- **Never show a slot the booking engine will reject.** Source the availability grid from the strict bookable endpoint, not the general calendar. If a service verifies unavailable or returns zero slots, render a call-the-shop fallback with the real phone number — never an empty grid.
|
|
44
|
+
- **Route media through `lib/media.ts`.** No hardcoded asset URLs in components. Transcode phone video (usually HEVC, unplayable in most browsers) to H.264, and size images down before shipping them.
|
|
45
|
+
|
|
46
|
+
## Verification loop
|
|
47
|
+
|
|
48
|
+
Continuously, not once at the end:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
build → start on PORT 3100 → screenshot at 1440px and 390px → fix → repeat
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Verify on **port 3100**. Dev holds 3000, and a stray verification server there blocks restarts. Kill your own.
|
|
55
|
+
- Read the **full** build output, unfiltered — a hidden page-generation failure ships as "Could not find a production build".
|
|
56
|
+
- Actually look at the screenshots. "It compiled" is not "it looks right".
|
|
57
|
+
- Screenshot interactive states too: nav open, search flyout, chat open, booking flow, mobile menu.
|
|
58
|
+
- Test once per round with reduced motion emulated.
|
|
59
|
+
|
|
60
|
+
## Escalate rather than loop
|
|
61
|
+
|
|
62
|
+
Stop and ask for: the live API key, go-live approval (`--prod`), anything irreversible (deleting CDN assets, domain changes), and dashboard-side changes you cannot make from code — typically staff-to-service assignment when a service returns zero availability while its API fields look identical to a working one. Present the evidence, then carry on with everything else.
|
|
@@ -109,6 +109,7 @@ export function BookClient({ treatments }: { treatments: Product[] }) {
|
|
|
109
109
|
schedulingMode={selectedTreatment.scheduling_mode}
|
|
110
110
|
durationUnit={selectedTreatment.duration_unit}
|
|
111
111
|
durationValue={selectedTreatment.duration_value}
|
|
112
|
+
contactPhone={brand.contact.phone}
|
|
112
113
|
/>
|
|
113
114
|
) : (
|
|
114
115
|
<p className="text-sm text-muted-foreground">Pick a treatment to see availability.</p>
|