create-apexjs 0.6.1 → 0.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-apexjs",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Scaffold a new Apex JS app",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -19,6 +19,8 @@ an MCP tool**. This file tells you (the agent) how to work here effectively.
19
19
  ```bash
20
20
  apex make page dashboard # pages/dashboard.alpine (a route → /dashboard)
21
21
  apex make component Card # components/Card.alpine (<Card /> in templates)
22
+ apex make component ui/Navbar # group in a folder → components/ui/Navbar.alpine (<UiNavbar />)
23
+ apex make client # app.client.ts — register Alpine plugins/directives/magics
22
24
  apex make model Post title:string body:string # models/Post.ts → migration + REST + MCP CRUD
23
25
  apex make api webhooks # server/api/webhooks.ts (defineApexRoute; also an MCP tool)
24
26
  apex make service Billing # services/BillingService.ts
@@ -31,13 +33,14 @@ apex check # type-check (tsc --noEmit; fast with the nati
31
33
  apex build --preset vercel # build + Vercel config (also: netlify, docker); then deploy
32
34
  apex test # run Vitest
33
35
  ```
34
- `apex make <kind> …` kinds: `page component api service store layout middleware test model migration auth`.
36
+ `apex make <kind> …` kinds: `page component api service store layout middleware test model migration auth client`.
35
37
 
36
38
  ## Project structure
37
39
  ```
38
40
  pages/**/*.alpine Routes. File path → URL. [param] = dynamic. index.alpine → parent path.
39
41
  layouts/*.alpine Shared shells; default.alpine wraps every page (<slot/>).
40
- components/*.alpine Reusable <PascalCase/> components (props via attributes).
42
+ components/**/*.alpine Reusable <PascalCase/> components (props via attributes). Group in
43
+ folders: components/ui/Card.alpine → <UiCard/> (folder-namespaced, Nuxt-style).
41
44
  server/api/*.ts Typed routes (defineApexRoute) / model resources → REST + MCP.
42
45
  server/auth.ts Identity (sessionAuth) → ctx.user everywhere. (from `apex extend auth`)
43
46
  models/*.ts defineModel → schema + migration + table + REST/MCP CRUD.
@@ -46,6 +49,8 @@ locales/*.json i18n catalogs. (from `apex extend i18n`)
46
49
  services/*.ts Business logic (classes). Keep routes thin; delegate here.
47
50
  stores/*.ts Global SSR-safe state ($store.x).
48
51
  composables/*.ts Reusable client logic (useX) for <script client>.
52
+ app.client.ts Optional. Default-exports (Alpine) => {…}, run BEFORE Alpine.start() —
53
+ register Alpine plugins ($persist, x-intersect, x-mask…), directives, magics.
49
54
  shared/*.ts Types shared by server + client.
50
55
  tests/*.test.ts Vitest. createTestApp boots the whole app in-process.
51
56
  ```