Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "enigma",
"name": "query",
"private": true,
"version": "1.0.0",
"packageManager": "pnpm@10.25.0",
Expand All @@ -22,10 +22,10 @@
"typecheck": "turbo run typecheck"
},
"devDependencies": {
"@enigma/eslint-config": "workspace:*",
"@enigma/prettier-config": "workspace:*",
"@enigma/tailwind-config": "workspace:*",
"@enigma/tsconfig": "workspace:*",
"@query/eslint-config": "workspace:*",
"@query/prettier-config": "workspace:*",
"@query/tailwind-config": "workspace:*",
"@query/tsconfig": "workspace:*",
"@tailwindcss/postcss": "^4.1.18",
"@tanstack/react-query": "^5.90.12",
"@trpc/client": "^11.7.2",
Expand All @@ -39,7 +39,7 @@
"typescript": "^5.6.3",
"zod": "^3.23.8"
},
"prettier": "@enigma/prettier-config",
"prettier": "@query/prettier-config",
"pnpm": {
"overrides": {
"react": "^18.3.1",
Expand Down
15 changes: 9 additions & 6 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@enigma/api",
"name": "@query/api",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": "./src/client.ts",
".": "./src/index.ts",
"./client": "./src/client.ts",
"./trpc-server": "./src/trpc-server.ts",
"./server": "./src/index.ts",
"./context": "./src/context.ts",
"./middleware": "./src/middleware.ts",
Expand All @@ -15,17 +17,18 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@enigma/auth": "workspace:*",
"@enigma/db": "workspace:*",
"@query/auth": "workspace:*",
"@query/db": "workspace:*",
"@trpc/server": "^11.7.2",
"@trpc/client": "^11.7.2",
"@trpc/react-query": "^11.7.2",
"@trpc/next": "^11.7.2",
"@tanstack/react-query": "^5.90.12",
"zod": "^3.23.8"
"zod": "^3.23.8",
"superjson": "^2.2.6"
},
"devDependencies": {
"@enigma/tsconfig": "workspace:*",
"@query/tsconfig": "workspace:*",
"typescript": "^5.6.3"
}
}
3 changes: 1 addition & 2 deletions packages/api/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// Client-only re-exports (types + trpc client helpers)
// Client-only types for trpc. Keep this file type-only to avoid pulling server code into bundles.
export type { AppRouter } from './index';
export { trpc, createTrpcClient } from './trpc';
53 changes: 0 additions & 53 deletions packages/api/src/context.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/api/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TRPCError } from '@trpc/server';
import { db } from '@enigma/db';
import { roles, users } from '@enigma/db/schema';
import { db } from '@query/db';
import { roles, users } from '@query/db/schema';

