source/: Official extensions, each inName.popclipextwithConfig.ts|js|json|yaml, optionalReadme.md, and assets.contrib/: Community and experimental extensions. DO NOT USE THESE AS EXAMPLES.lib/: Shared helpers published locally as@popclip/helpers.misc/: Maintenance tools (e.g.,misc/pcxconvertto migrate legacy configs).
npm run check: Type-check the repo viatsc --noEmit.npx biome check .: Lint code using Biome.npx biome format . --write: Auto-format files.misc/pcxconvert: ConvertConfig.plist→ YAML viaconvert.ts(run in an extension folder).
No bundle step is required for extensions; PopClip loads source files directly.
- Indentation: 2 spaces; formatter: Biome (see
biome.json). - Language: Prefer TypeScript; target ES2018; strict mode enabled (see
tsconfig.json). - Extension folder:
TitleCase.popclipext(e.g.,Uppercase.popclipext). - Config file:
Config.ts(orConfig.js) using@popclip/typesand@popclip/helpers. - Assets: Place alongside config; use clear names (e.g.,
icon.png).
- Required: pass
npm run checkandnpx biome check .before PR. - Manual verification: install your extension build into PopClip and confirm actions/options work.
- Optional unit tests for helper code may live next to sources (e.g.,
foo.test.ts). There is no repo-wide test runner.
- Commits: short, descriptive imperatives (e.g., "Update Kagi translate options"). Group related changes.
- PRs: include purpose, scope, user impact, and any screenshots where UI changes are relevant. Link issues when applicable.
- New extensions: submit under
contrib/Name.popclipextwithReadme.md, a concisedescriptionin Config, and a suitable icon. Follow quality criteria inREADME.md.
- Do not commit secrets or API keys. Use PopClip options for user-provided keys and document acquisition steps.
- Avoid external runtime dependencies for shell/AppleScript actions; extensions must work on stock macOS.
Extensions are self-contained modules. Config defines actions, requirements, and
metadata; shared logic belongs in lib/@popclip/helpers to reduce duplication.