wexts 4.0.0 → 4.1.5

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 (189) hide show
  1. package/README.md +49 -49
  2. package/bin/wexts.cjs +2 -2
  3. package/package.json +153 -148
  4. package/templates/.dockerignore +43 -43
  5. package/templates/.env.example +17 -17
  6. package/templates/Dockerfile +60 -60
  7. package/templates/Procfile +1 -1
  8. package/templates/README.md +67 -67
  9. package/templates/api-sdk.ts +115 -115
  10. package/templates/docker-compose.yml +34 -34
  11. package/templates/nestjs-api/.env.example +3 -3
  12. package/templates/nestjs-api/README.md +87 -87
  13. package/templates/nestjs-api/nest-cli.json +6 -6
  14. package/templates/nestjs-api/package.json +40 -40
  15. package/templates/nestjs-api/prisma/migrations/20251123205437_init/migration.sql +24 -24
  16. package/templates/nestjs-api/prisma/migrations/migration_lock.toml +3 -3
  17. package/templates/nestjs-api/prisma/schema.prisma +29 -29
  18. package/templates/nestjs-api/src/app.module.ts +17 -17
  19. package/templates/nestjs-api/src/auth/auth.controller.ts +27 -27
  20. package/templates/nestjs-api/src/auth/auth.module.ts +37 -37
  21. package/templates/nestjs-api/src/auth/auth.service.ts +86 -86
  22. package/templates/nestjs-api/src/auth/dto/auth.dto.ts +22 -22
  23. package/templates/nestjs-api/src/auth/guards/jwt-auth.guard.ts +5 -5
  24. package/templates/nestjs-api/src/auth/strategies/jwt.strategy.ts +27 -27
  25. package/templates/nestjs-api/src/main.ts +32 -32
  26. package/templates/nestjs-api/src/prisma/prisma.module.ts +9 -9
  27. package/templates/nestjs-api/src/prisma/prisma.service.ts +14 -14
  28. package/templates/nestjs-api/src/todos/dto/todo.dto.ts +24 -24
  29. package/templates/nestjs-api/src/todos/todos.controller.ts +39 -39
  30. package/templates/nestjs-api/src/todos/todos.module.ts +11 -11
  31. package/templates/nestjs-api/src/todos/todos.service.ts +53 -53
  32. package/templates/nestjs-api/src/users/users.controller.ts +14 -14
  33. package/templates/nestjs-api/src/users/users.module.ts +12 -12
  34. package/templates/nestjs-api/src/users/users.service.ts +19 -19
  35. package/templates/nestjs-api/tsconfig.json +39 -39
  36. package/templates/nextjs-web/README.md +76 -76
  37. package/templates/nextjs-web/app/actions/auth.ts +108 -108
  38. package/templates/nextjs-web/app/dashboard/error.tsx +39 -39
  39. package/templates/nextjs-web/app/dashboard/loading.tsx +14 -14
  40. package/templates/nextjs-web/app/dashboard/page.tsx +5 -5
  41. package/templates/nextjs-web/app/globals.css +93 -93
  42. package/templates/nextjs-web/app/layout.tsx +29 -29
  43. package/templates/nextjs-web/app/login/page.tsx +5 -5
  44. package/templates/nextjs-web/app/page.tsx +28 -28
  45. package/templates/nextjs-web/app/register/page.tsx +5 -5
  46. package/templates/nextjs-web/components/ui/button.tsx +56 -56
  47. package/templates/nextjs-web/components/ui/card.tsx +79 -79
  48. package/templates/nextjs-web/components/ui/input.tsx +25 -25
  49. package/templates/nextjs-web/components/ui/label.tsx +24 -24
  50. package/templates/nextjs-web/features/auth/LoginForm.tsx +140 -140
  51. package/templates/nextjs-web/features/auth/RegisterForm.tsx +159 -159
  52. package/templates/nextjs-web/features/auth/api.ts +35 -35
  53. package/templates/nextjs-web/features/auth/index.ts +3 -3
  54. package/templates/nextjs-web/features/dashboard/DashboardView.tsx +204 -204
  55. package/templates/nextjs-web/features/dashboard/api.ts +9 -9
  56. package/templates/nextjs-web/features/dashboard/components.tsx +74 -74
  57. package/templates/nextjs-web/features/dashboard/index.ts +3 -3
  58. package/templates/nextjs-web/hooks/index.ts +4 -4
  59. package/templates/nextjs-web/lib/api-client.ts +89 -89
  60. package/templates/nextjs-web/lib/api.ts +115 -115
  61. package/templates/nextjs-web/lib/axios-global-config.ts +17 -17
  62. package/templates/nextjs-web/lib/utils.ts +6 -6
  63. package/templates/nextjs-web/lib/wexts-client.ts +4 -4
  64. package/templates/nextjs-web/next-env.d.ts +6 -6
  65. package/templates/nextjs-web/next.config.ts +20 -20
  66. package/templates/nextjs-web/package.json +37 -37
  67. package/templates/nextjs-web/postcss.config.js +6 -6
  68. package/templates/nextjs-web/tailwind.config.ts +69 -69
  69. package/templates/nextjs-web/tsconfig.json +41 -41
  70. package/templates/nixpacks.toml +11 -11
  71. package/templates/root-package.json +31 -31
  72. package/templates/server.ts +66 -66
  73. package/templates/tsconfig.json +30 -30
  74. package/dist/chunk-2KAQYLVN.js +0 -1
  75. package/dist/chunk-2KAQYLVN.js.map +0 -1
  76. package/dist/chunk-2LJVUMXW.js +0 -228
  77. package/dist/chunk-2LJVUMXW.js.map +0 -1
  78. package/dist/chunk-7QKLIVRF.js +0 -94
  79. package/dist/chunk-7QKLIVRF.js.map +0 -1
  80. package/dist/chunk-7WULUGLH.mjs +0 -22
  81. package/dist/chunk-7WULUGLH.mjs.map +0 -1
  82. package/dist/chunk-BG56B4DE.js +0 -106
  83. package/dist/chunk-BG56B4DE.js.map +0 -1
  84. package/dist/chunk-CLM5PNSG.mjs +0 -496
  85. package/dist/chunk-CLM5PNSG.mjs.map +0 -1
  86. package/dist/chunk-DNLGCKTT.js +0 -31
  87. package/dist/chunk-DNLGCKTT.js.map +0 -1
  88. package/dist/chunk-JHOVXH3X.mjs +0 -65
  89. package/dist/chunk-JHOVXH3X.mjs.map +0 -1
  90. package/dist/chunk-MXINIFPC.js +0 -105
  91. package/dist/chunk-MXINIFPC.js.map +0 -1
  92. package/dist/chunk-SE32ZPOZ.js +0 -496
  93. package/dist/chunk-SE32ZPOZ.js.map +0 -1
  94. package/dist/chunk-UAL54DVV.mjs +0 -106
  95. package/dist/chunk-UAL54DVV.mjs.map +0 -1
  96. package/dist/chunk-WCKSKU3C.js +0 -65
  97. package/dist/chunk-WCKSKU3C.js.map +0 -1
  98. package/dist/chunk-WU6FW77M.mjs +0 -105
  99. package/dist/chunk-WU6FW77M.mjs.map +0 -1
  100. package/dist/chunk-XE4OXN2W.js +0 -12
  101. package/dist/chunk-XE4OXN2W.js.map +0 -1
  102. package/dist/chunk-YBM3IJEA.mjs +0 -94
  103. package/dist/chunk-YBM3IJEA.mjs.map +0 -1
  104. package/dist/chunk-YN6WIWNQ.mjs +0 -228
  105. package/dist/chunk-YN6WIWNQ.mjs.map +0 -1
  106. package/dist/chunk-YSLEF5C5.mjs +0 -1
  107. package/dist/chunk-YSLEF5C5.mjs.map +0 -1
  108. package/dist/chunk-ZX7QIN24.mjs +0 -31
  109. package/dist/chunk-ZX7QIN24.mjs.map +0 -1
  110. package/dist/cli/index.d.mts +0 -11
  111. package/dist/cli/index.d.ts +0 -11
  112. package/dist/cli/index.js +0 -332
  113. package/dist/cli/index.js.map +0 -1
  114. package/dist/cli/index.mjs +0 -334
  115. package/dist/cli/index.mjs.map +0 -1
  116. package/dist/client/index.d.mts +0 -21
  117. package/dist/client/index.d.ts +0 -21
  118. package/dist/client/index.js +0 -12
  119. package/dist/client/index.js.map +0 -1
  120. package/dist/client/index.mjs +0 -12
  121. package/dist/client/index.mjs.map +0 -1
  122. package/dist/codegen/index.d.mts +0 -2
  123. package/dist/codegen/index.d.ts +0 -2
  124. package/dist/codegen/index.js +0 -15
  125. package/dist/codegen/index.js.map +0 -1
  126. package/dist/codegen/index.mjs +0 -15
  127. package/dist/codegen/index.mjs.map +0 -1
  128. package/dist/decorators-BT1FFqN0.d.mts +0 -29
  129. package/dist/decorators-DvS58PqC.d.ts +0 -29
  130. package/dist/dev-server/index.d.mts +0 -1
  131. package/dist/dev-server/index.d.ts +0 -1
  132. package/dist/dev-server/index.js +0 -13
  133. package/dist/dev-server/index.js.map +0 -1
  134. package/dist/dev-server/index.mjs +0 -13
  135. package/dist/dev-server/index.mjs.map +0 -1
  136. package/dist/index-7QeQEf37.d.ts +0 -92
  137. package/dist/index-7RvU-jGE.d.mts +0 -66
  138. package/dist/index-7RvU-jGE.d.ts +0 -66
  139. package/dist/index-8nzxy0NN.d.mts +0 -92
  140. package/dist/index-Co5ZsLqq.d.ts +0 -58
  141. package/dist/index-D94W1__r.d.mts +0 -58
  142. package/dist/index-DQmyVp6F.d.mts +0 -27
  143. package/dist/index-KL_1BrQb.d.ts +0 -27
  144. package/dist/index.d.mts +0 -258
  145. package/dist/index.d.ts +0 -258
  146. package/dist/index.js +0 -410
  147. package/dist/index.js.map +0 -1
  148. package/dist/index.mjs +0 -410
  149. package/dist/index.mjs.map +0 -1
  150. package/dist/nest/index.d.mts +0 -3
  151. package/dist/nest/index.d.ts +0 -3
  152. package/dist/nest/index.js +0 -38
  153. package/dist/nest/index.js.map +0 -1
  154. package/dist/nest/index.mjs +0 -38
  155. package/dist/nest/index.mjs.map +0 -1
  156. package/dist/next/index.d.mts +0 -66
  157. package/dist/next/index.d.ts +0 -66
  158. package/dist/next/index.js +0 -226
  159. package/dist/next/index.js.map +0 -1
  160. package/dist/next/index.mjs +0 -188
  161. package/dist/next/index.mjs.map +0 -1
  162. package/dist/rpc/index.d.mts +0 -2
  163. package/dist/rpc/index.d.ts +0 -2
  164. package/dist/rpc/index.js +0 -23
  165. package/dist/rpc/index.js.map +0 -1
  166. package/dist/rpc/index.mjs +0 -23
  167. package/dist/rpc/index.mjs.map +0 -1
  168. package/dist/runtime/index.d.mts +0 -55
  169. package/dist/runtime/index.d.ts +0 -55
  170. package/dist/runtime/index.js +0 -213
  171. package/dist/runtime/index.js.map +0 -1
  172. package/dist/runtime/index.mjs +0 -213
  173. package/dist/runtime/index.mjs.map +0 -1
  174. package/dist/types/index.d.mts +0 -12
  175. package/dist/types/index.d.ts +0 -12
  176. package/dist/types/index.js +0 -2
  177. package/dist/types/index.js.map +0 -1
  178. package/dist/types/index.mjs +0 -3
  179. package/dist/types/index.mjs.map +0 -1
  180. package/dist/types-7d_fC-C3.d.mts +0 -32
  181. package/dist/types-7d_fC-C3.d.ts +0 -32
  182. package/dist/vercel-builder/index.d.mts +0 -58
  183. package/dist/vercel-builder/index.d.ts +0 -58
  184. package/dist/vercel-builder/index.js +0 -330
  185. package/dist/vercel-builder/index.js.map +0 -1
  186. package/dist/vercel-builder/index.mjs +0 -330
  187. package/dist/vercel-builder/index.mjs.map +0 -1
  188. package/templates/nestjs-api/package-lock.json +0 -5623
  189. package/templates/nextjs-web/package-lock.json +0 -3254
