Skip to content

Commit 5741559

Browse files
authored
Knip & Clean Ups (#51)
1 parent 3f3543e commit 5741559

46 files changed

Lines changed: 2792 additions & 3690 deletions

Some content is hidden

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

RELEASE_NOTES.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
### ✨ Features
22

3-
- **Migration Scripts** - Added `migrate:dev` and `migrate:deploy` scripts for easier database migration management
4-
- **Release Script** - Added automated release script (`scripts/release.sh`) for version bumping and tag creation
3+
- **Next.js 16 Upgrade** - Landing page upgraded to Next.js 16.1.1 with React 19.2.3
4+
- **Knip Integration** - Added dead code detection tooling for improved codebase hygiene
55

6-
### 🐛 Bug Fixes
6+
### 🧹 Maintenance
77

8-
- Fixed dashboard subscriber growth calculation to properly handle baseline subscriber count
9-
- Improved seed data distribution - subscribers now distributed over 2 years instead of 12 days for better testing
8+
- Removed unused exports, hooks, and components across the codebase
9+
- Added ESLint configurations for all packages and apps
10+
- Updated TypeScript configurations across the monorepo
11+
- Consolidated `@types/react` version overrides for consistency

apps/backend/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"description": "",
55
"main": "src/index.ts",
66
"scripts": {
7-
"start": "bun run src/index.ts",
8-
"dev": "watchexec -r -e ts bun run src/index.ts",
7+
"start": "bun src/index.ts",
8+
"dev": "bun --watch src/index.ts",
99
"build": "rm -rf dist && tsc -b tsconfig.build.json",
1010
"lint": "eslint .",
1111
"lint:fix": "eslint . --fix",
@@ -26,7 +26,7 @@
2626
"author": "",
2727
"license": "ISC",
2828
"dependencies": {
29-
"@prisma/client": "^6.7.0",
29+
"@prisma/client": "6.7.0",
3030
"@trpc/server": "11.0.0-rc.730",
3131
"bcryptjs": "^3.0.0",
3232
"cors": "^2.8.5",
@@ -47,9 +47,7 @@
4747
"devDependencies": {
4848
"@eslint/js": "^9.19.0",
4949
"@faker-js/faker": "^9.5.0",
50-
"@repo/eslint-config": "workspace:*",
5150
"@types/cors": "^2.8.17",
52-
"@types/dotenv": "^8.2.3",
5351
"@types/express": "^5.0.0",
5452
"@types/jsonwebtoken": "^9.0.8",
5553
"@types/node": "^22.12.0",

apps/backend/src/message/utils.ts

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

apps/backend/src/trpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const t = initTRPC.context<Context>().create({
6464
export const router = t.router
6565
export const publicProcedure = t.procedure
6666

67-
export const isAuthedMiddleware = t.middleware(({ ctx, next }) => {
67+
const isAuthedMiddleware = t.middleware(({ ctx, next }) => {
6868
if (!ctx.user) {
6969
throw new TRPCError({
7070
code: "UNAUTHORIZED",

apps/backend/src/utils/placeholder-parser.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ interface OrganizationPlaceholderData {
1212
name: string
1313
}
1414

15-
export interface PlaceholderData {
16-
subscriber: SubscriberPlaceholderData
17-
campaign: CampaignPlaceholderData
18-
organization: OrganizationPlaceholderData
19-
unsubscribe_link: string
20-
current_date?: string
21-
}
22-
2315
export type PlaceholderDataKey =
2416
| `subscriber.${keyof SubscriberPlaceholderData}`
2517
| `campaign.${keyof CampaignPlaceholderData}`

apps/backend/src/utils/schemas.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ export const paginationSchema = z.object({
55
perPage: z.number().min(1).max(100).default(10),
66
search: z.string().optional(),
77
})
8-
9-
export type PaginationSchema = z.infer<typeof paginationSchema>

apps/backend/src/utils/token.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ export const tokenPayloadSchema = z.object({
66
iat: z.number(),
77
exp: z.number(),
88
})
9-
10-
export type TokenPayload = z.infer<typeof tokenPayloadSchema>

apps/backend/src/webhook/types.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ export const WebhookEventSchema = z.object({
88
error: z.string().nullable().optional(),
99
})
1010

11-
// Schema for authorization result (must be boolean)
12-
export const AuthorizationResultSchema = z.boolean()
13-
1411
export type WebhookEvent = z.infer<typeof WebhookEventSchema>
1512

1613
// Event mapping configuration
@@ -34,10 +31,6 @@ export const EVENT_STATUS_MAP: Record<
3431
spam: { status: "COMPLAINED", errorDefault: "Spam complaint" },
3532
}
3633

37-
// Constants
38-
export const MEMORY_LIMIT = 128 * 1024 * 1024 // 128MB
39-
export const MAX_STACK_SIZE = 1024 * 1024 // 1MB
40-
4134
export type WebhookResult =
4235
| {
4336
success: false

apps/backend/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"noImplicitAny": true,
99
"strictNullChecks": true,
1010
"noUncheckedIndexedAccess": true,
11+
"noUnusedLocals": true,
12+
"noUnusedParameters": true,
1113
"skipDefaultLibCheck": true,
1214
"skipLibCheck": true,
1315
"paths": {

apps/docs/eslint.config.mjs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
4-
5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
7-
8-
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
});
1+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals"
2+
import nextTypescript from "eslint-config-next/typescript"
113

124
const eslintConfig = [
13-
...compat.extends("next/core-web-vitals", "next/typescript"),
14-
];
5+
...nextCoreWebVitals,
6+
...nextTypescript,
7+
{
8+
ignores: [
9+
"node_modules/**",
10+
".next/**",
11+
"out/**",
12+
"build/**",
13+
"next-env.d.ts",
14+
"public/_pagefind/**",
15+
],
16+
},
17+
]
1518

16-
export default eslintConfig;
19+
export default eslintConfig

0 commit comments

Comments
 (0)