An opinionated starter template for building Logseq plugins with TypeScript, Vite, Bun, and Biome.
- TypeScript + Vite build, configured for Logseq via
vite-plugin-logseqso HMR works while you develop the plugin against a live Logseq instance. - Bun as the package manager and script runner.
- Biome for formatting and linting (replaces ESLint + Prettier).
- Husky pre-commit hook that runs
biome check --writeandtsc --noEmit. - GitHub Actions workflow that builds the plugin and cuts a release via
semantic-release(zip bundled for the Logseq marketplace). - Minimal
src/entry that wires up@logseq/libs, a settings schema, and a popup helper (Esc / click-outside to close).
- Click Use this template on GitHub (or clone the repo).
- Rename
gh actions/to.github/. GitHub only picks up workflows from the.github/directory; the folder is shipped under a different name so the template repo itself does not run the publish workflow. - Replace every
<insert-plugin-name>placeholder inpackage.json(name,logseq.id,logseq.title, and thereleaseasset) with your plugin's id. - Add an
icon.svgto the project root. - Update this README's overview / usage sections for your plugin.
bun install
bun run devbun run dev starts Vite in dev mode. In Logseq, enable Developer mode, then Load unpacked plugin and point it at this project root. Thanks to vite-plugin-logseq, edits to src/ hot-reload inside Logseq without a full plugin reload.
bun run buildOutputs to dist/. The packaged plugin entry is dist/index.html (see logseq.main in package.json).
Push to main. The workflow in .github/workflows/publish.yml will:
- Build with Bun.
- Bundle
README.md,package.json,icon.svg, anddist/into<plugin-name>.zip. - Run
semantic-releaseto create a GitHub Release with the zip attached — ready for the Logseq marketplace.
Conventional commits drive the version bumps.
- Biome over ESLint/Prettier. One tool, one config (
biome.json), much faster. Linter recommended rules are off in favour of a hand-picked set; tweakbiome.jsonto taste. - Bun over npm/pnpm. Scripts call
bunxdirectly. If you prefer npm, swapbunxfornpxinpackage.json. vite-plugin-logseqfor HMR. It rewrites asset paths so the dev server can serve the plugin straight into Logseq — much nicer than rebuilding and reloading the unpacked plugin on every change.- DB-graph aware.
src/index.tscallslogseq.App.checkCurrentIsDbGraph()so you can branch behaviour for the new DB version vs. the file-based graph. - Popup ergonomics.
src/handle-popup.tswires up Esc and click-outside to dismisslogseq.showMainUI()popups — drop it if you're not building a popup-style plugin.
src/
index.ts # plugin entry, registers settings + main()
settings.ts # SettingSchemaDesc array
handle-popup.ts # Esc / click-outside dismiss helpers
index.html # Vite entry consumed by Logseq
vite.config.ts # registers vite-plugin-logseq
biome.json # formatter + linter config
gh actions/ # rename to .github/ after templating
MIT