Skip to content

Commit

Permalink
feat: add typesafe environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ixartz committed Aug 22, 2023
1 parent cd45e09 commit 5a2cd78
Show file tree
Hide file tree
Showing 7 changed files with 1,149 additions and 1,037 deletions.
4 changes: 4 additions & 0 deletions .env.development
@@ -1,3 +1,7 @@
# Database
DATABASE_URL=file:next-js-boilerplate.db

# Clerk authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_bGlnaHQtbGFicmFkb3ItNTEuY2xlcmsuYWNjb3VudHMuZGV2JA
CLERK_SECRET_KEY=your_clerk_secret_key

Expand Down
8 changes: 7 additions & 1 deletion drizzle.config.ts
@@ -1,10 +1,16 @@
/* eslint-disable-next-line import/no-extraneous-dependencies */
import dotenv from 'dotenv';
import type { Config } from 'drizzle-kit';

dotenv.config({
path: '.env.development',
});

export default {
out: './migrations',
schema: './src/models/schema.ts',
driver: 'libsql',
dbCredentials: {
url: 'file:next-js-boilerplate.db',
url: process.env.DATABASE_URL ?? '',
},
} satisfies Config;
1 change: 1 addition & 0 deletions next.config.js
Expand Up @@ -3,6 +3,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});

/** @type {import('next').NextConfig} */
module.exports = withBundleAnalyzer({
eslint: {
dirs: ['.'],
Expand Down

0 comments on commit 5a2cd78

Please sign in to comment.