@minimact/swig
v1.0.1
Published
CLI tool for Minimact development - Create, transpile, and run Minimact applications
Maintainers
Readme
@minimact/swig
CLI tool for Minimact development - Create, transpile, and run Minimact applications.
Installation
npm install -g @minimact/swig
# or use npx
npx @minimact/swig <command>Commands
swig install
Install Minimact Swig GUI to AppData.
swig install # Install Swig GUI
swig install --force # Force reinstallThe GUI is installed to:
- Windows:
%APPDATA%\minimact-swig - macOS:
~/Library/Application Support/minimact-swig - Linux:
~/.local/share/minimact-swig
swig launch
Launch the Minimact Swig GUI.
swig launchswig new
Create a new Minimact project.
swig new <template> <name>
# Examples
swig new counter MyCounterApp
swig new mvc MyMvcApp --tailwind
swig new dashboard MyDashboard --hooks useState,useEffectTemplates:
counter- Simple counter apptodolist- Todo list appdashboard- Dashboard with chartsmvc- MVC Bridge patternmvc-dashboard- MVC + Dashboard
Options:
--tailwind- Enable Tailwind CSS--no-solution- Skip creating .sln file--hooks <hooks>- Comma-separated list of hook examples
swig transpile
Transpile TSX files to C#.
swig transpile # Transpile entire project
swig transpile Pages/CounterPage.tsx # Transpile specific file
swig transpile Pages/**/*.tsx # Transpile multiple filesOptions:
-p, --project <path>- Project root directory (default: current directory)
swig run
Run the ASP.NET Core application.
swig run # Build and run
swig run --no-build # Run without building
swig run --port 3000 # Run on custom portOptions:
--port <port>- Port number (default: 5000)--no-build- Skip dotnet build
swig watch
Watch for TSX changes and auto-transpile.
swig watchOptions:
-p, --project <path>- Project root directory (default: current directory)
Workflow Examples
Quick Start
# Create new project
npx @minimact/swig new counter MyApp
# Navigate to project
cd MyApp
# Watch for changes and run
npx @minimact/swig watch # Terminal 1
npx @minimact/swig run # Terminal 2Using the GUI
# Install Swig GUI (one-time)
npx @minimact/swig install
# Launch GUI
npx @minimact/swig launchCI/CD
# In your CI/CD pipeline
npx @minimact/swig transpile # Transpile TSX to C#
dotnet build # Build the project
dotnet test # Run testsArchitecture
@minimact/swig is a lightweight CLI wrapper around @minimact/swig-shared, which contains the core services:
- ProjectManager - Create and manage projects
- TranspilerService - Transpile TSX to C# using babel-plugin-minimact
- FileWatcher - Watch files and trigger auto-transpilation
The same services power both the CLI and the Swig Electron GUI.
Requirements
- Node.js 18+
- .NET 9.0 SDK
- Git (for
swig install)
License
MIT
