@skyf0xx/hedgehog-core-full-stack-app 1.0.0 → 1.0.6

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.
@@ -1,6 +1,7 @@
1
1
  packages:
2
2
  - 'packages/*'
3
3
  - 'apps/*'
4
+ - 'tools/*'
4
5
  # Domain libs land as libs/<module>/<layer> during Phase A. Declared up
5
6
  # front so the first module through the repository layer doesn't have to
6
7
  # edit this file before pnpm will link its workspace:* deps.
@@ -68,11 +68,14 @@ function writeApiBaseUrl(tree: Tree) {
68
68
  }
69
69
 
70
70
  function clientFile(names: ModuleNames): string {
71
- return `import { initClient } from '@ts-rest/core';
71
+ return `import { initClient, type InitClientReturn } from '@ts-rest/core';
72
72
  import { ${names.camel}Contract } from 'contracts';
73
73
  import { apiBaseUrl } from '../api-base-url';
74
74
 
75
- export function ${names.camel}Client() {
75
+ export function ${names.camel}Client(): InitClientReturn<
76
+ typeof ${names.camel}Contract,
77
+ { baseUrl: string }
78
+ > {
76
79
  return initClient(${names.camel}Contract, { baseUrl: apiBaseUrl() });
77
80
  }
78
81
 
@@ -122,7 +125,7 @@ export function use${pascal}() {
122
125
  });
123
126
  }
124
127
 
125
- export function use${entityPascal}(id: string) {
128
+ export function use${entityPascal}ById(id: string) {
126
129
  return useQuery({
127
130
  queryKey: ${camel}Keys.detail(id),
128
131
  queryFn: async () => {