Skip to content

Commit

Permalink
adjust export setting
Browse files Browse the repository at this point in the history
  • Loading branch information
isoppp committed Sep 24, 2024
1 parent 4a0b5df commit b5644a6
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 185 deletions.
3 changes: 0 additions & 3 deletions apps/api-hono/src/trpc/index.export.ts

This file was deleted.

3 changes: 3 additions & 0 deletions apps/api-hono/src/trpc/shared-export/trpc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { appRouter } from '@/trpc'

export type AppRouter = typeof appRouter
9 changes: 5 additions & 4 deletions apps/api-hono/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/trpc/index.export.ts'],
format: ['cjs', 'esm'],
dts: true,
entry: ['src/trpc/shared-export/trpc.ts'],
dts: {
only: true,
},
splitting: false,
sourcemap: true,
clean: true,
outDir: '../app/app/generated/trpc',
})
158 changes: 158 additions & 0 deletions apps/app/app/generated/trpc/trpc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import * as _trpc_server from '@trpc/server';
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';

declare const appRouter: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
ctx: {
req: Request;
resHeaders: Headers;
user: {
id: string;
email: string;
createdAt: Date;
updatedAt: Date;
};
} | {
req: Request;
resHeaders: Headers;
user: null;
};
meta: object;
errorShape: {
data: {
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
httpStatus: number;
path?: string;
stack?: string;
};
message: string;
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
};
transformer: false;
}, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<{
example: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
ctx: {
req: Request;
resHeaders: Headers;
user: {
id: string;
email: string;
createdAt: Date;
updatedAt: Date;
};
} | {
req: Request;
resHeaders: Headers;
user: null;
};
meta: object;
errorShape: {
data: {
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
httpStatus: number;
path?: string;
stack?: string;
};
message: string;
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
};
transformer: false;
}, {
hello: _trpc_server.TRPCQueryProcedure<{
input: void;
output: string;
}>;
list: _trpc_server.TRPCQueryProcedure<{
input: void;
output: {
id: string;
name: string;
}[];
}>;
create: _trpc_server.TRPCMutationProcedure<{
input: {
name: string;
};
output: {
id: string;
name: string;
};
}>;
}>;
auth: _trpc_server_unstable_core_do_not_import.BuiltRouter<{
ctx: {
req: Request;
resHeaders: Headers;
user: {
id: string;
email: string;
createdAt: Date;
updatedAt: Date;
};
} | {
req: Request;
resHeaders: Headers;
user: null;
};
meta: object;
errorShape: {
data: {
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_KEY;
httpStatus: number;
path?: string;
stack?: string;
};
message: string;
code: _trpc_server_unstable_core_do_not_import.TRPC_ERROR_CODE_NUMBER;
};
transformer: false;
}, {
isSignedIn: _trpc_server.TRPCQueryProcedure<{
input: void;
output: {
isSignedIn: boolean;
};
}>;
signupWithEmail: _trpc_server.TRPCMutationProcedure<{
input: {
email: string;
};
output: {
ok: true;
};
}>;
signInWithEmail: _trpc_server.TRPCMutationProcedure<{
input: {
email: string;
};
output: {
ok: boolean;
};
}>;
signInVerification: _trpc_server.TRPCMutationProcedure<{
input: {
token: string;
};
output: {
ok: true;
} | {
ok: false;
attemptExceeded: boolean;
};
}>;
signUpVerification: _trpc_server.TRPCMutationProcedure<{
input: {
token: string;
};
output: {
ok: true;
} | {
ok: false;
attemptExceeded: boolean;
};
}>;
}>;
}>>;

type AppRouter = typeof appRouter;

export type { AppRouter };
2 changes: 1 addition & 1 deletion apps/app/app/lib/trpcClient.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { AppRouter } from '@/generated/trpc/trpc'
import { createTRPCReact } from '@trpc/react-query'
import type { AppRouter } from '../../types/trpc'
export const trpc = createTRPCReact<AppRouter>()
177 changes: 0 additions & 177 deletions apps/app/types/trpc.d.ts

This file was deleted.

0 comments on commit b5644a6

Please sign in to comment.