Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a606d4b
test: verify gpg signing
kieran-broomhall-nhs Mar 9, 2026
5ee620f
Updated NextJS and node versions
kieran-broomhall-nhs Mar 10, 2026
ec2d75a
VIA-685 MD: Fix eslint issues and upgrade libraries that needed an up…
marie-dedikova-nhs Mar 10, 2026
607cd26
VIA-685 MD/KB: Adjust eslint config - reduce the amount of libraries …
marie-dedikova-nhs Mar 11, 2026
ae013cc
VIA-685 MD/KB: Fixed some linting issues
kieran-broomhall-nhs Mar 11, 2026
777c23a
VIA-685 MD/KB: Allowed use of any for contract testing
kieran-broomhall-nhs Mar 11, 2026
52aed1d
VIA-685 MD/KB: Fixed build issue, failing tests and typescript issue
kieran-broomhall-nhs Mar 11, 2026
e2873b1
VIA-685 MD/KB: Reverted changes with tsconfig and meta-builder
kieran-broomhall-nhs Mar 11, 2026
21f7e30
VIA-685 MD/KB: Simplified logging logic
kieran-broomhall-nhs Mar 11, 2026
5ef5f0f
VIA-685 MD/KB: Updated NodeJS target version for esbuild and removed …
kieran-broomhall-nhs Mar 11, 2026
9536738
VIA-685 MD/KB: Fixed issue with E2E app not logged in test
kieran-broomhall-nhs Mar 13, 2026
7105cd2
VIA-685 KB: Fixed code formatting
kieran-broomhall-nhs Mar 13, 2026
5835617
VIA-685 KB: Removed remaining Edge runtime logic
kieran-broomhall-nhs Mar 13, 2026
3c255f0
VIA-685 KB: Merged with main
kieran-broomhall-nhs Mar 16, 2026
40a9e23
VIA-685 KB: Added ability to use fake Auth for non localhost envs
kieran-broomhall-nhs Mar 16, 2026
69fe885
VIA-685 KB: Re-added ignore for eslint 10 to dependabot
kieran-broomhall-nhs Mar 17, 2026
689fffd
VIA-685: Modified unused vars lint rule
kieran-broomhall-nhs Mar 23, 2026
8871948
VIA-685 KB: Merged main into branch
kieran-broomhall-nhs Mar 23, 2026
3d1088d
VIA-685 KB: Modified E2E tests to make USE_FAKE_AUTH env var optional
kieran-broomhall-nhs Mar 23, 2026
e3512ec
VIA-685 KB: Updated axios version
kieran-broomhall-nhs Mar 30, 2026
f7582cd
VIA-685 KB: Merge main into branch
kieran-broomhall-nhs Mar 30, 2026
27ecf12
VIA-685 KB: Updated name of test fake auth env var
kieran-broomhall-nhs Mar 30, 2026
1333e8f
VIA-685 KB: Refactored test
kieran-broomhall-nhs Mar 30, 2026
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
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ AUTH_SECRET=some-random-secret-works
# Playwright tests
TEST_APP_URL=https://localhost:3000/check-and-book-vaccinations
TEST_NHS_APP_URL=https://<fake-sso-app>/auth/login?vita=https://localhost:3000
USE_FAKE_AUTH=false
TEST_NHS_APP_USERNAME=
TEST_NHS_APP_PASSWORD=
TEST_NBS_APP_USERNAME=
Expand Down
4 changes: 0 additions & 4 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ updates:
prettier:
patterns: [ "prettier", "prettier*", "*prettier", "*prettier*" ]
ignore:
- dependency-name: "next"
versions: [ ">=16.0.0" ]
- dependency-name: "eslint-config-next"
versions: [ ">=16.0.0" ]
- dependency-name: "eslint"
versions: [ ">=10.0.0" ]
cooldown:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
terraform 1.14.1
pre-commit 4.5.0
vale 3.13.0
nodejs 22.13.1
nodejs 24.14.0

# ==============================================================================
# The section below is reserved for Docker image versions.
Expand Down
3 changes: 2 additions & 1 deletion e2e/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const login = async (browser: Browser, nhsLoginUsername: string): Promise
const user = loadUserFromEnvironment(nhsLoginUsername);
let page;

const useFakeAuth = user.nhsAppLoginUrl.endsWith("localhost:3000");
const useFakeAuth =
user.nhsAppLoginUrl.endsWith("localhost:3000") || process.env["TEST_USE_FAKE_AUTH"]?.toLowerCase() === "true";
if (useFakeAuth) {
const fakeAuthConfig = loadFakeAuthEnvironmentVariables();
const context = await browser.newContext({
Expand Down
2 changes: 1 addition & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const buildLambda = async () => {
minify: true,
platform: "node",
jsx: "automatic",
target: "node22",
target: "node24",
external: ["./xhr-sync-worker.js"],
outfile: `${OUTPUT_DIR}/lambda.js`,
});
Expand Down
93 changes: 75 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { FlatCompat } from "@eslint/eslintrc";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
import nextTypescript from "eslint-config-next/typescript";
import prettierConfig from "eslint-config-prettier";
import compat_plugin from "eslint-plugin-compat";
import { dirname } from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});
import globals from "globals";

