Skip to content

Commit b35b1ab

Browse files
committed
chore(deps): shrink the install footprint
- add devframe/utils/url, an in-house, browser-safe replacement for the handful of ufo helpers (joinURL, withBase, withProtocol, slash helpers, cleanDoubleSlashes); ufo is gone from every package and the catalog - move the types-only @standard-schema/spec to devDependencies everywhere and inline its declarations into each package's dts - bundle the remaining tiny pure deps instead of installing them: birpc, mrmime, nostics, pathe (devframe); pathe, perfect-debounce, tinyexec (hub); pathe (agentic, vite kit, service-open, plugin-git); image-meta, pathe, perfect-debounce, tinyglobby (plugin-assets) - give the throwing root entries an explicit 'export {}' so dts emit stops warning about them devframe's runtime deps shrink to crossws + h3; hub's to destr + h3 + zigpty; every dist stays self-contained (verified: no bundled-package import specifiers survive in dist).
1 parent 70e95ad commit b35b1ab

47 files changed

Lines changed: 364 additions & 129 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎alias.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const alias = {
4141
'devframe/utils/shared-state': r('devframe/src/utils/shared-state.ts'),
4242
'devframe/utils/streaming-channel': r('devframe/src/utils/streaming-channel.ts'),
4343
'devframe/utils/structured-clone': r('devframe/src/utils/structured-clone.ts'),
44+
'devframe/utils/url': r('devframe/src/utils/url.ts'),
4445
'devframe/utils/when': r('devframe/src/utils/when.ts'),
4546
'devframe/adapters/cac': r('devframe/src/adapters/cac.ts'),
4647
'devframe/adapters/dev': r('devframe/src/adapters/dev.ts'),

‎docs/app/pages/logos.vue‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
// Shadows the comark-docs layer's brand-assets page with devframe's assets.
3-
import { joinURL } from 'ufo'
43
import logoSvg from '../../public/logo.svg?raw'
54
65
definePageMeta({
@@ -11,7 +10,7 @@ const title = 'Brand assets'
1110
const description = 'Logos and assets for Devframe. Download SVG or PNG, or copy the raw SVG source directly.'
1211
1312
const site = useSiteConfig()
14-
const canonicalUrl = computed(() => joinURL(site.url, '/logos'))
13+
const canonicalUrl = computed(() => new URL('/logos', site.url).href)
1514
1615
useRobotsRule('index, follow')
1716

‎docs/content/8.references/8.utilities.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ state.mutate((draft) => {
123123
state.value() // => count is 1
124124
```
125125

126+
### `devframe/utils/url`
127+
128+
URL path-joining and slash-normalization helpers (browser-safe, zero-dep).
129+
130+
```ts
131+
import { joinURL, withBase, withProtocol, withTrailingSlash } from 'devframe/utils/url'
132+
133+
joinURL('/__devframe', '__renderers', 'vue.mjs') // '/__devframe/__renderers/vue.mjs'
134+
withBase('meta.json', '/__devframe/') // '/__devframe/meta.json'
135+
withProtocol('http://localhost:7777/ws', 'ws://') // 'ws://localhost:7777/ws'
136+
```
137+
138+
Also exports `withLeadingSlash`, `withoutLeadingSlash`, `withoutTrailingSlash`, and `cleanDoubleSlashes`.
139+
126140
### `devframe/utils/streaming-channel`
127141

128142
Sink/reader primitives for streamed RPC payloads, via `ctx.rpc.streaming`; see [Streaming](/guide/streaming).

‎docs/package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"comark-docs": "catalog:docs",
2121
"d3-shape": "catalog:frontend",
2222
"nuxt": "catalog:build",
23-
"shiki": "catalog:deps",
24-
"ufo": "catalog:deps"
23+
"shiki": "catalog:deps"
2524
},
2625
"devDependencies": {
2726
"@types/d3-shape": "catalog:types"

‎packages/agentic/package.json‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@
4141
"dependencies": {
4242
"@modelcontextprotocol/client": "catalog:deps",
4343
"@modelcontextprotocol/server": "catalog:deps",
44-
"@standard-schema/spec": "catalog:deps",
45-
"h3": "catalog:deps",
46-
"pathe": "catalog:deps",
47-
"ufo": "catalog:deps"
44+
"h3": "catalog:deps"
4845
},
4946
"devDependencies": {
47+
"@standard-schema/spec": "catalog:deps",
5048
"@types/node": "catalog:types",
5149
"devframe": "workspace:*",
50+
"pathe": "catalog:deps",
5251
"tsdown": "catalog:build",
5352
"valibot": "catalog:deps"
5453
}

‎packages/agentic/src/connect/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/server/stdio'
66
import { diagnostics, listLiveDevframeInstances, probeDevframeOrigin } from 'devframe/internal'
77
import { toAgentToolName } from 'devframe/utils/agent-tool-name'
88
import { Diagnostic } from 'devframe/utils/nostics'
9-
import { joinURL } from 'ufo'
9+
import { joinURL } from 'devframe/utils/url'
1010

1111
export interface ConnectServerOptions {
1212
/**

‎packages/agentic/src/index.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ throw new Error(
1212
+ ' • import from "devframe/adapters/mcp" to serve a devframe over MCP\n'
1313
+ ' • run "devframe connect" for the stdio discovery gateway\n',
1414
)
15+
16+
// An explicit empty module so dts emit has something to say about this entry.
17+
export {}

‎packages/agentic/tsdown.config.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ export default defineConfig({
1111
tsconfig: '../../tsconfig.base.json',
1212
dts: true,
1313
platform: 'node',
14+
deps: {
15+
onlyBundle: [
16+
'pathe',
17+
],
18+
},
1419
})

‎packages/devframe/package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"./utils/shared-state": "./dist/utils/shared-state.mjs",
6464
"./utils/streaming-channel": "./dist/utils/streaming-channel.mjs",
6565
"./utils/structured-clone": "./dist/utils/structured-clone.mjs",
66+
"./utils/url": "./dist/utils/url.mjs",
6667
"./utils/when": "./dist/utils/when.mjs",
6768
"./package.json": "./package.json"
6869
},
@@ -94,25 +95,24 @@
9495
}
9596
},
9697
"dependencies": {
97-
"@standard-schema/spec": "catalog:deps",
98-
"birpc": "catalog:deps",
9998
"crossws": "catalog:deps",
100-
"h3": "catalog:deps",
101-
"mrmime": "catalog:deps",
102-
"nostics": "catalog:deps",
103-
"pathe": "catalog:deps",
104-
"ufo": "catalog:deps"
99+
"h3": "catalog:deps"
105100
},
106101
"devDependencies": {
107102
"@devframes/agentic": "workspace:*",
103+
"@standard-schema/spec": "catalog:deps",
104+
"birpc": "catalog:deps",
108105
"cac": "catalog:deps",
109106
"get-port-please": "catalog:deps",
110107
"immer": "catalog:deps",
111108
"launch-editor": "catalog:deps",
112109
"mlly": "catalog:build",
110+
"mrmime": "catalog:deps",
111+
"nostics": "catalog:deps",
113112
"obug": "catalog:deps",
114113
"ohash": "catalog:deps",
115114
"p-limit": "catalog:deps",
115+
"pathe": "catalog:deps",
116116
"perfect-debounce": "catalog:deps",
117117
"structured-clone-es": "catalog:deps",
118118
"tinyglobby": "catalog:deps",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { AgenticMcpModule } from '../node/agentic'
22
import type { DevframeAgentHost } from '../types/agent'
33
import type { ConnectionMeta } from '../types/context'
44
import type { DevframeDefinition, DevframeDeploymentKind, McpAuthorization, McpSetting } from '../types/devframe'
5+
import { cleanDoubleSlashes, withLeadingSlash, withoutLeadingSlash, withTrailingSlash } from 'devframe/utils/url'
56
import { getPort } from 'get-port-please'
6-
import { cleanDoubleSlashes, withLeadingSlash, withoutLeadingSlash, withTrailingSlash } from 'ufo'
77
import { DEVFRAME_MCP_ROUTE } from '../constants'
88
import { importAgenticMcp, isAgenticInstalled, warnAgenticMcpMissingOnce } from '../node/agentic'
99

0 commit comments

Comments
 (0)