Skip to content

Extension Tooling Maintenance ​

This page is for core developers maintaining picloom, picloom-tooling, and picloom-extensions. To build standalone plugins or themes, see Plugin Quick Start and Theme Quick Start.

Package Structure & Responsibilities ​

Shared SDKs, validation rules, and project scaffolds live in the picloom-tooling repository (Bun 1.4.5+):

Directorynpm PackageResponsibility
package-rules@picloom/package-rulesShared package identity/version, asset path, localization, config schema, and validation rules for plugins and themes
plugin-sdk@picloom/plugin-sdkPlugin declaration (definePlugin), runtime contracts, PluginError, file/HTTP/scan helpers, and unit test utilities
theme-sdk@picloom/theme-sdkTheme declaration (defineTheme), browser-only runtime contracts, clipboard/byte helpers, and Vue composables
tools/plugin-tools@picloom/plugin-toolsCLI for plugin manifest extraction, offline structure checks, and ZIP packaging
tools/theme-tools@picloom/theme-toolsCLI for local mock preview, offline validation, Vite build, and ZIP packaging
tools/create-plugin@picloom/create-pluginbun create @picloom/plugin scaffold and template/ source files
tools/create-theme@picloom/create-themebun create @picloom/theme scaffold and template/ source files

@picloom/theme-sdk is a browser-only contract and must not import @picloom/plugin-sdk or server runtime code. During build, tools/create-theme/template/ generates dist/template/ with the repository root LICENSE via prepare.ts; update template/ directly and never edit dist/template/ by hand.

Local Packaging & Cross-Repo Sync ​

Build, typecheck, and test in picloom-tooling, then sync all 7 packages to adjacent consumer repositories (or generated standalone plugin/theme directories):

sh
cd ../picloom-tooling
bun install --frozen-lockfile
bun run build && bun run typecheck && bun test ./tests
bun run dev:sync -- ../picloom ../picloom-extensions

dev:sync builds first, packs all 7 packages as content-hashed .tgz archives under .local-packages/ in each target repository, updates package.json in the target repository and its workspaces, and runs bun install automatically.

Before ending local development or committing code, switch back to published npm versions and refresh lockfiles in target repositories:

sh
bun run dev:registry -- ../picloom ../picloom-extensions
cd ../picloom && bun install
cd ../picloom-extensions && bun install

dev:registry only restores exact version numbers in package.json and does not run install; you must run bun install in each target repository to update bun.lock (tests/ci-release.test.ts in the main repository rejects leftover .local-packages references).

Standalone Project & Example Verification ​

Run end-to-end tooling verification from the picloom main repository (reads adjacent ../picloom-tooling by default, or set PICLOOM_TOOLING_DIR):

sh
bun run test:plugin-tooling  # Requires network; verifies scaffold, types, packaging, and isolated host install/upload/processing in clean Bun PATH
bun run test:theme-tooling   # Requires network and Playwright Chromium; verifies scaffold, local preview, build, and host install

The 5 plugin examples under examples/ (path, storage, processor, access, post-save) are packaged to outputs/examples/*.zip by examples/build.ts via @picloom/plugin-tools. After editing examples or SDK contracts, run:

sh
bun run build:examples && bun test tests/examples.test.ts

npm Publishing Order ​

Before publishing, inspect each package's file list with bun pm pack --dry-run and publish in dependency order:

  1. Publish @picloom/package-rules.
  2. Update dependency versions, build and test, then publish @picloom/plugin-sdk, @picloom/theme-sdk, @picloom/plugin-tools, and @picloom/theme-tools.
  3. Update pinned dependency versions in tools/create-plugin/template/package.json and tools/create-theme/template/package.json (and review template README.md if templates changed), run bun run build to refresh create-theme/dist/template/, then publish @picloom/create-plugin and @picloom/create-theme.
  4. Run bun run dev:registry -- ../picloom ../picloom-extensions, run bun install in picloom and picloom-extensions to produce clean bun.lock files, and test bun create in an empty directory.