This commit is contained in:
Adam Matthiesen 2024-01-25 09:48:29 -08:00
parent 1b67aa5ab3
commit 5aad1e7fb3
5 changed files with 21 additions and 25 deletions

View File

@ -53,7 +53,7 @@ const ENV = loadEnv(IC.MODE, process.cwd(), IC.PREFIXES);
/** Astro-GhostCMS Integration
* @ For more information and to see the docs check
* @ https://astro-ghostcms.xyz
* @see https://astro-ghostcms.xyz
*/
export default function GhostCMS(options: UserConfig): AstroIntegration {
return {

View File

@ -4,6 +4,11 @@ const prefix: string = 'Invariant failed';
// Throw an error if the condition fails
// Strip out error messages for production
// > Not providing an inline default argument for message as the result is smaller
/** Throw an error if the condition is false
* @example
* import { invariant } from '@matthiesenxyz/astro-ghostcms/api';
* invariant(var, "var is false but its not supposed to be!")
*/
export function invariant(
// biome-ignore lint/suspicious/noExplicitAny: we know what we are doing
condition: any,

View File

@ -18,17 +18,18 @@ const RobotsPolicySchema = z.object({
})
export const RobotsTxtSchema = z.object({
/** EXAMPLE1 host: true - automatically resolve using the site option from Astro config
* EXAMPLE2 host: 'example.com'
/** @example host: true
* // Automatically resolve using the site option from Astro config
* @example host: 'example.com'
*/
host: z.string().optional(),
/** EXAMPLE1 sitemap: "https://example.com/sitemap-0.xml"
* EXAMPLE2 sitemap: ['https://example.com/sitemap-0.xml','https://example.com/sitemap-1.xml']
* EXAMPLE3 sitemap: false - If you want to get the robots.txt file without the Sitemap: ... entry, set the sitemap parameter to false.
/** @example sitemap: "https://example.com/sitemap-0.xml"
* @example sitemap: ['https://example.com/sitemap-0.xml','https://example.com/sitemap-1.xml']
* @example sitemap: false - If you want to get the robots.txt file without the Sitemap: ... entry, set the sitemap parameter to false.
*/
sitemap: z.string().optional(),
/** astrojs/sitemap and astro-sitemap integrations have the sitemap-index.xml as their primary output. That is why the default value of sitemapBaseFileName is set to sitemap-index.
* EXAMPLE sitemapBaseFileName: 'custom-sitemap'
* @example sitemapBaseFileName: 'custom-sitemap'
*/
sitemapBaseFileName: z.string().optional(),
/** SET POLICY RULES */

View File

@ -1,12 +1,12 @@
import { z } from "astro/zod";
export const SitemapSchema = z.object({
/** EXAMPLE: ['https://example-1.com', 'https://example-2.com]
* REFERENCE https://docs.astro.build/en/guides/integrations-guide/sitemap/#custompages
/** @example ['https://example-1.com', 'https://example-2.com]
* @see https://docs.astro.build/en/guides/integrations-guide/sitemap/#custompages
*/
customPages: z.string().array().optional(),
/** EXAMPLE: 10000
* REFERENCE https://docs.astro.build/en/guides/integrations-guide/sitemap/#entrylimit
/** @example 10000
* @see https://docs.astro.build/en/guides/integrations-guide/sitemap/#entrylimit
*/
entryLimit: z.number().optional()
})

View File

@ -18,10 +18,10 @@ importers:
demo:
dependencies:
'@matthiesenxyz/astro-ghostcms':
specifier: 3.1.2
specifier: 3.1.3
version: link:../packages/astro-ghostcms
'@matthiesenxyz/astro-ghostcms-theme-default':
specifier: 0.1.2
specifier: 0.1.3
version: link:../packages/astro-ghostcms-theme-default
astro:
specifier: ^4.2.4
@ -43,7 +43,7 @@ importers:
specifier: ^3.0.5
version: 3.0.5
'@matthiesenxyz/astro-ghostcms-theme-default':
specifier: ^0.1.1
specifier: ^0.1.3
version: link:../astro-ghostcms-theme-default
'@ts-ghost/core-api':
specifier: ^5.1.2
@ -54,9 +54,6 @@ importers:
astro-robots-txt:
specifier: ^1.0.0
version: 1.0.0
tiny-invariant:
specifier: ^1.3.1
version: 1.3.1
vite:
specifier: ^5.0.12
version: 5.0.12(@types/node@20.11.6)
@ -119,7 +116,7 @@ importers:
packages/astro-ghostcms-theme-default:
dependencies:
'@matthiesenxyz/astro-ghostcms':
specifier: ^3.1.2
specifier: ^3.1.3
version: link:../astro-ghostcms
astro:
specifier: ^4.2.1
@ -127,9 +124,6 @@ importers:
astro-font:
specifier: ^0.0.77
version: 0.0.77
tiny-invariant:
specifier: ^1.3.1
version: 1.3.1
devDependencies:
'@astrojs/check':
specifier: ^0.4.1
@ -6818,10 +6812,6 @@ packages:
any-promise: 1.3.0
dev: true
/tiny-invariant@1.3.1:
resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
dev: false
/tinybench@2.6.0:
resolution: {integrity: sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==}
dev: true