const eslintConfig = [
{
Expand All @@ -29,36 +25,97 @@ const eslintConfig = [
"performance/report",
],
},
...compat.extends("next/core-web-vitals", "next/typescript", "prettier", "next"),
compat_plugin.configs["flat/recommended"],
...nextCoreWebVitals,
...nextTypescript,
prettierConfig,

// ----------------------------
// APPLICATION CODE (TS/JS/React)
// ----------------------------
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
sourceType: "module",
ecmaFeatures: { jsx: true },
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
compat: compat_plugin,
},
rules: {
"@typescript-eslint/no-unused-vars": "error",

// nhsuk-frontend: https://github.com/nhsuk/nhsuk-frontend/blob/main/docs/contributing/browser-support.md
// Ref: https://github.com/nhsuk/nhsuk-frontend/blob/main/packages/nhsuk-frontend/.browserslistrc
// supported browsers are listed in package.json
"compat/compat": "warn",
},
},

// Node-only files
{
files: ["*.config.mjs", "*.config.ts", "*.setup.ts", "esbuild.config.mjs"],
languageOptions: {
globals: {
...globals.node,
},
},
},

// Type-aware rules
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
},
rules: {
"@typescript-eslint/no-floating-promises": "error",
},
},

// Override for test files: turn off compat
// ----------------------------
// TEST FILES
// ----------------------------

{
files: ["**/*.test.{js,jsx,ts,tsx}", "**/*.spec.{js,jsx,ts,tsx}", "test-data/**"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: { jsx: true },
},
globals: {
...globals.jest,
...globals.node,
...globals.browser,
},
},
plugins: {
compat: compat_plugin,
},
rules: {
"compat/compat": "off",
},
},
// Override for server-only files: browser compat is irrelevant for code that runs in Node.js
{
files: [
"src/_lambda/**",
"src/app/api/**",
"src/services/**",
"src/utils/auth/apim/**",
"src/utils/auth/callbacks/**",
"src/utils/auth/generate-auth-payload.ts",
"src/utils/auth/get-jwt-token.ts",
"src/utils/auth/pem-to-crypto-key.ts",
],
rules: {
"compat/compat": "off",
},
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/environments/dev/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
deploy_workspace = var.is_github_action ? "gh" : terraform.workspace
prefix = "${local.deploy_workspace}-${local.project_identifier_shortcode}-${data.aws_caller_identity.current.account_id}"
open_next_path = "../../../.open-next"
node_version = "nodejs22.x"
node_version = "nodejs24.x"
log_retention_in_days = 7
cache_lambda_zip_path = "../../../lambda.zip"
content_cache_bucket_name = "${local.prefix}-content-cache"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/environments/preprod/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
deploy_workspace = var.is_github_action ? "gh" : terraform.workspace
prefix = "${local.deploy_workspace}-${local.project_identifier_shortcode}-${data.aws_caller_identity.current.account_id}"
open_next_path = "../../../.open-next"
node_version = "nodejs22.x"
node_version = "nodejs24.x"
log_retention_in_days = 30
cache_lambda_zip_path = "../../../lambda.zip"
content_cache_bucket_name = "${local.prefix}-content-cache"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/environments/prod/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
deploy_workspace = var.is_github_action ? "gh" : terraform.workspace
prefix = "${local.deploy_workspace}-${local.project_identifier_shortcode}-${data.aws_caller_identity.current.account_id}"
open_next_path = "../../../.open-next"
node_version = "nodejs22.x"
node_version = "nodejs24.x"
log_retention_in_days = 30
cache_lambda_zip_path = "../../../lambda.zip"
content_cache_bucket_name = "${local.prefix}-content-cache"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/environments/test/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
deploy_workspace = var.is_github_action ? "gh" : terraform.workspace
prefix = "${local.deploy_workspace}-${local.project_identifier_shortcode}-${data.aws_caller_identity.current.account_id}"
open_next_path = "../../../.open-next"
node_version = "nodejs22.x"
node_version = "nodejs24.x"
log_retention_in_days = 30
cache_lambda_zip_path = "../../../lambda.zip"
content_cache_bucket_name = "${local.prefix}-content-cache"
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/deploy_app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "prefix" {

variable "nodejs_version" {
type = string
description = "Version of the nodejs to use, e.g. 'nodejs22.x'"
description = "Version of the nodejs to use, e.g. 'nodejs24.x'"
}

variable "open-next-path" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/modules/deploy_lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variable "region" {

variable "nodejs_version" {
type = string
description = "Version of the nodejs to use, e.g. 'nodejs22.x'"
description = "Version of the nodejs to use, e.g. 'nodejs24.x'"
}

variable "default_tags" {
Expand Down
17 changes: 17 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
import "@testing-library/jest-dom";
import { performance as nodePerf } from "perf_hooks";
import { TextDecoder, TextEncoder } from "util";

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;

if (typeof globalThis.performance.mark !== "function") {
Object.defineProperty(globalThis.performance, "mark", {
value: nodePerf.mark.bind(nodePerf),
configurable: true,
writable: true,
});
}

if (typeof globalThis.performance.measure !== "function") {
Object.defineProperty(globalThis.performance, "measure", {
value: nodePerf.measure.bind(nodePerf),
configurable: true,
writable: true,
});
}
Loading
Loading