@evjs/create-app 0.3.0 → 0.3.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/README.md +1 -1
- package/package.json +1 -1
- package/templates/api-routes/package.json +1 -1
- package/templates/basic/README.md +4 -7
- package/templates/basic/package.json +1 -1
- package/templates/complex-routing/README.md +5 -5
- package/templates/complex-routing/package.json +1 -1
- package/templates/custom-ws-transport/README.md +8 -3
- package/templates/custom-ws-transport/package.json +1 -1
- package/templates/mpa/README.md +3 -7
- package/templates/mpa/package.json +1 -1
- package/templates/plugin-authoring/README.md +2 -4
- package/templates/plugin-authoring/package.json +1 -1
- package/templates/with-sqlite/package.json +1 -1
- package/templates/with-tailwind/README.md +1 -1
- package/templates/with-tailwind/package.json +1 -1
- package/templates/with-trpc/README.md +3 -2
- package/templates/with-trpc/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npx @evjs/create-app [name] [options]
|
|
|
20
20
|
|
|
21
21
|
## Templates
|
|
22
22
|
|
|
23
|
-
Every template uses the same
|
|
23
|
+
Every template uses the same Page-and-Route authoring model: `page.tsx` anchors,
|
|
24
24
|
optional build-time `page.config.ts` for static title/named metadata and
|
|
25
25
|
rendering, and directory-derived URLs.
|
|
26
26
|
`routing.mode` is the only routing-mode configuration; SPA and MPA
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# basic
|
|
2
2
|
|
|
3
3
|
The standard starting point for an evjs application. It demonstrates the
|
|
4
|
-
|
|
4
|
+
Page-and-Route file convention alongside server functions.
|
|
5
5
|
|
|
6
6
|
## Run
|
|
7
7
|
|
|
@@ -38,9 +38,6 @@ npm run dev
|
|
|
38
38
|
- `useMutation({ mutationFn: createUser })` for server-side mutations
|
|
39
39
|
- `getFnQueryKey(getUsers)` for cache invalidation
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
route component to its URL directory as `page.tsx`, use
|
|
45
|
-
`routing.mode: "spa"`. Explicit `component`/`routes` config does not define an
|
|
46
|
-
MPA materialization mode.
|
|
41
|
+
This example uses the canonical `routing.mode: "spa"` file-convention profile.
|
|
42
|
+
Explicit `application.routes` is a separate SPA-only input into the same
|
|
43
|
+
normalized graph.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# complex-routing
|
|
2
2
|
|
|
3
|
-
Advanced SPA routing through the same
|
|
3
|
+
Advanced SPA routing through the same Page-and-Route file convention
|
|
4
4
|
used by the basic example.
|
|
5
5
|
|
|
6
6
|
## Run
|
|
@@ -29,7 +29,7 @@ npm run dev
|
|
|
29
29
|
- Redirects through the `/old-blog` Page lifecycle
|
|
30
30
|
- Page hooks such as `usePageParams()` and `usePageSearch()`
|
|
31
31
|
|
|
32
|
-
This example
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
This example uses SPA mode because MPA rejects its dynamic route and
|
|
33
|
+
router-only React facets. Canonical SPA and MPA apps share the same `page.tsx`
|
|
34
|
+
Page-anchor convention; `routing.mode` selects how supported Pages are
|
|
35
|
+
materialized.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# custom-ws-transport
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Client-side `TransportAdapter` example for sending server-function calls over
|
|
4
|
+
WebSocket. This repository does not provide the matching WebSocket server.
|
|
4
5
|
|
|
5
6
|
## Run
|
|
6
7
|
|
|
@@ -8,6 +9,10 @@ Custom WebSocket transport for server function calls.
|
|
|
8
9
|
npm run dev
|
|
9
10
|
```
|
|
10
11
|
|
|
12
|
+
The page shell runs locally, but server-function calls require a same-origin
|
|
13
|
+
`/ws` endpoint that accepts the documented `{ id, fnId, args }` messages and
|
|
14
|
+
returns `{ id, result }` or `{ id, error }`.
|
|
15
|
+
|
|
11
16
|
## Key Files
|
|
12
17
|
|
|
13
18
|
| File | Purpose |
|
|
@@ -22,6 +27,6 @@ npm run dev
|
|
|
22
27
|
|
|
23
28
|
- Custom `TransportAdapter` over WebSocket
|
|
24
29
|
- `initTransport({ adapter: { send } })` extension
|
|
25
|
-
-
|
|
26
|
-
-
|
|
30
|
+
- Request correlation and pending-call cleanup for a custom client protocol
|
|
31
|
+
- The client message contract a matching WebSocket server must implement
|
|
27
32
|
- Transport setup inside the root Page scope
|
package/templates/mpa/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Unified MPA
|
|
2
2
|
|
|
3
|
-
Minimal
|
|
3
|
+
Minimal multi-page application using the same `page.tsx` file
|
|
4
4
|
convention as SPA applications.
|
|
5
5
|
|
|
6
6
|
## Run
|
|
@@ -50,9 +50,5 @@ npm run build
|
|
|
50
50
|
- No `@evjs/client`, `@evjs/server`, or generated `route-types.d.ts`
|
|
51
51
|
dependency is needed for this router-free client output
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fields, and move remaining plugin-owned values to namespaced extensions.
|
|
56
|
-
Core discovers only canonical Page anchors. Explicit `component`/`routes`
|
|
57
|
-
config remains a SPA-only route-tree input and is not accepted as an MPA
|
|
58
|
-
authoring model.
|
|
53
|
+
Explicit `component`/`routes` config is a SPA-only route-tree input and is not
|
|
54
|
+
accepted as an MPA authoring model.
|
|
@@ -19,11 +19,9 @@ For plugins that need to declare generated `.ev` artifacts and attach them to
|
|
|
19
19
|
framework slots, see the generated contributions documentation.
|
|
20
20
|
|
|
21
21
|
Plugins use one `Plugin` shape: declare static capabilities in `describe()` and
|
|
22
|
-
add semantic contributions through the corresponding framework APIs.
|
|
23
|
-
runtime hooks and semantic facet attachment are not implemented yet and remain
|
|
24
|
-
outside this example's scope.
|
|
22
|
+
add semantic contributions through the corresponding framework APIs.
|
|
25
23
|
|
|
26
|
-
The application itself uses the
|
|
24
|
+
The application itself uses the canonical model:
|
|
27
25
|
`src/pages/page.tsx` defines `/`, `src/pages/layout.tsx` supplies the SPA root
|
|
28
26
|
layout, `ev.config.ts` configures the Application extension, and
|
|
29
27
|
`src/pages/page.config.ts` configures the Page and its unique Route. The
|
|
@@ -15,10 +15,11 @@ npm run dev
|
|
|
15
15
|
| `ev.config.ts` | Selects SPA routing mode |
|
|
16
16
|
| `src/pages/layout.tsx` | File-convention root layout |
|
|
17
17
|
| `src/pages/page.tsx` | UI consuming both tRPC and evjs APIs |
|
|
18
|
-
| `src/
|
|
18
|
+
| `src/trpc.ts` | tRPC router and procedure definitions |
|
|
19
|
+
| `src/apis/trpc.server.ts` | Server-function dispatcher bridge into the tRPC router |
|
|
19
20
|
|
|
20
21
|
## What It Demonstrates
|
|
21
22
|
|
|
22
23
|
- tRPC client + server alongside evjs server functions
|
|
23
|
-
-
|
|
24
|
+
- A `"use server"` bridge dispatching calls into an `@trpc/server` router
|
|
24
25
|
- Both APIs coexist in the same build pipeline
|