Skip to content

refactor(recipes): rename openHelpers to commonRpcFunctions and harden openInEditor - #141

Merged
antfu merged 4 commits into
mainfrom
chore/rename-open-helpers-to-common-rpc-functions
Jul 28, 2026
Merged

refactor(recipes): rename openHelpers to commonRpcFunctions and harden openInEditor#141
antfu merged 4 commits into
mainfrom
chore/rename-open-helpers-to-common-rpc-functions

Conversation

@antfubot

@antfubot antfubot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Renames the openHelpers RPC recipe export to commonRpcFunctions, moving it to a new canonical module devframe/recipes/common-rpc-functions, and hardens the openInEditor recipe.

  • devframe/recipes/common-rpc-functions now exports openInEditor, openInFinder, and commonRpcFunctions (the bundled array, previously openHelpers).
  • devframe/recipes/open-helpers remains as a deprecated compatibility shim — openHelpers is kept as a deprecated alias of commonRpcFunctions — so existing imports keep working.
  • Updated the internal consumer (@devframes/plugin-messages), package exports/build config, path aliases, docs, and the devframe skill reference to point at the new module.
  • openInEditor and openInFinder now lazily import() devframe/utils/launch-editor / devframe/utils/open inside their handlers instead of a top-level import.
  • openInEditor gains an optional second argument to pick the editor command explicitly, validated against a new KNOWN_EDITORS constant (and KnownEditor type) via v.picklist — the RPC surface can't be used to spawn an arbitrary command.
  • Regenerated the tsnapi API snapshots for the new and deprecated subpaths.

Verification

  • pnpm build
  • pnpm lint
  • pnpm typecheck
  • pnpm test (879 tests passing)

This PR was created with the help of an agent.

@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 32d5408
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a68800512252c000853ac47
😎 Deploy Preview https://deploy-preview-141--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.

@antfubot antfubot changed the title refactor(recipes): rename openHelpers to commonRpcFunctions refactor(recipes): rename openHelpers to commonRpcFunctions and harden openInEditor Jul 28, 2026
antfubot added 2 commits July 28, 2026 08:50
Move the open-in-editor/open-in-finder RPC recipe bundle from
devframe/recipes/open-helpers to devframe/recipes/common-rpc-functions,
renaming the exported openHelpers array to commonRpcFunctions.

devframe/recipes/open-helpers remains as a deprecated compatibility
shim (openHelpers aliased to commonRpcFunctions) so existing imports
keep working.
Load devframe/utils/launch-editor and devframe/utils/open lazily via
dynamic import in the openInEditor/openInFinder handlers instead of a
top-level import.

openInEditor gains an optional second argument to pick the editor
command explicitly. It's validated against a new KNOWN_EDITORS
constant (and KnownEditor type) via v.picklist, so the RPC surface
can't be used to spawn an arbitrary command.
@antfubot
antfubot force-pushed the chore/rename-open-helpers-to-common-rpc-functions branch 2 times, most recently from 9a8ec1a to e153305 Compare July 28, 2026 09:30
antfubot and others added 2 commits July 28, 2026 09:58
Write KnownEditor directly as a union of editor-command literals
instead of deriving it via (typeof KNOWN_EDITORS)[number] — the
tsnapi snapshot now prints the actual union instead of the indexed
access expression. KNOWN_EDITORS is now typed against KnownEditor
(as const satisfies readonly KnownEditor[]) to keep the two in sync.
@antfu
antfu merged commit 64236ac into main Jul 28, 2026
11 of 12 checks passed
@antfu
antfu deleted the chore/rename-open-helpers-to-common-rpc-functions branch July 28, 2026 10:12
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.

2 participants