@evjs/manifest 0.0.0

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 ADDED
@@ -0,0 +1,45 @@
1
+ # @evjs/manifest
2
+
3
+ Shared manifest schema types for the **ev** framework build system.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @evjs/manifest
9
+ ```
10
+
11
+ ## Purpose
12
+
13
+ Defines the structure of the unified manifest file emitted by `@evjs/webpack-plugin` and consumed by `@evjs/runtime`. A single `dist/manifest.json` contains both server and client build metadata:
14
+
15
+ ## Manifest (v1)
16
+
17
+ ```json
18
+ {
19
+ "version": 1,
20
+ "server": {
21
+ "entry": "main.a1b2c3d4.js",
22
+ "fns": {
23
+ "<fnId>": {
24
+ "moduleId": "f9b6...",
25
+ "export": "getUsers"
26
+ }
27
+ }
28
+ },
29
+ "client": {
30
+ "js": ["main.abc123.js"],
31
+ "css": ["main.def456.css"]
32
+ }
33
+ }
34
+ ```
35
+
36
+ ## Exported Types
37
+
38
+ - **`Manifest`** — unified manifest (`dist/manifest.json`) with `server` and `client` sections.
39
+ - **`ServerManifestSection`** — server section (`{ entry, fns, rsc? }`).
40
+ - **`ClientManifestSection`** — client section (`{ js, css, pages? }`).
41
+ - **`ServerFnEntry`** — server function metadata (`{ moduleId, export }`).
42
+ - **`RscEntry`** — React Server Components (reserved for future).
43
+ - **`PageEntry`** — per-page assets for MPA (reserved for future).
44
+ - **`ServerManifest`** — deprecated alias, use `Manifest` instead.
45
+ - **`ClientManifest`** — deprecated alias, use `Manifest` instead.
package/esm/index.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @evjs/manifest
3
+ *
4
+ * Shared manifest schemas for the ev framework build system.
5
+ *
6
+ * A single unified manifest is emitted to `dist/manifest.json`,
7
+ * containing both server and client build metadata.
8
+ */
9
+ /** Base manifest fields shared by all environment manifests. */
10
+ interface ManifestBase {
11
+ /** Schema version — bump on breaking changes. */
12
+ version: 1;
13
+ }
14
+ /** A registered server function entry. */
15
+ export interface ServerFnEntry {
16
+ /** Webpack module identifier (hash-based, no source paths exposed). */
17
+ moduleId: string;
18
+ /** Exported function name. */
19
+ export: string;
20
+ }
21
+ /** A React Server Component entry (future — reserved). */
22
+ export interface RscEntry {
23
+ /** Webpack module ID. */
24
+ moduleId: string;
25
+ /** Exported component name. */
26
+ export: string;
27
+ }
28
+ /** Server section of the manifest. */
29
+ export interface ServerManifestSection {
30
+ /** Server bundle entry filename (e.g. "main.js" or "main.a1b2c3d4.js"). */
31
+ entry: string;
32
+ /** Registered server functions (fnId → module + export). */
33
+ fns: Record<string, ServerFnEntry>;
34
+ /** React Server Components (future — reserved). */
35
+ rsc?: Record<string, RscEntry>;
36
+ }
37
+ /** Per-page asset entry for MPA support (future — reserved). */
38
+ export interface PageEntry {
39
+ /** JavaScript bundle paths for this page. */
40
+ js: string[];
41
+ /** CSS bundle paths for this page. */
42
+ css: string[];
43
+ }
44
+ /** Client section of the manifest. */
45
+ export interface ClientManifestSection {
46
+ /** JavaScript bundle paths for HTML injection. */
47
+ js: string[];
48
+ /** CSS bundle paths for HTML injection. */
49
+ css: string[];
50
+ /** Per-page assets for MPA support (future — reserved). */
51
+ pages?: Record<string, PageEntry>;
52
+ }
53
+ /**
54
+ * Unified manifest — emitted to `dist/manifest.json`.
55
+ *
56
+ * Contains both server and client build metadata in a single file.
57
+ */
58
+ export interface Manifest extends ManifestBase {
59
+ /** Server build metadata (entry, server functions, RSC). */
60
+ server: ServerManifestSection;
61
+ /** Client build metadata (bundles, CSS, pages). Optional until client manifest is implemented. */
62
+ client?: ClientManifestSection;
63
+ }
64
+ /**
65
+ * @deprecated Use `Manifest` instead. Kept for backward compatibility.
66
+ */
67
+ export type ServerManifest = ManifestBase & ServerManifestSection;
68
+ /**
69
+ * @deprecated Use `Manifest` instead. Kept for backward compatibility.
70
+ */
71
+ export type ClientManifest = ManifestBase & ClientManifestSection;
72
+ export {};
package/esm/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @evjs/manifest
3
+ *
4
+ * Shared manifest schemas for the ev framework build system.
5
+ *
6
+ * A single unified manifest is emitted to `dist/manifest.json`,
7
+ * containing both server and client build metadata.
8
+ */
9
+ export {};
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@evjs/manifest",
3
+ "version": "0.0.0",
4
+ "description": "Shared manifest types for the ev framework",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "main": "./esm/index.js",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./esm/index.d.ts",
13
+ "import": "./esm/index.js",
14
+ "require": "./esm/index.js"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "check-types": "tsc --noEmit"
20
+ },
21
+ "files": [
22
+ "esm"
23
+ ],
24
+ "keywords": [
25
+ "evjs",
26
+ "manifest",
27
+ "server-functions"
28
+ ],
29
+ "author": "xusd320",
30
+ "license": "MIT",
31
+ "devDependencies": {
32
+ "typescript": "^5.7.3"
33
+ },
34
+ "homepage": "https://github.com/evaijs/evjs#readme",
35
+ "bugs": {
36
+ "url": "https://github.com/evaijs/evjs/issues"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/evaijs/evjs.git"
41
+ }
42
+ }