jac-client 0.2.2__py3-none-any.whl → 0.2.4__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 (176) hide show
  1. jac_client/examples/all-in-one/assets/workers/worker.py +5 -0
  2. jac_client/tests/conftest.py +281 -0
  3. jac_client/tests/test_cli.py +755 -0
  4. jac_client/tests/test_it.py +347 -67
  5. {jac_client-0.2.2.dist-info → jac_client-0.2.4.dist-info}/METADATA +30 -24
  6. jac_client-0.2.4.dist-info/RECORD +10 -0
  7. {jac_client-0.2.2.dist-info → jac_client-0.2.4.dist-info}/WHEEL +2 -1
  8. jac_client-0.2.4.dist-info/entry_points.txt +4 -0
  9. jac_client-0.2.4.dist-info/top_level.txt +1 -0
  10. jac_client/docs/README.md +0 -689
  11. jac_client/docs/advanced-state.md +0 -1265
  12. jac_client/docs/asset-serving/intro.md +0 -209
  13. jac_client/docs/assets/pipe_line-v2.svg +0 -32
  14. jac_client/docs/assets/pipe_line.png +0 -0
  15. jac_client/docs/file-system/app.jac.md +0 -121
  16. jac_client/docs/file-system/backend-frontend.md +0 -217
  17. jac_client/docs/file-system/intro.md +0 -72
  18. jac_client/docs/file-system/nested-imports.md +0 -348
  19. jac_client/docs/guide-example/intro.md +0 -115
  20. jac_client/docs/guide-example/step-01-setup.md +0 -270
  21. jac_client/docs/guide-example/step-02-components.md +0 -416
  22. jac_client/docs/guide-example/step-03-styling.md +0 -478
  23. jac_client/docs/guide-example/step-04-todo-ui.md +0 -477
  24. jac_client/docs/guide-example/step-05-local-state.md +0 -530
  25. jac_client/docs/guide-example/step-06-events.md +0 -749
  26. jac_client/docs/guide-example/step-07-effects.md +0 -468
  27. jac_client/docs/guide-example/step-08-walkers.md +0 -534
  28. jac_client/docs/guide-example/step-09-authentication.md +0 -586
  29. jac_client/docs/guide-example/step-10-routing.md +0 -539
  30. jac_client/docs/guide-example/step-11-final.md +0 -963
  31. jac_client/docs/imports.md +0 -1141
  32. jac_client/docs/lifecycle-hooks.md +0 -773
  33. jac_client/docs/routing.md +0 -659
  34. jac_client/docs/styling/intro.md +0 -249
  35. jac_client/docs/styling/js-styling.md +0 -367
  36. jac_client/docs/styling/material-ui.md +0 -341
  37. jac_client/docs/styling/pure-css.md +0 -299
  38. jac_client/docs/styling/sass.md +0 -403
  39. jac_client/docs/styling/styled-components.md +0 -395
  40. jac_client/docs/styling/tailwind.md +0 -298
  41. jac_client/examples/all-in-one/.babelrc +0 -9
  42. jac_client/examples/all-in-one/README.md +0 -16
  43. jac_client/examples/all-in-one/app.jac +0 -426
  44. jac_client/examples/all-in-one/assets/burger.png +0 -0
  45. jac_client/examples/all-in-one/button.jac +0 -7
  46. jac_client/examples/all-in-one/components/button.jac +0 -7
  47. jac_client/examples/all-in-one/package.json +0 -29
  48. jac_client/examples/all-in-one/styles.css +0 -26
  49. jac_client/examples/all-in-one/vite.config.js +0 -28
  50. jac_client/examples/asset-serving/css-with-image/.babelrc +0 -9
  51. jac_client/examples/asset-serving/css-with-image/README.md +0 -91
  52. jac_client/examples/asset-serving/css-with-image/app.jac +0 -88
  53. jac_client/examples/asset-serving/css-with-image/assets/burger.png +0 -0
  54. jac_client/examples/asset-serving/css-with-image/package.json +0 -28
  55. jac_client/examples/asset-serving/css-with-image/styles.css +0 -26
  56. jac_client/examples/asset-serving/css-with-image/vite.config.js +0 -28
  57. jac_client/examples/asset-serving/image-asset/.babelrc +0 -9
  58. jac_client/examples/asset-serving/image-asset/README.md +0 -119
  59. jac_client/examples/asset-serving/image-asset/app.jac +0 -55
  60. jac_client/examples/asset-serving/image-asset/assets/burger.png +0 -0
  61. jac_client/examples/asset-serving/image-asset/package.json +0 -28
  62. jac_client/examples/asset-serving/image-asset/styles.css +0 -26
  63. jac_client/examples/asset-serving/image-asset/vite.config.js +0 -28
  64. jac_client/examples/asset-serving/import-alias/.babelrc +0 -9
  65. jac_client/examples/asset-serving/import-alias/README.md +0 -83
  66. jac_client/examples/asset-serving/import-alias/app.jac +0 -111
  67. jac_client/examples/asset-serving/import-alias/assets/burger.png +0 -0
  68. jac_client/examples/asset-serving/import-alias/package.json +0 -28
  69. jac_client/examples/asset-serving/import-alias/vite.config.js +0 -28
  70. jac_client/examples/basic/.babelrc +0 -9
  71. jac_client/examples/basic/README.md +0 -16
  72. jac_client/examples/basic/app.jac +0 -21
  73. jac_client/examples/basic/package.json +0 -27
  74. jac_client/examples/basic/vite.config.js +0 -27
  75. jac_client/examples/basic-auth/.babelrc +0 -9
  76. jac_client/examples/basic-auth/README.md +0 -16
  77. jac_client/examples/basic-auth/app.jac +0 -308
  78. jac_client/examples/basic-auth/package.json +0 -27
  79. jac_client/examples/basic-auth/vite.config.js +0 -27
  80. jac_client/examples/basic-auth-with-router/.babelrc +0 -9
  81. jac_client/examples/basic-auth-with-router/README.md +0 -60
  82. jac_client/examples/basic-auth-with-router/app.jac +0 -464
  83. jac_client/examples/basic-auth-with-router/package.json +0 -28
  84. jac_client/examples/basic-auth-with-router/vite.config.js +0 -27
  85. jac_client/examples/basic-full-stack/.babelrc +0 -9
  86. jac_client/examples/basic-full-stack/README.md +0 -18
  87. jac_client/examples/basic-full-stack/app.jac +0 -320
  88. jac_client/examples/basic-full-stack/package.json +0 -28
  89. jac_client/examples/basic-full-stack/vite.config.js +0 -27
  90. jac_client/examples/css-styling/js-styling/.babelrc +0 -9
  91. jac_client/examples/css-styling/js-styling/README.md +0 -183
  92. jac_client/examples/css-styling/js-styling/app.jac +0 -84
  93. jac_client/examples/css-styling/js-styling/package.json +0 -28
  94. jac_client/examples/css-styling/js-styling/styles.js +0 -100
  95. jac_client/examples/css-styling/js-styling/vite.config.js +0 -27
  96. jac_client/examples/css-styling/material-ui/.babelrc +0 -9
  97. jac_client/examples/css-styling/material-ui/README.md +0 -16
  98. jac_client/examples/css-styling/material-ui/app.jac +0 -122
  99. jac_client/examples/css-styling/material-ui/package.json +0 -32
  100. jac_client/examples/css-styling/material-ui/vite.config.js +0 -27
  101. jac_client/examples/css-styling/pure-css/.babelrc +0 -9
  102. jac_client/examples/css-styling/pure-css/README.md +0 -16
  103. jac_client/examples/css-styling/pure-css/app.jac +0 -64
  104. jac_client/examples/css-styling/pure-css/package.json +0 -28
  105. jac_client/examples/css-styling/pure-css/styles.css +0 -111
  106. jac_client/examples/css-styling/pure-css/vite.config.js +0 -27
  107. jac_client/examples/css-styling/sass-example/.babelrc +0 -9
  108. jac_client/examples/css-styling/sass-example/README.md +0 -16
  109. jac_client/examples/css-styling/sass-example/app.jac +0 -64
  110. jac_client/examples/css-styling/sass-example/package.json +0 -29
  111. jac_client/examples/css-styling/sass-example/styles.scss +0 -153
  112. jac_client/examples/css-styling/sass-example/vite.config.js +0 -27
  113. jac_client/examples/css-styling/styled-components/.babelrc +0 -9
  114. jac_client/examples/css-styling/styled-components/README.md +0 -16
  115. jac_client/examples/css-styling/styled-components/app.jac +0 -71
  116. jac_client/examples/css-styling/styled-components/package.json +0 -29
  117. jac_client/examples/css-styling/styled-components/styled.js +0 -90
  118. jac_client/examples/css-styling/styled-components/vite.config.js +0 -27
  119. jac_client/examples/css-styling/tailwind-example/.babelrc +0 -9
  120. jac_client/examples/css-styling/tailwind-example/README.md +0 -16
  121. jac_client/examples/css-styling/tailwind-example/app.jac +0 -63
  122. jac_client/examples/css-styling/tailwind-example/global.css +0 -1
  123. jac_client/examples/css-styling/tailwind-example/package.json +0 -30
  124. jac_client/examples/css-styling/tailwind-example/vite.config.js +0 -29
  125. jac_client/examples/full-stack-with-auth/.babelrc +0 -9
  126. jac_client/examples/full-stack-with-auth/README.md +0 -16
  127. jac_client/examples/full-stack-with-auth/app.jac +0 -722
  128. jac_client/examples/full-stack-with-auth/package.json +0 -28
  129. jac_client/examples/full-stack-with-auth/vite.config.js +0 -29
  130. jac_client/examples/little-x/app.jac +0 -724
  131. jac_client/examples/little-x/package.json +0 -23
  132. jac_client/examples/little-x/submit-button.jac +0 -8
  133. jac_client/examples/nested-folders/nested-advance/.babelrc +0 -9
  134. jac_client/examples/nested-folders/nested-advance/ButtonRoot.jac +0 -11
  135. jac_client/examples/nested-folders/nested-advance/README.md +0 -77
  136. jac_client/examples/nested-folders/nested-advance/app.jac +0 -35
  137. jac_client/examples/nested-folders/nested-advance/level1/ButtonSecondL.jac +0 -19
  138. jac_client/examples/nested-folders/nested-advance/level1/Card.jac +0 -43
  139. jac_client/examples/nested-folders/nested-advance/level1/level2/ButtonThirdL.jac +0 -25
  140. jac_client/examples/nested-folders/nested-advance/package.json +0 -29
  141. jac_client/examples/nested-folders/nested-advance/vite.config.js +0 -28
  142. jac_client/examples/nested-folders/nested-basic/.babelrc +0 -9
  143. jac_client/examples/nested-folders/nested-basic/README.md +0 -183
  144. jac_client/examples/nested-folders/nested-basic/app.jac +0 -13
  145. jac_client/examples/nested-folders/nested-basic/app.js +0 -7
  146. jac_client/examples/nested-folders/nested-basic/button.jac +0 -7
  147. jac_client/examples/nested-folders/nested-basic/components/button.jac +0 -7
  148. jac_client/examples/nested-folders/nested-basic/package.json +0 -28
  149. jac_client/examples/nested-folders/nested-basic/vite.config.js +0 -27
  150. jac_client/examples/with-router/.babelrc +0 -9
  151. jac_client/examples/with-router/README.md +0 -17
  152. jac_client/examples/with-router/app.jac +0 -323
  153. jac_client/examples/with-router/package.json +0 -28
  154. jac_client/examples/with-router/vite.config.js +0 -27
  155. jac_client/plugin/cli.py +0 -244
  156. jac_client/plugin/client.py +0 -152
  157. jac_client/plugin/client_runtime.jac +0 -234
  158. jac_client/plugin/vite_client_bundle.py +0 -503
  159. jac_client/tests/fixtures/basic-app/app.jac +0 -23
  160. jac_client/tests/fixtures/cl_file/app.cl.jac +0 -48
  161. jac_client/tests/fixtures/cl_file/app.jac +0 -15
  162. jac_client/tests/fixtures/client_app_with_antd/app.jac +0 -34
  163. jac_client/tests/fixtures/js_import/app.jac +0 -34
  164. jac_client/tests/fixtures/js_import/utils.js +0 -21
  165. jac_client/tests/fixtures/package-lock.json +0 -329
  166. jac_client/tests/fixtures/package.json +0 -11
  167. jac_client/tests/fixtures/relative_import/app.jac +0 -11
  168. jac_client/tests/fixtures/relative_import/button.jac +0 -7
  169. jac_client/tests/fixtures/spawn_test/app.jac +0 -129
  170. jac_client/tests/fixtures/test_fragments_spread/app.jac +0 -67
  171. jac_client/tests/test_asset_examples.py +0 -322
  172. jac_client/tests/test_cl.py +0 -530
  173. jac_client/tests/test_create_jac_app.py +0 -131
  174. jac_client/tests/test_nested_file.py +0 -374
  175. jac_client-0.2.2.dist-info/RECORD +0 -171
  176. jac_client-0.2.2.dist-info/entry_points.txt +0 -4
