Skip to content

feat: service-open + service-shiki wire services, with plugin migrations - #260

Open
antfubot wants to merge 3 commits into
mainfrom
feat/service-packages
Open

feat: service-open + service-shiki wire services, with plugin migrations#260
antfubot wants to merge 3 commits into
mainfrom
feat/service-packages

Conversation

@antfubot

@antfubot antfubot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

What

PRs 2+3 of the wire-services series (#256 landed the core mechanism): the first two service packages under a new services/* workspace tier, plus the plugin migrations onto them.

@devframes/service-opendevframes:service:open

One host-level installation of open-in-editor / open-in-finder, replacing the per-plugin registrations of the devframe/recipes/common-rpc-functions recipes (now @deprecated; removal is a future major).

  • open-in-editor takes { path, line?, column?, editor? }; open-in-finder takes { path }
  • Absolute paths only, contained to the workspace root plus configured extra roots (DS_OPEN_0001/DS_OPEN_0002)
  • Editor commands stay gated to the KNOWN_EDITORS picklist at the RPC boundary
  • Options { editor?, roots? } merge across installers: editor later-wins, roots union

@devframes/service-shikidevframes:service:shiki

Server-side Shiki so plugin bundles stop shipping grammars and themes.

  • Three query RPCs: highlight (dual light/dark HTML), code-to-hast, code-to-tokens — all cacheable client-side, LRU-cached server-side per (code, lang, themes); unknown languages degrade to plain text
  • Shiki loads lazily on first use; declared langs warm eagerly
  • Options { themes?, langs? } merge: themes later-wins (defaults vitesse-light/vitesse-dark), langs union

Migrations

messages — drops its commonRpcFunctions registration for a devframes:plugin:messages:open-file bridge: the plugin resolves workspace-relative file positions server-side and delegates to the open service's node API (no RPC hop), so the client never needs the server's filesystem layout. The panel's affordance is gated on the service advertisement (rpc.services.has(...), reactive via services.state()).

assetsopen-in-editor / reveal-in-folder keep their root-relative client posture and delegate to service-open, which the plugin installs at setup with the managed dir as an extra allowed root (it can live outside the workspace). The SPA hides both buttons until the service is advertised. Text-asset previews render server-highlighted through service-shiki (declared as an optional services entry) with the plain <pre> as fallback — both fallback styles of the conditional-UI story exercised in one real plugin.

git — stays as-is: its only code surface is the @pierre/diffs diff view, whose shiki adoption is the deferred diff-rebuild follow-up.

Conventions

  • Factories as default exports; typed declaration merges (RPC ids, node API, package→scope) — zero shipped client code
  • Service diagnostics use the DS_<SLUG>_ prefix; plugin additions use their DP_<SLUG>_ bands
  • New services/* glob wired through pnpm workspaces, turbo, knip, vitest projects, and source aliases
  • Docs: guide/services.md Built-in services section; recipe/helper/plugin pages point at the services

Validation

  • pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build all green (1201 tests, 108 files)
  • New tests: service units (containment, editor gating, roots/themes/langs merging, LRU, plain-text degradation) plus migration coverage — messages registers the bridge + the installed service, assets keeps its RPCs registered with the service present; test harnesses mirror the adapters' queue-then-ready() flow
  • Windows CI fixed (pathe-normalized test expectations) and API snapshots updated

Created with the help of an agent.

The first two wire-service packages, under a new services/* workspace
glob:

- @devframes/service-open (devframes:service:open) — open-in-editor /
  open-in-finder shared by every plugin: absolute paths only, contained
  to the workspace root plus configured extra roots, editor commands
  gated to KNOWN_EDITORS; options { editor?, roots? } merge across
  installers (editor later-wins, roots union). Supersedes the per-plugin
  recipes registrations, now marked deprecated.
- @devframes/service-shiki (devframes:service:shiki) — server-side
  syntax highlighting so plugins stop re-bundling highlighters:
  highlight (dual light/dark HTML), code-to-hast, code-to-tokens; all
  cacheable + LRU-cached per (code, lang, themes); unknown languages
  degrade to plain text; shiki loads lazily on first use; options
  { themes?, langs? } merge (themes later-wins, langs union).

Both ship their factory as the default export and contribute typed
declaration merges (RPC ids, node API, package→scope), so server and
client consumers are fully typed with zero shipped client code.
@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 4f64284
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a840639c15a7800080ba32c
😎 Deploy Preview https://deploy-preview-260--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

The expectations built paths with node:path (backslashes on Windows)
while the service resolves through pathe (forward slashes). Also declare
the pathe runtime dependency the service was getting via hoisting.
- messages: drops its commonRpcFunctions registration for a
  devframes:plugin:messages:open-file bridge that resolves
  workspace-relative file positions server-side and delegates to
  @devframes/service-open (declared in the definition's services); the
  panel gates its affordance on the service advertisement
- assets: open-in-editor / reveal-in-folder delegate to service-open,
  installed at setup with the managed dir as an extra allowed root; the
  SPA hides both buttons until the service is advertised, and text-asset
  previews render server-highlighted through @devframes/service-shiki
  (declared optional) with the plain <pre> as fallback
- docs + skill point at the service over the deprecated recipes
@antfubot antfubot changed the title feat: @devframes/service-open and @devframes/service-shiki wire services feat: service-open + service-shiki wire services, with plugin migrations Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant