diff --git a/README.md b/README.md
index e2e5a4b8..12041948 100644
--- a/README.md
+++ b/README.md
@@ -115,10 +115,10 @@ pnpm dev --filter=usehooks-ts # jest --watch
pnpm dev --filter=www # next dev
# Develop
+pnpm build
pnpm lint
pnpm types-check
pnpm test
-pnpm build
```
### How is structured a hook ?
diff --git a/apps/www/.gitignore b/apps/www/.gitignore
index ccac3db4..f898b899 100644
--- a/apps/www/.gitignore
+++ b/apps/www/.gitignore
@@ -8,12 +8,13 @@
# testing
/coverage
-# next.js
+# generated
/.next/
/out/
-
-# production
/build
+generated
+public/sitemap.xml
+public/robots.txt
# misc
.DS_Store
@@ -34,5 +35,4 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
-.contentlayer
-generated
+
diff --git a/apps/www/env.mjs b/apps/www/env.mjs
index 17b08bbc..1bdd48a8 100644
--- a/apps/www/env.mjs
+++ b/apps/www/env.mjs
@@ -4,7 +4,7 @@ import { z } from 'zod'
export const env = createEnv({
server: {},
client: {
- NEXT_PUBLIC_GA_MEASUREMENT_ID: z.string(),
+ NEXT_PUBLIC_GA_MEASUREMENT_ID: z.string().optional().default(''),
},
runtimeEnv: {
NEXT_PUBLIC_GA_MEASUREMENT_ID: process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID,
diff --git a/apps/www/package.json b/apps/www/package.json
index 1347520d..8c512420 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -33,7 +33,7 @@
"tailwind-merge": "^1.12.0",
"tailwindcss": "3.3.2",
"tailwindcss-animate": "^1.0.5",
- "usehooks-ts": "*",
+ "usehooks-ts": "workspace:*",
"zod": "^3.21.4"
},
"devDependencies": {
@@ -44,7 +44,7 @@
"@types/react-dom": "18.2.4",
"autoprefixer": "10.4.14",
"eslint": "8.41.0",
- "eslint-config-custom": "*",
+ "eslint-config-custom": "workspace:*",
"eslint-config-next": "13.4.4",
"next-sitemap": "^4.0.7",
"postcss": "8.4.24",
diff --git a/apps/www/public/robots.txt b/apps/www/public/robots.txt
deleted file mode 100644
index 4018307c..00000000
--- a/apps/www/public/robots.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# *
-User-agent: *
-Allow: /
-
-# Host
-Host: https://usehooks-ts.com
-
-# Sitemaps
-Sitemap: https://usehooks-ts.com/sitemap.xml
diff --git a/apps/www/public/sitemap.xml b/apps/www/public/sitemap.xml
deleted file mode 100644
index 7c61489a..00000000
--- a/apps/www/public/sitemap.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-https://usehooks-ts.com2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/introduction2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-boolean2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-click-any-where2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-copy-to-clipboard2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-countdown2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-counter2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-dark-mode2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-debounce2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-document-title2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-effect-once2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-element-size2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-event-listener2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-fetch2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-hover2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-image-on-load2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-intersection-observer2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-interval2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-is-client2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-is-first-render2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-is-mounted2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-local-storage2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-locked-body2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-map2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-media-query2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-on-click-outside2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-read-local-storage2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-screen2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-script2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-session-storage2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-ssr2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-step2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-ternary-dark-mode2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-timeout2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-toggle2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-update-effect2023-05-31T02:56:27.390Zdaily0.7
-https://usehooks-ts.com/react-hook/use-window-size2023-05-31T02:56:27.390Zdaily0.7
-
\ No newline at end of file
diff --git a/apps/www/src/components/analytics.tsx b/apps/www/src/components/analytics.tsx
index bd4ac95a..c29c33e9 100644
--- a/apps/www/src/components/analytics.tsx
+++ b/apps/www/src/components/analytics.tsx
@@ -4,6 +4,11 @@ import Script from 'next/script'
export function Analytics() {
const GA_MEASUREMENT_ID = process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID
+
+ if (!GA_MEASUREMENT_ID) {
+ return null
+ }
+
return (
<>