package/dist/index.d.mts DELETED
@@ -1,258 +0,0 @@
1
- export { i as Codegen } from './index-8nzxy0NN.mjs';
2
- export { i as DevServer } from './index-7RvU-jGE.mjs';
3
- export { i as Nest } from './index-D94W1__r.mjs';
4
- import React, { ReactNode } from 'react';
5
- import { FusionFetcher, WextsRpcClient } from './client/index.mjs';
6
- export { i as Rpc } from './index-DQmyVp6F.mjs';
7
- export { Todo, User } from './types/index.mjs';
8
- import './types-7d_fC-C3.mjs';
9
- import './decorators-BT1FFqN0.mjs';
10
-
11
- interface FusionConfig {
12
- [key: string]: any;
13
- }
14
- declare class ConfigLoader {
15
- private config;
16
- private configDir;
17
- constructor(configDir?: string);
18
- /**
19
- * Load configuration from file or environment
20
- */
21
- load(key: string, defaultValue?: any): any;
22
- /**
23
- * Set configuration value
24
- */
25
- set(key: string, value: any): void;
26
- /**
27
- * Get all configuration
28
- */
29
- getAll(): FusionConfig;
30
- /**
31
- * Parse environment value (handles JSON strings)
32
- */
33
- private parseEnvValue;
34
- }
35
- declare const config: ConfigLoader;
36
- declare function load(key: string, defaultValue?: any): any;
37
-
38
- declare enum LogLevel {
39
- DEBUG = 0,
40
- INFO = 1,
41
- WARN = 2,
42
- ERROR = 3
43
- }
44
- interface LoggerOptions {
45
- level?: LogLevel;
46
- prefix?: string;
47
- timestamp?: boolean;
48
- }
49
- declare class Logger {
50
- private level;
51
- private prefix;
52
- private timestamp;
53
- constructor(options?: LoggerOptions);
54
- private formatMessage;
55
- debug(...args: any[]): void;
56
- info(...args: any[]): void;
57
- warn(...args: any[]): void;
58
- error(...args: any[]): void;
59
- success(...args: any[]): void;
60
- }
61
- declare const logger: Logger;
62
- declare function createLogger(options: LoggerOptions): Logger;
63
-
64
- declare class FileSystem {
65
- /**
66
- * Read file as string
67
- */
68
- readFile(filePath: string, encoding?: BufferEncoding): Promise<string>;
69
- /**
70
- * Write file
71
- */
72
- writeFile(filePath: string, content: string): Promise<void>;
73
- /**
74
- * Read JSON file
75
- */
76
- readJSON<T = any>(filePath: string): Promise<T>;
77
- /**
78
- * Write JSON file
79
- */
80
- writeJSON(filePath: string, data: any, pretty?: boolean): Promise<void>;
81
- /**
82
- * Check if file/directory exists
83
- */
84
- exists(filePath: string): Promise<boolean>;
85
- /**
86
- * Ensure directory exists (create if not)
87
- */
88
- ensureDir(dirPath: string): Promise<void>;
89
- /**
90
- * Copy file
91
- */
92
- copyFile(src: string, dest: string): Promise<void>;
93
- /**
94
- * Read directory
95
- */
96
- readDir(dirPath: string): Promise<string[]>;
97
- }
98
- declare const filesystem: FileSystem;
99
-
100
- declare class ProcessManager {
101
- /**
102
- * Setup process error handlers
103
- */
104
- static initialize(): void;
105
- /**
106
- * Graceful shutdown helper
107
- */
108
- static shutdown(cleanup: () => Promise<void>): Promise<void>;
109
- }
110
-
111
- declare class FusionError extends Error {
112
- code?: string | undefined;
113
- constructor(message: string, code?: string | undefined);
114
- }
115
- declare class ConfigError extends FusionError {
116
- constructor(message: string);
117
- }
118
- declare class ValidationError extends FusionError {
119
- constructor(message: string);
120
- }
121
- declare class APIError extends FusionError {
122
- statusCode?: number | undefined;
123
- constructor(message: string, statusCode?: number | undefined);
124
- }
125
-
126
- type index$4_APIError = APIError;
127
- declare const index$4_APIError: typeof APIError;
128
- type index$4_ConfigError = ConfigError;
129
- declare const index$4_ConfigError: typeof ConfigError;
130
- type index$4_ConfigLoader = ConfigLoader;
131
- declare const index$4_ConfigLoader: typeof ConfigLoader;
132
- type index$4_FileSystem = FileSystem;
133
- declare const index$4_FileSystem: typeof FileSystem;
134
- type index$4_FusionConfig = FusionConfig;
135
- type index$4_FusionError = FusionError;
136
- declare const index$4_FusionError: typeof FusionError;
137
- type index$4_LogLevel = LogLevel;
138
- declare const index$4_LogLevel: typeof LogLevel;
139
- type index$4_Logger = Logger;
140
- declare const index$4_Logger: typeof Logger;
141
- type index$4_LoggerOptions = LoggerOptions;
142
- type index$4_ProcessManager = ProcessManager;
143
- declare const index$4_ProcessManager: typeof ProcessManager;
144
- type index$4_ValidationError = ValidationError;
145
- declare const index$4_ValidationError: typeof ValidationError;
146
- declare const index$4_config: typeof config;
147
- declare const index$4_createLogger: typeof createLogger;
148
- declare const index$4_filesystem: typeof filesystem;
149
- declare const index$4_load: typeof load;
150
- declare const index$4_logger: typeof logger;
151
- declare namespace index$4 {
152
- export { index$4_APIError as APIError, index$4_ConfigError as ConfigError, index$4_ConfigLoader as ConfigLoader, index$4_FileSystem as FileSystem, type index$4_FusionConfig as FusionConfig, index$4_FusionError as FusionError, index$4_LogLevel as LogLevel, index$4_Logger as Logger, type index$4_LoggerOptions as LoggerOptions, index$4_ProcessManager as ProcessManager, index$4_ValidationError as ValidationError, index$4_config as config, index$4_createLogger as createLogger, index$4_filesystem as filesystem, index$4_load as load, index$4_logger as logger };
153
- }
154
-
155
- declare const loader: {
156
- load: () => {};
157
- };
158
-
159
- declare const index$3_loader: typeof loader;
160
- declare namespace index$3 {
161
- export { index$3_loader as loader };
162
- }
163
-
164
- declare const server: {
165
- start: () => void;
166
- };
167
-
168
- declare const index$2_server: typeof server;
169
- declare namespace index$2 {
170
- export { index$2_server as server };
171
- }
172
-
173
- interface ScaffoldOptions {
174
- projectName: string;
175
- template: 'monorepo' | 'api' | 'web';
176
- packageManager?: 'npm' | 'pnpm' | 'yarn';
177
- }
178
- /**
179
- * @deprecated Use the `wexts create` CLI and `examples/hello-rpc` canonical scaffold instead.
180
- */
181
- declare class ProjectScaffolder {
182
- scaffold(options: ScaffoldOptions): Promise<void>;
183
- private createMonorepo;
184
- private createNestJSApp;
185
- private createNextJSApp;
186
- }
187
-
188
- type index$1_ProjectScaffolder = ProjectScaffolder;
189
- declare const index$1_ProjectScaffolder: typeof ProjectScaffolder;
190
- type index$1_ScaffoldOptions = ScaffoldOptions;
191
- declare namespace index$1 {
192
- export { index$1_ProjectScaffolder as ProjectScaffolder, type index$1_ScaffoldOptions as ScaffoldOptions };
193
- }
194
-
195
- interface FusionContextType {
196
- client: FusionFetcher;
197
- wexts: WextsRpcClient;
198
- }
199
- interface FusionProviderProps {
200
- children: ReactNode;
201
- baseUrl?: string;
202
- rpcBaseUrl?: string;
203
- rpcClient?: object;
204
- }
205
- /**
206
- * FusionProvider - Provides API client to React components
207
- * Usage:
208
- * ```tsx
209
- * <FusionProvider baseUrl="/api">
210
- * <App />
211
- * </FusionProvider>
212
- * ```
213
- */
214
- declare function FusionProvider({ children, baseUrl, rpcBaseUrl, rpcClient }: FusionProviderProps): React.JSX.Element;
215
- /**
216
- * useFusion hook - Access API client in components
217
- * Usage:
218
- * ```tsx
219
- * const { client } = useFusion();
220
- * const data = await client.get('/users');
221
- * ```
222
- */
223
- declare function useFusion(): FusionContextType;
224
- declare function useWexts<TClient = WextsRpcClient>(): TClient;
225
-
226
- interface AuthUser {
227
- id: string;
228
- email: string;
229
- name?: string;
230
- }
231
- interface UseAuthReturn {
232
- user: AuthUser | null;
233
- loading: boolean;
234
- login: (email: string, password: string) => Promise<void>;
235
- logout: () => Promise<void>;
236
- isAuthenticated: boolean;
237
- }
238
- /**
239
- * useAuth hook - Authentication state management
240
- * Usage:
241
- * ```tsx
242
- * const { user, login, logout, isAuthenticated } = useAuth();
243
- * ```
244
- */
245
- declare function useAuth(): UseAuthReturn;
246
-
247
- type index_AuthUser = AuthUser;
248
- declare const index_FusionProvider: typeof FusionProvider;
249
- type index_FusionProviderProps = FusionProviderProps;
250
- type index_UseAuthReturn = UseAuthReturn;
251
- declare const index_useAuth: typeof useAuth;
252
- declare const index_useFusion: typeof useFusion;
253
- declare const index_useWexts: typeof useWexts;
254
- declare namespace index {
255
- export { type index_AuthUser as AuthUser, index_FusionProvider as FusionProvider, type index_FusionProviderProps as FusionProviderProps, type index_UseAuthReturn as UseAuthReturn, index_useAuth as useAuth, index_useFusion as useFusion, index_useWexts as useWexts };
256
- }
257
-
258
- export { index$3 as Config, index$4 as Core, index$1 as CreateFusion, index$2 as Insight, index as Next };
package/dist/index.d.ts DELETED
@@ -1,258 +0,0 @@
1
- export { i as Codegen } from './index-7QeQEf37.js';
2
- export { i as DevServer } from './index-7RvU-jGE.js';
3
- export { i as Nest } from './index-Co5ZsLqq.js';
4
- import React, { ReactNode } from 'react';
5
- import { FusionFetcher, WextsRpcClient } from './client/index.js';
6
- export { i as Rpc } from './index-KL_1BrQb.js';
7
- export { Todo, User } from './types/index.js';
8
- import './types-7d_fC-C3.js';
9
- import './decorators-DvS58PqC.js';
10
-
11
- interface FusionConfig {
12
- [key: string]: any;
13
- }
14
- declare class ConfigLoader {
15
- private config;
16
- private configDir;
17
- constructor(configDir?: string);
18
- /**
19
- * Load configuration from file or environment
20
- */
21
- load(key: string, defaultValue?: any): any;
22
- /**
23
- * Set configuration value
24
- */
25
- set(key: string, value: any): void;
26
- /**
27
- * Get all configuration
28
- */
29
- getAll(): FusionConfig;
30
- /**
31
- * Parse environment value (handles JSON strings)
32
- */
33
- private parseEnvValue;
34
- }
35
- declare const config: ConfigLoader;
36
- declare function load(key: string, defaultValue?: any): any;
37
-
38
- declare enum LogLevel {
39
- DEBUG = 0,
40
- INFO = 1,
41
- WARN = 2,
42
- ERROR = 3
43
- }
44
- interface LoggerOptions {
45
- level?: LogLevel;
46
- prefix?: string;
47
- timestamp?: boolean;
48
- }
49
- declare class Logger {
50
- private level;
51
- private prefix;
52
- private timestamp;
53
- constructor(options?: LoggerOptions);
54
- private formatMessage;
55
- debug(...args: any[]): void;
56
- info(...args: any[]): void;
57
- warn(...args: any[]): void;
58
- error(...args: any[]): void;
59
- success(...args: any[]): void;
60
- }
61
- declare const logger: Logger;
62
- declare function createLogger(options: LoggerOptions): Logger;
63
-
64
- declare class FileSystem {
65
- /**
66
- * Read file as string
67
- */
68
- readFile(filePath: string, encoding?: BufferEncoding): Promise<string>;
69
- /**
70
- * Write file
71
- */
72
- writeFile(filePath: string, content: string): Promise<void>;
73
- /**
74
- * Read JSON file
75
- */
76
- readJSON<T = any>(filePath: string): Promise<T>;
77
- /**
78
- * Write JSON file
79
- */
80
- writeJSON(filePath: string, data: any, pretty?: boolean): Promise<void>;
81
- /**
82
- * Check if file/directory exists
83
- */
84
- exists(filePath: string): Promise<boolean>;
85
- /**
86
- * Ensure directory exists (create if not)
87
- */
88
- ensureDir(dirPath: string): Promise<void>;
89
- /**
90
- * Copy file
91
- */
92
- copyFile(src: string, dest: string): Promise<void>;
93
- /**
94
- * Read directory
95
- */
96
- readDir(dirPath: string): Promise<string[]>;
97
- }
98
- declare const filesystem: FileSystem;
99
-
100
- declare class ProcessManager {
101
- /**
102
- * Setup process error handlers
103
- */
104
- static initialize(): void;
105
- /**
106
- * Graceful shutdown helper
107
- */
108
- static shutdown(cleanup: () => Promise<void>): Promise<void>;
109
- }
110
-
111
- declare class FusionError extends Error {
112
- code?: string | undefined;
113
- constructor(message: string, code?: string | undefined);
114
- }
115
- declare class ConfigError extends FusionError {
116
- constructor(message: string);
117
- }
118
- declare class ValidationError extends FusionError {
119
- constructor(message: string);
120
- }
121
- declare class APIError extends FusionError {
122
- statusCode?: number | undefined;
123
- constructor(message: string, statusCode?: number | undefined);
124
- }
125
-
126
- type index$4_APIError = APIError;
127
- declare const index$4_APIError: typeof APIError;
128
- type index$4_ConfigError = ConfigError;
129
- declare const index$4_ConfigError: typeof ConfigError;
130
- type index$4_ConfigLoader = ConfigLoader;
131
- declare const index$4_ConfigLoader: typeof ConfigLoader;
132
- type index$4_FileSystem = FileSystem;
133
- declare const index$4_FileSystem: typeof FileSystem;
134
- type index$4_FusionConfig = FusionConfig;
135
- type index$4_FusionError = FusionError;
136
- declare const index$4_FusionError: typeof FusionError;
137
- type index$4_LogLevel = LogLevel;
138
- declare const index$4_LogLevel: typeof LogLevel;
139
- type index$4_Logger = Logger;
140
- declare const index$4_Logger: typeof Logger;
141
- type index$4_LoggerOptions = LoggerOptions;
142
- type index$4_ProcessManager = ProcessManager;
143
- declare const index$4_ProcessManager: typeof ProcessManager;
144
- type index$4_ValidationError = ValidationError;
145
- declare const index$4_ValidationError: typeof ValidationError;
146
- declare const index$4_config: typeof config;
147
- declare const index$4_createLogger: typeof createLogger;
148
- declare const index$4_filesystem: typeof filesystem;
149
- declare const index$4_load: typeof load;
150
- declare const index$4_logger: typeof logger;
151
- declare namespace index$4 {
152
- export { index$4_APIError as APIError, index$4_ConfigError as ConfigError, index$4_ConfigLoader as ConfigLoader, index$4_FileSystem as FileSystem, type index$4_FusionConfig as FusionConfig, index$4_FusionError as FusionError, index$4_LogLevel as LogLevel, index$4_Logger as Logger, type index$4_LoggerOptions as LoggerOptions, index$4_ProcessManager as ProcessManager, index$4_ValidationError as ValidationError, index$4_config as config, index$4_createLogger as createLogger, index$4_filesystem as filesystem, index$4_load as load, index$4_logger as logger };
153
- }
154
-
155
- declare const loader: {
156
- load: () => {};
157
- };
158
-
159
- declare const index$3_loader: typeof loader;
160
- declare namespace index$3 {
161
- export { index$3_loader as loader };
162
- }
163
-
164
- declare const server: {
165
- start: () => void;
166
- };
167
-
168
- declare const index$2_server: typeof server;
169
- declare namespace index$2 {
170
- export { index$2_server as server };
171
- }
172
-
173
- interface ScaffoldOptions {
174
- projectName: string;
175
- template: 'monorepo' | 'api' | 'web';
176
- packageManager?: 'npm' | 'pnpm' | 'yarn';
177
- }
178
- /**
179
- * @deprecated Use the `wexts create` CLI and `examples/hello-rpc` canonical scaffold instead.
180
- */
181
- declare class ProjectScaffolder {
182
- scaffold(options: ScaffoldOptions): Promise<void>;
183
- private createMonorepo;
184
- private createNestJSApp;
185
- private createNextJSApp;
186
- }
187
-
188
- type index$1_ProjectScaffolder = ProjectScaffolder;
189
- declare const index$1_ProjectScaffolder: typeof ProjectScaffolder;
190
- type index$1_ScaffoldOptions = ScaffoldOptions;
191
- declare namespace index$1 {
192
- export { index$1_ProjectScaffolder as ProjectScaffolder, type index$1_ScaffoldOptions as ScaffoldOptions };
193
- }
194
-
195
- interface FusionContextType {
196
- client: FusionFetcher;
197
- wexts: WextsRpcClient;
198
- }
199
- interface FusionProviderProps {
200
- children: ReactNode;
201
- baseUrl?: string;
202
- rpcBaseUrl?: string;
203
- rpcClient?: object;
204
- }
205
- /**
206
- * FusionProvider - Provides API client to React components
207
- * Usage:
208
- * ```tsx
209
- * <FusionProvider baseUrl="/api">
210
- * <App />
211
- * </FusionProvider>
212
- * ```
213
- */
214
- declare function FusionProvider({ children, baseUrl, rpcBaseUrl, rpcClient }: FusionProviderProps): React.JSX.Element;
215
- /**
216
- * useFusion hook - Access API client in components
217
- * Usage:
218
- * ```tsx
219
- * const { client } = useFusion();
220
- * const data = await client.get('/users');
221
- * ```
222
- */
223
- declare function useFusion(): FusionContextType;
224
- declare function useWexts<TClient = WextsRpcClient>(): TClient;
225
-
226
- interface AuthUser {
227
- id: string;
228
- email: string;
229
- name?: string;
230
- }
231
- interface UseAuthReturn {
232
- user: AuthUser | null;
233
- loading: boolean;
234
- login: (email: string, password: string) => Promise<void>;
235
- logout: () => Promise<void>;
236
- isAuthenticated: boolean;
237
- }
238
- /**
239
- * useAuth hook - Authentication state management
240
- * Usage:
241
- * ```tsx
242
- * const { user, login, logout, isAuthenticated } = useAuth();
243
- * ```
244
- */
245
- declare function useAuth(): UseAuthReturn;
246
-
247
- type index_AuthUser = AuthUser;
248
- declare const index_FusionProvider: typeof FusionProvider;
249
- type index_FusionProviderProps = FusionProviderProps;
250
- type index_UseAuthReturn = UseAuthReturn;
251
- declare const index_useAuth: typeof useAuth;
252
- declare const index_useFusion: typeof useFusion;
253
- declare const index_useWexts: typeof useWexts;
254
- declare namespace index {
255
- export { type index_AuthUser as AuthUser, index_FusionProvider as FusionProvider, type index_FusionProviderProps as FusionProviderProps, type index_UseAuthReturn as UseAuthReturn, index_useAuth as useAuth, index_useFusion as useFusion, index_useWexts as useWexts };
256
- }
257
-
258
- export { index$3 as Config, index$4 as Core, index$1 as CreateFusion, index$2 as Insight, index as Next };