create-fluxstack 1.18.1 → 1.20.0

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 (69) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/LLMD/INDEX.md +1 -1
  3. package/LLMD/MAINTENANCE.md +197 -197
  4. package/LLMD/MIGRATION.md +44 -1
  5. package/LLMD/agent.md +20 -7
  6. package/LLMD/config/declarative-system.md +268 -268
  7. package/LLMD/config/environment-vars.md +3 -6
  8. package/LLMD/config/runtime-reload.md +401 -401
  9. package/LLMD/core/build-system.md +599 -599
  10. package/LLMD/core/framework-lifecycle.md +249 -229
  11. package/LLMD/core/plugin-system.md +154 -100
  12. package/LLMD/patterns/anti-patterns.md +397 -397
  13. package/LLMD/patterns/project-structure.md +264 -264
  14. package/LLMD/patterns/type-safety.md +61 -5
  15. package/LLMD/reference/cli-commands.md +31 -7
  16. package/LLMD/reference/plugin-hooks.md +4 -2
  17. package/LLMD/reference/troubleshooting.md +364 -364
  18. package/LLMD/resources/controllers.md +465 -465
  19. package/LLMD/resources/live-auth.md +178 -1
  20. package/LLMD/resources/live-binary-delta.md +3 -1
  21. package/LLMD/resources/live-components.md +1192 -1041
  22. package/LLMD/resources/live-logging.md +3 -1
  23. package/LLMD/resources/live-rooms.md +1 -1
  24. package/LLMD/resources/live-upload.md +228 -181
  25. package/LLMD/resources/plugins-external.md +8 -7
  26. package/LLMD/resources/rest-auth.md +290 -290
  27. package/LLMD/resources/routes-eden.md +254 -254
  28. package/app/client/src/App.tsx +7 -7
  29. package/app/client/src/components/AppLayout.tsx +60 -23
  30. package/app/client/src/components/ColorWheel.tsx +195 -0
  31. package/app/client/src/components/DemoPage.tsx +5 -3
  32. package/app/client/src/components/LiveUploadWidget.tsx +1 -1
  33. package/app/client/src/components/ThemePicker.tsx +307 -0
  34. package/app/client/src/config/theme.config.ts +127 -0
  35. package/app/client/src/hooks/useThemeClock.ts +66 -0
  36. package/app/client/src/index.css +193 -0
  37. package/app/client/src/lib/theme-clock.ts +201 -0
  38. package/app/client/src/live/AuthDemo.tsx +9 -9
  39. package/app/client/src/live/CounterDemo.tsx +10 -10
  40. package/app/client/src/live/FormDemo.tsx +8 -8
  41. package/app/client/src/live/PingPongDemo.tsx +10 -10
  42. package/app/client/src/live/RoomChatDemo.tsx +10 -10
  43. package/app/client/src/live/SharedCounterDemo.tsx +5 -5
  44. package/app/client/src/pages/ApiTestPage.tsx +5 -5
  45. package/app/client/src/pages/HomePage.tsx +12 -12
  46. package/app/server/index.ts +8 -0
  47. package/app/server/live/auto-generated-components.ts +1 -1
  48. package/core/build/index.ts +1 -1
  49. package/core/cli/command-registry.ts +1 -1
  50. package/core/cli/commands/build.ts +25 -6
  51. package/core/cli/commands/plugin-deps.ts +1 -2
  52. package/core/cli/generators/plugin.ts +433 -581
  53. package/core/framework/server.ts +22 -8
  54. package/core/index.ts +6 -5
  55. package/core/plugins/index.ts +71 -199
  56. package/core/plugins/types.ts +76 -461
  57. package/core/server/index.ts +1 -1
  58. package/core/utils/logger/startup-banner.ts +26 -4
  59. package/create-fluxstack.ts +216 -107
  60. package/package.json +108 -107
  61. package/tsconfig.json +2 -1
  62. package/core/plugins/config.ts +0 -356
  63. package/core/plugins/dependency-manager.ts +0 -481
  64. package/core/plugins/discovery.ts +0 -379
  65. package/core/plugins/executor.ts +0 -353
  66. package/core/plugins/manager.ts +0 -645
  67. package/core/plugins/module-resolver.ts +0 -227
  68. package/core/plugins/registry.ts +0 -913
  69. package/vitest.config.live.ts +0 -69
