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+):
| Directory | npm Package | Responsibility |
|---|---|---|
package-rules | @picloom/package-rules | Shared package identity/version, asset path, localization, config schema, and validation rules for plugins and themes |
plugin-sdk | @picloom/plugin-sdk | Plugin declaration (definePlugin), runtime contracts, PluginError, file/HTTP/scan helpers, and unit test utilities |
theme-sdk | @picloom/theme-sdk | Theme declaration (defineTheme), browser-only runtime contracts, clipboard/byte helpers, and Vue composables |
tools/plugin-tools | @picloom/plugin-tools | CLI for plugin manifest extraction, offline structure checks, and ZIP packaging |
tools/theme-tools | @picloom/theme-tools | CLI for local mock preview, offline validation, Vite build, and ZIP packaging |
tools/create-plugin | @picloom/create-plugin | bun create @picloom/plugin scaffold and template/ source files |
tools/create-theme | @picloom/create-theme | bun 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):
cd ../picloom-tooling
bun install --frozen-lockfile
bun run build && bun run typecheck && bun test ./tests
bun run dev:sync -- ../picloom ../picloom-extensionsdev: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:
bun run dev:registry -- ../picloom ../picloom-extensions
cd ../picloom && bun install
cd ../picloom-extensions && bun installdev: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):
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 installThe 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:
bun run build:examples && bun test tests/examples.test.tsnpm Publishing Order
Before publishing, inspect each package's file list with bun pm pack --dry-run and publish in dependency order:
- Publish
@picloom/package-rules. - Update dependency versions, build and test, then publish
@picloom/plugin-sdk,@picloom/theme-sdk,@picloom/plugin-tools, and@picloom/theme-tools. - Update pinned dependency versions in
tools/create-plugin/template/package.jsonandtools/create-theme/template/package.json(and review templateREADME.mdif templates changed), runbun run buildto refreshcreate-theme/dist/template/, then publish@picloom/create-pluginand@picloom/create-theme. - Run
bun run dev:registry -- ../picloom ../picloom-extensions, runbun installinpicloomandpicloom-extensionsto produce cleanbun.lockfiles, and testbun createin an empty directory.