From 17a97205a4e76ca8fa391ff14c2e1bdce0fcb832 Mon Sep 17 00:00:00 2001 From: David Blass Date: Mon, 27 May 2024 21:53:01 -0400 Subject: [PATCH] remove unsupported light mode from docs (#981) --- ark/dark/injected.tmLanguage.json | 7 ++--- ark/dark/package.json | 2 +- ark/dark/tsWithArkType.tmLanguage.json | 7 ++--- ark/docs/astro.config.js | 8 ++++++ ark/docs/src/content/docs/attest/example.md | 29 --------------------- ark/docs/src/styles.css | 10 ++++--- ark/schema/config.ts | 10 +++---- 7 files changed, 24 insertions(+), 49 deletions(-) delete mode 100644 ark/docs/src/content/docs/attest/example.md diff --git a/ark/dark/injected.tmLanguage.json b/ark/dark/injected.tmLanguage.json index b1f59a2af8..41443833bc 100644 --- a/ark/dark/injected.tmLanguage.json +++ b/ark/dark/injected.tmLanguage.json @@ -11,15 +11,12 @@ "repository": { "arkDefinition": { "contentName": "meta.embedded.arktype.definition", - "begin": "(([^\\)\\(\\s]*)?((\\.)?(?:type|scope|define|match|fn|morph|and|or|when)))(\\()", + "begin": "(([^\\)\\(\\s]+)?(?:type|scope|define|match|fn|\\.morph|\\.and|\\.or|\\.when))(\\()", "beginCaptures": { "1": { "name": "entity.name.function.ts" }, - "4": { - "name": "punctuation.accessor" - }, - "5": { + "3": { "name": "meta.brace.round.ts" } }, diff --git a/ark/dark/package.json b/ark/dark/package.json index 83bb10d4c5..cb962960e2 100644 --- a/ark/dark/package.json +++ b/ark/dark/package.json @@ -2,7 +2,7 @@ "name": "arkdark", "displayName": "ArkDark", "description": "ArkType syntax highlighting and theme⛵", - "version": "5.1.5", + "version": "5.1.6", "publisher": "arktypeio", "type": "module", "scripts": { diff --git a/ark/dark/tsWithArkType.tmLanguage.json b/ark/dark/tsWithArkType.tmLanguage.json index 0137012c2e..d2ee4687cf 100644 --- a/ark/dark/tsWithArkType.tmLanguage.json +++ b/ark/dark/tsWithArkType.tmLanguage.json @@ -22,15 +22,12 @@ "repository": { "arkDefinition": { "contentName": "meta.embedded.arktype.definition", - "begin": "(([^\\)\\(\\s]*)?((\\.)?(?:type|scope|define|match|fn|morph|and|or|when)))(\\()", + "begin": "(([^\\)\\(\\s]+)?(?:type|scope|define|match|fn|\\.morph|\\.and|\\.or|\\.when))(\\()", "beginCaptures": { "1": { "name": "entity.name.function.ts" }, - "4": { - "name": "punctuation.accessor" - }, - "5": { + "3": { "name": "meta.brace.round.ts" } }, diff --git a/ark/docs/astro.config.js b/ark/docs/astro.config.js index e59434f75d..3973a852a6 100644 --- a/ark/docs/astro.config.js +++ b/ark/docs/astro.config.js @@ -20,6 +20,14 @@ export default defineConfig({ src: "./src/assets/logo.svg", replacesTitle: true }, + head: [ + // this ensures each page is rendered in dark mode since we + // don't support light yet + { + tag: "script", + content: `localStorage.setItem("starlight-theme", "dark")` + } + ], social: { twitch: "https://twitch.tv/arktypeio", twitter: "https://twitter.com/arktypeio", diff --git a/ark/docs/src/content/docs/attest/example.md b/ark/docs/src/content/docs/attest/example.md deleted file mode 100644 index 8d02f14587..0000000000 --- a/ark/docs/src/content/docs/attest/example.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Attest -description: A guide in my new Starlight docs site. ---- - -Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. -Writing a good guide requires thinking about what your users are trying to do. - -## Further reading - -- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework - -## Why use it? - -- Performance: - - In editor: Types are 3x more efficient than Zod - - At runtime: 400x faster than Zod, 2000x faster than Yup -- Concision: - - Definitions: About 1/2 as long as equivalent Zod on average - - Types: Tooltips are 1/5 the length of Zod on average -- Portability: Definitions are just strings and objects and are serializable by default. -- Developer Experience: With semantic validation and contextual autocomplete, ArkType's static parser is unlike anything you've ever seen. - -Also... - -- Deeply-computed intersections -- Automatically discriminated unions -- Clear, customizable error messages -- Recursive and cyclic types that can check cyclic data diff --git a/ark/docs/src/styles.css b/ark/docs/src/styles.css index 9d11532be6..8ace224496 100644 --- a/ark/docs/src/styles.css +++ b/ark/docs/src/styles.css @@ -86,6 +86,12 @@ header { background-color: transparent; } +/** Hide theme picker since light mode is not currently supported */ +starlight-theme-select, +.social-icons::after { + display: none; +} + .twoslash .twoslash-hover:hover .twoslash-popup-container { border-radius: 1rem; opacity: 1; @@ -94,10 +100,6 @@ header { box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); } -.twoslash-popup-code { - opacity: 1; -} - h1 { font-weight: 400; } diff --git a/ark/schema/config.ts b/ark/schema/config.ts index 3d7fd25df5..2c80e2cb21 100644 --- a/ark/schema/config.ts +++ b/ark/schema/config.ts @@ -13,11 +13,11 @@ export const mergeConfigs = ( for (k in extensions) { result[k] = isNodeKind(k) ? - ({ - ...base[k], - ...extensions[k] - } as never) - : (extensions[k]! as never) + { + ...(base as any)[k], + ...(extensions as any)[k] + } + : (extensions[k] as never) } return result }