diff --git a/.changeset/wise-boats-flow.md b/.changeset/wise-boats-flow.md new file mode 100644 index 00000000000..6a85edfdd55 --- /dev/null +++ b/.changeset/wise-boats-flow.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fix issue with nested `` components diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 649cf46ffc3..afa45d0349d 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -25,5 +25,5 @@ jobs: uses: andresz1/size-limit-action@dd31dce7dcc72a041fd3e49abf0502b13fc4ce05 with: github_token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }} - directory: docs/ + build_script: 'build:examples' package_manager: pnpm diff --git a/docs/package.json b/docs/package.json index 35af281c226..0091d79b6d8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,7 +6,6 @@ "scripts": { "test": "start-server-and-test preview http://localhost:3000 pa11y", "pa11y": "pa11y-ci --sitemap 'http://localhost:3000/sitemap-index.xml' --sitemap-find 'https://starlight.astro.build' --sitemap-replace 'http://localhost:3000'", - "size": "size-limit", "dev": "astro dev", "start": "astro dev", "build": "astro build", @@ -15,35 +14,16 @@ }, "dependencies": { "@astrojs/starlight": "workspace:*", - "astro": "^2.10.3", + "astro": "^2.10.4", "sharp": "^0.32.3" }, "devDependencies": { - "@size-limit/file": "^8.2.4", "hast-util-from-html": "^1.0.2", "hast-util-to-string": "^2.0.0", "hastscript": "^7.2.0", "pa11y-ci": "^3.0.1", "rehype": "^12.0.1", - "size-limit": "^8.2.4", "start-server-and-test": "^2.0.0", "unist-util-visit": "^4.1.2" - }, - "size-limit": [ - { - "name": "/index.html", - "path": "dist/index.html", - "limit": "14 kB" - }, - { - "name": "/_astro/*.js", - "path": "dist/_astro/*.js", - "limit": "20 kB" - }, - { - "name": "/_astro/*.css", - "path": "dist/_astro/*.css", - "limit": "10 kB" - } - ] + } } diff --git a/docs/src/content/docs/es/showcase.md b/docs/src/content/docs/es/showcase.md index 57a3a637935..0fb59c4b00c 100644 --- a/docs/src/content/docs/es/showcase.md +++ b/docs/src/content/docs/es/showcase.md @@ -23,6 +23,7 @@ Starlight ya está siendo utilizado en producción. Estos son algunos de los sit - [xs-dev docs](https://xs-dev.js.org) - [Athena OS](https://www.athenaos.org) - [simple-fm](https://simple.arciniega.one) +- [CommandKit](https://commandkit.underctrl.io) Consulta todos los [repositorios de proyectos públicos que utilizan Starlight en GitHub](https://github.com/withastro/starlight/network/dependents). diff --git a/docs/src/content/docs/fr/showcase.md b/docs/src/content/docs/fr/showcase.md index 32579295840..a1b18f9c92d 100644 --- a/docs/src/content/docs/fr/showcase.md +++ b/docs/src/content/docs/fr/showcase.md @@ -23,6 +23,7 @@ Starlight est déjà utilisé en production. Voici quelques sites sur le web : - [xs-dev docs](https://xs-dev.js.org) - [Athena OS](https://www.athenaos.org) - [simple-fm](https://simple.arciniega.one) +- [CommandKit](https://commandkit.underctrl.io) Voir [les dépôts de projets publics utilisant Starlight sur GitHub](https://github.com/withastro/starlight/network/dependents). diff --git a/docs/src/content/docs/showcase.md b/docs/src/content/docs/showcase.md index 3ee4362ff13..aaf61830517 100644 --- a/docs/src/content/docs/showcase.md +++ b/docs/src/content/docs/showcase.md @@ -23,6 +23,7 @@ Starlight is already being used in production. These are some of the sites aroun - [xs-dev docs](https://xs-dev.js.org) - [Athena OS](https://www.athenaos.org) - [simple-fm](https://simple.arciniega.one) +- [CommandKit](https://commandkit.underctrl.io) See all the [public project repos using Starlight on GitHub](https://github.com/withastro/starlight/network/dependents). diff --git a/docs/src/content/docs/zh/showcase.md b/docs/src/content/docs/zh/showcase.md index 5dbbde43dad..4bb6be0e6e4 100644 --- a/docs/src/content/docs/zh/showcase.md +++ b/docs/src/content/docs/zh/showcase.md @@ -22,6 +22,7 @@ Starlight 已投入生产。 这些是网络上的一些网站: - [xs-dev docs](https://xs-dev.js.org) - [Athena OS](https://www.athenaos.org) - [simple-fm](https://simple.arciniega.one) +- [CommandKit](https://commandkit.underctrl.io) 查看所有[在 GitHub 上使用 Starlight 的公共项目仓库](https://github.com/withastro/starlight/network/dependents)。 diff --git a/examples/basics/package.json b/examples/basics/package.json index ba79bc8ede4..3afd38514e5 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/starlight": "^0.6.1", - "astro": "^2.10.3", + "astro": "^2.10.4", "sharp": "^0.32.3" } } diff --git a/package.json b/package.json index 223dcf0bbe6..e49a7f451a5 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "version": "1.0.0", "description": "", "scripts": { + "build:examples": "pnpm --filter @example/* build", + "size": "size-limit", "version": "pnpm changeset version && pnpm i --no-frozen-lockfile", "format": "prettier -w --cache --plugin prettier-plugin-astro ." }, @@ -11,9 +13,28 @@ "devDependencies": { "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.1", - "astro": "^2.10.3", + "@size-limit/file": "^8.2.4", + "astro": "^2.10.4", "prettier": "^3.0.0", - "prettier-plugin-astro": "^0.11.0" + "prettier-plugin-astro": "^0.11.0", + "size-limit": "^8.2.4" }, - "packageManager": "pnpm@8.2.0" + "packageManager": "pnpm@8.2.0", + "size-limit": [ + { + "name": "/index.html", + "path": "examples/basics/dist/index.html", + "limit": "14 kB" + }, + { + "name": "/_astro/*.js", + "path": "examples/basics/dist/_astro/*.js", + "limit": "20 kB" + }, + { + "name": "/_astro/*.css", + "path": "examples/basics/dist/_astro/*.css", + "limit": "10 kB" + } + ] } diff --git a/packages/starlight/package.json b/packages/starlight/package.json index aebf25de799..e992ffa746d 100644 --- a/packages/starlight/package.json +++ b/packages/starlight/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@types/node": "^18.16.19", "@vitest/coverage-v8": "^0.33.0", - "astro": "^2.10.3", + "astro": "^2.10.4", "vitest": "^0.33.0" }, "dependencies": { diff --git a/packages/starlight/user-components/Tabs.astro b/packages/starlight/user-components/Tabs.astro index 43af0430618..82b3af179dd 100644 --- a/packages/starlight/user-components/Tabs.astro +++ b/packages/starlight/user-components/Tabs.astro @@ -77,7 +77,7 @@ const { html, panels } = processPanels(panelHtml); super(); const tablist = this.querySelector('[role="tablist"]')!; this.tabs = [...tablist.querySelectorAll('[role="tab"]')]; - this.panels = [...this.querySelectorAll('[role="tabpanel"]')]; + this.panels = [...this.querySelectorAll(':scope > [role="tabpanel"]')]; this.tabs.forEach((tab, i) => { // Handle clicks for mouse users diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4761870d8f7..05ceabf7630 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,15 +14,21 @@ importers: '@changesets/cli': specifier: ^2.26.1 version: 2.26.1 + '@size-limit/file': + specifier: ^8.2.4 + version: 8.2.4(size-limit@8.2.4) astro: - specifier: ^2.10.3 - version: 2.10.3(sharp@0.32.3) + specifier: ^2.10.4 + version: 2.10.4(sharp@0.32.3) prettier: specifier: ^3.0.0 version: 3.0.0 prettier-plugin-astro: specifier: ^0.11.0 version: 0.11.0 + size-limit: + specifier: ^8.2.4 + version: 8.2.4 docs: dependencies: @@ -30,15 +36,12 @@ importers: specifier: workspace:* version: link:../packages/starlight astro: - specifier: ^2.10.3 - version: 2.10.3(sharp@0.32.3) + specifier: ^2.10.4 + version: 2.10.4(sharp@0.32.3) sharp: specifier: ^0.32.3 version: 0.32.3 devDependencies: - '@size-limit/file': - specifier: ^8.2.4 - version: 8.2.4(size-limit@8.2.4) hast-util-from-html: specifier: ^1.0.2 version: 1.0.2 @@ -54,9 +57,6 @@ importers: rehype: specifier: ^12.0.1 version: 12.0.1 - size-limit: - specifier: ^8.2.4 - version: 8.2.4 start-server-and-test: specifier: ^2.0.0 version: 2.0.0 @@ -100,8 +100,8 @@ importers: specifier: ^0.6.1 version: link:../../packages/starlight astro: - specifier: ^2.10.3 - version: 2.10.3(sharp@0.32.3) + specifier: ^2.10.4 + version: 2.10.4(sharp@0.32.3) sharp: specifier: ^0.32.3 version: 0.32.3 @@ -116,10 +116,10 @@ importers: version: link:../../packages/tailwind '@astrojs/tailwind': specifier: ^4.0.0 - version: 4.0.0(astro@2.10.3)(tailwindcss@3.3.3) + version: 4.0.0(astro@2.10.4)(tailwindcss@3.3.3) astro: specifier: ^2.10.3 - version: 2.10.3(sharp@0.32.3) + version: 2.10.4(sharp@0.32.3) sharp: specifier: ^0.32.3 version: 0.32.3 @@ -131,7 +131,7 @@ importers: dependencies: '@astrojs/mdx': specifier: ^0.19.7 - version: 0.19.7(astro@2.10.3) + version: 0.19.7(astro@2.10.4) '@astrojs/sitemap': specifier: ^1.3.3 version: 1.3.3 @@ -182,8 +182,8 @@ importers: specifier: ^0.33.0 version: 0.33.0(vitest@0.33.0) astro: - specifier: ^2.10.3 - version: 2.10.3(@types/node@18.16.19) + specifier: ^2.10.4 + version: 2.10.4(@types/node@18.16.19) vitest: specifier: ^0.33.0 version: 0.33.0 @@ -195,7 +195,7 @@ importers: version: link:../starlight '@astrojs/tailwind': specifier: ^4.0.0 - version: 4.0.0(astro@2.10.3)(tailwindcss@3.3.3) + version: 4.0.0(astro@2.10.4)(tailwindcss@3.3.3) tailwindcss: specifier: ^3.3.3 version: 3.3.3 @@ -248,13 +248,13 @@ packages: vscode-languageserver-types: 3.17.3 vscode-uri: 3.0.7 - /@astrojs/markdown-remark@2.2.1(astro@2.10.3): + /@astrojs/markdown-remark@2.2.1(astro@2.10.4): resolution: {integrity: sha512-VF0HRv4GpC1XEMLnsKf6jth7JSmlt9qpqP0josQgA2eSpCIAC/Et+y94mgdBIZVBYH/yFnMoIxgKVe93xfO2GA==} peerDependencies: astro: ^2.5.0 dependencies: '@astrojs/prism': 2.1.2 - astro: 2.10.3(sharp@0.32.3) + astro: 2.10.4(sharp@0.32.3) github-slugger: 1.5.0 import-meta-resolve: 2.2.2 rehype-raw: 6.1.1 @@ -270,11 +270,11 @@ packages: transitivePeerDependencies: - supports-color - /@astrojs/mdx@0.19.7(astro@2.10.3): + /@astrojs/mdx@0.19.7(astro@2.10.4): resolution: {integrity: sha512-mfEbBD7oi8yBHhcJucEjnrquREkJ3os+jioURP8BR2B8tOV2rV2j8trvmLUgfS+P/+HevGObxCTjcRYxn6T7eg==} engines: {node: '>=16.12.0'} dependencies: - '@astrojs/markdown-remark': 2.2.1(astro@2.10.3) + '@astrojs/markdown-remark': 2.2.1(astro@2.10.4) '@astrojs/prism': 2.1.2 '@mdx-js/mdx': 2.3.0 acorn: 8.9.0 @@ -310,13 +310,13 @@ packages: zod: 3.21.4 dev: false - /@astrojs/tailwind@4.0.0(astro@2.10.3)(tailwindcss@3.3.3): + /@astrojs/tailwind@4.0.0(astro@2.10.4)(tailwindcss@3.3.3): resolution: {integrity: sha512-HmCAXFFes7MUBt5ihdfH1goa8QyGkHejIpz6Z4XBKK9VNYY9G2E3brCn8+pNn5zAOzcwl3FYcuH2AiOa/NGoMQ==} peerDependencies: astro: ^2.6.5 tailwindcss: ^3.0.24 dependencies: - astro: 2.10.3(sharp@0.32.3) + astro: 2.10.4(sharp@0.32.3) autoprefixer: 10.4.14(postcss@8.4.27) postcss: 8.4.27 postcss-load-config: 4.0.1(postcss@8.4.27) @@ -1723,8 +1723,8 @@ packages: hasBin: true dev: false - /astro@2.10.3(@types/node@18.16.19): - resolution: {integrity: sha512-Hp8HhamDsRw31QYftKNmPktbr9+YJ5CQMSAlg0ED667hhH0KkgfVV77bqRojsLlj6f/6qBYGMgooGQdtfdie1Q==} + /astro@2.10.4(@types/node@18.16.19): + resolution: {integrity: sha512-6MQ2E25tvHFNVgZ2uaNm33w2DKTyurlDLU0UUcdnAxVQwldDD8Qq8KDHm+nBx1CAWycjdbjJi9VQVvX2TOCMeQ==} engines: {node: '>=16.12.0', npm: '>=6.14.0'} hasBin: true peerDependencies: @@ -1736,7 +1736,7 @@ packages: '@astrojs/compiler': 1.8.0 '@astrojs/internal-helpers': 0.1.2 '@astrojs/language-server': 1.0.4 - '@astrojs/markdown-remark': 2.2.1(astro@2.10.3) + '@astrojs/markdown-remark': 2.2.1(astro@2.10.4) '@astrojs/telemetry': 2.1.1 '@astrojs/webapi': 2.2.0 '@babel/core': 7.22.5 @@ -1802,8 +1802,8 @@ packages: - terser dev: true - /astro@2.10.3(sharp@0.32.3): - resolution: {integrity: sha512-Hp8HhamDsRw31QYftKNmPktbr9+YJ5CQMSAlg0ED667hhH0KkgfVV77bqRojsLlj6f/6qBYGMgooGQdtfdie1Q==} + /astro@2.10.4(sharp@0.32.3): + resolution: {integrity: sha512-6MQ2E25tvHFNVgZ2uaNm33w2DKTyurlDLU0UUcdnAxVQwldDD8Qq8KDHm+nBx1CAWycjdbjJi9VQVvX2TOCMeQ==} engines: {node: '>=16.12.0', npm: '>=6.14.0'} hasBin: true peerDependencies: @@ -1815,7 +1815,7 @@ packages: '@astrojs/compiler': 1.8.0 '@astrojs/internal-helpers': 0.1.2 '@astrojs/language-server': 1.0.4 - '@astrojs/markdown-remark': 2.2.1(astro@2.10.3) + '@astrojs/markdown-remark': 2.2.1(astro@2.10.4) '@astrojs/telemetry': 2.1.1 '@astrojs/webapi': 2.2.0 '@babel/core': 7.22.5 @@ -3757,6 +3757,12 @@ packages: dependencies: has: 1.0.3 + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: false + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -4857,7 +4863,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 + resolve: 1.22.1 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -5239,7 +5245,7 @@ packages: postcss: 8.4.27 postcss-value-parser: 4.2.0 read-cache: 1.0.0 - resolve: 1.22.2 + resolve: 1.22.4 dev: false /postcss-js@4.0.1(postcss@8.4.27): @@ -5645,14 +5651,23 @@ packages: engines: {node: '>=8'} dev: true - /resolve@1.22.2: - resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + /resolve@1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true dependencies: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /resolve@1.22.4: + resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + /restore-cursor@4.0.0: resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -6141,8 +6156,8 @@ packages: inline-style-parser: 0.1.1 dev: false - /sucrase@3.32.0: - resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} + /sucrase@3.34.0: + resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} engines: {node: '>=8'} hasBin: true dependencies: @@ -6208,8 +6223,8 @@ packages: postcss-load-config: 4.0.1(postcss@8.4.27) postcss-nested: 6.0.1(postcss@8.4.27) postcss-selector-parser: 6.0.13 - resolve: 1.22.2 - sucrase: 3.32.0 + resolve: 1.22.4 + sucrase: 3.34.0 transitivePeerDependencies: - ts-node dev: false @@ -6343,7 +6358,7 @@ packages: '@types/json5': 0.0.30 '@types/resolve': 1.20.2 json5: 2.2.3 - resolve: 1.22.2 + resolve: 1.22.1 strip-bom: 4.0.0 type-fest: 0.13.1