@xeplr/cli 0.3.5 → 0.3.6
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/README.md +1 -0
- package/package.json +1 -1
- package/templates/CLAUDE.md +1 -0
- package/templates/api/package.json +1 -1
- package/templates/ui/README.md +1 -0
- package/templates/ui/package.json +3 -3
- package/templates/ui/src/index.css +31 -0
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ These are architecture decisions, not defaults to tune — each one exists becau
|
|
|
85
85
|
| **Designing, new forms and publishing are Super Admin only.** | `api/routes/access.js`, `@xeplr/auth` menu routes | Publishing changes database tables. Every other screen route checks the permission catalog. |
|
|
86
86
|
| **The browser is not a security boundary.** Front-end hooks (`ui/src/pages/Edit<Form>.jsx`) shape what people see and send; anything that must hold goes in server hooks (`api/screens/<form>/<form>.hooks.js`); data shape in the model (`<form>.model.js`). | `@xeplr/ui-factory`, `@xeplr/factory` | |
|
|
87
87
|
| **Anything every app would write identically lives in a package, not in the generated app.** A generated app is a starting point that then lives its own life — glue copied into it can never be fixed centrally, so an app made last month keeps that copy forever. When the flow designer needed this app's forms, its functions and its flows, the wiring went into `@xeplr/ui-factory` (`FlowDesignerPage`) and the generated page passes its two API clients. | `@xeplr/ui-factory` | A fix or a new control type has to reach apps that already exist, and it cannot reach code that was copied into them. `test/cli.test.js` fails if the glue reappears in the generated app. |
|
|
88
|
+
| **Every page works on a phone.** Below 640px the side rail is a bar across the top, forms from the designer go one field per row, and tables scroll sideways inside their own box with their row buttons pinned on screen. | `@xeplr/ui-account`, `@xeplr/ui-factory`, `@xeplr/ui-table`, `ui/src/index.css` | One design serves both. A phone-only copy of a screen drifts from the real one, and a scaled-down desktop form is text too small to read in boxes too small to tap. |
|
|
88
89
|
| **Every data address is under `/api`.** | `api/routes`, `ui/vite.config.js` | A page path and a data path must never collide. |
|
|
89
90
|
| **No guessed database names or connections.** | `api/development.env` | A wrong-but-present value starts cleanly and reads as empty data. |
|
|
90
91
|
| **Email is checked at start, never fatal.** The sign-in banner shows `email ✓ …` or `✗ NOT WORKING — reason`. | `@xeplr/auth` | Sign-in works without email; activation, invite and reset links cannot be sent until `EMAIL_PROVIDER` is set. |
|
package/package.json
CHANGED
package/templates/CLAUDE.md
CHANGED
|
@@ -68,4 +68,5 @@ Replace the bold parts. Add behaviour in the same message if you want it — "a
|
|
|
68
68
|
- The browser is not a security boundary: anything that must hold goes in a server function, named in the screen's events.
|
|
69
69
|
- Hooks and models are **methods** calling `super` — never arrow-function properties.
|
|
70
70
|
- `authFetch` returns the parsed body, not a Response.
|
|
71
|
+
- **Every page works on a phone.** Forms and lists from the designer stack themselves below 640px; a page written by hand puts its phone rules in the `@media (max-width: 640px)` block at the bottom of `ui/src/index.css` — inputs 16px or larger, buttons 44px tall, tables scrolling inside their own box, no fixed width wider than the screen. Do not design a second, phone-only screen.
|
|
71
72
|
- Sign-up needs email and `AUTH_REGISTER_ROLES` (the role a new account gets, in `api/development.env`); without either, registration is refused on purpose — never work around it by activating accounts or granting roles in SQL. An admin can activate an account from the User Roles screen.
|
package/templates/ui/README.md
CHANGED
|
@@ -26,4 +26,5 @@ npm run build # → dist/
|
|
|
26
26
|
- `authFetch` returns the **parsed body**, not a Response — no `.json()`.
|
|
27
27
|
- A side-rail item needs an **icon** (a collapsed rail shows icons only) and its key must exist as a menu row, or it is dropped silently. Give it its **`path`** too: that is how the rail marks the page you are on.
|
|
28
28
|
- The rail is 48px when collapsed; `--app-rail-width` in `src/index.css` reserves the same space and must match it.
|
|
29
|
+
- **Phones work without extra code.** Below 640px the rail becomes a bar across the top (`@xeplr/ui-account`) and `src/index.css` gives the page's top to it instead of its left (`--xeplr-nav-bar-height`). Forms and lists made in the designer stack themselves (`@xeplr/ui-factory`); tables keep scrolling sideways with their row buttons pinned on screen (`@xeplr/ui-table`). A page you write by hand follows the same rules in the phone block at the bottom of `src/index.css`: inputs 16px or larger (or iOS zooms the page), buttons 44px tall, tables that scroll inside their own box, nothing a fixed width wider than the screen.
|
|
29
30
|
- Set page backgrounds on a container inside the theme, never on `body`.
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@tanstack/react-table": "^8.21.3",
|
|
13
|
-
"@xeplr/ui-account": "^1.4.
|
|
13
|
+
"@xeplr/ui-account": "^1.4.2",
|
|
14
14
|
"@xeplr/ui-canvas": "^1.1.0",
|
|
15
|
-
"@xeplr/ui-factory": "^1.
|
|
16
|
-
"@xeplr/ui-table": "^1.
|
|
15
|
+
"@xeplr/ui-factory": "^1.8.3",
|
|
16
|
+
"@xeplr/ui-table": "^1.1.3",
|
|
17
17
|
"react": "^19.2.4",
|
|
18
18
|
"react-dom": "^19.2.4",
|
|
19
19
|
"react-router-dom": "^7.13.2",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
--app-rail-width: 48px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* ON A PHONE (below 640px) the rail becomes a bar across the top — see
|
|
14
|
+
@xeplr/ui-account's nav.css — so the page gives up its top instead of its
|
|
15
|
+
left: --xeplr-nav-bar-height, set by that stylesheet. The rest of this
|
|
16
|
+
file's phone rules are at the bottom. */
|
|
17
|
+
|
|
13
18
|
body { margin: 0; }
|
|
14
19
|
|
|
15
20
|
.app {
|
|
@@ -374,3 +379,29 @@ body { margin: 0; }
|
|
|
374
379
|
.app-connect-steps li { margin-bottom: 14px; }
|
|
375
380
|
.app-connect code { font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--xeplr-bg-secondary); border: 1px solid var(--xeplr-border-primary); }
|
|
376
381
|
.app-connect pre { margin: 6px 0 0; font-size: 12.5px; }
|
|
382
|
+
|
|
383
|
+
/* ── on a phone ──────────────────────────────────────────────────────────
|
|
384
|
+
Forms and lists made in the designer stack themselves (@xeplr/ui-factory),
|
|
385
|
+
and @xeplr/ui-table keeps its own rows reachable. What is left is this
|
|
386
|
+
app's own chrome: room for the top bar instead of the rail, tighter page
|
|
387
|
+
padding, fields one per row, tables that scroll inside their own box
|
|
388
|
+
rather than widening the page, and buttons a thumb can hit. */
|
|
389
|
+
@media (max-width: 640px) {
|
|
390
|
+
.app { padding-left: 0; padding-top: var(--xeplr-nav-bar-height, 52px); }
|
|
391
|
+
.main { padding: 16px 12px; }
|
|
392
|
+
.app-page h1 { font-size: 22px; }
|
|
393
|
+
.app-welcome h1 { font-size: 24px; }
|
|
394
|
+
|
|
395
|
+
.app-field-row { flex-direction: column; gap: 0; }
|
|
396
|
+
.app-field input, .app-field textarea, .app-field select { font-size: 16px; min-height: 44px; }
|
|
397
|
+
.app-forms-field { min-width: 0; flex-basis: 100%; }
|
|
398
|
+
.app-menu-label, .app-forms-new input { font-size: 16px; min-height: 44px; box-sizing: border-box; }
|
|
399
|
+
.app-btn { min-height: 44px; }
|
|
400
|
+
.app-row-actions .app-btn { min-height: 40px; padding: 8px 12px; }
|
|
401
|
+
|
|
402
|
+
.app-table { display: block; overflow-x: auto; }
|
|
403
|
+
.app-tabs { overflow-x: auto; }
|
|
404
|
+
.app-tab { white-space: nowrap; min-height: 44px; }
|
|
405
|
+
.app-help { padding: 16px; }
|
|
406
|
+
.app-connect { padding: 16px; }
|
|
407
|
+
}
|