feat(core): extract ShortcutsPlugin into @editorjs/shortcuts-plugin#180
Open
ilyamore88 wants to merge 1 commit into
Open
feat(core): extract ShortcutsPlugin into @editorjs/shortcuts-plugin#180ilyamore88 wants to merge 1 commit into
ilyamore88 wants to merge 1 commit into
Conversation
Move the last in-tree EditorjsPlugin out of packages/core into a standalone @editorjs/shortcuts-plugin package, mirroring the clipboard-plugin extraction (#129). Closes #171. - New package packages/plugins/shortcuts-plugin scaffolded from clipboard-plugin (package.json, tsconfigs, eslint, jest, stryker). - ShortcutsPlugin.ts moved verbatim into src/index.ts (no source changes) and covered by a new index.spec.ts (12 cases, 100% coverage) that closes the pre-existing test gap. - Wire core: add the workspace dependency, tsconfig project references (tsconfig + tsconfig.build), and switch the import to the package; delete the now-empty src/plugins directory. - Dedicated CI workflow shortcuts-plugin.yml (package-check shape). - Move the "Keyboard shortcuts plugin" requirement out of the core OpenSpec spec into a new specs/shortcuts-plugin/spec.md. - Ignore .claude/worktrees/ in .gitignore. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ilyamore88
marked this pull request as ready for review
July 21, 2026 22:12
gohabereg
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #171.
Extracts the last remaining in-tree
EditorjsPluginout ofpackages/coreinto a standalone@editorjs/shortcuts-pluginpackage, mirroring theClipboardPluginextraction (#129).What changed
packages/plugins/shortcuts-plugin(@editorjs/shortcuts-plugin), scaffolded fromclipboard-plugin(package.json,tsconfig{,.build,.eslint}.json,eslint.config.mjs,jest.config.ts,stryker.conf.mjs,.gitignore,README.md).ShortcutsPlugin.ts→src/index.tswith zero content change (git detects a pure rename). The plugin already imported only from@editorjs/sdk, so no code edits were needed.src/index.spec.ts— 12 cases at 100% coverage (statements/branches/functions/lines), closing the pre-existing gap (there was noShortcutsPlugin.spec.ts). Covers shortcut registration from tooloptions, keydown match/dispatch, first-match-wins, the IME-composition guard,IndexErrortolerance vs. rethrow of other errors, anddestroy().workspace:^dependency, added project references in bothtsconfig.jsonandtsconfig.build.json, switched the import to@editorjs/shortcuts-plugin, and removed the now-emptysrc/plugins/directory. Registration order inCoreis unchanged..github/workflows/shortcuts-plugin.yml, samepackage-check.yml-based shape asclipboard-plugin.yml(include-mutations: true).specs/core/spec.mdinto a newspecs/shortcuts-plugin/spec.md;openspec validatepasses for all 12 specs.Notes / scope
#processBlockTool/#processBlockTune) are moved as-is; they carry no statements so coverage stays at 100%. Consequently the issue's suggestion to also test the reserved block-tool/tuneshortcutsmap isn't applicable yet — it's documented as reserved in the new spec instead.Verification
yarn workspace @editorjs/shortcuts-plugin lint:ci— cleanyarn workspace @editorjs/shortcuts-plugin test:coverage— 12 passed, 100%yarn workspace @editorjs/shortcuts-plugin build— okyarn workspace @editorjs/core lint:ci/build— cleanyarn constraints— cleanopenspec validate— 12 passedFollow-ups (not in this PR)
matchKeyboardShortcuthas no unit test in@editorjs/sdk..github/scripts/should-run-ci.shonly scans depth-1packages/*, so it's blind to dependency changes forpackages/plugins/*andpackages/tools/*(pre-existing).🤖 Generated with Claude Code