Monorepo of CodeExpander plugins, managed with pnpm workspaces.
- packages/ui — Shared Tailwind + shadcn-style UI components used by plugins.
- packages/i18n — Minimal i18n helpers (
getLocale,t) for plugin locales. - packages/plugin-text … packages/plugin-ai — CodeExpander plugin packages (one per category). Each builds to a
dist/folder withplugin.json,index.html, and assets.
| Command | Description |
|---|---|
pnpm install |
Install all workspace dependencies. |
pnpm run dev |
Start the default plugin dev server. Use make dev to pick a plugin interactively, or make dev PLUGIN=plugin-html to specify one. |
pnpm run build |
Build all packages. |
pnpm --filter @codeexpander/plugin-text run build |
Build a single plugin. |
pnpm run build:plugins |
Build all plugin packages only (pnpm --filter './packages/plugin-*' run build). |
pnpm run publish:plugins |
Build and publish all plugins to npm in sequence (package names: @codeexpander/plugin-*). |
Plugin packages use the @codeexpander/plugin-* scope (e.g. @codeexpander/plugin-text). After publishing to npm, they can be installed via CodeExpander’s npm install flow.
Before publishing
- Log in to npm:
npm login(requires@codeexpanderorg access or your own scope). - Optional — bump versions (e.g.
0.1.0→0.2.0):pnpm --filter './packages/plugin-*' exec -- npm version patch --no-git-tag-version
Publish
pnpm run publish:pluginsThis will: build all plugins (build:plugins), then run pnpm publish for each plugin (with --no-git-checks). Published content is each package’s dist/ (including plugin.json, index.html, and assets).
To publish a single plugin:
pnpm --filter @codeexpander/plugin-text run build
cd packages/plugin-text && pnpm publish --no-git-checksRun the plugin UI in the browser with hot reload. Copy/Toast use fallbacks (e.g. navigator.clipboard) when not running inside CodeExpander.
cd packages/plugin-text && pnpm run dev
# or from repo root:
pnpm --filter @codeexpander/plugin-text run devOpen the URL shown in the terminal (e.g. http://localhost:5173) to see the plugin’s multi-tab tools UI (no “Back to Tools” shell, just the plugin).
Verify behavior in the real host (e.g. writeClipboard, showToast, i18n).
-
Build
pnpm --filter @codeexpander/plugin-text run build # or all plugins: pnpm run build:plugins -
Import in CodeExpander
- Open CodeExpander → Settings or Plugin Hub
- Choose Import from directory
- Select the plugin’s dist folder, e.g.:
packages/plugin-text/distpackages/plugin-html/dist
-
Verify
- Search or open the plugin (e.g. “Text Tools”) in CodeExpander.
- You should see only the plugin content: tabs for each tool (Word Counter, Text Diff, etc.), no “Back to Tools”.
- Test copy, Toast, and locale (if
initialPayload.localeis passed).
- Build the plugin:
pnpm --filter @codeexpander/plugin-text run build. - In CodeExpander: Settings or Plugin Hub → Import from directory.
- Select the plugin’s
distfolder (e.g.packages/plugin-text/dist). It must containplugin.jsonand the entry file (index.html).
Plugins support multiple languages (en, zh) via initialPayload.locale or browser locale.