Skip to content

Commit 005496d

Browse files
Merge branch 'main' into Adnanarodiya/main
2 parents 4c29adb + 12968be commit 005496d

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ yarn-error.log*
3939
.xata
4040
.xatarc
4141

42-
src/xata.ts
42+
src/xata.ts
43+
44+
.env

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "npm run xata:init && next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"xata:init": "dotenv -- xata init --db \"$XATA_HTTP_ENDPOINT\" --sdk --no-input --yes --codegen=src/xata.ts --force",
10+
"xata:init": "node prebuild.mjs",
1111
"format": "prettier --write \"./**/*.{ts,tsx,json}\""
1212
},
1313
"dependencies": {
@@ -20,6 +20,7 @@
2020
"class-variance-authority": "^0.7.1",
2121
"clsx": "^2.1.1",
2222
"daisyui": "^4.12.24",
23+
"dotenv": "^17.2.1",
2324
"dotenv-cli": "^10.0.0",
2425
"framer-motion": "^12.23.12",
2526
"jotai": "^2.12.5",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prebuild.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env node
2+
3+
import { execSync } from 'child_process';
4+
import 'dotenv/config';
5+
const command = `xata init --db ${process.env.XATA_HTTP_ENDPOINT} --sdk --no-input --yes --codegen=src/xata.ts --force`;
6+
7+
console.log(command);
8+
console.log('Running xata init command...');
9+
execSync(command, { stdio: 'inherit' });

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"**/*.tsx",
3131
"src/env.mjs",
3232
"next.config.mjs",
33-
".next/types/**/*.ts"
33+
".next/types/**/*.ts",
34+
"prebuild.mjs"
3435
],
3536
"exclude": ["node_modules"]
3637
}

0 commit comments

Comments
 (0)