/logseq-plugin-template-svelte

A template for a Logseq plugins using Vitest, Svelte, and Playwright

Primary LanguageTypeScript

Logseq Plugin template for Svelte

A template for Logseq plugins using Svelte, Vitest, Playwright, and pnpm.

Getting set up

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

Templates for other frameworks

React: pengx17/logseq-plugin-template-react

Technical choices

Why Svelte?

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.

Why use Vitest?

Vitest is faster than Jest, and a better fit for unit tests than Playwright.

Why include Playwright?

It allows for component/integration-level tests in your plugin.

If you don't want to use it, you can remove this line:

"test:e2e": "playwright test",

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:

"@playwright/test": "^1.27.0",

Why pnpm instead of X?

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!