Harden external plugin install-bundle dependency resolution #211
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First-party external plugin install bundles can require explicit public subpath
modules that are not present in the runtime dependency registry. The current
plugin execution host resolves dependency keys by exact match, so valid bundled
plugins can fail during startup with
Cannot require ...even when the subpathis part of an allowed first-party package surface.
Problem
lapis-notebookfails to load from its installed bundle because the bundlerequires
@lapis-notes/api/editor/extensions/class-highlighter, while theruntime dependency registry only registered package roots such as
@lapis-notes/api.Goal
External first-party plugin install bundles should load from their packaged
artifacts when all bare
require(...)entries target explicitly registeredruntime dependencies. Unknown bare modules must still fail loudly.
Scope
bundles.
PluginManagerdependency lookup exact-first and constrained to knownregistered module keys.
runtime plugin manager path.
main.jsfiles for barerequire(...)entries and fails when a requirement is not registered.Non-goals
Acceptance Criteria
lapis-notebookcan load from/.obsidian/plugins/lapis-notebookwithout aCannot require @lapis-notes/api/editor/extensions/class-highlightererror.seed manifest and dist artifacts into
/.obsidian/plugins/<id>/, enable theplugin, and assert it loads without module evaluation failures.
Cannot require.dist/main.jsfiles and fails when abare dependency is absent from the registered dependency registry.
Implementation Notes
packages/workspace/src/lib/deps.tsover heuristic resolution.
packages/api/src/lib/plugin-manager.tslookup exact-first. Any fallbackshould only return modules that are already explicit keys in the registered
dependency map.
related chunk files copied from each plugin
dist/directory.Suggested Files or Specs To Inspect
packages/workspace/src/lib/deps.tspackages/api/src/lib/plugin-manager.tspackages/api/src/lib/__tests__/plugin-manager.test.tsspec/src/30-cross-package-contracts/plugin-system/design.mdspec/src/20-packages/plugins/index.mdValidation Commands
pnpm --filter @lapis-notes/api test -- src/lib/__tests__/plugin-manager.test.tspnpm --filter @lapis-notes/api check:allpnpm --filter @lapis-notes/workspace check:allpnpm test:smokeif runtime boot behavior needs full smoke coverage.Related Issues
Follow-up Tasks
Implementation Summary
Added tracked ambient declarations for install-bundle dependency-map modules lacking package typings so API and workspace type checks pass.
Reopen Reason
Fix type-check regressions from install-bundle dependency registration.