Skip to content

Commit

Permalink
Merge branch 'main' into jh/grouped-options-with-exclusive-or
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion committed Jan 3, 2025
2 parents c89d07b + 6db8501 commit 325773f
Show file tree
Hide file tree
Showing 85 changed files with 2,038 additions and 430 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ FILE_API_KEY_LAMBETH=👻
FILE_API_KEY_SOUTHWARK=👻
FILE_API_KEY_EPSOM_EWELL=👻
FILE_API_KEY_MEDWAY=👻
FILE_API_KEY_GATESHEAD=👻

# Editor
EDITOR_URL_EXT=http://localhost:3000
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.1
v22.10.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ planx-new is a monorepo containing our full application stack. Here's a quick su
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [PNPM](https://github.com/pnpm/pnpm) `npm install -g pnpm@8.6.6`
- [Node](https://nodejs.org/en/download) `pnpm env use --global 18.16.1`
- [Node](https://nodejs.org/en/download) `pnpm env use --global 22.10.0`
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

**If you're an OSL developer:**
Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/.env.test.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ FILE_API_KEY_LAMBETH=👻
FILE_API_KEY_SOUTHWARK=👻
FILE_API_KEY_EPSOM_EWELL=👻
FILE_API_KEY_MEDWAY=👻
FILE_API_KEY_GATESHEAD=👻

# Editor
EDITOR_URL_EXT=example.com
Expand Down
6 changes: 3 additions & 3 deletions api.planx.uk/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## BASE ##
# 18.16.1 = LTS
FROM node:18.16.1-alpine as base
# 22.10.0 = LTS
FROM node:22.10.0-alpine as base

# Setup Git - required for fetching git dependencies (planx-core)
RUN apk add --no-cache git
Expand All @@ -21,7 +21,7 @@ RUN pnpm install --recursive --prefer-offline
RUN pnpm build
RUN pnpm prune --production

FROM node:18.16.1-alpine as production
FROM node:22.10.0-alpine as production
WORKDIR /api

## PRODUCTION ##
Expand Down
4 changes: 4 additions & 0 deletions api.planx.uk/modules/auth/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export const useFilePermission: RequestHandler = (req, _res, next): void => {
req.headers["api-key"] as string,
process.env.FILE_API_KEY_MEDWAY!,
) ||
isEqual(
req.headers["api-key"] as string,
process.env.FILE_API_KEY_GATESHEAD!,
) ||
isEqual(
req.headers["api-key"] as string,
process.env.FILE_API_KEY_EPSOM_EWELL!,
Expand Down
4 changes: 2 additions & 2 deletions api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"exports": "./dist/index.js",
"engines": {
"node": ">=18.16",
"node": ">=22.10",
"pnpm": "8.6.6"
},
"dependencies": {
Expand Down Expand Up @@ -92,7 +92,7 @@
"@types/jsonwebtoken": "^9.0.5",
"@types/lodash": "^4.17.0",
"@types/multer": "^1.4.11",
"@types/node": "^18.19.13",
"@types/node": "22.10.5",
"@types/passport": "^1.0.16",
"@types/passport-google-oauth20": "^2.0.14",
"@types/supertest": "^6.0.2",
Expand Down
74 changes: 32 additions & 42 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions doc/how-to/how-to-upgrade-nodejs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# How to upgrade Node.js

This guide walks through the required steps to upgrade Node.js versions across the PlanX repositories.

We should always aim to be on an LTS version (even release numbers). For the full release schedule please see https://nodejs.org/en/about/previous-releases

## planx-new
1. Locally install desired Node.js version

```shell
nvm install 22.10.0
nvm use 22.10.0
```

2. Update `.nvmrc` file

3. Update Dockerfiles -
- `api.planx.uk/Dockerfile`
- `sharedb.planx.uk/Dockerfile`

4. Update `@types/node` package across all projects ([npm](https://www.npmjs.com/package/@types/node)). Note: Only major.minor version need to match e.g. types version 22.10.7893 would be fine for Node 22.10.x ([docs](https://github.com/definitelytyped/definitelytyped#how-do-definitely-typed-package-versions-relate-to-versions-of-the-corresponding-library)).

5. Fix any type issues flagged by the above change

6. Update references to `engines` in API `package.json` file

7. Update `README.md`

8. Rebuild docker containers, test and run locally

9. Upgrade the `NODE_VERSION` on GitHub (Settings > Secrets and variables > Actions > "Variables" tab > Update `NODE_VERSION` variable). This variable is used across our GitHub actions to define which Node version runs our CI services.

Please note - this update is immediate and will effect other open PRs. It's advisable to hardcode the desired Node version into the GitHub action files initially to test CI and regression tests, before making this change.

## planx-core
Steps 4, 5 & 9 also apply here and should be updated shortly after.
Loading

0 comments on commit 325773f

Please sign in to comment.