@xeplr/ui-factory 1.0.5 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +12 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -15,11 +15,16 @@ It is built to work with Claude: ask for *"a form for employees with name, email
15
15
 
16
16
  ```sh
17
17
  npx xeplr-factory screens employee.entity.json -o src/screens/employee
18
- # employee-list.screen.json EmployeeList.jsx
19
- # employee-edit.screen.json EditEmployee.jsx
20
- # employee.hooks.js server hooks for its records: save / get / delete × before / after / error / override
18
+ # employee-list.screen.json EmployeeList.jsx the list page — uses EditEmployee.jsx's hooks
19
+ # employee-edit.screen.json EditEmployee.jsx the form page, holding the FRONT-END hooks (EmployeeHooks extends FactoryHooks)
20
+ # employee.hooks.js SERVER hooks: save / get / delete × before / after / error / override
21
+ # employee.model.js SERVER model: EmployeeModel extends FactoryModel — getters / setters for values
21
22
  ```
22
23
 
24
+ `--no-pages` leaves out the two `.jsx` (for an app whose pages live elsewhere). `--force` replaces only the screen JSON: the pages, hooks and model are your code and are always kept.
25
+
26
+ **Rules:** records live in real tables, never JSON · a form's **key** (`employee`) names its screens and table and never changes once published; its **label** (the screens' name) is renamed any time · rules that must hold go in server hooks, never front-end hooks.
27
+
23
28
  See [examples/](./examples) for exactly what it writes.
24
29
 
25
30
  (The package name on npm is `@xeplr/ui-factory` — the GitHub repo and folder are named `xeplr-ui-factory`.)
@@ -196,7 +201,7 @@ const screen = screenFromSpec({
196
201
  It lays the fields out as a tidy one- or two-column form and returns a checked document. The same is available on the command line:
197
202
 
198
203
  ```sh
199
- npx xeplr-factory screens entity.json -o dir # an entity → list + edit screens and pages
204
+ npx xeplr-factory screens entity.json -o dir # an entity → list + edit screens, pages, server hooks + model (--no-pages, --force)
200
205
  npx xeplr-factory migration edit.screen.json # preview the SQL Publish would run
201
206
  npx xeplr-factory generate spec.json -o screen.json # one screen from a spec
202
207
  npx xeplr-factory validate screen.json # every problem, with its path
@@ -248,9 +253,10 @@ src/
248
253
  validateDocument.js ─ the document checker
249
254
  values.js ─ values, validation, autosave readiness, records and list columns, formSchema
250
255
  generate.js ─ screenFromSpec, screensFromSpec (list + edit), entity names
251
- scaffold.js ─ an entity → its screen JSON, .jsx pages and hooks stub
256
+ scaffold.js ─ an entity → its screen JSON, .jsx pages (with front-end hooks), server hooks + model stubs
257
+ hooks.js ─ FactoryHooks: get / save / delete / actions — extend and call super
252
258
  tableSchema.js ─ a form → its table; the publish plan (create / add / widen / confirmed drops)
253
- remote.js ─ createFactoryApi: the calls to @xeplr/factory's routes
259
+ remote.js ─ createFactoryApi({ fetch }): the calls to @xeplr/factory's routes — fetch may be window.fetch or @xeplr/ui-account's authFetch (which returns parsed bodies); includes createEntity({ key, label })
254
260
  model.js ─ everything above, React-free
255
261
  useFactoryBuilder.js ─ builder controller
256
262
  useFactoryScreen.js ─ screen controller
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/ui-factory",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Design data-entry screens on @xeplr/ui-canvas, save them as JSON, run them as auto-saving forms with lists of saved records — built for Claude to draft and people to refine",
5
5
  "type": "module",
6
6
  "main": "src/index.js",