Skip to content

Commit c349d60

Browse files
authored
Merge pull request #15 from DataScience-GT/rework/turbbo
new name
2 parents b5a4201 + c6fb22d commit c349d60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+366
-382
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "enigma",
2+
"name": "query",
33
"private": true,
44
"version": "1.0.0",
55
"packageManager": "pnpm@10.25.0",
@@ -22,10 +22,10 @@
2222
"typecheck": "turbo run typecheck"
2323
},
2424
"devDependencies": {
25-
"@enigma/eslint-config": "workspace:*",
26-
"@enigma/prettier-config": "workspace:*",
27-
"@enigma/tailwind-config": "workspace:*",
28-
"@enigma/tsconfig": "workspace:*",
25+
"@query/eslint-config": "workspace:*",
26+
"@query/prettier-config": "workspace:*",
27+
"@query/tailwind-config": "workspace:*",
28+
"@query/tsconfig": "workspace:*",
2929
"@tailwindcss/postcss": "^4.1.18",
3030
"@tanstack/react-query": "^5.90.12",
3131
"@trpc/client": "^11.7.2",
@@ -39,7 +39,7 @@
3939
"typescript": "^5.6.3",
4040
"zod": "^3.23.8"
4141
},
42-
"prettier": "@enigma/prettier-config",
42+
"prettier": "@query/prettier-config",
4343
"pnpm": {
4444
"overrides": {
4545
"react": "^18.3.1",

packages/api/package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"name": "@enigma/api",
2+
"name": "@query/api",
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",
66
"exports": {
7-
".": "./src/client.ts",
7+
".": "./src/index.ts",
8+
"./client": "./src/client.ts",
9+
"./trpc-server": "./src/trpc-server.ts",
810
"./server": "./src/index.ts",
911
"./context": "./src/context.ts",
1012
"./middleware": "./src/middleware.ts",
@@ -15,17 +17,18 @@
1517
"typecheck": "tsc --noEmit"
1618
},
1719
"dependencies": {
18-
"@enigma/auth": "workspace:*",
19-
"@enigma/db": "workspace:*",
20+
"@query/auth": "workspace:*",
21+
"@query/db": "workspace:*",
2022
"@trpc/server": "^11.7.2",
2123
"@trpc/client": "^11.7.2",
2224
"@trpc/react-query": "^11.7.2",
2325
"@trpc/next": "^11.7.2",
2426
"@tanstack/react-query": "^5.90.12",
25-
"zod": "^3.23.8"
27+
"zod": "^3.23.8",
28+
"superjson": "^2.2.6"
2629
},
2730
"devDependencies": {
28-
"@enigma/tsconfig": "workspace:*",
31+
"@query/tsconfig": "workspace:*",
2932
"typescript": "^5.6.3"
3033
}
3134
}

packages/api/src/client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
// Client-only re-exports (types + trpc client helpers)
1+
// Client-only types for trpc. Keep this file type-only to avoid pulling server code into bundles.
22
export type { AppRouter } from './index';
3-
export { trpc, createTrpcClient } from './trpc';

packages/api/src/context.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/api/src/middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TRPCError } from '@trpc/server';
2-
import { db } from '@enigma/db';
3-
import { roles, users } from '@enigma/db/schema';
2+
import { db } from '@query/db';
3+
import { roles, users } from '@query/db/schema';
44

55
export async function requireAdmin(ctx: any) {
66
if (!ctx.user) throw new TRPCError({ code: 'UNAUTHORIZED' });

packages/api/src/trpc-server.ts

Lines changed: 0 additions & 98 deletions
This file was deleted.

packages/api/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@enigma/tsconfig/base.json",
2+
"extends": "@query/tsconfig/base.json",
33
"compilerOptions": {
44
"outDir": "dist",
55
"rootDir": "src"

packages/auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@enigma/auth",
2+
"name": "@query/auth",
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"uuid": "^9.0.0",
1616
"zod": "^3.23.8",
17-
"@enigma/db": "workspace:*",
17+
"@query/db": "workspace:*",
1818
"@tanstack/react-query": "^5.90.12"
1919
}
2020
}

packages/auth/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ async function tryDb() {
88
// dynamic import so packages/db doesn't need to resolve at build time
99
// (allows dev without Postgres)
1010
// eslint-disable-next-line @typescript-eslint/no-var-requires
11-
const mod = await import('@enigma/db');
11+
const mod = await import('@query/db');
1212
// also import schema
13-
const schema = await import('@enigma/db/schema');
13+
const schema = await import('@query/db/schema');
1414
return { db: mod.db, users: schema.users, sessions: schema.sessions };
1515
} catch (err) {
1616
return null;
@@ -85,7 +85,7 @@ export async function deleteSession(token: string) {
8585

8686
export function getTokenFromRequest(req: Request) {
8787
const cookies = req.headers.get('cookie') ?? '';
88-
const match = /(?:^|; )enigma_session=([^;]+)/.exec(cookies);
88+
const match = /(?:^|; )query_session=([^;]+)/.exec(cookies);
8989
return match?.[1] ?? null;
9090
}
9191

@@ -97,7 +97,7 @@ export async function getSessionFromRequest(req: Request) {
9797

9898
export function setSessionCookie(res: any, token: string) {
9999
try {
100-
res.cookies.set('enigma_session', token, {
100+
res.cookies.set('query_session', token, {
101101
httpOnly: true,
102102
path: '/',
103103
maxAge: 60 * 60 * 24 * 30,
@@ -106,15 +106,15 @@ export function setSessionCookie(res: any, token: string) {
106106
});
107107
} catch (err) {
108108
const prev = res.headers?.get?.('set-cookie') ?? '';
109-
res.headers?.set?.('set-cookie', `${prev}; enigma_session=${token}; Path=/; HttpOnly`);
109+
res.headers?.set?.('set-cookie', `${prev}; query_session=${token}; Path=/; HttpOnly`);
110110
}
111111
}
112112

113113
export function clearSessionCookie(res: any) {
114114
try {
115-
res.cookies.set('enigma_session', '', { path: '/', maxAge: 0 });
115+
res.cookies.set('query_session', '', { path: '/', maxAge: 0 });
116116
} catch (err) {
117-
res.headers?.set?.('set-cookie', 'enigma_session=; Path=/; Max-Age=0');
117+
res.headers?.set?.('set-cookie', 'query_session=; Path=/; Max-Age=0');
118118
}
119119
}
120120

packages/db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@enigma/db",
2+
"name": "@query/db",
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",

0 commit comments

Comments
 (0)