create-fluxstack 1.19.0 → 1.20.1

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 (37) hide show
  1. package/LLMD/INDEX.md +1 -1
  2. package/LLMD/MAINTENANCE.md +197 -197
  3. package/LLMD/MIGRATION.md +44 -1
  4. package/LLMD/agent.md +20 -7
  5. package/LLMD/config/declarative-system.md +268 -268
  6. package/LLMD/config/environment-vars.md +3 -6
  7. package/LLMD/config/runtime-reload.md +401 -401
  8. package/LLMD/core/build-system.md +599 -599
  9. package/LLMD/core/framework-lifecycle.md +249 -229
  10. package/LLMD/core/plugin-system.md +154 -100
  11. package/LLMD/patterns/anti-patterns.md +397 -397
  12. package/LLMD/patterns/project-structure.md +264 -264
  13. package/LLMD/patterns/type-safety.md +61 -5
  14. package/LLMD/reference/cli-commands.md +31 -7
  15. package/LLMD/reference/plugin-hooks.md +4 -2
  16. package/LLMD/reference/troubleshooting.md +364 -364
  17. package/LLMD/resources/controllers.md +465 -465
  18. package/LLMD/resources/live-auth.md +178 -1
  19. package/LLMD/resources/live-binary-delta.md +3 -1
  20. package/LLMD/resources/live-components.md +1192 -1041
  21. package/LLMD/resources/live-logging.md +3 -1
  22. package/LLMD/resources/live-rooms.md +1 -1
  23. package/LLMD/resources/live-upload.md +228 -181
  24. package/LLMD/resources/plugins-external.md +8 -7
  25. package/LLMD/resources/rest-auth.md +290 -290
  26. package/LLMD/resources/routes-eden.md +254 -254
  27. package/app/client/.live-stubs/LiveAdminPanel.js +15 -0
  28. package/app/client/.live-stubs/LiveCounter.js +9 -0
  29. package/app/client/.live-stubs/LiveForm.js +11 -0
  30. package/app/client/.live-stubs/LiveLocalCounter.js +8 -0
  31. package/app/client/.live-stubs/LivePingPong.js +10 -0
  32. package/app/client/.live-stubs/LiveRoomChat.js +11 -0
  33. package/app/client/.live-stubs/LiveSharedCounter.js +10 -0
  34. package/app/client/.live-stubs/LiveUpload.js +15 -0
  35. package/app/server/live/auto-generated-components.ts +1 -1
  36. package/core/utils/version.ts +6 -6
  37. package/package.json +108 -108
package/LLMD/INDEX.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FluxStack LLM Documentation
2
2
 
3
- **Version:** 2.0.0 | **Framework:** Bun + Elysia + React + Eden Treaty
3
+ **Version:** 1.19.0 | **Framework:** Bun + Elysia + React + Eden Treaty | **Live:** @fluxstack/live 0.7.2
4
4
 
5
5
  ## Quick Navigation
6
6
 
