Skip to content

Scaffolded plugins cannot build outside the monorepo: @instatic/plugin-sdk does not resolve #384

Description

@Mariomarquezt

docs/features/plugin-system.md:970 names @instatic/plugin-sdk as the import specifier for plugin sources, but there is no such package to resolve: node_modules/@instatic does not exist and package.json has no exports map pointing at it. A plugin developed outside the Instatic monorepo therefore cannot import the SDK by the documented specifier.

Workaround I am using: import the SDK by absolute path through a single indirection file, so the path lives in exactly one place:

// vendor-sdk.ts
export * from '/path/to/Instatic/src/core/plugin-sdk/index.ts'

My build script rewrites that one line from an INSTATIC env var before invoking the CLI. Lint, build and the sandbox scan all pass this way, so nothing is fundamentally blocked — it is just that the documented path does not work and every out-of-tree plugin has to invent the same workaround.

Either fix would do:

  • publish @instatic/plugin-sdk (or have the CLI inject a resolvable alias when it builds a directory outside the monorepo), or
  • document the monorepo-only constraint in the "Local dev with hot sync" section, so people know to expect it.

The first is obviously nicer for anyone distributing a plugin, since it also makes bun test on plugin sources work without a checkout of the whole CMS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions