sweetweb-cli
v1.2.6
Published
The official compiler for SweetWeb (.sw) - A domain-specific language for rapid full-stack web development.
Maintainers
Readme
SweetWeb CLI
The official command-line compiler for SweetWeb (.sw).
Installation
npm install -g sweetweb-cliUsage
Create a new project
sweetweb new my-app
cd my-appBuild your project
sweetweb build site.swThis will compile your .sw files into a dist/ folder containing standard HTML, CSS, and JS.
Syntax Cheat Sheet
Structure
[stack]: Vertical layout (Column)[row]: Horizontal layout (Row)[grid columns 3]: Grid layout
Scripts & Styles (v4.3)
[js link "utils.js"]: Link external JavaScript[css link "style.css"]: Link external CSS[js] console.log("Inline") [/js]: Inline Block[css] body { background: red } [/css]: Inline Block
Basic Elements
[text "Hello"][button "Click Me" link "/about"][input placeholder "Type..."][image "url"]
Web Components
[view "https://example.com" width "100%" height 500][youtube "VIDEO_ID"][badge "New"][avatar "image_url"]
Backend API
[api "/user/:id"] ... [/api]: Define serverless functions.[api "/py" lang "python"]: Define Python endpoints.
Features
- Zero Config: Just run build.
- Component System: Import reuseable parts.
- Server Functions: Automatically generates serverless function files.
- Modern UI: Built-in support for Grid, Stack, Alerts, and more.
