Skip to content

Commit 408540a

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-spaces-list
2 parents cb9a153 + 73892f4 commit 408540a

File tree

121 files changed

+2229
-769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2229
-769
lines changed

Diff for: .changeset/beige-snails-count.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/react-openapi': patch
3+
'gitbook': patch
4+
---
5+
6+
Adds content-visibility css property to OpenAPI Operation for better render performance

Diff for: .changeset/brave-camels-trade.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
---
4+
5+
Add Python support in Code Samples

Diff for: .changeset/dull-gifts-flow.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Use ellipsis and fix icon color for more links in the header on small screen

Diff for: .changeset/forty-trains-pull.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/icons': patch
3+
---
4+
5+
Fix first run of the package in development mode

Diff for: .changeset/heavy-jeans-unite.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/cache-do': minor
3+
---
4+
5+
First version of a new cache backend powered by Cloudflare Durable Objects

Diff for: .changeset/honest-jars-refuse.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Add support for Norwegian language

Diff for: .changeset/hungry-actors-march.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Optimize layout shift while transitioning between pages with full width blocks (ex: OpenAPI blocks)

Diff for: .changeset/kind-flies-impress.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Only display spaces dropdown in compact header when site is multi-variants

Diff for: .changeset/mighty-apples-design.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Persist state of tabs and dynamically sync them based on title

Diff for: .changeset/nervous-turtles-lick.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Ensure "Sponsored via GitBook" can be translated in all languages

Diff for: .changeset/odd-candles-cover.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Use new cache backend, powered by Durable Objects, alongside the existing ones (KV, etc).

Diff for: .changeset/plenty-pets-hope.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
---
4+
5+
Add required query parameters to the code sample

Diff for: .changeset/poor-bats-cheer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
---
4+
5+
Display pattern if available in parmas in OpenAPI block

Diff for: .changeset/poor-emus-remember.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Fix inconsistent click area in table because of scroll indicator

Diff for: .changeset/purple-forks-refuse.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
'gitbook': patch
4+
---
5+
6+
Synchronize response and response example tabs

Diff for: .changeset/purple-lies-teach.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Show definition title when visible in cards

Diff for: .changeset/quiet-doors-double.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@gitbook/react-openapi': minor
3+
'gitbook': patch
4+
---
5+
6+
Rollback of scalar modal while fixing perf issue

Diff for: .changeset/silent-donuts-love.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': patch
3+
---
4+
5+
Fix crash when `example` is undefined for a response

Diff for: .changeset/strange-eyes-notice.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': patch
3+
---
4+
5+
Adds tabs to Response Example section e.g. for status code examples

Diff for: .changeset/ten-carpets-cover.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/react-openapi': patch
3+
---
4+
5+
Render mandatory headers in code sample

Diff for: .changeset/thick-dogs-bake.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Prevent search indexation for pages where it's configured as disabled

Diff for: .changeset/three-shoes-talk.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Fix table of contents being visible on mobile when disabled at the page level

Diff for: .changeset/wise-papayas-retire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Don't show hidden pages in the empty state of a page

Diff for: .changeset/witty-kiwis-knock.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': minor
3+
---
4+
5+
Fix linking to a tab itself

Diff for: .github/CONTRIBUTING.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Welcome to GitBook's contributing guide!
22

