full site update
This commit is contained in:
21
node_modules/astro/dist/env/schema.js
generated
vendored
21
node_modules/astro/dist/env/schema.js
generated
vendored
@@ -64,11 +64,30 @@ const SecretServerEnvFieldMetadata = z.object({
|
||||
context: z.literal("server"),
|
||||
access: z.literal("secret")
|
||||
});
|
||||
const EnvFieldMetadata = z.union([
|
||||
const _EnvFieldMetadata = z.union([
|
||||
PublicClientEnvFieldMetadata,
|
||||
PublicServerEnvFieldMetadata,
|
||||
SecretServerEnvFieldMetadata
|
||||
]);
|
||||
const EnvFieldMetadata = z.custom().superRefine((data, ctx) => {
|
||||
const result = _EnvFieldMetadata.safeParse(data);
|
||||
if (result.success) {
|
||||
return;
|
||||
}
|
||||
for (const issue of result.error.issues) {
|
||||
if (issue.code === z.ZodIssueCode.invalid_union) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: `**Invalid combination** of "access" and "context" options:
|
||||
Secret client variables are not supported. Please review the configuration of \`env.schema.${ctx.path.at(-1)}\`.
|
||||
Learn more at https://docs.astro.build/en/guides/environment-variables/#variable-types`,
|
||||
path: ["context", "access"]
|
||||
});
|
||||
} else {
|
||||
ctx.addIssue(issue);
|
||||
}
|
||||
}
|
||||
});
|
||||
const EnvSchemaKey = z.string().min(1).refine(([firstChar]) => isNaN(Number.parseInt(firstChar)), {
|
||||
message: "A valid variable name cannot start with a number."
|
||||
}).refine((str) => /^[A-Z0-9_]+$/.test(str), {
|
||||
|
Reference in New Issue
Block a user