Skip to content

Commit 6371bc2

Browse files
MarcosBrendonDePaulaclaude
andcommitted
refactor: extract Live Components to standalone monorepo
Live Components system moved to FluxStackCore/fluxstack-live as independent packages (@fluxstack/live, @fluxstack/live-client, @fluxstack/live-express, @fluxstack/live-elysia, @fluxstack/live-react). Core FluxStack now imports from @fluxstack/live instead of bundling the live components internally. This decouples the real-time system from the framework, allowing it to be used with any backend. Removed from core/: - server/live/ internal implementations (ComponentRegistry, RoomManager, etc.) - client/ hooks and components (useLiveComponent, Live, etc.) - build/vite-plugin-live-strip - server/live/__tests__/ Updated imports across app/ and plugins/ to use @fluxstack/live. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 609fe88 commit 6371bc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+319
-14839
lines changed

app/client/src/live/LiveDebuggerPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// - Filtering by component, event type, and search
88

99
import { useState, useRef, useEffect, useCallback } from 'react'
10-
import { useLiveDebugger, type DebugEvent, type DebugEventType, type ComponentSnapshot, type DebugFilter } from '@/core/client/hooks/useLiveDebugger'
10+
import { useLiveDebugger, type DebugEvent, type DebugEventType, type ComponentSnapshot, type DebugFilter } from '@fluxstack/live-react'
1111

1212
// ===== Debugger Settings (shared with floating widget) =====
1313

app/server/auth/DevAuthProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import type {
1212
LiveAuthProvider,
1313
LiveAuthCredentials,
1414
LiveAuthContext,
15-
} from '@core/server/live/auth/types'
16-
import { AuthenticatedContext } from '@core/server/live/auth/LiveAuthContext'
15+
} from '@fluxstack/live'
16+
import { AuthenticatedContext } from '@fluxstack/live'
1717

1818
interface DevUser {
1919
id: string

app/server/auth/JWTAuthProvider.example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import type {
1313
LiveAuthProvider,
1414
LiveAuthCredentials,
1515
LiveAuthContext,
16-
} from '@core/server/live/auth/types'
17-
import { AuthenticatedContext } from '@core/server/live/auth/LiveAuthContext'
16+
} from '@fluxstack/live'
17+
import { AuthenticatedContext } from '@fluxstack/live'
1818

1919
/**
2020
* Exemplo de provider JWT para Live Components.

app/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
import { FluxStackFramework } from "@core/server"
1414
import { vitePlugin } from "@core/plugins/built-in/vite"
1515
import { swaggerPlugin } from "@core/plugins/built-in/swagger"
16-
import { liveComponentsPlugin } from "@core/server/live/websocket-plugin"
16+
import { liveComponentsPlugin } from "@core/server/live"
1717
import { appInstance } from "@server/app"
1818
import { appConfig } from "@config"
1919

2020
// 🔒 Auth provider para Live Components
21-
import { liveAuthManager } from "@core/server/live/auth"
21+
import { liveAuthManager } from "@core/server/live"
2222
import { DevAuthProvider } from "./auth/DevAuthProvider"
2323

2424
// 🔐 Auth system (Guard + Provider, Laravel-inspired)

app/server/live/LiveAdminPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Client link: import type { AdminPanelDemo as _Client } from '@client/src/live/AdminPanelDemo'
1212

1313
import { LiveComponent } from '@core/types/types'
14-
import type { LiveComponentAuth, LiveActionAuthMap } from '@core/server/live/auth/types'
14+
import type { LiveComponentAuth, LiveActionAuthMap } from '@core/types/types'
1515

1616
// ===== State =====
1717

app/server/live/LiveProtectedChat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// import type { LiveProtectedChat as _Client } from '@client/src/live/ProtectedChat'
1010

1111
import { LiveComponent } from '@core/types/types'
12-
import type { LiveComponentAuth, LiveActionAuthMap } from '@core/server/live/auth/types'
12+
import type { LiveComponentAuth, LiveActionAuthMap } from '@core/types/types'
1313

1414
interface ChatMessage {
1515
id: number

app/server/routes/room.routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// enviem mensagens para salas de chat via API REST
55

66
import { Elysia, t } from 'elysia'
7-
import { liveRoomManager } from '@core/server/live/LiveRoomManager'
8-
import { roomEvents } from '@core/server/live/RoomEventBus'
7+
import { liveRoomManager, roomEvents } from '@core/server/live'
98

109
export const roomRoutes = new Elysia({ prefix: '/rooms' })
1110

core/build/live-components-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class LiveComponentsGenerator {
116116
// Generated at: ${new Date().toISOString()}
117117
118118
${imports}
119-
import { componentRegistry } from "@core/server/live/ComponentRegistry"
119+
import { componentRegistry } from "@core/server/live"
120120
121121
// Register all components statically for production bundle
122122
function registerAllComponents() {

core/build/vite-plugin-live-strip.ts

Lines changed: 0 additions & 188 deletions
This file was deleted.

core/build/vite-plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import type { Plugin } from 'vite'
1010
import { resolve } from 'path'
1111
import tsconfigPaths from 'vite-tsconfig-paths'
1212
import checker from 'vite-plugin-checker'
13-
import { fluxstackLiveStripPlugin } from './vite-plugin-live-strip'
13+
import { liveStripPlugin } from '@fluxstack/live/build'
1414
import { helpers } from '../utils/env'
1515

1616
export function fluxstackVitePlugins(): Plugin[] {
1717
return [
18-
fluxstackLiveStripPlugin(),
18+
liveStripPlugin({ verbose: false }),
1919
tsconfigPaths({
2020
projects: [resolve(import.meta.dirname, '..', '..', 'tsconfig.json')]
2121
}),

0 commit comments

Comments
 (0)