A template for Logseq plugins using Svelte, Vitest, Playwright, and pnpm.
Install pnpm, then you can either hit "Use this template" above or use degit:
npx degit phildenhoff/logseq-plugin-template my-ls-plugin
cd my-ls-plugin
git init
Then,
pnpm install
React: pengx17/logseq-plugin-template-react
It's a good framework! Feel free to adapt this for any other framework, in case you'd like to set up an Angular or Vue.js template.
Vitest is faster than Jest, and a better fit for unit tests than Playwright.
It allows for component/integration-level tests in your plugin.
If you don't want to use it, you can remove this line:
as well as the Playright config file, the e2e folder, the playwright workflow file in .github/actions
, and finally the @playwright/test
dev dependency in the Package.json:
When I created this, pnpm
was faster than npm
and yarn
.
bun
, my first choice, wasn't stable.
That doesn't mean you have to use it!
You are more than welcome to use another package manager instead, but you may end up with different packages than what PNPM would install for you.
So be warned, things may not work if you don't use PNPM!