diff --git a/.gitignore b/.gitignore index 016b59e..cf3d2e9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,9 +13,8 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* -# environment variables +# prod environment variables .env -.env.production # macOS-specific files .DS_Store diff --git a/astro.config.mjs b/astro.config.mjs index 37f396a..12087a7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,25 +1,52 @@ import htmx from "astro-htmx"; // @ts-check -import { defineConfig } from "astro/config"; +import { defineConfig, envField } from "astro/config"; import alpinejs from "@astrojs/alpinejs"; -import partytown from "@astrojs/partytown"; import sitemap from "@astrojs/sitemap"; import bun from "@nurodev/astro-bun"; +import db from "@astrojs/db"; // https://astro.build/config export default defineConfig({ site: "https://badblocks.dev", + trailingSlash: "never", adapter: bun(), output: "static", - integrations: [ - alpinejs(), - partytown(), - sitemap(), - htmx(), - // sitemap({ - // filter: (page) => - // page !== "https://example.com/secret-vip-lounge-1/" && - // page !== "https://example.com/secret-vip-lounge-2/", - // }), - ], + devToolbar: { enabled: false }, + prefetch: { + prefetchAll: true, + }, + security: { + checkOrigin: true, + }, + server: { + host: true, + port: 4321, + }, + env: { + schema: { + ANDROID_SMS_GATEWAY_LOGIN: envField.string({ + context: "server", + access: "secret", + }), + ANDROID_SMS_GATEWAY_PASSWORD: envField.string({ + context: "server", + access: "secret", + }), + ANDROID_SMS_GATEWAY_RECIPIENT_PHONE: envField.string({ + context: "server", + access: "secret", + }), + ANDROID_SMS_GATEWAY_URL: envField.string({ + context: "server", + access: "secret", + }), + }, + }, + integrations: [alpinejs(), sitemap(), htmx(), db()], + experimental: { + preserveScriptOrder: true, + chromeDevtoolsWorkspace: true, + failOnPrerenderConflict: true, + }, }); diff --git a/bun.lockb b/bun.lockb index 8c6d14d..25bfd62 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 74aa1f6..9b4f6c5 100644 --- a/package.json +++ b/package.json @@ -5,20 +5,30 @@ "scripts": { "dev": "astro dev", "start": "bun run ./dist/server/entry.mjs", - "build": "astro build", + "check": "astro check", + "build-only": "astro build", + "build": "astro check && astro build", + "build-remote": "astro check && astro build --remote", "preview": "astro preview", "astro": "astro" }, "dependencies": { "@astrojs/alpinejs": "^0.4.9", + "@astrojs/check": "^0.9.6", + "@astrojs/db": "^0.18.3", "@astrojs/partytown": "^2.1.4", "@astrojs/sitemap": "^3.6.0", + "@astrojs/ts-plugin": "^1.10.6", + "@cap.js/server": "^4.0.5", + "@cap.js/widget": "^0.1.33", "@nurodev/astro-bun": "^2.1.2", "@types/alpinejs": "^3.13.11", "alpinejs": "^3.15.3", + "android-sms-gateway": "^3.0.0", "astro": "^5.16.6", "astro-htmx": "^1.0.6", - "htmx.org": "^2.0.8" + "htmx.org": "^2.0.8", + "typescript": "^5.9.3" }, "devDependencies": { "@types/bun": "^1.3.5" diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 0672a9b..8ad9dcb 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -13,6 +13,12 @@ href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet" /> +

Contact

-

Use the below form to shoot me a quick text!

-
+ {!success && +
+

Use the below form to shoot me a quick text!

+ {errors.form &&

{errors.form}

} +
+ -
+ ||

Your message has been sent successfully!

}
diff --git a/src/pages/index.astro b/src/pages/index.astro index 99cc513..23927f6 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,5 +1,5 @@ --- -import Layout from "../layouts/BaseLayout.astro"; +import Layout from "@layouts/BaseLayout.astro"; --- diff --git a/src/pages/tools.astro b/src/pages/tools.astro index ad02ef6..d22833b 100644 --- a/src/pages/tools.astro +++ b/src/pages/tools.astro @@ -1,5 +1,5 @@ --- -import Layout from "../layouts/BaseLayout.astro"; +import Layout from "@layouts/BaseLayout.astro"; --- diff --git a/tsconfig.json b/tsconfig.json index 8bf91d3..504ae34 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,18 @@ { - "extends": "astro/tsconfigs/strict", + "extends": "astro/tsconfigs/strictest", "include": [".astro/types.d.ts", "**/*"], - "exclude": ["dist"] + "exclude": ["dist"], + "compilerOptions": { + "verbatimModuleSyntax": true, + "paths": { + "@components/*": ["./src/components/*"], + "@layouts/*": ["./src/layouts/*"], + "@lib/*": ["./src/lib/*"], + }, + "plugins": [ + { + "name": "@astrojs/ts-plugin", + }, + ], + }, }