Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in latest from main #1312

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ coverage/
.vscode/
.env
.swc/
bundle.zip
bundle.zip
# Local Netlify folder
.netlify
63 changes: 38 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 9 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# 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.7

# 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
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 "======================================================================================================================================================================="

Expand Down
8 changes: 7 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
46 changes: 46 additions & 0 deletions netlify/functions/fetch-url.js
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/components/ActionBar/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
Loading