Skip to content

Commit

Permalink
Docusaurus migration (#5855)
Browse files Browse the repository at this point in the history
* base docusaurus project

* Add ORM docs (#5635)

* Update to latest Docusaurus

* add all ORM docs

* Add stub custom components needed by ORM docs

* remove comments

* enable "docs only" mode (#5636)

* Deploy docusaurus to cloudflare pages (#5637)

* quick tweak

* add accelerate docs and organize static imports (#5641)

* add pulse and platform docs (#5642)

* add accelerate docs and organize static imports

* add pulse and platform docs

* Docusaurus-add-about-docs (#5643)

* add accelerate docs and organize static imports

* add pulse and platform docs

* Add About docs

* Docusaurus: add getting started docs (#5648)

* Add styled-components as a dependency

* move remaining MDX files over

* migrate some components for getting started page(s)

* add TODOs and a few more placeholder MDX Components

* images for getting started pages

* Docusaurus: Update navbar (#5655)

* remove boilerplate pages

* Prisma logos

* sidebars, navbar items, and sidebar positioning

* Docusaurus: update footer (#5662)

* Docusaurus: make parallel blocks functional (#5663)

* make parallel blocks functional

* Docusaurus: styling the layout (#5672)

* custom sidebar for docusaurus

* update build

* Update gitignore
Update navbar/sidebars/styling

* Add fonts

* fix per rebase
added footer
update getting-started
added tooltip
added Icon

* getting started

* update tab padding

* update index link for orm

* some tidying up for theming

* update theming

* cleanup

* Docusaurus: merge in Prisma ORM name change (#5671)

* merge in prisma name change

* missed inlinecode references

* confirm build works

* update mobile layout for navbars (#5682)

* update mobile layout for navbars

* cleanup commented lines

* Docusaurus: fix sidebars (#5689)

* formatting

* create new re-usable platform category

* Docusaurus: Kapa.ai and OneTrust scripts (#5690)

* add actual sidebarconfigitem type

* linting

* Docusaurus: add gtag and gtm (#5691)

* add gtag and gtm

* feat: docusaurus homepage (#5688)

Co-authored-by: Jon Harrell <[email protected]>

* fixed

* fixed

* revert tsx icons to use svg files (#5694)

fix broken svgs for sqlite and mariadb

* (docusaurus) fix: Split homepage section into homepageFeatures (#5695)

* Split homepage into different component sections and delete config file

* vertical align

* Docusaurus: generate sitemap (#5704)

* Docusaurus: update algolia app (#5754)

* fix: (docusaurus) fix remaining UI (#5755)

* fix kapa icon issue

* add FA icons to footer

* Update preview + duration badges

* Fix menu caret

* update active color

* update footer to look exactly like prod

* update footer multiple other points

* update sidebar + padding for main content

* update button and icon

* push admonition

* add subsections

* update search input styling

* fix breadcrumbs bug

* update subsections

* fix breadcrumbs

* update menu padding

* update footer links

* feat: techswitcher page poc (#5740)

* add new pages for specific techs for techswitcher

* add children to top block

* update techswitcher title/topblock

* update dark mode + icons

* mobile ver

* fix double title

* update footer icons

* revert color of menu__link

* update theming name

* update admonition

* update tabs width

* fix: Continuing ui fixes (#5757)

* update box for subsections
update search page colors

* update carets

* update spacing between icons

* update in this section

* update hide toc

* fix kappa icon

* update font size

* feat: (docusaurus) Footer newsletter (#5756)

* footer newsletter

* update env variable for newsletter

* hide show all results

* hide all results

* hide all results

* Add robots.txt and Prisma syntax highlighting. (#5758)

* add robots.txt. Resolves DA-37

* add syntax highlighting for Prisma files. Resolves DA-144

* Docusaurus: more random things (#5759)

* Add back prism.css file. Resolves DA-147

* fix some broken tables

* make baseUrl /docs

* remove docusaurus template stuff. Resolves DA-148

* update sidenavs + use _category_.json + move custom props to frontMatter. Resolves DA-151

* revert baseUrl change

* Docusaurus: don't use styled-components on homepage (#5760)

* remove duplicate index

* stop using styled-components due to rendering issues

* introduce .editorconfig

* Docusaurus: Fix links on getting started page (#5763)

* Docusaurus: Feat/da 139 finish tech switcher (#5762)

* add more techswitcher pages

* add mongodb switcher

* fix: Continuing ui fixes (#5757)

* update box for subsections
update search page colors

* update carets

* update spacing between icons

* update in this section

* update hide toc

* fix kappa icon

* update font size

* Docusaurus: more random things (#5759)

* Add back prism.css file. Resolves DA-147

* fix some broken tables

* make baseUrl /docs

* remove docusaurus template stuff. Resolves DA-148

* update sidenavs + use _category_.json + move custom props to frontMatter. Resolves DA-151

* add techswithcer pages

* update index for relational databases

* update start-from-scratch/mongodb

* finish all techswitchers

* fix image path for tech switcher

* update space taker for no toc

---------

Co-authored-by: Jon Harrell <[email protected]>

* Revert "Docusaurus: Feat/da 139 finish tech switcher" (#5764)

This reverts commit 3edb5f3.

* Revert "Revert "Docusaurus: Feat/da 139 finish tech switcher"" (#5765)

* Delete docs/index.mdx

* resolve merge issues

* fix some issues from recent feedback (#5766)

* update tabbed content styling

* Docusaurus: add sass plugin (#5767)

* update table widths

* Docusaurus: migrate homepage css to sass (#5768)

* remove all references to styled-components (#5770)

* Docusaurus: fix image links (#5772)

* Docusaurus: add topblock back (#5771)

* Docusaurus: issues from review (#5774)

* Resolves DA-156

* Fix footer links. Resolves DA-170

* Add early access badge to Platform CLI. Resolves DA-171

* change sidebar names. Resolves DA-166.

* update footer on mobile (#5776)

* update pages with hide_toc (#5769)

* update font size for preview badge (#5779)

* add external link svg (#5777)

* update top position of arrow for collapsible box (#5780)

* Docusaurus: fix:DA-167 remove last breadcrumb (#5782)

* remove last item of breadcrumb

* update length min

* update spacing on main element

* update width of code blocks and admonition blocks (#5773)

* remove mobile padding

* update subsections components (#5783)

* Docusarusu: fix:DA-175 mobile sidebar (#5784)

* update mobile sidebar

* update mobile sidebar and header

* Trigger Build

* revert external icon

* update font size for badge

* update zindex of search

* update collapsible box
update padding for mobile content

* update collapsible box

* attempt update on mdx link

* update link

* add link

* add link

* update underline links

* Docusaurus: introduce _redirects file (#5775)

* introduce _redirects file. Resolves DA-142

* remove image redirects (png, snagx, svg, etc)

* add missing header/top section on pages (#5786)

fix ui issues

* add missing header/top section on pages (#5786) (#5787)

fix ui issues

* update getting started tab

* update code block bg

* remove extra padding-top from pre

* update styling of cards at homepage (#5788)

* remove margin on h1

* Idea 1: move everything under 'docs'

* Idea 2: try baseUrl again

* Revert "Idea 2: try baseUrl again"

This reverts commit c0938df.

* try Idea 2 again

* revert ideas around path issues

* fix codeblock issues (#5793)

* add missing theme

* update themings

* revert json to json5 (#5795)

* Docusaurus: remove docs substring in search results (#5789)

* update pagination_next for techswitcher files (#5796)

* update docs footer

* update code in anchor link

* Docusaurus: serve docs content from... content (#5803)

* Docusaurus: lost pixel (#5797)

* add visual regression testing with Lost Pixel

* update sidebars to remove duplicate routes

* edit page names before sending to lost pixel

* DA-118: fix repeated link on subsection

* DA-128: update landing page gradients

* DA-149: fix tables inside tab containers

* DA-187: fix subsections

* DA-184: linking from getting-started

* update font size

* update text size adjust

* update admonition

* Docusaurus: fix:DA-199 update code highlighting name (#5794)

* update code highlighting name

* rename docs to content to track with main

* fix TOC depth 4

* update code highlighting

* remove redundant navigation links in tech switcher pages

* add highlight

* update code

* add normal highlight to code + show numbers

* fix broken code

* update code styling

---------

Co-authored-by: Jon Harrell <[email protected]>
Co-authored-by: meletj <[email protected]>

* Revert "Docusaurus: fix:DA-199 update code highlighting name (#5794)" (#5810)

This reverts commit f22f36a.

* Docusaurus: start work on more github actions (#5809)

* add name for Lost Pixel GHA

* First crack at spellcheck. Resolves DA-52

* backport files from main to make transition easier

* first try at changed files. Resolves DA-49

* Revert "Revert "Docusaurus: fix:DA-199 update code highlighting name"" (#5811)

* Revert "Revert "Docusaurus: fix:DA-199 update code highlighting name (#5794)"…"

This reverts commit 7e00317.

* update colors

* update pre block padding

* Docusaurus: adds back image optimization GHA (#5813)

* Docusaurus: add og image (#5812)

* Docusaurus: correct broken image links (#5814)

* update icon size for admonition blocks

* update icon size for admonition blocks

* update heading for admonition

* update admonition

* try to add br

* fix dark highlight on code label for toc element (#5816)

* update code font size for headings

* Docusaurus: Fix/da 199 code highlight (#5817)

* fix-DA156

* update code highlight

* add missing techswitcher

* add prop to tabbed content

* fix highlight, title, and TOC level

* Update content/300-accelerate/300-caching.mdx

Co-authored-by: Jon Harrell <[email protected]>

---------

Co-authored-by: Prisma <[email protected]>
Co-authored-by: Jon Harrell <[email protected]>

* try to fix tables

* fix extra padding

* Docusaurus: rebase docs from main (#5818)

* rebase content

* delete stale pages

* some fixes

* update language-terminal

* category for pulse

* update docusaurus + usage of

* update docu

* update some shell to bash codeblocks

* Docusaurus: sitemap work + remove old markdown page (#5819)

* Remove leftover markdown page. Resolves DA-217

* make new sitemap closer to old sitemap

* correct sitemap sed command

* Fix/da 222/admonitions (#5820)

* swap alert -> danger for admonition

* fixes post rebase

* Docusaurus: lots of little feedback(s) (#5822)

* unlist legacy-migrate page. Resolves DA-240

* Remove stale cloudflare page. Resolves DA-242

* make pulse database instructions look closer to live. Resolves DA-234

* move backticks inside of square brackets. Resolves DA-233

* update lost pixel workflow

* update wrangler and add wrangler.toml (#5824)

* change production baseUrl for now

* bump docusaurus versions

* update bash type codeblock

* DA-221: fix code blocks

* DA-221: fix center alignment and consequent code block issues

* fix cli

* DA-246: center video

* DA-239: add  prop to blockcontent

* DA-236: update output name of cmdresult

* DA-235: update spacing on cmdresults

* DA-247: fix cmd result inside tabs container

* DA-249: add margin to top main content on index page

* DA-248: fix blockquote border

* Docusarus: fix:DA-205 QA pagespeed performance (#5828)

* parse through fonts and update font-face

* DA-213:fix toc padding

* update icon and toc padding

* DA-234:Fix ui for collapsible blocks

* DA-243: fix code with result query colors

* update prism file

* update highlight color

* update code with result specific margin

* update seeding page tabs

* remove border from collapsible

* DA-256: fix image width

* fixes (#5832)

* Fix/mongo db guide (#5833)

* update admonition

* line

* Docusaurus: fix broken links and throw on broken links (#5829)

* update padding on pages

* DA-266: update weird customprops on footer

* DA-265: update icon for sqlserver

* remove duplicate fonts and update font-faces (#5839)

* Docusaurus: fix:DA-256 table icons darkmode (#5840)

* update color of icons on table

* update missing classname for table icons
update kbd elements color for darkmode

* Docusaurus: edit EditThisPage component (#5835)

* edit EditThisPage component

* update styling of edit this on github link

---------

Co-authored-by: Prisma <[email protected]>

* Docusaurus: fix all relative links (#5837)

* Docusaurus: update footer links to be www instead of apex (#5836)

* Docusaurus: change baseUrl for preview for migration testing (#5841)

* change baseUrl for migration testing

* make site accessible again

* Docusaurus: convert metaDescription -> description (#5843)

* Docusaurus: give Platform its own sidebar (#5845)

* Docusaurus: remove title from TopBlock (#5844)

removes title from TopBlock and instead uses the default Docusaurus title but styled

* quick edit robots.txt

* another quick robots.txt update

* update canonical url for now

* final robots change

* Docusaurus: metadata compatible with our existing frontmatter (#5846)

* make docusaurus metadata compatible with our existing frontmatter

* Revert "Docusaurus: convert metaDescription -> description (#5843)" (#5847)

This reverts commit 730b558.

* Docusaurus: add missing files from main (#5848)

* fix syncing issues

* DA-149:Update tables

* update techswitcher pagers (#5851)

* update table color for dark mode

* fix docu build

* update table codes

* update tables

* Docusaurus: get our content closer to main (#5854)

* get our content closer to main

* Docusaurus: ready for production (#5857)

* Docusaurus final seo (#5853)

Update frontmatter for all tech switcher files

---------

Co-authored-by: Marc Hess <[email protected]>
Co-authored-by: Petra Donka <[email protected]>
Co-authored-by: Jon Harrell <[email protected]>

* fix links

* prepend links with forward slash

---------

Co-authored-by: carlagn <[email protected]>
Co-authored-by: meletj <[email protected]>
Co-authored-by: meletj <[email protected]>
Co-authored-by: Marc Hess <[email protected]>
Co-authored-by: Petra Donka <[email protected]>
  • Loading branch information
6 people authored Apr 10, 2024
1 parent 3826a86 commit 34b0978
Show file tree
Hide file tree
Showing 798 changed files with 38,813 additions and 69,519 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor config
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 100
trim_trailing_whitespace = true

[*.{md,mdx}]
insert_final_newline = false
trim_trailing_whitespace = false
8 changes: 0 additions & 8 deletions .env.example

This file was deleted.

11 changes: 0 additions & 11 deletions .flycode.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/image-optimise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout Branch
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Compress Images
id: calibre
Expand All @@ -51,7 +51,7 @@ jobs:
if: |
github.event_name != 'pull_request' &&
steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v6.0.2
with:
title: Auto Compress Images
branch-suffix: timestamp
Expand Down
117 changes: 40 additions & 77 deletions .github/workflows/list-changed-pages.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,62 @@
name: Comment based on changed pages (Vercel Deploy URLs + Redirect Suggestions)

name: List Changed Pages
on:
pull_request:
branches:
- main
- docusaurus
paths:
- 'content/**/*'

jobs:
post-comment-with-links-to-changed-pages:
name: Create or Update
post-files-changed-comment:
name: 'Post files changed comment'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get list of changed files
id: files
uses: Ana06/[email protected] # it's a fork of jitterbit/get-changed-files@v1 which works better with pull requests
- name: List Vercel Deploy URLs
id: links
# Note that this uses `%0A` instead of `\n` because of https://github.com/peter-evans/create-or-update-comment#setting-the-comment-body-from-a-file which I could not get to work here - but this brute force method does.
run: |
body="This PR changes the following pages (Vercel Preview Deploy links):%0A%0A"
no_changed_pages="%0A- This PR does not change any pages the [GH Actions workflow](https://github.com/prisma/docs/blob/main/.github/workflows/list-changed-pages.yml) could detect."
vercelLinks="Changed Vercel links"
body="$body%0A%0A$vercelLinks"
for changed_file in ${{ steps.files.outputs.all }}; do
if [[ $changed_file == content/* ]]
then
no_changed_pages=""
cleaned_file=$(echo "$changed_file" | sed -E 's:content/:/:g' | sed -E 's:/index.mdx::g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' )
branch_name=$(echo "${{github.event.pull_request.head.ref}}" | sed -e 's/\//-/g')
# TODO special case for images and similar non .mdx files
# Output inside the action
echo "- https://docs-git-${branch_name}-prisma.vercel.app$cleaned_file"
- uses: actions/checkout@v4

# Also collect into string
linksVercel="%0A- [/docs$cleaned_file](https://docs-git-${branch_name}-prisma.vercel.app$cleaned_file) ([currently](https://prisma.io/docs$cleaned_file))"
body="$body$linksVercel"
fi
done
body="$body$no_changed_pages"
body="$body%0A%0A(Note that links will only be valid after Vercel preview deploy succeeded)"
echo "::set-output name=body::$body"
- name: Find existing comment (links)
uses: peter-evans/find-comment@v1
id: fc
- name: Get all changed markdown files
id: changed-files
uses: tj-actions/changed-files@v44
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: following pages
files: content/**/*.{md,mdx}

- name: Create comment (links)
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.links.outputs.body }}

- name: Update comment (links)
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: ${{ steps.links.outputs.body }}
edit-mode: replace

### REDIRECTS ###

- name: Create suggested redirects
id: redirects
- name: Build comment body
id: build-comment-body
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.any_changed }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
bash .github/workflows/scripts/generate-redirects.sh
- name: Find existing comment (redirects)
OUTPUT=""
if [ ${CHANGED_FILES} == 'true' ]; then
OUTPUT="| original | preview |%0A| ------ | ------ |%0A"
for file in ${ALL_CHANGED_FILES}
do
OUTPUT+="| ${file} | |%0A"
done
else
OUTPUT="No files changed."
fi
echo "::set-output name=body::$OUTPUT"
- name: Find existing comment
uses: peter-evans/find-comment@v1
id: fc2
id: find-existing
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: following redirects
body-includes: 'original | preview'

- name: Create comment (redirects)
if: steps.fc2.outputs.comment-id == ''
- name: Create comment
if: steps.find-existing.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.redirects.outputs.body }}
body: ${{ steps.build-comment-body.outputs.body }}

- name: Update comment (redirects)
if: steps.fc2.outputs.comment-id != ''
- name: Update comment
if: steps.find-existing.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc2.outputs.comment-id }}
body: ${{ steps.redirects.outputs.body }}
comment-id: ${{ steps.find-existing.outputs.comment-id }}
body: ${{ steps.build-comment-body.outputs.body }}
edit-mode: replace
49 changes: 22 additions & 27 deletions .github/workflows/lost-pixel.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
---
name: LostPixel

name: 'Lost Pixel'
on: [push]

jobs:
gatsby-for-percy:
name: Lost Pixel screenshots via Gatsby build
build:
runs-on: ubuntu-latest
name: Lost Pixel

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: '14'
- run: npm ci
- name: Caching Gatsby
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: public
.cache
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: Build Gatsby app
run: npx gatsby build --prefix-paths
env:
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true
CI: true
node-version: 18

- name: Install deps
run: npm install

- name: Build docs
run: npm run clean && npm run build

- name: Start docs
run: npm run serve &

- name: Generate sitemap
run: npx lost-pixel page-sitemap-gen http://172.17.0.1:3000/sitemap.xml "./lost-pixel-pages.json"

- name: Run Gatsby app
run: npx gatsby serve --host 172.17.0.1 &
- name: Edit page names
run: sed -i -e 's/_/\//g' -e 's|prisma\.io||g' -re 's/(name.+)(\/)(\")/\1-\3/g' lost-pixel-pages.json

- name: Lost Pixel
uses: lost-pixel/lost-pixel@v3.4.4
uses: lost-pixel/lost-pixel@v3.16.0
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}
36 changes: 0 additions & 36 deletions .github/workflows/notion.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
name: 'Docs: Spellcheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
name: Check out the code
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
name: Setup node
with:
node-version: '18'
Expand Down
Loading

0 comments on commit 34b0978

Please sign in to comment.