Connect, collaborate, and grow with a community of TypeScript developers
dotenv was swallowing the flag, sigh. (#359)
Anthony Shewced0f5b73647
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 9dfaea37..198145d7 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -3,19 +3,13 @@To contribute you will first need to fork the repo and make some adjustments to get it up and running on your localmachine. Below are the steps to follow in order for you to get dotfyle to run on your local machine.-### 1. `.env` files--You'll need one for your web application:+### 1. Create a `.env` file```cp apps/web/.env.example apps/web/.env```-And one for your Prisma package:--```-cp packages/db/.env.example packages/db/.env-```+Provide your own values as needed.### 2 Configure your databasediff --git a/package.json b/package.jsonindex 684ee65d..2cd03889 100644--- a/package.json+++ b/package.json@@ -18,7 +18,7 @@"lint": "turbo lint --continue -- --cache --cache-location 'node_modules/.cache/.eslintcache'","lint:fix": "turbo lint --continue -- --fix --cache --cache-location 'node_modules/.cache/.eslintcache'","prepare": "husky install",- "refresh": "turbo db:reset",+ "refresh": "turbo db:reset db:seed --concurrency=1","typecheck": "turbo typecheck --continue"},"devDependencies": {diff --git a/packages/db/package.json b/packages/db/package.jsonindex 4f43c35f..38fc9de7 100644--- a/packages/db/package.json+++ b/packages/db/package.json@@ -21,7 +21,7 @@"db:format": "dotenv -e ../../.env prisma format","db:generate": "dotenv -e ../../.env prisma generate","db:push": "dotenv -e ../../.env prisma db push",- "db:reset": "dotenv -e ../../.env prisma db push --force-reset",+ "db:reset": "dotenv -e ../../.env prisma db push -- --force-reset","db:seed": "dotenv -e ../../.env tsx ./seed/index.ts","db:studio": "dotenv -e ../../.env prisma studio","format": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check",diff --git a/packages/db/truncate.ts b/packages/db/truncate.tsdeleted file mode 100644index 7bf14f04..00000000--- a/packages/db/truncate.ts+++ /dev/null@@ -1,29 +0,0 @@-// eslint-disable-next-line @typescript-eslint/no-var-requires-const { PrismaClient } = require('@prisma/client');--const prisma = new PrismaClient();--async function truncateTables() {- try {- // Get all table names- /** @type {{ table_name: string }[]} */- const tableNames = await prisma.$queryRaw`- SELECT table_name FROM information_schema.tables- WHERE table_schema = 'public' -- Replace 'public' with your schema name if necessary- AND table_type = 'BASE TABLE'- `;-- // Truncate each table- for (const { table_name } of tableNames) {- await prisma.$queryRaw`TRUNCATE TABLE "${table_name}" RESTART IDENTITY CASCADE`;- }-- console.log('All tables truncated successfully.');- } catch (error) {- console.error('Error truncating tables:', error);- } finally {- await prisma.$disconnect();- }-}--truncateTables();