create-fluxstack 1.0.0 → 1.0.2
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/create-fluxstack.ts +32 -17
- package/package-template.json +51 -0
- package/package.json +2 -1
- package/.env +0 -30
- package/LICENSE +0 -21
- package/app/client/README.md +0 -69
- package/app/client/frontend-only.ts +0 -12
- package/app/client/index.html +0 -13
- package/app/client/public/vite.svg +0 -1
- package/app/client/src/App.css +0 -883
- package/app/client/src/App.tsx +0 -669
- package/app/client/src/assets/react.svg +0 -1
- package/app/client/src/components/TestPage.tsx +0 -453
- package/app/client/src/index.css +0 -51
- package/app/client/src/lib/eden-api.ts +0 -110
- package/app/client/src/main.tsx +0 -10
- package/app/client/src/vite-env.d.ts +0 -1
- package/app/client/tsconfig.app.json +0 -43
- package/app/client/tsconfig.json +0 -7
- package/app/client/tsconfig.node.json +0 -25
- package/app/server/app.ts +0 -10
- package/app/server/backend-only.ts +0 -15
- package/app/server/controllers/users.controller.ts +0 -69
- package/app/server/index.ts +0 -104
- package/app/server/routes/index.ts +0 -25
- package/app/server/routes/users.routes.ts +0 -121
- package/app/server/types/index.ts +0 -1
- package/app/shared/types/index.ts +0 -18
- package/bun.lock +0 -1053
- package/core/__tests__/integration.test.ts +0 -227
- package/core/build/index.ts +0 -186
- package/core/cli/command-registry.ts +0 -334
- package/core/cli/index.ts +0 -394
- package/core/cli/plugin-discovery.ts +0 -200
- package/core/client/standalone.ts +0 -57
- package/core/config/__tests__/config-loader.test.ts +0 -591
- package/core/config/__tests__/config-merger.test.ts +0 -657
- package/core/config/__tests__/env-converter.test.ts +0 -372
- package/core/config/__tests__/env-processor.test.ts +0 -431
- package/core/config/__tests__/env.test.ts +0 -452
- package/core/config/__tests__/integration.test.ts +0 -418
- package/core/config/__tests__/loader.test.ts +0 -331
- package/core/config/__tests__/schema.test.ts +0 -129
- package/core/config/__tests__/validator.test.ts +0 -318
- package/core/config/env-dynamic.ts +0 -326
- package/core/config/env.ts +0 -597
- package/core/config/index.ts +0 -317
- package/core/config/loader.ts +0 -546
- package/core/config/runtime-config.ts +0 -322
- package/core/config/schema.ts +0 -694
- package/core/config/validator.ts +0 -540
- package/core/framework/__tests__/server.test.ts +0 -233
- package/core/framework/client.ts +0 -132
- package/core/framework/index.ts +0 -8
- package/core/framework/server.ts +0 -501
- package/core/framework/types.ts +0 -63
- package/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/core/plugins/__tests__/manager.test.ts +0 -398
- package/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/core/plugins/__tests__/registry.test.ts +0 -335
- package/core/plugins/built-in/index.ts +0 -142
- package/core/plugins/built-in/logger/index.ts +0 -180
- package/core/plugins/built-in/monitoring/README.md +0 -193
- package/core/plugins/built-in/monitoring/index.ts +0 -912
- package/core/plugins/built-in/static/index.ts +0 -289
- package/core/plugins/built-in/swagger/index.ts +0 -229
- package/core/plugins/built-in/vite/index.ts +0 -316
- package/core/plugins/config.ts +0 -348
- package/core/plugins/discovery.ts +0 -350
- package/core/plugins/executor.ts +0 -351
- package/core/plugins/index.ts +0 -195
- package/core/plugins/manager.ts +0 -583
- package/core/plugins/registry.ts +0 -424
- package/core/plugins/types.ts +0 -254
- package/core/server/framework.ts +0 -123
- package/core/server/index.ts +0 -8
- package/core/server/plugins/database.ts +0 -182
- package/core/server/plugins/logger.ts +0 -47
- package/core/server/plugins/swagger.ts +0 -34
- package/core/server/standalone.ts +0 -91
- package/core/templates/create-project.ts +0 -455
- package/core/types/api.ts +0 -169
- package/core/types/build.ts +0 -174
- package/core/types/config.ts +0 -68
- package/core/types/index.ts +0 -127
- package/core/types/plugin.ts +0 -94
- package/core/utils/__tests__/errors.test.ts +0 -139
- package/core/utils/__tests__/helpers.test.ts +0 -297
- package/core/utils/__tests__/logger.test.ts +0 -141
- package/core/utils/env-runtime-v2.ts +0 -232
- package/core/utils/env-runtime.ts +0 -252
- package/core/utils/errors/codes.ts +0 -115
- package/core/utils/errors/handlers.ts +0 -63
- package/core/utils/errors/index.ts +0 -81
- package/core/utils/helpers.ts +0 -180
- package/core/utils/index.ts +0 -18
- package/core/utils/logger/index.ts +0 -161
- package/core/utils/logger.ts +0 -106
- package/core/utils/monitoring/index.ts +0 -212
- package/tsconfig.json +0 -51
- package/vite.config.ts +0 -42
package/core/plugins/index.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced Plugin System
|
|
3
|
-
* Comprehensive plugin system with lifecycle hooks, dependency management, and configuration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Core plugin types and interfaces
|
|
7
|
-
export type {
|
|
8
|
-
Plugin,
|
|
9
|
-
PluginContext,
|
|
10
|
-
PluginHook,
|
|
11
|
-
PluginPriority,
|
|
12
|
-
PluginManifest,
|
|
13
|
-
PluginLoadResult,
|
|
14
|
-
PluginRegistryState,
|
|
15
|
-
PluginHookResult,
|
|
16
|
-
PluginMetrics,
|
|
17
|
-
PluginDiscoveryOptions,
|
|
18
|
-
PluginInstallOptions,
|
|
19
|
-
PluginExecutionContext,
|
|
20
|
-
PluginValidationResult,
|
|
21
|
-
HookExecutionOptions,
|
|
22
|
-
PluginLifecycleEvent,
|
|
23
|
-
PluginConfigSchema,
|
|
24
|
-
RequestContext,
|
|
25
|
-
ResponseContext,
|
|
26
|
-
ErrorContext,
|
|
27
|
-
BuildContext
|
|
28
|
-
} from './types'
|
|
29
|
-
|
|
30
|
-
// Plugin registry
|
|
31
|
-
export { PluginRegistry } from './registry'
|
|
32
|
-
export type { PluginRegistryConfig } from './registry'
|
|
33
|
-
|
|
34
|
-
// Plugin discovery
|
|
35
|
-
export { PluginDiscovery, pluginDiscovery } from './discovery'
|
|
36
|
-
export type { PluginDiscoveryConfig } from './discovery'
|
|
37
|
-
|
|
38
|
-
// Plugin configuration management
|
|
39
|
-
export {
|
|
40
|
-
DefaultPluginConfigManager,
|
|
41
|
-
createPluginUtils
|
|
42
|
-
} from './config'
|
|
43
|
-
export type { PluginConfigManager } from './config'
|
|
44
|
-
|
|
45
|
-
// Plugin manager
|
|
46
|
-
export {
|
|
47
|
-
PluginManager,
|
|
48
|
-
createRequestContext,
|
|
49
|
-
createResponseContext,
|
|
50
|
-
createErrorContext,
|
|
51
|
-
createBuildContext
|
|
52
|
-
} from './manager'
|
|
53
|
-
export type { PluginManagerConfig } from './manager'
|
|
54
|
-
|
|
55
|
-
// Plugin executor
|
|
56
|
-
export {
|
|
57
|
-
PluginExecutor,
|
|
58
|
-
calculateExecutionStats
|
|
59
|
-
} from './executor'
|
|
60
|
-
export type {
|
|
61
|
-
PluginExecutionPlan,
|
|
62
|
-
PluginExecutionStep,
|
|
63
|
-
PluginExecutionStats
|
|
64
|
-
} from './executor'
|
|
65
|
-
|
|
66
|
-
// Utility functions for plugin development
|
|
67
|
-
export const PluginUtils = {
|
|
68
|
-
/**
|
|
69
|
-
* Create a simple plugin
|
|
70
|
-
*/
|
|
71
|
-
createPlugin: (config: {
|
|
72
|
-
name: string
|
|
73
|
-
version?: string
|
|
74
|
-
description?: string
|
|
75
|
-
dependencies?: string[]
|
|
76
|
-
priority?: number | PluginPriority
|
|
77
|
-
setup?: (context: PluginContext) => void | Promise<void>
|
|
78
|
-
onServerStart?: (context: PluginContext) => void | Promise<void>
|
|
79
|
-
onServerStop?: (context: PluginContext) => void | Promise<void>
|
|
80
|
-
onRequest?: (context: RequestContext) => void | Promise<void>
|
|
81
|
-
onResponse?: (context: ResponseContext) => void | Promise<void>
|
|
82
|
-
onError?: (context: ErrorContext) => void | Promise<void>
|
|
83
|
-
configSchema?: any
|
|
84
|
-
defaultConfig?: any
|
|
85
|
-
}): Plugin => {
|
|
86
|
-
const plugin = {
|
|
87
|
-
name: config.name,
|
|
88
|
-
...(config.version && { version: config.version }),
|
|
89
|
-
...(config.description && { description: config.description }),
|
|
90
|
-
...(config.dependencies && { dependencies: config.dependencies }),
|
|
91
|
-
...(config.priority !== undefined && { priority: config.priority }),
|
|
92
|
-
...(config.setup && { setup: config.setup }),
|
|
93
|
-
...(config.onServerStart && { onServerStart: config.onServerStart }),
|
|
94
|
-
...(config.onServerStop && { onServerStop: config.onServerStop }),
|
|
95
|
-
...(config.onRequest && { onRequest: config.onRequest }),
|
|
96
|
-
...(config.onResponse && { onResponse: config.onResponse }),
|
|
97
|
-
...(config.onError && { onError: config.onError }),
|
|
98
|
-
...(config.configSchema && { configSchema: config.configSchema }),
|
|
99
|
-
...(config.defaultConfig && { defaultConfig: config.defaultConfig })
|
|
100
|
-
} as Plugin
|
|
101
|
-
return plugin
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Create a plugin manifest
|
|
106
|
-
*/
|
|
107
|
-
createManifest: (config: {
|
|
108
|
-
name: string
|
|
109
|
-
version: string
|
|
110
|
-
description: string
|
|
111
|
-
author: string
|
|
112
|
-
license: string
|
|
113
|
-
homepage?: string
|
|
114
|
-
repository?: string
|
|
115
|
-
keywords?: string[]
|
|
116
|
-
dependencies?: Record<string, string>
|
|
117
|
-
peerDependencies?: Record<string, string>
|
|
118
|
-
fluxstack: {
|
|
119
|
-
version: string
|
|
120
|
-
hooks: PluginHook[]
|
|
121
|
-
config?: any
|
|
122
|
-
category?: string
|
|
123
|
-
tags?: string[]
|
|
124
|
-
}
|
|
125
|
-
}): any => {
|
|
126
|
-
return {
|
|
127
|
-
name: config.name,
|
|
128
|
-
version: config.version || '1.0.0',
|
|
129
|
-
description: config.description,
|
|
130
|
-
author: config.author,
|
|
131
|
-
license: config.license,
|
|
132
|
-
homepage: config.homepage,
|
|
133
|
-
repository: config.repository,
|
|
134
|
-
keywords: config.keywords || [],
|
|
135
|
-
dependencies: config.dependencies || {},
|
|
136
|
-
peerDependencies: config.peerDependencies,
|
|
137
|
-
fluxstack: config.fluxstack
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Validate plugin structure
|
|
143
|
-
*/
|
|
144
|
-
validatePlugin: (plugin: any): plugin is Plugin => {
|
|
145
|
-
return (
|
|
146
|
-
plugin &&
|
|
147
|
-
typeof plugin === 'object' &&
|
|
148
|
-
typeof plugin.name === 'string' &&
|
|
149
|
-
plugin.name.length > 0
|
|
150
|
-
)
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Check if plugin implements hook
|
|
155
|
-
*/
|
|
156
|
-
implementsHook: (plugin: Plugin, hook: PluginHook): boolean => {
|
|
157
|
-
const hookFunction = (plugin as any)[hook]
|
|
158
|
-
return hookFunction && typeof hookFunction === 'function'
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Get plugin hooks
|
|
163
|
-
*/
|
|
164
|
-
getPluginHooks: (plugin: Plugin): PluginHook[] => {
|
|
165
|
-
const hooks: PluginHook[] = []
|
|
166
|
-
const possibleHooks: PluginHook[] = [
|
|
167
|
-
'setup',
|
|
168
|
-
'onServerStart',
|
|
169
|
-
'onServerStop',
|
|
170
|
-
'onRequest',
|
|
171
|
-
'onResponse',
|
|
172
|
-
'onError',
|
|
173
|
-
'onBuild',
|
|
174
|
-
'onBuildComplete'
|
|
175
|
-
]
|
|
176
|
-
|
|
177
|
-
for (const hook of possibleHooks) {
|
|
178
|
-
if (PluginUtils.implementsHook(plugin, hook)) {
|
|
179
|
-
hooks.push(hook)
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return hooks
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Re-export types for convenience
|
|
188
|
-
import type {
|
|
189
|
-
PluginContext,
|
|
190
|
-
PluginHook,
|
|
191
|
-
PluginPriority,
|
|
192
|
-
RequestContext,
|
|
193
|
-
ResponseContext,
|
|
194
|
-
ErrorContext
|
|
195
|
-
} from './types'
|