create-sofast-extension
v0.0.3
Published
Scaffold a Sofast extension UI project using Vite.
Readme
create-sofast-extension
Scaffold a Sofast extension UI project with Vite, supporting React, Vue, or no framework.
Usage
npm create sofast-extensionWhat you get
- UI build via
vite.config.ts(base./, single bundle,outDir: dist). package.jsonwith top-levelcommandsmanifest, and dev/build/preview scripts.
Templates
- File-based templates live under
extensions/create_extension/templates:common/: shared files (e.g.,vite.worker.config.ts.tpl, with__EXT__placeholder).common-ts/andcommon-js/: language-specific shared files (e.g., worker sample).<framework>/<ts|js>/: React/Vue/Empty UI templates and configs.
Placeholders
__EXT__: replaced withtsorjs.__PKG_NAME__: replaced with the package/directory name.__DISPLAY_NAME__: replaced with the human-friendly title (defaults to Title Case of package name, or provided via--title).__UI_ENTRY__: replaced with the UI entry file (defaults toindex.html).__FRAMEWORK__: replaced with the chosen framework id.
Tailwind option
- Flags:
--tailwindor--no-tailwind(interactive when omitted). - Default: Yes.
- When enabled:
- Adds
@tailwindcss/viteandtailwindcssdeps. - Populates Vite
pluginswithtailwindcss()via template placeholders.
- Adds
Notes
- The scaffold does not include
@sofast/apidependency in the template by default (package not yet published). Add it yourself when needed.
