From 329ee3860a64383613f511bb7df547d3e9e37f19 Mon Sep 17 00:00:00 2001 From: Seung Park Date: Thu, 21 Nov 2024 11:48:11 -0500 Subject: [PATCH 1/4] DOP-5194: update input font size for mobile (#1308) --- src/components/ActionBar/styles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ActionBar/styles.js b/src/components/ActionBar/styles.js index 1881e5c15..9486004ad 100644 --- a/src/components/ActionBar/styles.js +++ b/src/components/ActionBar/styles.js @@ -190,7 +190,9 @@ export const searchInputStyling = ({ mobileSearchActive }) => css` ${displayNone.onMedium}; @media ${theme.screenSize.upToMedium} { - font-size: ${theme.fontSize.default}; + input[type='search'] { + font-size: ${theme.fontSize.default}; + } } ${mobileSearchActive && From 8cf4a65ef23ecb777a20e698315feb9611c49ae7 Mon Sep 17 00:00:00 2001 From: rayangler <27821750+rayangler@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:06:42 -0500 Subject: [PATCH 2/4] DOP-5189: Create Netlify function to proxy URL fetch (#1310) --- netlify/functions/fetch-url.js | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 netlify/functions/fetch-url.js diff --git a/netlify/functions/fetch-url.js b/netlify/functions/fetch-url.js new file mode 100644 index 000000000..9163419c5 --- /dev/null +++ b/netlify/functions/fetch-url.js @@ -0,0 +1,46 @@ +import axios from 'axios'; + +async function handleURL({ url }) { + try { + const { data } = await axios.get(url, { + // Throws error whenever response status >= 400 + validateStatus: (status) => { + console.log(`Returning status ${status} for ${url}`); + return status < 400; + }, + }); + + return new Response(data, { + status: 200, + headers: { + 'Cache-Control': 'public, durable, max-age=300', + }, + }); + } catch (err) { + console.log({ err }); + + if (axios.isAxiosError(err) && err.response) { + return new Response(null, { status: err.response.status }); + } + return new Response(null, { status: 500 }); + } +} + +// This function exists only to help proxy URLs that were originally causing 403 errors, potentially due +// to IP addresses. (DOP-5189) +async function handler(req, context) { + const params = context.url.searchParams; + const url = params.get('url'); + + // Log to help keep track of requests + console.log({ req, context }); + + if (url) { + return handleURL({ url }); + } + + // Expected to only work when a url query param is defined + return new Response(null, { status: 400 }); +} + +export default handler; From 474dab53f6f82a5aa43f7bd22f326617d115365a Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:30:50 -0500 Subject: [PATCH 3/4] DOP-5159 Specify content repo and parser version in build script for Netlify Frontend Builds (#1309) --- .gitignore | 4 +++- README.md | 6 ++++++ build.sh | 16 +++++++++------- netlify.toml | 8 +++++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 9ee14c77b..5bfb2ce5f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ coverage/ .vscode/ .env .swc/ -bundle.zip \ No newline at end of file +bundle.zip +# Local Netlify folder +.netlify diff --git a/README.md b/README.md index 66459cd24..b41507c02 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,12 @@ npm run build:clean:stage :warning: Note: This will promote the contents of your local public directory. Your instance in staging may break or be outdated if you haven't run `npm run build` before `make stage`. +## Staging with Netlify + +When a commit is pushed, this automatically triggers a Netlify build on your branch. For every push, a deploy and deploy preview will be generated. + +By default, the master branch of `docs-landing` will be parsed with the parser version specified in the `Netlify.toml` and built using your branch as the frontend. If you'd like to build a different site or branch or build with a different parser version, this can be easily done by just updating the values in the Netlify.toml accordingly. Don't forget to update the `ORG_NAME` to `mongodb` or `10gen` depending on which org your repo belongs to! + ## Releasing We have configured an automatic release process using [GitHub Actions](https://github.com/features/actions) that is triggered by [npm-version](https://docs.npmjs.com/cli/version). To release a version, you must have admin privileges in this repo. Then proceed as follows: diff --git a/build.sh b/build.sh index acedec667..61b9f8404 100644 --- a/build.sh +++ b/build.sh @@ -1,21 +1,23 @@ # variables that need to be changed based on the content repo you're working on ------------------------------------------- -TESTING_CONTENT_REPO=docs-landing # name of content repo -ORGANIZATION=mongodb # name of org, usually mongodb or 10gen +TESTING_ORGANIZATION=$1 # name of org, usually mongodb or 10gen +TESTING_REPO_NAME=$2 # name of content repo +TESTING_BRANCH_NAME=$3 # name of the branch +PARSER_VERSION=$4 # version of the parser to download # ------------------------------------------------------------------------------------------------------------------------- -PARSER_VERSION=0.18.6 # This make command curls the examples for certain repos. # If the rule doesn't exist, the error doesn't interrupt the build process. # make examples - we don't need this for docs-landing, but have it here for when we change repos # cloning the content repo -echo "cloning content repo: ${TESTING_CONTENT_REPO}" -git clone https://github.com/${ORGANIZATION}/${TESTING_CONTENT_REPO}.git +echo "Cloning content repo: ${TESTING_REPO_NAME}" +git clone -b ${TESTING_BRANCH_NAME} https://github.com/${TESTING_ORGANIZATION}/${TESTING_REPO_NAME}.git + # running the parser if [ ! -d "snooty-parser" ]; then - echo "snooty parser not installed, downloading..." + echo "Snooty parser not installed, downloading parser version $PARSER_VERSION ..." curl -L -o snooty-parser.zip https://github.com/mongodb/snooty-parser/releases/download/v${PARSER_VERSION}/snooty-v${PARSER_VERSION}-linux_x86_64.zip unzip -d ./snooty-parser snooty-parser.zip chmod +x ./snooty-parser/snooty @@ -23,7 +25,7 @@ fi echo "=======================================================================================================================================================================" echo "========================================================================== Running parser... ==========================================================================" -./snooty-parser/snooty/snooty build $(pwd)/${TESTING_CONTENT_REPO} --output=./bundle.zip +./snooty-parser/snooty/snooty build $(pwd)/${TESTING_REPO_NAME} --output=./bundle.zip echo "========================================================================== Parser complete ============================================================================" echo "=======================================================================================================================================================================" diff --git a/netlify.toml b/netlify.toml index 937e9fc6a..3a4ac8875 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,4 +3,10 @@ name = "snooty-cache-plugin" [build] publish = "public" -command = ". ./build.sh" +command = ". ./build.sh $ORG_NAME $REPO_NAME $BRANCH_NAME $PARSER_VERSION" + +[build.environment] +ORG_NAME = "mongodb" +REPO_NAME = "docs-landing" +BRANCH_NAME = "master" +PARSER_VERSION = "0.18.6" \ No newline at end of file From f729b9e9b75f3872877e0a34b457846e07e7dfa4 Mon Sep 17 00:00:00 2001 From: anabellabuckvar <41971124+anabellabuckvar@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:49:55 -0500 Subject: [PATCH 4/4] Revert "Merge branch 'netlify-poc' into main" This reverts commit d77d32f69ce9d2dddf08f0fcf8ec16d6707ee380, reversing changes made to 474dab53f6f82a5aa43f7bd22f326617d115365a. Revert merge commit from netlify-poc branch --- CHANGELOG.md | 63 +++++++++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c372970..493a03435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,15 +46,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). ### Merged -- DOP-4785: Remove MUT_CANDIDATES [`#1290`](https://github.com/mongodb/snooty/pull/1290) -- DOP-5052: fixing link buffer's on mobile [`#1289`](https://github.com/mongodb/snooty/pull/1289) -- DOP-5078: Fix duplicate "docs" prefix in BreadcrumbList [`#1285`](https://github.com/mongodb/snooty/pull/1285) -- DOP-5080: Remove Lighthouse action [`#1288`](https://github.com/mongodb/snooty/pull/1288) -- DOP-5087: Remove DarkMode announcement/guide cue [`#1287`](https://github.com/mongodb/snooty/pull/1287) -- DOP-5092: Tabs components are interactive offline [`#1286`](https://github.com/mongodb/snooty/pull/1286) -- DOP-5053: Fix client-side fetch refresh - legacy page [`#1283`](https://github.com/mongodb/snooty/pull/1283) -- DOP-5061: Add title as name for Procedure structure data [`#1284`](https://github.com/mongodb/snooty/pull/1284) -- Update build.sh parser version [`#1282`](https://github.com/mongodb/snooty/pull/1282) - DOP-5014: allow chatbot option consecutively [`#1281`](https://github.com/mongodb/snooty/pull/1281) - DOP-4971: Source API changelog data from Github rather than S3 [`#1271`](https://github.com/mongodb/snooty/pull/1271) - DOP-5058: change font weight of steps to 500 [`#1280`](https://github.com/mongodb/snooty/pull/1280) @@ -290,7 +281,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Fix ChatbotUI background inheritance [`#1145`](https://github.com/mongodb/snooty/pull/1145) - Lighthouse Fix: Access correct commit message for both merges and PRs [`#1142`](https://github.com/mongodb/snooty/pull/1142) -## [v0.16.19](https://github.com/mongodb/snooty/compare/v0.16.17...v0.16.19) - 2024-06-20 +## [v0.16.19](https://github.com/mongodb/snooty/compare/v0.16.18...v0.16.19) - 2024-06-20 ## [v0.16.18](https://github.com/mongodb/snooty/compare/v0.16.17...v0.16.18) - 2024-06-27 @@ -314,20 +305,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Remove old lighthouse workflow [`#1134`](https://github.com/mongodb/snooty/pull/1134) - Remove lang-based redirect for now [`#1133`](https://github.com/mongodb/snooty/pull/1133) -<<<<<<< HEAD -<<<<<<< HEAD -## [v0.16.17](https://github.com/mongodb/snooty/compare/v0.16.15...v0.16.17) - 2024-06-13 -======= -## [v0.16.18](https://github.com/mongodb/snooty/compare/v0.16.17...v0.16.18) - 2024-06-14 - -### Merged - -- Remove lang-based redirect for now [`#1133`](https://github.com/mongodb/snooty/pull/1133) - -======= ->>>>>>> v0.18.11 ## [v0.16.17](https://github.com/mongodb/snooty/compare/v0.16.16...v0.16.17) - 2024-06-13 ->>>>>>> v0.18.9 ### Merged @@ -352,6 +330,18 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - DOP-4643: add border for dark mode image [`#1116`](https://github.com/mongodb/snooty/pull/1116) - DOP-4627: Darkmode - Code components [`#1110`](https://github.com/mongodb/snooty/pull/1110) +## [v0.16.16](https://github.com/mongodb/snooty/compare/v0.16.15...v0.16.16) - 2024-06-07 + +### Merged + +- Revert "DOP-4715: Upgrade consistent nav to "v2.1.0"" [`#1120`](https://github.com/mongodb/snooty/pull/1120) +- :lipstick: DOP-4654 applies dark mode support for product list component [`#1118`](https://github.com/mongodb/snooty/pull/1118) +- DOP-4608: Add entries for using Atlas Device SDK in the language selector [`#1092`](https://github.com/mongodb/snooty/pull/1092) + +### Commits + +- updating package with new version [`f7af6e9`](https://github.com/mongodb/snooty/commit/f7af6e90716cb3ba02cffac18ea22da1ef67d823) + ## [v0.16.15](https://github.com/mongodb/snooty/compare/v0.16.14...v0.16.15) - 2024-06-06 ### Merged @@ -390,7 +380,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - DOP-4566: set init values for tabs and tab selectors during build time [`#1080`](https://github.com/mongodb/snooty/pull/1080) -## [v0.16.12](https://github.com/mongodb/snooty/compare/v0.16.11...v0.16.12) - 2024-05-01 +## [v0.16.12](https://github.com/mongodb/snooty/compare/v0.16.12-breadcrumbs...v0.16.12) - 2024-05-01 ### Merged @@ -399,6 +389,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - :bug: DOP-4572 Unused objects/props are included in reference links [`#1081`](https://github.com/mongodb/snooty/pull/1081) - DOP-4505: Lighthouse Server scores for desktop and mobile [`#1079`](https://github.com/mongodb/snooty/pull/1079) +## [v0.16.12-breadcrumbs](https://github.com/mongodb/snooty/compare/v0.16.11...v0.16.12-breadcrumbs) - 2024-05-13 + +### Merged + +- Fix bread [`#1086`](https://github.com/mongodb/snooty/pull/1086) +- DOP-4536: Breadcrumbs! 🚂🍞🥐🥖🫓🍞 [`#1085`](https://github.com/mongodb/snooty/pull/1085) +- DOP-4587: Bump consistent-nav package to 2.0.7 [`#1082`](https://github.com/mongodb/snooty/pull/1082) + +### Commits + +- DOP-4613: Fix breadcrumb links (#1091) [`2a2a981`](https://github.com/mongodb/snooty/commit/2a2a9811039dc0c19bb5ad6a0b787ea1afef4b85) +- update version - v0.16.12-breadcrumbs [`da8982e`](https://github.com/mongodb/snooty/commit/da8982ea81c70620b33becaa0b500a7aa5a00c4c) + ## [v0.16.11](https://github.com/mongodb/snooty/compare/v0.16.11-munich...v0.16.11) - 2024-04-24 ## [v0.16.11-munich](https://github.com/mongodb/snooty/compare/v0.16.10...v0.16.11-munich) - 2024-05-01 @@ -455,7 +458,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Update .prettierignore [`722f310`](https://github.com/mongodb/snooty/commit/722f3105f4b0ef67854167cdd78ae5b3c6fd7d84) -## [v0.16.6](https://github.com/mongodb/snooty/compare/v0.16.4...v0.16.6) - 2024-03-20 +## [v0.16.6](https://github.com/mongodb/snooty/compare/v0.16.5...v0.16.6) - 2024-03-20 ### Merged @@ -476,6 +479,16 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - DOP-4379: Modify Figure.test.js to fail if "class" option is not properly accessed [`#1027`](https://github.com/mongodb/snooty/pull/1027) - Removing all instances of v0.16.5 [`#1026`](https://github.com/mongodb/snooty/pull/1026) +## [v0.16.5](https://github.com/mongodb/snooty/compare/v0.16.4...v0.16.5) - 2024-03-04 + +### Merged + +- DOP-4411: Fixing Homepage Hero Image [`#1030`](https://github.com/mongodb/snooty/pull/1030) + +### Commits + +- updating package, package-lock [`c165b87`](https://github.com/mongodb/snooty/commit/c165b872aa7295fc6c97e7f032db131f2ff7b13a) + ## [v0.16.4](https://github.com/mongodb/snooty/compare/v0.16.3...v0.16.4) - 2024-02-28 ### Merged diff --git a/package.json b/package.json index 7902d8d3e..e069123ff 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "build": "gatsby build --prefix-paths", "build:clean": "npm run clean && npm run build", "build:clean:stage": "npm run build:clean && make stage", - "build:no-prefix": "gatsby build", "build:netlify": "npm run build && echo -n $INCOMING_HOOK_BODY > build-hook.txt", + "build:no-prefix": "gatsby build", "clean": "gatsby clean", "develop": "gatsby develop", "ensure-main": "node scripts/ensure-main.js",