The Darkmatter template index for Vite+.
vp create @drkmttr reads the createConfig.templates list in
package.json and offers those templates in a picker. The Vite+ built-in
templates always appear at the end of that picker.
vp create @drkmttr # pick a template
vp create @drkmttr:monorepo # use one template directly
vp create @drkmttr --no-interactive # print the template listTo make vp create (no argument) open this picker inside a repo, add this to
the repo's root vite.config.ts:
import { defineConfig } from "vite-plus";
export default defineConfig({
create: { defaultTemplate: "@drkmttr" },
});| Name | Source |
|---|---|
monorepo |
darkmatter/template |
Add an entry to createConfig.templates in package.json. Each entry needs a
kebab-case name, a one-line description, and a template source:
github:darkmatter/<repo>for a template kept in its own public repo../templates/<name>for a template kept in this package. Also addtemplatestofilesso it is published. Vite+ copies the directory as-is and renames_gitignoreand_npmrcto their dotfile names.
Set "monorepo": true on templates that create a whole repo. Vite+ hides
those when vp create runs inside an existing monorepo.
Vite+ fails with an error when the list is invalid. To check a change before
publishing, publish it to a local registry such as
Verdaccio, point the scope at it with an .npmrc
line like @drkmttr:registry=http://127.0.0.1:4873/, and run
vp create @drkmttr --no-interactive next to that .npmrc.
Vite+ converts every scaffolded project to Vite+: it adds vite.config.ts,
rewrites lint, format, and test scripts to vp, and installs vite-plus.
Templates must still install and build after that conversion.
Bump version in package.json, then push a matching v<version> tag. The
Publish to npm workflow publishes the package with provenance through npm
trusted publishing, so the package must have darkmatter/create and the
publish.yml workflow registered as its trusted publisher on npmjs.com.