resuxjs 0.3.6 → 0.3.8

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 (38) hide show
  1. package/README.md +251 -251
  2. package/dist/cli.js +308 -295
  3. package/dist/cli.js.map +1 -1
  4. package/dist/compiler/implementation.js +266 -162
  5. package/dist/compiler/index.js.map +1 -1
  6. package/dist/core/module-container.d.ts +4 -0
  7. package/dist/core/module-container.js +35 -8
  8. package/dist/core/module-container.js.map +1 -1
  9. package/dist/create.js +446 -446
  10. package/dist/deploy/framework-runtime.d.ts +1 -0
  11. package/dist/deploy/framework-runtime.js +56 -0
  12. package/dist/deploy/framework-runtime.js.map +1 -0
  13. package/dist/deploy/netlify.js +7 -0
  14. package/dist/deploy/netlify.js.map +1 -1
  15. package/dist/deploy/production-report.d.ts +1 -0
  16. package/dist/deploy/production-report.js +19 -0
  17. package/dist/deploy/production-report.js.map +1 -0
  18. package/dist/deploy/runtime-dependencies.d.ts +4 -0
  19. package/dist/deploy/runtime-dependencies.js +237 -0
  20. package/dist/deploy/runtime-dependencies.js.map +1 -0
  21. package/dist/deploy/vercel.js +7 -125
  22. package/dist/deploy/vercel.js.map +1 -1
  23. package/dist/halal-core/ai/classifyRuntimeContent.js +20 -20
  24. package/dist/halal-core/report/generateHalalReport.js +17 -17
  25. package/dist/i18n/index.js +45 -6
  26. package/dist/i18n/index.js.map +1 -1
  27. package/dist/i18n/shared.js +11 -1
  28. package/dist/i18n/shared.js.map +1 -1
  29. package/dist/icons/index.d.ts +4 -4
  30. package/dist/runtime/index.d.ts +2 -0
  31. package/dist/runtime/index.js +9307 -8941
  32. package/dist/runtime/index.js.map +1 -1
  33. package/dist/ui/index.d.ts +15 -15
  34. package/dist/ui/index.js +254 -250
  35. package/dist/ui/index.js.map +1 -1
  36. package/package.json +150 -150
  37. package/templates/default/README.md +18 -18
  38. package/templates/default/pages/index.vue +102 -102
