Merge pull request #176 from bknd-io/chores/repo-cleanup

repo chores: fixed root dir, removed unused class, added .env.example
This commit is contained in:
dswbx
2025-05-27 20:27:38 +02:00
committed by GitHub
5 changed files with 100 additions and 78 deletions

42
app/.env.example Normal file
View File

@@ -0,0 +1,42 @@
# ===== DB Settings =====
VITE_DB_URL=:memory:
# you can set a location for a database here, it'll overwrite the previous setting
# ideally use the ".db" folder (create it first), it's git ignored
VITE_DB_URL=file:.db/dev.db
# alternatively, you can use url/token combination
#VITE_DB_URL=
#VITE_DB_TOKEN=
# ===== DEV Server =====
# restart the dev server on every change (enable with "1")
VITE_APP_FRESH=
# displays react-scan widget (enable with "1")
VITE_DEBUG_RERENDERS=
# console logs registered routes on start (enable with "1")
VITE_SHOW_ROUTES=
# ===== Test Credentials =====
RESEND_API_KEY=
R2_TOKEN=
R2_ACCESS_KEY=
R2_SECRET_ACCESS_KEY=
R2_URL=
AWS_ACCESS_KEY=
AWS_SECRET_KEY=
AWS_S3_URL=
OAUTH_CLIENT_ID=
OAUTH_CLIENT_SECRET=
PUBLIC_POSTHOG_KEY=
PUBLIC_POSTHOG_HOST=
# ===== Internals =====
BKND_CLI_CREATE_REF=main
BKND_CLI_LOG_LEVEL=debug
BKND_MODULES_DEBUG=1

View File

@@ -1,29 +0,0 @@
import type { Env, Input, MiddlewareHandler, ValidationTargets } from "hono";
import { validator } from "hono/validator";
import type { Static, TSchema } from "simple-jsonschema-ts";
export const honoValidator = <
Target extends keyof ValidationTargets,
E extends Env,
P extends string,
const Schema extends TSchema = TSchema,
Out = Static<Schema>,
I extends Input = {
in: { [K in Target]: Static<Schema> };
out: { [K in Target]: Static<Schema> };
},
>(
target: Target,
schema: Schema,
): MiddlewareHandler<E, P, I> => {
// @ts-expect-error not typed well
return validator(target, async (value, c) => {
const coersed = schema.coerce(value);
const result = schema.validate(coersed);
if (!result.valid) {
return c.json({ ...result, schema }, 400);
}
return coersed as Out;
});
};

View File

@@ -1,5 +1,11 @@
{
"extends": "./tsconfig.json",
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"exclude": ["./node_modules", "./__test__", "./e2e"]
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"rootDir": "./src",
"baseUrl": ".",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"exclude": ["./node_modules", "./__test__", "./e2e"]
}

View File

@@ -1,47 +1,47 @@
{
"compilerOptions": {
"types": ["bun-types", "@cloudflare/workers-types"],
"composite": false,
"incremental": true,
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"allowImportingTsExtensions": false,
"target": "ES2022",
"noImplicitAny": false,
"allowJs": true,
"verbatimModuleSyntax": true,
"declaration": true,
"strict": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": false,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"isolatedModules": true,
"esModuleInterop": true,
"skipLibCheck": true,
"rootDir": "./src",
"outDir": "./dist/types",
"baseUrl": ".",
"paths": {
"*": ["./src/*"],
"bknd": ["./src/*"]
}
},
"include": [
"./src/**/*.ts",
"./src/**/*.tsx",
"vite.dev.ts",
"build.ts",
"build.cli.ts",
"__test__",
"e2e/**/*.ts"
],
"exclude": ["node_modules", "dist", "dist/types", "**/*.d.ts"]
"compilerOptions": {
"types": ["bun-types", "@cloudflare/workers-types"],
"composite": false,
"incremental": true,
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"allowImportingTsExtensions": false,
"target": "ES2022",
"noImplicitAny": false,
"allowJs": true,
"verbatimModuleSyntax": true,
"declaration": true,
"strict": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": false,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"isolatedModules": true,
"esModuleInterop": true,
"skipLibCheck": true,
"rootDir": ".",
"baseUrl": ".",
"outDir": "./dist/types",
"paths": {
"*": ["./src/*"],
"bknd": ["./src/*"]
}
},
"include": [
"./src/**/*.ts",
"./src/**/*.tsx",
"vite.dev.ts",
"build.ts",
"build.cli.ts",
"__test__",
"e2e/**/*.ts"
],
"exclude": ["node_modules", "dist", "dist/types", "**/*.d.ts"]
}

View File

@@ -23,7 +23,10 @@ export default defineConfig({
},
plugins: [
react(),
tsconfigPaths(),
tsconfigPaths({
// otherwise it'll throw an error because of examples/astro
ignoreConfigErrors: true,
}),
devServer({
...devServerConfig,
entry: "./vite.dev.ts",