@unieojs/unio-evjs-adapter 0.6.0 → 0.6.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/dist/types.d.ts CHANGED
@@ -1,10 +1,54 @@
1
- import type { EvBuildResult, EvPlugin, EvPluginContext, EvPluginHooks } from "@evjs/ev";
2
- export type ClientManifest = EvBuildResult["clientManifest"];
3
- export type ServerManifest = NonNullable<EvBuildResult["serverManifest"]>;
4
- export type PageManifestEntry = NonNullable<ClientManifest["pages"]>[string];
5
- export type RouteEntry = NonNullable<ClientManifest["routes"]>[number];
6
- export type ServerFnEntry = ServerManifest["fns"][string];
7
- export type { EvBuildResult, EvPlugin, EvPluginContext, EvPluginHooks, };
1
+ export interface ManifestAssets {
2
+ js: string[];
3
+ css: string[];
4
+ }
5
+ export interface RouteEntry {
6
+ path: string;
7
+ }
8
+ export interface PageManifestEntry {
9
+ assets: ManifestAssets;
10
+ routes?: RouteEntry[];
11
+ }
12
+ export interface ClientManifest {
13
+ version: 1;
14
+ assets: ManifestAssets;
15
+ routes?: RouteEntry[];
16
+ pages?: Record<string, PageManifestEntry>;
17
+ }
18
+ export interface ServerFnEntry {
19
+ assets?: ManifestAssets;
20
+ [key: string]: unknown;
21
+ }
22
+ export interface ServerRouteEntry {
23
+ path: string;
24
+ methods: string[];
25
+ assets: ManifestAssets;
26
+ }
27
+ export interface ServerManifest {
28
+ version: 1;
29
+ entry?: string;
30
+ assets?: ManifestAssets;
31
+ fns: Record<string, ServerFnEntry>;
32
+ routes?: ServerRouteEntry[];
33
+ rsc?: Record<string, ServerFnEntry>;
34
+ }
35
+ export interface EvBuildResult {
36
+ clientManifest: ClientManifest;
37
+ serverManifest?: ServerManifest;
38
+ isRebuild?: boolean;
39
+ }
40
+ export interface EvPluginContext {
41
+ mode: "development" | "production";
42
+ cwd: string;
43
+ config: unknown;
44
+ }
45
+ export interface EvPluginHooks {
46
+ buildEnd?: (result: EvBuildResult) => void | Promise<void>;
47
+ }
48
+ export interface EvPlugin {
49
+ name: string;
50
+ setup?: (ctx: EvPluginContext) => EvPluginHooks | Promise<EvPluginHooks>;
51
+ }
8
52
  export type CapabilityStatus = "supported" | "partial" | "degraded" | "unsupported";
9
53
  export interface UboaCapabilities {
10
54
  static: CapabilityStatus;
@@ -144,3 +188,4 @@ export interface EmitUboaOptions extends UnioEvjsAdapterOptions {
144
188
  serverManifest?: ServerManifest;
145
189
  }
146
190
  export type BuildOptions = EmitUboaOptions;
191
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unieojs/unio-evjs-adapter",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "EVJS adapter that emits Unio Build Output API manifests.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/types.ts CHANGED
@@ -1,22 +1,64 @@
1
- import type {
2
- EvBuildResult,
3
- EvPlugin,
4
- EvPluginContext,
5
- EvPluginHooks,
6
- } from "@evjs/ev";
7
-
8
- export type ClientManifest = EvBuildResult["clientManifest"];
9
- export type ServerManifest = NonNullable<EvBuildResult["serverManifest"]>;
10
- export type PageManifestEntry = NonNullable<ClientManifest["pages"]>[string];
11
- export type RouteEntry = NonNullable<ClientManifest["routes"]>[number];
12
- export type ServerFnEntry = ServerManifest["fns"][string];
13
-
14
- export type {
15
- EvBuildResult,
16
- EvPlugin,
17
- EvPluginContext,
18
- EvPluginHooks,
19
- };
1
+ export interface ManifestAssets {
2
+ js: string[];
3
+ css: string[];
4
+ }
5
+
6
+ export interface RouteEntry {
7
+ path: string;
8
+ }
9
+
10
+ export interface PageManifestEntry {
11
+ assets: ManifestAssets;
12
+ routes?: RouteEntry[];
13
+ }
14
+
15
+ export interface ClientManifest {
16
+ version: 1;
17
+ assets: ManifestAssets;
18
+ routes?: RouteEntry[];
19
+ pages?: Record<string, PageManifestEntry>;
20
+ }
21
+
22
+ export interface ServerFnEntry {
23
+ assets?: ManifestAssets;
24
+ [key: string]: unknown;
25
+ }
26
+
27
+ export interface ServerRouteEntry {
28
+ path: string;
29
+ methods: string[];
30
+ assets: ManifestAssets;
31
+ }
32
+
33
+ export interface ServerManifest {
34
+ version: 1;
35
+ entry?: string;
36
+ assets?: ManifestAssets;
37
+ fns: Record<string, ServerFnEntry>;
38
+ routes?: ServerRouteEntry[];
39
+ rsc?: Record<string, ServerFnEntry>;
40
+ }
41
+
42
+ export interface EvBuildResult {
43
+ clientManifest: ClientManifest;
44
+ serverManifest?: ServerManifest;
45
+ isRebuild?: boolean;
46
+ }
47
+
48
+ export interface EvPluginContext {
49
+ mode: "development" | "production";
50
+ cwd: string;
51
+ config: unknown;
52
+ }
53
+
54
+ export interface EvPluginHooks {
55
+ buildEnd?: (result: EvBuildResult) => void | Promise<void>;
56
+ }
57
+
58
+ export interface EvPlugin {
59
+ name: string;
60
+ setup?: (ctx: EvPluginContext) => EvPluginHooks | Promise<EvPluginHooks>;
61
+ }
20
62
 
21
63
  export type CapabilityStatus =
22
64
  | "supported"