From 41f2e4f137152a86b7435a5505bd15a5b4c4457f Mon Sep 17 00:00:00 2001 From: Kian Newman-Hazel Date: Wed, 18 Sep 2024 14:54:11 +0100 Subject: [PATCH] [Docs Site] Upgrade Astro to 4.15.7, Starlight to 0.28.1 --- package-lock.json | 75 +++++++++++++------ package.json | 8 +- ....patch => @astrojs+starlight+0.28.1.patch} | 4 +- src/content/config.ts | 3 +- src/content/i18n/en.json | 3 + 5 files changed, 65 insertions(+), 28 deletions(-) rename patches/{@astrojs+starlight+0.27.1.patch => @astrojs+starlight+0.28.1.patch} (89%) create mode 100644 src/content/i18n/en.json diff --git a/package-lock.json b/package-lock.json index 140898c6f97b36..f4fcdfd8179752 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,15 +12,15 @@ "@astrojs/check": "^0.9.3", "@astrojs/rss": "^4.0.7", "@astrojs/sitemap": "^3.1.6", - "@astrojs/starlight": "^0.27.1", - "@astrojs/starlight-docsearch": "^0.1.1", + "@astrojs/starlight": "^0.28.1", + "@astrojs/starlight-docsearch": "^0.2.0", "@astrojs/starlight-tailwind": "^2.0.3", - "@astrojs/tailwind": "^5.1.0", + "@astrojs/tailwind": "^5.1.1", "@cloudflare/workers-types": "^4.20240903.0", "@codingheads/sticky-header": "^1.0.2", "@types/node": "^20.16.1", "algoliasearch": "^4.24.0", - "astro": "^4.15.5", + "astro": "^4.15.7", "astro-breadcrumbs": "^2.3.1", "astro-icon": "^1.1.1", "astro-live-code": "^0.0.3", @@ -640,9 +640,9 @@ } }, "node_modules/@astrojs/starlight": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.27.1.tgz", - "integrity": "sha512-L2hEgN/Tk7tfBDeaqUOgOpey5NcUL78FuQa06iNxyZ6RjyYyuXSniOoFxZYIo5PpY9O1dLdK22PkZyCDpO729g==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.28.1.tgz", + "integrity": "sha512-aEBy6k1w8L25lP+jV1WYvujxfigFxh10NFPxHCW76J695Xgw1jC1TVALbhkctIuCdIAmzUElpXfuOuOiARJf0g==", "dev": true, "license": "MIT", "dependencies": { @@ -657,6 +657,7 @@ "hast-util-select": "^6.0.2", "hast-util-to-string": "^3.0.0", "hastscript": "^9.0.0", + "i18next": "^23.11.5", "mdast-util-directive": "^3.0.0", "mdast-util-to-markdown": "^2.1.0", "mdast-util-to-string": "^4.0.0", @@ -669,13 +670,13 @@ "vfile": "^6.0.2" }, "peerDependencies": { - "astro": "^4.8.6" + "astro": "^4.14.0" } }, "node_modules/@astrojs/starlight-docsearch": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@astrojs/starlight-docsearch/-/starlight-docsearch-0.1.1.tgz", - "integrity": "sha512-9tD4nLHhiv0LLFrepIq3Yu/k3wr9mdwGj/mpwBBOGejTBxDc25e8SNxdD1CRBNMdHENswB7xJ7RnnGLjuxkPIQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@astrojs/starlight-docsearch/-/starlight-docsearch-0.2.0.tgz", + "integrity": "sha512-jeZuJrcy0IX9qz7m4Emy/Vfr3hurjBByUFvcpqmvH7x48PCVYozCxEnLdDJzXU3vHWhvodtRCt51wcugCTGB5g==", "dev": true, "license": "MIT", "dependencies": { @@ -683,7 +684,7 @@ "@docsearch/js": "^3.6.0" }, "peerDependencies": { - "@astrojs/starlight": ">=0.14.0" + "@astrojs/starlight": ">=0.28.0" } }, "node_modules/@astrojs/starlight-tailwind": { @@ -699,18 +700,18 @@ } }, "node_modules/@astrojs/tailwind": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@astrojs/tailwind/-/tailwind-5.1.0.tgz", - "integrity": "sha512-BJoCDKuWhU9FT2qYg+fr6Nfb3qP4ShtyjXGHKA/4mHN94z7BGcmauQK23iy+YH5qWvTnhqkd6mQPQ1yTZTe9Ig==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@astrojs/tailwind/-/tailwind-5.1.1.tgz", + "integrity": "sha512-LwurA10uIKcGRxQP2R81RvAnBT0WPKzBntXZBF4hrAefDgM5Uumn0nsGr6tdIjSARgYz4X+Cq/Vh78t3bql3yw==", "dev": true, "license": "MIT", "dependencies": { - "autoprefixer": "^10.4.15", - "postcss": "^8.4.28", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.45", "postcss-load-config": "^4.0.2" }, "peerDependencies": { - "astro": "^3.0.0 || ^4.0.0", + "astro": "^3.0.0 || ^4.0.0 || ^5.0.0-beta.0", "tailwindcss": "^3.0.24" } }, @@ -3640,9 +3641,9 @@ } }, "node_modules/astro": { - "version": "4.15.5", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.15.5.tgz", - "integrity": "sha512-zcHXpRav0dtYpddxoGMDN7A7SKrGL9wsu5IxLjqCcZhylfZ/5mfLfoGYnSg7aFwuAleUXP66lyfY+GDbFTbF2w==", + "version": "4.15.7", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.15.7.tgz", + "integrity": "sha512-RGZjGpLcR3jcnXA1+g56i73O77krmqs7VjpoBOfk9UVP8Js5T2YSeUBAyComOUb6vj31wEw1vgRgOEN0MzYc8w==", "dev": true, "license": "MIT", "dependencies": { @@ -3692,6 +3693,7 @@ "ora": "^8.1.0", "p-limit": "^6.1.0", "p-queue": "^8.0.1", + "path-to-regexp": "6.2.2", "preferred-pm": "^4.0.0", "prompts": "^2.4.2", "rehype": "^13.0.1", @@ -3793,6 +3795,13 @@ "unist-util-visit-parents": "^6.0.1" } }, + "node_modules/astro/node_modules/path-to-regexp": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", + "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", + "dev": true, + "license": "MIT" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -7106,6 +7115,30 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/i18next": { + "version": "23.15.1", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.15.1.tgz", + "integrity": "sha512-wB4abZ3uK7EWodYisHl/asf8UYEhrI/vj/8aoSsrj/ZDxj4/UXPOa1KvFt1Fq5hkUHquNqwFlDprmjZ8iySgYA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", diff --git a/package.json b/package.json index 5bff9898d577d3..d38dc71a6ce494 100644 --- a/package.json +++ b/package.json @@ -21,15 +21,15 @@ "@astrojs/check": "^0.9.3", "@astrojs/rss": "^4.0.7", "@astrojs/sitemap": "^3.1.6", - "@astrojs/starlight": "^0.27.1", - "@astrojs/starlight-docsearch": "^0.1.1", + "@astrojs/starlight": "^0.28.1", + "@astrojs/starlight-docsearch": "^0.2.0", "@astrojs/starlight-tailwind": "^2.0.3", - "@astrojs/tailwind": "^5.1.0", + "@astrojs/tailwind": "^5.1.1", "@cloudflare/workers-types": "^4.20240903.0", "@codingheads/sticky-header": "^1.0.2", "@types/node": "^20.16.1", "algoliasearch": "^4.24.0", - "astro": "^4.15.5", + "astro": "^4.15.7", "astro-breadcrumbs": "^2.3.1", "astro-icon": "^1.1.1", "astro-live-code": "^0.0.3", diff --git a/patches/@astrojs+starlight+0.27.1.patch b/patches/@astrojs+starlight+0.28.1.patch similarity index 89% rename from patches/@astrojs+starlight+0.27.1.patch rename to patches/@astrojs+starlight+0.28.1.patch index 753d27552168ae..e3434e0e30039c 100644 --- a/patches/@astrojs+starlight+0.27.1.patch +++ b/patches/@astrojs+starlight+0.28.1.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/@astrojs/starlight/utils/navigation.ts b/node_modules/@astrojs/starlight/utils/navigation.ts -index cd1475d..69d8801 100644 +index 526d9f2..de8c64a 100644 --- a/node_modules/@astrojs/starlight/utils/navigation.ts +++ b/node_modules/@astrojs/starlight/utils/navigation.ts -@@ -346,8 +346,12 @@ export function getSidebarFromConfig( +@@ -360,8 +360,12 @@ export function getSidebarFromConfig( locale: string | undefined ): SidebarEntry[] { const routes = getLocaleRoutes(locale); diff --git a/src/content/config.ts b/src/content/config.ts index 371a08684ddbd3..3a0c07abccc3f2 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,5 +1,5 @@ import { z, defineCollection } from "astro:content"; -import { docsSchema } from "@astrojs/starlight/schema"; +import { docsSchema, i18nSchema } from "@astrojs/starlight/schema"; import { appsSchema, changelogsSchema, @@ -24,6 +24,7 @@ export const collections = { extend: baseSchema, }), }), + i18n: defineCollection({ type: "data", schema: i18nSchema() }), changelogs: defineCollection({ schema: changelogsSchema, type: "data", diff --git a/src/content/i18n/en.json b/src/content/i18n/en.json new file mode 100644 index 00000000000000..ea14a02a8f27b4 --- /dev/null +++ b/src/content/i18n/en.json @@ -0,0 +1,3 @@ +{ + "aside.caution": "Warning" +}