create-fluxstack 1.21.0 → 1.22.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.
- package/app/client/src/App.tsx +9 -11
- package/app/client/src/components/AppLayout.tsx +1 -0
- package/app/client/src/components/BackButton.tsx +1 -0
- package/app/client/src/components/ColorWheel.tsx +1 -0
- package/app/client/src/components/DemoPage.tsx +1 -0
- package/app/client/src/components/ErrorBoundary.tsx +2 -1
- package/app/client/src/components/LiveErrorBoundary.tsx +2 -1
- package/app/client/src/components/ThemePicker.tsx +1 -0
- package/app/client/src/framework/ClientOnly.tsx +14 -0
- package/app/client/src/framework/LivePage.tsx +55 -0
- package/app/client/src/framework/RscHomePage.tsx +125 -0
- package/app/client/src/framework/RscLink.tsx +31 -0
- package/app/client/src/framework/RscNav.tsx +42 -0
- package/app/client/src/framework/RscRoot.tsx +54 -0
- package/app/client/src/framework/csrf.ts +22 -0
- package/app/client/src/framework/entry.browser.tsx +51 -0
- package/app/client/src/framework/entry.rsc.tsx +41 -0
- package/app/client/src/framework/entry.ssr.tsx +12 -0
- package/app/client/src/framework/navigation.ts +29 -0
- package/app/client/src/framework/params.tsx +22 -0
- package/app/client/src/framework/routes.ts +143 -0
- package/app/client/src/framework/vite-rsc.d.ts +21 -0
- package/app/client/src/hooks/useThemeClock.ts +16 -1
- package/app/client/src/live/AuthDemo.tsx +1 -0
- package/app/client/src/live/CounterDemo.tsx +1 -0
- package/app/client/src/live/FormDemo.tsx +1 -0
- package/app/client/src/live/PingPongDemo.tsx +1 -0
- package/app/client/src/live/RoomChatDemo.tsx +1 -0
- package/app/client/src/live/SharedCounterDemo.tsx +2 -1
- package/app/client/src/pages/ApiTestPage.tsx +1 -0
- package/app/client/src/pages/auth.tsx +13 -0
- package/app/client/src/pages/blog/[slug].tsx +23 -0
- package/app/client/src/pages/counter.tsx +15 -0
- package/app/client/src/pages/form.tsx +13 -0
- package/app/client/src/pages/index.tsx +9 -0
- package/app/client/src/pages/ping-pong.tsx +13 -0
- package/app/client/src/pages/room-chat.tsx +13 -0
- package/app/client/src/pages/shared-counter.tsx +13 -0
- package/app/client/src/pages/sobre.tsx +19 -0
- package/app/server/index.ts +5 -1
- package/app/server/live/rooms/index.ts +14 -0
- package/config/system/plugins.config.ts +12 -2
- package/core/cli/commands/dev.ts +9 -1
- package/core/plugins/built-in/rsc/index.ts +156 -0
- package/core/plugins/built-in/ssr/bun-asset-loader.ts +46 -0
- package/core/plugins/built-in/ssr/index.ts +143 -0
- package/core/plugins/built-in/ssr/registry.ts +38 -0
- package/core/plugins/built-in/vite/index.ts +7 -0
- package/core/server/live/websocket-plugin.ts +29 -10
- package/core/utils/version.ts +6 -6
- package/create-fluxstack.ts +64 -5
- package/package.json +112 -108
- package/playwright.config.ts +6 -2
- package/vite.config.ts +22 -0
- package/app/client/.live-stubs/LiveUpload.js +0 -15
package/playwright.config.ts
CHANGED
|
@@ -11,7 +11,10 @@ export default defineConfig({
|
|
|
11
11
|
timeout: 30_000,
|
|
12
12
|
|
|
13
13
|
use: {
|
|
14
|
-
|
|
14
|
+
// Entrar pela 3000 (Elysia) — o app de verdade: API + WebSocket + frontend
|
|
15
|
+
// (via proxy Vite). A 5173 é o Vite dev cru (sem WebSocket Live), detalhe
|
|
16
|
+
// interno. Pela 3000 tudo é mesma origem, então o WS conecta sozinho.
|
|
17
|
+
baseURL: 'http://localhost:3000',
|
|
15
18
|
trace: 'on-first-retry',
|
|
16
19
|
},
|
|
17
20
|
|
|
@@ -24,7 +27,8 @@ export default defineConfig({
|
|
|
24
27
|
|
|
25
28
|
webServer: {
|
|
26
29
|
command: 'bun run dev',
|
|
27
|
-
|
|
30
|
+
// Espera a 3000 (Elysia) ficar pronta — é por onde os testes entram.
|
|
31
|
+
port: 3000,
|
|
28
32
|
reuseExistingServer: !process.env.CI,
|
|
29
33
|
timeout: 30_000,
|
|
30
34
|
},
|
package/vite.config.ts
CHANGED
|
@@ -9,6 +9,13 @@ import { fluxstackVitePlugins } from './core/build/vite-plugins'
|
|
|
9
9
|
// Root directory (vite.config.ts is in project root)
|
|
10
10
|
const rootDir = import.meta.dirname
|
|
11
11
|
|
|
12
|
+
// RSC (React Server Components) — modo PADRÃO do FluxStack. Adiciona os 3
|
|
13
|
+
// ambientes (rsc/ssr/client) ao Vite e o Elysia dirige o handler RSC
|
|
14
|
+
// (serverHandler:false = plugin não instala middleware próprio). Paths dos
|
|
15
|
+
// entries relativos ao `root` do Vite (app/client).
|
|
16
|
+
// Para SPA puro: RSC_ENABLED=false no ambiente.
|
|
17
|
+
const RSC_ENABLED = process.env.RSC_ENABLED !== 'false'
|
|
18
|
+
|
|
12
19
|
// When using bun-linked @fluxstack/live-* packages locally, point Vite at the
|
|
13
20
|
// TypeScript source instead of pre-built dist. This ensures a single React
|
|
14
21
|
// context (no dual-instance problem) and gives us HMR for the library code.
|
|
@@ -29,6 +36,21 @@ export default defineConfig({
|
|
|
29
36
|
plugins: [
|
|
30
37
|
// FluxStack internal plugins (live-strip, tsconfig-paths, type-checker)
|
|
31
38
|
...fluxstackVitePlugins(),
|
|
39
|
+
// RSC plugin ANTES do react() — quando ligado, ele gerencia os ambientes.
|
|
40
|
+
// Entries com caminho ABSOLUTO: no dev relativo ao root funciona, mas no
|
|
41
|
+
// `vite build` o rollup resolve relativo ao cwd e não acha — absoluto cobre os dois.
|
|
42
|
+
...(RSC_ENABLED
|
|
43
|
+
? [
|
|
44
|
+
(await import('@vitejs/plugin-rsc')).default({
|
|
45
|
+
serverHandler: false,
|
|
46
|
+
entries: {
|
|
47
|
+
rsc: resolve(rootDir, 'app/client/src/framework/entry.rsc.tsx'),
|
|
48
|
+
ssr: resolve(rootDir, 'app/client/src/framework/entry.ssr.tsx'),
|
|
49
|
+
client: resolve(rootDir, 'app/client/src/framework/entry.browser.tsx'),
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
]
|
|
53
|
+
: []),
|
|
32
54
|
react(),
|
|
33
55
|
tailwindcss(),
|
|
34
56
|
],
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export class LiveUpload {
|
|
2
|
-
static componentName = 'LiveUpload'
|
|
3
|
-
static defaultState = {
|
|
4
|
-
status: 'idle',
|
|
5
|
-
progress: 0,
|
|
6
|
-
fileName: '',
|
|
7
|
-
fileSize: 0,
|
|
8
|
-
fileType: '',
|
|
9
|
-
fileUrl: '',
|
|
10
|
-
bytesUploaded: 0,
|
|
11
|
-
totalBytes: 0,
|
|
12
|
-
error: null
|
|
13
|
-
}
|
|
14
|
-
static publicActions = ['startUpload', 'updateProgress', 'completeUpload', 'failUpload', 'reset']
|
|
15
|
-
}
|