jac-client 0.2.0__py3-none-any.whl

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.
Files changed (72) hide show
  1. jac_client/docs/README.md +659 -0
  2. jac_client/docs/advanced-state.md +1266 -0
  3. jac_client/docs/assets/pipe_line.png +0 -0
  4. jac_client/docs/guide-example/intro.md +117 -0
  5. jac_client/docs/guide-example/step-01-setup.md +260 -0
  6. jac_client/docs/guide-example/step-02-components.md +416 -0
  7. jac_client/docs/guide-example/step-03-styling.md +478 -0
  8. jac_client/docs/guide-example/step-04-todo-ui.md +477 -0
  9. jac_client/docs/guide-example/step-05-local-state.md +530 -0
  10. jac_client/docs/guide-example/step-06-events.md +750 -0
  11. jac_client/docs/guide-example/step-07-effects.md +469 -0
  12. jac_client/docs/guide-example/step-08-walkers.md +534 -0
  13. jac_client/docs/guide-example/step-09-authentication.md +586 -0
  14. jac_client/docs/guide-example/step-10-routing.md +540 -0
  15. jac_client/docs/guide-example/step-11-final.md +964 -0
  16. jac_client/docs/imports.md +1142 -0
  17. jac_client/docs/lifecycle-hooks.md +774 -0
  18. jac_client/docs/routing.md +660 -0
  19. jac_client/examples/basic/.babelrc +9 -0
  20. jac_client/examples/basic/README.md +16 -0
  21. jac_client/examples/basic/app.jac +16 -0
  22. jac_client/examples/basic/package.json +27 -0
  23. jac_client/examples/basic/vite.config.js +28 -0
  24. jac_client/examples/basic-auth/.babelrc +9 -0
  25. jac_client/examples/basic-auth/README.md +16 -0
  26. jac_client/examples/basic-auth/app.jac +308 -0
  27. jac_client/examples/basic-auth/package.json +27 -0
  28. jac_client/examples/basic-auth/vite.config.js +28 -0
  29. jac_client/examples/basic-auth-with-router/.babelrc +9 -0
  30. jac_client/examples/basic-auth-with-router/README.md +60 -0
  31. jac_client/examples/basic-auth-with-router/app.jac +464 -0
  32. jac_client/examples/basic-auth-with-router/package.json +28 -0
  33. jac_client/examples/basic-auth-with-router/vite.config.js +28 -0
  34. jac_client/examples/basic-full-stack/.babelrc +9 -0
  35. jac_client/examples/basic-full-stack/README.md +18 -0
  36. jac_client/examples/basic-full-stack/app.jac +320 -0
  37. jac_client/examples/basic-full-stack/package.json +28 -0
  38. jac_client/examples/basic-full-stack/vite.config.js +28 -0
  39. jac_client/examples/full-stack-with-auth/.babelrc +9 -0
  40. jac_client/examples/full-stack-with-auth/README.md +16 -0
  41. jac_client/examples/full-stack-with-auth/app.jac +735 -0
  42. jac_client/examples/full-stack-with-auth/package.json +28 -0
  43. jac_client/examples/full-stack-with-auth/vite.config.js +30 -0
  44. jac_client/examples/little-x/app.jac +615 -0
  45. jac_client/examples/little-x/package.json +23 -0
  46. jac_client/examples/little-x/submit-button.jac +8 -0
  47. jac_client/examples/with-router/.babelrc +9 -0
  48. jac_client/examples/with-router/README.md +17 -0
  49. jac_client/examples/with-router/app.jac +323 -0
  50. jac_client/examples/with-router/package.json +28 -0
  51. jac_client/examples/with-router/vite.config.js +28 -0
  52. jac_client/plugin/cli.py +239 -0
  53. jac_client/plugin/client.py +89 -0
  54. jac_client/plugin/client_runtime.jac +234 -0
  55. jac_client/plugin/vite_client_bundle.py +355 -0
  56. jac_client/tests/__init__.py +2 -0
  57. jac_client/tests/fixtures/basic-app/app.jac +18 -0
  58. jac_client/tests/fixtures/client_app_with_antd/app.jac +28 -0
  59. jac_client/tests/fixtures/js_import/app.jac +30 -0
  60. jac_client/tests/fixtures/js_import/utils.js +22 -0
  61. jac_client/tests/fixtures/package-lock.json +329 -0
  62. jac_client/tests/fixtures/package.json +11 -0
  63. jac_client/tests/fixtures/relative_import/app.jac +13 -0
  64. jac_client/tests/fixtures/relative_import/button.jac +6 -0
  65. jac_client/tests/fixtures/spawn_test/app.jac +133 -0
  66. jac_client/tests/fixtures/test_fragments_spread/app.jac +53 -0
  67. jac_client/tests/test_cl.py +476 -0
  68. jac_client/tests/test_create_jac_app.py +139 -0
  69. jac_client-0.2.0.dist-info/METADATA +182 -0
  70. jac_client-0.2.0.dist-info/RECORD +72 -0
  71. jac_client-0.2.0.dist-info/WHEEL +4 -0
  72. jac_client-0.2.0.dist-info/entry_points.txt +4 -0
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: jac-client
3
+ Version: 0.2.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.9.0)
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
+ - **React Hooks**: Use standard React `useState` and `useEffect` hooks
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/page/app` 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 declarative routing (`<Router>`, `<Routes>`, `<Route>`)
61
+ - **[Lifecycle Hooks](jac_client/docs/lifecycle-hooks.md)** - Using React hooks (`useState`, `useEffect`)
62
+ - **[Advanced State](jac_client/docs/advanced-state.md)** - Managing complex state with React hooks
63
+ - **[Imports](jac_client/docs/imports.md)** - Importing third-party libraries (React, Ant Design, Lodash), Jac files, and JavaScript modules
64
+
65
+ ---
66
+
67
+ ## 💡 Example
68
+
69
+ ### Simple Counter with React Hooks
70
+
71
+ ```jac
72
+ cl import from react { useState, useEffect }
73
+
74
+ cl {
75
+ def Counter() -> any {
76
+ let [count, setCount] = useState(0);
77
+
78
+ useEffect(lambda -> None {
79
+ console.log("Count changed:", count);
80
+ }, [count]);
81
+
82
+ return <div>
83
+ <h1>Count: {count}</h1>
84
+ <button onClick={lambda e: any -> None {
85
+ setCount(count + 1);
86
+ }}>
87
+ Increment
88
+ </button>
89
+ </div>;
90
+ }
91
+
92
+ def app() -> any {
93
+ return Counter();
94
+ }
95
+ }
96
+ ```
97
+
98
+ ### Full-Stack Todo App
99
+
100
+ ```jac
101
+ cl import from react { useState, useEffect }
102
+ cl import from '@jac-client/utils' { jacSpawn }
103
+
104
+ # Backend: Jac nodes and walkers
105
+ node Todo {
106
+ has text: str;
107
+ has done: bool = False;
108
+ }
109
+
110
+ walker create_todo {
111
+ has text: str;
112
+ can create with `root entry {
113
+ new_todo = here ++> Todo(text=self.text);
114
+ report new_todo;
115
+ }
116
+ }
117
+
118
+ walker read_todos {
119
+ can read with `root entry {
120
+ visit [-->(`?Todo)];
121
+ }
122
+ }
123
+
124
+ # Frontend: React component
125
+ cl {
126
+ def app() -> any {
127
+ let [todos, setTodos] = useState([]);
128
+
129
+ useEffect(lambda -> None {
130
+ async def loadTodos() -> None {
131
+ result = await jacSpawn("read_todos", "", {});
132
+ setTodos(result.reports);
133
+ }
134
+ loadTodos();
135
+ }, []);
136
+
137
+ return <div>
138
+ <h1>My Todos</h1>
139
+ {todos.map(lambda todo: any -> any {
140
+ return <div key={todo._jac_id}>{todo.text}</div>;
141
+ })}
142
+ </div>;
143
+ }
144
+ }
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 🔧 Requirements
150
+
151
+ - Python: 3.12+
152
+ - Node.js: For npm and Vite
153
+ - Jac Language: `jaclang` (installed automatically)
154
+
155
+ ---
156
+
157
+ ## 🛠️ How It Works
158
+
159
+ Jac Client is a plugin that:
160
+ 1. Compiles your `.jac` client code to JavaScript
161
+ 2. Bundles dependencies with Vite for optimal performance
162
+ 3. Provides a runtime for reactive state and components
163
+ 4. Integrates seamlessly with Jac's backend graph operations
164
+
165
+ ---
166
+
167
+ ## 📖 Learn More
168
+
169
+ - **Full Documentation**: See [docs/](jac_client/docs/) for comprehensive guides
170
+ - **Examples**: Check `jac_client/examples/` for working examples
171
+ - **Issues**: Report bugs on [GitHub Issues](https://github.com/Jaseci-Labs/jaseci/issues)
172
+
173
+ ---
174
+
175
+ ## 📄 License
176
+
177
+ MIT License - see [LICENSE](../LICENSE) file.
178
+
179
+ ---
180
+
181
+ **Happy coding with Jac!** 🎉
182
+
@@ -0,0 +1,72 @@
1
+ jac_client/docs/README.md,sha256=HV00SWr2tvfjzoB4fhY6UbfAwTPsQ1kTelkjIdBt_g8,17173
2
+ jac_client/docs/advanced-state.md,sha256=RNF5w2A8_ElBdfUFBjqWXqLG7pTVhCHP5Ujhuf9MCys,35465
3
+ jac_client/docs/assets/pipe_line.png,sha256=agSseYhL8rNX-cxlqlfbBOuhtq_iGnujNx6oQufl33s,70639
4
+ jac_client/docs/guide-example/intro.md,sha256=BftfRNckYMk4GDvEvFprJM6C3shR_Ub6wf07pXpT9AQ,4630
5
+ jac_client/docs/guide-example/step-01-setup.md,sha256=aG6fbQlrAXpKaciwMDPCVTG-MAZuJBu8JZwZ1_SSoOc,5374
6
+ jac_client/docs/guide-example/step-02-components.md,sha256=xD2eY59Wn100-o71yfrSvTSqud_mVSoMnD1hSYVzNNg,8710
7
+ jac_client/docs/guide-example/step-03-styling.md,sha256=O1k710uKVaFrLijVxaLHMOBOQK7DpH3FvYKgBm-Os0k,10717
8
+ jac_client/docs/guide-example/step-04-todo-ui.md,sha256=Di9yF9k5ch7LFha8Q3DCDf8PI8Dzps85zpnI1uZQJUk,12039
9
+ jac_client/docs/guide-example/step-05-local-state.md,sha256=k5a2FS6gS0JxsA2_rXQ-PJzYKZms9k11TRH5PVqfAkI,12956
10
+ jac_client/docs/guide-example/step-06-events.md,sha256=T7cUedmD-nNluSRuQa9VBYTybTWgfP2Xfs_lQPzztQM,18596
11
+ jac_client/docs/guide-example/step-07-effects.md,sha256=wSj64yqPSlye7oilW52t-BM5sTAh2nshmwRzbwuZi50,10135
12
+ jac_client/docs/guide-example/step-08-walkers.md,sha256=D8ERSQXjihOMj7neanvX1stihJdpEsQZMAa0Sm3ZvUg,10564
13
+ jac_client/docs/guide-example/step-09-authentication.md,sha256=CH0zkXONlEFlPs3xTyA-F7kDOML6E0OGvx1liWSTrhs,14295
14
+ jac_client/docs/guide-example/step-10-routing.md,sha256=PswR89r-0n3LkoyE4zIl2mDupfFntJ1Teo7Q5GJbxtU,11813
15
+ jac_client/docs/guide-example/step-11-final.md,sha256=deSEjhXxTBW_joiNrQM-Ad8qzVEwUiAS_WcOvVzCeyQ,28087
16
+ jac_client/docs/imports.md,sha256=WQCiYR5jwWZelz6d5JwsLSHUKGbHg23mPDkREdInBiw,25709
17
+ jac_client/docs/lifecycle-hooks.md,sha256=MU2aRD-EbGynjW-qe3jrN82dtebfiLd5uepP-14i6Xc,19494
18
+ jac_client/docs/routing.md,sha256=yDQfyCWUhMDwyt7r8pZyCwj-TSXnZdl21BQazIcWFdw,17248
19
+ jac_client/examples/basic/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
20
+ jac_client/examples/basic/README.md,sha256=Ra90lVRm62Xnvd2j1cRewMZr_qKLQDxuRTq4-r2zU2g,188
21
+ jac_client/examples/basic/app.jac,sha256=Ytf4UrWHGPtayG0QddOyiy_60tneP_eFLzQfaZkaSdY,433
22
+ jac_client/examples/basic/package.json,sha256=jocBFTSfVdlfBNGdUgIfhZx0YuxVYcS49j368JI594M,656
23
+ jac_client/examples/basic/vite.config.js,sha256=Fw_3OJilwEKwNo6nCpWyk2Tdgmx3BeN7QKRpXIM3lfk,671
24
+ jac_client/examples/basic-auth/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
25
+ jac_client/examples/basic-auth/README.md,sha256=aLI6d9PFhWQ5otE2ibYLia9pCCTzQBRl_snHlWFDgvw,192
26
+ jac_client/examples/basic-auth/app.jac,sha256=aLu-1B8oISgDj_1FnwWCcfs7ZQkjhgWH2uM0qTaCytQ,12173
27
+ jac_client/examples/basic-auth/package.json,sha256=un_qE_dVfFNOSgiMfqOujHTgVsHmte6aho5F8gEi-9Q,664
28
+ jac_client/examples/basic-auth/vite.config.js,sha256=Fw_3OJilwEKwNo6nCpWyk2Tdgmx3BeN7QKRpXIM3lfk,671
29
+ jac_client/examples/basic-auth-with-router/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
30
+ jac_client/examples/basic-auth-with-router/README.md,sha256=rYvgGTT_PzzH_Whg-wLLI0aIj06VB2ZFCbnSTleNN7E,1824
31
+ jac_client/examples/basic-auth-with-router/app.jac,sha256=-e5FLlFZf4pddSrNmitlhtpv5_z9wkdcnxIc2RagoNg,15079
32
+ jac_client/examples/basic-auth-with-router/package.json,sha256=0jl9pUaXilbxKviDdBO_bCT6tXevMyP6RT17DlVmap4,723
33
+ jac_client/examples/basic-auth-with-router/vite.config.js,sha256=Fw_3OJilwEKwNo6nCpWyk2Tdgmx3BeN7QKRpXIM3lfk,671
34
+ jac_client/examples/basic-full-stack/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
35
+ jac_client/examples/basic-full-stack/README.md,sha256=qEFUx5zPYk2OYi9XOpPBbE9oWyqudHu6YXTkcE35QPA,200
36
+ jac_client/examples/basic-full-stack/app.jac,sha256=T2DbREtr7AaWskTIvvmrl6PCAtxclXwXhxity65I-6M,12080
37
+ jac_client/examples/basic-full-stack/package.json,sha256=mBnqM2BG2GP7A7yRh7O_idRoCU2psojF8TD3rBzJ65c,710
38
+ jac_client/examples/basic-full-stack/vite.config.js,sha256=Fw_3OJilwEKwNo6nCpWyk2Tdgmx3BeN7QKRpXIM3lfk,671
39
+ jac_client/examples/full-stack-with-auth/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
40
+ jac_client/examples/full-stack-with-auth/README.md,sha256=lQL3mQIxxHSujm0-xN95D-lh_7VfS94BmKnk1w30CLE,202
41
+ jac_client/examples/full-stack-with-auth/app.jac,sha256=wPgxS5ag9BAU6as5-iDiXOZFVXFlcKldv8hyrfGj2Ms,22518
42
+ jac_client/examples/full-stack-with-auth/package.json,sha256=xI-CNLFet0hqws_QelPZitVTnQTZHTXA70QcPjZXn9g,719
43
+ jac_client/examples/full-stack-with-auth/vite.config.js,sha256=Hs7wgen2DoKvHfge2bg91H45UvzgfwzC45QRRYto73Q,711
44
+ jac_client/examples/little-x/app.jac,sha256=NueM8h35Bvf-hXL-kyeZ01-HAL7xZxUxrpHR99ASkhM,16760
45
+ jac_client/examples/little-x/package.json,sha256=XaXpijPuRDojT-yQFJwkaopDgqMiriepqEk0LsFQ-cU,521
46
+ jac_client/examples/little-x/submit-button.jac,sha256=ByyRpDDN49RxoF8k7TC0r1mgoKAwwdlpo6wiiTE7p_4,324
47
+ jac_client/examples/with-router/.babelrc,sha256=hbksHBMOJhU8iQeWqMk9fBu1Ym5NiR1AxgbBBdwnvW8,131
48
+ jac_client/examples/with-router/README.md,sha256=Vj66hInHSqvv_5wxJlaH-fsvuBfwKd-qHoZFz53eqUs,189
49
+ jac_client/examples/with-router/app.jac,sha256=nbnFhgxapgp9FSdc_fYy24KKl93iiy7N1GS5GEF1L0c,8671
50
+ jac_client/examples/with-router/package.json,sha256=k8KnRIWgCrmRvmJUUB0dtG45qJFYBb-wI16w4cwrJPU,691
51
+ jac_client/examples/with-router/vite.config.js,sha256=Fw_3OJilwEKwNo6nCpWyk2Tdgmx3BeN7QKRpXIM3lfk,671
52
+ jac_client/plugin/cli.py,sha256=xaRp5k3OEdHeyLzrsDqk1UBuoBUmhqvVtGaofFYF-2A,7836
53
+ jac_client/plugin/client.py,sha256=wpdp9H3LZG3Z5Ax4T23JTvjQGguLat523XhiPpK2qQ8,2751
54
+ jac_client/plugin/client_runtime.jac,sha256=wDfckQTRSzlOZ9NwUg7pb7ljPb0tCf2e_-OtczK3uRQ,7613
55
+ jac_client/plugin/vite_client_bundle.py,sha256=UMdsL2_YmtmPj9gVnGKbvjrNoi_eSEaquyaBDieB0Wk,13390
56
+ jac_client/tests/__init__.py,sha256=zleq_UtH4HBbp9SSkkqtaLd1tvm5F3QfXHEffXpxxQo,37
57
+ jac_client/tests/fixtures/basic-app/app.jac,sha256=nTPZ3Cc5pPAEncRfrfo1Z2LAyz6DVgGdB_uUW7W4b8Q,437
58
+ jac_client/tests/fixtures/client_app_with_antd/app.jac,sha256=j2N82axLh4lKXjsAceETK0_W3kUGVMQzeFaCKYCHLQ4,490
59
+ jac_client/tests/fixtures/js_import/app.jac,sha256=O_cXpjgmVXNDlPywhE6JCnWpMXguuaGhrVlf32vrgpc,720
60
+ jac_client/tests/fixtures/js_import/utils.js,sha256=lrcZ9yUEb4QrpUpUp0gWRvISFui9_v96rWPN-btllmU,413
61
+ jac_client/tests/fixtures/package-lock.json,sha256=RKNoyMoGXx3IOm3B5d1Kt0vrgMac9intCLXGew51AAQ,19358
62
+ jac_client/tests/fixtures/package.json,sha256=s5Ltvbh1MQGeZZyyNJdqhoA21VO5F7scBcVPlgHpF3c,278
63
+ jac_client/tests/fixtures/relative_import/app.jac,sha256=F0BD1eDVATHNGOXkip6saOlsIrI-Ageh0ctw5Ky2Yq8,189
64
+ jac_client/tests/fixtures/relative_import/button.jac,sha256=8xLhhX7UpiRdzO9BLC1XwhejiKMEi50VlPFSjJP0XR8,109
65
+ jac_client/tests/fixtures/spawn_test/app.jac,sha256=2SA2kQ6vyQxNxRvTSJb6dEZDavK-YYQ2qI3Ot63_xJ4,4045
66
+ jac_client/tests/fixtures/test_fragments_spread/app.jac,sha256=zdEpVXGB_C3EmWS0TIR4EIHF4Dw_Iu4AfhBP1DDrurs,1114
67
+ jac_client/tests/test_cl.py,sha256=lR16col1HCcaJzqGlGzWVd_aF0zNMfLOfgxylvSzGZE,20109
68
+ jac_client/tests/test_create_jac_app.py,sha256=ahVpMR_7Cil988-Ji8vbpNmEUWBxtBNn0hiOtqkniQU,5514
69
+ jac_client-0.2.0.dist-info/METADATA,sha256=hPCucmge43Kd8ttKwyAgOMGEofgOp4ecFyOQwG5cAsc,4485
70
+ jac_client-0.2.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
71
+ jac_client-0.2.0.dist-info/entry_points.txt,sha256=WxzPDwDUGAvQyJ_RkIOSk3cJgJChESQGP839Kb70_vo,92
72
+ jac_client-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ [jac]
2
+ create_jac_app=jac_client.plugin.cli:JacCmd
3
+ serve=jac_client.plugin.client:JacClient
4
+