Skip to content

Commit 0e3830c

Browse files
authored
Merge pull request #1 from nedhmn/feature/seeder
Feature/seeder
2 parents 4524b04 + 6fc674e commit 0e3830c

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

+40816
-61
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ yarn-debug.log*
2424
yarn-error.log*
2525

2626
# local env files
27+
.env
2728
.env.local
2829
.env.development.local
2930
.env.test.local

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
{
44
"mode": "auto"
55
}
6-
]
6+
],
7+
"editor.tabSize": 2
78
}

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"devDependencies": {
2222
"@next/eslint-plugin-next": "^15.3.0",
2323
"@repo/eslint-config": "workspace:*",
24-
"@repo/typescript-config": "workspace:*",
24+
"@repo/tsconfig": "workspace:*",
2525
"@types/mdx": "^2.0.13",
2626
"@types/node": "^22.15.3",
2727
"@types/react": "^19.1.0",

apps/docs/tsconfig.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
2-
"extends": "@repo/typescript-config/nextjs.json",
2+
"extends": "@repo/tsconfig/nextjs.json",
33
"compilerOptions": {
44
"plugins": [
55
{
66
"name": "next"
77
}
8-
]
8+
],
9+
"allowJs": true
910
},
1011
"include": [
1112
"**/*.ts",
@@ -14,5 +15,7 @@
1415
"next.config.ts",
1516
".next/types/**/*.ts"
1617
],
17-
"exclude": ["node_modules"]
18+
"exclude": [
19+
"node_modules"
20+
]
1821
}

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@next/eslint-plugin-next": "^15.3.0",
2121
"@repo/eslint-config": "workspace:*",
2222
"@repo/tailwind-config": "workspace:*",
23-
"@repo/typescript-config": "workspace:*",
23+
"@repo/tsconfig": "workspace:*",
2424
"@tailwindcss/postcss": "^4.1.5",
2525
"@types/node": "^22.15.3",
2626
"@types/react": "^19.1.0",

apps/web/tsconfig.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
2-
"extends": "@repo/typescript-config/nextjs.json",
2+
"extends": "@repo/tsconfig/nextjs.json",
33
"compilerOptions": {
44
"plugins": [
55
{
66
"name": "next"
77
}
8-
]
8+
],
9+
"allowJs": true
910
},
1011
"include": [
1112
"**/*.ts",
@@ -14,5 +15,7 @@
1415
"next.config.ts",
1516
".next/types/**/*.ts"
1617
],
17-
"exclude": ["node_modules"]
18+
"exclude": [
19+
"node_modules"
20+
]
1821
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "turbo run dev",
77
"lint": "turbo run lint",
88
"check-types": "turbo run check-types",
9-
"format": "prettier --write \"**/*.{ts,tsx,md}\""
9+
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
10+
"db:seed": "bash scripts/seed_db.sh"
1011
},
1112
"devDependencies": {
1213
"prettier": "^3.5.3",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { config } from "@repo/eslint-config/base";
2+
3+
/** @type {import("eslint").Linter.Config} */
4+
export default config;

packages/embeddings/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "@repo/embeddings",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"files": [
7+
"dist"
8+
],
9+
"imports": {
10+
"#*": "./src/*"
11+
},
12+
"exports": {
13+
".": "./dist/index.js",
14+
"./openai": "./dist/openai.js"
15+
},
16+
"scripts": {
17+
"build": "tsc",
18+
"check-types": "tsc --noEmit",
19+
"lint": "eslint src --max-warnings 0"
20+
},
21+
"devDependencies": {
22+
"@repo/eslint-config": "workspace:*",
23+
"@repo/tsconfig": "workspace:*",
24+
"@types/node": "^22.15.3",
25+
"eslint": "^9.26.0",
26+
"typescript": "^5.8.3"
27+
},
28+
"dependencies": {
29+
"@ai-sdk/openai": "^1.3.22",
30+
"@repo/utils": "workspace:*",
31+
"ai": "^4.3.15",
32+
"zod": "^3.24.4"
33+
}
34+
}

packages/embeddings/src/config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { loadEnvFile } from "@repo/utils";
2+
import { z } from "zod";
3+
4+
// Load environment variables
5+
if (process.env.NODE_ENV !== "production") {
6+
loadEnvFile("../.env.local", import.meta.url);
7+
}
8+
9+
const envSchema = z.object({
10+
OPENAI_API_KEY: z.string(),
11+
OPENAI_EMBEDDING_MODEL: z.string().default("text-embedding-3-small"),
12+
OPENAI_EMBEDDING_DIMENSION: z.number().int().default(1536),
13+
});
14+
15+
const env = envSchema.parse(process.env);
16+
17+
export default env;

0 commit comments

Comments
 (0)