Skip to content

Commit 30850bb

Browse files
committed
chore!: remove deprecated 0.7-era compat shims for 0.9
Clears the compatibility shims deprecated across the 0.7 series and adds the 0.9 migration guide. - devframe/adapters/cli (createCli/CreateCliOptions/CliHandle) -> devframe/adapters/cac - devframe/recipes/open-helpers (openHelpers) -> devframe/recipes/common-rpc-functions - devframe/rpc dump re-exports -> devframe/rpc/dump - @devframes/hub json-render shims (defineJsonRenderSpec, ctx.createJsonRenderer, DevframeViewJsonRender, JsonRenderSpec/JsonRenderElement/JsonRenderer) -> @devframes/json-render Migrates the hub-ui reference viewer's json-render dock onto the serializable view ref from @devframes/json-render/hub.
1 parent 7c18542 commit 30850bb

38 files changed

Lines changed: 215 additions & 467 deletions

‎alias.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const alias = {
3636
'devframe/utils/structured-clone': r('devframe/src/utils/structured-clone.ts'),
3737
'devframe/utils/when': r('devframe/src/utils/when.ts'),
3838
'devframe/adapters/cac': r('devframe/src/adapters/cac.ts'),
39-
'devframe/adapters/cli': r('devframe/src/adapters/cli.ts'),
4039
'devframe/adapters/dev': r('devframe/src/adapters/dev.ts'),
4140
'devframe/adapters/build': r('devframe/src/adapters/build.ts'),
4241
'devframe/helpers/vite': r('devframe/src/helpers/vite.ts'),
@@ -80,7 +79,6 @@ export const alias = {
8079
'@devframes/plugin-git': p('git/src/index.ts'),
8180
'devframe/recipes/interactive-auth': r('devframe/src/recipes/interactive-auth.ts'),
8281
'devframe/recipes/common-rpc-functions': r('devframe/src/recipes/common-rpc-functions.ts'),
83-
'devframe/recipes/open-helpers': r('devframe/src/recipes/open-helpers.ts'),
8482
'devframe/client': r('devframe/src/client/index.ts'),
8583
'devframe': r('devframe/src'),
8684
'@devframes/plugin-data-inspector/client': p('data-inspector/src/client/index.ts'),

‎docs/.vitepress/config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export function devframeNav(prefix = ''): DefaultTheme.NavItem[] {
146146
{ text: 'Contributing', link: `${repo}/blob/main/CONTRIBUTING.md` },
147147
{
148148
items: [
149+
{ text: 'Migrating to 0.9', link: `${prefix}/guide/migration-0.9` },
149150
{ text: 'Migrating to 0.7', link: `${prefix}/guide/migration-0.7` },
150151
{ text: 'Migrating to 0.6', link: `${prefix}/guide/migration-0.6` },
151152
],

‎docs/adapters/cac.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ const devframe = defineDevframe({
2828
await createCac(devframe).parse()
2929
```
3030

31-
The `devframe/adapters/cli` entry (`createCli`) remains as a deprecated alias for this module — new code should import `createCac` from `devframe/adapters/cac`.
32-
3331
Running the resulting binary:
3432

3533
```sh

‎docs/guide/migration-0.9.md‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Migrating to 0.9
6+
7+
0.9 removes the compatibility shims that were deprecated across the 0.7 series. Each removed export has a drop-in replacement that has shipped alongside it since 0.7, so migrating is a matter of updating import paths and a handful of call sites. This page covers the changes between 0.8.x and 0.9.
8+
9+
## `devframe/adapters/cli` is removed
10+
11+
The CLI adapter was renamed to `cac` in 0.7. The `devframe/adapters/cli` entry — `createCli`, `CreateCliOptions`, and `CliHandle` — is now gone. Import from `devframe/adapters/cac` instead:
12+
13+
| 0.8.x | 0.9 |
14+
|-------|-----|
15+
| `import { createCli } from 'devframe/adapters/cli'` | `import { createCac } from 'devframe/adapters/cac'` |
16+
| `CreateCliOptions` | `CreateCacOptions` |
17+
| `CliHandle` | `CacHandle` |
18+
19+
```ts
20+
// 0.8.x
21+
import { createCli } from 'devframe/adapters/cli'
22+
23+
await createCli(devframe).parse()
24+
```
25+
26+
```ts
27+
// 0.9
28+
import { createCac } from 'devframe/adapters/cac'
29+
30+
await createCac(devframe).parse()
31+
```
32+
33+
The typed-flag helpers `defineCliFlags` and `parseCliFlags` live on `devframe/adapters/cac` too. See [CLI (cac)](/adapters/cac) for the full adapter reference.
34+
35+
## `devframe/recipes/open-helpers` is removed
36+
37+
The recipe was renamed to `common-rpc-functions` in 0.7.16. Import `commonRpcFunctions` from `devframe/recipes/common-rpc-functions`:
38+
39+
```ts
40+
// 0.8.x
41+
import { openHelpers } from 'devframe/recipes/open-helpers'
42+
```
43+
44+
```ts
45+
// 0.9
46+
import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions'
47+
```
48+
49+
The `openInEditor` and `openInFinder` members are unchanged. See [Common RPC functions](/helpers/common-rpc-functions) for the full reference.
50+
51+
## RPC dump re-exports move to `devframe/rpc/dump`
52+
53+
The static-dump helpers and types are served from the dedicated `devframe/rpc/dump` entry; the aliases that re-exported them from the top-level `devframe/rpc` barrel are removed. Import them from `devframe/rpc/dump`:
54+
55+
```ts
56+
// 0.8.x
57+
import { createClientFromDump, dumpFunctions } from 'devframe/rpc'
58+
59+
// 0.9
60+
import { createClientFromDump, dumpFunctions } from 'devframe/rpc/dump'
61+
```
62+
63+
This applies to every dump export — `collectStaticRpcDump`, `createClientFromDump`, `dumpFunctions`, `getDefinitionsWithDumps`, `reviveDumpError`, `serializeDumpError`, and the `StaticRpcDump*` types.
64+
65+
## `@devframes/hub` json-render shims are removed
66+
67+
json-render moved out of the hub into the opt-in [`@devframes/json-render`](./json-render) integration in 0.7. The hub-local compatibility shims are now removed: the `defineJsonRenderSpec` helper, the `ctx.createJsonRenderer` factory, the `DevframeViewJsonRender` dock type, and the `JsonRenderSpec` / `JsonRenderElement` / `JsonRenderer` types.
68+
69+
| 0.8.x (`@devframes/hub`) | 0.9 (`@devframes/json-render`) |
70+
|---|---|
71+
| `defineJsonRenderSpec(spec)` | Pass the spec directly to `createJsonRenderView(ctx, { id, spec })` |
72+
| `ctx.createJsonRenderer(spec)` | `createJsonRenderView(ctx, { id, spec })` (from `@devframes/json-render/node`) |
73+
| `JsonRenderSpec` | `DevframeJsonRenderSpec` |
74+
| `JsonRenderElement` | element shape of `DevframeJsonRenderSpec` |
75+
| `JsonRenderer` | `JsonRenderView` |
76+
| `DevframeViewJsonRender` | `DevframeJsonRenderDockEntry` (from `@devframes/json-render/hub`) |
77+
78+
```ts
79+
// 0.8.x
80+
import { defineJsonRenderSpec } from '@devframes/hub'
81+
82+
const spec = defineJsonRenderSpec({ root: 'panel', elements: { /* ... */ } })
83+
const renderer = ctx.createJsonRenderer(spec)
84+
```
85+
86+
```ts
87+
// 0.9
88+
import { createJsonRenderView } from '@devframes/json-render/node'
89+
90+
const view = createJsonRenderView(ctx, {
91+
id: 'panel',
92+
spec: { root: 'panel', elements: { /* ... */ } },
93+
})
94+
```
95+
96+
`createJsonRenderView` returns a view carrying a serializable `ref` (a shared-state key or an inline spec). Project it onto a hub dock with `toJsonRenderDockEntry` from `@devframes/json-render/hub`, which contributes the `'json-render'` dock type to the hub's open dock union. A dock entry now carries that serializable `view` ref rather than a live renderer handle — a client reads `entry.view.stateKey` (or `entry.view.spec`) to render it.
97+
98+
See [JSON-Render](./json-render) for the full integration reference.

‎docs/helpers/common-rpc-functions.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ defineDevframe({
3030

3131
Both functions are `action`-type RPCs returning `void`, and their arguments are schema-validated — `openInEditor`'s `editor` argument is restricted to `KNOWN_EDITORS`, so a value outside that list fails validation rather than reaching the underlying `launch-editor` process spawn. Both handlers dynamically `import()` their underlying `devframe/utils/*` implementation, so the `launch-editor` and `open` dependencies only load when the recipe actually runs.
3232

33-
The `devframe/recipes/open-helpers` entry (`openHelpers`) remains as a deprecated alias for this module — new code should import `commonRpcFunctions` from `devframe/recipes/common-rpc-functions`.
34-
3533
## Pick and choose
3634

3735
Register only the helper you need rather than the whole array:

‎knip.jsonc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@
7373
"entry": [
7474
"src/{index,constants}.ts",
7575
"src/helpers/vite.ts",
76-
"src/adapters/{build,cac,cli,dev,embedded,initiate}.ts",
76+
"src/adapters/{build,cac,dev,embedded,initiate}.ts",
7777
"src/adapters/mcp/index.ts",
7878
"src/client/index.ts",
7979
"src/node/index.ts",
8080
"src/node/{auth,hub-internals}/index.ts",
81-
"src/recipes/{common-rpc-functions,interactive-auth,open-helpers}.ts",
81+
"src/recipes/{common-rpc-functions,interactive-auth}.ts",
8282
"src/rpc/{index,client,server}.ts",
8383
"src/rpc/dump/index.ts",
8484
"src/rpc/transports/{ws-bun,ws-client,ws-server}.ts",

‎packages/devframe/package.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
".": "./dist/index.mjs",
2323
"./adapters/build": "./dist/adapters/build.mjs",
2424
"./adapters/cac": "./dist/adapters/cac.mjs",
25-
"./adapters/cli": "./dist/adapters/cli.mjs",
2625
"./adapters/dev": "./dist/adapters/dev.mjs",
2726
"./adapters/embedded": "./dist/adapters/embedded.mjs",
2827
"./adapters/mcp": "./dist/adapters/mcp.mjs",
@@ -35,7 +34,6 @@
3534
"./node/hub-internals": "./dist/node/hub-internals.mjs",
3635
"./recipes/common-rpc-functions": "./dist/recipes/common-rpc-functions.mjs",
3736
"./recipes/interactive-auth": "./dist/recipes/interactive-auth.mjs",
38-
"./recipes/open-helpers": "./dist/recipes/open-helpers.mjs",
3937
"./rpc": "./dist/rpc/index.mjs",
4038
"./rpc/client": "./dist/rpc/client.mjs",
4139
"./rpc/dump": "./dist/rpc/dump.mjs",

‎packages/devframe/src/adapters/cac.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// without it throws at load time with the usual Node module-not-found
77
// error. The typed-flag helpers (`defineCliFlags` / `parseCliFlags`) are
88
// re-exported below so they live alongside the CLI adapter.
9-
//
10-
// The historical `devframe/adapters/cli` entry (`createCli`) re-exports
11-
// this module under deprecated aliases for backward compatibility.
129
import type { CAC } from 'cac'
1310
import type { H3 } from 'h3'
1411
import type { DevframeDefinition } from '../types/devframe'

‎packages/devframe/src/adapters/cli.ts‎

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

‎packages/devframe/src/recipes/__tests__/common-rpc-functions.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { StandardSchemaV1 } from '@standard-schema/spec'
22
import { describe, expect, it } from 'vitest'
33
import { commonRpcFunctions, KNOWN_EDITORS, openInEditor, openInFinder } from '../common-rpc-functions'
4-
import { openHelpers } from '../open-helpers'
54

65
/** Synchronously check whether a value satisfies a Standard Schema. */
76
function accepts(schema: StandardSchemaV1, value: unknown): boolean {
@@ -42,8 +41,4 @@ describe('recipes/common-rpc-functions', () => {
4241
expect(commonRpcFunctions).toContain(openInEditor)
4342
expect(commonRpcFunctions).toContain(openInFinder)
4443
})
45-
46-
it('keeps the deprecated `devframe/recipes/open-helpers` entry working as an alias', () => {
47-
expect(openHelpers).toBe(commonRpcFunctions)
48-
})
4944
})

0 commit comments

Comments
 (0)