this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fuck it

+69 -75
-10
.env.schema
··· 1 - # This env file uses @env-spec - see https://varlock.dev/env-spec for more info 2 - # 3 - # @defaultRequired=infer @defaultSensitive=false 4 - # @generateTypes(lang=ts, path=env.d.ts) 5 - # ---------- 6 - 7 - # @required @type=url 8 - TURSO_DATABASE_URL= 9 - # @required @sensitive 10 - TURSO_AUTH_TOKEN=
+3 -3
drizzle.config.ts
··· 1 1 import { defineConfig } from "drizzle-kit"; 2 - import { ENV } from "varlock/env"; 2 + import { env } from "./env.js"; 3 3 4 4 export default defineConfig({ 5 5 schema: "./src/data/schema.ts", 6 6 out: "./migrations", 7 7 dialect: "turso", 8 8 dbCredentials: { 9 - url: ENV.TURSO_DATABASE_URL, 10 - authToken: ENV.TURSO_AUTH_TOKEN, 9 + url: env.TURSO_DATABASE_URL, 10 + authToken: env.TURSO_AUTH_TOKEN, 11 11 }, 12 12 });
-47
env.d.ts
··· 1 - // 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 2 - // 🛑 THIS IS AN AUTOGENERATED FILE - DO NOT EDIT DIRECTLY 🛑 3 - // 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 4 - 5 - // @ts-nocheck 6 - /* eslint-disable */ 7 - export type CoercedEnvSchema = { 8 - /** 9 - * **TURSO_DATABASE_URL** 10 - * ![icon](data:image/svg+xml;utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23808080%22%20d%3D%22M24%2021V9h-2v14h8v-2zm-4-6v-4c0-1.103-.897-2-2-2h-6v14h2v-6h1.48l2.335%206h2.145l-2.333-6H18c1.103%200%202-.897%202-2m-6-4h4v4h-4zM8%2023H4c-1.103%200-2-.897-2-2V9h2v12h4V9h2v12c0%201.103-.897%202-2%202%22%2F%3E%3C%2Fsvg%3E) 11 - */ 12 - TURSO_DATABASE_URL: string; 13 - 14 - /** 15 - * **TURSO_AUTH_TOKEN** 🔐 _sensitive_ 16 - * ![icon](data:image/svg+xml;utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20fill%3D%22%23808080%22%20d%3D%22M29%2022h-5a2.003%202.003%200%200%201-2-2v-6a2%202%200%200%201%202-2h5v2h-5v6h5ZM18%2012h-4V8h-2v14h6a2.003%202.003%200%200%200%202-2v-6a2%202%200%200%200-2-2m-4%208v-6h4v6Zm-6-8H3v2h5v2H4a2%202%200%200%200-2%202v2a2%202%200%200%200%202%202h6v-8a2%202%200%200%200-2-2m0%208H4v-2h4Z%22%2F%3E%3C%2Fsvg%3E) 17 - */ 18 - TURSO_AUTH_TOKEN: string; 19 - }; 20 - 21 - declare module "varlock/env" { 22 - export interface TypedEnvSchema extends Readonly<CoercedEnvSchema> {} 23 - export interface PublicTypedEnvSchema extends Readonly< 24 - Pick<CoercedEnvSchema, "TURSO_DATABASE_URL"> 25 - > {} 26 - } 27 - 28 - export type EnvSchemaAsStrings = { 29 - [Property in keyof CoercedEnvSchema]: CoercedEnvSchema[Property] extends string 30 - ? CoercedEnvSchema[Property] 31 - : CoercedEnvSchema[Property] extends boolean 32 - ? "true" | "false" 33 - : string; 34 - }; 35 - 36 - declare global { 37 - // add types for global import.meta.env 38 - interface ImportMetaEnv extends EnvSchemaAsStrings {} 39 - interface ImportMeta { 40 - readonly env: ImportMetaEnv; 41 - } 42 - 43 - // add types for global process.env 44 - namespace NodeJS { 45 - interface ProcessEnv extends EnvSchemaAsStrings {} 46 - } 47 - }
+30
env.ts
··· 1 + import { createEnv } from "@t3-oss/env-core"; 2 + import * as v from "valibot"; 3 + 4 + export const env = createEnv({ 5 + server: { 6 + TURSO_DATABASE_URL: v.pipe(v.string(), v.url(), v.minLength(1)), 7 + TURSO_AUTH_TOKEN: v.pipe(v.string(), v.minLength(1)), 8 + }, 9 + 10 + /** 11 + * What object holds the environment variables at runtime. This is usually 12 + * `process.env` or `import.meta.env`. 13 + */ 14 + runtimeEnv: process.env, 15 + 16 + /** 17 + * By default, this library will feed the environment variables directly to 18 + * the Zod validator. 19 + * 20 + * This means that if you have an empty string for a value that is supposed 21 + * to be a number (e.g. `PORT=` in a ".env" file), Zod will incorrectly flag 22 + * it as a type mismatch violation. Additionally, if you have an empty string 23 + * for a value that is supposed to be a string with a default value (e.g. 24 + * `DOMAIN=` in an ".env" file), the default value will never be applied. 25 + * 26 + * In order to solve these issues, we recommend that all new projects 27 + * explicitly specify this option as true. 28 + */ 29 + emptyStringAsUndefined: true, 30 + });
+2 -4
package.json
··· 16 16 "@libsql/client": "^0.17.2", 17 17 "@radix-ui/react-label": "^2.1.8", 18 18 "@radix-ui/react-slot": "^1.2.4", 19 + "@t3-oss/env-core": "^0.13.11", 19 20 "@tailwindcss/vite": "^4.2.2", 20 21 "@tanstack/react-pacer": "^0.21.1", 21 22 "@tanstack/react-query": "^5.96.1", ··· 24 25 "@tanstack/react-router-devtools": "1.166.11", 25 26 "@tanstack/react-router-with-query": "1.130.17", 26 27 "@tanstack/react-start": "1.167.16", 27 - "@varlock/1password-plugin": "^0.3.2", 28 - "@varlock/vite-integration": "^0.2.8", 29 28 "class-variance-authority": "^0.7.1", 30 29 "clsx": "^2.1.1", 31 30 "drizzle-orm": "1.0.0-beta.20", ··· 34 33 "tailwind-merge": "^3.5.0", 35 34 "tailwindcss": "^4.2.2", 36 35 "tailwindcss-animate": "^1.0.7", 37 - "valibot": "^1.3.1", 38 - "varlock": "^0.7.0" 36 + "valibot": "^1.3.1" 39 37 }, 40 38 "devDependencies": { 41 39 "1password-cli": "^0.2.1",
+26 -3
pnpm-lock.yaml
··· 21 21 '@radix-ui/react-slot': 22 22 specifier: ^1.2.4 23 23 version: 1.2.4(@types/react@19.2.14)(react@19.2.4) 24 + '@t3-oss/env-core': 25 + specifier: ^0.13.11 26 + version: 0.13.11(typescript@6.0.2)(valibot@1.3.1(typescript@6.0.2))(zod@4.3.6) 24 27 '@tailwindcss/vite': 25 28 specifier: ^4.2.2 26 29 version: 4.2.2(@voidzero-dev/vite-plus-core@0.1.15(@types/node@25.5.0)(esbuild@0.27.5)(jiti@2.6.1)(tsx@4.21.0)(typescript@6.0.2)(yaml@2.8.3)) ··· 78 81 valibot: 79 82 specifier: ^1.3.1 80 83 version: 1.3.1(typescript@6.0.2) 81 - varlock: 82 - specifier: ^0.7.0 83 - version: 0.7.0 84 84 devDependencies: 85 85 1password-cli: 86 86 specifier: ^0.2.1 ··· 1962 1962 resolution: {integrity: sha512-lVJX6qEgs/4DOcRTpo56tmKzVPtoWAaVbL4hfO7t7NVwl9AAXzQR6cihesW1BmNMPl+bK6dreu2sOKBP2Q9CIA==} 1963 1963 peerDependencies: 1964 1964 acorn: ^8.9.0 1965 + 1966 + '@t3-oss/env-core@0.13.11': 1967 + resolution: {integrity: sha512-sM7GYY+KL7H/Hl0BE0inWfk3nRHZOLhmVn7sHGxaZt9FAR6KqREXAE+6TqKfiavfXmpRxO/OZ2QgKRd+oiBYRQ==} 1968 + peerDependencies: 1969 + arktype: ^2.1.0 1970 + typescript: '>=5.0.0' 1971 + valibot: ^1.0.0-beta.7 || ^1.0.0 1972 + zod: ^3.24.0 || ^4.0.0 1973 + peerDependenciesMeta: 1974 + arktype: 1975 + optional: true 1976 + typescript: 1977 + optional: true 1978 + valibot: 1979 + optional: true 1980 + zod: 1981 + optional: true 1965 1982 1966 1983 '@tailwindcss/node@4.2.2': 1967 1984 resolution: {integrity: sha512-pXS+wJ2gZpVXqFaUEjojq7jzMpTGf8rU6ipJz5ovJV6PUGmlJ+jvIwGrzdHdQ80Sg+wmQxUFuoW1UAAwHNEdFA==} ··· 6831 6848 '@sveltejs/acorn-typescript@1.0.9(acorn@8.16.0)': 6832 6849 dependencies: 6833 6850 acorn: 8.16.0 6851 + 6852 + '@t3-oss/env-core@0.13.11(typescript@6.0.2)(valibot@1.3.1(typescript@6.0.2))(zod@4.3.6)': 6853 + optionalDependencies: 6854 + typescript: 6.0.2 6855 + valibot: 1.3.1(typescript@6.0.2) 6856 + zod: 4.3.6 6834 6857 6835 6858 '@tailwindcss/node@4.2.2': 6836 6859 dependencies:
+3 -3
src/data/db.ts
··· 1 1 import { sql } from "drizzle-orm"; 2 2 import { drizzle } from "drizzle-orm/libsql"; 3 - import { ENV } from "varlock/env"; 3 + import { env } from "~env"; 4 4 import { relations } from "./relations.js"; 5 5 6 6 const db = drizzle({ 7 7 connection: { 8 - url: ENV.TURSO_DATABASE_URL, 9 - authToken: ENV.TURSO_AUTH_TOKEN, 8 + url: env.TURSO_DATABASE_URL, 9 + authToken: env.TURSO_AUTH_TOKEN, 10 10 }, 11 11 relations, 12 12 });
+3 -3
src/data/seed.ts
··· 1 1 import { readFileSync } from "node:fs"; 2 2 import { dirname, resolve } from "node:path"; 3 3 import { fileURLToPath } from "node:url"; 4 - import { ENV } from "varlock/env"; 4 + import { env } from "~env"; 5 5 import { drizzle } from "drizzle-orm/libsql"; 6 6 import * as schema from "./schema.js"; 7 7 ··· 29 29 30 30 const db = drizzle({ 31 31 connection: { 32 - url: ENV.TURSO_DATABASE_URL, 33 - authToken: ENV.TURSO_AUTH_TOKEN, 32 + url: env.TURSO_DATABASE_URL, 33 + authToken: env.TURSO_AUTH_TOKEN, 34 34 }, 35 35 schema, 36 36 });
+1
tsconfig.json
··· 21 21 "noFallthroughCasesInSwitch": true, 22 22 "noUncheckedSideEffectImports": true, 23 23 "paths": { 24 + "~env": ["./env.ts"], 24 25 "~/*": ["./src/*"], 25 26 "~drizzle/*": ["./drizzle/*"] 26 27 }
+1 -2
vite.config.ts
··· 2 2 import { defineConfig } from "vite-plus"; 3 3 import react from "@vitejs/plugin-react"; 4 4 import { tanstackStart } from "@tanstack/react-start/plugin/vite"; 5 - import { varlockVitePlugin } from "@varlock/vite-integration"; 6 5 import netlify from "@netlify/vite-plugin-tanstack-start"; 7 6 8 7 export default defineConfig({ ··· 19 18 server: { 20 19 port: 3000, 21 20 }, 22 - plugins: [varlockVitePlugin(), tanstackStart({}), netlify(), react(), tailwindcss()], 21 + plugins: [tanstackStart({}), netlify(), react(), tailwindcss()], 23 22 });