@@ -1,209 +0,0 @@
1
- # Asset Serving in Jac
2
-
3
- Static assets such as images, fonts, videos, and stylesheets are essential for web applications. Jac provides multiple approaches for serving these assets, each suited for different use cases.
4
-
5
- !!! tip "Important"
6
- All local assets must be placed in the `assets/` folder at the root of your project. The server serves these files from the `/static/` path.
7
-
8
- ## Overview
9
-
10
- Jac supports two primary approaches for asset serving:
11
-
12
- - **Remote Assets**: External URLs from CDNs or remote servers
13
- - **Local Assets**: Files stored in your project, served by the Jac server
14
-
15
- Local assets can be referenced using either **Static Path** (direct `/static/` URLs) or **Import Alias** (Vite-processed imports with optimization).
16
-
17
- ## Remote Assets
18
-
19
- Use external URLs for assets hosted on CDNs or remote servers.
20
-
21
- ### Usage
22
-
23
- ```jac
24
- <img src="https://picsum.photos/400/300" alt="Image" />
25
- <img src="https://via.placeholder.com/400x300" alt="Placeholder" />
26
- ```
27
-
28
- ### When to Use
29
-
30
- - CDN-hosted production assets
31
- - Placeholder images during development
32
- - External resources managed outside your project
33
- - Dynamic or user-generated content
34
-
35
- ## Local Assets
36
-
37
- > **Important**: All local assets must be placed in the `assets/` folder at the root of your project. .
38
-
39
- Local assets are stored in your project and served by the Jac server. Two methods are available:
40
-
41
- ### Static Path
42
-
43
- Reference assets directly using the `/static/` path prefix.
44
-
45
- #### Usage
46
-
47
- ```jac
48
- <img src="/static/assets/burger.png" alt="Burger" />
49
- <link rel="stylesheet" href="/static/styles.css" />
50
- ```
51
-
52
- #### How It Works
53
-
54
- - Assets in the `assets/` folder are served at `/static/assets/` path
55
- - Assets in `dist/` are also accessible via `/static/`
56
- - Server automatically detects file type and sets correct MIME type
57
- - No build configuration required
58
-
59
- #### When to Use
60
-
61
- - Quick prototypes and simple applications
62
- - Assets that don't require optimization
63
- - Immediate results without build step
64
-
65
- ### Import Alias
66
-
67
- Import assets using the `@jac-client/assets` alias for Vite-processed assets.
68
-
69
- #### Usage
70
-
71
- ```jac
72
- cl import from "@jac-client/assets/burger.png" { default as burgerImage }
73
-
74
- <img src={burgerImage} alt="Burger" />
75
- ```
76
-
77
- #### How It Works
78
-
79
- - Alias configured in `vite.config.js` points to `src/assets/`
80
- - Assets from root `assets/` folder are copied to `src/assets/` during build
81
- - Vite processes imports and generates optimized asset URLs
82
- - Automatic hash generation for cache busting
83
-
84
- #### When to Use
85
-
86
- - Production applications
87
- - Assets that benefit from optimization
88
- - Type-safe asset references
89
- - Automatic cache busting
90
-
91
- ## Using Assets in CSS
92
-
93
- Assets can be referenced in CSS files using static paths.
94
-
95
- ### Usage
96
-
97
- **CSS File (`styles.css`):**
98
- ```css
99
- .container {
100
- background-image: url('/static/assets/burger.png');
101
- background-size: cover;
102
- background-position: center;
103
- }
104
-
105
- .burgerImage {
106
- width: 200px;
107
- height: auto;
108
- border-radius: 10px;
109
- }
110
- ```
111
-
112
- **Jac File:**
113
- ```jac
114
- cl import "./styles.css";
115
-
116
- <div className="container">
117
- <img src="/static/assets/burger.png" className="burgerImage" alt="Burger" />
118
- </div>
119
- ```
120
-
121
- ### Notes
122
-
123
- - CSS files reference assets using `/static/` paths
124
- - Assets are resolved at runtime by the server
125
- - Works with both background images and regular image elements
126
-
127
- ## Supported Asset Types
128
-
129
- Jac automatically serves and detects MIME types for:
130
-
131
- - **Images**: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.svg`, `.ico`, `.avif`
132
- - **Fonts**: `.woff`, `.woff2`, `.ttf`, `.otf`, `.eot`
133
- - **Media**: `.mp4`, `.webm`, `.ogg`, `.mov`, `.mp3`, `.wav`, `.m4a`
134
- - **Documents**: `.pdf`
135
- - **Stylesheets**: `.css`, `.scss`, `.sass`, `.less`
136
-
137
- ## Project Structure
138
-
139
- ```
140
- project/
141
- ├── assets/ # Static assets (served via /static/)
142
- │ ├── images/
143
- │ ├── fonts/
144
- │ └── videos/
145
- ├── src/
146
- │ └── assets/ # Assets for import alias (@jac-client/assets)
147
- └── dist/ # Vite output (auto-generated)
148
- ```
149
-
150
- ## Examples
151
-
152
- Complete working examples are available:
153
-
154
- - [`image-asset/`](../../examples/asset-serving/image-asset/) - Static path serving
155
- - [`import-alias/`](../../examples/asset-serving/import-alias/) - Import alias pattern
156
- - [`css-with-image/`](../../examples/asset-serving/css-with-image/) - Assets in CSS
157
-
158
- Run any example:
159
-
160
- ```bash
161
- cd jac-client/jac_client/examples/asset-serving/<example-name>
162
- npm install
163
- jac serve app.jac
164
- ```
165
-
166
- ## Quick Reference
167
-
168
- ### Remote URLs
169
- ```jac
170
- <img src="https://example.com/image.jpg" alt="Image" />
171
- ```
172
-
173
- ### Static Path
174
- ```jac
175
- <img src="/static/assets/logo.png" alt="Logo" />
176
- ```
177
-
178
- ### Import Alias
179
- ```jac
180
- cl import from "@jac-client/assets/logo.png" { default as logo }
181
- <img src={logo} />
182
- ```
183
-
184
- ### CSS Assets
185
- ```css
186
- .hero {
187
- background-image: url('/static/assets/hero.jpg');
188
- }
189
- ```
190
-
191
- ## Troubleshooting
192
-
193
- **Asset not found (404)**
194
- - Verify file exists in `assets/` or `dist/` directory
195
- - Check path matches file location exactly
196
-
197
- **Import not resolving**
198
- - Ensure `vite.config.js` has `@jac-client/assets` alias configured
199
- - Verify assets are copied to `src/assets/` during build
200
-
201
- **CSS background image not showing**
202
- - Use `/static/` prefix in CSS `url()` paths
203
- - Verify asset file exists in `assets/` directory
204
-
205
- ## Related Documentation
206
-
207
- - [Import System](../imports.md)
208
- - [Styling](../styling/intro.md)
209
- - [Routing](../routing.md)