@evjs/manifest 0.0.14 → 0.0.16
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 +25 -25
- package/esm/index.d.ts +23 -31
- package/esm/index.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,43 +10,43 @@ npm install @evjs/manifest
|
|
|
10
10
|
|
|
11
11
|
## Purpose
|
|
12
12
|
|
|
13
|
-
Defines the structure of the
|
|
13
|
+
Defines the structure of the manifest files emitted by `@evjs/bundler-webpack` and consumed by `@evjs/client` and `@evjs/server`. Two separate manifests are emitted during the build:
|
|
14
14
|
|
|
15
|
-
## Manifest (
|
|
15
|
+
## Server Manifest (`dist/server/manifest.json`)
|
|
16
16
|
|
|
17
17
|
```json
|
|
18
18
|
{
|
|
19
19
|
"version": 1,
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"export": "getUsers"
|
|
26
|
-
}
|
|
20
|
+
"entry": "main.a1b2c3d4.js",
|
|
21
|
+
"fns": {
|
|
22
|
+
"<fnId>": {
|
|
23
|
+
"moduleId": "f9b6...",
|
|
24
|
+
"export": "getUsers"
|
|
27
25
|
}
|
|
28
|
-
},
|
|
29
|
-
"client": {
|
|
30
|
-
"assets": {
|
|
31
|
-
"js": ["main.abc123.js"],
|
|
32
|
-
"css": ["main.def456.css"]
|
|
33
|
-
},
|
|
34
|
-
"routes": [
|
|
35
|
-
{ "path": "/" },
|
|
36
|
-
{ "path": "/posts/$postId" }
|
|
37
|
-
]
|
|
38
26
|
}
|
|
39
27
|
}
|
|
40
28
|
```
|
|
41
29
|
|
|
30
|
+
## Client Manifest (`dist/client/manifest.json`)
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"version": 1,
|
|
35
|
+
"assets": {
|
|
36
|
+
"js": ["main.abc123.js"],
|
|
37
|
+
"css": ["main.def456.css"]
|
|
38
|
+
},
|
|
39
|
+
"routes": [
|
|
40
|
+
{ "path": "/" },
|
|
41
|
+
{ "path": "/posts/$postId" }
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
42
46
|
## Exported Types
|
|
43
47
|
|
|
44
|
-
- **`
|
|
45
|
-
- **`
|
|
46
|
-
- **`ClientManifestSection`** — client section (`{ assets: { js, css }, routes? }`).
|
|
48
|
+
- **`ServerManifest`** — server manifest (`dist/server/manifest.json`) with `entry`, `fns`, and optional `rsc`.
|
|
49
|
+
- **`ClientManifest`** — client manifest (`dist/client/manifest.json`) with `assets` and optional `routes`.
|
|
47
50
|
- **`ServerFnEntry`** — server function metadata (`{ moduleId, export }`).
|
|
48
51
|
- **`RouteEntry`** — a discovered client route (`{ path }`).
|
|
49
52
|
- **`RscEntry`** — React Server Components (reserved for future).
|
|
50
|
-
- **`PageEntry`** — per-page assets for MPA (reserved for future).
|
|
51
|
-
- **`ServerManifest`** — deprecated alias, use `Manifest` instead.
|
|
52
|
-
- **`ClientManifest`** — deprecated alias, use `Manifest` instead.
|
package/esm/index.d.ts
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared manifest schemas for the ev framework build system.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Two separate manifests are emitted during fullstack builds:
|
|
7
|
+
* - `dist/server/manifest.json` — server build metadata
|
|
8
|
+
* - `dist/client/manifest.json` — client build metadata
|
|
9
|
+
*
|
|
10
|
+
* For CSR-only builds (`server: false`), only the client manifest
|
|
11
|
+
* is emitted to `dist/manifest.json` (flat output).
|
|
8
12
|
*/
|
|
9
|
-
/** Base manifest fields shared by all environment manifests. */
|
|
10
|
-
interface ManifestBase {
|
|
11
|
-
/** Schema version — bump on breaking changes. */
|
|
12
|
-
version: 1;
|
|
13
|
-
}
|
|
14
13
|
/** A registered server function entry. */
|
|
15
14
|
export interface ServerFnEntry {
|
|
16
15
|
/** Webpack module identifier (hash-based, no source paths exposed). */
|
|
@@ -25,8 +24,14 @@ export interface RscEntry {
|
|
|
25
24
|
/** Exported component name. */
|
|
26
25
|
export: string;
|
|
27
26
|
}
|
|
28
|
-
/**
|
|
29
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Server manifest — emitted to `dist/server/manifest.json`.
|
|
29
|
+
*
|
|
30
|
+
* Contains server bundle entry, registered server functions, and RSC metadata.
|
|
31
|
+
*/
|
|
32
|
+
export interface ServerManifest {
|
|
33
|
+
/** Schema version — bump on breaking changes. */
|
|
34
|
+
version: 1;
|
|
30
35
|
/** Server bundle entry filename (e.g. "main.js" or "main.a1b2c3d4.js"). Omitted when no server bundle exists. */
|
|
31
36
|
entry?: string;
|
|
32
37
|
/** Registered server functions (fnId → module + export). */
|
|
@@ -39,8 +44,15 @@ export interface RouteEntry {
|
|
|
39
44
|
/** Route path (e.g. "/", "/posts/$postId", "*"). */
|
|
40
45
|
path: string;
|
|
41
46
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Client manifest — emitted to `dist/client/manifest.json` (fullstack)
|
|
49
|
+
* or `dist/manifest.json` (CSR-only, `server: false`).
|
|
50
|
+
*
|
|
51
|
+
* Contains client bundle assets and discovered routes.
|
|
52
|
+
*/
|
|
53
|
+
export interface ClientManifest {
|
|
54
|
+
/** Schema version — bump on breaking changes. */
|
|
55
|
+
version: 1;
|
|
44
56
|
/** Bundle asset paths for HTML injection. */
|
|
45
57
|
assets: {
|
|
46
58
|
/** JavaScript bundle paths. */
|
|
@@ -51,23 +63,3 @@ export interface ClientManifestSection {
|
|
|
51
63
|
/** Discovered client routes. */
|
|
52
64
|
routes?: RouteEntry[];
|
|
53
65
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Unified manifest — emitted to `dist/manifest.json`.
|
|
56
|
-
*
|
|
57
|
-
* Contains both server and client build metadata in a single file.
|
|
58
|
-
*/
|
|
59
|
-
export interface Manifest extends ManifestBase {
|
|
60
|
-
/** Server build metadata (entry, server functions, RSC). */
|
|
61
|
-
server: ServerManifestSection;
|
|
62
|
-
/** Client build metadata (bundles, CSS, routes). Optional until client manifest is implemented. */
|
|
63
|
-
client?: ClientManifestSection;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated Use `Manifest` instead. Kept for backward compatibility.
|
|
67
|
-
*/
|
|
68
|
-
export type ServerManifest = ManifestBase & ServerManifestSection;
|
|
69
|
-
/**
|
|
70
|
-
* @deprecated Use `Manifest` instead. Kept for backward compatibility.
|
|
71
|
-
*/
|
|
72
|
-
export type ClientManifest = ManifestBase & ClientManifestSection;
|
|
73
|
-
export {};
|
package/esm/index.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared manifest schemas for the ev framework build system.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Two separate manifests are emitted during fullstack builds:
|
|
7
|
+
* - `dist/server/manifest.json` — server build metadata
|
|
8
|
+
* - `dist/client/manifest.json` — client build metadata
|
|
9
|
+
*
|
|
10
|
+
* For CSR-only builds (`server: false`), only the client manifest
|
|
11
|
+
* is emitted to `dist/manifest.json` (flat output).
|
|
8
12
|
*/
|
|
9
13
|
export {};
|