@deck-shelves/host 1.4.0 → 1.4.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/index.cjs +1 -1
- package/dist/index.d.cts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +1 -1
- package/package.json +6 -4
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
* npm release version. Bump semver here on shape changes: MINOR for additive,
|
|
24
24
|
* backward-compatible members (a new optional namespace / field); MAJOR on a
|
|
25
25
|
* breaking change. 1.2.0 added the optional `updates` namespace and the
|
|
26
|
-
* optional `React`/`ReactDOM`/`jsx` UI-surface members.
|
|
26
|
+
* optional `React`/`ReactDOM`/`jsx` UI-surface members. 1.3.0 added the optional
|
|
27
|
+
* `api.handshake()` + `HostHandshake`, `lifecycle.teardown()`, and the
|
|
28
|
+
* `routes.addPatch`/`removePatch` route-patch members.
|
|
27
29
|
*/
|
|
28
|
-
declare const HOST_API_VERSION: "1.
|
|
30
|
+
declare const HOST_API_VERSION: "1.3.0";
|
|
29
31
|
interface PluginDescriptor {
|
|
30
32
|
name: string;
|
|
31
33
|
version: string;
|
|
@@ -53,9 +55,30 @@ interface HostLifecycle {
|
|
|
53
55
|
interface HostRpc {
|
|
54
56
|
call<Req = unknown, Res = unknown>(method: string, args?: Req): Promise<Res>;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Transforms an existing route's props. Receives a shallow copy of the route's
|
|
60
|
+
* props and returns a partial override (today only `children` is honored); a
|
|
61
|
+
* missing/void return leaves the route untouched.
|
|
62
|
+
*/
|
|
63
|
+
type RoutePatch = (props: {
|
|
64
|
+
path?: string;
|
|
65
|
+
children?: unknown;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}) => {
|
|
68
|
+
children?: unknown;
|
|
69
|
+
} | void;
|
|
56
70
|
interface HostRoutes {
|
|
57
71
|
/** Register a full-page route; returns a disposer that removes it. */
|
|
58
72
|
register(path: string, component: () => unknown): Disposable;
|
|
73
|
+
/**
|
|
74
|
+
* Patch an existing route (the host's own or a coexisting loader's) in place —
|
|
75
|
+
* e.g. wrap the Home to inject shelves. Returns the same `patch` so the caller
|
|
76
|
+
* can pair it with `removePatch`. Optional (feature-detected): hosts on a
|
|
77
|
+
* contract below 1.3.0 do not implement it.
|
|
78
|
+
*/
|
|
79
|
+
addPatch?(path: string, patch: RoutePatch): RoutePatch;
|
|
80
|
+
/** Remove a patch previously added with {@link addPatch}. Optional. */
|
|
81
|
+
removePatch?(path: string, patch: RoutePatch): RoutePatch;
|
|
59
82
|
}
|
|
60
83
|
interface ToastOptions {
|
|
61
84
|
title?: string;
|
|
@@ -348,4 +371,4 @@ declare global {
|
|
|
348
371
|
}
|
|
349
372
|
}
|
|
350
373
|
|
|
351
|
-
export { type Disposable, FORCE_OWNER_GLOBAL, HOST_API_VERSION, type HostApi, type HostHandshake, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostOwnerKind, type HostOwnerMetadata, type HostQam, type HostRoutes, type HostRpc, type HostUi, type HostUpdates, INJECTED_HOST_GLOBAL, type MainMenuEntry, OWNER_GLOBAL, OWNER_METADATA_GLOBAL, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions, getInjectedHost, isForcedOwner, readForcedOwner, readOwner };
|
|
374
|
+
export { type Disposable, FORCE_OWNER_GLOBAL, HOST_API_VERSION, type HostApi, type HostHandshake, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostOwnerKind, type HostOwnerMetadata, type HostQam, type HostRoutes, type HostRpc, type HostUi, type HostUpdates, INJECTED_HOST_GLOBAL, type MainMenuEntry, OWNER_GLOBAL, OWNER_METADATA_GLOBAL, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type RoutePatch, type ShelfSource, type ShelvesHostGlobal, type ToastOptions, getInjectedHost, isForcedOwner, readForcedOwner, readOwner };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
* npm release version. Bump semver here on shape changes: MINOR for additive,
|
|
24
24
|
* backward-compatible members (a new optional namespace / field); MAJOR on a
|
|
25
25
|
* breaking change. 1.2.0 added the optional `updates` namespace and the
|
|
26
|
-
* optional `React`/`ReactDOM`/`jsx` UI-surface members.
|
|
26
|
+
* optional `React`/`ReactDOM`/`jsx` UI-surface members. 1.3.0 added the optional
|
|
27
|
+
* `api.handshake()` + `HostHandshake`, `lifecycle.teardown()`, and the
|
|
28
|
+
* `routes.addPatch`/`removePatch` route-patch members.
|
|
27
29
|
*/
|
|
28
|
-
declare const HOST_API_VERSION: "1.
|
|
30
|
+
declare const HOST_API_VERSION: "1.3.0";
|
|
29
31
|
interface PluginDescriptor {
|
|
30
32
|
name: string;
|
|
31
33
|
version: string;
|
|
@@ -53,9 +55,30 @@ interface HostLifecycle {
|
|
|
53
55
|
interface HostRpc {
|
|
54
56
|
call<Req = unknown, Res = unknown>(method: string, args?: Req): Promise<Res>;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Transforms an existing route's props. Receives a shallow copy of the route's
|
|
60
|
+
* props and returns a partial override (today only `children` is honored); a
|
|
61
|
+
* missing/void return leaves the route untouched.
|
|
62
|
+
*/
|
|
63
|
+
type RoutePatch = (props: {
|
|
64
|
+
path?: string;
|
|
65
|
+
children?: unknown;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}) => {
|
|
68
|
+
children?: unknown;
|
|
69
|
+
} | void;
|
|
56
70
|
interface HostRoutes {
|
|
57
71
|
/** Register a full-page route; returns a disposer that removes it. */
|
|
58
72
|
register(path: string, component: () => unknown): Disposable;
|
|
73
|
+
/**
|
|
74
|
+
* Patch an existing route (the host's own or a coexisting loader's) in place —
|
|
75
|
+
* e.g. wrap the Home to inject shelves. Returns the same `patch` so the caller
|
|
76
|
+
* can pair it with `removePatch`. Optional (feature-detected): hosts on a
|
|
77
|
+
* contract below 1.3.0 do not implement it.
|
|
78
|
+
*/
|
|
79
|
+
addPatch?(path: string, patch: RoutePatch): RoutePatch;
|
|
80
|
+
/** Remove a patch previously added with {@link addPatch}. Optional. */
|
|
81
|
+
removePatch?(path: string, patch: RoutePatch): RoutePatch;
|
|
59
82
|
}
|
|
60
83
|
interface ToastOptions {
|
|
61
84
|
title?: string;
|
|
@@ -348,4 +371,4 @@ declare global {
|
|
|
348
371
|
}
|
|
349
372
|
}
|
|
350
373
|
|
|
351
|
-
export { type Disposable, FORCE_OWNER_GLOBAL, HOST_API_VERSION, type HostApi, type HostHandshake, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostOwnerKind, type HostOwnerMetadata, type HostQam, type HostRoutes, type HostRpc, type HostUi, type HostUpdates, INJECTED_HOST_GLOBAL, type MainMenuEntry, OWNER_GLOBAL, OWNER_METADATA_GLOBAL, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type ShelfSource, type ShelvesHostGlobal, type ToastOptions, getInjectedHost, isForcedOwner, readForcedOwner, readOwner };
|
|
374
|
+
export { type Disposable, FORCE_OWNER_GLOBAL, HOST_API_VERSION, type HostApi, type HostHandshake, type HostLifecycle, type HostMainMenu, type HostNotifications, type HostOwnerKind, type HostOwnerMetadata, type HostQam, type HostRoutes, type HostRpc, type HostUi, type HostUpdates, INJECTED_HOST_GLOBAL, type MainMenuEntry, OWNER_GLOBAL, OWNER_METADATA_GLOBAL, type PlatformApi, type PlatformAppMeta, type PlatformCollection, type PlatformTab, type PluginDescriptor, type QamPanel, type RoutePatch, type ShelfSource, type ShelvesHostGlobal, type ToastOptions, getInjectedHost, isForcedOwner, readForcedOwner, readOwner };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck-shelves/host",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Deck Shelves host contract — the HostApi types all host adapters and the bundle build against.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,12 +32,14 @@
|
|
|
32
32
|
"lint:fix": "eslint --fix \"src/**/*.ts\"",
|
|
33
33
|
"test": "vitest run",
|
|
34
34
|
"test:watch": "vitest",
|
|
35
|
+
"api:check": "pnpm run build && node scripts/check-api.mjs check",
|
|
36
|
+
"api:update": "pnpm run build && node scripts/check-api.mjs update",
|
|
35
37
|
"check": "pnpm run typecheck && pnpm run lint && pnpm run test",
|
|
36
38
|
"dev:check": "pnpm run check",
|
|
37
39
|
"clean": "node scripts/clean.mjs",
|
|
38
|
-
"release:dry": "pnpm run clean && pnpm run check && pnpm run build && pnpm pack --dry-run",
|
|
39
|
-
"release:local": "pnpm run clean && pnpm run check && pnpm run build && pnpm pack",
|
|
40
|
-
"prepublishOnly": "pnpm run clean && pnpm run check && pnpm run build"
|
|
40
|
+
"release:dry": "pnpm run clean && pnpm run check && pnpm run build && node scripts/check-api.mjs check && pnpm pack --dry-run",
|
|
41
|
+
"release:local": "pnpm run clean && pnpm run check && pnpm run build && node scripts/check-api.mjs check && pnpm pack",
|
|
42
|
+
"prepublishOnly": "pnpm run clean && pnpm run check && pnpm run build && node scripts/check-api.mjs check"
|
|
41
43
|
},
|
|
42
44
|
"keywords": [
|
|
43
45
|
"deck-shelves",
|