export async function requireAdmin(ctx: any) {
if (!ctx.user) throw new TRPCError({ code: 'UNAUTHORIZED' });
Expand Down
98 changes: 0 additions & 98 deletions packages/api/src/trpc-server.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@enigma/tsconfig/base.json",
"extends": "@query/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enigma/auth",
"name": "@query/auth",
"version": "0.0.0",
"private": true,
"type": "module",
Expand All @@ -14,7 +14,7 @@
"dependencies": {
"uuid": "^9.0.0",
"zod": "^3.23.8",
"@enigma/db": "workspace:*",
"@query/db": "workspace:*",
"@tanstack/react-query": "^5.90.12"
}
}
14 changes: 7 additions & 7 deletions packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ async function tryDb() {
// dynamic import so packages/db doesn't need to resolve at build time
// (allows dev without Postgres)
// eslint-disable-next-line @typescript-eslint/no-var-requires
const mod = await import('@enigma/db');
const mod = await import('@query/db');
// also import schema
const schema = await import('@enigma/db/schema');
const schema = await import('@query/db/schema');
return { db: mod.db, users: schema.users, sessions: schema.sessions };
} catch (err) {
return null;
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function deleteSession(token: string) {

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

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

export function setSessionCookie(res: any, token: string) {
try {
res.cookies.set('enigma_session', token, {
res.cookies.set('query_session', token, {
httpOnly: true,
path: '/',
maxAge: 60 * 60 * 24 * 30,
Expand All @@ -106,15 +106,15 @@ export function setSessionCookie(res: any, token: string) {
});
} catch (err) {
const prev = res.headers?.get?.('set-cookie') ?? '';
res.headers?.set?.('set-cookie', `${prev}; enigma_session=${token}; Path=/; HttpOnly`);
res.headers?.set?.('set-cookie', `${prev}; query_session=${token}; Path=/; HttpOnly`);
}
}

export function clearSessionCookie(res: any) {
try {
res.cookies.set('enigma_session', '', { path: '/', maxAge: 0 });
res.cookies.set('query_session', '', { path: '/', maxAge: 0 });
} catch (err) {
res.headers?.set?.('set-cookie', 'enigma_session=; Path=/; Max-Age=0');
res.headers?.set?.('set-cookie', 'query_session=; Path=/; Max-Age=0');
}
}

2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enigma/db",
"name": "@query/db",
"version": "0.0.0",
"private": true,
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/db/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { drizzle } from "drizzle-orm/pg";
import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
import * as schema from "./schema";

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { config } from "@enigma/eslint-config/react-internal";
import { config } from "@query/eslint-config/react-internal";

/** @type {import("eslint").Linter.Config} */
export default config;
8 changes: 4 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enigma/ui",
"name": "@query/ui",
"version": "0.0.0",
"sideEffects": [
"**/*.css"
Expand All @@ -25,9 +25,9 @@
"react": "^18.3.1"
},
"devDependencies": {
"@enigma/eslint-config": "workspace:*",
"@enigma/tailwind-config": "workspace:*",
"@enigma/tsconfig": "workspace:*",
"@query/eslint-config": "workspace:*",
"@query/tailwind-config": "workspace:*",
"@query/tsconfig": "workspace:*",
"@next/eslint-plugin-next": "^16.0.8",
"@tailwindcss/cli": "^4.1.5",
"@types/minimatch": "^6.0.0",
Expand Down
17 changes: 17 additions & 0 deletions packages/ui/src/card.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Card = Card;
function Card(_a) {
var title = _a.title, children = _a.children, href = _a.href;
return (<a className="ui:group ui:rounded-lg ui:border ui:border-transparent ui:px-5 ui:py-4 ui:transition-colors hover:ui:border-neutral-700 hover:ui:bg-neutral-800/30" href={"".concat(href, "?utm_source=create-turbo&utm_medium=with-tailwind&utm_campaign=create-turbo\"")} rel="noopener noreferrer" target="_blank">
<h2 className="ui:mb-3 ui:text-2xl ui:font-semibold">
{title}{" "}
<span className="ui:inline-block ui:transition-transform group-hover:ui:translate-x-1 motion-reduce:ui:transform-none">
-&gt;
</span>
</h2>
<p className="ui:m-0 ui:max-w-[30ch] ui:text-sm ui:opacity-50">
{children}
</p>
</a>);
}
9 changes: 9 additions & 0 deletions packages/ui/src/gradient.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Gradient = Gradient;
function Gradient(_a) {
var conic = _a.conic, className = _a.className, small = _a.small;
return (<span className={"ui:absolute ui:mix-blend-normal ui:will-change-[filter] ui:rounded-[100%] ".concat(small ? "ui:blur-[32px]" : "ui:blur-[75px]", " ").concat(conic
? "ui:bg-[conic-gradient(from_180deg_at_50%_50%,var(--red-1000)_0deg,_var(--purple-1000)_180deg,_var(--blue-1000)_360deg)]"
: "", " ").concat(className !== null && className !== void 0 ? className : "")}/>);
}
16 changes: 16 additions & 0 deletions packages/ui/src/turborepo-logo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TurborepoLogo = void 0;
var TurborepoLogo = function () {
return (<svg aria-label="Turbo logomark" height="80" role="img" viewBox="0 0 40 40" width="80">
<path d="M19.9845 6.99291C12.818 6.99291 6.98755 12.8279 6.98755 19.9999C6.98755 27.1721 12.818 33.0071 19.9845 33.0071C27.1509 33.0071 32.9814 27.1721 32.9814 19.9999C32.9814 12.8279 27.1509 6.99291 19.9845 6.99291ZM19.9845 26.7313C16.2694 26.7313 13.2585 23.718 13.2585 19.9999C13.2585 16.282 16.2694 13.2687 19.9845 13.2687C23.6996 13.2687 26.7105 16.282 26.7105 19.9999C26.7105 23.718 23.6996 26.7313 19.9845 26.7313Z" fill="currentcolor"></path>
<path clipRule="evenodd" d="M21.0734 4.85648V0C31.621 0.564369 40 9.30362 40 19.9999C40 30.6963 31.621 39.4332 21.0734 40V35.1435C28.9344 34.5815 35.1594 28.0078 35.1594 19.9999C35.1594 11.9922 28.9344 5.41843 21.0734 4.85648ZM8.52181 29.931C6.43794 27.5233 5.09469 24.4568 4.85508 21.09H0C0.251709 25.8011 2.13468 30.0763 5.08501 33.368L8.51938 29.931H8.52181ZM18.8951 40V35.1435C15.5285 34.9037 12.4644 33.5619 10.0587 31.4739L6.62435 34.9109C9.91593 37.866 14.1876 39.7481 18.8927 40H18.8951Z" fill="url(#:Sb:paint0_linear_902_224)" fillRule="evenodd"></path>
<defs>
<linearGradient gradientUnits="userSpaceOnUse" id=":Sb:paint0_linear_902_224" x1="21.8576" x2="2.17018" y1="2.81244" y2="22.4844">
<stop stopColor="#0096FF"></stop>
<stop offset="1" stopColor="#FF1E56"></stop>
</linearGradient>
</defs>
</svg>);
};
exports.TurborepoLogo = TurborepoLogo;
2 changes: 1 addition & 1 deletion packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@enigma/tsconfig/internal-package.json",
"extends": "@query/tsconfig/internal-package.json",
"compilerOptions": {
"lib": ["ES2022", "dom", "dom.iterable"],
"jsx": "preserve",
Expand Down
Loading
Loading