Skip to content

Commit 81054e2

Browse files
committed
chore: update
1 parent b314310 commit 81054e2

14 files changed

Lines changed: 78 additions & 175 deletions

File tree

docs/content/1.guide/10.standalone-cli.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ defineDevframe({
185185
```
186186

187187
Booleans become `--verbose` / `--no-verbose`, else `--depth <value>`; keys are camelCase in TS, kebab-case on the CLI (`configFile``--config-file`). Flags outside the schema pass through.
188-
189-
## Common RPC functions
190-
191-
Recipes for opening files in the editor or OS explorer live in `devframe/recipes/common-rpc-functions` ([Common RPC Functions](/references/common-rpc-functions)).
192-
193188
## Snapshot queries for static builds
194189

195190
For an RPC function returning one payload per build, set `snapshot: true`; the build adapter runs the handler once, baking the result in:

docs/content/1.guide/19.services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: 'ctx.services lets one devframe expose a typed, namespaced capabili
77

88
`ctx.services` lets one devframe expose a typed, namespaced capability visible to every devframe. Two tiers: in-process services (`provide`/`get`) share live objects between devframes; [wire services](#wire-services) also register RPC and advertise to RPC clients.
99

10-
The [Services reference](/references/services) collects the host methods, the definition/descriptor fields, and the built-in services as lookup tables.
10+
The [Node-Side API reference](/references/node-api#devframeserviceshost) collects the host methods and the definition/descriptor fields as lookup tables.
1111

1212
## Providing a service
1313

docs/content/5.add-ons/2.services/1.open.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ navigation:
55
description: 'The @devframes/service-open wire service: open files in an editor or reveal them in the OS explorer over RPC, with workspace-root path containment and editor gating.'
66
---
77

8-
Open files in an editor or reveal them in the OS explorer, shared over RPC by every devframe on the host. Replaces per-devframe registration of the (deprecated) [`common-rpc-functions`](/references/common-rpc-functions) recipe with one install, feature-detectable from RPC clients, adding workspace-root path containment on top of editor gating.
8+
Open files in an editor or reveal them in the OS explorer, shared over RPC by every devframe on the host. Replaces per-devframe registration of the (deprecated) `devframe/recipes/common-rpc-functions` recipe with one install, feature-detectable from RPC clients, adding workspace-root path containment on top of editor gating.
99

1010
Package: `@devframes/service-open` · Scope: `devframes:service:open`
1111

docs/content/5.add-ons/2.services/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ navigation:
55
description: 'Built-in wire services (@devframes/service-*): one node-side capability installed once per host and consumed by every devframe and RPC client, without re-implementing or re-bundling it.'
66
---
77

8-
Built-in [wire services](/guide/services#wire-services) (`@devframes/service-*`) — one node-side capability installed once per host and consumed by every devframe and RPC client, without re-implementing or re-bundling it. See [Cross-Devframe Services](/guide/services) for the mechanism and the [Services reference](/references/services) for the host API.
8+
Built-in [wire services](/guide/services#wire-services) (`@devframes/service-*`) — one node-side capability installed once per host and consumed by every devframe and RPC client, without re-implementing or re-bundling it. See [Cross-Devframe Services](/guide/services) for the mechanism and the [Node-Side API reference](/references/node-api#devframeserviceshost) for the host API.
99

1010
| Service | Scope | RPC functions | What it does |
1111
|---------|-------|---------------|--------------|

docs/content/5.add-ons/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Complete tools, each picking its own UI framework yet sharing one node-side API
2727

2828
## Services
2929

30-
Shared node-side capabilities other devframes install and consume — see [Cross-Devframe Services](/guide/services) for the mechanism, and the [Services reference](/references/services) for the host API.
30+
Shared node-side capabilities other devframes install and consume — see [Cross-Devframe Services](/guide/services) for the mechanism, and the [Node-Side API reference](/references/node-api#devframeserviceshost) for the host API.
3131

3232
| Service | Scope | What it does |
3333
|---------|-------|--------------|

docs/content/6.errors/DF0062.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Install the exact declared version to serve byte-identical assets:
1919
npm install @devframes/plugin-git-client@1.2.3
2020
```
2121

22-
A major-version mismatch is rejected instead — see [DF0061](/errors/DF0061.md).
22+
A major-version mismatch is rejected instead — see [DF0061](/errors/DF0061).
2323

2424
## Source
2525

docs/content/7.migrations/4.migration-0.6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default defineDevframe({
2323
})
2424
```
2525

26-
See [Devframe Definition](/guide/devframe-definition#sourcing-metadata-from-package-json) for the full reference and the optional `duplicationStrategy`.
26+
See [Devframe Definition](/guide/devframe-definition#sourcing-metadata-from-packagejson) for the full reference and the optional `duplicationStrategy`.
2727

2828
## Auth handshake methods are renamed
2929

docs/content/8.references/11.services.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

docs/content/8.references/4.node-api.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Node-Side API'
33
navigation:
44
icon: i-lucide-server-cog
5-
description: 'Lookup tables for the node side: DevframeDefinition fields, CLI options, storage scopes, RPC function types, broadcast options, streaming lifecycle, remote assets, diagnostics prefixes, and the auth surface.'
5+
description: 'Lookup tables for the node side: DevframeDefinition fields, CLI options, storage scopes, RPC function types, broadcast options, streaming lifecycle, remote assets, the cross-devframe services surface, diagnostics prefixes, and the auth surface.'
66
---
77

88
Lookup tables for a devframe's node side. Each section links the guide page that teaches the concept.
@@ -102,6 +102,65 @@ The fields of a `RemoteAssets` source for `clientAssets` and `hostStatic` — [R
102102
| `provider` | `'jsdelivr'` (default), `'unpkg'`, or a custom provider (internal mirror). |
103103
| `offline` | `true` serves only from local install or cache, never network. |
104104

105+
## `DevframeServicesHost`
106+
107+
The methods on `ctx.services`[Cross-Devframe Services](/guide/services#the-devframeserviceshost-api).
108+
109+
| Method | Signature | Role |
110+
|--------|-----------|------|
111+
| `provide` | `(id, service) => revoke` | Publish an in-process service under a namespaced id. Throws [`DF0037`](/errors/DF0037) if the id is taken. |
112+
| `get` | `(id) => service \| undefined` | The service currently provided under `id` (augmented type, else `unknown`). |
113+
| `has` | `(id) => boolean` | Whether a service is provided under `id`. |
114+
| `whenAvailable` | `(id, cb) => unsubscribe` | Run `cb` as soon as the service exists — now if provided, else on `provide` — and re-fire on revoke/re-provide. |
115+
| `keys` | `() => string[]` | Ids of every currently-provided service. |
116+
| `install` | `(input, options?) => Promise<api \| undefined>` | Install a [wire service](#wire-service-definition-fields) at runtime (the dynamic escape hatch; the common path is declarative). `options.resolveFrom` is the descriptor's resolution base. |
117+
| `ready` | `() => Promise<void>` | **Internal.** Construct every queued wire service before any `setup` runs. Adapters call it; application code uses declarative `services`. |
118+
119+
## Service tiers
120+
121+
The two tiers a service can take — [Cross-Devframe Services](/guide/services).
122+
123+
| Tier | Shared how | Registers RPC | Advertised to clients |
124+
|------|-----------|---------------|-----------------------|
125+
| In-process service (`provide`/`get`) | live object, node side only | No | No |
126+
| [Wire service](/guide/services#wire-services) (`install` / declarative `services`) | npm package, node API + RPC | Yes, under its `scope` | Yes, via `devframe:services` shared state |
127+
128+
## Wire-service definition fields
129+
130+
The fields of a `DevframeServiceDefinition` returned by a service package's `create<X>Service` factory — [Shipping a wire service](/guide/services#shipping-one).
131+
132+
| Field | Type | Description |
133+
|-------|------|-------------|
134+
| `package` | `string` | **Required.** npm package name — also its registry key (`ctx.services.has(pkg)`). |
135+
| `version` | `string` | **Required.** Semver; advertised to clients, checked against declared ranges. |
136+
| `scope` | `string` | **Required.** RPC namespace its functions register under (e.g. `devframes:service:open`); `setup` gets a context pre-scoped to it. |
137+
| `meta` | `Record<string, unknown>` | Extra advertised metadata (feature flags, defaults). Must be JSON-serializable. |
138+
| `options` | `Options` | This instance's own option set, baked in by its factory; joins the merge. |
139+
| `mergeOptions` | `(sets: Options[]) => Options` | Merge multiple installers' option sets. Default: shallow, later wins. |
140+
| `setup` | `(ctx, info) => api` | **Required.** Register RPC on the pre-scoped context; return the node API served from `ctx.services.get(package)`. |
141+
142+
## Wire-service descriptor fields
143+
144+
The declarative reference form on `DevframeDefinition.services` / `initHub({ services })`[Declaring services](/guide/services#declaring).
145+
146+
| Field | Type | Description |
147+
|-------|------|-------------|
148+
| `package` | `string` | **Required.** npm package name; its default export is the factory the host imports. |
149+
| `version` | `string` | Accepted semver range. Unsatisfied warns ([`DF0069`](/errors/DF0069)), or throws ([`DF0068`](/errors/DF0068)) when `required`. |
150+
| `required` | `boolean` | Fail hard on a missing package ([`DF0067`](/errors/DF0067)) or unsatisfied range. Default `false` — a missing service is skipped and clients see `has() === false`. |
151+
| `options` | `Options` | Option set this installer contributes to the merge. |
152+
153+
## Advertised service meta
154+
155+
Each installed service's entry in the `devframe:services` [shared state](/guide/shared-state), mirrored to RPC clients as `rpc.services`[Feature-detecting on the RPC client](/guide/services#feature-detecting-on-the-rpc-client).
156+
157+
| Field | Description |
158+
|-------|-------------|
159+
| `package` | npm package name — the registry key. |
160+
| `version` | Installed version of the service. |
161+
| `scope` | RPC namespace its functions live under. |
162+
| `meta` | Extra service-declared metadata. |
163+
105164
## Diagnostic code prefixes
106165

107166
Prefixes in use across the ecosystem — [Structured Diagnostics](/guide/diagnostics#code-conventions).

docs/content/8.references/7.helpers.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)