jac-client 0.1.0__tar.gz
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.
- jac_client-0.1.0/PKG-INFO +126 -0
- jac_client-0.1.0/README.md +111 -0
- jac_client-0.1.0/jac_client/docs/README.md +629 -0
- jac_client-0.1.0/jac_client/docs/advanced-state.md +706 -0
- jac_client-0.1.0/jac_client/docs/imports.md +650 -0
- jac_client-0.1.0/jac_client/docs/lifecycle-hooks.md +554 -0
- jac_client-0.1.0/jac_client/docs/routing.md +530 -0
- jac_client-0.1.0/jac_client/examples/little-x/app.jac +615 -0
- jac_client-0.1.0/jac_client/examples/little-x/package-lock.json +2840 -0
- jac_client-0.1.0/jac_client/examples/little-x/package.json +23 -0
- jac_client-0.1.0/jac_client/examples/little-x/submit-button.jac +8 -0
- jac_client-0.1.0/jac_client/examples/todo-app/README.md +82 -0
- jac_client-0.1.0/jac_client/examples/todo-app/app.jac +683 -0
- jac_client-0.1.0/jac_client/examples/todo-app/package-lock.json +999 -0
- jac_client-0.1.0/jac_client/examples/todo-app/package.json +22 -0
- jac_client-0.1.0/jac_client/plugin/cli.py +328 -0
- jac_client-0.1.0/jac_client/plugin/client.py +41 -0
- jac_client-0.1.0/jac_client/plugin/client_runtime.jac +941 -0
- jac_client-0.1.0/jac_client/plugin/vite_client_bundle.py +470 -0
- jac_client-0.1.0/jac_client/tests/__init__.py +2 -0
- jac_client-0.1.0/jac_client/tests/fixtures/button.jac +6 -0
- jac_client-0.1.0/jac_client/tests/fixtures/client_app.jac +18 -0
- jac_client-0.1.0/jac_client/tests/fixtures/client_app_with_antd.jac +21 -0
- jac_client-0.1.0/jac_client/tests/fixtures/js_import.jac +30 -0
- jac_client-0.1.0/jac_client/tests/fixtures/package-lock.json +329 -0
- jac_client-0.1.0/jac_client/tests/fixtures/package.json +11 -0
- jac_client-0.1.0/jac_client/tests/fixtures/relative_import.jac +13 -0
- jac_client-0.1.0/jac_client/tests/fixtures/test_fragments_spread.jac +44 -0
- jac_client-0.1.0/jac_client/tests/fixtures/utils.js +22 -0
- jac_client-0.1.0/jac_client/tests/test_cl.py +360 -0
- jac_client-0.1.0/jac_client/tests/test_create_jac_app.py +139 -0
- jac_client-0.1.0/pyproject.toml +24 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jac-client
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary:
|
|
5
|
+
Author: Jason Mars
|
|
6
|
+
Author-email: jason@mars.ninja
|
|
7
|
+
Requires-Python: >=3.12.0,<4.0.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Requires-Dist: jaclang (==0.8.10)
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# Jac Client
|
|
16
|
+
|
|
17
|
+
Build full-stack web applications with Jac - one language for frontend and backend.
|
|
18
|
+
|
|
19
|
+
Jac Client enables you to write React-like components, manage state, and build interactive UIs all in Jac. No need for separate frontend frameworks, HTTP clients, or complex build configurations.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ✨ Features
|
|
24
|
+
|
|
25
|
+
- **Single Language**: Write frontend and backend in Jac
|
|
26
|
+
- **No HTTP Client**: Use `__jacSpawn()` instead of fetch/axios
|
|
27
|
+
- **Reactive State**: Built-in state management with `createState()`
|
|
28
|
+
- **Component-Based**: Build reusable UI components with JSX
|
|
29
|
+
- **Graph Database**: Built-in graph data model eliminates need for SQL/NoSQL
|
|
30
|
+
- **Type Safety**: Type checking across frontend and backend
|
|
31
|
+
- **Vite-Powered**: Optimized production bundles with Vite
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Quick Start
|
|
36
|
+
|
|
37
|
+
### Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install jac-client
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Create a New App
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
jac create_jac_app my-app
|
|
47
|
+
cd my-app
|
|
48
|
+
jac serve app.jac
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Visit `http://localhost:8000` to see your app!
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📚 Documentation
|
|
56
|
+
|
|
57
|
+
For detailed guides and tutorials, see the **[docs folder](jac_client/docs/)**:
|
|
58
|
+
|
|
59
|
+
- **[Getting Started Guide](jac_client/docs/README.md)** - Complete beginner's guide
|
|
60
|
+
- **[Routing](jac_client/docs/routing.md)** - Multi-page applications with `initRouter()`
|
|
61
|
+
- **[Lifecycle Hooks](jac_client/docs/lifecycle-hooks.md)** - Using `onMount()` for initialization
|
|
62
|
+
- **[Advanced State](jac_client/docs/advanced-state.md)** - Managing complex state
|
|
63
|
+
- **[Imports](jac_client/docs/imports.md)** - Importing libraries, Jac files, and JavaScript modules
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 💡 Example
|
|
68
|
+
|
|
69
|
+
```jac
|
|
70
|
+
cl {
|
|
71
|
+
let [count, setCount] = createState({"value": 0});
|
|
72
|
+
|
|
73
|
+
def Counter() -> any {
|
|
74
|
+
s = count();
|
|
75
|
+
return <div>
|
|
76
|
+
<h1>Count: {s.value}</h1>
|
|
77
|
+
<button onClick={lambda -> None {
|
|
78
|
+
setCount({"value": s.value + 1});
|
|
79
|
+
}}>
|
|
80
|
+
Increment
|
|
81
|
+
</button>
|
|
82
|
+
</div>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
def jac_app() -> any {
|
|
86
|
+
return Counter();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🔧 Requirements
|
|
94
|
+
|
|
95
|
+
- Python: 3.12+
|
|
96
|
+
- Node.js: For npm and Vite
|
|
97
|
+
- Jac Language: `jaclang` (installed automatically)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🛠️ How It Works
|
|
102
|
+
|
|
103
|
+
Jac Client is a plugin that:
|
|
104
|
+
1. Compiles your `.jac` client code to JavaScript
|
|
105
|
+
2. Bundles dependencies with Vite for optimal performance
|
|
106
|
+
3. Provides a runtime for reactive state and components
|
|
107
|
+
4. Integrates seamlessly with Jac's backend graph operations
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 📖 Learn More
|
|
112
|
+
|
|
113
|
+
- **Full Documentation**: See [docs/](jac_client/docs/) for comprehensive guides
|
|
114
|
+
- **Examples**: Check `jac_client/examples/` for working examples
|
|
115
|
+
- **Issues**: Report bugs on [GitHub Issues](https://github.com/Jaseci-Labs/jaseci/issues)
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 📄 License
|
|
120
|
+
|
|
121
|
+
MIT License - see [LICENSE](../LICENSE) file.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
**Happy coding with Jac!** 🎉
|
|
126
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Jac Client
|
|
2
|
+
|
|
3
|
+
Build full-stack web applications with Jac - one language for frontend and backend.
|
|
4
|
+
|
|
5
|
+
Jac Client enables you to write React-like components, manage state, and build interactive UIs all in Jac. No need for separate frontend frameworks, HTTP clients, or complex build configurations.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **Single Language**: Write frontend and backend in Jac
|
|
12
|
+
- **No HTTP Client**: Use `__jacSpawn()` instead of fetch/axios
|
|
13
|
+
- **Reactive State**: Built-in state management with `createState()`
|
|
14
|
+
- **Component-Based**: Build reusable UI components with JSX
|
|
15
|
+
- **Graph Database**: Built-in graph data model eliminates need for SQL/NoSQL
|
|
16
|
+
- **Type Safety**: Type checking across frontend and backend
|
|
17
|
+
- **Vite-Powered**: Optimized production bundles with Vite
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🚀 Quick Start
|
|
22
|
+
|
|
23
|
+
### Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install jac-client
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Create a New App
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
jac create_jac_app my-app
|
|
33
|
+
cd my-app
|
|
34
|
+
jac serve app.jac
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Visit `http://localhost:8000` to see your app!
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 📚 Documentation
|
|
42
|
+
|
|
43
|
+
For detailed guides and tutorials, see the **[docs folder](jac_client/docs/)**:
|
|
44
|
+
|
|
45
|
+
- **[Getting Started Guide](jac_client/docs/README.md)** - Complete beginner's guide
|
|
46
|
+
- **[Routing](jac_client/docs/routing.md)** - Multi-page applications with `initRouter()`
|
|
47
|
+
- **[Lifecycle Hooks](jac_client/docs/lifecycle-hooks.md)** - Using `onMount()` for initialization
|
|
48
|
+
- **[Advanced State](jac_client/docs/advanced-state.md)** - Managing complex state
|
|
49
|
+
- **[Imports](jac_client/docs/imports.md)** - Importing libraries, Jac files, and JavaScript modules
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 💡 Example
|
|
54
|
+
|
|
55
|
+
```jac
|
|
56
|
+
cl {
|
|
57
|
+
let [count, setCount] = createState({"value": 0});
|
|
58
|
+
|
|
59
|
+
def Counter() -> any {
|
|
60
|
+
s = count();
|
|
61
|
+
return <div>
|
|
62
|
+
<h1>Count: {s.value}</h1>
|
|
63
|
+
<button onClick={lambda -> None {
|
|
64
|
+
setCount({"value": s.value + 1});
|
|
65
|
+
}}>
|
|
66
|
+
Increment
|
|
67
|
+
</button>
|
|
68
|
+
</div>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
def jac_app() -> any {
|
|
72
|
+
return Counter();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🔧 Requirements
|
|
80
|
+
|
|
81
|
+
- Python: 3.12+
|
|
82
|
+
- Node.js: For npm and Vite
|
|
83
|
+
- Jac Language: `jaclang` (installed automatically)
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🛠️ How It Works
|
|
88
|
+
|
|
89
|
+
Jac Client is a plugin that:
|
|
90
|
+
1. Compiles your `.jac` client code to JavaScript
|
|
91
|
+
2. Bundles dependencies with Vite for optimal performance
|
|
92
|
+
3. Provides a runtime for reactive state and components
|
|
93
|
+
4. Integrates seamlessly with Jac's backend graph operations
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📖 Learn More
|
|
98
|
+
|
|
99
|
+
- **Full Documentation**: See [docs/](jac_client/docs/) for comprehensive guides
|
|
100
|
+
- **Examples**: Check `jac_client/examples/` for working examples
|
|
101
|
+
- **Issues**: Report bugs on [GitHub Issues](https://github.com/Jaseci-Labs/jaseci/issues)
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 📄 License
|
|
106
|
+
|
|
107
|
+
MIT License - see [LICENSE](../LICENSE) file.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
**Happy coding with Jac!** 🎉
|