From 153dddaf1c88c5d89445c4edcc23b55871cf1f6a Mon Sep 17 00:00:00 2001 From: Louis Escher Date: Thu, 25 Jun 2026 20:41:14 +0200 Subject: [PATCH 1/7] chore: Make Astro v7 Compatible --- docs/astro.config.mts | 225 +- docs/package.json | 9 +- docs/src/components/landing/HeroSection.astro | 798 +++--- docs/src/content/docs/docs/changelog.md | 518 +++- docs/src/pages/index.astro | 349 +-- packages/studiocms_ui/package.json | 3 +- packages/studiocms_ui/src/index.ts | 324 ++- packages/studiocms_ui/src/utils/typegen.ts | 20 +- packages/studiocms_ui/src/virtuals.d.ts | 254 +- .../__snapshots__/SearchSelect.test.ts.snap | 2 +- .../__snapshots__/Select.test.ts.snap | 2 +- .../__snapshots__/Tooltip.test.ts.snap | 2 +- .../__snapshots__/User.test.ts.snap | 2 +- pnpm-lock.yaml | 2437 ++++++++++------- pnpm-workspace.yaml | 7 +- 15 files changed, 2873 insertions(+), 2079 deletions(-) diff --git a/docs/astro.config.mts b/docs/astro.config.mts index 4602050a..682b4326 100644 --- a/docs/astro.config.mts +++ b/docs/astro.config.mts @@ -1,15 +1,15 @@ -import starlight from '@astrojs/starlight'; -import onestWoff2 from '@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url'; -import ui from '@studiocms/ui'; -import { defineConfig, envField } from 'astro/config'; -import rehypePluginKit from './src/plugins/rehypePluginKit'; +import starlight from "@astrojs/starlight"; +import onestWoff2 from "@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url"; +import ui from "@studiocms/ui"; +import { defineConfig, envField } from "astro/config"; +import rehypePluginKit from "./src/plugins/rehypePluginKit"; // Define the Site URL -const site = 'https://ui.studiocms.dev/'; +const site = "https://ui.studiocms.dev/"; export const locales = { - root: { label: 'English', lang: 'en' }, - es: { label: 'Español', lang: 'es' }, + root: { label: "English", lang: "en" }, + es: { label: "Español", lang: "es" }, // de: { label: 'Deutsch', lang: 'de' }, // ja: { label: '日本語', lang: 'ja' }, // fr: { label: 'Français', lang: 'fr' }, @@ -29,199 +29,218 @@ export const locales = { export default defineConfig({ site, image: { - remotePatterns: [{ protocol: 'https' }], + remotePatterns: [{ protocol: "https" }], }, + markdown: { rehypePlugins: rehypePluginKit, }, env: { schema: { THUM_SECRET_KEY: envField.string({ - access: 'secret', - context: 'server', + access: "secret", + context: "server", optional: true, }), }, }, integrations: [ starlight({ - title: 'StudioCMS UI', - description: 'The UI library for StudioCMS, available for Astro for all to use.', + title: "StudioCMS UI", + description: + "The UI library for StudioCMS, available for Astro for all to use.", lastUpdated: true, credits: false, - tagline: 'The UI library for StudioCMS, available for Astro for all to use.', + tagline: + "The UI library for StudioCMS, available for Astro for all to use.", components: { - SiteTitle: './src/starlightOverrides/SiteTitle.astro', - PageTitle: './src/starlightOverrides/PageTitle.astro', - Sidebar: './src/starlightOverrides/Sidebar.astro', - Head: './src/starlightOverrides/Head.astro', - Header: './src/starlightOverrides/Header.astro', + SiteTitle: "./src/starlightOverrides/SiteTitle.astro", + PageTitle: "./src/starlightOverrides/PageTitle.astro", + Sidebar: "./src/starlightOverrides/Sidebar.astro", + Head: "./src/starlightOverrides/Head.astro", + Header: "./src/starlightOverrides/Header.astro", }, logo: { - dark: '../assets/logo-light.svg', - light: '../assets/logo-dark.svg', + dark: "../assets/logo-light.svg", + light: "../assets/logo-dark.svg", }, - defaultLocale: 'root', + defaultLocale: "root", locales, social: [ { - href: 'https://github.com/withstudiocms/ui', - icon: 'github', - label: 'GitHub', + href: "https://github.com/withstudiocms/ui", + icon: "github", + label: "GitHub", }, { - href: 'https://chat.studiocms.dev', - icon: 'discord', - label: 'Discord', + href: "https://chat.studiocms.dev", + icon: "discord", + label: "Discord", }, { - href: 'https://www.youtube.com/@StudioCMS', - icon: 'youtube', - label: 'YouTube', + href: "https://www.youtube.com/@StudioCMS", + icon: "youtube", + label: "YouTube", }, { - href: 'https://x.com/withstudiocms', - icon: 'x.com', - label: 'X/Twitter', + href: "https://x.com/withstudiocms", + icon: "x.com", + label: "X/Twitter", }, { - href: 'https://bsky.app/profile/studiocms.dev', - icon: 'blueSky', - label: 'BlueSky', + href: "https://bsky.app/profile/studiocms.dev", + icon: "blueSky", + label: "BlueSky", }, { - href: 'https://opencollective.com/StudioCMS', - icon: 'openCollective', - label: 'Open Collective', + href: "https://opencollective.com/StudioCMS", + icon: "openCollective", + label: "Open Collective", }, ], customCss: [ - './src/styles/sponsorcolors.css', - './src/styles/starlight.css', - 'studiocms:ui/global-css', + "./src/styles/sponsorcolors.css", + "./src/styles/starlight.css", + "studiocms:ui/global-css", ], editLink: { - baseUrl: 'https://github.com/withstudiocms/ui/tree/main/docs', + baseUrl: "https://github.com/withstudiocms/ui/tree/main/docs", }, head: [ { - tag: 'script', + tag: "script", attrs: { - src: 'https://analytics.studiocms.cloud/script.js', - 'data-website-id': 'd30566ce-efae-4096-95e5-037378c8d2cb', + src: "https://analytics.studiocms.cloud/script.js", + "data-website-id": "d30566ce-efae-4096-95e5-037378c8d2cb", defer: true, }, }, { - tag: 'meta', + tag: "meta", attrs: { - property: 'og:image', + property: "og:image", content: `${site}og.png`, }, }, { - tag: 'meta', + tag: "meta", attrs: { - property: 'twitter:image', + property: "twitter:image", content: `${site}og.png`, }, }, { - tag: 'meta', + tag: "meta", attrs: { - property: 'twitter:site', - content: 'withstudiocms', + property: "twitter:site", + content: "withstudiocms", }, }, { - tag: 'meta', + tag: "meta", attrs: { - property: 'twitter:creator', - content: 'withstudiocms', + property: "twitter:creator", + content: "withstudiocms", }, }, { - tag: 'link', + tag: "link", attrs: { - rel: 'preload', - as: 'font', - type: 'font/woff2', + rel: "preload", + as: "font", + type: "font/woff2", href: onestWoff2, - crossorigin: 'anonymous', + crossorigin: "anonymous", }, }, { - tag: 'link', + tag: "link", attrs: { - rel: 'icon', - href: '/favicon.svg', - type: 'image/svg+xml', + rel: "icon", + href: "/favicon.svg", + type: "image/svg+xml", }, }, { - tag: 'link', + tag: "link", attrs: { - rel: 'icon', - href: '/favicon-light.png', - type: 'image/png', - media: '(prefers-color-scheme: dark)', + rel: "icon", + href: "/favicon-light.png", + type: "image/png", + media: "(prefers-color-scheme: dark)", }, }, { - tag: 'link', + tag: "link", attrs: { - rel: 'icon', - href: '/favicon-dark.png', - type: 'image/png', - media: '(prefers-color-scheme: light)', + rel: "icon", + href: "/favicon-dark.png", + type: "image/png", + media: "(prefers-color-scheme: light)", }, }, ], sidebar: [ { - label: 'Getting Started', + label: "Getting Started", items: [ { - label: 'Installation', - link: 'docs/', + label: "Installation", + link: "docs/", }, { - label: 'Release Notes', - link: 'docs/changelog', + label: "Release Notes", + link: "docs/changelog", }, { - label: 'Site Showcase', - link: 'docs/showcase', + label: "Site Showcase", + link: "docs/showcase", }, ], }, { - label: 'Guides', - autogenerate: { - directory: 'docs/guides', - collapsed: true, - }, + label: "Guides", + items: [ + { + autogenerate: { + directory: "docs/guides", + collapsed: true, + }, + }, + ], }, { - label: 'Upgrading StudioCMS', - autogenerate: { - directory: 'docs/upgrade-guides', - collapsed: true, - }, + label: "Upgrading StudioCMS", + items: [ + { + autogenerate: { + directory: "docs/upgrade-guides", + collapsed: true, + }, + }, + ], }, { - label: 'Components', - autogenerate: { - directory: 'docs/components', - collapsed: true, - }, + label: "Components", + items: [ + { + autogenerate: { + directory: "docs/components", + collapsed: true, + }, + }, + ], }, { - label: 'Utilities', - autogenerate: { - directory: 'docs/utilities', - collapsed: true, - }, + label: "Utilities", + items: [ + { + autogenerate: { + directory: "docs/utilities", + collapsed: true, + }, + }, + ], }, ], }), diff --git a/docs/package.json b/docs/package.json index b00f53f3..9504f7b1 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,7 +15,8 @@ "dependencies": { "@11ty/eleventy-fetch": "^5.0.1", "@astrojs/check": "catalog:", - "@astrojs/starlight": "^0.38.1", + "@astrojs/markdown-remark": "^7.2.0", + "@astrojs/starlight": "^0.40.0", "@expressive-code/plugin-line-numbers": "^0.41.7", "@fontsource-variable/fira-code": "^5.1.0", "@fontsource-variable/onest": "catalog:", @@ -27,7 +28,7 @@ "@types/mdast": "^4.0.4", "@types/node": "catalog:", "astro": "catalog:", - "astro-embed": "^0.12.0", + "astro-embed": "^0.13.0", "expressive-code-twoslash": "^0.6.1", "md5": "2.3.0", "mdast-util-from-markdown": "^2.0.2", @@ -40,7 +41,7 @@ "starlight-package-managers": "^0.8.1", "tsm": "^2.3.0", "typescript": "catalog:", - "unist-util-visit": "^5.0.0", - "unified": "^11.0.5" + "unified": "^11.0.5", + "unist-util-visit": "^5.0.0" } } diff --git a/docs/src/components/landing/HeroSection.astro b/docs/src/components/landing/HeroSection.astro index a16440f6..6ae230aa 100644 --- a/docs/src/components/landing/HeroSection.astro +++ b/docs/src/components/landing/HeroSection.astro @@ -12,407 +12,411 @@ import { Textarea, Toggle, User, -} from 'studiocms:ui/components'; +} from "studiocms:ui/components"; +import "studiocms:ui/global-css"; -import GitHubIcon from '~/components/icons/GitHubIcon.astro'; +import GitHubIcon from "~/components/icons/GitHubIcon.astro"; --- -
-
- -
-
- -
-
- -
- -
-