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

[NT] Split out docs dependencies #2084

Merged
merged 8 commits into from
Oct 13, 2023
Merged

Conversation

timdawborn
Copy link
Contributor

@timdawborn timdawborn commented Oct 12, 2023

Description, Motivation and Context

The dependencies in the top-level package.json file are not particularly representative of SPOT itself. Many of them, especially the large external libraries (including mobx and react 😱), are only needed for building the docs.

This PR moves all of the docs-only dependencies out to their own package.json and yarn.lock files. By having the docs dependencies separate, we should have a lot more confidence when upgrading external dependencies that we're not going to break the main application.

@timdawborn timdawborn changed the title [NT] Split docs dependencies into separate dependencies [NT] Split out docs dependencies Oct 12, 2023
@@ -32,15 +32,27 @@ commands:
- checkout
- restore_cache:
keys:
- v3-dependencies-{{ checksum "package.json" }}
- v3-dependencies-{{ checksum "yarn.lock" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated bug fix — the node_modules cache should have been keyed by yarn.lock, not package.json.

Comment on lines +44 to +55
- restore_cache:
keys:
- v3-docs-dependencies-{{ checksum "docs/yarn.lock" }}
- v3-docs-dependencies
- run:
name: Install docs dependencies
command: yarn install --frozen-lockfile
working_directory: docs/
- save_cache:
paths:
- docs/node_modules
key: v3-docs-dependencies-{{ checksum "docs/yarn.lock" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install the docs dependencies in addition to the top-level dependencies.

Comment on lines +12 to +17
- package-ecosystem: npm
directory: "/docs"
schedule:
interval: weekly
day: monday
time: "05:00"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add dependabot updates for the docs dependencies.

@timdawborn timdawborn requested a review from njday October 12, 2023 08:09
@timdawborn timdawborn marked this pull request as ready for review October 12, 2023 08:09
@timdawborn timdawborn requested a review from a team as a code owner October 12, 2023 08:09
Comment on lines +80 to +87
- run:
name: Build the documentation.
command: |
set -uex
if [ << parameters.node_version >> -gt 16 ]; then
# Without this, we get `Error: error:0308010C:digital envelope routines::unsupported` on Node >= 17.
export NODE_OPTIONS="--openssl-legacy-provider"
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build the docs as part of CI.

Copy link

@njday njday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea 👍

@timdawborn timdawborn merged commit 431b815 into master Oct 13, 2023
6 checks passed
@timdawborn timdawborn deleted the no-ticket-split-docs-dependencies branch October 13, 2023 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants