wexts 3.0.2 → 4.0.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/README.md +49 -346
- package/bin/wexts.cjs +2 -0
- package/dist/chunk-2KAQYLVN.js +0 -0
- package/dist/chunk-2KAQYLVN.js.map +1 -1
- package/dist/{chunk-O42L6HOX.js → chunk-2LJVUMXW.js} +79 -93
- package/dist/chunk-2LJVUMXW.js.map +1 -0
- package/dist/chunk-7QKLIVRF.js +94 -0
- package/dist/chunk-7QKLIVRF.js.map +1 -0
- package/dist/{chunk-FCEZDH42.mjs → chunk-7WULUGLH.mjs} +5 -3
- package/dist/chunk-7WULUGLH.mjs.map +1 -0
- package/dist/{chunk-WF65EDRZ.js → chunk-BG56B4DE.js} +20 -2
- package/dist/chunk-BG56B4DE.js.map +1 -0
- package/dist/chunk-CLM5PNSG.mjs +496 -0
- package/dist/chunk-CLM5PNSG.mjs.map +1 -0
- package/dist/chunk-DNLGCKTT.js +31 -0
- package/dist/chunk-DNLGCKTT.js.map +1 -0
- package/dist/{chunk-VNNVLQLJ.mjs → chunk-JHOVXH3X.mjs} +2 -2
- package/dist/chunk-JHOVXH3X.mjs.map +1 -0
- package/dist/chunk-MXINIFPC.js +105 -0
- package/dist/chunk-MXINIFPC.js.map +1 -0
- package/dist/chunk-SE32ZPOZ.js +496 -0
- package/dist/chunk-SE32ZPOZ.js.map +1 -0
- package/dist/{chunk-STTOPUZ2.mjs → chunk-UAL54DVV.mjs} +21 -3
- package/dist/chunk-UAL54DVV.mjs.map +1 -0
- package/dist/{chunk-3OM7CHCA.js → chunk-WCKSKU3C.js} +1 -1
- package/dist/chunk-WCKSKU3C.js.map +1 -0
- package/dist/chunk-WU6FW77M.mjs +105 -0
- package/dist/chunk-WU6FW77M.mjs.map +1 -0
- package/dist/chunk-XE4OXN2W.js +0 -0
- package/dist/chunk-XE4OXN2W.js.map +1 -1
- package/dist/chunk-YBM3IJEA.mjs +94 -0
- package/dist/chunk-YBM3IJEA.mjs.map +1 -0
- package/dist/{chunk-KXYLEUSW.mjs → chunk-YN6WIWNQ.mjs} +69 -83
- package/dist/chunk-YN6WIWNQ.mjs.map +1 -0
- package/dist/chunk-YSLEF5C5.mjs +0 -0
- package/dist/chunk-YSLEF5C5.mjs.map +0 -0
- package/dist/chunk-ZX7QIN24.mjs +31 -0
- package/dist/chunk-ZX7QIN24.mjs.map +1 -0
- package/dist/cli/index.d.mts +10 -0
- package/dist/cli/index.d.ts +10 -0
- package/dist/cli/index.js +292 -292
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +294 -293
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.d.mts +10 -1
- package/dist/client/index.d.ts +10 -1
- package/dist/client/index.js +4 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +6 -4
- package/dist/client/index.mjs.map +0 -0
- package/dist/codegen/index.d.mts +2 -1
- package/dist/codegen/index.d.ts +2 -1
- package/dist/codegen/index.js +5 -3
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/index.mjs +7 -5
- package/dist/codegen/index.mjs.map +0 -0
- package/dist/decorators-BT1FFqN0.d.mts +29 -0
- package/dist/decorators-DvS58PqC.d.ts +29 -0
- package/dist/dev-server/index.d.mts +1 -1
- package/dist/dev-server/index.d.ts +1 -1
- package/dist/dev-server/index.js +3 -3
- package/dist/dev-server/index.js.map +1 -1
- package/dist/dev-server/index.mjs +3 -3
- package/dist/dev-server/index.mjs.map +0 -0
- package/dist/{index-SjUaHgFr.d.ts → index-7QeQEf37.d.ts} +27 -10
- package/dist/{index-tFGPFVfQ.d.mts → index-7RvU-jGE.d.mts} +0 -1
- package/dist/{index-tFGPFVfQ.d.ts → index-7RvU-jGE.d.ts} +0 -1
- package/dist/{index-SjUaHgFr.d.mts → index-8nzxy0NN.d.mts} +27 -10
- package/dist/index-Co5ZsLqq.d.ts +58 -0
- package/dist/index-D94W1__r.d.mts +58 -0
- package/dist/index-DQmyVp6F.d.mts +27 -0
- package/dist/index-KL_1BrQb.d.ts +27 -0
- package/dist/index.d.mts +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +57 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -21
- package/dist/index.mjs.map +1 -1
- package/dist/nest/index.d.mts +3 -1
- package/dist/nest/index.d.ts +3 -1
- package/dist/nest/index.js +20 -2
- package/dist/nest/index.js.map +1 -1
- package/dist/nest/index.mjs +21 -3
- package/dist/nest/index.mjs.map +0 -0
- package/dist/next/index.d.mts +7 -2
- package/dist/next/index.d.ts +7 -2
- package/dist/next/index.js +72 -5
- package/dist/next/index.js.map +1 -1
- package/dist/next/index.mjs +70 -4
- package/dist/next/index.mjs.map +1 -1
- package/dist/rpc/index.d.mts +2 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.js +23 -0
- package/dist/rpc/index.js.map +1 -0
- package/dist/rpc/index.mjs +23 -0
- package/dist/{chunk-7NSRDJ5C.mjs.map → rpc/index.mjs.map} +0 -0
- package/dist/runtime/index.d.mts +55 -0
- package/dist/runtime/index.d.ts +55 -0
- package/dist/runtime/index.js +213 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/index.mjs +213 -0
- package/dist/runtime/index.mjs.map +1 -0
- package/dist/types/index.d.mts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.js +0 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +0 -0
- package/dist/types-7d_fC-C3.d.mts +32 -0
- package/dist/types-7d_fC-C3.d.ts +32 -0
- package/dist/vercel-builder/index.d.mts +58 -0
- package/dist/vercel-builder/index.d.ts +58 -0
- package/dist/vercel-builder/index.js +330 -0
- package/dist/vercel-builder/index.js.map +1 -0
- package/dist/vercel-builder/index.mjs +330 -0
- package/dist/vercel-builder/index.mjs.map +1 -0
- package/package.json +37 -16
- package/templates/.dockerignore +43 -43
- package/templates/.env.example +0 -0
- package/templates/Dockerfile +60 -60
- package/templates/Procfile +1 -1
- package/templates/README.md +67 -58
- package/templates/api-sdk.ts +115 -115
- package/templates/docker-compose.yml +34 -34
- package/templates/nestjs-api/.env.example +0 -0
- package/templates/nestjs-api/README.md +87 -79
- package/templates/nestjs-api/nest-cli.json +6 -6
- package/templates/nestjs-api/package-lock.json +5623 -5623
- package/templates/nestjs-api/package.json +40 -40
- package/templates/nestjs-api/prisma/dev.db +0 -0
- package/templates/nestjs-api/prisma/migrations/20251123205437_init/migration.sql +0 -0
- package/templates/nestjs-api/prisma/migrations/migration_lock.toml +0 -0
- package/templates/nestjs-api/prisma/schema.prisma +29 -29
- package/templates/nestjs-api/src/app.module.ts +17 -17
- package/templates/nestjs-api/src/auth/auth.controller.ts +27 -27
- package/templates/nestjs-api/src/auth/auth.module.ts +37 -29
- package/templates/nestjs-api/src/auth/auth.service.ts +86 -86
- package/templates/nestjs-api/src/auth/dto/auth.dto.ts +22 -22
- package/templates/nestjs-api/src/auth/guards/jwt-auth.guard.ts +5 -5
- package/templates/nestjs-api/src/auth/strategies/jwt.strategy.ts +27 -19
- package/templates/nestjs-api/src/main.ts +32 -32
- package/templates/nestjs-api/src/prisma/prisma.module.ts +9 -9
- package/templates/nestjs-api/src/prisma/prisma.service.ts +14 -14
- package/templates/nestjs-api/src/todos/dto/todo.dto.ts +24 -24
- package/templates/nestjs-api/src/todos/todos.controller.ts +39 -39
- package/templates/nestjs-api/src/todos/todos.module.ts +11 -11
- package/templates/nestjs-api/src/todos/todos.service.ts +53 -53
- package/templates/nestjs-api/src/users/users.controller.ts +14 -14
- package/templates/nestjs-api/src/users/users.module.ts +12 -12
- package/templates/nestjs-api/src/users/users.service.ts +19 -19
- package/templates/nestjs-api/tsconfig.json +39 -39
- package/templates/nextjs-web/README.md +76 -68
- package/templates/nextjs-web/app/actions/auth.ts +108 -108
- package/templates/nextjs-web/app/dashboard/error.tsx +39 -39
- package/templates/nextjs-web/app/dashboard/loading.tsx +14 -14
- package/templates/nextjs-web/app/dashboard/page.tsx +5 -5
- package/templates/nextjs-web/app/globals.css +93 -93
- package/templates/nextjs-web/app/layout.tsx +29 -29
- package/templates/nextjs-web/app/login/page.tsx +5 -5
- package/templates/nextjs-web/app/page.tsx +28 -28
- package/templates/nextjs-web/app/register/page.tsx +5 -5
- package/templates/nextjs-web/components/ui/button.tsx +56 -56
- package/templates/nextjs-web/components/ui/card.tsx +79 -79
- package/templates/nextjs-web/components/ui/input.tsx +25 -25
- package/templates/nextjs-web/components/ui/label.tsx +24 -24
- package/templates/nextjs-web/features/auth/LoginForm.tsx +140 -140
- package/templates/nextjs-web/features/auth/RegisterForm.tsx +159 -159
- package/templates/nextjs-web/features/auth/api.ts +35 -35
- package/templates/nextjs-web/features/auth/index.ts +3 -3
- package/templates/nextjs-web/features/dashboard/DashboardView.tsx +204 -204
- package/templates/nextjs-web/features/dashboard/api.ts +9 -9
- package/templates/nextjs-web/features/dashboard/components.tsx +74 -74
- package/templates/nextjs-web/features/dashboard/index.ts +3 -3
- package/templates/nextjs-web/hooks/index.ts +4 -4
- package/templates/nextjs-web/lib/api-client.ts +89 -89
- package/templates/nextjs-web/lib/api.ts +115 -115
- package/templates/nextjs-web/lib/axios-global-config.ts +17 -17
- package/templates/nextjs-web/lib/utils.ts +6 -6
- package/templates/nextjs-web/lib/wexts-client.ts +4 -4
- package/templates/nextjs-web/next-env.d.ts +6 -6
- package/templates/nextjs-web/next.config.ts +20 -20
- package/templates/nextjs-web/package-lock.json +3254 -3254
- package/templates/nextjs-web/package.json +37 -37
- package/templates/nextjs-web/postcss.config.js +6 -6
- package/templates/nextjs-web/tailwind.config.ts +69 -69
- package/templates/nextjs-web/tsconfig.json +1 -1
- package/templates/nixpacks.toml +11 -11
- package/templates/root-package.json +31 -31
- package/templates/server.ts +66 -66
- package/templates/tsconfig.json +30 -30
- package/dist/chunk-2MCBBWEA.js +0 -1
- package/dist/chunk-2MCBBWEA.js.map +0 -1
- package/dist/chunk-3OM7CHCA.js.map +0 -1
- package/dist/chunk-63MTCWU2.mjs +0 -361
- package/dist/chunk-63MTCWU2.mjs.map +0 -1
- package/dist/chunk-667BQCEM.js +0 -375
- package/dist/chunk-667BQCEM.js.map +0 -1
- package/dist/chunk-67IJ6H4J.mjs +0 -44
- package/dist/chunk-67IJ6H4J.mjs.map +0 -1
- package/dist/chunk-6SVQEGEX.mjs +0 -44
- package/dist/chunk-6SVQEGEX.mjs.map +0 -1
- package/dist/chunk-7NSRDJ5C.mjs +0 -1
- package/dist/chunk-ASDXAK6G.js +0 -44
- package/dist/chunk-ASDXAK6G.js.map +0 -1
- package/dist/chunk-CKZ4VSCB.mjs +0 -18
- package/dist/chunk-CKZ4VSCB.mjs.map +0 -1
- package/dist/chunk-DW6GOKMF.js +0 -57
- package/dist/chunk-DW6GOKMF.js.map +0 -1
- package/dist/chunk-EFZPSZWO.mjs +0 -1
- package/dist/chunk-EFZPSZWO.mjs.map +0 -1
- package/dist/chunk-FCEZDH42.mjs.map +0 -1
- package/dist/chunk-FYGXL4V7.js +0 -361
- package/dist/chunk-FYGXL4V7.js.map +0 -1
- package/dist/chunk-GKVPGKAH.js +0 -66
- package/dist/chunk-GKVPGKAH.js.map +0 -1
- package/dist/chunk-GWP6PNSP.js +0 -225
- package/dist/chunk-GWP6PNSP.js.map +0 -1
- package/dist/chunk-HQKTXE7E.mjs +0 -225
- package/dist/chunk-HQKTXE7E.mjs.map +0 -1
- package/dist/chunk-HSFLZUJN.mjs +0 -57
- package/dist/chunk-HSFLZUJN.mjs.map +0 -1
- package/dist/chunk-HU63F22V.js +0 -361
- package/dist/chunk-HU63F22V.js.map +0 -1
- package/dist/chunk-J5LGTIGS.mjs +0 -10
- package/dist/chunk-J5LGTIGS.mjs.map +0 -1
- package/dist/chunk-JMBD6DOP.js +0 -225
- package/dist/chunk-JMBD6DOP.js.map +0 -1
- package/dist/chunk-K7EIJSYQ.js +0 -1
- package/dist/chunk-K7EIJSYQ.js.map +0 -1
- package/dist/chunk-KXYLEUSW.mjs.map +0 -1
- package/dist/chunk-MTHKZO55.js +0 -44
- package/dist/chunk-MTHKZO55.js.map +0 -1
- package/dist/chunk-NNQFLD7O.mjs +0 -361
- package/dist/chunk-NNQFLD7O.mjs.map +0 -1
- package/dist/chunk-NU2UB242.js +0 -82
- package/dist/chunk-NU2UB242.js.map +0 -1
- package/dist/chunk-NULGSZFE.mjs +0 -57
- package/dist/chunk-NULGSZFE.mjs.map +0 -1
- package/dist/chunk-O42L6HOX.js.map +0 -1
- package/dist/chunk-ONXNE2A6.mjs +0 -375
- package/dist/chunk-ONXNE2A6.mjs.map +0 -1
- package/dist/chunk-OTBYRUBE.mjs +0 -225
- package/dist/chunk-OTBYRUBE.mjs.map +0 -1
- package/dist/chunk-OTSAVKLY.mjs +0 -66
- package/dist/chunk-OTSAVKLY.mjs.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-QP2TMRLG.js +0 -57
- package/dist/chunk-QP2TMRLG.js.map +0 -1
- package/dist/chunk-RS23R3ZQ.mjs +0 -82
- package/dist/chunk-RS23R3ZQ.mjs.map +0 -1
- package/dist/chunk-STTOPUZ2.mjs.map +0 -1
- package/dist/chunk-VMT3LALB.mjs +0 -51
- package/dist/chunk-VMT3LALB.mjs.map +0 -1
- package/dist/chunk-VNNVLQLJ.mjs.map +0 -1
- package/dist/chunk-W3YRVEFQ.js +0 -66
- package/dist/chunk-W3YRVEFQ.js.map +0 -1
- package/dist/chunk-WF65EDRZ.js.map +0 -1
- package/dist/chunk-WMHVXEYQ.mjs +0 -66
- package/dist/chunk-WMHVXEYQ.mjs.map +0 -1
- package/dist/chunk-XVKTIYHY.js +0 -51
- package/dist/chunk-XVKTIYHY.js.map +0 -1
- package/dist/codegen-MRZDLCYI.js +0 -13
- package/dist/codegen-MRZDLCYI.js.map +0 -1
- package/dist/codegen-UI5HTMXE.mjs +0 -13
- package/dist/codegen-UI5HTMXE.mjs.map +0 -1
- package/dist/dev-server-JKRVBWPY.mjs +0 -13
- package/dist/dev-server-JKRVBWPY.mjs.map +0 -1
- package/dist/dev-server-TLL7UQMR.js +0 -13
- package/dist/dev-server-TLL7UQMR.js.map +0 -1
- package/dist/index-BsNaOUtH.d.mts +0 -44
- package/dist/index-BsNaOUtH.d.ts +0 -44
- package/dist/index-CrbXnXsO.d.ts +0 -62
- package/dist/index-kEbGExWM.d.mts +0 -62
- package/templates/nestjs-api/.env +0 -4
- package/templates/nextjs-web/.env +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { R as RequireAuth, a as RpcMethod, b as RpcMethodOptions, c as RpcService, d as RpcServiceOptions, e as RuntimeRpcMethodMetadata, f as RuntimeRpcServiceMetadata, W as WextsRpc, g as WextsRpcService, h as getRpcAuthPolicy, i as getRuntimeRpcMethodsMetadata, j as getRuntimeRpcServiceMetadata } from './decorators-BT1FFqN0.mjs';
|
|
2
|
+
|
|
3
|
+
interface FusionRouteMetadata {
|
|
4
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
5
|
+
path: string;
|
|
6
|
+
responseType?: string;
|
|
7
|
+
requestType?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Mark a NestJS controller for Fusion codegen
|
|
11
|
+
* Usage: @FusionController('users')
|
|
12
|
+
*/
|
|
13
|
+
declare function FusionController(prefix?: string): ClassDecorator;
|
|
14
|
+
/**
|
|
15
|
+
* Mark a route for API client generation
|
|
16
|
+
* Usage: @FusionRoute({ method: 'GET', path: '/:id' })
|
|
17
|
+
*/
|
|
18
|
+
declare function FusionRoute(metadata: FusionRouteMetadata): MethodDecorator;
|
|
19
|
+
/**
|
|
20
|
+
* Helper decorators for common HTTP methods
|
|
21
|
+
*/
|
|
22
|
+
declare function FusionGet(path?: string): MethodDecorator;
|
|
23
|
+
declare function FusionPost(path?: string): MethodDecorator;
|
|
24
|
+
declare function FusionPut(path?: string): MethodDecorator;
|
|
25
|
+
declare function FusionDelete(path?: string): MethodDecorator;
|
|
26
|
+
/**
|
|
27
|
+
* Get Fusion metadata from a controller
|
|
28
|
+
*/
|
|
29
|
+
declare function getFusionMetadata(controller: any): {
|
|
30
|
+
controller: any;
|
|
31
|
+
routes: any[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
declare const index_FusionController: typeof FusionController;
|
|
35
|
+
declare const index_FusionDelete: typeof FusionDelete;
|
|
36
|
+
declare const index_FusionGet: typeof FusionGet;
|
|
37
|
+
declare const index_FusionPost: typeof FusionPost;
|
|
38
|
+
declare const index_FusionPut: typeof FusionPut;
|
|
39
|
+
declare const index_FusionRoute: typeof FusionRoute;
|
|
40
|
+
type index_FusionRouteMetadata = FusionRouteMetadata;
|
|
41
|
+
declare const index_RequireAuth: typeof RequireAuth;
|
|
42
|
+
declare const index_RpcMethod: typeof RpcMethod;
|
|
43
|
+
declare const index_RpcMethodOptions: typeof RpcMethodOptions;
|
|
44
|
+
declare const index_RpcService: typeof RpcService;
|
|
45
|
+
declare const index_RpcServiceOptions: typeof RpcServiceOptions;
|
|
46
|
+
declare const index_RuntimeRpcMethodMetadata: typeof RuntimeRpcMethodMetadata;
|
|
47
|
+
declare const index_RuntimeRpcServiceMetadata: typeof RuntimeRpcServiceMetadata;
|
|
48
|
+
declare const index_WextsRpc: typeof WextsRpc;
|
|
49
|
+
declare const index_WextsRpcService: typeof WextsRpcService;
|
|
50
|
+
declare const index_getFusionMetadata: typeof getFusionMetadata;
|
|
51
|
+
declare const index_getRpcAuthPolicy: typeof getRpcAuthPolicy;
|
|
52
|
+
declare const index_getRuntimeRpcMethodsMetadata: typeof getRuntimeRpcMethodsMetadata;
|
|
53
|
+
declare const index_getRuntimeRpcServiceMetadata: typeof getRuntimeRpcServiceMetadata;
|
|
54
|
+
declare namespace index {
|
|
55
|
+
export { index_FusionController as FusionController, index_FusionDelete as FusionDelete, index_FusionGet as FusionGet, index_FusionPost as FusionPost, index_FusionPut as FusionPut, index_FusionRoute as FusionRoute, type index_FusionRouteMetadata as FusionRouteMetadata, index_RequireAuth as RequireAuth, index_RpcMethod as RpcMethod, index_RpcMethodOptions as RpcMethodOptions, index_RpcService as RpcService, index_RpcServiceOptions as RpcServiceOptions, index_RuntimeRpcMethodMetadata as RuntimeRpcMethodMetadata, index_RuntimeRpcServiceMetadata as RuntimeRpcServiceMetadata, index_WextsRpc as WextsRpc, index_WextsRpcService as WextsRpcService, index_getFusionMetadata as getFusionMetadata, index_getRpcAuthPolicy as getRpcAuthPolicy, index_getRuntimeRpcMethodsMetadata as getRuntimeRpcMethodsMetadata, index_getRuntimeRpcServiceMetadata as getRuntimeRpcServiceMetadata };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { FusionController as F, FusionDelete as a, FusionGet as b, FusionPost as c, FusionPut as d, FusionRoute as e, type FusionRouteMetadata as f, getFusionMetadata as g, index as i };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { R as RequireAuth, a as RpcMethod, b as RpcMethodOptions, c as RpcService, d as RpcServiceOptions, e as RuntimeRpcMethodMetadata, f as RuntimeRpcServiceMetadata, W as WextsRpc, g as WextsRpcService, h as getRpcAuthPolicy, i as getRuntimeRpcMethodsMetadata, j as getRuntimeRpcServiceMetadata } from './decorators-BT1FFqN0.mjs';
|
|
2
|
+
import { R as RpcAuthPolicy, a as RpcInvocationRequest, b as RpcInvocationResponse, c as RpcManifest, d as RpcMethodManifest, e as RpcParameterManifest, f as RpcServiceManifest } from './types-7d_fC-C3.mjs';
|
|
3
|
+
|
|
4
|
+
declare const index_RequireAuth: typeof RequireAuth;
|
|
5
|
+
declare const index_RpcAuthPolicy: typeof RpcAuthPolicy;
|
|
6
|
+
declare const index_RpcInvocationRequest: typeof RpcInvocationRequest;
|
|
7
|
+
declare const index_RpcInvocationResponse: typeof RpcInvocationResponse;
|
|
8
|
+
declare const index_RpcManifest: typeof RpcManifest;
|
|
9
|
+
declare const index_RpcMethod: typeof RpcMethod;
|
|
10
|
+
declare const index_RpcMethodManifest: typeof RpcMethodManifest;
|
|
11
|
+
declare const index_RpcMethodOptions: typeof RpcMethodOptions;
|
|
12
|
+
declare const index_RpcParameterManifest: typeof RpcParameterManifest;
|
|
13
|
+
declare const index_RpcService: typeof RpcService;
|
|
14
|
+
declare const index_RpcServiceManifest: typeof RpcServiceManifest;
|
|
15
|
+
declare const index_RpcServiceOptions: typeof RpcServiceOptions;
|
|
16
|
+
declare const index_RuntimeRpcMethodMetadata: typeof RuntimeRpcMethodMetadata;
|
|
17
|
+
declare const index_RuntimeRpcServiceMetadata: typeof RuntimeRpcServiceMetadata;
|
|
18
|
+
declare const index_WextsRpc: typeof WextsRpc;
|
|
19
|
+
declare const index_WextsRpcService: typeof WextsRpcService;
|
|
20
|
+
declare const index_getRpcAuthPolicy: typeof getRpcAuthPolicy;
|
|
21
|
+
declare const index_getRuntimeRpcMethodsMetadata: typeof getRuntimeRpcMethodsMetadata;
|
|
22
|
+
declare const index_getRuntimeRpcServiceMetadata: typeof getRuntimeRpcServiceMetadata;
|
|
23
|
+
declare namespace index {
|
|
24
|
+
export { index_RequireAuth as RequireAuth, index_RpcAuthPolicy as RpcAuthPolicy, index_RpcInvocationRequest as RpcInvocationRequest, index_RpcInvocationResponse as RpcInvocationResponse, index_RpcManifest as RpcManifest, index_RpcMethod as RpcMethod, index_RpcMethodManifest as RpcMethodManifest, index_RpcMethodOptions as RpcMethodOptions, index_RpcParameterManifest as RpcParameterManifest, index_RpcService as RpcService, index_RpcServiceManifest as RpcServiceManifest, index_RpcServiceOptions as RpcServiceOptions, index_RuntimeRpcMethodMetadata as RuntimeRpcMethodMetadata, index_RuntimeRpcServiceMetadata as RuntimeRpcServiceMetadata, index_WextsRpc as WextsRpc, index_WextsRpcService as WextsRpcService, index_getRpcAuthPolicy as getRpcAuthPolicy, index_getRuntimeRpcMethodsMetadata as getRuntimeRpcMethodsMetadata, index_getRuntimeRpcServiceMetadata as getRuntimeRpcServiceMetadata };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { index as i };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { R as RequireAuth, a as RpcMethod, b as RpcMethodOptions, c as RpcService, d as RpcServiceOptions, e as RuntimeRpcMethodMetadata, f as RuntimeRpcServiceMetadata, W as WextsRpc, g as WextsRpcService, h as getRpcAuthPolicy, i as getRuntimeRpcMethodsMetadata, j as getRuntimeRpcServiceMetadata } from './decorators-DvS58PqC.js';
|
|
2
|
+
import { R as RpcAuthPolicy, a as RpcInvocationRequest, b as RpcInvocationResponse, c as RpcManifest, d as RpcMethodManifest, e as RpcParameterManifest, f as RpcServiceManifest } from './types-7d_fC-C3.js';
|
|
3
|
+
|
|
4
|
+
declare const index_RequireAuth: typeof RequireAuth;
|
|
5
|
+
declare const index_RpcAuthPolicy: typeof RpcAuthPolicy;
|
|
6
|
+
declare const index_RpcInvocationRequest: typeof RpcInvocationRequest;
|
|
7
|
+
declare const index_RpcInvocationResponse: typeof RpcInvocationResponse;
|
|
8
|
+
declare const index_RpcManifest: typeof RpcManifest;
|
|
9
|
+
declare const index_RpcMethod: typeof RpcMethod;
|
|
10
|
+
declare const index_RpcMethodManifest: typeof RpcMethodManifest;
|
|
11
|
+
declare const index_RpcMethodOptions: typeof RpcMethodOptions;
|
|
12
|
+
declare const index_RpcParameterManifest: typeof RpcParameterManifest;
|
|
13
|
+
declare const index_RpcService: typeof RpcService;
|
|
14
|
+
declare const index_RpcServiceManifest: typeof RpcServiceManifest;
|
|
15
|
+
declare const index_RpcServiceOptions: typeof RpcServiceOptions;
|
|
16
|
+
declare const index_RuntimeRpcMethodMetadata: typeof RuntimeRpcMethodMetadata;
|
|
17
|
+
declare const index_RuntimeRpcServiceMetadata: typeof RuntimeRpcServiceMetadata;
|
|
18
|
+
declare const index_WextsRpc: typeof WextsRpc;
|
|
19
|
+
declare const index_WextsRpcService: typeof WextsRpcService;
|
|
20
|
+
declare const index_getRpcAuthPolicy: typeof getRpcAuthPolicy;
|
|
21
|
+
declare const index_getRuntimeRpcMethodsMetadata: typeof getRuntimeRpcMethodsMetadata;
|
|
22
|
+
declare const index_getRuntimeRpcServiceMetadata: typeof getRuntimeRpcServiceMetadata;
|
|
23
|
+
declare namespace index {
|
|
24
|
+
export { index_RequireAuth as RequireAuth, index_RpcAuthPolicy as RpcAuthPolicy, index_RpcInvocationRequest as RpcInvocationRequest, index_RpcInvocationResponse as RpcInvocationResponse, index_RpcManifest as RpcManifest, index_RpcMethod as RpcMethod, index_RpcMethodManifest as RpcMethodManifest, index_RpcMethodOptions as RpcMethodOptions, index_RpcParameterManifest as RpcParameterManifest, index_RpcService as RpcService, index_RpcServiceManifest as RpcServiceManifest, index_RpcServiceOptions as RpcServiceOptions, index_RuntimeRpcMethodMetadata as RuntimeRpcMethodMetadata, index_RuntimeRpcServiceMetadata as RuntimeRpcServiceMetadata, index_WextsRpc as WextsRpc, index_WextsRpcService as WextsRpcService, index_getRpcAuthPolicy as getRpcAuthPolicy, index_getRuntimeRpcMethodsMetadata as getRuntimeRpcMethodsMetadata, index_getRuntimeRpcServiceMetadata as getRuntimeRpcServiceMetadata };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { index as i };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export { i as Codegen } from './index-
|
|
2
|
-
export { i as DevServer } from './index-
|
|
3
|
-
export { i as Nest } from './index-
|
|
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
4
|
import React, { ReactNode } from 'react';
|
|
5
|
-
import { FusionFetcher } from './client/index.mjs';
|
|
5
|
+
import { FusionFetcher, WextsRpcClient } from './client/index.mjs';
|
|
6
|
+
export { i as Rpc } from './index-DQmyVp6F.mjs';
|
|
6
7
|
export { Todo, User } from './types/index.mjs';
|
|
8
|
+
import './types-7d_fC-C3.mjs';
|
|
9
|
+
import './decorators-BT1FFqN0.mjs';
|
|
7
10
|
|
|
8
11
|
interface FusionConfig {
|
|
9
12
|
[key: string]: any;
|
|
@@ -172,6 +175,9 @@ interface ScaffoldOptions {
|
|
|
172
175
|
template: 'monorepo' | 'api' | 'web';
|
|
173
176
|
packageManager?: 'npm' | 'pnpm' | 'yarn';
|
|
174
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Use the `wexts create` CLI and `examples/hello-rpc` canonical scaffold instead.
|
|
180
|
+
*/
|
|
175
181
|
declare class ProjectScaffolder {
|
|
176
182
|
scaffold(options: ScaffoldOptions): Promise<void>;
|
|
177
183
|
private createMonorepo;
|
|
@@ -188,10 +194,13 @@ declare namespace index$1 {
|
|
|
188
194
|
|
|
189
195
|
interface FusionContextType {
|
|
190
196
|
client: FusionFetcher;
|
|
197
|
+
wexts: WextsRpcClient;
|
|
191
198
|
}
|
|
192
199
|
interface FusionProviderProps {
|
|
193
200
|
children: ReactNode;
|
|
194
201
|
baseUrl?: string;
|
|
202
|
+
rpcBaseUrl?: string;
|
|
203
|
+
rpcClient?: object;
|
|
195
204
|
}
|
|
196
205
|
/**
|
|
197
206
|
* FusionProvider - Provides API client to React components
|
|
@@ -202,7 +211,7 @@ interface FusionProviderProps {
|
|
|
202
211
|
* </FusionProvider>
|
|
203
212
|
* ```
|
|
204
213
|
*/
|
|
205
|
-
declare function FusionProvider({ children, baseUrl }: FusionProviderProps): React.JSX.Element;
|
|
214
|
+
declare function FusionProvider({ children, baseUrl, rpcBaseUrl, rpcClient }: FusionProviderProps): React.JSX.Element;
|
|
206
215
|
/**
|
|
207
216
|
* useFusion hook - Access API client in components
|
|
208
217
|
* Usage:
|
|
@@ -212,6 +221,7 @@ declare function FusionProvider({ children, baseUrl }: FusionProviderProps): Rea
|
|
|
212
221
|
* ```
|
|
213
222
|
*/
|
|
214
223
|
declare function useFusion(): FusionContextType;
|
|
224
|
+
declare function useWexts<TClient = WextsRpcClient>(): TClient;
|
|
215
225
|
|
|
216
226
|
interface AuthUser {
|
|
217
227
|
id: string;
|
|
@@ -240,8 +250,9 @@ type index_FusionProviderProps = FusionProviderProps;
|
|
|
240
250
|
type index_UseAuthReturn = UseAuthReturn;
|
|
241
251
|
declare const index_useAuth: typeof useAuth;
|
|
242
252
|
declare const index_useFusion: typeof useFusion;
|
|
253
|
+
declare const index_useWexts: typeof useWexts;
|
|
243
254
|
declare namespace index {
|
|
244
|
-
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 };
|
|
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 };
|
|
245
256
|
}
|
|
246
257
|
|
|
247
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
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export { i as Codegen } from './index-
|
|
2
|
-
export { i as DevServer } from './index-
|
|
3
|
-
export { i as Nest } from './index-
|
|
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
4
|
import React, { ReactNode } from 'react';
|
|
5
|
-
import { FusionFetcher } from './client/index.js';
|
|
5
|
+
import { FusionFetcher, WextsRpcClient } from './client/index.js';
|
|
6
|
+
export { i as Rpc } from './index-KL_1BrQb.js';
|
|
6
7
|
export { Todo, User } from './types/index.js';
|
|
8
|
+
import './types-7d_fC-C3.js';
|
|
9
|
+
import './decorators-DvS58PqC.js';
|
|
7
10
|
|
|
8
11
|
interface FusionConfig {
|
|
9
12
|
[key: string]: any;
|
|
@@ -172,6 +175,9 @@ interface ScaffoldOptions {
|
|
|
172
175
|
template: 'monorepo' | 'api' | 'web';
|
|
173
176
|
packageManager?: 'npm' | 'pnpm' | 'yarn';
|
|
174
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Use the `wexts create` CLI and `examples/hello-rpc` canonical scaffold instead.
|
|
180
|
+
*/
|
|
175
181
|
declare class ProjectScaffolder {
|
|
176
182
|
scaffold(options: ScaffoldOptions): Promise<void>;
|
|
177
183
|
private createMonorepo;
|
|
@@ -188,10 +194,13 @@ declare namespace index$1 {
|
|
|
188
194
|
|
|
189
195
|
interface FusionContextType {
|
|
190
196
|
client: FusionFetcher;
|
|
197
|
+
wexts: WextsRpcClient;
|
|
191
198
|
}
|
|
192
199
|
interface FusionProviderProps {
|
|
193
200
|
children: ReactNode;
|
|
194
201
|
baseUrl?: string;
|
|
202
|
+
rpcBaseUrl?: string;
|
|
203
|
+
rpcClient?: object;
|
|
195
204
|
}
|
|
196
205
|
/**
|
|
197
206
|
* FusionProvider - Provides API client to React components
|
|
@@ -202,7 +211,7 @@ interface FusionProviderProps {
|
|
|
202
211
|
* </FusionProvider>
|
|
203
212
|
* ```
|
|
204
213
|
*/
|
|
205
|
-
declare function FusionProvider({ children, baseUrl }: FusionProviderProps): React.JSX.Element;
|
|
214
|
+
declare function FusionProvider({ children, baseUrl, rpcBaseUrl, rpcClient }: FusionProviderProps): React.JSX.Element;
|
|
206
215
|
/**
|
|
207
216
|
* useFusion hook - Access API client in components
|
|
208
217
|
* Usage:
|
|
@@ -212,6 +221,7 @@ declare function FusionProvider({ children, baseUrl }: FusionProviderProps): Rea
|
|
|
212
221
|
* ```
|
|
213
222
|
*/
|
|
214
223
|
declare function useFusion(): FusionContextType;
|
|
224
|
+
declare function useWexts<TClient = WextsRpcClient>(): TClient;
|
|
215
225
|
|
|
216
226
|
interface AuthUser {
|
|
217
227
|
id: string;
|
|
@@ -240,8 +250,9 @@ type index_FusionProviderProps = FusionProviderProps;
|
|
|
240
250
|
type index_UseAuthReturn = UseAuthReturn;
|
|
241
251
|
declare const index_useAuth: typeof useAuth;
|
|
242
252
|
declare const index_useFusion: typeof useFusion;
|
|
253
|
+
declare const index_useWexts: typeof useWexts;
|
|
243
254
|
declare namespace index {
|
|
244
|
-
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 };
|
|
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 };
|
|
245
256
|
}
|
|
246
257
|
|
|
247
258
|
export { index$3 as Config, index$4 as Core, index$1 as CreateFusion, index$2 as Insight, index as Next };
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _class;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2LJVUMXWjs = require('./chunk-2LJVUMXW.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkWF65EDRZjs = require('./chunk-WF65EDRZ.js');
|
|
7
|
-
require('./chunk-2KAQYLVN.js');
|
|
8
6
|
|
|
7
|
+
var _chunkMXINIFPCjs = require('./chunk-MXINIFPC.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkBG56B4DEjs = require('./chunk-BG56B4DE.js');
|
|
9
11
|
|
|
10
12
|
|
|
13
|
+
var _chunkDNLGCKTTjs = require('./chunk-DNLGCKTT.js');
|
|
14
|
+
require('./chunk-7QKLIVRF.js');
|
|
15
|
+
require('./chunk-2KAQYLVN.js');
|
|
16
|
+
|
|
11
17
|
|
|
12
|
-
var _chunk667BQCEMjs = require('./chunk-667BQCEM.js');
|
|
13
18
|
|
|
14
19
|
|
|
15
|
-
var
|
|
20
|
+
var _chunkSE32ZPOZjs = require('./chunk-SE32ZPOZ.js');
|
|
16
21
|
|
|
17
22
|
|
|
18
23
|
|
|
19
24
|
|
|
20
25
|
|
|
21
|
-
var
|
|
26
|
+
var _chunkWCKSKU3Cjs = require('./chunk-WCKSKU3C.js');
|
|
22
27
|
|
|
23
28
|
|
|
24
29
|
|
|
@@ -30,17 +35,17 @@ _chunkXE4OXN2Wjs.__export.call(void 0, core_exports, {
|
|
|
30
35
|
APIError: () => APIError,
|
|
31
36
|
ConfigError: () => ConfigError,
|
|
32
37
|
ConfigLoader: () => ConfigLoader,
|
|
33
|
-
FileSystem: () =>
|
|
38
|
+
FileSystem: () => _chunkSE32ZPOZjs.FileSystem,
|
|
34
39
|
FusionError: () => FusionError,
|
|
35
|
-
LogLevel: () =>
|
|
36
|
-
Logger: () =>
|
|
40
|
+
LogLevel: () => _chunkWCKSKU3Cjs.LogLevel,
|
|
41
|
+
Logger: () => _chunkWCKSKU3Cjs.Logger,
|
|
37
42
|
ProcessManager: () => ProcessManager,
|
|
38
43
|
ValidationError: () => ValidationError,
|
|
39
44
|
config: () => config,
|
|
40
|
-
createLogger: () =>
|
|
41
|
-
filesystem: () =>
|
|
45
|
+
createLogger: () => _chunkWCKSKU3Cjs.createLogger,
|
|
46
|
+
filesystem: () => _chunkSE32ZPOZjs.filesystem,
|
|
42
47
|
load: () => load,
|
|
43
|
-
logger: () =>
|
|
48
|
+
logger: () => _chunkWCKSKU3Cjs.logger
|
|
44
49
|
});
|
|
45
50
|
|
|
46
51
|
// src/core/config.ts
|
|
@@ -227,7 +232,7 @@ var ProjectScaffolder = class {
|
|
|
227
232
|
async scaffold(options) {
|
|
228
233
|
const { projectName, template } = options;
|
|
229
234
|
const projectPath = _path.join.call(void 0, process.cwd(), projectName);
|
|
230
|
-
|
|
235
|
+
_chunkWCKSKU3Cjs.logger.info(`Creating project at: ${projectPath}`);
|
|
231
236
|
await _promises.mkdir.call(void 0, projectPath, {
|
|
232
237
|
recursive: true
|
|
233
238
|
});
|
|
@@ -238,11 +243,11 @@ var ProjectScaffolder = class {
|
|
|
238
243
|
} else if (template === "web") {
|
|
239
244
|
await this.createNextJSApp(projectPath, projectName);
|
|
240
245
|
}
|
|
241
|
-
|
|
242
|
-
|
|
246
|
+
_chunkWCKSKU3Cjs.logger.success(`Project ${projectName} created successfully!`);
|
|
247
|
+
_chunkWCKSKU3Cjs.logger.info(`
|
|
243
248
|
Next steps:`);
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
_chunkWCKSKU3Cjs.logger.info(` cd ${projectName}`);
|
|
250
|
+
_chunkWCKSKU3Cjs.logger.info(` wexts dev`);
|
|
246
251
|
}
|
|
247
252
|
async createMonorepo(projectPath, projectName) {
|
|
248
253
|
await _promises.mkdir.call(void 0, _path.join.call(void 0, projectPath, "apps", "api"), {
|
|
@@ -266,31 +271,39 @@ Next steps:`);
|
|
|
266
271
|
"packages/*"
|
|
267
272
|
],
|
|
268
273
|
scripts: {
|
|
269
|
-
dev: "
|
|
270
|
-
build: "
|
|
274
|
+
dev: "wexts dev",
|
|
275
|
+
build: "wexts build"
|
|
271
276
|
},
|
|
272
277
|
devDependencies: {
|
|
273
|
-
"wexts": "^
|
|
278
|
+
"wexts": "^3.0.3"
|
|
274
279
|
}
|
|
275
280
|
};
|
|
276
281
|
await _promises.writeFile.call(void 0, _path.join.call(void 0, projectPath, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
277
282
|
const readme = `# ${projectName}
|
|
278
283
|
|
|
279
|
-
Created with
|
|
284
|
+
Created with the deprecated ProjectScaffolder compatibility API.
|
|
285
|
+
|
|
286
|
+
Use examples/hello-rpc as the canonical Wexts reference.
|
|
280
287
|
|
|
281
288
|
## Getting Started
|
|
282
289
|
|
|
283
290
|
\`\`\`bash
|
|
284
|
-
|
|
291
|
+
wexts dev
|
|
285
292
|
\`\`\`
|
|
286
293
|
`;
|
|
287
294
|
await _promises.writeFile.call(void 0, _path.join.call(void 0, projectPath, "README.md"), readme);
|
|
288
295
|
}
|
|
289
296
|
async createNestJSApp(projectPath, projectName) {
|
|
290
|
-
|
|
297
|
+
await _promises.writeFile.call(void 0, _path.join.call(void 0, projectPath, "README.md"), `# ${projectName}
|
|
298
|
+
|
|
299
|
+
Standalone API scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.
|
|
300
|
+
`);
|
|
291
301
|
}
|
|
292
302
|
async createNextJSApp(projectPath, projectName) {
|
|
293
|
-
|
|
303
|
+
await _promises.writeFile.call(void 0, _path.join.call(void 0, projectPath, "README.md"), `# ${projectName}
|
|
304
|
+
|
|
305
|
+
Standalone web scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.
|
|
306
|
+
`);
|
|
294
307
|
}
|
|
295
308
|
};
|
|
296
309
|
|
|
@@ -299,19 +312,27 @@ var next_exports = {};
|
|
|
299
312
|
_chunkXE4OXN2Wjs.__export.call(void 0, next_exports, {
|
|
300
313
|
FusionProvider: () => FusionProvider,
|
|
301
314
|
useAuth: () => useAuth,
|
|
302
|
-
useFusion: () => useFusion
|
|
315
|
+
useFusion: () => useFusion,
|
|
316
|
+
useWexts: () => useWexts
|
|
303
317
|
});
|
|
304
318
|
|
|
305
319
|
// src/next/provider.tsx
|
|
306
320
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
307
321
|
var FusionContext = /* @__PURE__ */ _react.createContext.call(void 0, null);
|
|
308
|
-
function FusionProvider({ children, baseUrl = "/api" }) {
|
|
309
|
-
const client = _react2.default.useMemo(() => new (0,
|
|
322
|
+
function FusionProvider({ children, baseUrl = "/api", rpcBaseUrl = "/rpc", rpcClient }) {
|
|
323
|
+
const client = _react2.default.useMemo(() => new (0, _chunkMXINIFPCjs.FusionFetcher)(baseUrl), [
|
|
310
324
|
baseUrl
|
|
311
325
|
]);
|
|
326
|
+
const wexts = _react2.default.useMemo(() => _nullishCoalesce(rpcClient, () => ( _chunkMXINIFPCjs.createWextsRpcClient.call(void 0, void 0, {
|
|
327
|
+
baseUrl: rpcBaseUrl
|
|
328
|
+
}))), [
|
|
329
|
+
rpcBaseUrl,
|
|
330
|
+
rpcClient
|
|
331
|
+
]);
|
|
312
332
|
return /* @__PURE__ */ _react2.default.createElement(FusionContext.Provider, {
|
|
313
333
|
value: {
|
|
314
|
-
client
|
|
334
|
+
client,
|
|
335
|
+
wexts
|
|
315
336
|
}
|
|
316
337
|
}, children);
|
|
317
338
|
}
|
|
@@ -324,6 +345,11 @@ function useFusion() {
|
|
|
324
345
|
return context;
|
|
325
346
|
}
|
|
326
347
|
_chunkXE4OXN2Wjs.__name.call(void 0, useFusion, "useFusion");
|
|
348
|
+
function useWexts() {
|
|
349
|
+
const context = useFusion();
|
|
350
|
+
return context.wexts;
|
|
351
|
+
}
|
|
352
|
+
_chunkXE4OXN2Wjs.__name.call(void 0, useWexts, "useWexts");
|
|
327
353
|
|
|
328
354
|
// src/next/useAuth.ts
|
|
329
355
|
|
|
@@ -379,5 +405,6 @@ _chunkXE4OXN2Wjs.__name.call(void 0, useAuth, "useAuth");
|
|
|
379
405
|
|
|
380
406
|
|
|
381
407
|
|
|
382
|
-
|
|
408
|
+
|
|
409
|
+
exports.Codegen = _chunkSE32ZPOZjs.codegen_exports; exports.Config = config_exports; exports.Core = core_exports; exports.CreateFusion = create_fusion_exports; exports.DevServer = _chunk2LJVUMXWjs.dev_server_exports; exports.Insight = insight_exports; exports.Nest = _chunkBG56B4DEjs.nest_exports; exports.Next = next_exports; exports.Rpc = _chunkDNLGCKTTjs.rpc_exports;
|
|
383
410
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["c:\\Users\\ziad\\Desktop\\wexts\\packages\\dist\\index.js"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACF,sDAA4B;AAC5B;AACA;AACA,IAAI,aAAa,EAAE,CAAC,CAAC;AACrB,uCAAQ,YAAa,EAAE;AACvB,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,QAAQ;AAC1B,EAAE,WAAW,EAAE,CAAC,EAAE,GAAG,WAAW;AAChC,EAAE,YAAY,EAAE,CAAC,EAAE,GAAG,YAAY;AAClC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,2BAAU;AAC9B,EAAE,WAAW,EAAE,CAAC,EAAE,GAAG,WAAW;AAChC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,yBAAQ;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,uBAAM;AACtB,EAAE,cAAc,EAAE,CAAC,EAAE,GAAG,cAAc;AACtC,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,eAAe;AACxC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM;AACtB,EAAE,YAAY,EAAE,CAAC,EAAE,GAAG,6BAAY;AAClC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,2BAAU;AAC9B,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,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,WAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"C:\\Users\\ziad\\Desktop\\wexts\\packages\\dist\\index.js","sourcesContent":[null]}
|
|
1
|
+
{"version":3,"sources":["/Volumes/Projects/wexts/packages/dist/index.js","../src/core/index.ts","../src/core/config.ts","../src/core/process-manager.ts","../src/core/errors.ts","../src/config/index.ts","../src/config/loader.ts","../src/insight/index.ts","../src/insight/server.ts","../src/create-fusion/index.ts","../src/create-fusion/scaffold.ts","../src/next/index.ts","../src/next/provider.tsx","../src/next/useAuth.ts"],"names":["ConfigLoader","config","Map","configDir","process","cwd","load","key","defaultValue","has","get","envKey","toUpperCase","env","value","readFileSync","ProcessManager","error","promise","cleanup","Error","code","FusionError","statusCode","log","ProjectScaffolder","options","projectName","projectPath","useContext","createContext","FusionFetcher","baseUrl","rpcClient","rpcBaseUrl","FusionContext","client","wexts","children","FusionProvider","useFusion","context","useWexts","useAuth","loadUser","userData","email","password","response","user","loading","login","logout"],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACE;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACF,sDAA4B;AAC5B;AACA;AC/BA,IAAA,aAAA,EAAA,CAAA,CAAA;ADiCA,uCAAQ,YAAa,EAAE;AACvB,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,QAAQ;AAC1B,EAAE,WAAW,EAAE,CAAC,EAAE,GAAG,WAAW;AAChC,EAAE,YAAY,EAAE,CAAC,EAAE,GAAG,YAAY;AAClC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,2BAAU;AAC9B,EAAE,WAAW,EAAE,CAAC,EAAE,GAAG,WAAW;AAChC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,yBAAQ;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,uBAAM;AACtB,EAAE,cAAc,EAAE,CAAC,EAAE,GAAG,cAAc;AACtC,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,eAAe;AACxC,EAAE,MAAM,EAAE,CAAC,EAAE,GAA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IAAA;AAAEC,MAAAA;AAAQC,MAAAA;AAAM,IAAA;AAC1CC,EAAAA;AAGb;AAZgBC;AAsBAC;AACeL,EAAAA;AACb,EAAA;AACM,IAAA;AACpB,EAAA;AACOM,EAAAA;AACX;AANgBD;AAQAE;AACIF,EAAAA;AACDH,EAAAA;AACnB;AAHgBK;AZsS+B;AACA;Aa/VX;AAwBpBC;AACOH,EAAAA;AAC+B,EAAA;AACX,EAAA;AAE7B,EAAA;AAE6B,IAAA;AACxB,IAAA;AAEPI,MAAAA;AACG,IAAA;AACQ,MAAA;AACf,IAAA;AACC,EAAA;AAEY,EAAA;AACT,IAAA;AAC4C,MAAA;AACpCC,MAAAA;AACI,IAAA;AACY,MAAA;AAC5B,IAAA;AACe,MAAA;AACf,IAAA;AARa,EAAA;AAWIC,EAAAA;AACqD,IAAA;AAClEA,MAAAA;AACAC,MAAAA;AACJ,IAAA;AACqCC,IAAAA;AAChB,IAAA;AANX,EAAA;AASC,EAAA;AACa,IAAA;AAChB,IAAA;AAFG,EAAA;AAKR,EAAA;AACHC,IAAAA;AACAC,IAAAA;AACAC,IAAAA;AACAC,IAAAA;AACmBH,IAAAA;AACvB,EAAA;AACJ;AAhDgBN;AboX+B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Volumes/Projects/wexts/packages/dist/index.js","sourcesContent":[null,"// Core exports placeholder\nexport * from './config';\nexport * from './logger';\nexport * from './filesystem';\nexport * from './process-manager';\nexport * from './errors';\n","import * as fs from 'fs';\nimport * as path from 'path';\n\nexport interface FusionConfig {\n [key: string]: any;\n}\n\nexport class ConfigLoader {\n private config: Map<string, any> = new Map();\n private configDir: string;\n\n constructor(configDir: string = process.cwd()) {\n this.configDir = configDir;\n }\n\n /**\n * Load configuration from file or environment\n */\n load(key: string, defaultValue?: any): any {\n if (this.config.has(key)) {\n return this.config.get(key);\n }\n\n // Try to load from environment variable\n const envKey = `FUSION_${key.toUpperCase()}`;\n if (process.env[envKey]) {\n const value = this.parseEnvValue(process.env[envKey]!);\n this.config.set(key, value);\n return value;\n }\n\n // Try to load from config file\n const configPath = path.join(this.configDir, 'fusion.config.json');\n if (fs.existsSync(configPath)) {\n try {\n const fileConfig = JSON.parse(fs.readFileSync(configPath, 'utf-8'));\n if (fileConfig[key] !== undefined) {\n this.config.set(key, fileConfig[key]);\n return fileConfig[key];\n }\n } catch (error) {\n // Silently fail and use default\n }\n }\n\n return defaultValue;\n }\n\n /**\n * Set configuration value\n */\n set(key: string, value: any): void {\n this.config.set(key, value);\n }\n\n /**\n * Get all configuration\n */\n getAll(): FusionConfig {\n return Object.fromEntries(this.config);\n }\n\n /**\n * Parse environment value (handles JSON strings)\n */\n private parseEnvValue(value: string): any {\n try {\n return JSON.parse(value);\n } catch {\n return value;\n }\n }\n}\n\n// Export singleton instance\nexport const config = new ConfigLoader();\n\n// Helper function for backward compatibility\nexport function load(key: string, defaultValue?: any): any {\n return config.load(key, defaultValue);\n}\n","export class ProcessManager {\n /**\n * Setup process error handlers\n */\n static initialize(): void {\n process.on('uncaughtException', (error) => {\n console.error('[Fusion] Uncaught Exception:', error);\n process.exit(1);\n });\n\n process.on('unhandledRejection', (reason, promise) => {\n console.error('[Fusion] Unhandled Rejection at:', promise, 'reason:', reason);\n });\n\n process.on('SIGTERM', () => {\n console.log('[Fusion] SIGTERM received, shutting down gracefully');\n process.exit(0);\n });\n\n process.on('SIGINT', () => {\n console.log('[Fusion] SIGINT received, shutting down gracefully');\n process.exit(0);\n });\n }\n\n /**\n * Graceful shutdown helper\n */\n static async shutdown(cleanup: () => Promise<void>): Promise<void> {\n try {\n await cleanup();\n process.exit(0);\n } catch (error) {\n console.error('[Fusion] Error during shutdown:', error);\n process.exit(1);\n }\n }\n}\n","export class FusionError extends Error {\n constructor(message: string, public code?: string) {\n super(message);\n this.name = 'FusionError';\n }\n}\n\nexport class ConfigError extends FusionError {\n constructor(message: string) {\n super(message, 'CONFIG_ERROR');\n this.name = 'ConfigError';\n }\n}\n\nexport class ValidationError extends FusionError {\n constructor(message: string) {\n super(message, 'VALIDATION_ERROR');\n this.name = 'ValidationError';\n }\n}\n\nexport class APIError extends FusionError {\n constructor(message: string, public statusCode?: number) {\n super(message, 'API_ERROR');\n this.name = 'APIError';\n }\n}\n","// Config exports placeholder\nexport * from './loader';\n","export const loader = {\n load: () => ({}),\n};\n","// Insight exports placeholder\nexport * from './server';\n","export const server = {\n start: () => console.log('Insight server started'),\n};\n","export * from './scaffold';\n","import { mkdir, writeFile } from 'fs/promises';\nimport { join } from 'path';\nimport { logger } from '../core/logger';\n\nexport interface ScaffoldOptions {\n projectName: string;\n template: 'monorepo' | 'api' | 'web';\n packageManager?: 'npm' | 'pnpm' | 'yarn';\n}\n\n/**\n * @deprecated Use the `wexts create` CLI and `examples/hello-rpc` canonical scaffold instead.\n */\nexport class ProjectScaffolder {\n async scaffold(options: ScaffoldOptions): Promise<void> {\n const { projectName, template } = options;\n const projectPath = join(process.cwd(), projectName);\n\n logger.info(`Creating project at: ${projectPath}`);\n\n // Create base directory\n await mkdir(projectPath, { recursive: true });\n\n if (template === 'monorepo') {\n await this.createMonorepo(projectPath, projectName);\n } else if (template === 'api') {\n await this.createNestJSApp(projectPath, projectName);\n } else if (template === 'web') {\n await this.createNextJSApp(projectPath, projectName);\n }\n\n logger.success(`Project ${projectName} created successfully!`);\n logger.info(`\\nNext steps:`);\n logger.info(` cd ${projectName}`);\n logger.info(` wexts dev`);\n }\n\n private async createMonorepo(projectPath: string, projectName: string): Promise<void> {\n // Create directory structure\n await mkdir(join(projectPath, 'apps', 'api'), { recursive: true });\n await mkdir(join(projectPath, 'apps', 'web'), { recursive: true });\n await mkdir(join(projectPath, 'packages', 'types'), { recursive: true });\n await mkdir(join(projectPath, 'packages', 'api-client'), { recursive: true });\n\n // Create root package.json\n const packageJson = {\n name: projectName,\n version: '0.0.1',\n private: true,\n workspaces: ['apps/*', 'packages/*'],\n scripts: {\n dev: 'wexts dev',\n build: 'wexts build',\n },\n devDependencies: {\n 'wexts': '^3.0.3',\n },\n };\n\n await writeFile(\n join(projectPath, 'package.json'),\n JSON.stringify(packageJson, null, 2)\n );\n\n // Create README\n const readme = `# ${projectName}\\n\\nCreated with the deprecated ProjectScaffolder compatibility API.\\n\\nUse examples/hello-rpc as the canonical Wexts reference.\\n\\n## Getting Started\\n\\n\\`\\`\\`bash\\nwexts dev\\n\\`\\`\\`\\n`;\n await writeFile(join(projectPath, 'README.md'), readme);\n }\n\n private async createNestJSApp(projectPath: string, projectName: string): Promise<void> {\n await writeFile(\n join(projectPath, 'README.md'),\n `# ${projectName}\\n\\nStandalone API scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.\\n`\n );\n }\n\n private async createNextJSApp(projectPath: string, projectName: string): Promise<void> {\n await writeFile(\n join(projectPath, 'README.md'),\n `# ${projectName}\\n\\nStandalone web scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.\\n`\n );\n }\n}\n","export * from './provider';\nexport * from './useAuth';\n","'use client';\n\nimport React, { createContext, useContext, ReactNode } from 'react';\nimport { createWextsRpcClient, FusionFetcher, WextsRpcClient } from '../client/fetcher';\n\ninterface FusionContextType {\n client: FusionFetcher;\n wexts: WextsRpcClient;\n}\n\nconst FusionContext = createContext<FusionContextType | null>(null);\n\nexport interface FusionProviderProps {\n children: ReactNode;\n baseUrl?: string;\n rpcBaseUrl?: string;\n rpcClient?: object;\n}\n\n/**\n * FusionProvider - Provides API client to React components\n * Usage:\n * ```tsx\n * <FusionProvider baseUrl=\"/api\">\n * <App />\n * </FusionProvider>\n * ```\n */\nexport function FusionProvider({ children, baseUrl = '/api', rpcBaseUrl = '/rpc', rpcClient }: FusionProviderProps) {\n const client = React.useMemo(() => new FusionFetcher(baseUrl), [baseUrl]);\n const wexts = React.useMemo(\n () => (rpcClient as WextsRpcClient | undefined) ?? createWextsRpcClient(undefined, { baseUrl: rpcBaseUrl }),\n [rpcBaseUrl, rpcClient]\n );\n\n return (\n <FusionContext.Provider value={{ client, wexts }}>\n {children}\n </FusionContext.Provider>\n );\n}\n\n/**\n * useFusion hook - Access API client in components\n * Usage:\n * ```tsx\n * const { client } = useFusion();\n * const data = await client.get('/users');\n * ```\n */\nexport function useFusion(): FusionContextType {\n const context = useContext(FusionContext);\n if (!context) {\n throw new Error('useFusion must be used within FusionProvider');\n }\n return context;\n}\n\nexport function useWexts<TClient = WextsRpcClient>(): TClient {\n const context = useFusion();\n return context.wexts as TClient;\n}\n","'use client';\n\nimport { useState, useEffect } from 'react';\nimport { useFusion } from './provider';\n\nexport interface AuthUser {\n id: string;\n email: string;\n name?: string;\n}\n\nexport interface UseAuthReturn {\n user: AuthUser | null;\n loading: boolean;\n login: (email: string, password: string) => Promise<void>;\n logout: () => Promise<void>;\n isAuthenticated: boolean;\n}\n\n/**\n * useAuth hook - Authentication state management\n * Usage:\n * ```tsx\n * const { user, login, logout, isAuthenticated } = useAuth();\n * ```\n */\nexport function useAuth(): UseAuthReturn {\n const { client } = useFusion();\n const [user, setUser] = useState<AuthUser | null>(null);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n // Check for existing session\n const token = localStorage.getItem('fusion_token');\n if (token) {\n // Validate token and load user\n loadUser();\n } else {\n setLoading(false);\n }\n }, []);\n\n const loadUser = async () => {\n try {\n const userData = await client.get<AuthUser>('/auth/me');\n setUser(userData);\n } catch (error) {\n localStorage.removeItem('fusion_token');\n } finally {\n setLoading(false);\n }\n };\n\n const login = async (email: string, password: string) => {\n const response = await client.post<{ token: string; user: AuthUser }>('/auth/login', {\n email,\n password,\n });\n localStorage.setItem('fusion_token', response.token);\n setUser(response.user);\n };\n\n const logout = async () => {\n localStorage.removeItem('fusion_token');\n setUser(null);\n };\n\n return {\n user,\n loading,\n login,\n logout,\n isAuthenticated: !!user,\n };\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
dev_server_exports
|
|
3
|
+
} from "./chunk-YN6WIWNQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
FusionFetcher,
|
|
6
|
+
createWextsRpcClient
|
|
7
|
+
} from "./chunk-WU6FW77M.mjs";
|
|
4
8
|
import {
|
|
5
9
|
nest_exports
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UAL54DVV.mjs";
|
|
11
|
+
import {
|
|
12
|
+
rpc_exports
|
|
13
|
+
} from "./chunk-ZX7QIN24.mjs";
|
|
14
|
+
import "./chunk-YBM3IJEA.mjs";
|
|
7
15
|
import "./chunk-YSLEF5C5.mjs";
|
|
8
16
|
import {
|
|
9
17
|
FileSystem,
|
|
10
18
|
codegen_exports,
|
|
11
19
|
filesystem
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
dev_server_exports
|
|
15
|
-
} from "./chunk-KXYLEUSW.mjs";
|
|
20
|
+
} from "./chunk-CLM5PNSG.mjs";
|
|
16
21
|
import {
|
|
17
22
|
LogLevel,
|
|
18
23
|
Logger,
|
|
19
24
|
createLogger,
|
|
20
25
|
logger
|
|
21
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JHOVXH3X.mjs";
|
|
22
27
|
import {
|
|
23
28
|
__export,
|
|
24
29
|
__name
|
|
25
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-7WULUGLH.mjs";
|
|
26
31
|
|
|
27
32
|
// src/core/index.ts
|
|
28
33
|
var core_exports = {};
|
|
@@ -242,7 +247,7 @@ var ProjectScaffolder = class {
|
|
|
242
247
|
logger.info(`
|
|
243
248
|
Next steps:`);
|
|
244
249
|
logger.info(` cd ${projectName}`);
|
|
245
|
-
logger.info(`
|
|
250
|
+
logger.info(` wexts dev`);
|
|
246
251
|
}
|
|
247
252
|
async createMonorepo(projectPath, projectName) {
|
|
248
253
|
await mkdir(join2(projectPath, "apps", "api"), {
|
|
@@ -266,31 +271,39 @@ Next steps:`);
|
|
|
266
271
|
"packages/*"
|
|
267
272
|
],
|
|
268
273
|
scripts: {
|
|
269
|
-
dev: "
|
|
270
|
-
build: "
|
|
274
|
+
dev: "wexts dev",
|
|
275
|
+
build: "wexts build"
|
|
271
276
|
},
|
|
272
277
|
devDependencies: {
|
|
273
|
-
"wexts": "^
|
|
278
|
+
"wexts": "^3.0.3"
|
|
274
279
|
}
|
|
275
280
|
};
|
|
276
281
|
await writeFile(join2(projectPath, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
277
282
|
const readme = `# ${projectName}
|
|
278
283
|
|
|
279
|
-
Created with
|
|
284
|
+
Created with the deprecated ProjectScaffolder compatibility API.
|
|
285
|
+
|
|
286
|
+
Use examples/hello-rpc as the canonical Wexts reference.
|
|
280
287
|
|
|
281
288
|
## Getting Started
|
|
282
289
|
|
|
283
290
|
\`\`\`bash
|
|
284
|
-
|
|
291
|
+
wexts dev
|
|
285
292
|
\`\`\`
|
|
286
293
|
`;
|
|
287
294
|
await writeFile(join2(projectPath, "README.md"), readme);
|
|
288
295
|
}
|
|
289
296
|
async createNestJSApp(projectPath, projectName) {
|
|
290
|
-
|
|
297
|
+
await writeFile(join2(projectPath, "README.md"), `# ${projectName}
|
|
298
|
+
|
|
299
|
+
Standalone API scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.
|
|
300
|
+
`);
|
|
291
301
|
}
|
|
292
302
|
async createNextJSApp(projectPath, projectName) {
|
|
293
|
-
|
|
303
|
+
await writeFile(join2(projectPath, "README.md"), `# ${projectName}
|
|
304
|
+
|
|
305
|
+
Standalone web scaffolding through ProjectScaffolder is deprecated. Use examples/hello-rpc or wexts create for the canonical path.
|
|
306
|
+
`);
|
|
294
307
|
}
|
|
295
308
|
};
|
|
296
309
|
|
|
@@ -299,19 +312,27 @@ var next_exports = {};
|
|
|
299
312
|
__export(next_exports, {
|
|
300
313
|
FusionProvider: () => FusionProvider,
|
|
301
314
|
useAuth: () => useAuth,
|
|
302
|
-
useFusion: () => useFusion
|
|
315
|
+
useFusion: () => useFusion,
|
|
316
|
+
useWexts: () => useWexts
|
|
303
317
|
});
|
|
304
318
|
|
|
305
319
|
// src/next/provider.tsx
|
|
306
320
|
import React, { createContext, useContext } from "react";
|
|
307
321
|
var FusionContext = /* @__PURE__ */ createContext(null);
|
|
308
|
-
function FusionProvider({ children, baseUrl = "/api" }) {
|
|
322
|
+
function FusionProvider({ children, baseUrl = "/api", rpcBaseUrl = "/rpc", rpcClient }) {
|
|
309
323
|
const client = React.useMemo(() => new FusionFetcher(baseUrl), [
|
|
310
324
|
baseUrl
|
|
311
325
|
]);
|
|
326
|
+
const wexts = React.useMemo(() => rpcClient ?? createWextsRpcClient(void 0, {
|
|
327
|
+
baseUrl: rpcBaseUrl
|
|
328
|
+
}), [
|
|
329
|
+
rpcBaseUrl,
|
|
330
|
+
rpcClient
|
|
331
|
+
]);
|
|
312
332
|
return /* @__PURE__ */ React.createElement(FusionContext.Provider, {
|
|
313
333
|
value: {
|
|
314
|
-
client
|
|
334
|
+
client,
|
|
335
|
+
wexts
|
|
315
336
|
}
|
|
316
337
|
}, children);
|
|
317
338
|
}
|
|
@@ -324,6 +345,11 @@ function useFusion() {
|
|
|
324
345
|
return context;
|
|
325
346
|
}
|
|
326
347
|
__name(useFusion, "useFusion");
|
|
348
|
+
function useWexts() {
|
|
349
|
+
const context = useFusion();
|
|
350
|
+
return context.wexts;
|
|
351
|
+
}
|
|
352
|
+
__name(useWexts, "useWexts");
|
|
327
353
|
|
|
328
354
|
// src/next/useAuth.ts
|
|
329
355
|
import { useState, useEffect } from "react";
|
|
@@ -378,6 +404,7 @@ export {
|
|
|
378
404
|
dev_server_exports as DevServer,
|
|
379
405
|
insight_exports as Insight,
|
|
380
406
|
nest_exports as Nest,
|
|
381
|
-
next_exports as Next
|
|
407
|
+
next_exports as Next,
|
|
408
|
+
rpc_exports as Rpc
|
|
382
409
|
};
|
|
383
410
|
//# sourceMappingURL=index.mjs.map
|