wozie 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOCS.md +191 -0
- package/README.md +53 -0
- package/bin/woozie.js +255 -0
- package/docs/elements.md +506 -0
- package/docs/hosting.md +69 -0
- package/docs/install.md +74 -0
- package/editor/woozie-syntax/icons/comet.svg +17 -0
- package/editor/woozie-syntax/icons/woozie-build.svg +19 -0
- package/editor/woozie-syntax/icons/woozie-folder.svg +13 -0
- package/editor/woozie-syntax/icons/woozie-pages.svg +21 -0
- package/editor/woozie-syntax/icons/woozie-plugin.svg +18 -0
- package/editor/woozie-syntax/icons/woozie-rules.svg +23 -0
- package/editor/woozie-syntax/icons/woozie-style.svg +19 -0
- package/editor/woozie-syntax/icons/woozie.svg +19 -0
- package/editor/woozie-syntax/language-configuration.json +23 -0
- package/editor/woozie-syntax/package.json +43 -0
- package/editor/woozie-syntax/syntaxes/woozie.tmLanguage.json +120 -0
- package/editor/woozie-syntax/themes/woozie-icons.json +53 -0
- package/package.json +47 -0
- package/scripts/install.sh +20 -0
- package/scripts/postinstall.js +29 -0
- package/src/comet/registry.js +105 -0
- package/src/core/compiler.js +246 -0
- package/src/core/generator.js +166 -0
- package/src/core/parser.js +87 -0
- package/src/core/server.js +112 -0
- package/src/runtime/client.js +117 -0
- package/src/runtime/router.js +49 -0
- package/src/styles/base.css +79 -0
- package/src/styles/components.css +135 -0
- package/src/styles/controls.css +110 -0
- package/src/styles/interactive.css +111 -0
- package/src/styles/layout.css +72 -0
package/DOCS.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Woozie ā The Easiest Web Framework Ever š
|
|
2
|
+
|
|
3
|
+
**Built by Woozlit 2026 ā v2.0**
|
|
4
|
+
|
|
5
|
+
Write simple tags. Get beautiful, responsive websites. No HTML, no CSS, no JavaScript required.
|
|
6
|
+
|
|
7
|
+
## What is Woozie?
|
|
8
|
+
|
|
9
|
+
Woozie is a declarative UI language that compiles to modern HTML/CSS/JS. It has **40+ built-in components**, a **plugin system**, **dark mode**, **style files**, and **multi-file output** ā all with zero configuration.
|
|
10
|
+
|
|
11
|
+
```woozie
|
|
12
|
+
app "My App":
|
|
13
|
+
hero "Hello World":
|
|
14
|
+
text "Built with Woozie"
|
|
15
|
+
button "Get Started"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That's a full website. Seriously.
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git clone <repo-url>
|
|
24
|
+
cd woozie
|
|
25
|
+
npm install
|
|
26
|
+
npm link
|
|
27
|
+
|
|
28
|
+
woozie init MyProject
|
|
29
|
+
cd MyProject
|
|
30
|
+
woozie run
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Open http://localhost:3000 and see your app with live reload.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
| Feature | Description |
|
|
38
|
+
|---------|-------------|
|
|
39
|
+
| **40+ Components** | Buttons, cards, forms, modals, tabs, accordions, alerts, stats, and more |
|
|
40
|
+
| **Style Files** | Customize any component via `style.woozie` |
|
|
41
|
+
| **Dark Mode** | Set `theme: dark` in `woozie.rules` |
|
|
42
|
+
| **Plugins** | Drop a `.woozie` file in `plugins/` ā it becomes a tag |
|
|
43
|
+
| **Live Reload** | Dev server watches files and reloads instantly |
|
|
44
|
+
| **Multi-File Output** | Generates separate HTML, CSS, JS files |
|
|
45
|
+
| **Responsive** | Every component is mobile-friendly |
|
|
46
|
+
| **Animations** | Scroll animations, hover effects, transitions |
|
|
47
|
+
| **Attributes** | `button "Click" [variant=outline, color=success]` |
|
|
48
|
+
| **Comments** | `// This is a comment` |
|
|
49
|
+
| **Zero Config** | No webpack, no babel, no config files |
|
|
50
|
+
|
|
51
|
+
## Project Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
my-project/
|
|
55
|
+
main.woozie <- entry point (your app)
|
|
56
|
+
woozie.rules <- config (NO COMMENTS allowed)
|
|
57
|
+
style.woozie <- custom style overrides (optional)
|
|
58
|
+
plugins/ <- custom components (optional)
|
|
59
|
+
navbar.woozie
|
|
60
|
+
sidebar.woozie
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Syntax
|
|
64
|
+
|
|
65
|
+
Woozie is indentation-based. Tags can have string arguments and attributes:
|
|
66
|
+
|
|
67
|
+
```woozie
|
|
68
|
+
tagname "argument" [attr1=value1, attr2=value2]:
|
|
69
|
+
child_tag "child argument"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
A colon `:` at the end means the tag has children (indent them below).
|
|
73
|
+
|
|
74
|
+
## Components
|
|
75
|
+
|
|
76
|
+
### Layout
|
|
77
|
+
`column` `row` `grid [cols=N]` `center` `container` `section` `spacer` `divider` `wrap`
|
|
78
|
+
|
|
79
|
+
### Typography
|
|
80
|
+
`heading` `subheading` `text` `small` `bold` `italic` `label` `link [href=URL]` `code` `quote`
|
|
81
|
+
|
|
82
|
+
### Interactive
|
|
83
|
+
`button [variant=solid|outline|ghost, color=primary|success|warning|danger, size=sm|md|lg]`
|
|
84
|
+
`input [type=text|email|password]` `textarea [rows=N]` `select`/`option` `toggle` `checkbox` `radio [name=group]` `slider [min=0, max=100]` `dropdown`
|
|
85
|
+
|
|
86
|
+
### Media
|
|
87
|
+
`image "url"` `video "url"` `audio "url"` `icon "emoji"` `avatar "url"`
|
|
88
|
+
|
|
89
|
+
### Feedback
|
|
90
|
+
`alert "msg" [type=info|success|warning|error]` `badge "text" [color=X]` `progress "75"` `spinner` `tooltip [text=X]`
|
|
91
|
+
|
|
92
|
+
### Navigation
|
|
93
|
+
`nav` `navlink "text" [href=URL]` `tabs`/`tab "Label"` `breadcrumb` `menu`
|
|
94
|
+
|
|
95
|
+
### Data
|
|
96
|
+
`table` `list [type=ordered]` `listitem "text"` `stat "value" [label=Label]`
|
|
97
|
+
|
|
98
|
+
### Containers
|
|
99
|
+
`card` `modal [id=X]` `accordion`/`accordion_item "Title"` `hero "Title"` `header` `footer`
|
|
100
|
+
|
|
101
|
+
## Rules File (woozie.rules)
|
|
102
|
+
|
|
103
|
+
Configuration file. **NO COMMENTS ALLOWED.**
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
version: 2.0
|
|
107
|
+
theme: light
|
|
108
|
+
title: My App
|
|
109
|
+
font: Inter
|
|
110
|
+
color: #6366f1
|
|
111
|
+
lang: en
|
|
112
|
+
favicon: icon.png
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Key | Values | Default |
|
|
116
|
+
|-----|--------|---------|
|
|
117
|
+
| `version` | Any | `2.0` |
|
|
118
|
+
| `theme` | `light`, `dark` | `light` |
|
|
119
|
+
| `title` | Any string | `Woozie App` |
|
|
120
|
+
| `font` | Google Font name | `Inter` |
|
|
121
|
+
| `color` | Hex color | `#6366f1` |
|
|
122
|
+
| `lang` | Language code | `en` |
|
|
123
|
+
| `favicon` | Path or URL | (none) |
|
|
124
|
+
|
|
125
|
+
## Style File (style.woozie)
|
|
126
|
+
|
|
127
|
+
Override any component's CSS:
|
|
128
|
+
|
|
129
|
+
```woozie
|
|
130
|
+
// Comments ARE allowed in style.woozie
|
|
131
|
+
button:
|
|
132
|
+
border-radius: 8px
|
|
133
|
+
font-size: 1rem
|
|
134
|
+
|
|
135
|
+
card:
|
|
136
|
+
border: 2px solid #e2e8f0
|
|
137
|
+
padding: 3rem
|
|
138
|
+
|
|
139
|
+
hero:
|
|
140
|
+
padding: 8rem 2rem
|
|
141
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Selector names match Woozie element names. Properties are standard CSS.
|
|
145
|
+
|
|
146
|
+
## Plugins
|
|
147
|
+
|
|
148
|
+
Create `plugins/pricing.woozie`:
|
|
149
|
+
```woozie
|
|
150
|
+
card:
|
|
151
|
+
subheading "Pro Plan"
|
|
152
|
+
text "$9/month"
|
|
153
|
+
list:
|
|
154
|
+
listitem "Unlimited projects"
|
|
155
|
+
listitem "Priority support"
|
|
156
|
+
button "Subscribe" [variant=solid]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Use it in `main.woozie`:
|
|
160
|
+
```woozie
|
|
161
|
+
app "My App":
|
|
162
|
+
pricing:
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## CLI Commands
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
woozie init <name> Create a new project
|
|
169
|
+
woozie run Start dev server with live reload
|
|
170
|
+
woozie dev Alias for run
|
|
171
|
+
woozie build Compile to static dist/ folder
|
|
172
|
+
--port <n> Custom port (default: 3000)
|
|
173
|
+
--output <path> Custom output path
|
|
174
|
+
--help Show help
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Documentation
|
|
178
|
+
|
|
179
|
+
- [Element Reference](docs/elements.md) ā Every component with examples
|
|
180
|
+
- [Installation Guide](docs/install.md) ā How to install and set up
|
|
181
|
+
- [Hosting Guide](docs/hosting.md) ā How to deploy your Woozie app
|
|
182
|
+
|
|
183
|
+
## VS Code Extension
|
|
184
|
+
|
|
185
|
+
Install syntax highlighting from `editor/woozie-syntax/`:
|
|
186
|
+
```bash
|
|
187
|
+
cd editor/woozie-syntax
|
|
188
|
+
# Install in VS Code via Extensions > Install from VSIX
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Features: syntax highlighting, auto-indent, comment toggling, bracket matching.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Woozie 2.0 š
|
|
2
|
+
|
|
3
|
+
The easiest web framework ever - now powered by Node.js.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### From NPM
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g woozie
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### From URL (Simulated)
|
|
13
|
+
```bash
|
|
14
|
+
./scripts/install.sh
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Create a Project
|
|
20
|
+
```bash
|
|
21
|
+
woozie init my-app
|
|
22
|
+
cd my-app
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Run Dev Server
|
|
26
|
+
```bash
|
|
27
|
+
woozie run
|
|
28
|
+
```
|
|
29
|
+
Starts server at `http://localhost:3000`.
|
|
30
|
+
|
|
31
|
+
### Build for Production
|
|
32
|
+
```bash
|
|
33
|
+
woozie build
|
|
34
|
+
```
|
|
35
|
+
Creates `dist/index.html`.
|
|
36
|
+
|
|
37
|
+
## New Features
|
|
38
|
+
- **No Python**: Pure Node.js.
|
|
39
|
+
- **Modern UI**: Glassmorphism, gradients, and sleek typography out of the box.
|
|
40
|
+
- **TailwindCSS**: Use `tailwindcss:` tag to enable.
|
|
41
|
+
- **Workers**: Use `worker "script.js"` to spawn Web Workers.
|
|
42
|
+
- **URL Plugins**: Import plugins from URLs in `woozie.imports`.
|
|
43
|
+
|
|
44
|
+
## Example `main.woozie`
|
|
45
|
+
|
|
46
|
+
```woozie
|
|
47
|
+
app "My Modern App":
|
|
48
|
+
tailwindcss:
|
|
49
|
+
column:
|
|
50
|
+
card:
|
|
51
|
+
text "Hello Woozie 2.0"
|
|
52
|
+
button "Click Me"
|
|
53
|
+
```
|
package/bin/woozie.js
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import arg from 'arg';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { WoozieCompiler } from '../src/core/compiler.js';
|
|
9
|
+
import { WoozieServer } from '../src/core/server.js';
|
|
10
|
+
import { CometRegistry } from '../src/comet/registry.js';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
|
|
15
|
+
const args = arg({
|
|
16
|
+
'--port': Number,
|
|
17
|
+
'--output': String,
|
|
18
|
+
'--help': Boolean
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const command = args._[0];
|
|
22
|
+
|
|
23
|
+
if (!command || args['--help']) {
|
|
24
|
+
console.log(`
|
|
25
|
+
Woozie CLI v3.0 ā The easiest web framework š
|
|
26
|
+
Usage: woozie <command> [options]
|
|
27
|
+
|
|
28
|
+
Commands:
|
|
29
|
+
init <name> Create a new project (with syntax highlighting)
|
|
30
|
+
run Start dev server (alias: dev)
|
|
31
|
+
build Compile to static files
|
|
32
|
+
syntax Install VS Code syntax highlighting
|
|
33
|
+
|
|
34
|
+
comet init <name> Create a new CometUI package
|
|
35
|
+
comet add <path> Install a local CometUI package
|
|
36
|
+
comet list List installed CometUI packages
|
|
37
|
+
comet remove <name> Remove a CometUI package
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
--port <n> Port for dev server (default: 3000)
|
|
41
|
+
--output <f> Output dir for build (default: dist/index.html)
|
|
42
|
+
`);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const cwd = process.cwd();
|
|
47
|
+
|
|
48
|
+
async function main() {
|
|
49
|
+
if (command === 'init') {
|
|
50
|
+
const name = args._[1];
|
|
51
|
+
if (!name) { console.error("Please specify a project name."); process.exit(1); }
|
|
52
|
+
|
|
53
|
+
console.log(`⨠Creating Woozie project: ${name}...`);
|
|
54
|
+
const projectDir = path.join(cwd, name);
|
|
55
|
+
fs.mkdirSync(path.join(projectDir, 'plugins'), { recursive: true });
|
|
56
|
+
fs.mkdirSync(path.join(projectDir, 'pages'), { recursive: true });
|
|
57
|
+
|
|
58
|
+
fs.writeFileSync(path.join(projectDir, 'main.woozie'),
|
|
59
|
+
`app "${name}":
|
|
60
|
+
nav:
|
|
61
|
+
navlink "Home" [page=index]
|
|
62
|
+
navlink "About" [page=about]
|
|
63
|
+
navlink "Contact" [page=contact]
|
|
64
|
+
|
|
65
|
+
hero "Welcome to ${name}":
|
|
66
|
+
text "Built with Woozie ā the easiest web framework"
|
|
67
|
+
row:
|
|
68
|
+
button "Get Started" [variant=solid]
|
|
69
|
+
button "About Us" [variant=outline, page=about]
|
|
70
|
+
|
|
71
|
+
section:
|
|
72
|
+
heading "Features"
|
|
73
|
+
grid [cols=3]:
|
|
74
|
+
card:
|
|
75
|
+
icon "ā”"
|
|
76
|
+
subheading "Fast"
|
|
77
|
+
text "Compiles in milliseconds"
|
|
78
|
+
card:
|
|
79
|
+
icon "šØ"
|
|
80
|
+
subheading "Beautiful"
|
|
81
|
+
text "Stunning UI out of the box"
|
|
82
|
+
card:
|
|
83
|
+
icon "š"
|
|
84
|
+
subheading "Extensible"
|
|
85
|
+
text "CometUI plugin system for community libraries"
|
|
86
|
+
|
|
87
|
+
footer:
|
|
88
|
+
text "Built with Woozie 3.0"
|
|
89
|
+
`);
|
|
90
|
+
|
|
91
|
+
fs.writeFileSync(path.join(projectDir, 'pages', 'about.woozie'),
|
|
92
|
+
`app "${name} ā About":
|
|
93
|
+
nav:
|
|
94
|
+
navlink "Home" [page=index]
|
|
95
|
+
navlink "About" [page=about]
|
|
96
|
+
navlink "Contact" [page=contact]
|
|
97
|
+
|
|
98
|
+
section:
|
|
99
|
+
heading "About"
|
|
100
|
+
text "This project was built with Woozie, the easiest web framework."
|
|
101
|
+
|
|
102
|
+
footer:
|
|
103
|
+
text "Built with Woozie 3.0"
|
|
104
|
+
`);
|
|
105
|
+
|
|
106
|
+
fs.writeFileSync(path.join(projectDir, 'pages', 'contact.woozie'),
|
|
107
|
+
`app "${name} ā Contact":
|
|
108
|
+
nav:
|
|
109
|
+
navlink "Home" [page=index]
|
|
110
|
+
navlink "About" [page=about]
|
|
111
|
+
navlink "Contact" [page=contact]
|
|
112
|
+
|
|
113
|
+
section:
|
|
114
|
+
heading "Contact Us"
|
|
115
|
+
column:
|
|
116
|
+
input "Your name" [type=text]
|
|
117
|
+
input "Your email" [type=email]
|
|
118
|
+
textarea "Your message"
|
|
119
|
+
button "Send Message" [variant=solid]
|
|
120
|
+
|
|
121
|
+
footer:
|
|
122
|
+
text "Built with Woozie 3.0"
|
|
123
|
+
`);
|
|
124
|
+
|
|
125
|
+
fs.writeFileSync(path.join(projectDir, 'woozie.rules'),
|
|
126
|
+
`version: 3.0
|
|
127
|
+
theme: light
|
|
128
|
+
title: ${name}
|
|
129
|
+
font: Inter
|
|
130
|
+
`);
|
|
131
|
+
|
|
132
|
+
fs.writeFileSync(path.join(projectDir, 'style.woozie'),
|
|
133
|
+
`// Custom styles for ${name}
|
|
134
|
+
hero:
|
|
135
|
+
padding: 6rem 2rem
|
|
136
|
+
|
|
137
|
+
card:
|
|
138
|
+
text-align: center
|
|
139
|
+
`);
|
|
140
|
+
|
|
141
|
+
// Create .vscode workspace config with extension recommendation
|
|
142
|
+
fs.mkdirSync(path.join(projectDir, '.vscode'), { recursive: true });
|
|
143
|
+
fs.writeFileSync(path.join(projectDir, '.vscode', 'extensions.json'),
|
|
144
|
+
JSON.stringify({
|
|
145
|
+
recommendations: ['woozlit.woozie-syntax']
|
|
146
|
+
}, null, 4) + '\n');
|
|
147
|
+
fs.writeFileSync(path.join(projectDir, '.vscode', 'settings.json'),
|
|
148
|
+
JSON.stringify({
|
|
149
|
+
'files.associations': { '*.woozie': 'woozie' },
|
|
150
|
+
'editor.tabSize': 4,
|
|
151
|
+
'editor.insertSpaces': true
|
|
152
|
+
}, null, 4) + '\n');
|
|
153
|
+
|
|
154
|
+
// Auto-install syntax extension
|
|
155
|
+
installSyntax(true);
|
|
156
|
+
|
|
157
|
+
console.log(`\nā
Project created! Next steps:\n`);
|
|
158
|
+
console.log(` cd ${name}`);
|
|
159
|
+
console.log(` woozie run\n`);
|
|
160
|
+
|
|
161
|
+
} else if (command === 'run' || command === 'dev') {
|
|
162
|
+
const port = args['--port'] || 3000;
|
|
163
|
+
const server = new WoozieServer(port);
|
|
164
|
+
await server.start(cwd);
|
|
165
|
+
|
|
166
|
+
} else if (command === 'build') {
|
|
167
|
+
const output = args['--output'] || 'dist/index.html';
|
|
168
|
+
const compiler = new WoozieCompiler();
|
|
169
|
+
try {
|
|
170
|
+
await compiler.loadPlugins(cwd);
|
|
171
|
+
await compiler.loadComet(cwd);
|
|
172
|
+
compiler.compile(cwd, output);
|
|
173
|
+
console.log(`š¦ Built to ${path.dirname(output)}/`);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
console.error("Build error:", e.message);
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
} else if (command === 'comet') {
|
|
180
|
+
const subCmd = args._[1];
|
|
181
|
+
const registry = new CometRegistry();
|
|
182
|
+
|
|
183
|
+
if (subCmd === 'init') {
|
|
184
|
+
const name = args._[2];
|
|
185
|
+
if (!name) { console.error("Usage: woozie comet init <name>"); process.exit(1); }
|
|
186
|
+
const pkgDir = registry.init(cwd, name);
|
|
187
|
+
console.log(`š CometUI package created: ${pkgDir}`);
|
|
188
|
+
console.log(` Edit components/ to add .woozie plugins`);
|
|
189
|
+
|
|
190
|
+
} else if (subCmd === 'add') {
|
|
191
|
+
const source = args._[2];
|
|
192
|
+
if (!source) { console.error("Usage: woozie comet add <path>"); process.exit(1); }
|
|
193
|
+
const sourcePath = path.resolve(cwd, source);
|
|
194
|
+
const name = registry.add(cwd, sourcePath);
|
|
195
|
+
console.log(`š Installed CometUI package: ${name}`);
|
|
196
|
+
|
|
197
|
+
} else if (subCmd === 'list') {
|
|
198
|
+
const pkgs = registry.list(cwd);
|
|
199
|
+
if (pkgs.length === 0) { console.log('No CometUI packages installed.'); }
|
|
200
|
+
else {
|
|
201
|
+
console.log('š Installed CometUI packages:\n');
|
|
202
|
+
for (const p of pkgs) {
|
|
203
|
+
console.log(` ${p.name}@${p.version || '?'} ā ${p.description || ''}`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
} else if (subCmd === 'remove') {
|
|
208
|
+
const name = args._[2];
|
|
209
|
+
if (!name) { console.error("Usage: woozie comet remove <name>"); process.exit(1); }
|
|
210
|
+
registry.remove(cwd, name);
|
|
211
|
+
console.log(`š Removed: ${name}`);
|
|
212
|
+
|
|
213
|
+
} else {
|
|
214
|
+
console.log('CometUI commands: init, add, list, remove');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
} else if (command === 'syntax') {
|
|
218
|
+
installSyntax(false);
|
|
219
|
+
|
|
220
|
+
} else {
|
|
221
|
+
console.error("Unknown command:", command);
|
|
222
|
+
process.exit(1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function installSyntax(silent) {
|
|
227
|
+
const extSrc = path.join(__dirname, '..', 'editor', 'woozie-syntax');
|
|
228
|
+
const home = process.env.USERPROFILE || process.env.HOME;
|
|
229
|
+
const extDest = path.join(home, '.vscode', 'extensions', 'woozlit.woozie-syntax-3.0.0');
|
|
230
|
+
try {
|
|
231
|
+
// Copy extension folder into VS Code extensions directory
|
|
232
|
+
_copyDirSync(extSrc, extDest);
|
|
233
|
+
if (!silent) console.log('ā
Woozie syntax highlighting installed in VS Code');
|
|
234
|
+
if (!silent) console.log(' Restart or reload VS Code to activate.');
|
|
235
|
+
} catch (e) {
|
|
236
|
+
if (!silent) {
|
|
237
|
+
console.log('ā ļø Could not auto-install syntax extension.');
|
|
238
|
+
console.log(' To install manually, copy this folder:');
|
|
239
|
+
console.log(` ${extSrc}`);
|
|
240
|
+
console.log(` ā ${path.join(home, '.vscode', 'extensions', 'woozlit.woozie-syntax-3.0.0')}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function _copyDirSync(src, dest) {
|
|
246
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
247
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
248
|
+
const s = path.join(src, entry.name);
|
|
249
|
+
const d = path.join(dest, entry.name);
|
|
250
|
+
if (entry.isDirectory()) _copyDirSync(s, d);
|
|
251
|
+
else fs.copyFileSync(s, d);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
main();
|