0x-lang 0.1.23 → 0.1.24
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/README.md +95 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<strong>Write 18 lines. Get 96 lines of production React.</strong><br/>
|
|
9
|
-
A full-stack language that compiles to React, Vue 3, Svelte 5, Express, React Native, and Terraform
|
|
9
|
+
A full-stack language that compiles to React, Vue 3, Svelte 5, Express, React Native, and Terraform.<br/>
|
|
10
|
+
Now with <strong>LSP/IDE support</strong> and full Vue/Svelte feature parity.
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
<p align="center">
|
|
@@ -347,7 +348,77 @@ page Infra:
|
|
|
347
348
|
|
|
348
349
|
Compiles to Terraform HCL with provider blocks, resource definitions, and variable declarations.
|
|
349
350
|
|
|
350
|
-
|
|
351
|
+
### Blog App — 64 lines
|
|
352
|
+
|
|
353
|
+
```python
|
|
354
|
+
page Blog:
|
|
355
|
+
state posts: list[Post] = []
|
|
356
|
+
state loading: bool = true
|
|
357
|
+
|
|
358
|
+
data posts from fetch("/api/posts")
|
|
359
|
+
|
|
360
|
+
layout col gap=24 padding=32:
|
|
361
|
+
nav "BlogApp" links=["Home", "Write", "About"]
|
|
362
|
+
hero "My Blog" subtitle="Thoughts and tutorials"
|
|
363
|
+
|
|
364
|
+
for post in posts:
|
|
365
|
+
component PostCard(post)
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Full CRUD blog with data fetching, auth, routing, and reusable components.
|
|
369
|
+
|
|
370
|
+
### CRM Dashboard — 80 lines
|
|
371
|
+
|
|
372
|
+
```python
|
|
373
|
+
page CRM:
|
|
374
|
+
data customers from fetch("/api/customers")
|
|
375
|
+
state search: str = ""
|
|
376
|
+
derived filtered = customers.filter(c => c.name.includes(search))
|
|
377
|
+
|
|
378
|
+
layout col gap=24 padding=32:
|
|
379
|
+
text "CRM Dashboard" size=3xl bold
|
|
380
|
+
input search placeholder="Search customers..."
|
|
381
|
+
|
|
382
|
+
layout grid cols=3 gap=16:
|
|
383
|
+
stat "Total" value={customers.length}
|
|
384
|
+
stat "Active" value={customers.filter(c => c.active).length}
|
|
385
|
+
stat "Revenue" value="$12,500"
|
|
386
|
+
|
|
387
|
+
table filtered columns=["name", "email", "status", "revenue"]
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
CRM with search, stats, filterable table, and modal forms.
|
|
391
|
+
|
|
392
|
+
### SaaS Landing — 77 lines, Kanban Board — 77 lines, Admin Panel — 91 lines
|
|
393
|
+
|
|
394
|
+
See all 10 examples in [`examples/`](examples/).
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## IDE / Editor Support
|
|
399
|
+
|
|
400
|
+
0x includes a built-in **Language Server Protocol (LSP)** server for IDE integration.
|
|
401
|
+
|
|
402
|
+
### VSCode Extension
|
|
403
|
+
|
|
404
|
+
Install the 0x VSCode extension for:
|
|
405
|
+
- **Syntax highlighting** — all 73+ keywords color-coded
|
|
406
|
+
- **Autocomplete** — context-aware keyword and identifier completion
|
|
407
|
+
- **Hover info** — documentation for keywords, types for variables
|
|
408
|
+
- **Go to definition** — jump to state, fn, prop declarations
|
|
409
|
+
- **Document outline** — page, component, state, fn in the sidebar
|
|
410
|
+
- **Real-time diagnostics** — parse and validation errors as you type
|
|
411
|
+
|
|
412
|
+
### Other Editors
|
|
413
|
+
|
|
414
|
+
The LSP server works with any editor that supports LSP:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# Start the LSP server
|
|
418
|
+
0x-lsp --stdio
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Configure your editor's LSP client to connect to `0x-lsp --stdio` for `.ai` files.
|
|
351
422
|
|
|
352
423
|
---
|
|
353
424
|
|
|
@@ -619,6 +690,7 @@ const output = generateReact(ast); // React JSX string
|
|
|
619
690
|
| `0x-lang/generators/react-native` | `generateReactNative()` |
|
|
620
691
|
| `0x-lang/generators/terraform` | `generateTerraform()` |
|
|
621
692
|
| `0x-lang/generators/ai-bridge` | `getLanguageSpec()`, `generatePrompt()`, `compileFromDescription()` |
|
|
693
|
+
| `0x-lang/lsp` | LSP server for IDE integration |
|
|
622
694
|
|
|
623
695
|
---
|
|
624
696
|
|
|
@@ -741,30 +813,34 @@ Validator ─── Circular deps · unused state · type checks
|
|
|
741
813
|
↓
|
|
742
814
|
Generator
|
|
743
815
|
├── React ────────── JSX + hooks + CSS-in-JS
|
|
744
|
-
├── Vue ──────────── SFC + Composition API +
|
|
745
|
-
├── Svelte ──────── Runes
|
|
816
|
+
├── Vue ──────────── SFC + Composition API + store/data/form/auth/model
|
|
817
|
+
├── Svelte ──────── Runes + store/data/form/auth/model
|
|
746
818
|
├── React Native ── View + StyleSheet + TouchableOpacity
|
|
747
819
|
├── Backend ─────── Express + JWT + CRUD + middleware
|
|
748
820
|
├── Terraform ───── HCL + providers + resources
|
|
749
821
|
└── AI Bridge ───── Spec + prompts + skeleton generation
|
|
822
|
+
↓
|
|
823
|
+
LSP Server ─── Diagnostics · completion · hover · go-to-def · symbols
|
|
750
824
|
```
|
|
751
825
|
|
|
752
|
-
~
|
|
826
|
+
~14,000 lines of TypeScript. Zero runtime dependencies (except gen-mapping for source maps).
|
|
753
827
|
|
|
754
828
|
| Module | Lines | |
|
|
755
829
|
|:---|---:|:---|
|
|
756
|
-
| Parser | 3,
|
|
757
|
-
| React Generator | 2,
|
|
758
|
-
|
|
|
759
|
-
|
|
|
760
|
-
|
|
|
761
|
-
| React Native Generator |
|
|
762
|
-
| Backend Generator |
|
|
763
|
-
|
|
|
764
|
-
|
|
|
765
|
-
|
|
|
766
|
-
| AI Bridge |
|
|
767
|
-
|
|
|
830
|
+
| Parser | 3,876 | Recursive descent, full AST |
|
|
831
|
+
| React Generator | 2,795 | JSX + hooks + memo + styling |
|
|
832
|
+
| Vue Generator | 1,383 | SFC + Composition API + store/data/form/auth/model |
|
|
833
|
+
| Svelte Generator | 1,270 | Svelte 5 runes + store/data/form/auth/model |
|
|
834
|
+
| AST Types | 1,099 | TypeScript definitions |
|
|
835
|
+
| React Native Generator | 689 | View + StyleSheet + native components |
|
|
836
|
+
| Backend Generator | 425 | Express + JWT + CRUD + middleware |
|
|
837
|
+
| Tokenizer | 394 | Indentation-aware lexer |
|
|
838
|
+
| Terraform Generator | 369 | HCL + multi-provider (AWS, Vercel, Fly.io) |
|
|
839
|
+
| Validator | 358 | Static analysis + error reporting |
|
|
840
|
+
| AI Bridge | 323 | Spec + prompt generation + skeleton |
|
|
841
|
+
| Shared Utilities | 249 | Type helpers, gradient parser, passthrough props |
|
|
842
|
+
| CLI | 249 | build · dev · bench · init |
|
|
843
|
+
| LSP Server | 637 | Diagnostics, completion, hover, go-to-def, symbols |
|
|
768
844
|
|
|
769
845
|
## CLI
|
|
770
846
|
|
|
@@ -773,6 +849,7 @@ Generator
|
|
|
773
849
|
0x dev <file.ai> --target <target>
|
|
774
850
|
0x bench <file.ai>
|
|
775
851
|
0x init [project-name]
|
|
852
|
+
0x-lsp --stdio # Start LSP server
|
|
776
853
|
|
|
777
854
|
Flags:
|
|
778
855
|
--target, -t react, vue, svelte, react-native, backend, terraform (comma-separated)
|
|
@@ -786,7 +863,7 @@ Flags:
|
|
|
786
863
|
git clone https://github.com/hankimis/0x-lang.git
|
|
787
864
|
cd 0x-lang
|
|
788
865
|
npm install
|
|
789
|
-
npm test #
|
|
866
|
+
npm test # 303 tests across 12 test suites
|
|
790
867
|
npm run build
|
|
791
868
|
```
|
|
792
869
|
|