ReviewOS

also looking at this

stacks/bunpress

fix(docs): deploy corrected active tabs

#81
Merged chrisbbreuer wants to merge agent/fix-active-tab-deploy into main
6 files +64 -5
.config/bunpress.tsmodified+2-2
Changes to .config/bunpress.ts
@@ -1,5 +1,5 @@
1import type { BunPressOptions } from '../src/types'
2import { defaultConfig } from '../src/config'
1import type { BunPressOptions } from '../packages/bunpress/src/types'
2import { defaultConfig } from '../packages/bunpress/src/config'
33
44const config: BunPressOptions = {
55 ...defaultConfig,
.github/workflows/ci.ymlmodified+51-0
Changes to .github/workflows/ci.yml
@@ -106,3 +106,54 @@ jobs:
106106 run: pantry publish:commit './packages/*'
107107 env:
108108 PANTRY_REGISTRY_TOKEN: ${{ secrets.PANTRY_TOKEN }}
109
110 deploy-docs:
111 name: deploy bunpress.org
112 needs: [lint, typecheck, test]
113 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
114 runs-on: ubuntu-latest
115 concurrency:
116 group: bunpress-org-production
117 cancel-in-progress: false
118 env:
119 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
120 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
121 AWS_DEFAULT_REGION: us-east-1
122
123 steps:
124 - uses: actions/checkout@v6
125
126 - name: Setup Pantry
127 uses: pantry-pm/pantry/packages/action@9f797da1ed073df7839cb6a9a7db6181ba33f0b7
128 with:
129 version: 0.11.12
130 packages: bun.sh@1.3.14
131 install: 'false'
132
133 - name: Install dependencies
134 run: bun install --frozen-lockfile
135
136 - name: Build documentation
137 run: bun run build:docs
138
139 - name: Publish site and invalidate CloudFront
140 shell: bash
141 run: |
142 set -euo pipefail
143
144 distribution_id="$(
145 aws cloudfront list-distributions --output json \
146 | jq -r '[.DistributionList.Items[] | select((.Aliases.Items // []) | index("bunpress.org")) | .Id][0] // empty'
147 )"
148
149 if [[ -z "$distribution_id" ]]; then
150 echo "Could not find the CloudFront distribution for bunpress.org." >&2
151 exit 1
152 fi
153
154 aws s3 sync dist/.bunpress s3://bunpress-org \
155 --delete \
156 --cache-control 'max-age=3600, public'
157 aws cloudfront create-invalidation \
158 --distribution-id "$distribution_id" \
159 --paths '/*'
packages/bunpress/src/themes/bun/index.tsmodified+1-1
Changes to packages/bunpress/src/themes/bun/index.ts
@@ -333,7 +333,7 @@ const varsCSS = `/**
333333 --bp-code-tab-text-color: var(--bp-c-text-2);
334334 --bp-code-tab-bg: var(--bp-code-block-bg);
335335 --bp-code-tab-hover-text-color: var(--bp-c-text-1);
336 --bp-code-tab-active-text-color: var(--bp-c-text-1);
336 --bp-code-tab-active-text-color: var(--bp-c-brand-1);
337337 --bp-code-tab-active-bar-color: var(--bp-c-brand-1);
338338}
339339
packages/bunpress/src/themes/vitepress/index.tsmodified+1-1
Changes to packages/bunpress/src/themes/vitepress/index.ts
@@ -304,7 +304,7 @@ const varsCSS = `/**
304304 --bp-code-tab-text-color: var(--bp-c-text-2);
305305 --bp-code-tab-bg: var(--bp-code-block-bg);
306306 --bp-code-tab-hover-text-color: var(--bp-c-text-1);
307 --bp-code-tab-active-text-color: var(--bp-c-text-1);
307 --bp-code-tab-active-text-color: var(--bp-c-brand-1);
308308 --bp-code-tab-active-bar-color: var(--bp-c-brand-1);
309309}
310310
packages/bunpress/src/themes/vitepress/vars.cssmodified+1-1
Changes to packages/bunpress/src/themes/vitepress/vars.css
@@ -285,7 +285,7 @@
285285 --vp-code-tab-text-color: var(--vp-c-text-2);
286286 --vp-code-tab-bg: var(--vp-code-block-bg);
287287 --vp-code-tab-hover-text-color: var(--vp-c-text-1);
288 --vp-code-tab-active-text-color: var(--vp-c-text-1);
288 --vp-code-tab-active-text-color: var(--vp-c-brand-1);
289289 --vp-code-tab-active-bar-color: var(--vp-c-brand-1);
290290}
291291
test/theme-config-css.test.tsmodified+8-0
Changes to test/theme-config-css.test.ts
@@ -61,4 +61,12 @@ describe('themeConfig to CSS', () => {
6161
6262 expect(html).not.toContain('--bp-c-brand-1: #')
6363 })
64
65 it('renders one branded active-tab treatment', async () => {
66 const html = await render(BASE)
67
68 expect(html.match(/\.code-group-tab\.active\s*\{/g)).toHaveLength(1)
69 expect(html).toContain('--bp-code-tab-active-text-color: var(--bp-c-brand-1);')
70 expect(html).not.toContain('border-bottom-color: #3451b2;')
71 })
6472})