package/CHANGELOG.md CHANGED
@@ -2,6 +2,138 @@
2
2
 
3
3
  All notable changes to FluxStack will be documented in this file.
4
4
 
5
+ ## [1.19.0] - 2026-04-11
6
+
7
+ ### Major Refactor: Plugin System Extracted to `@fluxstack/plugin-kit`
8
+
9
+ The plugin system (manager, registry, executor, discovery, dependency
10
+ manager, module resolver, types) has been extracted from `core/plugins/`
11
+ into the new standalone package `@fluxstack/plugin-kit`. This is the
12
+ same playbook we used for `@fluxstack/live` in 1.16.0 — implementation
13
+ lives in the lib, `core/plugins/` is now a thin re-export shim layer
14
+ for backwards compatibility with existing `@core/plugins/*` imports.
15
+
16
+ **Impact:** ~3,300 lines of plugin system implementation deleted from
17
+ the app, `core/plugins/` went from 9 runtime files (4017 lines) to
18
+ 2 thin shims (types.ts + index.ts, ~200 lines combined). Single
19
+ source of truth for plugin types and runtime is now
20
+ `@fluxstack/plugin-kit`.
21
+
22
+ ### Breaking Changes
23
+
24
+ - **Auto-discovery removed from `PluginManager.initialize()`** (plugin-kit 0.4.0).
25
+ The old code called `readdir('node_modules')` and `readdir('plugins')`
26
+ at startup to discover plugins. This silently broke in production
27
+ bundles where those directories don't exist, and prevented bundlers
28
+ from statically including plugin code. Host apps must now register
29
+ plugins explicitly via `framework.use(pluginObject)`. Dev and prod
30
+ are now identical; the bundler can tree-shake.
31
+
32
+ - **`PluginManager` constructor requires `settings` and `clientHooks`**
33
+ explicitly. These used to be read from the full config / imported
34
+ as module-level singletons. Now they're injected:
35
+ ```ts
36
+ new PluginManager<FluxStackConfig>({
37
+ config: fullConfig,
38
+ settings: fullConfig.plugins,
39
+ logger: pluginLogger,
40
+ clientHooks: { register: (...) => pluginClientHooks.register(...) },
41
+ app: this.app,
42
+ })
43
+ ```
44
+
45
+ - **`FluxStack.Plugin` generic over `TConfig`**. The legacy form
46
+ (no generic) still works and defaults to `unknown`. FluxStack's
47
+ shim specializes to `Plugin<FluxStackConfig>`.
48
+
49
+ - **Plugin classes discouraged, object literals are canonical**.
50
+ All built-in plugins and `@fluxstack/plugin-csrf-protection` use
51
+ `export const xxxPlugin: Plugin = { name, setup, ... }`. The
52
+ `class X implements Plugin` form is retired from the generators
53
+ but still technically accepted at runtime (it implements the
54
+ same interface).
55
+
56
+ ### Added
57
+
58
+ - **`@fluxstack/plugin-kit`** — new npm package. Types + runtime
59
+ for the plugin system. Published at 0.4.0 as of this release.
60
+ Used by FluxStack app and external plugin packages alike.
61
+ - **`tests/integration/framework/registered-plugins.test.ts`** (10 tests)
62
+ — end-to-end verification that the four plugins registered via
63
+ `framework.use()` in `app/server/index.ts` actually inject their
64
+ hooks at runtime. Catches the class of bug where plugin objects
65
+ are registered but no hook actually fires (the exact failure
66
+ mode of the old auto-discovery in prod bundles).
67
+ - **Static plugin registration everywhere**. `app/server/index.ts`
68
+ now imports `csrfProtectionPlugin` from `@fluxstack/plugin-csrf-protection`
69
+ directly and registers via `.use()`. Same pattern as the built-ins.
70
+ - **Startup banner reads from the PluginRegistry**. The banner line
71
+ `Plugins (N): ...` now lists exactly what `framework.getPluginRegistry().getAll()`
72
+ returns, instead of relying on each plugin manually pushing itself
73
+ to `globalThis.__fluxstackPlugins`. Backwards compatible — the old
74
+ global is still read as a fallback.
75
+ - **`@fluxstack/sdk` deprecated on npm** with a message pointing
76
+ users to `@fluxstack/plugin-kit`. The SDK was a static copy of
77
+ plugin types + a duplicate of `@fluxstack/config`; both have
78
+ canonical sources now.
79
+ - **`make:plugin` CLI** generates plain object literal plugins
80
+ importing from `@fluxstack/plugin-kit`. Identifier generation
81
+ fixed: `my-plugin` → `myPlugin` (not `myPluginPlugin`).
82
+
83
+ ### Changed
84
+
85
+ - **`@fluxstack/live` family bumped** from `^0.6.0` to `^0.7.1`.
86
+ Ships three follow-up bug fixes: opt-in `includeSelf` on `$room`
87
+ proxy emit (#15), `deepAssign` clones plain objects to break
88
+ external aliasing (#13), fail-loud protocol framing + telemetry (#7).
89
+ - **`create-fluxstack` README template**: removed the `loggerPlugin`
90
+ example (that plugin was deleted), replaced class-based plugin
91
+ example with object literal, added a hook reference table.
92
+ - **`plugins/README.md` template**: rewritten to reflect the static
93
+ `.use()` model. Explicitly calls out that plugins are NOT
94
+ auto-discovered. Points at `@fluxstack/plugin-csrf-protection`
95
+ as the living reference implementation.
96
+ - **Bundle prod size** grew from ~2.46 MB to ~3.34 MB because
97
+ `@fluxstack/plugin-csrf-protection` is now statically included.
98
+ Before, it was dynamically loaded via `readdir('node_modules')`
99
+ and the bundler couldn't see it.
100
+ - **Vite plugin startup banner label fixed** — `| Vite: embedded`
101
+ only shows in development now. In production the vite plugin
102
+ runs in static-fallback mode (serving `dist/client/`) and doesn't
103
+ actually run a Vite dev server, so the label was misleading.
104
+
105
+ ### Removed
106
+
107
+ - **6934 lines of dead test code** across 24 test files. Orphaned
108
+ tests under `core/**/__tests__/*` never ran (vitest config was
109
+ `include: tests/**/*.test.ts`) and 14 of 18 were broken on
110
+ import when run directly. Also deleted 5 `describe.skip`'d test
111
+ suites under `tests/` with abandoned TODOs pointing at APIs
112
+ that were refactored away (Eden Treaty, ProjectCreator). Plus
113
+ `vitest.config.live.ts`, an orphan config pointing at a
114
+ directory that doesn't exist anymore.
115
+ - **`core/plugins/{manager,registry,executor,discovery,dependency-manager,module-resolver,config}.ts`**
116
+ deleted from FluxStack app. Implementation lives in
117
+ `@fluxstack/plugin-kit` now. `core/plugins/types.ts` and
118
+ `core/plugins/index.ts` kept as thin shim barrels that re-export
119
+ from the lib and specialize `<TConfig>` against `FluxStackConfig`.
120
+ - **Deprecated `configSchema` and `defaultConfig` fields** from the
121
+ Plugin interface. Were marked `@deprecated` and had no call sites.
122
+ Plugins use `@fluxstack/config` for declarative config instead.
123
+ - **`loggerPlugin`** — old built-in plugin that was already absent
124
+ from the real codebase but still referenced in generated templates.
125
+ Template references removed.
126
+
127
+ ### Validation
128
+
129
+ - Typecheck (`bunx tsc --noEmit -p tsconfig.api-strict.json`) holds
130
+ at the 60 pre-existing errors baseline throughout every step —
131
+ zero regression across all four phases of the extraction.
132
+ - Full test suite: 42 test files, 652 passing, 5 skipped (all
133
+ intentional individual `it.skip` TODOs).
134
+ - Dev and prod both show `Plugins (4): swagger, live-components,
135
+ csrf-protection, vite` in the startup banner — identical output.
136
+
5
137
  ## [1.16.0] - 2026-03-13
6
138
 
7
139
  ### Major Refactor: Extract Live Components to Monorepo
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?