Skip to content

Commit 4238046

Browse files
committed
refactor(devframe): rename node/internal subpath to node/hub-internals
This subpath is the bridge `@devframes/hub` (and any future first-party hub adapter) uses to reach into devframe's remote-dock token machinery and basePath resolver. Calling it "internal" while a published package depends on it understates the contract: rename to `hub-internals` and document it as the stable surface for first-party hub adapters.
1 parent 16dd84a commit 4238046

16 files changed

Lines changed: 39 additions & 40 deletions

File tree

‎alias.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const alias = {
1414
'devframe/rpc': r('devframe/src/rpc'),
1515
'devframe/types': r('devframe/src/types/index.ts'),
1616
'devframe/node/auth': r('devframe/src/node/auth/index.ts'),
17-
'devframe/node/internal': r('devframe/src/node/internal/index.ts'),
17+
'devframe/node/hub-internals': r('devframe/src/node/hub-internals/index.ts'),
1818
'devframe/node': r('devframe/src/node/index.ts'),
1919
'devframe/constants': r('devframe/src/constants.ts'),
2020
'devframe/utils/colors': r('devframe/src/utils/colors.ts'),

‎packages/devframe/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"./helpers/vite": "./dist/helpers/vite.mjs",
3131
"./node": "./dist/node/index.mjs",
3232
"./node/auth": "./dist/node/auth.mjs",
33-
"./node/internal": "./dist/node/internal.mjs",
33+
"./node/hub-internals": "./dist/node/hub-internals.mjs",
3434
"./recipes/open-helpers": "./dist/recipes/open-helpers.mjs",
3535
"./rpc": "./dist/rpc/index.mjs",
3636
"./rpc/client": "./dist/rpc/client.mjs",

‎packages/devframe/src/node/auth/revoke.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { DevframeNodeContext } from 'devframe/types'
22
import type { SharedState } from 'devframe/utils/shared-state'
33
import type { RpcFunctionsHost } from '../host-functions'
4-
import type { InternalAnonymousAuthStorage } from '../internal/context'
4+
import type { InternalAnonymousAuthStorage } from '../hub-internals/context'
55

66
/**
77
* Flip `isTrusted` to false on any live WS clients connected with `token`

‎packages/devframe/src/node/auth/state.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { DevframeNodeRpcSession } from 'devframe/types'
22
import type { SharedState } from 'devframe/utils/shared-state'
3-
import type { InternalAnonymousAuthStorage } from '../internal/context'
3+
import type { InternalAnonymousAuthStorage } from '../hub-internals/context'
44
import { humanId } from 'devframe/utils/human-id'
55

66
export interface PendingAuthRequest {
File renamed without changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Public surface for first-party hub adapters (`@devframes/hub` and
3+
* similar). Carries the primitives a hub-kit author needs to bridge a
4+
* framework dev server into a hub context — base-path resolution and
5+
* the remote-dock token bridge used by the hub's docks host.
6+
*
7+
* Stable across minor versions; treat additions or removals as breaking
8+
* only across major versions.
9+
*/
10+
11+
export {
12+
normalizeBasePath,
13+
resolveBasePath,
14+
} from '../../adapters/_shared'
15+
16+
export {
17+
getInternalContext,
18+
internalContextMap,
19+
} from './context'
20+
21+
export type {
22+
DevframeInternalContext,
23+
InternalAnonymousAuthStorage,
24+
RemoteTokenRecord,
25+
} from './context'

‎packages/devframe/src/node/internal/index.ts‎

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

‎packages/devframe/src/node/server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createRpcServer } from 'devframe/rpc/server'
88
import { attachWsRpcTransport } from 'devframe/rpc/transports/ws-server'
99
import { H3, toNodeHandler } from 'h3'
1010
import { WebSocketServer as WSServer } from 'ws'
11-
import { getInternalContext } from './internal/context'
11+
import { getInternalContext } from './hub-internals/context'
1212

1313
export interface StartHttpAndWsOptions {
1414
context: DevframeNodeContext

‎packages/devframe/tsdown.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const serverEntries = {
8383
'rpc/transports/ws-server': 'src/rpc/transports/ws-server.ts',
8484
'node/index': 'src/node/index.ts',
8585
'node/auth': 'src/node/auth/index.ts',
86-
'node/internal': 'src/node/internal/index.ts',
86+
'node/hub-internals': 'src/node/hub-internals/index.ts',
8787
'utils/launch-editor': 'src/utils/launch-editor.ts',
8888
'utils/open': 'src/utils/open.ts',
8989
'utils/serve-static': 'src/utils/serve-static.ts',

‎packages/hub/src/node/__tests__/context.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { mkdtempSync } from 'node:fs'
22
import { tmpdir } from 'node:os'
33
import { join } from 'node:path'
44
import { createHostContext, startHttpAndWs } from 'devframe/node'
5-
import { getInternalContext } from 'devframe/node/internal'
5+
import { getInternalContext } from 'devframe/node/hub-internals'
66
import { describe, expect, it } from 'vitest'
77
import { createHubContext } from '../context'
88

0 commit comments

Comments
 (0)