package/README.md CHANGED
@@ -1,251 +1,251 @@
1
- # Resux
2
-
3
- **Resux** stands for **Resumability + User Experience (UX)**.
4
-
5
- Resux is an experimental HTML-first web framework with a custom resumable runtime. It uses familiar `.vue` files and file-based routing, but normal Resux components do **not** use Vue hydration or the Vue runtime. The compiler renders HTML on the server, serializes the state needed to continue, and loads browser handler code when interaction actually needs it.
6
-
7
- 📖 **Documentation:** https://mahmoudabdalrhmanmohamed.github.io/resux-docs/
8
-
9
- ## Why Resux
10
-
11
- Resux is centered on explicit runtime cost:
12
-
13
- - server-render useful HTML first;
14
- - preserve serializable state for resumability;
15
- - load event-handler/client code on interaction instead of hydrating every normal component;
16
- - use progressive client enhancements when server HTML can remain useful first;
17
- - use Vue islands only when a widget genuinely needs a Vue component/runtime subtree;
18
- - keep server-only, client-only, and progressive package boundaries explicit.
19
-
20
- The documentation explains these boundaries in detail rather than describing Resux as a normal Vue SSR framework.
21
-
22
- ## Create an app
23
-
24
- ```sh
25
- npx create-resuxjs@latest my-app
26
- cd my-app
27
- npm install
28
- npm run dev
29
- ```
30
-
31
- You can also scaffold through the framework CLI:
32
-
33
- ```sh
34
- npx resuxjs@latest init my-app
35
- ```
36
-
37
- Current framework source requires Node.js `>=20.19.0`.
38
-
39
- ## A normal Resux component
40
-
41
- ```vue
42
- <script setup lang="ts">
43
- const count = ref(0)
44
-
45
- function increment() {
46
- count.value++
47
- }
48
- </script>
49
-
50
- <template>
51
- <button @click="increment">
52
- Count: {{ count }}
53
- </button>
54
- </template>
55
- ```
56
-
57
- The normal Resux path is compiled into server HTML, serialized state, and resumable event-handler modules. It is not automatically turned into a Vue-hydrated component.
58
-
59
- ## Main framework areas
60
-
61
- The documentation site is the authoritative deep reference for:
62
-
63
- - compiler and supported SFC/template syntax;
64
- - SSR, resumability, state, handlers, and client navigation;
65
- - pages, layouts, middleware, plugins, server routes, modules, hooks, and route rules;
66
- - data fetching, runtime config, SEO/head APIs, error handling, and TypeScript;
67
- - third-party package modes and progressive client enhancements;
68
- - first-party images/video media primitives;
69
- - optional UI, icon, font, i18n, and Vue-island features;
70
- - CLI, inspection/check commands, deployment, security, testing, release flow, and Halal Core;
71
- - public package exports and API references.
72
-
73
- Start with the **Framework Tour**, then use the API/reference sections for exact contracts.
74
-
75
- ## First-party images and video
76
-
77
- `ResuxImg`, `ResuxPicture`, and `ResuxVideo` are handled by the Resux renderer. They are **not** `resuxjs/ui` Vue components.
78
-
79
- ```vue
80
- <ResuxImg
81
- src="/images/hero.jpg"
82
- alt="Product dashboard"
83
- width="1200"
84
- height="675"
85
- sizes="100vw"
86
- priority
87
- />
88
- ```
89
-
90
- The media runtime supports responsive image candidates, image transformation URLs/providers, placeholders, lazy/priority behavior, preloads, picture sources, video loading strategies, and optional image/video transformation paths. Image transformation uses Sharp; video transformation uses FFmpeg when requested.
91
-
92
- Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/media/
93
-
94
- ## UI components (`resuxjs/ui`)
95
-
96
- The UI package is optional and Vue-owned. Its public `Rx*` components (with matching `Resux*` aliases) belong inside a Vue island or another explicit Vue runtime boundary.
97
-
98
- ```vue
99
- <script setup lang="ts">
100
- import { ref } from 'vue'
101
- import { RxButton, RxModal } from 'resuxjs/ui'
102
-
103
- const open = ref(false)
104
- </script>
105
-
106
- <template>
107
- <RxButton @click="open = true">Open</RxButton>
108
- <RxModal v-model:open="open" title="Details">
109
- Vue-owned modal content
110
- </RxModal>
111
- </template>
112
- ```
113
-
114
- The package also exports `defineUiTokens()`, `isReducedMotion()`, `useAnimate()`, and the Vue directives `vAnime` / `vAnimate`.
115
-
116
- Important current limits are documented per component. For example, component names do not imply unimplemented behavior: `RxReveal` currently animates on mount rather than viewport visibility, and `RxAutoAnimate` currently performs one mount animation rather than mutation-aware layout animation.
117
-
118
- Component catalog: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/components/
119
-
120
- ## Icons (`resuxjs/icons`)
121
-
122
- The icons package provides a **Vue SVG icon component**, a mutable local SVG-path registry, and optional client-side Iconify-compatible remote fetching.
123
-
124
- ```vue
125
- <script setup lang="ts">
126
- import { Icon } from 'resuxjs/icons'
127
- </script>
128
-
129
- <template>
130
- <Icon name="check" />
131
- <Icon name="ph:check-circle" lazy />
132
- </template>
133
- ```
134
-
135
- Current module defaults include `collections: []`, `mode: 'svg'`, component name `Icon`, and `lazy: false`. Local registry entries can render without a remote request; unknown remote icons resolve on the client. `collections` does not automatically mean entire icon collections are pre-bundled.
136
-
137
- Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/icons/
138
-
139
- ## Fonts (`resuxjs/fonts`)
140
-
141
- The first-party fonts module is currently a **Google Fonts stylesheet loader**. It supports configured families/weights, `font-display`, preconnect, and eager/preload/lazy loading strategies.
142
-
143
- ```ts
144
- export default defineResuxConfig({
145
- modules: [
146
- ['resuxjs/fonts', {
147
- google: [
148
- {
149
- name: 'Inter',
150
- weights: ['100..900'],
151
- display: 'swap'
152
- }
153
- ]
154
- }]
155
- ]
156
- })
157
- ```
158
-
159
- It does not currently implement local font discovery, self-host/download management, provider plugins, generated `@font-face`, fallback metric generation, or CSS-variable generation.
160
-
161
- Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/fonts/
162
-
163
- ## i18n (`resuxjs/i18n`)
164
-
165
- Internationalization is opt-in:
166
-
167
- ```ts
168
- export default defineResuxConfig({
169
- modules: ['resuxjs/i18n'],
170
- i18n: {
171
- defaultLocale: 'en',
172
- fallbackLocale: 'en',
173
- strategy: 'prefix_except_default',
174
- locales: [
175
- { code: 'en', name: 'English', dir: 'ltr' },
176
- { code: 'ar', name: 'العربية', dir: 'rtl' }
177
- ],
178
- messages: {
179
- en: () => import('./locales/en.json'),
180
- ar: () => import('./locales/ar.json')
181
- }
182
- }
183
- })
184
- ```
185
-
186
- See the documentation for routing strategy, translation helpers, locale switching, and SEO/hreflang behavior.
187
-
188
- ## Public package entry points
189
-
190
- Resux separates browser/runtime and build/server concerns through package exports, including:
191
-
192
- ```txt
193
- resuxjs
194
- resuxjs/runtime
195
- resuxjs/reactivity
196
- resuxjs/compiler
197
- resuxjs/create
198
- resuxjs/i18n
199
- resuxjs/ui
200
- resuxjs/icons
201
- resuxjs/fonts
202
- resuxjs/kit
203
- resuxjs/core
204
- resuxjs/halal
205
- resuxjs/node
206
- resuxjs/globals
207
- ```
208
-
209
- Use the focused package entry point when it keeps server/compiler code out of client-facing code or makes an optional feature boundary explicit.
210
-
211
- Package/API coverage: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/reference/coverage
212
-
213
- ## CLI
214
-
215
- Common commands include:
216
-
217
- ```sh
218
- resux init <project-dir>
219
- resux dev <app-root>
220
- resux build <app-root>
221
- resux prepare <app-root>
222
- resux preview <app-root>
223
- resux start <app-root>
224
- resux inspect <app-root>
225
- resux check <app-root>
226
- resux deploy <app-root>
227
- ```
228
-
229
- Run `resux --help` and the CLI reference for the complete current options instead of relying on README snippets for every flag.
230
-
231
- ## Development
232
-
233
- ```sh
234
- npm install
235
- npm run typecheck
236
- npm run build
237
- npm test
238
- npm run test:templates
239
- ```
240
-
241
- For the repository's complete verification matrix, use the scripts defined in `package.json` and the GitHub Actions workflows. Release/package verification intentionally runs more checks than this introductory README lists.
242
-
243
- ## Documentation rule
244
-
245
- The **source code, package exports, and tests are the source of truth**. The README is intentionally an introduction rather than a duplicate of the complete documentation site.
246
-
247
- When a public API changes, update the implementation/tests and the relevant documentation together. Do not document a feature merely because a comparable framework has it.
248
-
249
- ## License
250
-
251
- See [LICENSE](LICENSE).
1
+ # Resux
2
+
3
+ **Resux** stands for **Resumability + User Experience (UX)**.
4
+
5
+ Resux is an experimental HTML-first web framework with a custom resumable runtime. It uses familiar `.vue` files and file-based routing, but normal Resux components do **not** use Vue hydration or the Vue runtime. The compiler renders HTML on the server, serializes the state needed to continue, and loads browser handler code when interaction actually needs it.
6
+
7
+ 📖 **Documentation:** https://mahmoudabdalrhmanmohamed.github.io/resux-docs/
8
+
9
+ ## Why Resux
10
+
11
+ Resux is centered on explicit runtime cost:
12
+
13
+ - server-render useful HTML first;
14
+ - preserve serializable state for resumability;
15
+ - load event-handler/client code on interaction instead of hydrating every normal component;
16
+ - use progressive client enhancements when server HTML can remain useful first;
17
+ - use Vue islands only when a widget genuinely needs a Vue component/runtime subtree;
18
+ - keep server-only, client-only, and progressive package boundaries explicit.
19
+
20
+ The documentation explains these boundaries in detail rather than describing Resux as a normal Vue SSR framework.
21
+
22
+ ## Create an app
23
+
24
+ ```sh
25
+ npx create-resuxjs@latest my-app
26
+ cd my-app
27
+ npm install
28
+ npm run dev
29
+ ```
30
+
31
+ You can also scaffold through the framework CLI:
32
+
33
+ ```sh
34
+ npx resuxjs@latest init my-app
35
+ ```
36
+
37
+ Current framework source requires Node.js `>=20.19.0`.
38
+
39
+ ## A normal Resux component
40
+
41
+ ```vue
42
+ <script setup lang="ts">
43
+ const count = ref(0)
44
+
45
+ function increment() {
46
+ count.value++
47
+ }
48
+ </script>
49
+
50
+ <template>
51
+ <button @click="increment">
52
+ Count: {{ count }}
53
+ </button>
54
+ </template>
55
+ ```
56
+
57
+ The normal Resux path is compiled into server HTML, serialized state, and resumable event-handler modules. It is not automatically turned into a Vue-hydrated component.
58
+
59
+ ## Main framework areas
60
+
61
+ The documentation site is the authoritative deep reference for:
62
+
63
+ - compiler and supported SFC/template syntax;
64
+ - SSR, resumability, state, handlers, and client navigation;
65
+ - pages, layouts, middleware, plugins, server routes, modules, hooks, and route rules;
66
+ - data fetching, runtime config, SEO/head APIs, error handling, and TypeScript;
67
+ - third-party package modes and progressive client enhancements;
68
+ - first-party images/video media primitives;
69
+ - optional UI, icon, font, i18n, and Vue-island features;
70
+ - CLI, inspection/check commands, deployment, security, testing, release flow, and Halal Core;
71
+ - public package exports and API references.
72
+
73
+ Start with the **Framework Tour**, then use the API/reference sections for exact contracts.
74
+
75
+ ## First-party images and video
76
+
77
+ `ResuxImg`, `ResuxPicture`, and `ResuxVideo` are handled by the Resux renderer. They are **not** `resuxjs/ui` Vue components.
78
+
79
+ ```vue
80
+ <ResuxImg
81
+ src="/images/hero.jpg"
82
+ alt="Product dashboard"
83
+ width="1200"
84
+ height="675"
85
+ sizes="100vw"
86
+ priority
87
+ />
88
+ ```
89
+
90
+ The media runtime supports responsive image candidates, image transformation URLs/providers, placeholders, lazy/priority behavior, preloads, picture sources, video loading strategies, and optional image/video transformation paths. Image transformation uses Sharp; video transformation uses FFmpeg when requested.
91
+
92
+ Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/media/
93
+
94
+ ## UI components (`resuxjs/ui`)
95
+
96
+ The UI package is optional and Vue-owned. Its public `Rx*` components (with matching `Resux*` aliases) belong inside a Vue island or another explicit Vue runtime boundary.
97
+
98
+ ```vue
99
+ <script setup lang="ts">
100
+ import { ref } from 'vue'
101
+ import { RxButton, RxModal } from 'resuxjs/ui'
102
+
103
+ const open = ref(false)
104
+ </script>
105
+
106
+ <template>
107
+ <RxButton @click="open = true">Open</RxButton>
108
+ <RxModal v-model:open="open" title="Details">
109
+ Vue-owned modal content
110
+ </RxModal>
111
+ </template>
112
+ ```
113
+
114
+ The package also exports `defineUiTokens()`, `isReducedMotion()`, `useAnimate()`, and the Vue directives `vAnime` / `vAnimate`.
115
+
116
+ Important current limits are documented per component. For example, component names do not imply unimplemented behavior: `RxReveal` currently animates on mount rather than viewport visibility, and `RxAutoAnimate` currently performs one mount animation rather than mutation-aware layout animation.
117
+
118
+ Component catalog: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/components/
119
+
120
+ ## Icons (`resuxjs/icons`)
121
+
122
+ The icons package provides a **Vue SVG icon component**, a mutable local SVG-path registry, and optional client-side Iconify-compatible remote fetching.
123
+
124
+ ```vue
125
+ <script setup lang="ts">
126
+ import { Icon } from 'resuxjs/icons'
127
+ </script>
128
+
129
+ <template>
130
+ <Icon name="check" />
131
+ <Icon name="ph:check-circle" lazy />
132
+ </template>
133
+ ```
134
+
135
+ Current module defaults include `collections: []`, `mode: 'svg'`, component name `Icon`, and `lazy: false`. Local registry entries can render without a remote request; unknown remote icons resolve on the client. `collections` does not automatically mean entire icon collections are pre-bundled.
136
+
137
+ Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/icons/
138
+
139
+ ## Fonts (`resuxjs/fonts`)
140
+
141
+ The first-party fonts module is currently a **Google Fonts stylesheet loader**. It supports configured families/weights, `font-display`, preconnect, and eager/preload/lazy loading strategies.
142
+
143
+ ```ts
144
+ export default defineResuxConfig({
145
+ modules: [
146
+ ['resuxjs/fonts', {
147
+ google: [
148
+ {
149
+ name: 'Inter',
150
+ weights: ['100..900'],
151
+ display: 'swap'
152
+ }
153
+ ]
154
+ }]
155
+ ]
156
+ })
157
+ ```
158
+
159
+ It does not currently implement local font discovery, self-host/download management, provider plugins, generated `@font-face`, fallback metric generation, or CSS-variable generation.
160
+
161
+ Deep reference: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/fonts/
162
+
163
+ ## i18n (`resuxjs/i18n`)
164
+
165
+ Internationalization is opt-in:
166
+
167
+ ```ts
168
+ export default defineResuxConfig({
169
+ modules: ['resuxjs/i18n'],
170
+ i18n: {
171
+ defaultLocale: 'en',
172
+ fallbackLocale: 'en',
173
+ strategy: 'prefix_except_default',
174
+ locales: [
175
+ { code: 'en', name: 'English', dir: 'ltr' },
176
+ { code: 'ar', name: 'العربية', dir: 'rtl' }
177
+ ],
178
+ messages: {
179
+ en: () => import('./locales/en.json'),
180
+ ar: () => import('./locales/ar.json')
181
+ }
182
+ }
183
+ })
184
+ ```
185
+
186
+ See the documentation for routing strategy, translation helpers, locale switching, and SEO/hreflang behavior.
187
+
188
+ ## Public package entry points
189
+
190
+ Resux separates browser/runtime and build/server concerns through package exports, including:
191
+
192
+ ```txt
193
+ resuxjs
194
+ resuxjs/runtime
195
+ resuxjs/reactivity
196
+ resuxjs/compiler
197
+ resuxjs/create
198
+ resuxjs/i18n
199
+ resuxjs/ui
200
+ resuxjs/icons
201
+ resuxjs/fonts
202
+ resuxjs/kit
203
+ resuxjs/core
204
+ resuxjs/halal
205
+ resuxjs/node
206
+ resuxjs/globals
207
+ ```
208
+
209
+ Use the focused package entry point when it keeps server/compiler code out of client-facing code or makes an optional feature boundary explicit.
210
+
211
+ Package/API coverage: https://mahmoudabdalrhmanmohamed.github.io/resux-docs/reference/coverage
212
+
213
+ ## CLI
214
+
215
+ Common commands include:
216
+
217
+ ```sh
218
+ resux init <project-dir>
219
+ resux dev <app-root>
220
+ resux build <app-root>
221
+ resux prepare <app-root>
222
+ resux preview <app-root>
223
+ resux start <app-root>
224
+ resux inspect <app-root>
225
+ resux check <app-root>
226
+ resux deploy <app-root>
227
+ ```
228
+
229
+ Run `resux --help` and the CLI reference for the complete current options instead of relying on README snippets for every flag.
230
+
231
+ ## Development
232
+
233
+ ```sh
234
+ npm install
235
+ npm run typecheck
236
+ npm run build
237
+ npm test
238
+ npm run test:templates
239
+ ```
240
+
241
+ For the repository's complete verification matrix, use the scripts defined in `package.json` and the GitHub Actions workflows. Release/package verification intentionally runs more checks than this introductory README lists.
242
+
243
+ ## Documentation rule
244
+
245
+ The **source code, package exports, and tests are the source of truth**. The README is intentionally an introduction rather than a duplicate of the complete documentation site.
246
+
247
+ When a public API changes, update the implementation/tests and the relevant documentation together. Do not document a feature merely because a comparable framework has it.
248
+
249
+ ## License
250
+
251
+ See [LICENSE](LICENSE).