@@ -1,197 +1,197 @@
1
- # Documentation Maintenance Guide
2
-
3
- **Version:** 1.11.0 | **Updated:** 2025-02-08
4
-
5
- ## Quick Facts
6
-
7
- - Documentation lives in `/LLMD/`
8
- - Each document tracks version and update date
9
- - Target: <2000 tokens per document
10
- - All internal links must be validated
11
-
12
- ## Document Format
13
-
14
- Every document follows this template:
15
-
16
- ```markdown
17
- # Document Title
18
-
19
- **Version:** X.Y.Z | **Updated:** YYYY-MM-DD
20
-
21
- ## Quick Facts
22
-
23
- - Key point 1
24
- - Key point 2
25
-
26
- ## [Main Sections]
27
-
28
- Content...
29
-
30
- ## Related
31
-
32
- - [Link 1](./path.md)
33
- - [Link 2](./path.md)
34
- ```
35
-
36
- ## When to Update Documentation
37
-
38
- ### Code Changes That Require Doc Updates
39
-
40
- | Change Type | Update Required |
41
- |-------------|-----------------|
42
- | New CLI command | `reference/cli-commands.md` |
43
- | New plugin hook | `reference/plugin-hooks.md`, `core/plugin-system.md` |
44
- | New config option | `config/environment-vars.md`, `config/declarative-system.md` |
45
- | Changed API pattern | `resources/routes-eden.md`, `patterns/type-safety.md` |
46
- | New framework feature | Relevant `core/*.md` file |
47
- | Build system change | `core/build-system.md` |
48
- | Breaking change | `patterns/anti-patterns.md`, `reference/troubleshooting.md` |
49
-
50
- ### Version Bump Checklist
51
-
52
- When FluxStack version changes:
53
-
54
- 1. Update `**Version:**` header in all `.md` files
55
- 2. Update `MIGRATION.md` if needed
56
- 3. Add new entries to `reference/troubleshooting.md` for version-specific issues
57
- 4. Update `INDEX.md` if new documents added
58
-
59
- ## Adding New Documentation
60
-
61
- ### New Document Checklist
62
-
63
- 1. **Create file** in appropriate directory:
64
- - `core/` - Framework internals
65
- - `config/` - Configuration system
66
- - `resources/` - Creating things (routes, controllers, plugins)
67
- - `patterns/` - Best practices and rules
68
- - `reference/` - Quick lookup (CLI, hooks, troubleshooting)
69
-
70
- 2. **Add header** with version and date
71
-
72
- 3. **Add to INDEX.md** in the right section
73
-
74
- 4. **Add Related links** at bottom of new document
75
-
76
- 5. **Cross-link** from related existing documents
77
-
78
- ### Token Efficiency Guidelines
79
-
80
- - No prose introductions ("In this document we will...")
81
- - Use tables for reference data
82
- - Use code blocks, not explanations of code
83
- - Bullet points over paragraphs
84
- - No repeated information (link instead)
85
-
86
- ## Link Validation
87
-
88
- ### Manual Check
89
-
90
- ```bash
91
- # Find all internal links
92
- grep -r "\]\(./" LLMD/ | grep "\.md"
93
-
94
- # Verify each path exists
95
- ```
96
-
97
- ### Required Links to Check
98
-
99
- Each document should have working links in:
100
- - `## Related` section at bottom
101
- - Any inline references
102
-
103
- ## Directory Structure
104
-
105
- ```
106
- LLMD/
107
- ├── INDEX.md # Navigation hub (update for new docs)
108
- ├── MIGRATION.md # Changes from ai-context/
109
- ├── MAINTENANCE.md # This file
110
- ├── core/
111
- │ ├── framework-lifecycle.md
112
- │ ├── plugin-system.md
113
- │ └── build-system.md
114
- ├── config/
115
- │ ├── declarative-system.md
116
- │ ├── environment-vars.md
117
- │ └── runtime-reload.md
118
- ├── resources/
119
- │ ├── routes-eden.md
120
- │ ├── controllers.md
121
- │ ├── live-components.md
122
- │ └── plugins-external.md
123
- ├── patterns/
124
- │ ├── project-structure.md
125
- │ ├── type-safety.md
126
- │ └── anti-patterns.md
127
- └── reference/
128
- ├── cli-commands.md
129
- ├── plugin-hooks.md
130
- └── troubleshooting.md
131
- ```
132
-
133
- ## Code Example Standards
134
-
135
- ### TypeScript Examples
136
-
137
- ```typescript
138
- // ✅ Include imports when non-obvious
139
- import { Elysia, t } from 'elysia'
140
-
141
- // ✅ Show complete, runnable snippets
142
- export const route = new Elysia()
143
- .get('/', () => ({ status: 'ok' }))
144
- ```
145
-
146
- ### Bash Examples
147
-
148
- ```bash
149
- # ✅ Include expected output when helpful
150
- bun run dev
151
- # ⚡ Starting Full-stack development server...
152
- # Backend: http://localhost:3000
153
- # Frontend: http://localhost:5173
154
- ```
155
-
156
- ### Avoid
157
-
158
- ```typescript
159
- // ❌ Incomplete snippets
160
- .get('/', () => ...)
161
-
162
- // ❌ Unexplained magic
163
- const x = doSomething() // What is doSomething?
164
- ```
165
-
166
- ## Sync with Code Changes
167
-
168
- ### Before PR
169
-
170
- 1. Check if code changes affect documentation
171
- 2. Update relevant documents
172
- 3. Update version dates
173
- 4. Validate links
174
-
175
- ### After Major Feature
176
-
177
- 1. Create new document if needed
178
- 2. Update INDEX.md
179
- 3. Add to MIGRATION.md for notable changes
180
- 4. Cross-reference from related docs
181
-
182
- ## Quality Checklist
183
-
184
- Before committing documentation changes:
185
-
186
- - [ ] Version and date updated
187
- - [ ] All code examples syntactically valid
188
- - [ ] All internal links work
189
- - [ ] No duplicate information (link instead)
190
- - [ ] Added to INDEX.md if new document
191
- - [ ] Related section has relevant links
192
- - [ ] Token count reasonable (<2000 target)
193
-
194
- ## Related
195
-
196
- - [INDEX.md](./INDEX.md) - Main navigation
197
- - [MIGRATION.md](./MIGRATION.md) - Version changes
1
+ # Documentation Maintenance Guide
2
+
3
+ **Version:** 1.19.0 | **Updated:** 2026-04-14
4
+
5
+ ## Quick Facts
6
+
7
+ - Documentation lives in `/LLMD/`
8
+ - Each document tracks version and update date
9
+ - Target: <2000 tokens per document
10
+ - All internal links must be validated
11
+
12
+ ## Document Format
13
+
14
+ Every document follows this template:
15
+
16
+ ```markdown
17
+ # Document Title
18
+
19
+ **Version:** X.Y.Z | **Updated:** YYYY-MM-DD
20
+
21
+ ## Quick Facts
22
+
23
+ - Key point 1
24
+ - Key point 2
25
+
26
+ ## [Main Sections]
27
+
28
+ Content...
29
+
30
+ ## Related
31
+
32
+ - [Link 1](./path.md)
33
+ - [Link 2](./path.md)
34
+ ```
35
+
36
+ ## When to Update Documentation
37
+
38
+ ### Code Changes That Require Doc Updates
39
+
40
+ | Change Type | Update Required |
41
+ |-------------|-----------------|
42
+ | New CLI command | `reference/cli-commands.md` |
43
+ | New plugin hook | `reference/plugin-hooks.md`, `core/plugin-system.md` |
44
+ | New config option | `config/environment-vars.md`, `config/declarative-system.md` |
45
+ | Changed API pattern | `resources/routes-eden.md`, `patterns/type-safety.md` |
46
+ | New framework feature | Relevant `core/*.md` file |
47
+ | Build system change | `core/build-system.md` |
48
+ | Breaking change | `patterns/anti-patterns.md`, `reference/troubleshooting.md` |
49
+
50
+ ### Version Bump Checklist
51
+
52
+ When FluxStack version changes:
53
+
54
+ 1. Update `**Version:**` header in all `.md` files
55
+ 2. Update `MIGRATION.md` if needed
56
+ 3. Add new entries to `reference/troubleshooting.md` for version-specific issues
57
+ 4. Update `INDEX.md` if new documents added
58
+
59
+ ## Adding New Documentation
60
+
61
+ ### New Document Checklist
62
+
63
+ 1. **Create file** in appropriate directory:
64
+ - `core/` - Framework internals
65
+ - `config/` - Configuration system
66
+ - `resources/` - Creating things (routes, controllers, plugins)
67
+ - `patterns/` - Best practices and rules
68
+ - `reference/` - Quick lookup (CLI, hooks, troubleshooting)
69
+
70
+ 2. **Add header** with version and date
71
+
72
+ 3. **Add to INDEX.md** in the right section
73
+
74
+ 4. **Add Related links** at bottom of new document
75
+
76
+ 5. **Cross-link** from related existing documents
77
+
78
+ ### Token Efficiency Guidelines
79
+
80
+ - No prose introductions ("In this document we will...")
81
+ - Use tables for reference data
82
+ - Use code blocks, not explanations of code
83
+ - Bullet points over paragraphs
84
+ - No repeated information (link instead)
85
+
86
+ ## Link Validation
87
+
88
+ ### Manual Check
89
+
90
+ ```bash
91
+ # Find all internal links
92
+ grep -r "\]\(./" LLMD/ | grep "\.md"
93
+
94
+ # Verify each path exists
95
+ ```
96
+
97
+ ### Required Links to Check
98
+
99
+ Each document should have working links in:
100
+ - `## Related` section at bottom
101
+ - Any inline references
102
+
103
+ ## Directory Structure
104
+
105
+ ```
106
+ LLMD/
107
+ ├── INDEX.md # Navigation hub (update for new docs)
108
+ ├── MIGRATION.md # Changes from ai-context/
109
+ ├── MAINTENANCE.md # This file
110
+ ├── core/
111
+ │ ├── framework-lifecycle.md
112
+ │ ├── plugin-system.md
113
+ │ └── build-system.md
114
+ ├── config/
115
+ │ ├── declarative-system.md
116
+ │ ├── environment-vars.md
117
+ │ └── runtime-reload.md
118
+ ├── resources/
119
+ │ ├── routes-eden.md
120
+ │ ├── controllers.md
121
+ │ ├── live-components.md
122
+ │ └── plugins-external.md
123
+ ├── patterns/
124
+ │ ├── project-structure.md
125
+ │ ├── type-safety.md
126
+ │ └── anti-patterns.md
127
+ └── reference/
128
+ ├── cli-commands.md
129
+ ├── plugin-hooks.md
130
+ └── troubleshooting.md
131
+ ```
132
+
133
+ ## Code Example Standards
134
+
135
+ ### TypeScript Examples
136
+
137
+ ```typescript
138
+ // ✅ Include imports when non-obvious
139
+ import { Elysia, t } from 'elysia'
140
+
141
+ // ✅ Show complete, runnable snippets
142
+ export const route = new Elysia()
143
+ .get('/', () => ({ status: 'ok' }))
144
+ ```
145
+
146
+ ### Bash Examples
147
+
148
+ ```bash
149
+ # ✅ Include expected output when helpful
150
+ bun run dev
151
+ # ⚡ Starting Full-stack development server...
152
+ # Backend: http://localhost:3000
153
+ # Frontend: http://localhost:5173
154
+ ```
155
+
156
+ ### Avoid
157
+
158
+ ```typescript
159
+ // ❌ Incomplete snippets
160
+ .get('/', () => ...)
161
+
162
+ // ❌ Unexplained magic
163
+ const x = doSomething() // What is doSomething?
164
+ ```
165
+
166
+ ## Sync with Code Changes
167
+
168
+ ### Before PR
169
+
170
+ 1. Check if code changes affect documentation
171
+ 2. Update relevant documents
172
+ 3. Update version dates
173
+ 4. Validate links
174
+
175
+ ### After Major Feature
176
+
177
+ 1. Create new document if needed
178
+ 2. Update INDEX.md
179
+ 3. Add to MIGRATION.md for notable changes
180
+ 4. Cross-reference from related docs
181
+
182
+ ## Quality Checklist
183
+
184
+ Before committing documentation changes:
185
+
186
+ - [ ] Version and date updated
187
+ - [ ] All code examples syntactically valid
188
+ - [ ] All internal links work
189
+ - [ ] No duplicate information (link instead)
190
+ - [ ] Added to INDEX.md if new document
191
+ - [ ] Related section has relevant links
192
+ - [ ] Token count reasonable (<2000 target)
193
+
194
+ ## Related
195
+
196
+ - [INDEX.md](./INDEX.md) - Main navigation
197
+ - [MIGRATION.md](./MIGRATION.md) - Version changes
package/LLMD/MIGRATION.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Migration Guide: ai-context/ → LLMD/
2
2
 
