template Svelte Themes

Template

Collection of templates for quick project scaffolding

template

Collection of templates for quick project scaffolding.

These are some templates that I frequently use to scaffold new projects.

Use degit to copy the template:

npx degit metonym/template#<branch> <project-name>
cd <project-name> && yarn

Example using the typescript template:

npx degit metonym/template#typescript typescript
cd typescript && yarn

There are five categories of templates:

  1. general purpose (prototyping)
  2. generic library (intended to be published to npm)
  3. library/framework-specific components
  4. plugins
  5. web apps

General purpose, library and plugin templates use the native Node.js assertion module for testing. They also have a "prepack" script defined for building the library before publishing to npm. Web app templates start off with only development/build scripts in order to be as light as possible.

Templates

General purpose

  • typescript: Write projects in TypeScript. Uses ts-node-dev for fast compiling and the native Node.js assert library for testing.
npx degit metonym/template#typescript typescript
cd typescript && yarn

Generic library

npx degit metonym/template#vite-lib my-vite-lib
cd my-vite-lib && yarn
npx degit metonym/template#esbuild-lib my-esbuild-lib
cd my-esbuild-lib && yarn
  • typescript-lib: The same as the typescript template but with additional npm publishing metadata.
npx degit metonym/template#typescript-lib my-typescript-lib
cd my-typescript-lib && yarn
  • bun-lib: The same as the bun-lib template but using Bun instead of Yarn/Vitest.
npx degit metonym/template#bun-lib my-bun-lib
cd my-bun-lib && yarn
  • rollup-lib: Bundle projects with Rollup to support CJS, ES, UMD output formats.
npx degit metonym/template#rollup-lib my-rollup-lib
cd my-rollup-lib && yarn

Components

  • component-svelte: Develop Svelte components using a "README-driven development" approach with Rollup.
npx degit metonym/template#component-svelte svelte-component
cd svelte-component && yarn
  • component-sveltekit: Develop Svelte components using a "README-driven development" approach with SvelteKit.
npx degit metonym/template#component-sveltekit svelte-component
cd svelte-component && yarn
npx degit metonym/template#component-library-sveltekit svelte-component
cd svelte-component && yarn
npx degit metonym/template#vite-lib-svelte my-vite-lib-svelte
cd my-vite-lib-svelte && yarn

Plugins

npx degit metonym/template#vite-plugin vite-plugin
cd vite-plugin && yarn
  • plugin-posthtml: Develop PostHTML plugins written in TypeScript. Test using vitest.
npx degit metonym/template#plugin-posthtml posthtml-template
cd posthtml-template && yarn
npx degit metonym/template#plugin-postcss postcss-template
cd postcss-template && yarn
npx degit metonym/template#svelte-preprocessor svelte-preprocess-name
cd svelte-preprocess-name && yarn
npx degit metonym/template#svelte-preprocess-bun svelte-preprocess-name
cd svelte-preprocess-name && yarn

Web apps

  • astro-bun: Build a full stack website using Bun, Astro, and Elysia.
npx degit metonym/template#astro-bun my-astro-bun
cd my-bun-site && bun install
  • astro-site: Build static sites with Astro and Svelte.
npx degit metonym/template#astro-site my-astro-site
cd my-astro-site && npm install
npx degit metonym/template#astro-svelte my-astro-svelte-app
cd my-astro-svelte-app && yarn
npx degit metonym/template#webpack-svelte my-webpack-svelte-app
cd my-webpack-svelte-app && yarn
npx degit metonym/template#webpack-svelte-lite my-webpack-svelte-lite-app
cd my-webpack-svelte-lite-app && yarn
npx degit metonym/template#rollup-svelte my-rollup-svelte-app
cd my-rollup-svelte-app && yarn
  • svite: Build Svelte apps with svite and MDsveX.
npx degit metonym/template#svite my-svite-app
cd my-svite-app && yarn
npx degit metonym/template#vite-svelte my-vite-svelte-app
cd my-vite-svelte-app && yarn
npx degit metonym/template#vite-svelte-tailwind my-vite-svelte-app
cd my-vite-svelte-app && npm i
npx degit metonym/template#sveltekit-static my-sveltekit-static-app
cd my-sveltekit-static-app && yarn

License

MIT

Top categories

Loading Svelte Themes