@idealyst/cli 1.0.53 → 1.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,26 +1,21 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
- import { httpBatchLink } from '@trpc/client';
4
3
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc } from './utils/trpc';
4
+ import { trpc, createTRPCClient } from './utils/trpc';
6
5
  import { AppRouter } from '@{{workspaceScope}}/shared';
7
6
 
8
- // Create tRPC client
7
+ // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
10
9
 
11
- const trpcClient = trpc.createClient({
12
- links: [
13
- httpBatchLink({
14
- url: 'http://localhost:3000/trpc', // Update this to your API URL
15
- // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
16
- // Optional: Add headers for authentication
17
- // headers() {
18
- // return {
19
- // authorization: getAuthToken(),
20
- // };
21
- // },
22
- }),
23
- ],
10
+ const trpcClient = createTRPCClient({
11
+ apiUrl: 'http://localhost:3000/trpc', // Update this to your API URL
12
+ // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
24
19
  });
25
20
 
26
21
  function App() {
@@ -1,26 +1,21 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
- import { httpBatchLink } from '@trpc/client';
4
3
  import { NavigatorProvider } from '@idealyst/navigation';
5
- import { trpc } from './utils/trpc';
4
+ import { trpc, createTRPCClient } from './utils/trpc';
6
5
  import AppRouter from './navigation/AppRouter';
7
6
 
8
- // Create tRPC client
7
+ // Create tRPC client using shared factory
9
8
  const queryClient = new QueryClient();
10
9
 
11
- const trpcClient = trpc.createClient({
12
- links: [
13
- httpBatchLink({
14
- url: 'http://localhost:3000/trpc', // Update this to your API URL
15
- // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
16
- // Optional: Add headers for authentication
17
- // headers() {
18
- // return {
19
- // authorization: getAuthToken(),
20
- // };
21
- // },
22
- }),
23
- ],
10
+ const trpcClient = createTRPCClient({
11
+ apiUrl: 'http://localhost:3000/trpc', // Update this to your API URL
12
+ // For device testing, you might need: 'http://192.168.1.xxx:3000/trpc'
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
24
19
  });
25
20
 
26
21
  function App() {
@@ -26,7 +26,8 @@
26
26
  "@trpc/react-query": "^11.5.1",
27
27
  "@trpc/server": "^11.5.1",
28
28
  "react": "^19.1.0",
29
- "react-native": "^0.80.1"
29
+ "react-native": "^0.80.1",
30
+ "{{workspaceScope}}/api": "*"
30
31
  },
31
32
  "peerDependenciesMeta": {
32
33
  "react-native": {
@@ -1,9 +1,10 @@
1
- import { createTRPCReact } from '@trpc/react-query';
2
- import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
3
- import type { AppRouter } from '@{{workspaceScope}}/api';
1
+ import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
2
+ import { createTRPCReact } from "@trpc/react-query";
3
+ import type { AppRouter } from "@{{workspaceScope}}/api";
4
4
 
5
5
  // Create the tRPC React hooks with full type safety
6
- export const trpc = createTRPCReact<AppRouter>();
6
+ export const trpc: ReturnType<typeof createTRPCReact<AppRouter>> =
7
+ createTRPCReact<AppRouter>();
7
8
 
8
9
  // Configuration for tRPC client
9
10
  export interface TRPCClientConfig {
@@ -12,7 +13,9 @@ export interface TRPCClientConfig {
12
13
  }
13
14
 
14
15
  // Create tRPC client factory
15
- export function createTRPCClient(config: TRPCClientConfig) {
16
+ export function createTRPCClient(
17
+ config: TRPCClientConfig
18
+ ): ReturnType<typeof trpc.createClient> {
16
19
  return trpc.createClient({
17
20
  links: [
18
21
  httpBatchLink({
@@ -24,7 +27,9 @@ export function createTRPCClient(config: TRPCClientConfig) {
24
27
  }
25
28
 
26
29
  // Create a vanilla client (for use outside of React components)
27
- export function createVanillaTRPCClient(config: TRPCClientConfig) {
30
+ export function createVanillaTRPCClient(
31
+ config: TRPCClientConfig
32
+ ): ReturnType<typeof createTRPCProxyClient<AppRouter>> {
28
33
  return createTRPCProxyClient<AppRouter>({
29
34
  links: [
30
35
  httpBatchLink({
@@ -36,4 +41,4 @@ export function createVanillaTRPCClient(config: TRPCClientConfig) {
36
41
  }
37
42
 
38
43
  // Export types
39
- export type { AppRouter } from '@{{workspaceScope}}/api';
44
+ export type { AppRouter } from "@{{workspaceScope}}/api";
@@ -1,26 +1,21 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
- import { httpBatchLink } from '@trpc/client';
4
3
  import { BrowserRouter } from 'react-router-dom';
5
4
  import { NavigatorProvider } from '@idealyst/navigation';
6
- import { trpc } from './utils/trpc';
5
+ import { trpc, createTRPCClient } from './utils/trpc';
7
6
  import { AppRouter } from '@{{workspaceScope}}/shared';
8
7
 
9
- // Create tRPC client
8
+ // Create tRPC client using shared factory
10
9
  const queryClient = new QueryClient();
11
10
 
12
- const trpcClient = trpc.createClient({
13
- links: [
14
- httpBatchLink({
15
- url: 'http://localhost:3000/trpc', // Update this to match your API URL
16
- // Optional: Add headers for authentication
17
- // headers() {
18
- // return {
19
- // authorization: getAuthToken(),
20
- // };
21
- // },
22
- }),
23
- ],
11
+ const trpcClient = createTRPCClient({
12
+ apiUrl: 'http://localhost:3000/trpc', // Update this to match your API URL
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
24
19
  });
25
20
 
26
21
  function App() {
@@ -1,26 +1,21 @@
1
1
  import React from 'react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
- import { httpBatchLink } from '@trpc/client';
4
3
  import { BrowserRouter } from 'react-router-dom';
5
4
  import { NavigatorProvider } from '@idealyst/navigation';
6
- import { trpc } from './utils/trpc';
5
+ import { trpc, createTRPCClient } from './utils/trpc';
7
6
  import AppRouterWithTrpc from './navigation/AppRouterWithTrpc';
8
7
 
9
- // Create tRPC client
8
+ // Create tRPC client using shared factory
10
9
  const queryClient = new QueryClient();
11
10
 
12
- const trpcClient = trpc.createClient({
13
- links: [
14
- httpBatchLink({
15
- url: 'http://localhost:3000/trpc', // Update this to match your API URL
16
- // Optional: Add headers for authentication
17
- // headers() {
18
- // return {
19
- // authorization: getAuthToken(),
20
- // };
21
- // },
22
- }),
23
- ],
11
+ const trpcClient = createTRPCClient({
12
+ apiUrl: 'http://localhost:3000/trpc', // Update this to match your API URL
13
+ // Optional: Add headers for authentication
14
+ // headers() {
15
+ // return {
16
+ // authorization: getAuthToken(),
17
+ // };
18
+ // },
24
19
  });
25
20
 
26
21
  function App() {