3
- **Version:** 1.11.0 | **Updated:** 2025-02-08
3
+ **Version:** 1.19.0 | **Updated:** 2026-04-14
4
4
 
5
5
  ## Overview
6
6
 
@@ -145,6 +145,49 @@ These rules remain the same in both documentation systems:
145
145
  - **ALWAYS** use native Eden Treaty: `const { data, error } = await api.users.get()`
146
146
  - **ALWAYS** define shared types in `app/shared/`
147
147
 
148
+ ## Changes v1.12 to v1.19
149
+
150
+ This section documents the major changes that occurred between v1.12 and v1.19. All LLMD documents have been updated to reflect these changes.
151
+
152
+ ### Plugin-Kit Extraction (v1.19)
153
+
154
+ - **Auto-discovery removed**: The automatic plugin discovery from `node_modules/` was removed in `@fluxstack/plugin-kit@0.4.0` because it broke silently in production bundles (`dist/node_modules/` does not exist).
155
+ - **Manual registration via `.use()`**: Every plugin the app wants to enable must now be explicitly imported and registered via `.use()` in `app/server/index.ts`.
156
+ - **Project plugins (`plugins/`)**: Also require explicit registration; the `PLUGINS_DISCOVER_PROJECT` env var no longer applies.
157
+ - **Example** (from `app/server/index.ts`):
158
+ ```typescript
159
+ import { csrfProtectionPlugin } from "@fluxstack/plugin-csrf-protection"
160
+
161
+ const framework = new FluxStackFramework()
162
+ .use(swaggerPlugin)
163
+ .use(liveComponentsPlugin)
164
+ .use(csrfProtectionPlugin)
165
+ ```
166
+
167
+ ### @fluxstack/live 0.7.2
168
+
169
+ - **Custom `generateId`**: LiveServer now accepts a custom ID generator function, allowing UUIDs, nanoid, or any other strategy.
170
+ - **WebSocket optimizations**: Reduced overhead on message encoding/decoding and improved reconnection logic.
171
+
172
+ ### Reactive State Proxy (v1.12)
173
+
174
+ - State mutations auto-sync with the frontend via Proxy.
175
+ - `this.state.count++` triggers a `STATE_DELTA` automatically.
176
+ - `setState()` remains available for batch updates (multiple properties in a single emit).
177
+
178
+ ### Static defaultState (v1.12)
179
+
180
+ - `defaultState` is now defined inside the class as a static property.
181
+ - Old pattern (`export const defaultState = {...}` outside the class) is deprecated.
182
+ - Less boilerplate, better encapsulation.
183
+
184
+ ### Theme System (v1.18)
185
+
186
+ - Built-in theme support for the frontend with light/dark mode.
187
+ - Theme configuration via `config/client.config.ts`.
188
+
189
+ ---
190
+
148
191
  ## Feedback
