From 6bd4b97ccd47cd0282cbc49b13e2f7bd9935b42e Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:04:25 -0500 Subject: [PATCH 1/9] add name for Lost Pixel GHA --- .github/workflows/lost-pixel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lost-pixel.yml b/.github/workflows/lost-pixel.yml index 8e03709c4b..d61c999c2a 100644 --- a/.github/workflows/lost-pixel.yml +++ b/.github/workflows/lost-pixel.yml @@ -1,3 +1,4 @@ +name: 'Lost Pixel' on: [push] jobs: From dd6adf44f7771a837ed273916946f84023ee7cb8 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:05:10 -0500 Subject: [PATCH 2/9] First crack at spellcheck. Resolves DA-52 --- .github/workflows/spellcheck.yml | 28 ++++++ cSpell.json | 152 +++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 .github/workflows/spellcheck.yml create mode 100644 cSpell.json diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 0000000000..da289269f5 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,28 @@ +name: Documentation Checks + +on: + push: + branches: + - main + paths: + - 'content/**/*' + pull_request: + branches: + - main + paths: + - 'content/**/*' +jobs: + spellcheck: + name: 'Docs: Spellcheck' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install cSpell + run: npm install -g cspell + + - name: Run cSpell + run: cspell --config ./cSpell.json "content/**/*.mdx" --no-progress diff --git a/cSpell.json b/cSpell.json new file mode 100644 index 0000000000..fc82d6459f --- /dev/null +++ b/cSpell.json @@ -0,0 +1,152 @@ +{ + "version": "0.2", + "language": "en", + "words": [ + "Amplication", + "Autoincrementing", + "baselined", + "Baselining", + "cockroachdb", + "codemod", + "codemods", + "datamodel", + "datasource", + "earlyaccess", + "ecommerce", + "Fastify", + "fulltext", + "Hasura", + "hotfix", + "hotfixing", + "idempotency", + "InnoDB", + "ISAM", + "livestream", + "microservices", + "Middlewares", + "MSSQLSERVER", + "neovim", + "Nestjs", + "Overfetching", + "pgbouncer", + "planetscale", + "pooler", + "poolers", + "preconfigure", + "preconfigured", + "Quickstart", + "refactorings", + "roadmap", + "signup", + "sqlserver", + "TLDR", + "triaging", + "upsert", + "upserts", + "upvote", + "walkthrough", + "healthcheck", + "runtimes", + "substep", + "substeps", + "Supabase", + "Redistributable", + "Nuxt", + "Sveltekit", + "Pothos", + "backoff", + "Replibyte", + "Snaplet", + "Kysely", + "Turso", + "autocompletions", + "Formbricks", + "Openform", + "Documenso", + "Docusign", + "ghostfolio", + "Scholarsome", + "Dittofeed", + "Webstudio", + "Dyrector", + "Coolify", + "hostable", + "Rallly", + "Dundring", + "Letterpad", + "Hitori", + "Zenstack" + ], + "ignoreWords": [ + "Ania", + "Koyeb", + "Neward", + "nikolasburk", + "Slonik", + "Superstruct", + "Tottem", + "tsdf", + "Typebot", + "umami", + "Vitess", + "libgcc", + "libc", + "Distroless", + "Nikolas", + "Supavisor", + "inshellisense", + "janedoe" + ], + "patterns": [ + { + "name": "Markdown links", + "pattern": "\\((.*)\\)", + "description": "" + }, + { + "name": "Markdown code blocks", + "pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx", + "description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions" + }, + { + "name": "Inline code blocks", + "pattern": "\\`([^\\`\\r\\n]+?)\\`", + "description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex" + }, + { + "name": "Link contents", + "pattern": "\\", + "description": "" + }, + { + "name": "Snippet references", + "pattern": "-- snippet:(.*)", + "description": "" + }, + { + "name": "Snippet references 2", + "pattern": "\\<\\[sample:(.*)", + "description": "another kind of snippet reference" + }, + { + "name": "Multi-line code blocks", + "pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm" + }, + { + "name": "HTML Tags", + "pattern": "<[^>]*>", + "description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string" + } + ], + "ignoreRegExpList": [ + "Markdown links", + "Markdown code blocks", + "Inline code blocks", + "Link contents", + "Snippet references", + "Snippet references 2", + "Multi-line code blocks", + "HTML Tags" + ], + "ignorePaths": [] +} \ No newline at end of file From fcd733b346eb5ccce799fc5625c713a9622ed692 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:05:53 -0500 Subject: [PATCH 3/9] backport files from main to make transition easier --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/doc_request.md | 6 ++ .github/ISSUE_TEMPLATE/website_request.md | 5 ++ .github/ISSUE_TEMPLATE/z_doc_release.md | 18 +++++ .../workflows/scripts/generate-redirects.sh | 74 +++++++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/doc_request.md create mode 100644 .github/ISSUE_TEMPLATE/website_request.md create mode 100644 .github/ISSUE_TEMPLATE/z_doc_release.md create mode 100644 .github/workflows/scripts/generate-redirects.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..5aea5e4c32 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +content/* @prisma/dev-advocates-write diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3ba13e0cec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/doc_request.md b/.github/ISSUE_TEMPLATE/doc_request.md new file mode 100644 index 0000000000..b80d4b4fc8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc_request.md @@ -0,0 +1,6 @@ +--- +name: ✍ Documentation request or bug +about: Report a content issue (incorrect content, spelling mistake, broken link), request new content, or suggest an improvement. +labels: 'docs' +assignees: '' +--- diff --git a/.github/ISSUE_TEMPLATE/website_request.md b/.github/ISSUE_TEMPLATE/website_request.md new file mode 100644 index 0000000000..2614313882 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/website_request.md @@ -0,0 +1,5 @@ +--- +name: ✨ Doc site request or bug +about: Request a website feature or improvement, or report a bug. For documentation, please use documentation request. +labels: 'website' +--- diff --git a/.github/ISSUE_TEMPLATE/z_doc_release.md b/.github/ISSUE_TEMPLATE/z_doc_release.md new file mode 100644 index 0000000000..8c3bc9a5d3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/z_doc_release.md @@ -0,0 +1,18 @@ +--- +name: 🎉 Documentation release +about: INTERNAL ONLY. Documentation release tasks. +title: 'Release:' +labels: 'docs,docs/task' +assignees: '' +--- + +## Release + +- [ ] Merge in new content +- [ ] Update 'What's new' page with links to the release notes and new docs (example: https://www.prisma.io/docs/about/whats-new-in-prisma-docs#april-04-2021) +- [ ] Add links to release notes + +## After release + +- [ ] Add the 'What's new' video +- [ ] Clean up milestone diff --git a/.github/workflows/scripts/generate-redirects.sh b/.github/workflows/scripts/generate-redirects.sh new file mode 100644 index 0000000000..990e734f66 --- /dev/null +++ b/.github/workflows/scripts/generate-redirects.sh @@ -0,0 +1,74 @@ +#!/bin/bash + +body="This PR probably requires the following redirects to be added to vercel.json:%0A%0A" +no_changed_pages="%0A- This PR does not change any pages in a way that would require a redirect." + +echo $GITHUB_BASE_REF +git status -s +git fetch +git reset --soft origin/$GITHUB_BASE_REF +git status -s +status=$(git status -s) + +while IFS= read -r line +do + # Split line into parts + IFS=' ' + read -ra values <<< "$line" + # for value in "${values[@]}"; do + # echo "$value" + # done + + # Skip if line does not indicate modification or rename + if [[ "${values[0]}" != "D" && "${values[0]}" != "R" ]]; then + continue + fi + + # Delete msg for no edited pages and start code block + if [ -n "$no_changed_pages" ]; then + no_changed_pages="" + body="$body""\`\`\`%0A" + fi + + # name pieces (and replace `/index` from files (to get to a filename that would be equivalent)) + action=${values[0]} + path1=$(echo "${values[1]}" | sed -e 's#/index##g' ) + path2=$(echo "${values[3]}" | sed -e 's#/index##g' ) + + # Skip if file names are identical (probably via `/index` replacement above) + if [[ "$path1" == "$path2" ]]; then + continue + fi + + # clean paths + path1_cleaned=$(echo "$path1" | sed -E 's:content/:/:g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' ) + path2_cleaned=$(echo "$path2" | sed -E 's:content/:/:g' | sed -e 's/.mdx//g' | sed -E 's:/[0-9]+-:/:g' ) + + # special case for deletion + if [[ "${values[0]}" == "D" ]]; then + path2_cleaned="/##( TODO: Path of page that replaces deleted page )##" + fi + + redirect=$(cat <<-END + { + "source": "/docs$path1_cleaned", + "destination": "/docs$path2_cleaned" + }, + +END +) + echo $redirect + echo "" + body="$body$redirect%0A" + + #echo "foo" + + +done < <(printf '%s\n' "$status") + +body="$body$no_changed_pages" +body=$(echo "$body" | sed ':a;N;$!ba;s/\n/%0A/g') +echo $body + +echo "::set-output name=body::$body" + From b9e0cb536dc0b4e5409e08642fcd747026bdb010 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:06:19 -0500 Subject: [PATCH 4/9] first try at changed files. Resolves DA-49 --- .github/workflows/list-changed-pages.yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/list-changed-pages.yml diff --git a/.github/workflows/list-changed-pages.yml b/.github/workflows/list-changed-pages.yml new file mode 100644 index 0000000000..d3bda2806d --- /dev/null +++ b/.github/workflows/list-changed-pages.yml @@ -0,0 +1,56 @@ +name: List Changed Pages +on: + pull_request: + branches: + - main + - docusaurus + paths: + - 'content/**/*' + +jobs: + post-files-changed-comment: + name: 'Docs: Spellcheck' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get all changed markdown files + id: changed-files + uses: tj-actions/changed-files@v44 + with: + files: content/**.{md,mdx} + + - name: Build comment body + id: build-comment-body + if: steps.changed-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + output="| original | preview |\n| ------ | ------ |\n"; + for file in ${ALL_CHANGED_FILES}; do; + output+="| ${file} | |\n"; + done; + echo "::set-output name=body::$output" + + - name: Find existing comment + uses: peter-evans/find-comment@v1 + id: find-existing + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: 'original | preview' + + - 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.build-comment-body.outputs.body }} + + - name: Update comment + if: steps.find-existing.outputs.comment-id != '' + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.find-existing.outputs.comment-id }} + body: ${{ steps.build-comment-body.outputs.body }} + edit-mode: replace From 18dde8e91ec21817fbac8d163833fc313afa3f85 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:20:49 -0500 Subject: [PATCH 5/9] make a content change to kick off other github actions --- content/500-platform/30-maturity-levels.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/500-platform/30-maturity-levels.mdx b/content/500-platform/30-maturity-levels.mdx index f51fd78df3..ab0019a646 100644 --- a/content/500-platform/30-maturity-levels.mdx +++ b/content/500-platform/30-maturity-levels.mdx @@ -12,8 +12,6 @@ You can [check out the releases and maturity process for the Prisma ORM](/orm/mo -## - ### Early Access If a feature on the Prisma Data Platform is labeled as **Early Access**: From db8129098779c4c8267ce8e205275bb1bfc1d20d Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:28:50 -0500 Subject: [PATCH 6/9] gha updates --- .github/workflows/list-changed-pages.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/list-changed-pages.yml b/.github/workflows/list-changed-pages.yml index d3bda2806d..e986d61f2e 100644 --- a/.github/workflows/list-changed-pages.yml +++ b/.github/workflows/list-changed-pages.yml @@ -18,18 +18,21 @@ jobs: id: changed-files uses: tj-actions/changed-files@v44 with: - files: content/**.{md,mdx} + files: content/**/*.{md,mdx} - name: Build comment body id: build-comment-body - if: steps.changed-files.outputs.any_changed == 'true' env: + CHANGED_FILES: ${{ steps.changed-files.outputs.any_changed }} ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - output="| original | preview |\n| ------ | ------ |\n"; - for file in ${ALL_CHANGED_FILES}; do; - output+="| ${file} | |\n"; - done; + output="No files changed." + if [ ${CHANGED_FILES} == 'true' ]; then + output="| original | preview |\n| ------ | ------ |\n"; + for file in ${ALL_CHANGED_FILES}; do; + output+="| ${file} | |\n"; + done; + fi echo "::set-output name=body::$output" - name: Find existing comment From fd0668e4c0e029a3cd4dd3857926fca4315a3039 Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:32:39 -0500 Subject: [PATCH 7/9] try and remember bash scripting --- .github/workflows/list-changed-pages.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/list-changed-pages.yml b/.github/workflows/list-changed-pages.yml index e986d61f2e..3e73c00744 100644 --- a/.github/workflows/list-changed-pages.yml +++ b/.github/workflows/list-changed-pages.yml @@ -28,10 +28,11 @@ jobs: run: | output="No files changed." if [ ${CHANGED_FILES} == 'true' ]; then - output="| original | preview |\n| ------ | ------ |\n"; - for file in ${ALL_CHANGED_FILES}; do; - output+="| ${file} | |\n"; - done; + output="| original | preview |\n| ------ | ------ |\n" + for file in ${ALL_CHANGED_FILES} + do + output+="| ${file} | |\n" + done fi echo "::set-output name=body::$output" From ab836bd1f98a5d5aa503fa8c5ede16c4f5891bcd Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:38:06 -0500 Subject: [PATCH 8/9] handle newlines --- .github/workflows/list-changed-pages.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/list-changed-pages.yml b/.github/workflows/list-changed-pages.yml index 3e73c00744..d452d429de 100644 --- a/.github/workflows/list-changed-pages.yml +++ b/.github/workflows/list-changed-pages.yml @@ -26,15 +26,17 @@ jobs: CHANGED_FILES: ${{ steps.changed-files.outputs.any_changed }} ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - output="No files changed." + OUTPUT="" if [ ${CHANGED_FILES} == 'true' ]; then - output="| original | preview |\n| ------ | ------ |\n" + OUTPUT="| original | preview |\n| ------ | ------ |\n" for file in ${ALL_CHANGED_FILES} do - output+="| ${file} | |\n" + OUTPUT+="| ${file} | |\n" done + else + OUTPUT="No files changed." fi - echo "::set-output name=body::$output" + echo "::set-output name=body::${OUTPUT//$'\n'/'%0A'}" - name: Find existing comment uses: peter-evans/find-comment@v1 From fb3c4977fd5113b38b2a2f95d75d327fe72e4e5e Mon Sep 17 00:00:00 2001 From: Jon Harrell <4829245+jharrell@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:40:07 -0500 Subject: [PATCH 9/9] one more try --- .github/workflows/list-changed-pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/list-changed-pages.yml b/.github/workflows/list-changed-pages.yml index d452d429de..22a1e11ccd 100644 --- a/.github/workflows/list-changed-pages.yml +++ b/.github/workflows/list-changed-pages.yml @@ -28,15 +28,15 @@ jobs: run: | OUTPUT="" if [ ${CHANGED_FILES} == 'true' ]; then - OUTPUT="| original | preview |\n| ------ | ------ |\n" + OUTPUT="| original | preview |%0A| ------ | ------ |%0A" for file in ${ALL_CHANGED_FILES} do - OUTPUT+="| ${file} | |\n" + OUTPUT+="| ${file} | |%0A" done else OUTPUT="No files changed." fi - echo "::set-output name=body::${OUTPUT//$'\n'/'%0A'}" + echo "::set-output name=body::$OUTPUT" - name: Find existing comment uses: peter-evans/find-comment@v1