create-vitriol
v0.9.9
Published
Create Mithril + Vite projects
Downloads
632
Maintainers
Readme
create-vitriol
A scaffolding tool for creating Mithril.js projects powered by Vite.
Features
- ⚡️ Fast: Powered by Vite for lightning-fast development and building.
- 🔧 Flexible: Choose between Standard (Hyperscript) or JSX syntax.
- 📘 TypeScript: Optional TypeScript support for type safety.
- 📱 Ionic: Optional Ionic Framework integration for building mobile-ready apps.
- 🐳 DevContainer: Optional DevContainer configuration for consistent development environments.
Usage
With NPM:
npm create vitriol@latestWith Yarn:
yarn create vitriolWith PNPM:
pnpm create vitriolWith Bun:
bun create vitriolInteractive Mode
Simply run the command without arguments to start the interactive prompt. You will be asked to:
- Select a project type (Standard or JSX).
- Enter a project name (which will be the folder name).
- Choose whether to use TypeScript.
- Choose whether to include Ionic integration.
- Choose whether to include DevContainer configuration.
Command Line Arguments
You can also pass arguments directly to skip some prompts:
npm create vitriol@latest [target-dir] [options]Note: If you are using
npm createornpm init, you may need to use a double dash--to pass flags to the generator, e.g.,npm create vitriol@latest my-app -- --standard.
[target-dir]: The directory to create the project in.
Options:
--standard,--std: Use Standard (Hyperscript) template.--jsx: Use JSX template.-i,--ionic: Enable Ionic integration.--noi,--no-ionic: Disable Ionic integration (skip prompt).--dc,--devcontainer: Add DevContainer configuration.--nodc,--no-devcontainer: Disable DevContainer configuration (skip prompt).--ts,--typescript: Use TypeScript.--js,--javascript: Use JavaScript.
Examples
Create a standard Mithril project in a folder named my-app:
npm create vitriol@latest my-app -- --standardCreate a standard Mithril project with TypeScript:
npm create vitriol@latest my-app -- --standard --tsCreate a JSX Mithril project with Ionic support:
npm create vitriol@latest my-ionic-app -- --jsx --ionicTemplates
Vitriol keeps every variant in sync by sourcing shared .vitriol files from the template/ root. During scaffolding it also copies the matching markdown tutorial from template/tutorials into the generated project.
| Template | Syntax | Ionic | Tutorial source |
| --- | --- | --- | --- |
| standard | Hyperscript + JavaScript | No | template/tutorials/standard-js.md |
| standard-ts | Hyperscript + TypeScript | No | template/tutorials/standard-ts.md |
| standard-ionic | Hyperscript + JavaScript | Yes | template/tutorials/standard-ionic-js.md |
| standard-ionic-ts | Hyperscript + TypeScript | Yes | template/tutorials/standard-ionic-ts.md |
| jsx | JSX + JavaScript | No | template/tutorials/jsx-js.md |
| jsx-ts | JSX + TypeScript | No | template/tutorials/jsx-ts.md |
| jsx-ionic | JSX + JavaScript | Yes | template/tutorials/jsx-ionic-js.md |
| jsx-ionic-ts | JSX + TypeScript | Yes | template/tutorials/jsx-ionic-ts.md |
License
Tutorial
Tutorial can be found here
Developer Tutorial
Want to contribute to the generator itself? Read tutorial-dev.md for instructions on local setup, editing .vitriol templates, packaging the VS Code syntax extension, and submitting issues or pull requests.