149
192
 
150
193
  If you find outdated content or missing information in `LLMD/`, please update the relevant document and increment the update date.
package/LLMD/agent.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FluxStack Agent Guide
2
2
 
3
- **Version:** 1.13.0 | **Updated:** 2025-02-14
3
+ **Version:** 1.19.0 | **Updated:** 2026-04-14
4
4
 
5
5
  > Guia completo para agentes de IA que auxiliam desenvolvedores a configurar, construir e manter aplicacoes FluxStack.
6
6
 
@@ -44,7 +44,7 @@ FluxStack/
44
44
  ├── config/ # CONFIGURACOES (declarativas, com validacao)
45
45
  │ ├── system/ # Defaults do framework (base)
46
46
  │ └── *.config.ts # Overrides do usuario
47
- ├── plugins/ # PLUGINS DO PROJETO (auto-discovered, confiaveis)
47
+ ├── plugins/ # PLUGINS DO PROJETO (registro manual via .use())
48
48
  ├── tests/ # TESTES (Vitest)
49
49
  └── LLMD/ # DOCUMENTACAO LLM-optimizada
50
50
  ```
@@ -420,7 +420,20 @@ const meuPlugin: FluxStackPlugin = {
420
420
  export default meuPlugin
421
421
  ```
422
422
 
