From 8db7190be8933eaeaf5bc408c4d35a8ac5fc7592 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Sun, 3 Mar 2024 05:17:54 -0800 Subject: [PATCH] First group of progress changes... and it works --- package.json | 2 +- packages/astro-ghostcms/.env.demo | 2 - packages/astro-ghostcms/CHANGELOG.md | 2 +- packages/astro-ghostcms/LICENSE | 2 +- packages/astro-ghostcms/README.md | 1 - packages/astro-ghostcms/index.ts | 359 ----------- packages/astro-ghostcms/package.json | 176 ++--- .../src/api/content-api/content-api.test.ts | 84 --- .../src/api/content-api/content-api.ts | 116 ---- .../src/api/content-api/index.ts | 8 - .../schemas/authors/authors.test.ts | 164 ----- .../api/content-api/schemas/authors/index.ts | 1 - .../api/content-api/schemas/helpers/index.ts | 1 - .../api/content-api/schemas/pages/index.ts | 1 - .../api/content-api/schemas/posts/index.ts | 1 - .../content-api/schemas/posts/posts.test.ts | 69 -- .../api/content-api/schemas/settings/index.ts | 1 - .../src/api/content-api/schemas/tags/index.ts | 1 - .../api/content-api/schemas/tiers/index.ts | 1 - .../src/api/{api-functions.ts => ghostAPI.ts} | 10 +- packages/astro-ghostcms/src/api/index.ts | 5 +- .../astro-ghostcms/src/api/invariant.test.ts | 32 - packages/astro-ghostcms/src/api/invariant.ts | 3 +- packages/astro-ghostcms/src/astro-ghostcms.ts | 170 +++++ packages/astro-ghostcms/src/index.ts | 3 + .../src/integrations/robots-txt.ts | 28 - .../rssfeed/astro-ghostcms-rss.ts | 48 ++ .../src/integrations/rssfeed/index.ts | 3 + .../rssfeed/routes}/rss-style.xsl.ts | 2 +- .../rssfeed/routes}/rss.xml.ts | 4 +- .../satoriog/astro-ghostcms-satoriog.ts | 73 +++ .../src/integrations/satoriog/index.ts | 3 + .../satoriog/routes}/[slug].png.ts | 6 +- .../satoriog/routes}/author/[slug].png.ts | 6 +- .../satoriog/routes}/authors.png.ts | 6 +- .../satoriog/routes}/index.png.ts | 6 +- .../satoriog/routes}/tag/[slug].png.ts | 6 +- .../satoriog/routes}/tags.png.ts | 6 +- .../src/integrations/{ => satoriog}/satori.ts | 4 +- .../integrations/satoriog}/types.d.ts | 21 +- .../src/integrations/sitemap.ts | 38 -- .../astro-ghostcms-themeprovider.ts | 81 +++ .../src/integrations/themeprovider/index.ts | 3 + .../src/integrations/virtual-config.ts | 6 - .../src/integrations/virtual.d.ts | 4 - .../{default-routes/404 => routes}/404.astro | 2 +- .../{default-routes/404 => routes}/404.css | 0 .../authors => schemas/api}/authors.ts | 4 +- .../schemas => schemas/api}/index.ts | 4 +- .../schemas/pages => schemas/api}/pages.ts | 8 +- .../schemas/posts => schemas/api}/posts.ts | 8 +- .../settings => schemas/api}/settings.ts | 4 +- .../helpers => schemas/api}/socials.ts | 2 +- .../schemas/tags => schemas/api}/tags.ts | 4 +- .../schemas/tiers => schemas/api}/tiers.ts | 4 +- packages/astro-ghostcms/src/schemas/index.ts | 3 - .../astro-ghostcms/src/schemas/userconfig.ts | 53 +- .../src/utils/add-virtual-import.test.ts | 82 --- .../src/utils/add-virtual-import.ts | 93 --- .../src/utils/add-vite-plugin.test.ts | 69 -- .../src/utils/add-vite-plugin.ts | 55 -- .../astro-ghostcms/src/utils/latestVersion.ts | 26 - .../utils/zod-validation/ValidationError.js | 22 - .../src/utils/zod-validation/config.js | 5 - .../src/utils/zod-validation/errorMap.js | 10 - .../src/utils/zod-validation/fromZodError.js | 37 -- .../src/utils/zod-validation/fromZodIssue.js | 61 -- .../src/utils/zod-validation/index.js | 7 - .../utils/zod-validation/isValidationError.js | 4 - .../zod-validation/isValidationErrorLike.js | 3 - .../src/utils/zod-validation/prefixMessage.js | 13 - .../utils/zod-validation/toValidationError.js | 14 - .../zod-validation/utils/NonEmptyArray.js | 3 - .../utils/zod-validation/utils/joinPath.js | 22 - packages/astro-ghostcms/vitest.config.ts | 15 - playground/.env | 2 - playground/src/env.d.ts | 1 - playgrounds/astro-playground/.env | 1 + .../astro-playground}/.gitignore | 0 .../astro-playground}/.vscode/extensions.json | 0 .../astro-playground}/.vscode/launch.json | 0 .../astro-playground}/CHANGELOG.md | 0 .../astro-playground}/LICENSE | 0 .../astro-playground}/README.md | 0 .../astro-playground}/astro.config.mjs | 8 +- .../astro-playground}/package.json | 6 +- .../astro-playground}/public/favicon.svg | 0 playgrounds/astro-playground/src/env.d.ts | 3 + .../astro-playground}/tailwind.config.cjs | 0 .../astro-playground}/tsconfig.json | 0 .../astro-playground}/uno.config.ts | 0 .../starlight-playground}/.gitignore | 0 .../.vscode/extensions.json | 0 .../starlight-playground}/.vscode/launch.json | 0 .../starlight-playground}/astro.config.mjs | 0 .../starlight-playground}/package.json | 0 .../starlight-playground}/public/favicon.svg | 0 .../src/assets/houston.webp | Bin .../src/content/config.ts | 0 .../src/content/docs/guides/example.md | 0 .../src/content/docs/index.mdx | 0 .../src/content/docs/reference/example.md | 0 .../starlight-playground}/src/env.d.ts | 0 .../starlight-playground}/tsconfig.json | 0 pnpm-lock.yaml | 605 ++++++++++++------ pnpm-workspace.yaml | 3 +- 106 files changed, 944 insertions(+), 1891 deletions(-) delete mode 100644 packages/astro-ghostcms/.env.demo delete mode 100644 packages/astro-ghostcms/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/content-api.test.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/content-api.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.test.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/authors/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/helpers/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/pages/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/posts/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.test.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/settings/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/tags/index.ts delete mode 100644 packages/astro-ghostcms/src/api/content-api/schemas/tiers/index.ts rename packages/astro-ghostcms/src/api/{api-functions.ts => ghostAPI.ts} (90%) delete mode 100644 packages/astro-ghostcms/src/api/invariant.test.ts create mode 100644 packages/astro-ghostcms/src/astro-ghostcms.ts create mode 100644 packages/astro-ghostcms/src/index.ts delete mode 100644 packages/astro-ghostcms/src/integrations/robots-txt.ts create mode 100644 packages/astro-ghostcms/src/integrations/rssfeed/astro-ghostcms-rss.ts create mode 100644 packages/astro-ghostcms/src/integrations/rssfeed/index.ts rename packages/astro-ghostcms/src/{default-routes => integrations/rssfeed/routes}/rss-style.xsl.ts (99%) rename packages/astro-ghostcms/src/{default-routes => integrations/rssfeed/routes}/rss.xml.ts (90%) create mode 100644 packages/astro-ghostcms/src/integrations/satoriog/astro-ghostcms-satoriog.ts create mode 100644 packages/astro-ghostcms/src/integrations/satoriog/index.ts rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/[slug].png.ts (96%) rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/author/[slug].png.ts (96%) rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/authors.png.ts (96%) rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/index.png.ts (96%) rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/tag/[slug].png.ts (96%) rename packages/astro-ghostcms/src/{default-routes/open-graph => integrations/satoriog/routes}/tags.png.ts (96%) rename packages/astro-ghostcms/src/integrations/{ => satoriog}/satori.ts (98%) rename packages/astro-ghostcms/{ => src/integrations/satoriog}/types.d.ts (63%) delete mode 100644 packages/astro-ghostcms/src/integrations/sitemap.ts create mode 100644 packages/astro-ghostcms/src/integrations/themeprovider/astro-ghostcms-themeprovider.ts create mode 100644 packages/astro-ghostcms/src/integrations/themeprovider/index.ts delete mode 100644 packages/astro-ghostcms/src/integrations/virtual-config.ts delete mode 100644 packages/astro-ghostcms/src/integrations/virtual.d.ts rename packages/astro-ghostcms/src/{default-routes/404 => routes}/404.astro (88%) rename packages/astro-ghostcms/src/{default-routes/404 => routes}/404.css (100%) rename packages/astro-ghostcms/src/{api/content-api/schemas/authors => schemas/api}/authors.ts (95%) rename packages/astro-ghostcms/src/{api/content-api/schemas => schemas/api}/index.ts (71%) rename packages/astro-ghostcms/src/{api/content-api/schemas/pages => schemas/api}/pages.ts (92%) rename packages/astro-ghostcms/src/{api/content-api/schemas/posts => schemas/api}/posts.ts (93%) rename packages/astro-ghostcms/src/{api/content-api/schemas/settings => schemas/api}/settings.ts (91%) rename packages/astro-ghostcms/src/{api/content-api/schemas/helpers => schemas/api}/socials.ts (99%) rename packages/astro-ghostcms/src/{api/content-api/schemas/tags => schemas/api}/tags.ts (96%) rename packages/astro-ghostcms/src/{api/content-api/schemas/tiers => schemas/api}/tiers.ts (96%) delete mode 100644 packages/astro-ghostcms/src/schemas/index.ts delete mode 100644 packages/astro-ghostcms/src/utils/add-virtual-import.test.ts delete mode 100644 packages/astro-ghostcms/src/utils/add-virtual-import.ts delete mode 100644 packages/astro-ghostcms/src/utils/add-vite-plugin.test.ts delete mode 100644 packages/astro-ghostcms/src/utils/add-vite-plugin.ts delete mode 100644 packages/astro-ghostcms/src/utils/latestVersion.ts delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/ValidationError.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/config.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/errorMap.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/fromZodError.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/fromZodIssue.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/index.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/isValidationError.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/isValidationErrorLike.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/prefixMessage.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/toValidationError.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/utils/NonEmptyArray.js delete mode 100644 packages/astro-ghostcms/src/utils/zod-validation/utils/joinPath.js delete mode 100644 packages/astro-ghostcms/vitest.config.ts delete mode 100644 playground/.env delete mode 100644 playground/src/env.d.ts create mode 100644 playgrounds/astro-playground/.env rename {playground => playgrounds/astro-playground}/.gitignore (100%) rename {playground => playgrounds/astro-playground}/.vscode/extensions.json (100%) rename {playground => playgrounds/astro-playground}/.vscode/launch.json (100%) rename {playground => playgrounds/astro-playground}/CHANGELOG.md (100%) rename {playground => playgrounds/astro-playground}/LICENSE (100%) rename {playground => playgrounds/astro-playground}/README.md (100%) rename {playground => playgrounds/astro-playground}/astro.config.mjs (71%) rename {playground => playgrounds/astro-playground}/package.json (79%) rename {playground => playgrounds/astro-playground}/public/favicon.svg (100%) create mode 100644 playgrounds/astro-playground/src/env.d.ts rename {playground => playgrounds/astro-playground}/tailwind.config.cjs (100%) rename {playground => playgrounds/astro-playground}/tsconfig.json (100%) rename {playground => playgrounds/astro-playground}/uno.config.ts (100%) rename {starlight-playground => playgrounds/starlight-playground}/.gitignore (100%) rename {starlight-playground => playgrounds/starlight-playground}/.vscode/extensions.json (100%) rename {starlight-playground => playgrounds/starlight-playground}/.vscode/launch.json (100%) rename {starlight-playground => playgrounds/starlight-playground}/astro.config.mjs (100%) rename {starlight-playground => playgrounds/starlight-playground}/package.json (100%) rename {starlight-playground => playgrounds/starlight-playground}/public/favicon.svg (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/assets/houston.webp (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/content/config.ts (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/content/docs/guides/example.md (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/content/docs/index.mdx (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/content/docs/reference/example.md (100%) rename {starlight-playground => playgrounds/starlight-playground}/src/env.d.ts (100%) rename {starlight-playground => playgrounds/starlight-playground}/tsconfig.json (100%) diff --git a/package.json b/package.json index ad52c7b5..04ff3b53 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "node": ">=18.19.0" }, "scripts": { - "dev": "pnpm --filter playground dev", + "astro:dev": "pnpm --filter astro-playground dev", "starlight:dev": "pnpm --filter starlight-playground dev", "lint": "biome check .", "lint:fix": "biome check --apply .", diff --git a/packages/astro-ghostcms/.env.demo b/packages/astro-ghostcms/.env.demo deleted file mode 100644 index e1699c0e..00000000 --- a/packages/astro-ghostcms/.env.demo +++ /dev/null @@ -1,2 +0,0 @@ -CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48 -CONTENT_API_URL=https://ghostdemo.matthiesen.xyz \ No newline at end of file diff --git a/packages/astro-ghostcms/CHANGELOG.md b/packages/astro-ghostcms/CHANGELOG.md index a9e053ba..19219270 100644 --- a/packages/astro-ghostcms/CHANGELOG.md +++ b/packages/astro-ghostcms/CHANGELOG.md @@ -60,4 +60,4 @@ - Initialization of changeset cli - Updated dependencies - - @matthiesenxyz/astro-ghostcms-theme-default@0.1.10 + - @matthiesenxyz/astro-ghostcms-theme-default@0.1.10 \ No newline at end of file diff --git a/packages/astro-ghostcms/LICENSE b/packages/astro-ghostcms/LICENSE index 592eb27d..5fe4487a 100644 --- a/packages/astro-ghostcms/LICENSE +++ b/packages/astro-ghostcms/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/packages/astro-ghostcms/README.md b/packages/astro-ghostcms/README.md index 8029250d..b50af9a8 100644 --- a/packages/astro-ghostcms/README.md +++ b/packages/astro-ghostcms/README.md @@ -113,4 +113,3 @@ For more information and to see the docs please check our website: [Astro-GhostC # Foot Notes & Credits [^1]: Ghost.org, Ghost.io, Ghost are all trademarks of [The Ghost Foundation](https://ghost.org/). This project is Open Source and not directly related to or provided by The Ghost Foundation and is intended to help create a easier method to utilize their provided JavaScript tools to link a Headless GhostCMS install in to your Astro project. - diff --git a/packages/astro-ghostcms/index.ts b/packages/astro-ghostcms/index.ts deleted file mode 100644 index 88715ed3..00000000 --- a/packages/astro-ghostcms/index.ts +++ /dev/null @@ -1,359 +0,0 @@ -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import type { AstroIntegration } from "astro"; -import type { SafeParseError, SafeParseSuccess } from "astro/zod"; -import fse from "fs-extra"; -import { loadEnv } from "vite"; -import ghostRobots from "./src/integrations/robots-txt"; -import ghostSitemap from "./src/integrations/sitemap"; -import { UserConfigSchema } from "./src/schemas"; -import { addVirtualImport } from "./src/utils/add-virtual-import"; -import latestVersion from "./src/utils/latestVersion.js"; -import { fromZodError } from "./src/utils/zod-validation/fromZodError.js"; -import type { UserConfig } from "./types"; - -/** INTERNAL CONSTANTS */ -const IC = { - /** INTERNAL PACKAGE NAME */ - PKG: "@matthiesenxyz/astro-ghostcms", - /** INTERNAL PACKAGE NAME (THEME) */ - DT: "@matthiesenxyz/astro-ghostcms-theme-default", - /** INTERNAL STRING */ - CHECK_ENV: "Checking for Environment Variables...", - /** SET ENV GRABBER MODE */ - MODE: "all", - /** SET ENV GRABBER PREFIXES */ - PREFIXES: "CONTENT_API", - /** INTERNAL STRING */ - KEY_MISSING: "CONTENT_API_KEY Missing from .env/environment variables", - /** INTERNAL STRING */ - URL_MISSING: - "CONTENT_API_URL Missing from .env/environment variables or ghostURL under the integration settings in `astro.config.mjs`", - /** INTERNAL STRING */ - IT: "Injecting Theme: ", - /** INTERNAL STRING */ - IDR: "Injecting Default Routes...", - /** INTERNAL STRING */ - ITR: "Injecting Default Theme Routes...", - /** INTERNAL STRING */ - IRD: "Route Injection Disabled - Skipping...", - /** INTERNAL STRING */ - IIR: "Injecting Integration Route: ", - /** INTERNAL STRING */ - II: "Injecting Integration: ", - /** INTERNAL STRING */ - AIbU: "Already Imported by User: ", - /** INTERNAL STRING */ - CF: "Checking for ", - /** INTERNAL STRING */ - CONFSETUPDONE: "Step Complete", - /** INTERNAL STRING */ - F0FR: "Inject `/404` Route", - /** INTERNAL STRING */ - RSS: "Injecting `/rss.xml` Route and `@astrojs/rss` Integration", - /** INTERNAL STRING */ - NOURL: - "No Ghost URL defined in User Config: Falling back to environment variables.", - /** INTERNAL STRING */ - id404: "404 Injection Disabled", - /** INTERNAL STRING */ - idRSS: "RSS Injection Disabled", - /** INTERNAL STRING */ - satori_e: "Injecting Satori-OpenGraph Generator", - /** INTERNAL STRING */ - satori_d: "Satori Injection disabled", -}; - -/** CONTENT API ENVIRONMENT VARIABLES */ -const ENV = loadEnv(IC.MODE, process.cwd(), IC.PREFIXES); - -/** Astro-GhostCMS Integration - * @ For more information and to see the docs check - * @see https://astro-ghostcms.xyz - */ -export default function GhostCMS(options: UserConfig): AstroIntegration { - return { - name: "astro-ghostcms", - hooks: { - "astro:config:setup": async ({ - injectRoute, - config, - updateConfig, - logger, - }) => { - // DEFINE LOGGERS - const logConfigCheck = logger.fork("astro-ghostcms/config:check"); - const logConfigSetup = logger.fork("astro-ghostcms/config:setup"); - - // CHECK USER CONFIG AND MAKE AVAILBLE TO INTEGRATIONS - logConfigCheck.info("Checking Config..."); - const GhostUserConfig = UserConfigSchema.safeParse( - options || {}, - ) as SafeParseSuccess; - if (!GhostUserConfig.success) { - const validationError = fromZodError( - (GhostUserConfig as unknown as SafeParseError).error, - ); - logConfigCheck.error(`Config Error - ${validationError}`); - throw Error(""); - } - const GhostConfig = GhostUserConfig.data; - const GCD = { - theme: GhostConfig.theme, - dRI: GhostConfig.disableRouteInjection, - dCO: GhostConfig.disableConsoleOutput, - SM: GhostConfig.sitemap, - RTXT: GhostConfig.robotstxt, - gSite: GhostConfig.ghostURL, - dRSS: GhostConfig.disableRSS, - d404: GhostConfig.disable404, - dOG: GhostConfig.disableSatoriOG, - }; - - // Check For ENV Variables - if (!GCD.dCO) { - logConfigCheck.info(IC.CHECK_ENV); - } - if (ENV.CONTENT_API_KEY === undefined) { - logConfigCheck.error(IC.KEY_MISSING); - throw IC.KEY_MISSING; - } - if (GCD.gSite === undefined) { - logConfigCheck.warn(IC.NOURL); - if (ENV.CONTENT_API_URL === undefined) { - logConfigCheck.error(IC.URL_MISSING); - throw IC.URL_MISSING; - } - } - - if (!GCD.dRI) { - // THEME SELECTOR - if (GCD.theme === IC.DT) { - if (!GCD.dCO) { - logConfigCheck.info(IC.IT + IC.DT); - } - } else { - if (!GCD.dCO) { - logConfigCheck.info(IC.IT + GCD.theme); - } - } - // INJECT ROUTES - //// DEFAULT PROGRAM ROUTES - if (!GCD.dCO) { - logConfigSetup.info(IC.IDR); - } - if (!GCD.d404) { - if (!GCD.dCO) { - logConfigSetup.info(IC.F0FR); - } - injectRoute({ - pattern: "/404", - entrypoint: `${IC.PKG}/404.astro`, - }); - } else { - if (!GCD.dCO) { - logConfigSetup.info(IC.id404); - } - } - - if (!GCD.dRSS) { - if (!GCD.dCO) { - logConfigSetup.info(IC.RSS); - } - injectRoute({ - pattern: "/rss-style.xsl", - entrypoint: `${IC.PKG}/rss-style.xsl.ts`, - }); - injectRoute({ - pattern: "/rss.xml", - entrypoint: `${IC.PKG}/rss.xml.ts`, - }); - } else { - if (!GCD.dCO) { - logConfigSetup.info(IC.idRSS); - } - } - - if (!GCD.dOG) { - if (!GCD.dCO) { - logConfigSetup.info(IC.satori_e); - } - injectRoute({ - pattern: "/open-graph/[slug].png", - entrypoint: `${IC.PKG}/open-graph/[slug].png.ts`, - }); - injectRoute({ - pattern: "/open-graph/index.png", - entrypoint: `${IC.PKG}/open-graph/index.png.ts`, - }); - injectRoute({ - pattern: "/open-graph/authors.png", - entrypoint: `${IC.PKG}/open-graph/authors.png.ts`, - }); - injectRoute({ - pattern: "/open-graph/author/[slug].png", - entrypoint: `${IC.PKG}/open-graph/author/[slug].png.ts`, - }); - injectRoute({ - pattern: "/open-graph/tags.png", - entrypoint: `${IC.PKG}/open-graph/tags.png.ts`, - }); - injectRoute({ - pattern: "/open-graph/tag/[slug].png", - entrypoint: `${IC.PKG}/open-graph/tag/[slug].png.ts`, - }); - } else { - if (!GCD.dCO) { - logConfigSetup.info(IC.satori_d); - } - } - - // THEME ROUTES - if (!GCD.dCO) { - logConfigSetup.info(IC.ITR); - } - - injectRoute({ - pattern: "/", - entrypoint: `${GCD.theme}/index.astro`, - }); - injectRoute({ - pattern: "/[slug]", - entrypoint: `${GCD.theme}/[slug].astro`, - }); - injectRoute({ - pattern: "/tags", - entrypoint: `${GCD.theme}/tags.astro`, - }); - injectRoute({ - pattern: "/authors", - entrypoint: `${GCD.theme}/authors.astro`, - }); - injectRoute({ - pattern: "/tag/[slug]", - entrypoint: `${GCD.theme}/tag/[slug].astro`, - }); - injectRoute({ - pattern: "/author/[slug]", - entrypoint: `${GCD.theme}/author/[slug].astro`, - }); - injectRoute({ - pattern: "/archives/[...page]", - entrypoint: `${GCD.theme}/archives/[...page].astro`, - }); - } else { - if (!GCD.dCO) { - logConfigSetup.info(IC.IRD); - } - } - - // IMPORT INTEGRATIONS & INTEGRATION ROUTES - const integrations = [...config.integrations]; - - // IMPORT INTEGRATION: @ASTROJS/SITEMAP - if (!GCD.dCO) { - logConfigSetup.info(`${IC.CF}@astrojs/sitemap`); - } - if (!integrations.find(({ name }) => name === "@astrojs/sitemap")) { - if (!GCD.dCO) { - logConfigSetup.info(`${IC.II}@astrojs/sitemap`); - } - integrations.push(ghostSitemap(GCD.SM)); - } else { - if (!GCD.dCO) { - logConfigSetup.info(`${IC.AIbU}@astrojs/sitemap`); - } - } - - // IMPORT INTEGRATION: ASTRO-ROBOTS-TXT - if (!GCD.dCO) { - logConfigSetup.info(`${IC.CF}astro-robots-txt`); - } - if (!integrations.find(({ name }) => name === "astro-robots-txt")) { - if (!GCD.dCO) { - logConfigSetup.info(`${IC.II}astro-robots-txt`); - } - integrations.push(ghostRobots(GCD.RTXT)); - } else { - if (!GCD.dCO) { - logConfigSetup.info(`${IC.AIbU}astro-robots-txt`); - } - } - - // FINAL STEP TO KEEP INTEGRATION LIVE - try { - updateConfig({ - // UPDATE ASTRO CONFIG WITH INTEGRATED INTEGRATIONS - integrations: [ghostSitemap(GCD.SM), ghostRobots(GCD.RTXT)], - vite: { - optimizeDeps: { exclude: ["@resvg/resvg-js"] }, - }, - }); - } catch (e) { - logConfigSetup.error(e as string); - throw e; - } - - addVirtualImport({ - name: "virtual:@matthiesenxyz/astro-ghostcms/config", - content: `export default ${JSON.stringify(GhostUserConfig.data)}`, - updateConfig, - }); - }, - "astro:config:done": async ({ logger }) => { - // Config Done - const logConfigDone = logger.fork("astro-ghostcms/config:done"); - const pJSON = await fse.readJson( - path.resolve(fileURLToPath(import.meta.url), "..", "package.json"), - ); - const pkgVer = pJSON.version; - logConfigDone.info(`Config Done. Current Version: v${pkgVer}`); - }, - "astro:server:setup": async ({ logger }) => { - // Dev Server Start - const logServerSetup = logger.fork("astro-ghostcms/server:setup"); - const logCurrentVersion = logger.fork("astro-ghostcms/current-version"); - const logNpmVersion = logger.fork("astro-ghostcms/npm-pub-version"); - const logCheck = logger.fork("astro-ghostcms/check"); - const pJSON = await fse.readJson( - path.resolve(fileURLToPath(import.meta.url), "..", "package.json"), - ); - const pkgVer = pJSON.version; - const npmVER = await latestVersion(IC.PKG); - if (pkgVer !== npmVER) { - logCurrentVersion.warn(`Current Installed Version is v${pkgVer}`); - logNpmVersion.warn(`Latest Published Version is v${npmVER}`); - logCheck.warn("Please consider updating."); - } - logServerSetup.info( - "Setting up Astro-GhostCMS server for Development!", - ); - }, - "astro:server:start": async ({ logger }) => { - // Server Start - const logServerStart = logger.fork("astro-ghostcms/server:start"); - logServerStart.info("Astro-GhostCMS Integration Ready!"); - }, - "astro:build:done": async ({ logger }) => { - // Build Done - const logBuildDone = logger.fork("astro-ghostcms/build:done"); - const logCurrentVersion = logger.fork("astro-ghostcms/current-version"); - const logNpmVersion = logger.fork("astro-ghostcms/npm-pub-version"); - const logCheck = logger.fork("astro-ghostcms/check"); - const pJSON = await fse.readJson( - path.resolve(fileURLToPath(import.meta.url), "..", "package.json"), - ); - const pkgVer = pJSON.version; - const npmVER = await latestVersion(IC.PKG); - if (pkgVer !== npmVER) { - logCurrentVersion.warn(`Current Installed Version is v${pkgVer}`); - logNpmVersion.warn(`Latest Published Version is v${npmVER}`); - logCheck.warn("Please consider updating."); - } - logBuildDone.info( - `Build Complete, Integration Now ready for Production. Astro-GhostCMS v${pkgVer}`, - ); - }, - }, - }; -} diff --git a/packages/astro-ghostcms/package.json b/packages/astro-ghostcms/package.json index 036503d0..c81e3c24 100644 --- a/packages/astro-ghostcms/package.json +++ b/packages/astro-ghostcms/package.json @@ -1,111 +1,73 @@ { - "name": "@matthiesenxyz/astro-ghostcms", - "description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content", - "version": "3.2.9", - "homepage": "https://astro-ghostcms.xyz/", - "type": "module", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "sideEffects": false, - "author": { - "email": "adam@matthiesen.xyz", - "name": "Adam Matthiesen - MatthiesenXYZ", - "url": "https://matthiesen.xyz" - }, - "keywords": [ - "astro-component", - "astro-integration", - "withastro", - "astro", - "blog", - "content", - "integration", - "ghost", - "ghostcms", - "ghostcms-theme", - "ghost-theme", - "astro-theme" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/MatthiesenXYZ/astro-ghostcms.git" - }, - "bugs": { - "url": "https://github.com/MatthiesenXYZ/astro-ghostcms/issues", - "email": "issues@astro-ghostcms.xyz" - }, - "main": "index.ts", - "types": "types.d.ts", - "files": [ - "src", - ".env.demo", - "index.ts", - "tsconfig.json", - "types.d.ts" - ], - "exports": { - ".": "./index.ts", - "./api": { - "types": "./src/api/index.ts", - "default": "./src/api/index.ts" + "name": "@matthiesenxyz/astro-ghostcms", + "description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content", + "version": "3.3.0-dev.1", + "homepage": "https://astro-ghostcms.xyz/", + "type": "module", + "license": "MIT", + "publishConfig": { + "access": "public" }, - "./api-core": "./src/api/content-api/index.ts", - "./config": { - "types": "./src/integrations/virtual.d.ts", - "default": "./src/integrations/virtual-config.ts" + "sideEffects": false, + "author": { + "email": "adam@matthiesen.xyz", + "name": "Adam Matthiesen - MatthiesenXYZ", + "url": "https://matthiesen.xyz" }, - "./satoriOG": "./src/integrations/satori.ts", - "./404.astro": "./src/default-routes/404/404.astro", - "./rss.xml.ts": "./src/default-routes/rss.xml.ts", - "./rss-style.xsl.ts": "./src/default-routes/rss-style.xsl.ts", - "./open-graph/index.png.ts": "./src/default-routes/open-graph/index.png.ts", - "./open-graph/authors.png.ts": "./src/default-routes/open-graph/authors.png.ts", - "./open-graph/tags.png.ts": "./src/default-routes/open-graph/tags.png.ts", - "./open-graph/[slug].png.ts": "./src/default-routes/open-graph/[slug].png.ts", - "./open-graph/author/[slug].png.ts": "./src/default-routes/open-graph/author/[slug].png.ts", - "./open-graph/tag/[slug].png.ts": "./src/default-routes/open-graph/tag/[slug].png.ts" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest", - "test:coverage": "vitest run --coverage", - "test:ci": "vitest run --coverage.enabled --coverage.reporter='text-summary'" - }, - "devDependencies": { - "@astrojs/check": "^0.5.4", - "@ts-ghost/core-api": "*", - "@ts-ghost/tsconfig": "*", - "@matthiesenxyz/astro-ghostcms-theme-default": "*", - "@matthiesenxyz/astro-ghostcms-catppuccin": "*", - "@types/fs-extra": "^11.0.1", - "@types/node": "^20.11.19", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-astro": "^0.31.4", - "prettier": "^3.2.5", - "prettier-plugin-astro": "^0.13.0", - "typescript": "^5.3.3", - "vitest": "^1.3.0", - "vitest-fetch-mock": "^0.2.2" - }, - "dependencies": { - "@matthiesenxyz/astro-ghostcms-theme-default": "^0.1.13", - "@astrojs/rss": "^4.0.5", - "@astrojs/sitemap": "^3.0.5", - "@resvg/resvg-js": "^2.6.0", - "@ts-ghost/core-api": "^5.1.2", - "astro": "^4.4.0", - "astro-robots-txt": "^1.0.0", - "fs-extra": "^11.1.0", - "package-json": "9.0.0", - "satori": "^0.10.11", - "satori-html": "^0.3.2", - "vite": "^5.1.3", - "vite-tsconfig-paths": "^4.2.2", - "zod": "^3.22.4" + "keywords": [ + "astro-component", + "astro-integration", + "withastro", + "astro", + "blog", + "content", + "integration", + "ghost", + "ghostcms", + "ghostcms-theme", + "ghost-theme", + "astro-theme" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/MatthiesenXYZ/astro-ghostcms.git" + }, + "bugs": { + "url": "https://github.com/MatthiesenXYZ/astro-ghostcms/issues", + "email": "issues@astro-ghostcms.xyz" + }, + "files": [ + "src", + "index.ts" + ], + "exports": { + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./404.astro": "./src/routes/404.astro", + "./rss-routes/*": "./src/integrations/rssfeed/routes/*", + "./satoriOG": "./src/integrations/satoriog/satori.ts", + "./open-graph/*": "./src/integrations/satoriog/routes/*" + }, + "scripts": { + }, + "peerDependencies": { + "astro": "^4.4.1" + }, + "devDependencies": { + }, + "dependencies": { + "@astrojs/rss": "^4.0.5", + "@astrojs/sitemap": "^3.0.5", + "@matthiesenxyz/astro-ghostcms-theme-default": "^0.1.13", + "@resvg/resvg-js": "^2.6.0", + "@ts-ghost/core-api": "^6.0.0", + "@ts-ghost/content-api": "^4.0.12", + "astro-integration-kit": "^0.5.0", + "astro-robots-txt": "^1.0.0", + "picocolors": "1.0.0", + "satori": "^0.10.13", + "satori-html": "0.3.2", + "vite": "^5.1.4" + } } -} + \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/content-api.test.ts b/packages/astro-ghostcms/src/api/content-api/content-api.test.ts deleted file mode 100644 index e47ec835..00000000 --- a/packages/astro-ghostcms/src/api/content-api/content-api.test.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { assert, beforeEach, describe, expect, test } from "vitest"; - -import TS_API from "./content-api"; - -describe("content-api", () => { - let api: TS_API; - beforeEach(() => { - api = new TS_API("https://ghost.org", "59d4bf56c73c04a18c867dc3ba", "v5.0"); - }); - - test("content-api", () => { - expect(api).toBeDefined(); - }); - - test("content-api shouldn't instantiate with an incorrect url", () => { - assert.throws(() => { - const api = new TS_API("ghost.org", "59d4bf56c73c04a18c867dc3ba", "v5.0"); - api.settings; - }); - }); - - test("content-api shouldn't instantiate with an incorrect key", () => { - assert.throws(() => { - const api = new TS_API("https://ghost.org", "a", "v5.0"); - api.settings; - }); - }); - - test("content-api shouldn't instantiate with an incorrect version", () => { - assert.throws(() => { - const api = new TS_API( - "https://ghost.org", - "1efedd9db174adee2d23d982:4b74dca0219bad629852191af326a45037346c2231240e0f7aec1f9371cc14e8", - // @ts-expect-error - "v4.0", - ); - api.settings; - }); - }); - - test("content-api.posts", () => { - expect(api.posts).toBeDefined(); - expect(api.posts.browse).toBeDefined(); - expect(api.posts.read).toBeDefined(); - }); - - test("content-api.pages", () => { - expect(api.pages).toBeDefined(); - expect(api.pages.browse).toBeDefined(); - expect(api.pages.read).toBeDefined(); - }); - - test("content-api.tags", () => { - expect(api.tags).toBeDefined(); - expect(api.tags.browse).toBeDefined(); - expect(api.tags.read).toBeDefined(); - }); - - test("content-api.tiers", () => { - expect(api.tiers).toBeDefined(); - expect(api.tiers.browse).toBeDefined(); - expect(api.tiers.read).toBeDefined(); - }); - - test("content-api.authors", () => { - expect(api.authors).toBeDefined(); - expect(api.authors.browse).toBeDefined(); - expect(api.authors.read).toBeDefined(); - // @ts-expect-error - expect(api.authors.add).toBeUndefined(); - // @ts-expect-error - expect(api.authors.edit).toBeUndefined(); - expect(api.authors).toBeDefined(); - }); - - test("content-api.settings", () => { - expect(api.settings).toBeDefined(); - expect(api.settings.fetch).toBeDefined(); - // @ts-expect-error - expect(api.settings.read).toBeUndefined(); - // @ts-expect-error - expect(api.settings.browse).toBeUndefined(); - }); -}); diff --git a/packages/astro-ghostcms/src/api/content-api/content-api.ts b/packages/astro-ghostcms/src/api/content-api/content-api.ts deleted file mode 100644 index 6035e96a..00000000 --- a/packages/astro-ghostcms/src/api/content-api/content-api.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { - APIComposer, - BasicFetcher, - HTTPClient, - contentAPICredentialsSchema, - slugOrIdSchema, -} from "@ts-ghost/core-api"; - -import { - authorsIncludeSchema, - authorsSchema, - pagesIncludeSchema, - pagesSchema, - postsIncludeSchema, - postsSchema, - settingsSchema, - tagsIncludeSchema, - tagsSchema, - tiersIncludeSchema, - tiersSchema, -} from "./schemas"; - -export type { ContentAPICredentials, APIVersions } from "@ts-ghost/core-api"; - -export enum BrowseEndpointType { - authors = "authors", - tiers = "tiers", - posts = "posts", - pages = "pages", - tags = "tags", - settings = "settings", -} - -export default class TS_API { - private httpClient: HTTPClient; - - constructor( - protected readonly url: string, - protected readonly key: string, - protected readonly version: Version, - ) { - const apiCredentials = contentAPICredentialsSchema.parse({ - key, - version, - url, - }); - this.httpClient = new HTTPClient({ - ...apiCredentials, - endpoint: "content", - }); - } - - get authors() { - return new APIComposer( - "authors", - { - schema: authorsSchema, - identitySchema: slugOrIdSchema, - include: authorsIncludeSchema, - }, - this.httpClient, - ).access(["read", "browse"]); - } - get tiers() { - return new APIComposer( - "tiers", - { - schema: tiersSchema, - identitySchema: slugOrIdSchema, - include: tiersIncludeSchema, - }, - this.httpClient, - ).access(["browse", "read"]); - } - get posts() { - return new APIComposer( - "posts", - { - schema: postsSchema, - identitySchema: slugOrIdSchema, - include: postsIncludeSchema, - }, - this.httpClient, - ).access(["browse", "read"]); - } - get pages() { - return new APIComposer( - "pages", - { - schema: pagesSchema, - identitySchema: slugOrIdSchema, - include: pagesIncludeSchema, - }, - this.httpClient, - ).access(["browse", "read"]); - } - get tags() { - return new APIComposer( - "tags", - { - schema: tagsSchema, - identitySchema: slugOrIdSchema, - include: tagsIncludeSchema, - }, - this.httpClient, - ).access(["browse", "read"]); - } - - get settings() { - return new BasicFetcher( - "settings", - { output: settingsSchema }, - this.httpClient, - ); - } -} diff --git a/packages/astro-ghostcms/src/api/content-api/index.ts b/packages/astro-ghostcms/src/api/content-api/index.ts deleted file mode 100644 index fb09f087..00000000 --- a/packages/astro-ghostcms/src/api/content-api/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as TS_API } from "./content-api"; -export * from "./schemas"; - -export type { - InferFetcherDataShape, - InferResponseDataShape, - BrowseParams, -} from "@ts-ghost/core-api"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.test.ts b/packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.test.ts deleted file mode 100644 index 1d24851f..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.test.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; -import createFetchMock from "vitest-fetch-mock"; - -import TS_API from "../../content-api"; - -const fetchMocker = createFetchMock(vi); - -describe("authors api .browse() Args Type-safety", () => { - const url = process.env.VITE_GHOST_URL || "https://my-ghost-blog.com"; - const key = - process.env.VITE_GHOST_CONTENT_API_KEY || "59d4bf56c73c04a18c867dc3ba"; - const api = new TS_API(url, key, "v5.0"); - test(".browse() params shouldnt accept invalid params", () => { - // @ts-expect-error - shouldnt accept invalid params - const browse = api.authors.browse({ pp: 2 }); - expect(browse.getParams().browseParams).toStrictEqual({}); - }); - - test(".browse() 'order' params should ony accept fields values", () => { - // @ts-expect-error - order should ony contain field - expect(() => api.authors.browse({ order: "foo ASC" })).toThrow(); - // valid - expect( - api.authors.browse({ order: "name ASC" }).getParams().browseParams, - ).toStrictEqual({ - order: "name ASC", - }); - expect( - api.authors.browse({ order: "name ASC,slug DESC" }).getParams() - .browseParams, - ).toStrictEqual({ - order: "name ASC,slug DESC", - }); - expect( - api.authors - .browse({ order: "name ASC,slug DESC,location ASC" }) - .getParams().browseParams, - ).toStrictEqual({ - order: "name ASC,slug DESC,location ASC", - }); - // @ts-expect-error - order should ony contain field (There is a typo in location) - expect(() => - api.authors.browse({ order: "name ASC,slug DESC,locaton ASC" }), - ).toThrow(); - }); - - test(".browse() 'filter' params should ony accept valid field", () => { - expect(() => - api.authors.browse({ - // @ts-expect-error - order should ony contain field - filter: "foo:bar", - }), - ).toThrow(); - expect( - api.authors - .browse({ - filter: "name:bar", - }) - .getParams().browseParams, - ).toStrictEqual({ - filter: "name:bar", - }); - expect( - api.authors - .browse({ - filter: "name:bar+slug:-test", - }) - .getParams().browseParams, - ).toStrictEqual({ - filter: "name:bar+slug:-test", - }); - }); - - test(".browse 'fields' argument should ony accept valid fields", () => { - expect( - api.authors - .browse() - .fields({ - // @ts-expect-error - order should ony contain field - foo: true, - }) - .getOutputFields(), - ).toEqual([]); - - expect( - api.authors.browse().fields({ location: true }).getOutputFields(), - ).toEqual(["location"]); - expect( - api.authors - .browse() - .fields({ name: true, website: true }) - .getOutputFields(), - ).toEqual(["name", "website"]); - }); -}); - -describe("authors resource mocked", () => { - let api: TS_API; - - beforeEach(() => { - api = new TS_API( - "https://my-ghost-blog.com", - "59d4bf56c73c04a18c867dc3ba", - "v5.0", - ); - fetchMocker.enableMocks(); - }); - afterEach(() => { - vi.restoreAllMocks(); - }); - - test("aouthors should be fetched correctly", async () => { - const authors = api.authors; - expect(authors).not.toBeUndefined(); - const browseQuery = authors - .browse({ - page: 2, - }) - .fields({ - name: true, - id: true, - }); - expect(browseQuery).not.toBeUndefined(); - expect(browseQuery.getOutputFields()).toStrictEqual(["name", "id"]); - - fetchMocker.doMockOnce( - JSON.stringify({ - authors: [ - { - name: "foo", - id: "eaoizdjoa1321123", - }, - ], - meta: { - pagination: { - page: 1, - limit: 15, - pages: 1, - total: 1, - next: null, - prev: null, - }, - }, - }), - ); - const result = await browseQuery.fetch(); - expect(fetchMocker).toHaveBeenCalledTimes(1); - expect(fetchMocker).toHaveBeenCalledWith( - "https://my-ghost-blog.com/ghost/api/content/authors/?page=2&fields=name%2Cid&key=59d4bf56c73c04a18c867dc3ba", - { - headers: { - "Content-Type": "application/json", - "Accept-Version": "v5.0", - }, - }, - ); - expect(result).not.toBeUndefined(); - if (result.success) { - expect(result.data.length).toBe(1); - expect(result.data[0].name).toBe("foo"); - expect(result.data[0].id).toBe("eaoizdjoa1321123"); - } - }); -}); diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/authors/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/authors/index.ts deleted file mode 100644 index f9adb07f..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/authors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./authors"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/helpers/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/helpers/index.ts deleted file mode 100644 index f4fb9f52..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/helpers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./socials"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/pages/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/pages/index.ts deleted file mode 100644 index c4e34b27..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/pages/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./pages"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/posts/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/posts/index.ts deleted file mode 100644 index 4f89127a..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/posts/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./posts"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.test.ts b/packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.test.ts deleted file mode 100644 index b2dfbbe3..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { describe, expect, test } from "vitest"; - -import TS_API from "../../content-api"; -import type { Post } from "./posts"; - -const url = process.env.VITE_GHOST_URL || "https://my-ghost-blog.com"; -const key = - process.env.VITE_GHOST_CONTENT_API_KEY || "59d4bf56c73c04a18c867dc3ba"; - -describe("posts api .browse() Args Type-safety", () => { - const api = new TS_API(url, key, "v5.0"); - test(".browse() params shouldnt accept invalid params", () => { - // @ts-expect-error - shouldnt accept invalid params - const browse = api.posts.browse({ pp: 2 }); - expect(browse.getParams().browseParams).toStrictEqual({}); - - const outputFields = { - slug: true, - title: true, - // @ts-expect-error - shouldnt accept invalid params - foo: true, - } satisfies { [k in keyof Post]?: true | undefined }; - - // biome-ignore lint/style/useConst: - let test = api.posts - .browse() - // @ts-expect-error - shouldnt accept invalid params - .fields(outputFields); - expect(test.getOutputFields()).toEqual(["slug", "title"]); - - const fields = ["slug", "title", "foo"] as const; - const unknownOriginFields = fields.reduce( - (acc, k) => { - acc[k as keyof Post] = true; - return acc; - }, - {} as { [k in keyof Post]?: true | undefined }, - ); - const result = api.posts.browse().fields(unknownOriginFields); - expect(result.getOutputFields()).toEqual(["slug", "title"]); - }); - test(".browse() params, output fields declare const", () => { - const outputFields = { - slug: true, - title: true, - } satisfies { [k in keyof Post]?: true | undefined }; - - // biome-ignore lint/style/useConst: - let test = api.posts.browse().fields(outputFields); - expect(test.getOutputFields()).toEqual(["slug", "title"]); - - // @ts-expect-error - shouldnt accept invalid params - expect(() => api.posts.browse({ filter: "slugg:test" })).toThrow(); - // @ts-expect-error - shouldnt accept invalid params - expect(() => - api.posts.browse({ filter: "slug:test,foo:-[bar,baz]" }), - ).toThrow(); - expect( - api.posts.browse({ filter: "slug:test,tags:-[bar,baz]" }), - ).toBeDefined(); - expect( - api.posts.browse({ filter: "slug:test,tags:[bar,baz]" }), - ).toBeDefined(); - // @ts-expect-error - shouldnt accept invalid params - expect(() => - api.posts.browse({ filter: "slug:test,food:-[bar,baz]" }), - ).toThrow(); - }); -}); diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/settings/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/settings/index.ts deleted file mode 100644 index dcf101b0..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/settings/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./settings"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/tags/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/tags/index.ts deleted file mode 100644 index 006f4bf5..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/tags/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tags"; diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/tiers/index.ts b/packages/astro-ghostcms/src/api/content-api/schemas/tiers/index.ts deleted file mode 100644 index aec8c265..00000000 --- a/packages/astro-ghostcms/src/api/content-api/schemas/tiers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./tiers"; diff --git a/packages/astro-ghostcms/src/api/api-functions.ts b/packages/astro-ghostcms/src/api/ghostAPI.ts similarity index 90% rename from packages/astro-ghostcms/src/api/api-functions.ts rename to packages/astro-ghostcms/src/api/ghostAPI.ts index dde659e8..0d031775 100644 --- a/packages/astro-ghostcms/src/api/api-functions.ts +++ b/packages/astro-ghostcms/src/api/ghostAPI.ts @@ -1,10 +1,10 @@ -import { TS_API } from "./content-api"; -import type { Page, Post } from "./content-api/schemas"; +import { TSGhostContentAPI } from "@ts-ghost/content-api"; +import type { Page, Post } from "../schemas/api"; // LOAD ENVIRONMENT VARIABLES import { loadEnv } from "vite"; -import config from "../integrations/virtual-config"; +import config from "virtual:@matthiesenxyz/astro-ghostcms/config"; const CONF_URL = config.ghostURL; @@ -17,7 +17,7 @@ const { CONTENT_API_KEY, CONTENT_API_URL } = loadEnv( const ghostApiKey = CONTENT_API_KEY; const ghostUrl = CONF_URL ? CONF_URL : CONTENT_API_URL; const version = "v5.0"; -const api = new TS_API(ghostUrl, ghostApiKey, version); +const api = new TSGhostContentAPI(ghostUrl, ghostApiKey, version); export const getAllAuthors = async () => { const results = await api.authors @@ -121,4 +121,4 @@ export const getFeaturedPosts = async () => { posts: results.data, meta: results.meta, }; -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/index.ts b/packages/astro-ghostcms/src/api/index.ts index 91557560..808a2451 100644 --- a/packages/astro-ghostcms/src/api/index.ts +++ b/packages/astro-ghostcms/src/api/index.ts @@ -1,3 +1,2 @@ -export * from "./api-functions"; -export * from "./content-api/schemas"; -export * from "./invariant"; +export * from "./ghostAPI"; +export * from "./invariant"; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/invariant.test.ts b/packages/astro-ghostcms/src/api/invariant.test.ts deleted file mode 100644 index 20c887b9..00000000 --- a/packages/astro-ghostcms/src/api/invariant.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { describe, expect, it } from "vitest"; - -// Modified version of invariant script to allow tests -const isProduction = false; -const prefix: string = "Invariant failed"; -function invariant(condition: any, message?: string | (() => string)) { - if (condition) { - return; - } - if (isProduction) { - throw new Error(prefix); - } - const provided: string | undefined = - typeof message === "function" ? message() : message; - const value: string = provided ? `${prefix}: ${provided}` : prefix; - return value; -} - -// TEST SECTION -const testTrue = true; -const testFalse = false; -describe("test invariant", () => { - it("Test `true` value", () => { - invariant(testTrue, "This should not error"); - expect(null); - }); - - it("Test `false` value", () => { - invariant(testFalse, "This should Error"); - expect(String("Invariant failed")); - }); -}); diff --git a/packages/astro-ghostcms/src/api/invariant.ts b/packages/astro-ghostcms/src/api/invariant.ts index 787f7935..d17d926a 100644 --- a/packages/astro-ghostcms/src/api/invariant.ts +++ b/packages/astro-ghostcms/src/api/invariant.ts @@ -20,7 +20,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -const tinyinvariant = "merged"; const isProduction: boolean = process.env.NODE_ENV === "production"; const prefix: string = "Invariant failed"; @@ -45,4 +44,4 @@ export function invariant( const value: string = provided ? `${prefix}: ${provided}` : prefix; throw new Error(value); -} +} \ No newline at end of file diff --git a/packages/astro-ghostcms/src/astro-ghostcms.ts b/packages/astro-ghostcms/src/astro-ghostcms.ts new file mode 100644 index 00000000..68a809b1 --- /dev/null +++ b/packages/astro-ghostcms/src/astro-ghostcms.ts @@ -0,0 +1,170 @@ +import { createResolver, defineIntegration } from "astro-integration-kit"; +import { corePlugins } from "astro-integration-kit/plugins"; +import { GhostUserConfigSchema } from "./schemas/userconfig"; +import { loadEnv } from "vite"; +import { AstroError } from "astro/errors"; +import c from "picocolors"; + +// Import External Integrations +import sitemap from "@astrojs/sitemap"; +import robotsTxt from "astro-robots-txt"; + +// Import Internal Integrations +import ghostOGImages from "./integrations/satoriog" +import ghostRSS from "./integrations/rssfeed" +import ghostThemeProvider from "./integrations/themeprovider" + +// Load environment variables +const ENV = loadEnv("all", process.cwd(), "CONTENT_API"); + +/** Astro-GhostCMS Integration + * @description This integration allows you to use GhostCMS as a headless CMS for your Astro project + * @see https://astro-ghostcms.xyz for the most up-to-date documentation! +*/ +export default defineIntegration({ + name: "@matthiesenxyz/astro-ghostcms", + optionsSchema: GhostUserConfigSchema, + plugins: [...corePlugins], + setup({ options, name }) { + const { resolve } = createResolver(import.meta.url); + + return { + "astro:config:setup": ({ + watchIntegration, + hasIntegration, + addIntegration, + addVirtualImports, + addDts, + injectRoute, + logger + }) => { + const GhostLogger = logger.fork(c.bold(c.blue('👻 Astro-GhostCMS'))); + const GhostENVLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('ENV Check')}`); + const GhostIntegrationLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('Integrations')}`); + const GhostRouteLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('Router')}`); + + watchIntegration(resolve()) + GhostLogger.info('Initializing @matthiesenxyz/astro-ghostcms...') + + const verbose = options.fullConsoleLogs; + + // Check for GhostCMS environment variables + GhostENVLogger.info(c.bold(c.yellow('Checking for GhostCMS environment variables & user configuration'))) + if (ENV.CONTENT_API_KEY === undefined) { + GhostENVLogger.error(c.bgRed(c.bold(c.white('CONTENT_API_KEY is not set in environment variables')))) + throw new AstroError(`${name} CONTENT_API_KEY is not set in environment variables`) + } + + if (options.ghostURL === undefined) { + GhostENVLogger.warn(c.bgYellow(c.bold(c.black('ghostURL is not set in user configuration falling back to environment variable')))) + if (ENV.CONTENT_API_URL === undefined) { + GhostENVLogger.error(c.bgRed(c.bold(c.white('CONTENT_API_URL is not set in environment variables')))) + throw new AstroError(`${name} CONTENT_API_URL is not set in environment variables`) + } + } + GhostENVLogger.info(c.bold(c.green('GhostCMS environment variables are set'))) + + // Set up Astro-GhostCMS Integrations + GhostIntegrationLogger.info(c.bold(c.magenta('Configuring Enabled Integrations'))) + + // Theme Provider + if ( !options.disableThemeProvider ) { + addIntegration( + ghostThemeProvider({ + theme: options.ThemeProvider.theme, + verbose + }) + ) + } else { + if (verbose) { + GhostIntegrationLogger.info(c.gray('Theme Provider is disabled')) + } + } + + // Satori OG Images + if ( options.enableOGImages ) { + addIntegration(ghostOGImages({ verbose })) + } else { + if (verbose) { + GhostIntegrationLogger.info(c.gray('OG Image Provider is disabled')) + } + } + + // RSS Feed + if ( options.enableRSSFeed ) { + addIntegration(ghostRSS({ verbose })) + } else { + if (verbose) { + GhostIntegrationLogger.info(c.gray('RSS Feed is disabled')) + } + } + + // @ASTROJS/SITEMAP + if ( !hasIntegration("@astrojs/sitemap") ) { + if (verbose) { + GhostIntegrationLogger.info(c.bold(c.magenta(`Adding ${c.blue("@astrojs/sitemap")} integration`))) + } + addIntegration(sitemap()) + } else { + if (verbose) { + GhostIntegrationLogger.info(c.gray('@astrojs/sitemap integration already exists, skipping...')) + } + } + // ASTRO-ROBOTS-TXT + if ( !hasIntegration("@astro-robots-txt") ) { + if (verbose) { + GhostIntegrationLogger.info(c.bold(c.magenta(`Adding ${c.blue("astro-robots-txt")} integration`))) + } + addIntegration(robotsTxt()) + } else { + if (verbose) { + GhostIntegrationLogger.info(c.gray('astro-robots-txt integration already exists, skipping...')) + } + } + + // Set up default 404 page + if ( !options.disableDefault404 ) { + if (verbose) { + GhostRouteLogger.info(c.bold(c.cyan('Setting up default 404 page'))) + } + injectRoute({ + pattern: "/404", + entrypoint: `${name}/404.astro`, + prerender: true + }) + } else { + if (verbose) { + GhostRouteLogger.info(c.gray('Default 404 page is disabled, Skipping...')) + } + } + + // Add virtual imports for user configuration + addVirtualImports({ + 'virtual:@matthiesenxyz/astro-ghostcms/config': `export default ${JSON.stringify(options)}`, + }) + + // Add types for user configuration + addDts({ + name: "@matthiesenxyz/astro-ghostcms/config", + content: `declare module "virtual:@matthiesenxyz/astro-ghostcms/config" { + const Config: import("../schemas/userconfig").GhostUserConfig; + export default Config; + }` + }) + + }, + "astro:config:done": ({ logger }) => { + const GhostLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.green('Config')}`); + GhostLogger.info(c.bold(c.green('Integration Setup & Configuration Complete'))) + }, + "astro:server:start": ({ logger }) => { + const GhostLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.bold(c.green('DEV'))}`); + GhostLogger.info(c.bold(c.magenta('Running Astro-GhostCMS in Deveopment mode'))) + }, + "astro:build:done": ({ logger }) => { + const GhostLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.bold(c.green('BUILD'))}`); + GhostLogger.info(c.bold(c.magenta('Running Astro-GhostCMS in Production mode'))) + } + } + } +}) \ No newline at end of file diff --git a/packages/astro-ghostcms/src/index.ts b/packages/astro-ghostcms/src/index.ts new file mode 100644 index 00000000..58acee04 --- /dev/null +++ b/packages/astro-ghostcms/src/index.ts @@ -0,0 +1,3 @@ +import astroghostcms from './astro-ghostcms.js'; + +export default astroghostcms; diff --git a/packages/astro-ghostcms/src/integrations/robots-txt.ts b/packages/astro-ghostcms/src/integrations/robots-txt.ts deleted file mode 100644 index 38cbe70c..00000000 --- a/packages/astro-ghostcms/src/integrations/robots-txt.ts +++ /dev/null @@ -1,28 +0,0 @@ -import robotsTxt, { type RobotsTxtOptions } from "astro-robots-txt"; -import type { UserConfig } from "../schemas"; - -export function getRobotsTxtConfig( - opts: UserConfig["robotstxt"], -): RobotsTxtOptions { - const robotsConfig: RobotsTxtOptions = {}; - if (opts?.host) { - robotsConfig.host = opts.host; - } - if (opts?.policy) { - robotsConfig.policy = opts.policy; - } - if (opts?.sitemap) { - robotsConfig.sitemap = opts.sitemap; - } - if (opts?.sitemapBaseFileName) { - robotsConfig.sitemapBaseFileName = opts.sitemapBaseFileName; - } - return robotsConfig; -} - -/** - * A wrapped version of the `astro-robots-txt` integration for GhostCMS. - */ -export default function ghostRobots(opts: UserConfig["robotstxt"]) { - return robotsTxt(getRobotsTxtConfig(opts)); -} diff --git a/packages/astro-ghostcms/src/integrations/rssfeed/astro-ghostcms-rss.ts b/packages/astro-ghostcms/src/integrations/rssfeed/astro-ghostcms-rss.ts new file mode 100644 index 00000000..d64cd556 --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/rssfeed/astro-ghostcms-rss.ts @@ -0,0 +1,48 @@ +import { createResolver, defineIntegration } from "astro-integration-kit"; +import { corePlugins } from "astro-integration-kit/plugins"; +import c from "picocolors"; +import { z } from "astro/zod"; + +export default defineIntegration({ + name: "@matthiesenxyz/astro-ghostcms-rss", + optionsSchema: z.object({ + verbose: z.boolean().optional().default(false), + }), + plugins: [...corePlugins], + setup({ options }) { + const { resolve } = createResolver(import.meta.url); + + return { + "astro:config:setup": ({ + watchIntegration, + injectRoute, + logger + }) => { + watchIntegration(resolve()) + const RSSLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('RSSGenerator')}`); + + RSSLogger.info(c.bold(c.magenta('RSS Feed Enabled. Setting up...'))) + + const rssRoute = "@matthiesenxyz/astro-ghostcms/rss-routes" + + injectRoute({ + pattern: "/rss-style.xsl", + entrypoint: `${rssRoute}/rss-style.xsl.ts`, + }); + + injectRoute({ + pattern: "/rss.xml", + entrypoint: `${rssRoute}/rss.xml.ts`, + }); + + }, + "astro:config:done": ({ logger }) => { + const RSSLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('RSSGenerator')}`); + + if (options.verbose) { + RSSLogger.info(c.bold(c.green('RSS Feed Setup Complete'))) + } + } + } + } +}) \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/rssfeed/index.ts b/packages/astro-ghostcms/src/integrations/rssfeed/index.ts new file mode 100644 index 00000000..34ef34e7 --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/rssfeed/index.ts @@ -0,0 +1,3 @@ +import astroGhostcmsRSS from "./astro-ghostcms-rss"; + +export default astroGhostcmsRSS; diff --git a/packages/astro-ghostcms/src/default-routes/rss-style.xsl.ts b/packages/astro-ghostcms/src/integrations/rssfeed/routes/rss-style.xsl.ts similarity index 99% rename from packages/astro-ghostcms/src/default-routes/rss-style.xsl.ts rename to packages/astro-ghostcms/src/integrations/rssfeed/routes/rss-style.xsl.ts index f5282760..61dd87ed 100644 --- a/packages/astro-ghostcms/src/default-routes/rss-style.xsl.ts +++ b/packages/astro-ghostcms/src/integrations/rssfeed/routes/rss-style.xsl.ts @@ -78,4 +78,4 @@ export async function GET() { }, }, ); -} +} \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/rss.xml.ts b/packages/astro-ghostcms/src/integrations/rssfeed/routes/rss.xml.ts similarity index 90% rename from packages/astro-ghostcms/src/default-routes/rss.xml.ts rename to packages/astro-ghostcms/src/integrations/rssfeed/routes/rss.xml.ts index 3ca72a34..81c7df11 100644 --- a/packages/astro-ghostcms/src/default-routes/rss.xml.ts +++ b/packages/astro-ghostcms/src/integrations/rssfeed/routes/rss.xml.ts @@ -1,6 +1,6 @@ import rss from "@astrojs/rss"; import type { APIContext } from "astro"; -import { getAllPosts, getSettings, invariant } from "../api"; +import { getAllPosts, getSettings, invariant } from "../../../api"; const posts = await getAllPosts(); const settings = await getSettings(); @@ -24,4 +24,4 @@ export async function GET({ site }: APIContext) { author: post.primary_author?.name, })), }); -} +} \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/satoriog/astro-ghostcms-satoriog.ts b/packages/astro-ghostcms/src/integrations/satoriog/astro-ghostcms-satoriog.ts new file mode 100644 index 00000000..ded0418e --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/satoriog/astro-ghostcms-satoriog.ts @@ -0,0 +1,73 @@ +import { createResolver, defineIntegration } from "astro-integration-kit"; +import { corePlugins } from "astro-integration-kit/plugins"; +import c from "picocolors"; +import { z } from "astro/zod"; + +export default defineIntegration({ + name: "@matthiesenxyz/astro-ghostcms-satoriog", + optionsSchema: z.object({ + verbose: z.boolean().optional().default(false), + }), + plugins: [...corePlugins], + setup({ options }) { + const { resolve } = createResolver(import.meta.url); + + return { + "astro:config:setup": ({ + watchIntegration, + updateConfig, + injectRoute, + logger + }) => { + watchIntegration(resolve()) + + const SatoriLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('SatoriOG')}`); + + SatoriLogger.info(c.bold(c.magenta('OG Image Integration Enabled. Setting up...'))) + + const pkgname = "@matthiesenxyz/astro-ghostcms/open-graph" + + injectRoute({ + pattern: "/open-graph/[slug].png", + entrypoint: `${pkgname}/[slug].png.ts`, + }); + + injectRoute({ + pattern: "/open-graph/index.png", + entrypoint: `${pkgname}/index.png.ts`, + }); + + injectRoute({ + pattern: "/open-graph/authors.png", + entrypoint: `${pkgname}/authors.png.ts`, + }); + + injectRoute({ + pattern: "/open-graph/author/[slug].png", + entrypoint: `${pkgname}/author/[slug].png.ts`, + }); + + injectRoute({ + pattern: "/open-graph/tags.png", + entrypoint: `${pkgname}/tags.png.ts`, + }); + + injectRoute({ + pattern: "/open-graph/tag/[slug].png", + entrypoint: `${pkgname}/tag/[slug].png.ts`, + }); + + updateConfig({ + vite: { optimizeDeps: { exclude: ["@resvg/resvg-js"] } } + }) + }, + "astro:config:done": ({ logger }) => { + const SatoriLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('SatoriOG')}`); + + if (options.verbose) { + SatoriLogger.info(c.bold(c.green('OG Image Integration Setup Complete'))) + } + } + } + } +}) \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/satoriog/index.ts b/packages/astro-ghostcms/src/integrations/satoriog/index.ts new file mode 100644 index 00000000..20a40a55 --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/satoriog/index.ts @@ -0,0 +1,3 @@ +import astroGhostcmsSatoriog from "./astro-ghostcms-satoriog"; + +export default astroGhostcmsSatoriog; diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/[slug].png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/[slug].png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/[slug].png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/[slug].png.ts index 3be6ca55..f0bf0d9f 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/[slug].png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/[slug].png.ts @@ -10,8 +10,8 @@ import { getAllPosts, getSettings, invariant, -} from "../../api/index.js"; -import satoriOG from "../../integrations/satori.js"; +} from "../../../api"; +import satoriOG from "../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -67,4 +67,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/author/[slug].png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/author/[slug].png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/author/[slug].png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/author/[slug].png.ts index 95046eba..142b8f27 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/author/[slug].png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/author/[slug].png.ts @@ -10,8 +10,8 @@ import { getAllPosts, getSettings, invariant, -} from "../../../api/index.js"; -import satoriOG from "../../../integrations/satori.js"; +} from "../../../../api"; +import satoriOG from "../../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -61,4 +61,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/authors.png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/authors.png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/authors.png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/authors.png.ts index 9003a7b7..3eb0d239 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/authors.png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/authors.png.ts @@ -10,8 +10,8 @@ import { getAllPosts, getSettings, invariant, -} from "../../api/index.js"; -import satoriOG from "../../integrations/satori.js"; +} from "../../../api"; +import satoriOG from "../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -65,4 +65,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/index.png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/index.png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/index.png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/index.png.ts index 4059cb6c..01dd5dc7 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/index.png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/index.png.ts @@ -10,8 +10,8 @@ import { getAllPosts, getSettings, invariant, -} from "../../api/index.js"; -import satoriOG from "../../integrations/satori.js"; +} from "../../../api"; +import satoriOG from "../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -65,4 +65,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/tag/[slug].png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/tag/[slug].png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/tag/[slug].png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/tag/[slug].png.ts index f535f543..26176c25 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/tag/[slug].png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/tag/[slug].png.ts @@ -10,8 +10,8 @@ import { getAllTags, getSettings, invariant, -} from "../../../api/index.js"; -import satoriOG from "../../../integrations/satori.js"; +} from "../../../../api"; +import satoriOG from "../../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -68,4 +68,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/default-routes/open-graph/tags.png.ts b/packages/astro-ghostcms/src/integrations/satoriog/routes/tags.png.ts similarity index 96% rename from packages/astro-ghostcms/src/default-routes/open-graph/tags.png.ts rename to packages/astro-ghostcms/src/integrations/satoriog/routes/tags.png.ts index d81e0d2e..6d562052 100644 --- a/packages/astro-ghostcms/src/default-routes/open-graph/tags.png.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/routes/tags.png.ts @@ -10,8 +10,8 @@ import { getAllPosts, getSettings, invariant, -} from "../../api/index.js"; -import satoriOG from "../../integrations/satori.js"; +} from "../../../api"; +import satoriOG from "../satori"; export const getStaticPaths: GetStaticPaths = async () => { const result: GetStaticPathsItem[] = []; @@ -65,4 +65,4 @@ export const GET: APIRoute = async ({ props, site }) => { ], }, }); -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/satori.ts b/packages/astro-ghostcms/src/integrations/satoriog/satori.ts similarity index 98% rename from packages/astro-ghostcms/src/integrations/satori.ts rename to packages/astro-ghostcms/src/integrations/satoriog/satori.ts index 402eab9c..6b38a1a7 100644 --- a/packages/astro-ghostcms/src/integrations/satori.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/satori.ts @@ -5,7 +5,7 @@ import type { ToImageOptions, ToResponseOptions, ToSvgOptions, -} from "../../types.js"; +} from "./types"; const satoriOG = ({ width, height, template }: SatoriAstroOGOptions) => { return { @@ -52,4 +52,4 @@ export function getOgImagePath(inputFilename = "index"): string { filename = "index"; } return `./open-graph/${filename}.png`; -} +} \ No newline at end of file diff --git a/packages/astro-ghostcms/types.d.ts b/packages/astro-ghostcms/src/integrations/satoriog/types.d.ts similarity index 63% rename from packages/astro-ghostcms/types.d.ts rename to packages/astro-ghostcms/src/integrations/satoriog/types.d.ts index b991c890..b4c24795 100644 --- a/packages/astro-ghostcms/types.d.ts +++ b/packages/astro-ghostcms/src/integrations/satoriog/types.d.ts @@ -1,24 +1,5 @@ import type { Resvg } from "@resvg/resvg-js"; import type satori from "satori"; - -export type { UserConfig, GhostUserConfig } from "./src/schemas"; - -export type { - Author, - AuthorsIncludeSchema, - Page, - PagesIncludeSchema, - Post, - PostsIncludeSchema, - Settings, - Tag, - TagsIncludeSchema, - Tier, - TiersIncludeSchema, -} from "./src/api/index.ts"; - -export type { ContentAPICredentials, APIVersions } from "@ts-ghost/core-api"; - type SatoriParameters = Parameters; type SatoriOptions = SatoriParameters[1]; type ResvgOptions = NonNullable[1]>; @@ -36,4 +17,4 @@ export type ToImageOptions = { | ResvgOptions | ((params: { width: number; height: number }) => ResvgOptions); }; -export type ToResponseOptions = ToImageOptions & { response?: ResponseInit }; +export type ToResponseOptions = ToImageOptions & { response?: ResponseInit }; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/sitemap.ts b/packages/astro-ghostcms/src/integrations/sitemap.ts deleted file mode 100644 index 0c174e54..00000000 --- a/packages/astro-ghostcms/src/integrations/sitemap.ts +++ /dev/null @@ -1,38 +0,0 @@ -import sitemap, { type SitemapOptions } from "@astrojs/sitemap"; -import type { UserConfig } from "../schemas"; - -export function getSitemapConfig(opts: UserConfig["sitemap"]): SitemapOptions { - const sitemapConfig: SitemapOptions = {}; - if (opts?.filter) { - sitemapConfig.filter = opts.filter; - } - if (opts?.changefreq) { - sitemapConfig.changefreq = opts.changefreq; - } - if (opts?.entryLimit) { - sitemapConfig.entryLimit = opts.entryLimit; - } - if (opts?.customPages) { - sitemapConfig.customPages = opts.customPages; - } - if (opts?.i18n) { - sitemapConfig.i18n = opts.i18n; - } - if (opts?.lastmod) { - sitemapConfig.lastmod = opts.lastmod; - } - if (opts?.priority) { - sitemapConfig.priority = opts.priority; - } - if (opts?.serialize) { - sitemapConfig.serialize = opts.serialize; - } - return sitemapConfig; -} - -/** - * A wrapped version of the `@astrojs/sitemap` integration for GhostCMS. - */ -export default function ghostSitemap(opts: UserConfig["sitemap"]) { - return sitemap(getSitemapConfig(opts)); -} diff --git a/packages/astro-ghostcms/src/integrations/themeprovider/astro-ghostcms-themeprovider.ts b/packages/astro-ghostcms/src/integrations/themeprovider/astro-ghostcms-themeprovider.ts new file mode 100644 index 00000000..17cfc5a3 --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/themeprovider/astro-ghostcms-themeprovider.ts @@ -0,0 +1,81 @@ +import { createResolver, defineIntegration } from "astro-integration-kit"; +import { corePlugins } from "astro-integration-kit/plugins"; +import { z } from "astro/zod"; +import c from "picocolors"; + +export default defineIntegration({ + name: "@matthiesenxyz/astro-ghostcms-themeprovider", + optionsSchema: z.object({ + theme: z.string().optional().default("@matthiesenxyz/astro-ghostcms-theme-default"), + verbose: z.boolean().optional().default(false), + }), + plugins: [...corePlugins], + setup({ options }) { + const { resolve } = createResolver(import.meta.url); + + return { + "astro:config:setup": ({ + watchIntegration, + injectRoute, + logger + }) => { + watchIntegration(resolve()) + + const themeLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('Theme Provider')}`); + + themeLogger.info(c.bold(c.magenta('Theme Provider enabled. Setting up...'))) + + if ( options.verbose) { + if ( options.theme === "@matthiesenxyz/astro-ghostcms-theme-default" ) { + themeLogger.info(c.blue('No theme is set, injecting default theme')) + } else { + themeLogger.info(`${c.bold(c.cyan("Injecting Theme:"))} ${c.bold(c.underline(c.magenta(options.theme)))}`) + } + } + + injectRoute({ + pattern: "/", + entrypoint: `${options.theme}/index.astro`, + }); + + injectRoute({ + pattern: "/[slug]", + entrypoint: `${options.theme}/[slug].astro`, + }); + + injectRoute({ + pattern: "/tags", + entrypoint: `${options.theme}/tags.astro`, + }); + + injectRoute({ + pattern: "/authors", + entrypoint: `${options.theme}/authors.astro`, + }); + + injectRoute({ + pattern: "/tag/[slug]", + entrypoint: `${options.theme}/tag/[slug].astro`, + }); + + injectRoute({ + pattern: "/author/[slug]", + entrypoint: `${options.theme}/author/[slug].astro`, + }); + + injectRoute({ + pattern: "/archives/[...page]", + entrypoint: `${options.theme}/archives/[...page].astro`, + }); + + }, + "astro:config:done": ({ logger }) => { + const themeLogger = logger.fork(`${c.bold(c.blue('👻 Astro-GhostCMS'))}${c.gray("/")}${c.blue('Theme Provider')}`); + + if ( options.verbose ) { + themeLogger.info(c.bold(c.green('Provider Setup Complete'))) + } + } + } + } +}) \ No newline at end of file diff --git a/packages/astro-ghostcms/src/integrations/themeprovider/index.ts b/packages/astro-ghostcms/src/integrations/themeprovider/index.ts new file mode 100644 index 00000000..88e66a21 --- /dev/null +++ b/packages/astro-ghostcms/src/integrations/themeprovider/index.ts @@ -0,0 +1,3 @@ +import astroGhostcmsThemeProvider from "./astro-ghostcms-themeprovider"; + +export default astroGhostcmsThemeProvider; diff --git a/packages/astro-ghostcms/src/integrations/virtual-config.ts b/packages/astro-ghostcms/src/integrations/virtual-config.ts deleted file mode 100644 index e49f5f6e..00000000 --- a/packages/astro-ghostcms/src/integrations/virtual-config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { GhostUserConfig } from "../schemas"; -import config from "virtual:@matthiesenxyz/astro-ghostcms/config"; - -const UserConfig = config as GhostUserConfig; - -export default UserConfig; diff --git a/packages/astro-ghostcms/src/integrations/virtual.d.ts b/packages/astro-ghostcms/src/integrations/virtual.d.ts deleted file mode 100644 index 45a64ba9..00000000 --- a/packages/astro-ghostcms/src/integrations/virtual.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module "virtual:@matthiesenxyz/astro-ghostcms/config" { - const Config: import("../schemas/index").GhostUserConfig; - export default Config; -} diff --git a/packages/astro-ghostcms/src/default-routes/404/404.astro b/packages/astro-ghostcms/src/routes/404.astro similarity index 88% rename from packages/astro-ghostcms/src/default-routes/404/404.astro rename to packages/astro-ghostcms/src/routes/404.astro index 8489240a..175a5093 100644 --- a/packages/astro-ghostcms/src/default-routes/404/404.astro +++ b/packages/astro-ghostcms/src/routes/404.astro @@ -1,6 +1,6 @@ --- import './404.css'; -import { getSettings, invariant } from '../../api'; +import { getSettings, invariant } from '../api'; const settings = await getSettings(); invariant(settings, "Settings not found"); diff --git a/packages/astro-ghostcms/src/default-routes/404/404.css b/packages/astro-ghostcms/src/routes/404.css similarity index 100% rename from packages/astro-ghostcms/src/default-routes/404/404.css rename to packages/astro-ghostcms/src/routes/404.css diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.ts b/packages/astro-ghostcms/src/schemas/api/authors.ts similarity index 95% rename from packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.ts rename to packages/astro-ghostcms/src/schemas/api/authors.ts index 5091b306..ea02b3dc 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/authors/authors.ts +++ b/packages/astro-ghostcms/src/schemas/api/authors.ts @@ -3,7 +3,7 @@ import { ghostMetaSchema, ghostMetadataSchema, } from "@ts-ghost/core-api"; -import { z } from "zod"; +import { z } from "astro/zod"; export const authorsSchema = z.object({ ...ghostIdentitySchema.shape, @@ -34,4 +34,4 @@ export const ghostFetchAuthorsSchema = z.object({ export const authorsIncludeSchema = z.object({ "count.posts": z.literal(true).optional(), }); -export type AuthorsIncludeSchema = z.infer; +export type AuthorsIncludeSchema = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/index.ts b/packages/astro-ghostcms/src/schemas/api/index.ts similarity index 71% rename from packages/astro-ghostcms/src/api/content-api/schemas/index.ts rename to packages/astro-ghostcms/src/schemas/api/index.ts index 88bfc1b9..09360d62 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/index.ts +++ b/packages/astro-ghostcms/src/schemas/api/index.ts @@ -1,7 +1,7 @@ export * from "./authors"; -export * from "./helpers"; export * from "./pages"; export * from "./posts"; export * from "./settings"; +export * from "./socials"; export * from "./tags"; -export * from "./tiers"; +export * from "./tiers"; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/pages/pages.ts b/packages/astro-ghostcms/src/schemas/api/pages.ts similarity index 92% rename from packages/astro-ghostcms/src/api/content-api/schemas/pages/pages.ts rename to packages/astro-ghostcms/src/schemas/api/pages.ts index cc4165e6..ac002aae 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/pages/pages.ts +++ b/packages/astro-ghostcms/src/schemas/api/pages.ts @@ -5,10 +5,10 @@ import { ghostSocialMediaSchema, ghostVisibilitySchema, } from "@ts-ghost/core-api"; -import { z } from "zod"; +import { z } from "astro/zod"; -import { authorsSchema } from "../authors"; -import { tagsSchema } from "../tags"; +import { authorsSchema } from "./authors"; +import { tagsSchema } from "./tags"; const postsAuthorSchema = authorsSchema.extend({ url: z.string().nullish(), @@ -52,4 +52,4 @@ export const pagesIncludeSchema = z.object({ authors: z.literal(true).optional(), tags: z.literal(true).optional(), }); -export type PagesIncludeSchema = z.infer; +export type PagesIncludeSchema = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.ts b/packages/astro-ghostcms/src/schemas/api/posts.ts similarity index 93% rename from packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.ts rename to packages/astro-ghostcms/src/schemas/api/posts.ts index dc0d982a..18b1aa5e 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/posts/posts.ts +++ b/packages/astro-ghostcms/src/schemas/api/posts.ts @@ -5,10 +5,10 @@ import { ghostSocialMediaSchema, ghostVisibilitySchema, } from "@ts-ghost/core-api"; -import { z } from "zod"; +import { z } from "astro/zod"; -import { authorsSchema } from "../authors"; -import { tagsSchema } from "../tags"; +import { authorsSchema } from "./authors"; +import { tagsSchema } from "./tags"; const postsAuthorSchema = authorsSchema.extend({ url: z.string().nullish(), @@ -51,4 +51,4 @@ export const postsIncludeSchema = z.object({ authors: z.literal(true).optional(), tags: z.literal(true).optional(), }); -export type PostsIncludeSchema = z.infer; +export type PostsIncludeSchema = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/settings/settings.ts b/packages/astro-ghostcms/src/schemas/api/settings.ts similarity index 91% rename from packages/astro-ghostcms/src/api/content-api/schemas/settings/settings.ts rename to packages/astro-ghostcms/src/schemas/api/settings.ts index 8f91873d..240aa74b 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/settings/settings.ts +++ b/packages/astro-ghostcms/src/schemas/api/settings.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import { z } from "astro/zod"; export const settingsSchema = z.object({ title: z.string(), @@ -37,4 +37,4 @@ export const settingsSchema = z.object({ url: z.string(), }); -export type Settings = z.infer; +export type Settings = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/helpers/socials.ts b/packages/astro-ghostcms/src/schemas/api/socials.ts similarity index 99% rename from packages/astro-ghostcms/src/api/content-api/schemas/helpers/socials.ts rename to packages/astro-ghostcms/src/schemas/api/socials.ts index 95dc9a9b..9d07e4a1 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/helpers/socials.ts +++ b/packages/astro-ghostcms/src/schemas/api/socials.ts @@ -29,4 +29,4 @@ export const twitter = (username: string) => { export const facebook = (username: string) => { // Handles a starting slash, this shouldn't happen, but just in case return `https://www.facebook.com/${username.replace(/^\//, "")}`; -}; +}; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/tags/tags.ts b/packages/astro-ghostcms/src/schemas/api/tags.ts similarity index 96% rename from packages/astro-ghostcms/src/api/content-api/schemas/tags/tags.ts rename to packages/astro-ghostcms/src/schemas/api/tags.ts index e1a1eb0f..ef805c49 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/tags/tags.ts +++ b/packages/astro-ghostcms/src/schemas/api/tags.ts @@ -5,7 +5,7 @@ import { ghostSocialMediaSchema, ghostVisibilitySchema, } from "@ts-ghost/core-api"; -import { z } from "zod"; +import { z } from "astro/zod"; export const tagsSchema = z.object({ ...ghostIdentitySchema.shape, @@ -31,4 +31,4 @@ export type Tag = z.infer; export const tagsIncludeSchema = z.object({ "count.posts": z.literal(true).optional(), }); -export type TagsIncludeSchema = z.infer; +export type TagsIncludeSchema = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/api/content-api/schemas/tiers/tiers.ts b/packages/astro-ghostcms/src/schemas/api/tiers.ts similarity index 96% rename from packages/astro-ghostcms/src/api/content-api/schemas/tiers/tiers.ts rename to packages/astro-ghostcms/src/schemas/api/tiers.ts index a8571b89..7c6e8ef3 100644 --- a/packages/astro-ghostcms/src/api/content-api/schemas/tiers/tiers.ts +++ b/packages/astro-ghostcms/src/schemas/api/tiers.ts @@ -1,5 +1,5 @@ import { ghostIdentitySchema, ghostVisibilitySchema } from "@ts-ghost/core-api"; -import { z } from "zod"; +import { z } from "astro/zod"; export const tiersSchema = z.object({ ...ghostIdentitySchema.shape, @@ -37,4 +37,4 @@ export const tiersIncludeSchema = z.object({ yearly_price: z.literal(true).optional(), benefits: z.literal(true).optional(), }); -export type TiersIncludeSchema = z.infer; +export type TiersIncludeSchema = z.infer; \ No newline at end of file diff --git a/packages/astro-ghostcms/src/schemas/index.ts b/packages/astro-ghostcms/src/schemas/index.ts deleted file mode 100644 index eb3d58e3..00000000 --- a/packages/astro-ghostcms/src/schemas/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./robots"; -export * from "./sitemap"; -export * from "./userconfig"; diff --git a/packages/astro-ghostcms/src/schemas/userconfig.ts b/packages/astro-ghostcms/src/schemas/userconfig.ts index b949e271..3b281af7 100644 --- a/packages/astro-ghostcms/src/schemas/userconfig.ts +++ b/packages/astro-ghostcms/src/schemas/userconfig.ts @@ -1,7 +1,8 @@ import { z } from "astro/zod"; -import { RobotsTxtSchema, SitemapSchema } from "./index"; +import { RobotsTxtSchema } from "./robots.ts"; +import { SitemapSchema } from "./sitemap.ts"; -export const UserConfigSchema = z.object({ +export const GhostUserConfigSchema = z.object({ /** OPTIONAL - Either set the URL in your .env or put it here * @example * // https://astro.build/config @@ -13,31 +14,24 @@ export const UserConfigSchema = z.object({ * ], * }); */ ghostURL: z.string().url().optional(), - /** OPTIONAL - Allows the user to disable the `/rss.xml` injection */ - disableRSS: z.boolean().default(false), - /** OPTIONAL - Allows the user to disable the `/open-graph/*` route injection - * @ This feature uses `satori` to generate OpenGraph Images + /** OPTIONAL - Disable the theme provider + * @default false */ - disableSatoriOG: z.boolean().default(false), - /** OPTIONAL - Allows the user to disable the `/404` injection */ - disable404: z.boolean().default(false), - /** OPTIONAL - Disable Route Injector - * This option allows the user to disable the route injection system and utilize just the integraions other functions. Such as API, sitemap and robotstxt integrations. */ - disableRouteInjection: z.boolean().default(false), - /** OPTIONAL - (Default: true) Allows the user to disable "info" console output */ - disableConsoleOutput: z.boolean().default(true), - /** OPTIONAL - Theme Selector - * This option allows the user to replace the included theme with an external npm module - * @example - * // https://astro.build/config - * export default defineConfig({ - * integrations: [ - * ghostcms({ - * theme: "@matthiesenxyz/astro-ghostcms-theme-default" - * }) - * ], - * }); */ - theme: z.string().default("@matthiesenxyz/astro-ghostcms-theme-default"), + disableThemeProvider: z.boolean().optional().default(false), + ThemeProvider: z.object({ + /** OPTIONAL - Set the theme you want to use + * @default "@matthiesenxyz/astro-ghostcms-theme-default" + */ + theme: z.string().optional().default("@matthiesenxyz/astro-ghostcms-theme-default"), + }).optional(), + /** Allows the user to disable the provided 404 page */ + disableDefault404: z.boolean().optional().default(false), + /** Allows the user to disable the provided RSS Feed */ + enableRSSFeed: z.boolean().optional().default(true), + /** Allows the user to Enable or Disable the default Satori OG Image Generation + * @default true + */ + enableOGImages: z.boolean().optional().default(true), /** OPTIONAL - astrojs/sitemap * This option allows the user to configure the included integration * Options shown are the availble options @@ -50,8 +44,11 @@ export const UserConfigSchema = z.object({ * REFERENCE https://www.npmjs.com/package/astro-robots-txt#configuration */ robotstxt: RobotsTxtSchema.optional(), + /** Allows the user to turn on/off Full Console Logs + * @default true + */ + fullConsoleLogs: z.boolean().optional().default(false), }); /** USER CONFIGURATION SCHEMA */ -export type UserConfig = z.infer; -export type GhostUserConfig = z.infer; +export type GhostUserConfig = z.infer; diff --git a/packages/astro-ghostcms/src/utils/add-virtual-import.test.ts b/packages/astro-ghostcms/src/utils/add-virtual-import.test.ts deleted file mode 100644 index 8e2374dd..00000000 --- a/packages/astro-ghostcms/src/utils/add-virtual-import.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** MIT License - -Copyright (c) 2024 Florian Lefebvre - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. */ -import { type Mock, afterEach, describe, expect, test, vi } from "vitest"; -import { addVirtualImport } from "./add-virtual-import.js"; -import { addVitePlugin } from "./add-vite-plugin.js"; - -vi.mock("./add-vite-plugin"); - -const pluginNameStub = (name: T): `vite-plugin-${T}` => - `vite-plugin-${name}`; - -describe("add-virtual-import", () => { - const name = "test-module"; - const content = "export default {}"; - - afterEach(() => { - vi.clearAllMocks(); - }); - - test("It should call `addVitePlugin`", () => { - const updateConfig = vi.fn(); - - addVirtualImport({ - name, - content, - updateConfig, - }); - - expect(addVitePlugin).toHaveBeenCalled(); - }); - - test("`addVitePlugin` should get called with the correct plugin name", () => { - const updateConfig = vi.fn(); - - addVirtualImport({ - name, - content, - updateConfig, - }); - - const expectedName = pluginNameStub(name); - - const { plugin } = (addVitePlugin as Mock).mock.lastCall[0]; - - expect(plugin.name).toEqual(expectedName); - }); - - test("Virtual module should resolve correct name", () => { - const updateConfig = vi.fn(); - - addVirtualImport({ - name, - content, - updateConfig, - }); - - const { plugin } = (addVitePlugin as Mock).mock.lastCall[0]; - - const resolvedVirtualModuleId = plugin.resolveId(name); - - expect(resolvedVirtualModuleId).toEqual(`\0${name}`); - }); -}); diff --git a/packages/astro-ghostcms/src/utils/add-virtual-import.ts b/packages/astro-ghostcms/src/utils/add-virtual-import.ts deleted file mode 100644 index c655f947..00000000 --- a/packages/astro-ghostcms/src/utils/add-virtual-import.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** MIT License - -Copyright (c) 2024 Florian Lefebvre - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. */ -import type { HookParameters } from "astro"; -import type { Plugin } from "vite"; -import { addVitePlugin } from "./add-vite-plugin.js"; - -const resolveVirtualModuleId = (id: T): `\0${T}` => { - return `\0${id}`; -}; - -const createVirtualModule = (name: string, content: string): Plugin => { - const pluginName = `vite-plugin-${name}`; - - return { - name: pluginName, - resolveId(id) { - if (id === name) { - return resolveVirtualModuleId(id); - } - }, - load(id) { - if (id === resolveVirtualModuleId(name)) { - return content; - } - }, - }; -}; - -/** - * Creates a Vite virtual module and updates the Astro config. - * Virtual imports are useful for passing things like config options, or data computed within the integration. - * - * @param {object} params - * @param {string} params.name - * @param {string} params.content - * @param {import("astro").HookParameters<"astro:config:setup">["updateConfig"]} params.updateConfig - * - * @see https://astro-integration-kit.netlify.app/utilities/add-virtual-import/ - * - * @example - * ```ts - * // my-integration/index.ts - * import { addVirtualImport } from "astro-integration-kit"; - * - * addVirtualImport( - * name: 'virtual:my-integration/config', - * content: `export default ${ JSON.stringify({foo: "bar"}) }`, - * updateConfig - * ); - * ``` - * - * This is then readable anywhere else in your integration: - * - * ```ts - * // myIntegration/src/component/layout.astro - * import config from "virtual:my-integration/config"; - * - * console.log(config.foo) // "bar" - * ``` - */ -export const addVirtualImport = ({ - name, - content, - updateConfig, -}: { - name: string; - content: string; - updateConfig: HookParameters<"astro:config:setup">["updateConfig"]; -}) => { - addVitePlugin({ - plugin: createVirtualModule(name, content), - updateConfig, - }); -}; diff --git a/packages/astro-ghostcms/src/utils/add-vite-plugin.test.ts b/packages/astro-ghostcms/src/utils/add-vite-plugin.test.ts deleted file mode 100644 index 203f888a..00000000 --- a/packages/astro-ghostcms/src/utils/add-vite-plugin.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { Plugin } from "vite"; -import { describe, expect, test, vi } from "vitest"; -import { addVitePlugin } from "./add-vite-plugin.js"; - -describe("addVitePlugin", () => { - test("Should run", () => { - const updateConfig = vi.fn(); - - expect(() => - addVitePlugin({ - plugin: null, - updateConfig, - }), - ).not.toThrow(); - }); - - test("Should call updateConfig", () => { - const updateConfig = vi.fn(); - - addVitePlugin({ - plugin: null, - updateConfig, - }); - - expect(updateConfig).toHaveBeenCalled(); - }); - - test("Should add vite plugin", () => { - let plugin: Plugin; - const pluginName = "test-plugin"; - - const updateConfig = vi.fn((config) => { - plugin = config.vite.plugins[0]; - }); - - const expectedPlugin = { - name: pluginName, - }; - - addVitePlugin({ - plugin: expectedPlugin, - updateConfig, - }); - - // @ts-ignore - expect(plugin).toBeDefined(); - }); - - test("Plugin name should match", () => { - let plugin: Plugin; - const pluginName = "test-plugin"; - - const updateConfig = vi.fn((config) => { - plugin = config.vite.plugins[0]; - }); - - const expectedPlugin = { - name: pluginName, - }; - - addVitePlugin({ - plugin: expectedPlugin, - updateConfig, - }); - - // @ts-ignore - expect(plugin.name).toBe(pluginName); - }); -}); diff --git a/packages/astro-ghostcms/src/utils/add-vite-plugin.ts b/packages/astro-ghostcms/src/utils/add-vite-plugin.ts deleted file mode 100644 index 8d0279ba..00000000 --- a/packages/astro-ghostcms/src/utils/add-vite-plugin.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** MIT License - -Copyright (c) 2024 Florian Lefebvre - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. */ -import type { HookParameters } from "astro"; -import type { PluginOption } from "vite"; - -/** - * Adds a [vite plugin](https://vitejs.dev/guide/using-plugins) to the - * Astro config. - * - * @param {Params} params - * @param {import("vite").Plugin} params.plugin - * @param {import("astro").HookParameters<"astro:config:setup">["updateConfig"]} params.updateConfig - * - * @see https://astro-integration-kit.netlify.app/utilities/add-vite-plugin/ - * - * @example - * ```ts - * addVitePlugin({ - * plugin, - * updateConfig - * }) - * ``` - */ -export const addVitePlugin = ({ - plugin, - updateConfig, -}: { - plugin: PluginOption; - updateConfig: HookParameters<"astro:config:setup">["updateConfig"]; -}) => { - updateConfig({ - vite: { - plugins: [plugin], - }, - }); -}; diff --git a/packages/astro-ghostcms/src/utils/latestVersion.ts b/packages/astro-ghostcms/src/utils/latestVersion.ts deleted file mode 100644 index b41085af..00000000 --- a/packages/astro-ghostcms/src/utils/latestVersion.ts +++ /dev/null @@ -1,26 +0,0 @@ -import packageJson from "package-json"; - -export type Options = { - /** - A semver range or [dist-tag](https://docs.npmjs.com/cli/dist-tag). - */ - readonly version?: string; -}; - -/** -Get the latest version of an npm package. - -@example -``` -console.log(await latestVersion('ava')); -//=> '0.18.0' -``` -*/ -export default async function latestVersion( - packageName: string, - options?: Options, -) { - const { version } = await packageJson(packageName.toLowerCase(), options); - - return version; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/ValidationError.js b/packages/astro-ghostcms/src/utils/zod-validation/ValidationError.js deleted file mode 100644 index ff3e97ce..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/ValidationError.js +++ /dev/null @@ -1,22 +0,0 @@ -import * as zod from "zod"; -export class ValidationError extends Error { - name; - details; - constructor(message, options) { - super(message, options); - this.name = "ZodValidationError"; - this.details = getIssuesFromErrorOptions(options); - } - toString() { - return this.message; - } -} -function getIssuesFromErrorOptions(options) { - if (options) { - const cause = options.cause; - if (cause instanceof zod.ZodError) { - return cause.issues; - } - } - return []; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/config.js b/packages/astro-ghostcms/src/utils/zod-validation/config.js deleted file mode 100644 index c3d9c30a..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/config.js +++ /dev/null @@ -1,5 +0,0 @@ -export const ISSUE_SEPARATOR = "; "; -export const MAX_ISSUES_IN_MESSAGE = 99; -export const PREFIX = "Validation error"; -export const PREFIX_SEPARATOR = ": "; -export const UNION_SEPARATOR = ", or "; diff --git a/packages/astro-ghostcms/src/utils/zod-validation/errorMap.js b/packages/astro-ghostcms/src/utils/zod-validation/errorMap.js deleted file mode 100644 index dae66709..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/errorMap.js +++ /dev/null @@ -1,10 +0,0 @@ -import { fromZodIssue } from "./fromZodIssue"; -export const errorMap = (issue, ctx) => { - const error = fromZodIssue({ - ...issue, - message: issue.message ?? ctx.defaultError, - }); - return { - message: error.message, - }; -}; diff --git a/packages/astro-ghostcms/src/utils/zod-validation/fromZodError.js b/packages/astro-ghostcms/src/utils/zod-validation/fromZodError.js deleted file mode 100644 index e5a0e383..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/fromZodError.js +++ /dev/null @@ -1,37 +0,0 @@ -import { ValidationError } from "./ValidationError"; -import { - ISSUE_SEPARATOR, - MAX_ISSUES_IN_MESSAGE, - PREFIX, - PREFIX_SEPARATOR, - UNION_SEPARATOR, -} from "./config"; -import { getMessageFromZodIssue } from "./fromZodIssue"; -import { prefixMessage } from "./prefixMessage"; -export function fromZodError(zodError, options = {}) { - const { - maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE, - issueSeparator = ISSUE_SEPARATOR, - unionSeparator = UNION_SEPARATOR, - prefixSeparator = PREFIX_SEPARATOR, - prefix = PREFIX, - includePath = true, - } = options; - const zodIssues = zodError.errors; - const reason = - zodIssues.length === 0 - ? zodError.message - : zodIssues - .slice(0, maxIssuesInMessage) - .map((issue) => - getMessageFromZodIssue({ - issue, - issueSeparator, - unionSeparator, - includePath, - }), - ) - .join(issueSeparator); - const message = prefixMessage(reason, prefix, prefixSeparator); - return new ValidationError(message, { cause: zodError }); -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/fromZodIssue.js b/packages/astro-ghostcms/src/utils/zod-validation/fromZodIssue.js deleted file mode 100644 index fa5dddc5..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/fromZodIssue.js +++ /dev/null @@ -1,61 +0,0 @@ -import * as zod from "zod"; -import { ValidationError } from "./ValidationError"; -import { - ISSUE_SEPARATOR, - PREFIX, - PREFIX_SEPARATOR, - UNION_SEPARATOR, -} from "./config"; -import { prefixMessage } from "./prefixMessage"; -import { isNonEmptyArray } from "./utils/NonEmptyArray"; -import { joinPath } from "./utils/joinPath"; -export function getMessageFromZodIssue(props) { - const { issue, issueSeparator, unionSeparator, includePath } = props; - if (issue.code === "invalid_union") { - return issue.unionErrors - .reduce((acc, zodError) => { - const newIssues = zodError.issues - .map((issue) => - getMessageFromZodIssue({ - issue, - issueSeparator, - unionSeparator, - includePath, - }), - ) - .join(issueSeparator); - if (!acc.includes(newIssues)) { - acc.push(newIssues); - } - return acc; - }, []) - .join(unionSeparator); - } - if (includePath && isNonEmptyArray(issue.path)) { - if (issue.path.length === 1) { - const identifier = issue.path[0]; - if (typeof identifier === "number") { - return `${issue.message} at index ${identifier}`; - } - } - return `${issue.message} at "${joinPath(issue.path)}"`; - } - return issue.message; -} -export function fromZodIssue(issue, options = {}) { - const { - issueSeparator = ISSUE_SEPARATOR, - unionSeparator = UNION_SEPARATOR, - prefixSeparator = PREFIX_SEPARATOR, - prefix = PREFIX, - includePath = true, - } = options; - const reason = getMessageFromZodIssue({ - issue, - issueSeparator, - unionSeparator, - includePath, - }); - const message = prefixMessage(reason, prefix, prefixSeparator); - return new ValidationError(message, { cause: new zod.ZodError([issue]) }); -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/index.js b/packages/astro-ghostcms/src/utils/zod-validation/index.js deleted file mode 100644 index 3c273d4a..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/index.js +++ /dev/null @@ -1,7 +0,0 @@ -export { ValidationError } from "./ValidationError"; -export { isValidationError } from "./isValidationError"; -export { isValidationErrorLike } from "./isValidationErrorLike"; -export { errorMap } from "./errorMap"; -export { fromZodIssue } from "./fromZodIssue"; -export { fromZodError } from "./fromZodError"; -export { toValidationError } from "./toValidationError"; diff --git a/packages/astro-ghostcms/src/utils/zod-validation/isValidationError.js b/packages/astro-ghostcms/src/utils/zod-validation/isValidationError.js deleted file mode 100644 index 4df3123c..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/isValidationError.js +++ /dev/null @@ -1,4 +0,0 @@ -import { ValidationError } from "./ValidationError"; -export function isValidationError(err) { - return err instanceof ValidationError; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/isValidationErrorLike.js b/packages/astro-ghostcms/src/utils/zod-validation/isValidationErrorLike.js deleted file mode 100644 index 120a726b..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/isValidationErrorLike.js +++ /dev/null @@ -1,3 +0,0 @@ -export function isValidationErrorLike(err) { - return err instanceof Error && err.name === "ZodValidationError"; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/prefixMessage.js b/packages/astro-ghostcms/src/utils/zod-validation/prefixMessage.js deleted file mode 100644 index 3016dcba..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/prefixMessage.js +++ /dev/null @@ -1,13 +0,0 @@ -import { PREFIX } from "./config"; -export function prefixMessage(message, prefix, prefixSeparator) { - if (prefix !== null) { - if (message.length > 0) { - return [prefix, message].join(prefixSeparator); - } - return prefix; - } - if (message.length > 0) { - return message; - } - return PREFIX; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/toValidationError.js b/packages/astro-ghostcms/src/utils/zod-validation/toValidationError.js deleted file mode 100644 index ea7e74f6..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/toValidationError.js +++ /dev/null @@ -1,14 +0,0 @@ -import * as zod from "zod"; -import { ValidationError } from "./ValidationError"; -import { fromZodError } from "./fromZodError"; -export const toValidationError = - (options = {}) => - (err) => { - if (err instanceof zod.ZodError) { - return fromZodError(err, options); - } - if (err instanceof Error) { - return new ValidationError(err.message, { cause: err }); - } - return new ValidationError("Unknown error"); - }; diff --git a/packages/astro-ghostcms/src/utils/zod-validation/utils/NonEmptyArray.js b/packages/astro-ghostcms/src/utils/zod-validation/utils/NonEmptyArray.js deleted file mode 100644 index 9fd10456..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/utils/NonEmptyArray.js +++ /dev/null @@ -1,3 +0,0 @@ -export function isNonEmptyArray(value) { - return value.length !== 0; -} diff --git a/packages/astro-ghostcms/src/utils/zod-validation/utils/joinPath.js b/packages/astro-ghostcms/src/utils/zod-validation/utils/joinPath.js deleted file mode 100644 index 86cef5ef..00000000 --- a/packages/astro-ghostcms/src/utils/zod-validation/utils/joinPath.js +++ /dev/null @@ -1,22 +0,0 @@ -const identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u; -export function joinPath(path) { - if (path.length === 1) { - return path[0].toString(); - } - return path.reduce((acc, item) => { - if (typeof item === "number") { - return `${acc}[${item.toString()}]`; - } - if (item.includes('"')) { - return `${acc}["${escapeQuotes(item)}"]`; - } - if (!identifierRegex.test(item)) { - return `${acc}["${item}"]`; - } - const separator = acc.length === 0 ? "" : "."; - return acc + separator + item; - }, ""); -} -function escapeQuotes(str) { - return str.replace(/"/g, '\\"'); -} diff --git a/packages/astro-ghostcms/vitest.config.ts b/packages/astro-ghostcms/vitest.config.ts deleted file mode 100644 index deec7256..00000000 --- a/packages/astro-ghostcms/vitest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// -/// - -import tsconfigPaths from "vite-tsconfig-paths"; -import { defineProject } from "vitest/config"; - -export default defineProject({ - plugins: [tsconfigPaths()], - test: { - globals: true, - include: ["./**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], - watchExclude: [".*\\/node_modules\\/.*", ".*\\/build\\/.*"], - exclude: ["node_modules", "dist", ".idea", ".git", ".cache"], - }, -}); diff --git a/playground/.env b/playground/.env deleted file mode 100644 index e1699c0e..00000000 --- a/playground/.env +++ /dev/null @@ -1,2 +0,0 @@ -CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48 -CONTENT_API_URL=https://ghostdemo.matthiesen.xyz \ No newline at end of file diff --git a/playground/src/env.d.ts b/playground/src/env.d.ts deleted file mode 100644 index f964fe0c..00000000 --- a/playground/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/playgrounds/astro-playground/.env b/playgrounds/astro-playground/.env new file mode 100644 index 00000000..8f084c23 --- /dev/null +++ b/playgrounds/astro-playground/.env @@ -0,0 +1 @@ +CONTENT_API_KEY=a33da3965a3a9fb2c6b3f63b48 \ No newline at end of file diff --git a/playground/.gitignore b/playgrounds/astro-playground/.gitignore similarity index 100% rename from playground/.gitignore rename to playgrounds/astro-playground/.gitignore diff --git a/playground/.vscode/extensions.json b/playgrounds/astro-playground/.vscode/extensions.json similarity index 100% rename from playground/.vscode/extensions.json rename to playgrounds/astro-playground/.vscode/extensions.json diff --git a/playground/.vscode/launch.json b/playgrounds/astro-playground/.vscode/launch.json similarity index 100% rename from playground/.vscode/launch.json rename to playgrounds/astro-playground/.vscode/launch.json diff --git a/playground/CHANGELOG.md b/playgrounds/astro-playground/CHANGELOG.md similarity index 100% rename from playground/CHANGELOG.md rename to playgrounds/astro-playground/CHANGELOG.md diff --git a/playground/LICENSE b/playgrounds/astro-playground/LICENSE similarity index 100% rename from playground/LICENSE rename to playgrounds/astro-playground/LICENSE diff --git a/playground/README.md b/playgrounds/astro-playground/README.md similarity index 100% rename from playground/README.md rename to playgrounds/astro-playground/README.md diff --git a/playground/astro.config.mjs b/playgrounds/astro-playground/astro.config.mjs similarity index 71% rename from playground/astro.config.mjs rename to playgrounds/astro-playground/astro.config.mjs index 3dc022d3..934e3c7a 100644 --- a/playground/astro.config.mjs +++ b/playgrounds/astro-playground/astro.config.mjs @@ -10,12 +10,10 @@ export default defineConfig({ //tailwind(), UnoCSS({ injectReset: true }), ghostcms({ - disable404: false, - disableRSS: false, - disableRouteInjection: false, - disableConsoleOutput: false, - theme: "@matthiesenxyz/astro-ghostcms-brutalbyelian", ghostURL: "https://ghostdemo.matthiesen.xyz", + ThemeProvider: { + theme: '@matthiesenxyz/astro-ghostcms-brutalbyelian', + }, }), ], }); diff --git a/playground/package.json b/playgrounds/astro-playground/package.json similarity index 79% rename from playground/package.json rename to playgrounds/astro-playground/package.json index e78563f4..533aece7 100644 --- a/playground/package.json +++ b/playgrounds/astro-playground/package.json @@ -1,5 +1,5 @@ { - "name": "playground", + "name": "astro-playground", "type": "module", "version": "0.0.2", "private": true, @@ -12,10 +12,8 @@ }, "dependencies": { "astro": "^4.4.0", - "@matthiesenxyz/astro-ghostcms-theme-default": "workspace:*", - "@matthiesenxyz/astro-ghostcms-catppuccin": "workspace:*", - "@matthiesenxyz/astro-ghostcms-brutalbyelian": "workspace:*", "@matthiesenxyz/astro-ghostcms": "workspace:*", + "@matthiesenxyz/astro-ghostcms-brutalbyelian": "workspace:*", "@astrojs/tailwind": "^5.1.0", "@unocss/astro": "^0.58.5", "tailwindcss": "^3.3.5" diff --git a/playground/public/favicon.svg b/playgrounds/astro-playground/public/favicon.svg similarity index 100% rename from playground/public/favicon.svg rename to playgrounds/astro-playground/public/favicon.svg diff --git a/playgrounds/astro-playground/src/env.d.ts b/playgrounds/astro-playground/src/env.d.ts new file mode 100644 index 00000000..e49580d9 --- /dev/null +++ b/playgrounds/astro-playground/src/env.d.ts @@ -0,0 +1,3 @@ +/// +/// +/// diff --git a/playground/tailwind.config.cjs b/playgrounds/astro-playground/tailwind.config.cjs similarity index 100% rename from playground/tailwind.config.cjs rename to playgrounds/astro-playground/tailwind.config.cjs diff --git a/playground/tsconfig.json b/playgrounds/astro-playground/tsconfig.json similarity index 100% rename from playground/tsconfig.json rename to playgrounds/astro-playground/tsconfig.json diff --git a/playground/uno.config.ts b/playgrounds/astro-playground/uno.config.ts similarity index 100% rename from playground/uno.config.ts rename to playgrounds/astro-playground/uno.config.ts diff --git a/starlight-playground/.gitignore b/playgrounds/starlight-playground/.gitignore similarity index 100% rename from starlight-playground/.gitignore rename to playgrounds/starlight-playground/.gitignore diff --git a/starlight-playground/.vscode/extensions.json b/playgrounds/starlight-playground/.vscode/extensions.json similarity index 100% rename from starlight-playground/.vscode/extensions.json rename to playgrounds/starlight-playground/.vscode/extensions.json diff --git a/starlight-playground/.vscode/launch.json b/playgrounds/starlight-playground/.vscode/launch.json similarity index 100% rename from starlight-playground/.vscode/launch.json rename to playgrounds/starlight-playground/.vscode/launch.json diff --git a/starlight-playground/astro.config.mjs b/playgrounds/starlight-playground/astro.config.mjs similarity index 100% rename from starlight-playground/astro.config.mjs rename to playgrounds/starlight-playground/astro.config.mjs diff --git a/starlight-playground/package.json b/playgrounds/starlight-playground/package.json similarity index 100% rename from starlight-playground/package.json rename to playgrounds/starlight-playground/package.json diff --git a/starlight-playground/public/favicon.svg b/playgrounds/starlight-playground/public/favicon.svg similarity index 100% rename from starlight-playground/public/favicon.svg rename to playgrounds/starlight-playground/public/favicon.svg diff --git a/starlight-playground/src/assets/houston.webp b/playgrounds/starlight-playground/src/assets/houston.webp similarity index 100% rename from starlight-playground/src/assets/houston.webp rename to playgrounds/starlight-playground/src/assets/houston.webp diff --git a/starlight-playground/src/content/config.ts b/playgrounds/starlight-playground/src/content/config.ts similarity index 100% rename from starlight-playground/src/content/config.ts rename to playgrounds/starlight-playground/src/content/config.ts diff --git a/starlight-playground/src/content/docs/guides/example.md b/playgrounds/starlight-playground/src/content/docs/guides/example.md similarity index 100% rename from starlight-playground/src/content/docs/guides/example.md rename to playgrounds/starlight-playground/src/content/docs/guides/example.md diff --git a/starlight-playground/src/content/docs/index.mdx b/playgrounds/starlight-playground/src/content/docs/index.mdx similarity index 100% rename from starlight-playground/src/content/docs/index.mdx rename to playgrounds/starlight-playground/src/content/docs/index.mdx diff --git a/starlight-playground/src/content/docs/reference/example.md b/playgrounds/starlight-playground/src/content/docs/reference/example.md similarity index 100% rename from starlight-playground/src/content/docs/reference/example.md rename to playgrounds/starlight-playground/src/content/docs/reference/example.md diff --git a/starlight-playground/src/env.d.ts b/playgrounds/starlight-playground/src/env.d.ts similarity index 100% rename from starlight-playground/src/env.d.ts rename to playgrounds/starlight-playground/src/env.d.ts diff --git a/starlight-playground/tsconfig.json b/playgrounds/starlight-playground/tsconfig.json similarity index 100% rename from starlight-playground/tsconfig.json rename to playgrounds/starlight-playground/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d3f2040..4965dfb2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,7 +19,7 @@ importers: version: 1.3.0(vitest@1.3.0) vitest: specifier: ^1.3.0 - version: 1.3.0(@vitest/ui@1.3.0) + version: 1.3.0(@types/node@20.11.19)(@vitest/ui@1.3.0) vitest-fetch-mock: specifier: ^0.2.2 version: 0.2.2(vitest@1.3.0) @@ -38,82 +38,33 @@ importers: '@resvg/resvg-js': specifier: ^2.6.0 version: 2.6.0 + '@ts-ghost/content-api': + specifier: ^4.0.12 + version: 4.0.12 '@ts-ghost/core-api': - specifier: ^5.1.2 - version: 5.1.2 + specifier: ^6.0.0 + version: 6.0.0 astro: - specifier: ^4.4.0 - version: 4.4.0(@types/node@20.11.19)(typescript@5.3.3) + specifier: ^4.4.1 + version: 4.4.9 + astro-integration-kit: + specifier: ^0.5.0 + version: 0.5.0(astro@4.4.9) astro-robots-txt: specifier: ^1.0.0 version: 1.0.0 - fs-extra: - specifier: ^11.1.0 - version: 11.2.0 - package-json: - specifier: 9.0.0 - version: 9.0.0 + picocolors: + specifier: 1.0.0 + version: 1.0.0 satori: - specifier: ^0.10.11 + specifier: ^0.10.13 version: 0.10.13 satori-html: - specifier: ^0.3.2 + specifier: 0.3.2 version: 0.3.2 vite: - specifier: ^5.1.3 - version: 5.1.3(@types/node@20.11.19) - vite-tsconfig-paths: - specifier: ^4.2.2 - version: 4.3.1(typescript@5.3.3)(vite@5.1.3) - zod: - specifier: ^3.22.4 - version: 3.22.4 - devDependencies: - '@astrojs/check': - specifier: ^0.5.4 - version: 0.5.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3) - '@matthiesenxyz/astro-ghostcms-catppuccin': - specifier: '*' - version: link:../astro-ghostcms-catppuccin - '@ts-ghost/tsconfig': - specifier: '*' - version: link:../tsconfig - '@types/fs-extra': - specifier: ^11.0.1 - version: 11.0.4 - '@types/node': - specifier: ^20.11.19 - version: 20.11.19 - '@typescript-eslint/eslint-plugin': - specifier: ^7.0.1 - version: 7.0.1(@typescript-eslint/parser@7.0.1)(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/parser': - specifier: ^7.0.1 - version: 7.0.1(eslint@8.56.0)(typescript@5.3.3) - eslint: - specifier: ^8.56.0 - version: 8.56.0 - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@8.56.0) - eslint-plugin-astro: - specifier: ^0.31.4 - version: 0.31.4(eslint@8.56.0) - prettier: - specifier: ^3.2.5 - version: 3.2.5 - prettier-plugin-astro: - specifier: ^0.13.0 - version: 0.13.0 - typescript: - specifier: ^5.3.3 - version: 5.3.3 - vitest: - specifier: ^1.3.0 - version: 1.3.0(@types/node@20.11.19)(@vitest/ui@1.3.0) - vitest-fetch-mock: - specifier: ^0.2.2 - version: 0.2.2(vitest@1.3.0) + specifier: ^5.1.4 + version: 5.1.4(@types/node@20.11.19) packages/astro-ghostcms-brutalbyelian: dependencies: @@ -128,19 +79,19 @@ importers: version: 1.1.8 '@matthiesenxyz/astro-ghostcms': specifier: ^3.2.9 - version: link:../astro-ghostcms + version: 3.2.9(typescript@5.3.3) '@matthiesenxyz/astro-ghostcms-rendercontent': specifier: ^0.0.7 version: link:../astro-ghostcms-rendercontent '@unocss/astro': specifier: ^0.58.5 - version: 0.58.5(vite@5.1.3) + version: 0.58.5(vite@5.1.4) '@unocss/reset': specifier: ^0.58.5 version: 0.58.5 astro: specifier: ^4.2.0 - version: 4.3.7(sass@1.71.0)(typescript@5.3.3) + version: 4.3.7(typescript@5.3.3) astro-font: specifier: ^0.0.77 version: 0.0.77 @@ -152,7 +103,7 @@ importers: version: 1.5.2 unocss: specifier: ^0.58.5 - version: 0.58.5(postcss@8.4.35)(vite@5.1.3) + version: 0.58.5(postcss@8.4.35)(vite@5.1.4) devDependencies: '@typescript-eslint/parser': specifier: ^7.0.1 @@ -186,13 +137,13 @@ importers: version: 5.0.16 '@matthiesenxyz/astro-ghostcms': specifier: ^3.2.9 - version: link:../astro-ghostcms + version: 3.2.9(typescript@5.3.3) '@tailwindcss/typography': specifier: ^0.5.10 version: 0.5.10(tailwindcss@3.4.1) astro: specifier: ^4.2.1 - version: 4.3.7(sass@1.71.0)(typescript@5.3.3) + version: 4.3.7(typescript@5.3.3) astro-navbar: specifier: ^2.3.1 version: 2.3.1 @@ -220,7 +171,7 @@ importers: dependencies: '@matthiesenxyz/astro-ghostcms': specifier: ^3.2.9 - version: link:../astro-ghostcms + version: 3.2.9(sass@1.71.0)(typescript@5.3.3) astro: specifier: ^4.2.1 version: 4.3.7(sass@1.71.0)(typescript@5.3.3) @@ -233,7 +184,7 @@ importers: devDependencies: '@astrojs/check': specifier: ^0.5.4 - version: 0.5.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3) + version: 0.5.4(typescript@5.3.3) typescript: specifier: ^5.3.3 version: 5.3.3 @@ -312,10 +263,10 @@ importers: version: 5.1.2 vite: specifier: ^5.1.2 - version: 5.1.3(sass@1.71.0) + version: 5.1.3(@types/node@20.11.19) vite-tsconfig-paths: specifier: ^4.2.2 - version: 4.3.1(vite@5.1.3) + version: 4.3.1(typescript@5.3.3)(vite@5.1.3) devDependencies: '@astrojs/starlight': specifier: ^0.19.0 @@ -335,26 +286,20 @@ importers: packages/tsconfig: {} - playground: + playgrounds/astro-playground: dependencies: '@astrojs/tailwind': specifier: ^5.1.0 version: 5.1.0(astro@4.4.0)(tailwindcss@3.4.1) '@matthiesenxyz/astro-ghostcms': specifier: workspace:* - version: link:../packages/astro-ghostcms + version: link:../../packages/astro-ghostcms '@matthiesenxyz/astro-ghostcms-brutalbyelian': specifier: workspace:* - version: link:../packages/astro-ghostcms-brutalbyelian - '@matthiesenxyz/astro-ghostcms-catppuccin': - specifier: workspace:* - version: link:../packages/astro-ghostcms-catppuccin - '@matthiesenxyz/astro-ghostcms-theme-default': - specifier: workspace:* - version: link:../packages/astro-ghostcms-theme-default + version: link:../../packages/astro-ghostcms-brutalbyelian '@unocss/astro': specifier: ^0.58.5 - version: 0.58.5(vite@5.1.3) + version: 0.58.5(vite@5.1.4) astro: specifier: ^4.4.0 version: 4.4.0(typescript@5.3.3) @@ -370,16 +315,16 @@ importers: version: 5.3.3 unocss: specifier: ^0.58.5 - version: 0.58.5(postcss@8.4.35)(vite@5.1.3) + version: 0.58.5(postcss@8.4.35)(vite@5.1.4) - starlight-playground: + playgrounds/starlight-playground: dependencies: '@astrojs/starlight': specifier: ^0.19.0 version: 0.19.0(astro@4.4.0) '@matthiesenxyz/starlight-ghostcms': specifier: workspace:* - version: link:../packages/starlight-ghostcms + version: link:../../packages/starlight-ghostcms astro: specifier: ^4.4.0 version: 4.4.0(typescript@5.3.3) @@ -415,13 +360,13 @@ packages: /@antfu/utils@0.7.7: resolution: {integrity: sha512-gFPqTG7otEJ8uP6wrhDv6mqwGWYZKNvAcCq6u9hOj0c+IKCEsY4L1oC9trPq2SaWIzAfHvqfBDxF591JkMf+kg==} - /@astrojs/check@0.5.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3): + /@astrojs/check@0.5.4(typescript@5.3.3): resolution: {integrity: sha512-BFClaLEuRzpfF9wrmh9KDS5gmRHGhkVN7qvm6tWPBvUxOADXiNz+hzrYFvZVqXTXhHjS0Ern1g3yHifgu0zsmw==} hasBin: true peerDependencies: typescript: ^5.0.0 dependencies: - '@astrojs/language-server': 2.7.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3) + '@astrojs/language-server': 2.7.4(typescript@5.3.3) chokidar: 3.6.0 fast-glob: 3.3.2 kleur: 4.1.5 @@ -433,6 +378,7 @@ packages: /@astrojs/compiler@1.8.2: resolution: {integrity: sha512-o/ObKgtMzl8SlpIdzaxFnt7SATKPxu4oIP/1NL+HDJRzxfJcAkOTAb/ZKMRyULbz4q+1t2/DAebs2Z1QairkZw==} + dev: true /@astrojs/compiler@2.5.3: resolution: {integrity: sha512-jzj01BRv/fmo+9Mr2FhocywGzEYiyiP2GVHje1ziGNU6c97kwhYGsnvwMkHrncAy9T9Vi54cjaMK7UE4ClX4vA==} @@ -440,7 +386,7 @@ packages: /@astrojs/internal-helpers@0.2.1: resolution: {integrity: sha512-06DD2ZnItMwUnH81LBLco3tWjcZ1lGU9rLCCBaeUCGYe9cI0wKyY2W3kDyoW1I6GmcWgt1fu+D1CTvz+FIKf8A==} - /@astrojs/language-server@2.7.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3): + /@astrojs/language-server@2.7.4(typescript@5.3.3): resolution: {integrity: sha512-U317ZKx5VXg2Sy6iPgYOliOZ10Ji/eo8MGFCry2/yT+rYTfb81HbrSWUu9nsZzpFK66So5aprQutRWWM/m7mPQ==} hasBin: true peerDependencies: @@ -460,12 +406,10 @@ packages: '@volar/language-service': 2.0.4 '@volar/typescript': 2.0.4 fast-glob: 3.3.2 - prettier: 3.2.5 - prettier-plugin-astro: 0.13.0 volar-service-css: 0.0.29(@volar/language-service@2.0.4) volar-service-emmet: 0.0.29(@volar/language-service@2.0.4) volar-service-html: 0.0.29(@volar/language-service@2.0.4) - volar-service-prettier: 0.0.29(@volar/language-service@2.0.4)(prettier@3.2.5) + volar-service-prettier: 0.0.29(@volar/language-service@2.0.4) volar-service-typescript: 0.0.29(@volar/language-service@2.0.4)(@volar/typescript@2.0.4) volar-service-typescript-twoslash-queries: 0.0.29(@volar/language-service@2.0.4) vscode-html-languageservice: 5.1.2 @@ -570,7 +514,7 @@ packages: astro: ^3.0.0 || ^4.0.0 tailwindcss: ^3.0.24 dependencies: - astro: 4.3.7(sass@1.71.0)(typescript@5.3.3) + astro: 4.3.7(typescript@5.3.3) autoprefixer: 10.4.17(postcss@8.4.35) postcss: 8.4.35 postcss-load-config: 4.0.2(postcss@8.4.35) @@ -1572,6 +1516,84 @@ packages: globby: 11.1.0 read-yaml-file: 1.1.0 + /@matthiesenxyz/astro-ghostcms-theme-default@0.1.13(astro@4.4.0)(typescript@5.3.3): + resolution: {integrity: sha512-W3zMuu+lJNkO+ccCsjCuGDwe/j8U08WAOowDy2fmwb5vkMu5QWYlCv8tR4Gh3VKfWodRTYoJsSkxETIQ7pXKxQ==} + peerDependencies: + astro: ^4.2.1 + dependencies: + '@matthiesenxyz/astro-ghostcms': 3.2.9(sass@1.71.0)(typescript@5.3.3) + astro: 4.4.0(typescript@5.3.3) + astro-font: 0.0.77 + sass: 1.71.0 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - stylus + - sugarss + - supports-color + - terser + - typescript + dev: false + + /@matthiesenxyz/astro-ghostcms@3.2.9(sass@1.71.0)(typescript@5.3.3): + resolution: {integrity: sha512-LuMXWwo8/AozHKLuu9okjmDqZWSRuJ+Pt2ggZv/gMQrfD4CLIucS4UMl2YQviU1QpguY46j7SP9x0BoIAhFBeA==} + dependencies: + '@astrojs/rss': 4.0.5 + '@astrojs/sitemap': 3.0.5 + '@matthiesenxyz/astro-ghostcms-theme-default': 0.1.13(astro@4.4.0)(typescript@5.3.3) + '@resvg/resvg-js': 2.6.0 + '@ts-ghost/core-api': 5.1.2 + astro: 4.4.0(sass@1.71.0)(typescript@5.3.3) + astro-robots-txt: 1.0.0 + fs-extra: 11.2.0 + package-json: 9.0.0 + satori: 0.10.13 + satori-html: 0.3.2 + vite: 5.1.4(sass@1.71.0) + vite-tsconfig-paths: 4.3.1(typescript@5.3.3)(vite@5.1.4) + zod: 3.22.4 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + - typescript + dev: false + + /@matthiesenxyz/astro-ghostcms@3.2.9(typescript@5.3.3): + resolution: {integrity: sha512-LuMXWwo8/AozHKLuu9okjmDqZWSRuJ+Pt2ggZv/gMQrfD4CLIucS4UMl2YQviU1QpguY46j7SP9x0BoIAhFBeA==} + dependencies: + '@astrojs/rss': 4.0.5 + '@astrojs/sitemap': 3.0.5 + '@matthiesenxyz/astro-ghostcms-theme-default': 0.1.13(astro@4.4.0)(typescript@5.3.3) + '@resvg/resvg-js': 2.6.0 + '@ts-ghost/core-api': 5.1.2 + astro: 4.4.0(typescript@5.3.3) + astro-robots-txt: 1.0.0 + fs-extra: 11.2.0 + package-json: 9.0.0 + satori: 0.10.13 + satori-html: 0.3.2 + vite: 5.1.4(@types/node@20.11.19) + vite-tsconfig-paths: 4.3.1(typescript@5.3.3)(vite@5.1.4) + zod: 3.22.4 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + - typescript + dev: false + /@mdx-js/mdx@3.0.1: resolution: {integrity: sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA==} dependencies: @@ -1963,6 +1985,13 @@ packages: tailwindcss: 3.4.1 dev: false + /@ts-ghost/content-api@4.0.12: + resolution: {integrity: sha512-EjpF83pOR1pC0F2USGhFTCGuJBYsM+P4n0ndKfQGO5KITYuMPV1BE4+J1iarFNnFu2g/BovFhohrRGv3mtJhIg==} + dependencies: + '@ts-ghost/core-api': 6.0.0 + zod: 3.22.4 + dev: false + /@ts-ghost/core-api@5.1.2: resolution: {integrity: sha512-YqLLGAJ8GxHx3GvotnZxmkDuT9ZjJo4DVLl30n5aXr/+1Y3O6PpNpwAa1ws67cshx0rbFmTAGN76goKbVfLDTg==} dependencies: @@ -1970,6 +1999,13 @@ packages: zod: 3.22.4 dev: false + /@ts-ghost/core-api@6.0.0: + resolution: {integrity: sha512-5Q7nbrmAoJ/5PcW2lPgCVyAJloVaQqybHpzXuFRbKj5sYWNeJbcwSrnYOBw/3t1tA2ghPrNVXqWOGrGKqZl1Zg==} + dependencies: + jose: 5.2.2 + zod: 3.22.4 + dev: false + /@types/acorn@4.0.6: resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} dependencies: @@ -2273,7 +2309,7 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@unocss/astro@0.58.5(vite@5.1.3): + /@unocss/astro@0.58.5(vite@5.1.4): resolution: {integrity: sha512-LtuVnj8oFAK9663OVhQO8KpdJFiOyyPsYfnOZlDCOFK3gHb/2WMrzdBwr1w8LoQF3bDedkFMKirVF7gWjyZiaw==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -2283,8 +2319,8 @@ packages: dependencies: '@unocss/core': 0.58.5 '@unocss/reset': 0.58.5 - '@unocss/vite': 0.58.5(vite@5.1.3) - vite: 5.1.3(sass@1.71.0) + '@unocss/vite': 0.58.5(vite@5.1.4) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - rollup @@ -2444,7 +2480,7 @@ packages: dependencies: '@unocss/core': 0.58.5 - /@unocss/vite@0.58.5(vite@5.1.3): + /@unocss/vite@0.58.5(vite@5.1.4): resolution: {integrity: sha512-p4o1XNX1rvjmoUqSSdua8XyWNg/d+YUChDd2L/xEty+6j2qv0wUaohs3UQ87vWlv632/UmgdX+2MbrgtqthCtw==} peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 @@ -2459,7 +2495,7 @@ packages: chokidar: 3.6.0 fast-glob: 3.3.2 magic-string: 0.30.7 - vite: 5.1.3(sass@1.71.0) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - rollup @@ -2535,7 +2571,7 @@ packages: pathe: 1.1.2 picocolors: 1.0.0 sirv: 2.0.4 - vitest: 1.3.0(@vitest/ui@1.3.0) + vitest: 1.3.0(@types/node@20.11.19)(@vitest/ui@1.3.0) dev: true /@vitest/utils@1.2.2: @@ -2844,6 +2880,34 @@ packages: resolution: {integrity: sha512-dh5TX2uxwqdFq15DF9cbRZgEdE9o8q522MP6xZYs+rnd3dexfDsIJMeEIDNVO7rkRxwJ7sphhCqTmdWvUJaiDg==} dev: false + /astro-integration-kit@0.5.0(astro@4.4.9): + resolution: {integrity: sha512-RbviqerotzLoVBGF8L1aFw5jIP40oWKScRXuzJNp399uDnPMPq7/cIh2x3MIS62U17h7o3d0S3kGt/Ael+tj1g==} + peerDependencies: + '@vitejs/plugin-react': ^4.2.1 + astro: ^4.4.1 + preact: ^10.19.4 + react: ^18.2.0 + solid-js: ^1.8.15 + svelte: ^4.2.11 + vue: ^3.4.19 + peerDependenciesMeta: + '@vitejs/plugin-react': + optional: true + preact: + optional: true + react: + optional: true + solid-js: + optional: true + svelte: + optional: true + vue: + optional: true + dependencies: + astro: 4.4.9 + pathe: 1.1.2 + dev: false + /astro-navbar@2.3.1: resolution: {integrity: sha512-lLvhWS03Qc3heMU23adFwEnBUJFlL6gxYi0xPvIyX1atb2oCov4kOS/MaWOPGnvj2nK63szebUzlG+NdIoUZzQ==} dev: false @@ -2858,7 +2922,7 @@ packages: /astro-seo@0.8.2(typescript@5.3.3): resolution: {integrity: sha512-9hu+2y0QboOShFly9r+LcasfEOsWFhV5GKzsfnPG4kbNm9mqXuEP7YrUt7XrEA7rJOzC1DInOV+cIT+7zBasBQ==} dependencies: - '@astrojs/check': 0.5.4(prettier-plugin-astro@0.13.0)(prettier@3.2.5)(typescript@5.3.3) + '@astrojs/check': 0.5.4(typescript@5.3.3) transitivePeerDependencies: - prettier - prettier-plugin-astro @@ -2930,8 +2994,8 @@ packages: tsconfck: 3.0.2(typescript@5.3.3) unist-util-visit: 5.0.0 vfile: 6.0.1 - vite: 5.1.3(sass@1.71.0) - vitefu: 0.2.5(vite@5.1.3) + vite: 5.1.4(sass@1.71.0) + vitefu: 0.2.5(vite@5.1.4) which-pm: 2.1.1 yargs-parser: 21.1.1 zod: 3.22.4 @@ -2949,7 +3013,91 @@ packages: - typescript dev: false - /astro@4.4.0(@types/node@20.11.19)(typescript@5.3.3): + /astro@4.3.7(typescript@5.3.3): + resolution: {integrity: sha512-spdl+Ae6WZjQ0w8VBPq8ulN1hdN0m4EWvKG7ecgHjPQIHidMnzWJoZLEFEeKASqCGB1fDibqr7RDHoHkhZbp2Q==} + engines: {node: '>=18.14.1', npm: '>=6.14.0'} + hasBin: true + dependencies: + '@astrojs/compiler': 2.5.3 + '@astrojs/internal-helpers': 0.2.1 + '@astrojs/markdown-remark': 4.2.1 + '@astrojs/telemetry': 3.0.4 + '@babel/core': 7.23.9 + '@babel/generator': 7.23.6 + '@babel/parser': 7.23.9 + '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.23.9) + '@babel/traverse': 7.23.9 + '@babel/types': 7.23.9 + '@types/babel__core': 7.20.5 + acorn: 8.11.3 + aria-query: 5.3.0 + axobject-query: 4.0.0 + boxen: 7.1.1 + chokidar: 3.6.0 + ci-info: 4.0.0 + clsx: 2.1.0 + common-ancestor-path: 1.0.1 + cookie: 0.6.0 + cssesc: 3.0.0 + debug: 4.3.4 + deterministic-object-hash: 2.0.2 + devalue: 4.3.2 + diff: 5.2.0 + dlv: 1.1.3 + dset: 3.1.3 + es-module-lexer: 1.4.1 + esbuild: 0.19.12 + estree-walker: 3.0.3 + execa: 8.0.1 + fast-glob: 3.3.2 + flattie: 1.1.0 + github-slugger: 2.0.0 + gray-matter: 4.0.3 + html-escaper: 3.0.3 + http-cache-semantics: 4.1.1 + js-yaml: 4.1.0 + kleur: 4.1.5 + magic-string: 0.30.7 + mdast-util-to-hast: 13.0.2 + mime: 3.0.0 + ora: 7.0.1 + p-limit: 5.0.0 + p-queue: 8.0.1 + path-to-regexp: 6.2.1 + preferred-pm: 3.1.2 + probe-image-size: 7.2.3 + prompts: 2.4.2 + rehype: 13.0.1 + resolve: 1.22.8 + semver: 7.6.0 + server-destroy: 1.0.1 + shikiji: 0.9.19 + shikiji-core: 0.9.19 + string-width: 7.1.0 + strip-ansi: 7.1.0 + tsconfck: 3.0.2(typescript@5.3.3) + unist-util-visit: 5.0.0 + vfile: 6.0.1 + vite: 5.1.4(@types/node@20.11.19) + vitefu: 0.2.5(vite@5.1.4) + which-pm: 2.1.1 + yargs-parser: 21.1.1 + zod: 3.22.4 + optionalDependencies: + sharp: 0.32.6 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + - typescript + dev: false + + /astro@4.4.0(sass@1.71.0)(typescript@5.3.3): resolution: {integrity: sha512-JAsMrm1Z6W4Iqg9Q7LW/6lCXrqa4jndEOlR/yu7NGNP0BrPwSM8i4+yzya6hxgsNvyyVK8ywthaNhFmqd8Z+cg==} engines: {node: '>=18.14.1', npm: '>=6.14.0'} hasBin: true @@ -3014,8 +3162,8 @@ packages: tsconfck: 3.0.2(typescript@5.3.3) unist-util-visit: 5.0.0 vfile: 6.0.1 - vite: 5.1.3(@types/node@20.11.19) - vitefu: 0.2.5(vite@5.1.3) + vite: 5.1.4(sass@1.71.0) + vitefu: 0.2.5(vite@5.1.4) which-pm: 2.1.1 yargs-parser: 21.1.1 zod: 3.22.4 @@ -3098,8 +3246,8 @@ packages: tsconfck: 3.0.2(typescript@5.3.3) unist-util-visit: 5.0.0 vfile: 6.0.1 - vite: 5.1.3(sass@1.71.0) - vitefu: 0.2.5(vite@5.1.3) + vite: 5.1.4(@types/node@20.11.19) + vitefu: 0.2.5(vite@5.1.4) which-pm: 2.1.1 yargs-parser: 21.1.1 zod: 3.22.4 @@ -3116,6 +3264,89 @@ packages: - terser - typescript + /astro@4.4.9: + resolution: {integrity: sha512-FTWhzKjao7rHHiF/CqPqPS18AFad+fmUcYUFhWWIsYETHcc9g0IIIiv6cHXUE7g6mEZf7ycAa+WdboeEHUhraQ==} + engines: {node: '>=18.14.1', npm: '>=6.14.0'} + hasBin: true + dependencies: + '@astrojs/compiler': 2.5.3 + '@astrojs/internal-helpers': 0.2.1 + '@astrojs/markdown-remark': 4.2.1 + '@astrojs/telemetry': 3.0.4 + '@babel/core': 7.23.9 + '@babel/generator': 7.23.6 + '@babel/parser': 7.23.9 + '@babel/plugin-transform-react-jsx': 7.23.4(@babel/core@7.23.9) + '@babel/traverse': 7.23.9 + '@babel/types': 7.23.9 + '@medv/finder': 3.1.0 + '@types/babel__core': 7.20.5 + acorn: 8.11.3 + aria-query: 5.3.0 + axobject-query: 4.0.0 + boxen: 7.1.1 + chokidar: 3.6.0 + ci-info: 4.0.0 + clsx: 2.1.0 + common-ancestor-path: 1.0.1 + cookie: 0.6.0 + cssesc: 3.0.0 + debug: 4.3.4 + deterministic-object-hash: 2.0.2 + devalue: 4.3.2 + diff: 5.2.0 + dlv: 1.1.3 + dset: 3.1.3 + es-module-lexer: 1.4.1 + esbuild: 0.19.12 + estree-walker: 3.0.3 + execa: 8.0.1 + fast-glob: 3.3.2 + flattie: 1.1.0 + github-slugger: 2.0.0 + gray-matter: 4.0.3 + html-escaper: 3.0.3 + http-cache-semantics: 4.1.1 + js-yaml: 4.1.0 + kleur: 4.1.5 + magic-string: 0.30.7 + mdast-util-to-hast: 13.0.2 + mime: 3.0.0 + ora: 7.0.1 + p-limit: 5.0.0 + p-queue: 8.0.1 + path-to-regexp: 6.2.1 + preferred-pm: 3.1.2 + prompts: 2.4.2 + rehype: 13.0.1 + resolve: 1.22.8 + semver: 7.6.0 + shikiji: 0.9.19 + shikiji-core: 0.9.19 + string-width: 7.1.0 + strip-ansi: 7.1.0 + tsconfck: 3.0.2(typescript@5.3.3) + unist-util-visit: 5.0.0 + vfile: 6.0.1 + vite: 5.1.4(@types/node@20.11.19) + vitefu: 0.2.5(vite@5.1.4) + which-pm: 2.1.1 + yargs-parser: 21.1.1 + zod: 3.22.4 + optionalDependencies: + sharp: 0.32.6 + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + - typescript + dev: false + /astrojs-compiler-sync@0.3.5(@astrojs/compiler@2.5.3): resolution: {integrity: sha512-y420rhIIJ2HHDkYeqKArBHSdJNIIGMztLH90KGIX3zjcJyt/cr9Z2wYA8CP5J1w6KE7xqMh0DAkhfjhNDpQb2Q==} engines: {node: ^14.18.0 || >=16.0.0} @@ -5060,6 +5291,7 @@ packages: /immutable@4.3.5: resolution: {integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==} + dev: false /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -5502,6 +5734,7 @@ packages: /lilconfig@3.1.0: resolution: {integrity: sha512-p3cz0JV5vw/XeouBU3Ldnp+ZkBjE+n8ydJ4mcwBrOiXXPqNlrzGBqWs9X4MWF7f+iKUBu794Y8Hh8yawiJbCjw==} engines: {node: '>=14'} + deprecated: This version contains a security issue. Please upgrade to 3.1.1 or later. dev: false /linebreak@1.1.0: @@ -6816,6 +7049,7 @@ packages: '@astrojs/compiler': 1.8.2 prettier: 3.2.5 sass-formatter: 0.7.9 + dev: true /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} @@ -6826,6 +7060,7 @@ packages: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'} hasBin: true + dev: true /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} @@ -7220,6 +7455,7 @@ packages: /s.color@0.0.15: resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==} + dev: true /safe-array-concat@1.1.0: resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} @@ -7249,6 +7485,7 @@ packages: resolution: {integrity: sha512-CWZ8XiSim+fJVG0cFLStwDvft1VI7uvXdCNJYXhDvowiv+DsbD1nXLiQ4zrE5UBvj5DWZJ93cwN0NX5PMsr1Pw==} dependencies: suf-log: 2.5.3 + dev: true /sass@1.71.0: resolution: {integrity: sha512-HKKIKf49Vkxlrav3F/w6qRuPcmImGVbIXJ2I3Kg0VMA+3Bav+8yE9G5XmP5lMj6nl4OlqbPftGAscNaNu28b8w==} @@ -7258,6 +7495,7 @@ packages: chokidar: 3.6.0 immutable: 4.3.5 source-map-js: 1.0.2 + dev: false /satori-html@0.3.2: resolution: {integrity: sha512-wjTh14iqADFKDK80e51/98MplTGfxz2RmIzh0GqShlf4a67+BooLywF17TvJPD6phO0Hxm7Mf1N5LtRYvdkYRA==} @@ -7684,6 +7922,7 @@ packages: resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} dependencies: s.color: 0.0.15 + dev: true /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -8145,7 +8384,7 @@ packages: engines: {node: '>= 10.0.0'} dev: false - /unocss@0.58.5(postcss@8.4.35)(vite@5.1.3): + /unocss@0.58.5(postcss@8.4.35)(vite@5.1.4): resolution: {integrity: sha512-0g4P6jLgRRNnhscxw7nQ9RHGrKJ1UPPiHPet+YT3TXUcmy4mTiYgo9+kGQf5bjyrzsELJ10cT6Qz2y6g9Tls4g==} engines: {node: '>=14'} peerDependencies: @@ -8157,7 +8396,7 @@ packages: vite: optional: true dependencies: - '@unocss/astro': 0.58.5(vite@5.1.3) + '@unocss/astro': 0.58.5(vite@5.1.4) '@unocss/cli': 0.58.5 '@unocss/core': 0.58.5 '@unocss/extractor-arbitrary-variants': 0.58.5 @@ -8176,8 +8415,8 @@ packages: '@unocss/transformer-compile-class': 0.58.5 '@unocss/transformer-directives': 0.58.5 '@unocss/transformer-variant-group': 0.58.5 - '@unocss/vite': 0.58.5(vite@5.1.3) - vite: 5.1.3(sass@1.71.0) + '@unocss/vite': 0.58.5(vite@5.1.4) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - postcss - rollup @@ -8263,28 +8502,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.3(sass@1.71.0) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - dev: true - - /vite-node@1.3.0: - resolution: {integrity: sha512-D/oiDVBw75XMnjAXne/4feCkCEwcbr2SU1bjAhCcfI5Bq3VoOHji8/wCPAfUkDIeohJ5nSZ39fNxM3dNZ6OBOA==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - dependencies: - cac: 6.7.14 - debug: 4.3.4 - pathe: 1.1.2 - picocolors: 1.0.0 - vite: 5.1.3(sass@1.71.0) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - '@types/node' - less @@ -8305,7 +8523,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.1.3(@types/node@20.11.19) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - '@types/node' - less @@ -8333,7 +8551,7 @@ packages: - supports-color - typescript - /vite-tsconfig-paths@4.3.1(vite@5.1.3): + /vite-tsconfig-paths@4.3.1(typescript@5.3.3)(vite@5.1.4): resolution: {integrity: sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==} peerDependencies: vite: '*' @@ -8344,7 +8562,7 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 3.0.2(typescript@5.3.3) - vite: 5.1.3(sass@1.71.0) + vite: 5.1.4(@types/node@20.11.19) transitivePeerDependencies: - supports-color - typescript @@ -8385,8 +8603,43 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vite@5.1.3(sass@1.71.0): - resolution: {integrity: sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==} + /vite@5.1.4(@types/node@20.11.19): + resolution: {integrity: sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.11.19 + esbuild: 0.19.12 + postcss: 8.4.35 + rollup: 4.11.0 + optionalDependencies: + fsevents: 2.3.3 + + /vite@5.1.4(sass@1.71.0): + resolution: {integrity: sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -8419,8 +8672,9 @@ packages: sass: 1.71.0 optionalDependencies: fsevents: 2.3.3 + dev: false - /vitefu@0.2.5(vite@5.1.3): + /vitefu@0.2.5(vite@5.1.4): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 @@ -8428,7 +8682,7 @@ packages: vite: optional: true dependencies: - vite: 5.1.3(@types/node@20.11.19) + vite: 5.1.4(@types/node@20.11.19) /vitest-fetch-mock@0.2.2(vitest@1.2.2): resolution: {integrity: sha512-XmH6QgTSjCWrqXoPREIdbj40T7i1xnGmAsTAgfckoO75W1IEHKR8hcPCQ7SO16RsdW1t85oUm6pcQRLeBgjVYQ==} @@ -8449,7 +8703,7 @@ packages: vitest: '>=0.16.0' dependencies: cross-fetch: 3.1.8 - vitest: 1.3.0(@vitest/ui@1.3.0) + vitest: 1.3.0(@types/node@20.11.19)(@vitest/ui@1.3.0) transitivePeerDependencies: - encoding dev: true @@ -8498,7 +8752,7 @@ packages: strip-literal: 1.3.0 tinybench: 2.6.0 tinypool: 0.8.2 - vite: 5.1.3(sass@1.71.0) + vite: 5.1.4(@types/node@20.11.19) vite-node: 1.2.2 why-is-node-running: 2.2.2 transitivePeerDependencies: @@ -8568,62 +8822,6 @@ packages: - terser dev: true - /vitest@1.3.0(@vitest/ui@1.3.0): - resolution: {integrity: sha512-V9qb276J1jjSx9xb75T2VoYXdO1UKi+qfflY7V7w93jzX7oA/+RtYE6TcifxksxsZvygSSMwu2Uw6di7yqDMwg==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.3.0 - '@vitest/ui': 1.3.0 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - dependencies: - '@vitest/expect': 1.3.0 - '@vitest/runner': 1.3.0 - '@vitest/snapshot': 1.3.0 - '@vitest/spy': 1.3.0 - '@vitest/ui': 1.3.0(vitest@1.3.0) - '@vitest/utils': 1.3.0 - acorn-walk: 8.3.2 - chai: 4.4.1 - debug: 4.3.4 - execa: 8.0.1 - local-pkg: 0.5.0 - magic-string: 0.30.7 - pathe: 1.1.2 - picocolors: 1.0.0 - std-env: 3.7.0 - strip-literal: 2.0.0 - tinybench: 2.6.0 - tinypool: 0.8.2 - vite: 5.1.3(sass@1.71.0) - vite-node: 1.3.0 - why-is-node-running: 2.2.2 - transitivePeerDependencies: - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - dev: true - /volar-service-css@0.0.29(@volar/language-service@2.0.4): resolution: {integrity: sha512-2kNdgEYEiLeeer3wkagNBVDPa3Zj7mBDeM7D3iYmBXA0LCwd2tQL3eASzcDW9Gvac1g478UtptK468GxzUAEcA==} peerDependencies: @@ -8660,7 +8858,7 @@ packages: vscode-html-languageservice: 5.1.2 vscode-uri: 3.0.8 - /volar-service-prettier@0.0.29(@volar/language-service@2.0.4)(prettier@3.2.5): + /volar-service-prettier@0.0.29(@volar/language-service@2.0.4): resolution: {integrity: sha512-GxcDKfiVv3fc4XUtUOkQpX0QlFjWppRCVWIBp751gOKJwDex142xMlbTxP9la9tollbmj2O/tVUrqqLDGQ+Lsg==} peerDependencies: '@volar/language-service': ~2.0.1 @@ -8672,7 +8870,6 @@ packages: optional: true dependencies: '@volar/language-service': 2.0.4 - prettier: 3.2.5 vscode-uri: 3.0.8 /volar-service-typescript-twoslash-queries@0.0.29(@volar/language-service@2.0.4): diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a2aec9a0..f30c9659 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,3 @@ packages: - "packages/*" - - "playground" - - "starlight-playground" \ No newline at end of file + - "playgrounds/*" \ No newline at end of file