Skip to content

Commit

Permalink
chore: add zode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabb-c committed Apr 3, 2024
1 parent a1de301 commit e0920ba
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 168 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"organizeImports": {
"enabled": true
},
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/assets/siteLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions docs/.vitepress/components/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { h } from 'vue'
import Theme from 'vitepress/theme'
import Theme from "vitepress/theme";
import { h } from "vue";

import ReloadPrompt from './components/ReloadPrompt.vue'
import ReloadPrompt from "./components/ReloadPrompt.vue";

export default {
...Theme,
Layout() {
return h(Theme.Layout, null, {
'layout-bottom': () => h(ReloadPrompt)
})
}
}
"layout-bottom": () => h(ReloadPrompt),
});
},
};
9 changes: 4 additions & 5 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import { SOCIAL_LINKS } from "./social-links";

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import * as dotenv from "dotenv";

dotenv.config();
import { ENV_VARIABLES } from "../../env";

const readSvg = (fileName: string): string =>
readFileSync(resolve(`./docs/.vitepress/assets/${fileName}`), "utf-8");
Expand Down Expand Up @@ -52,9 +51,9 @@ export default defineConfig({
search: {
provider: "algolia",
options: {
apiKey: process.env.API_KEY as string,
appId: process.env.APP_ID as string,
indexName: process.env.INDEX_NAME as string,
apiKey: ENV_VARIABLES.API_KEY,
appId: ENV_VARIABLES.APP_ID,
indexName: ENV_VARIABLES.INDEX_NAME,
},
},
},
Expand Down
15 changes: 15 additions & 0 deletions env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { z } from "zod";

export const ENV_SCHEMA = z.object({
API_KEY: z.string(),
APP_ID: z.string(),
INDEX_NAME: z.string(),
} as const);

declare global {
namespace NodeJS {
interface ProcessEnv extends z.infer<typeof ENV_SCHEMA> {}
}
}

export const ENV_VARIABLES = ENV_SCHEMA.parse(process.env);
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"devDependencies": {
"@algolia/client-search": "^4.23.2",
"@biomejs/biome": "^1.6.3",
"@biomejs/biome": "^1.6.4",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@semantic-release/changelog": "^6.0.3",
Expand All @@ -62,26 +62,25 @@
"@size-limit/preset-small-lib": "^11.1.2",
"@swc/core": "^1.4.11",
"@types/is-ci": "^3.0.4",
"@types/node": "^20.11.30",
"@types/node": "^20.12.3",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/ui": "^1.4.0",
"axios": "^1.6.8",
"axios-cache-interceptor": "^1.5.1",
"ci-info": "^4.0.0",
"dotenv": "^16.4.5",
"http-status-codes": "^2.3.0",
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"semantic-release": "^23.0.6",
"size-limit": "^11.1.2",
"sort-package-json": "^2.9.0",
"tsup": "^8.0.2",
"typescript": "^5.4.3",
"vite-tsconfig-paths": "^4.3.2",
"vitepress": "1.0.1",
"vitepress": "1.0.2",
"vitest": "^1.4.0",
"vue": "^3.4.21"
"vue": "^3.4.21",
"zod": "^3.22.4"
},
"peerDependencies": {
"axios": "^1.6.8",
Expand Down
Loading

0 comments on commit e0920ba

Please sign in to comment.