3-
Thank you for investing your time in contributing to GitBook. Any contribution you make will be reviewed by our team.In this guide, you'll learn the different ways you can contribute.
3+
> _For help, support, feature requests, and product questions - head to our [GitHub Community](https://github.com/orgs/GitbookIO/discussions) 🤖_
4+
5+
Thank you for investing your time in contributing to GitBook. Any contribution you make will be reviewed by our team. In this guide, you'll learn the different ways you can contribute.
46

57
## Types of Contributions
68

@@ -45,13 +47,25 @@ Any contribution you make can be made to the code located in this repository. In
4547

4648
- [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
4749

48-
##### GitHub Codespaces:
50+
#### 2. Create a working branch and start with your changes
4951

50-
- [Fork, edit, and preview](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace) using [GitHub Codespaces](https://github.com/features/codespaces) without having to install and run the project locally.
52+
After forking this repository, you'll want to [create a branch](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-a-branch-for-an-issue) to work off of.
5153

52-
#### 2. Create a working branch and start with your changes
54+
#### 3. Install dependencies and run the project locally
55+
56+
GitBook uses [Bun](https://bun.sh/) to run the project. Make sure you're using the specified version of `node` before running any of the development commands to ensure a smooth development experience.
57+
58+
You can easily do this by running the command `nvm use`.
59+
60+
To start your local version of GitBook, run the command `bun dev`.
61+
62+
#### 4. Preview your changes
63+
64+
When running the development server, published GitBook sites can be rendered through your local version at `http://localhost:3000/`.
65+
66+
For example, our published docs can be viewed using the local version by visiting `http://localhost:3000/docs.gitbook.com` after running the development server.
5367

54-
After forking this repository, you'll want to [create a branch](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-a-branch-for-an-issue) to work off of. After creating the branch, you can start making changes!
68+
You can visit any published GitBook site behind your development server. Please make sure your site is [published publicly](https://docs.gitbook.com/published-documentation/publish-your-content-as-a-docs-site) to ensure you can view the site correctly in your development version.
5569

5670
### Commit your update
5771

@@ -71,4 +85,4 @@ When you're finished with the changes, [create a pull request](https://docs.gith
7185

7286
### Your PR is merged
7387

74-
Congratulations 🎉Thank you for your contribution! Once your PR is merged, your contributions will be publicly visible on the relevant repository.
88+
Congratulations 🎉 Thank you for your contribution! Once your PR is merged, your contributions will be publicly visible on the relevant repository.

Diff for: .github/workflows/ci.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
env:
9494
BASE_URL: ${{needs.deploy.outputs.deployment_url}}
9595
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
96+
- uses: actions/upload-artifact@v4
97+
if: ${{ !cancelled() }}
98+
with:
99+
name: playwright-test-results
100+
path: packages/gitbook/test-results/
101+
retention-days: 3
96102
pagespeed-testing:
97103
runs-on: ubuntu-latest
98104
name: PageSpeed Testing

Diff for: .github/workflows/publish.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,26 @@ jobs:
3535
# https://github.com/orgs/community/discussions/26875#discussioncomment-3253761
3636
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
3737
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
39+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+
release-preview:
41+
# For now it releases the cache-do to both preview and production
42+
# Once we changed to deploy the app only on release, we should change `release:preview` in `cache-do`
43+
name: Release Preview
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout Repo
47+
uses: actions/checkout@v3
48+
- name: Setup bun
49+
uses: oven-sh/setup-bun@v1
50+
with:
51+
bun-version: 1.1.18
52+
- name: Install dependencies
53+
run: bun install --frozen-lockfile
54+
env:
55+
PUPPETEER_SKIP_DOWNLOAD: 1
56+
- name: Release preview packages
57+
run: bun run release:preview
58+
env:
59+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
60+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

Diff for: README.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<p align="center">Welcome to GitBook, the platform for managing technical knowledge for teams.</p>
1616

17-
<p align="center">This repository contains the open-source code used to render GitBook's published content.</p>
17+
<p align="center">This repository contains the open source code used to render GitBook's published content.</p>
1818

1919
<p align="center">
2020
<img alt="GitBook Open Published Site" src="./assets/published-site.png">
@@ -46,19 +46,28 @@ To run a local version of this project, please follow these simple steps.
4646
git clone https://github.com/gitbookIO/gitbook.git
4747
```
4848

49-
2. Install the project's dependencies through Bun.
49+
2. Ensure you are using the project's version of `node`. Running `nvm use` will change your local version to the correct one.
50+
51+
3. Install the project's dependencies through Bun.
5052

5153
```
5254
bun install
5355
```
5456

55-
3. Start your local development server.
57+
4. Start your local development server.
5658

5759
```
5860
bun dev
5961
```
6062

61-
Then open the space in your web browser, using http://localhost:3000/<host>/<path> (example: http://localhost:3000/docs.gitbook.com).
63+
5. Open a published GitBook space in your web browser, prefixing it with `http://localhost:3000/`.
64+
65+
examples:
66+
67+
- http://localhost:3000/docs.gitbook.com
68+
- http://localhost:3000/open-source.gitbook.io/midjourney
69+
70+
Any published GitBook site can be accessed through your local development instance, and any updates you make to the codebase will be reflected in your browser.
6271

6372
### Other development commands
6473

@@ -71,15 +80,15 @@ All pull-requests will be tested against both visual and performances testing to
7180

7281
## Contributing
7382

74-
GitBook's rendering engine is fully open-source and built on top of [Next.js](https://nextjs.org/). Head to our [contributing guide](https://github.com/GitbookIO/gitbook/.github/CONTRIBUTING.md) to learn more about the workflow on adding your first Pull Request.
83+
GitBook's rendering engine is fully open source and built on top of [Next.js](https://nextjs.org/). Head to our [contributing guide](https://github.com/GitbookIO/gitbook/blob/main/.github/CONTRIBUTING.md) to learn more about the workflow on adding your first Pull Request.
7584

7685
### Types of contributions
7786

7887
We encourage you to contribute to GitBook to help us build the best tool for documenting technical knowledge. If you're looking for some quick ways to contribute, continue reading to learn more about popular contributions.
7988

8089
#### Translations
8190

82-
The GitBook UI is rendered using a set of translation files found in [`src/intl/translations`](/src/intl/translations/). We welcome all additional translations for the UI.
91+
The GitBook UI is rendered using a set of translation files found in [`packages/gitbook/src/intl/translations`](/packages/gitbook/src/intl/translations/). We welcome all additional translations for the UI.
8392

8493
#### Bugs
8594

@@ -90,7 +99,7 @@ Encounter a bug or find an issue you'd like to fix? Helping us fix issues relate
9099
> [!WARNING]
91100
> While it is possible to self-host this project, we do not recommend this unless you are certain this option fits your need.
92101
>
93-
> _Looking to add a specific feature in GitBook? Head to our [contributing guide](/.github/CONTRIBUTING.md) to get started._
102+
> _Looking to add a specific feature in GitBook? Head to our [contributing guide](https://github.com/GitbookIO/gitbook/blob/main/.github/CONTRIBUTING.md) to get started._
94103
>
95104
> Self-hosting this project puts the responsibility of maintaining and merging future updates on **you**. We cannot guarantee support, maintenance, or updates to forked and self-hosted instances of this project.
96105
>

Diff for: bun.lockb

2.22 KB
Binary file not shown.

Diff for: package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
"e2e": "turbo run e2e",
1717
"changeset": "changeset",
1818
"release": "turbo run release && changeset publish",
19-
"download:env": "op read op://gitbook-x-dev/gitbook-open/.env.local >> .env.local"
19+
"release:preview": "turbo run release:preview",
20+
"download:env": "op read op://gitbook-x-dev/gitbook-open/.env.local >> .env.local",
21+
"clean": "turbo run clean"
2022
},
2123
"workspaces": [
2224
"packages/*"
2325
],
2426
"devDependencies": {
2527
"@changesets/cli": "^2.27.7",
2628
"prettier": "^3.0.3",
27-
"turbo": "^2.0.9"
29+
"turbo": "^2.1.2"
2830
},
2931
"patchedDependencies": {
3032
"@vercel/[email protected]": "patches/@vercel%[email protected]"

Diff for: packages/cache-do/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.wrangler
2+
worker-configuration.d.ts
3+
dist/

Diff for: packages/cache-do/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# `@gitbook/cache-do`
2+
3+
Cache backend, powered by Cloudflare Durable Objects. The cache is optimized for GitBook use-cases.
4+
5+
### Performances
6+
7+
The cache backend is optimized for performances by being distributed and accessible close to the worker locations that are reading it.
8+
9+
### Geo-distribution
10+
11+
To achieve a good balance between **performances** and **consistency**, cache objects are distributed over 7 locations, representing continents.
12+
13+
It makes it possible to purge all 7 locations in one go and achieve fast consistency.
14+
15+
### Concepts
16+
17+
**Cache tag**: unique tag in the cache environment. A cache tag groups multiple keys that should be purged together in one operation.
18+
Cache tags should not contain a large set of unique keys. Exceeding thousands could lead to performances or reliability issues.
19+
20+
**Cache key**: unique key in the cache environment. Each key should be assigned to a `tag`.
21+
22+
**Location**: cache is distributed over 7 unique locations, one for each continent.

Diff for: packages/cache-do/package.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "@gitbook/cache-do",
3+
"type": "module",
4+
"private": true,
5+
"exports": {
6+
".": {
7+
"types": "./dist/index.d.ts",
8+
"development": "./src/index.ts",
9+
"default": "./dist/index.js"
10+
},
11+
"./api": {
12+
"types": "./dist/api.d.ts",
13+
"development": "./src/api.ts",
14+
"default": "./dist/api.js"
15+
}
16+
},
17+
"version": "0.0.0",
18+
"dependencies": {
19+
"@msgpack/msgpack": "^3.0.0-beta2",
20+
"lru_map": "^0.4.1"
21+
},
22+
"devDependencies": {
23+
"typescript": "^5.5.3",
24+
"wrangler": "^3.78.7"
25+
},
26+
"scripts": {
27+
"generate": "wrangler types --experimental-include-runtime",
28+
"build": "tsc",
29+
"typecheck": "tsc --noEmit",
30+
"dev": "tsc -w",
31+
"release": "wrangler deploy",
32+
"release:preview": "wrangler deploy && wrangler deploy --env preview"
33+
},
34+
"files": [
35+
"dist",
36+
"src",
37+
"bin",
38+
"data",
39+
"README.md",
40+
"CHANGELOG.md"
41+
]
42+
}

0 commit comments

Comments
 (0)