Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
♻️ Inline @rallly/api-core into web app (#2448)
Luke Vellae0d4e9be0351
diff --git a/apps/web/package.json b/apps/web/package.jsonindex e6a3329bb..671fd296a 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -36,7 +36,6 @@"@radix-ui/react-select": "^2.2.2","@radix-ui/react-slot": "^1.1.2","@radix-ui/react-switch": "^1.0.2",- "@rallly/api-core": "workspace:*","@rallly/billing": "workspace:*","@rallly/database": "workspace:*","@rallly/emails": "workspace:*",diff --git a/apps/web/src/app/api/private/[...route]/route.test.ts b/apps/web/src/app/api/private/[...route]/route.test.tsindex ebe2d14b4..0c4b0ec83 100644--- a/apps/web/src/app/api/private/[...route]/route.test.ts+++ b/apps/web/src/app/api/private/[...route]/route.test.ts@@ -8,12 +8,12 @@ const mockCreatePoll = vi.fn();const mockGetPollResults = vi.fn();const mockGetPollParticipants = vi.fn();-vi.mock("@rallly/api-core/polls/mutations", () => ({+vi.mock("@/features/poll/mutations", () => ({deletePoll: (...args: unknown[]) => mockDeletePoll(...args),createPoll: (...args: unknown[]) => mockCreatePoll(...args),}));-vi.mock("@rallly/api-core/polls/data", () => ({+vi.mock("@/features/poll/data", () => ({getPollResults: (...args: unknown[]) => mockGetPollResults(...args),getPollParticipants: (...args: unknown[]) => mockGetPollParticipants(...args),}));diff --git a/apps/web/src/app/api/private/[...route]/route.ts b/apps/web/src/app/api/private/[...route]/route.tsindex 127a82651..a78beed30 100644--- a/apps/web/src/app/api/private/[...route]/route.ts+++ b/apps/web/src/app/api/private/[...route]/route.ts@@ -1,9 +1,4 @@import { RedisStore } from "@hono-rate-limiter/redis";-import {- getPollParticipants,- getPollResults,-} from "@rallly/api-core/polls/data";-import { createPoll, deletePoll } from "@rallly/api-core/polls/mutations";import { prisma } from "@rallly/database";import { absoluteUrl, shortUrl } from "@rallly/utils/absolute-url";import { Scalar } from "@scalar/hono-api-reference";@@ -16,6 +11,8 @@ import {validator,} from "hono-openapi";import { rateLimiter } from "hono-rate-limiter";+import { getPollParticipants, getPollResults } from "@/features/poll/data";+import { createPoll, deletePoll } from "@/features/poll/mutations";import { redis } from "@/lib/kv";import {createPollInputSchema,diff --git a/apps/web/src/app/api/private/utils/api-key.ts b/apps/web/src/app/api/private/utils/api-key.tsindex fde418ada..94339af99 100644--- a/apps/web/src/app/api/private/utils/api-key.ts+++ b/apps/web/src/app/api/private/utils/api-key.ts@@ -1,11 +1,8 @@import crypto from "node:crypto";-import {- extractApiKeyPrefix,- verifyApiKey,-} from "@rallly/api-core/auth/api-key";import { prisma } from "@rallly/database";import { bearerAuth } from "hono/bearer-auth";import { after } from "next/server";+import { extractApiKeyPrefix, verifyApiKey } from "@/features/api-keys/api-key";export const spaceApiKeyAuth = bearerAuth({verifyToken: async (rawKey, c) => {diff --git a/packages/api-core/src/auth/api-key.test.ts b/apps/web/src/features/api-keys/api-key.test.tssimilarity index 100%rename from packages/api-core/src/auth/api-key.test.tsrename to apps/web/src/features/api-keys/api-key.test.tsdiff --git a/packages/api-core/src/auth/api-key.ts b/apps/web/src/features/api-keys/api-key.tssimilarity index 100%rename from packages/api-core/src/auth/api-key.tsrename to apps/web/src/features/api-keys/api-key.tsdiff --git a/packages/api-core/src/polls/data.ts b/apps/web/src/features/poll/data.tssimilarity index 100%rename from packages/api-core/src/polls/data.tsrename to apps/web/src/features/poll/data.tsdiff --git a/packages/api-core/src/polls/mutations.ts b/apps/web/src/features/poll/mutations.tssimilarity index 100%rename from packages/api-core/src/polls/mutations.tsrename to apps/web/src/features/poll/mutations.tsdiff --git a/apps/web/src/trpc/routers/api-keys.ts b/apps/web/src/trpc/routers/api-keys.tsindex 37a513908..61cd3552e 100644--- a/apps/web/src/trpc/routers/api-keys.ts+++ b/apps/web/src/trpc/routers/api-keys.ts@@ -1,7 +1,7 @@-import { createApiKey } from "@rallly/api-core/auth/api-key";import { prisma } from "@rallly/database";import { TRPCError } from "@trpc/server";import * as z from "zod";+import { createApiKey } from "@/features/api-keys/api-key";import { isApiAccessEnabled } from "@/features/developer/data";import { router, spaceOwnerProcedure } from "../trpc";diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.tsindex 616ba7658..b402f4f40 100644--- a/apps/web/src/trpc/routers/polls.ts+++ b/apps/web/src/trpc/routers/polls.ts@@ -1,4 +1,3 @@-import { getPolls } from "@rallly/api-core/polls/data";import type { PollStatus } from "@rallly/database";import { prisma } from "@rallly/database";import { sendFinalizeHostEmail } from "@rallly/emails/templates/finalized-host";@@ -12,6 +11,7 @@ import * as z from "zod";import { getInstanceBranding, getSpaceBranding } from "@/emails/branding";import { posthog } from "@/features/analytics/posthog";import { moderateContent } from "@/features/moderation";+import { getPolls } from "@/features/poll/data";import { canUserManagePoll } from "@/features/poll/helpers";import { hasPollAdminAccess } from "@/features/poll/query";import { formatEventDateTime } from "@/features/scheduled-event/utils";diff --git a/packages/api-core/biome.json b/packages/api-core/biome.jsondeleted file mode 100644index c4a672504..000000000--- a/packages/api-core/biome.json+++ /dev/null@@ -1,4 +0,0 @@-{- "$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",- "extends": "//"-}diff --git a/packages/api-core/package.json b/packages/api-core/package.jsondeleted file mode 100644index 4a1d704ff..000000000--- a/packages/api-core/package.json+++ /dev/null@@ -1,22 +0,0 @@-{- "name": "@rallly/api-core",- "version": "0.0.0",- "private": true,- "scripts": {- "test:unit": "vitest run",- "type-check": "tsc --noEmit"- },- "exports": {- "./*": "./src/*.ts"- },- "dependencies": {- "@rallly/database": "workspace:*",- "@rallly/logger": "workspace:*",- "@rallly/utils": "workspace:*"- },- "devDependencies": {- "@rallly/tsconfig": "workspace:*",- "@types/node": "^24.1.0",- "vitest": "^4.0.16"- }-}diff --git a/packages/api-core/tsconfig.json b/packages/api-core/tsconfig.jsondeleted file mode 100644index 4959f2f61..000000000--- a/packages/api-core/tsconfig.json+++ /dev/null@@ -1,8 +0,0 @@-{- "extends": "@rallly/tsconfig/node.json",- "compilerOptions": {- "types": ["vitest/globals", "node"],- "lib": ["es2020"]- },- "include": ["**/*.ts"]-}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 913424611..ba57be996 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -92,7 +92,7 @@ importers:version: 8.1.0([email protected])'@vercel/analytics':specifier: ^1.5.0- version: 1.6.1([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 1.6.1([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])dayjs:specifier: ^1.11.13version: 1.11.19@@ -131,7 +131,7 @@ importers:version: 6.0.0(@types/[email protected])([email protected])next-seo:specifier: ^6.1.0- version: 6.8.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 6.8.0([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])pg:specifier: ^8.17.1version: 8.18.0@@ -238,9 +238,6 @@ importers:'@radix-ui/react-switch':specifier: ^1.0.2version: 1.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])- '@rallly/api-core':- specifier: workspace:*- version: link:../../packages/api-core'@rallly/billing':specifier: workspace:*version: link:../../packages/billing@@ -525,28 +522,6 @@ importers:specifier: ^4.0.16version: 4.0.18(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])- packages/api-core:- dependencies:- '@rallly/database':- specifier: workspace:*- version: link:../database- '@rallly/logger':- specifier: workspace:*- version: link:../logger- '@rallly/utils':- specifier: workspace:*- version: link:../utils- devDependencies:- '@rallly/tsconfig':- specifier: workspace:*- version: link:../tsconfig- '@types/node':- specifier: ^24.1.0- version: 24.10.11- vitest:- specifier: ^4.0.16- version: 4.0.18(@opentelemetry/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])-packages/billing:dependencies:'@radix-ui/react-radio-group':@@ -18184,7 +18159,7 @@ snapshots:dependencies:uncrypto: 0.1.3- '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':+ '@vercel/[email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected])':optionalDependencies:next: 16.2.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 19.2.6@@ -21942,7 +21917,7 @@ snapshots:react: 19.2.6react-dom: 19.2.6([email protected])- [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ [email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):dependencies:next: 16.2.6(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 19.2.6