423
- Plugins em `plugins/` sao auto-discovered e confiaveis. Nao precisam de whitelist.
423
+ **Passo 3 - Registrar o plugin** em `app/server/index.ts`:
424
+
425
+ Desde v1.19 (plugin-kit 0.4.0), todos os plugins devem ser registrados manualmente via `.use()`.
426
+ Nao existe mais auto-discovery de plugins. Importe e registre explicitamente:
427
+
428
+ ```typescript
429
+ // app/server/index.ts
430
+ import meuPlugin from '../../plugins/meu-plugin'
431
+
432
+ const framework = new FluxStackFramework()
433
+ .use(swaggerPlugin)
434
+ .use(liveComponentsPlugin)
435
+ .use(meuPlugin) // <-- registro explicito
436
+ ```
424
437
 
425
438
  ---
426
439
 
@@ -718,7 +731,7 @@ bun run flux plugin:remove nome-plugin # Remover plugin
718
731
  3. **Omitir response schemas** - Eden Treaty perde a tipagem no frontend
719
732
  4. **Usar `process.env` diretamente** - Use o sistema de config declarativo
720
733
  5. **Colocar logica de negocio em rotas** - Use controllers/services
721
- 6. **Habilitar NPM discovery sem whitelist** - Risco de supply chain attack
734
+ 6. **Usar plugins sem registro explicito via .use()** - Auto-discovery foi removida em v1.19
722
735
  7. **Criar tipos manuais para respostas de API** - Eden Treaty infere automaticamente
723
736
  8. **Usar imports relativos profundos** - Use path aliases (@server, @client, etc.)
724
737
  9. **Armazenar dados nao-serializaveis no state de Live Components**
@@ -765,9 +778,9 @@ Live Component nao sincroniza?
765
778
  │ └── SIM → State e serializavel (sem functions, Date, etc.)?
766
779
 
767
780
  Plugin nao carrega?
768
- ├── E plugin NPM?
769
- │ ├── SIMPLUGINS_DISCOVER_NPM=true e PLUGINS_ALLOWED configurado?
770
- │ └── NAOEsta em plugins/ com export default?
781
+ ├── Foi importado e registrado via .use() em app/server/index.ts?
782
+ │ ├── NAOImportar e registrar com framework.use(meuPlugin)
783
+ │ └── SIMExport default esta correto no index.ts do plugin?
771
784
  └── Verificar logs de seguranca no console
772
785
 
773
786
  Config nao carrega?