Skip to content

Commit 899d019

Browse files
committed
omit plausible url from server schema
1 parent 011e609 commit 899d019

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.refine(
2+
(data) => {
3+
if (data.NODE_ENV === 'production') return Boolean(data.PLAUSIBLE_SCRIPT_URL);
4+
return true;
5+
},
6+
{
7+
message: 'PLAUSIBLE_SCRIPT_URL is required in production',
8+
path: ['PLAUSIBLE_SCRIPT_URL'],
9+
}
10+
);

docs/working-notes/todo3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,5 +530,6 @@ folder name for slug and index.mdx and images
530530
// plausible
531531
<script defer data-domain="nemanjamitic.com" src="https://plausible.arm1.nemanjamitic.com/js/script.js"></script>
532532
add zod schema that checks node_env for plausible_url instead of optional
533+
moze samo za 1 url data-domain="nemanjamitic.com"
533534
------------
534535
```

src/schemas/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const processEnvSchema = z.object({
1818
});
1919

2020
export const configServerSchema = processEnvSchema
21-
.omit({ SITE_URL: true, PREVIEW_MODE: true })
21+
.omit({ SITE_URL: true, PREVIEW_MODE: true, PLAUSIBLE_SCRIPT_URL: true })
2222
.extend({ PREVIEW_MODE: z.boolean() }); // here its boolean, not 'true' | 'false'
2323

2424
export const configClientSchema = processEnvSchema

0 commit comments

Comments
 (0)