Skip to content
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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
**/.nx
.git
*.log
yarn-error.log*
npm-debug.log*
pnpm-debug.log*
.env
Expand Down
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
/pnpm-lock.yaml linguist-generated
14 changes: 9 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Installs the pnpm version pinned in package.json#packageManager.
- name: Setup pnpm
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
node-version-file: .nvmrc
cache: 'pnpm'

- name: Install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run Prettier check
run: yarn format:check
run: pnpm format:check

- name: Run ESLint
run: yarn lint
run: pnpm lint
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
**/*/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage
Expand All @@ -28,8 +23,6 @@ dist/

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
934 changes: 0 additions & 934 deletions .yarn/releases/yarn-4.6.0.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ the mongoose library. The data is stored in a MongoDB database.

## Development

NodeJS dependencies are managed using [yarn](https://yarnpkg.com/). Make sure
[NodeJS](https://nodejs.org/en) v22 or higher is installed. Run `yarn install`
to install the dependencies.
NodeJS dependencies are managed using [pnpm](https://pnpm.io/). Make sure
[NodeJS](https://nodejs.org/en) v24 or higher is installed (see `.nvmrc`), enable pnpm via
`corepack enable` (it picks up the version pinned in `package.json`) and run
`pnpm install` to install the dependencies.

### Preparation

Expand Down Expand Up @@ -144,7 +145,7 @@ docker exec mongodb mongosh extension-a11y-checker \
In the root directory of the project run:

```shell
yarn dev
pnpm dev
```

This will start the frontend app and the executor in watch mode. The frontend
Expand All @@ -154,7 +155,7 @@ changes on the model classes are made, frontend and executor need to be
restarted manually.

Alternatively you can start the frontend and executor separately by running
`yarn dev` in each package directory.
`pnpm dev` in each package directory.

### Load the frontend fragments

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@
"name": "Lukas Fritze",
"email": "l.fritze@mittwald.de"
},
"packageManager": "yarn@4.6.0",
"packageManager": "pnpm@12.21.0",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "nx run-many --targets=lint",
"lint:fix": "nx run-many --target=lint:fix",
"format": "nx run-many --target=format",
"format:check": "nx run-many --target=format:check",
"typecheck": "nx run-many --target=typecheck",
"test": "nx run-many --target=test",
"dev": "yarn workspaces foreach --all --interlaced --parallel run dev",
"dev": "pnpm --recursive --parallel run dev",
"build": "nx run-many --target=build",
"start": "nx run-many --target=start",
"compile": "yarn build"
"compile": "pnpm build"
},
"devDependencies": {
"@nx/eslint": "23.1.2",
"@nx/vite": "23.1.2",
"@nx/web": "23.1.2",
"@types/node": "^24",
"@vitest/ui": "^4.1.11",
"nx": "23.1.2",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"vite": "^7.3.6",
"vitest": "^4.1.11"
},
"engines": {
"node": ">=24"
}
}
15 changes: 9 additions & 6 deletions packages/executor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
FROM --platform=amd64 node:22 AS builder
FROM --platform=amd64 node:24 AS builder

Check warning on line 1 in packages/executor/Dockerfile

View workflow job for this annotation

GitHub Actions / Build executor

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/

WORKDIR /app

COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml nx.json ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml nx.json ./
COPY packages/storage/package.json ./packages/storage/
COPY packages/executor/package.json ./packages/executor/
# pnpm checks every workspace project against the lockfile, so the web2
# manifest is needed even though only executor and storage get installed.
COPY packages/web2/package.json ./packages/web2/

RUN yarn install
RUN corepack enable \
&& pnpm install --frozen-lockfile --filter . --filter "extension-a11y-checker-executor..."

COPY packages/storage ./packages/storage
COPY packages/executor ./packages/executor

ENV NX_DAEMON=false
RUN yarn nx run extension-a11y-checker-executor:build
RUN pnpm nx run extension-a11y-checker-executor:build


FROM --platform=amd64 node:22-slim
FROM --platform=amd64 node:24-slim

Check warning on line 22 in packages/executor/Dockerfile

View workflow job for this annotation

GitHub Actions / Build executor

FROM --platform flag should not use a constant value

FromPlatformFlagConstDisallowed: FROM --platform flag should not use constant value "amd64" More info: https://docs.docker.com/go/dockerfile/rule/from-platform-flag-const-disallowed/
WORKDIR /app

RUN apt-get update \
Expand Down
11 changes: 5 additions & 6 deletions packages/executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"private": true,
"type": "module",
"scripts": {
"dev": "nodemon --watch 'src/**/*.ts' --exec 'yarn start'",
"dev": "nodemon --watch 'src/**/*.ts' --exec 'pnpm start'",
"build": "tsc",
"compile": "yarn build",
"start": "yarn build && LOG_LEVEL=debug DEBUG='*,-puppeteer:protocol*' MONGODB_URI=mongodb://localhost:27017/extension-a11y-checker node --no-experimental-require-module dist/index.js",
"compile": "pnpm build",
"start": "pnpm build && LOG_LEVEL=debug DEBUG='*,-puppeteer:protocol*' MONGODB_URI=mongodb://localhost:27017/extension-a11y-checker node --no-experimental-require-module dist/index.js",
"format": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}' --write",
"format:check": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}' --check"
},
Expand All @@ -27,11 +27,10 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/node": "^24",
"@types/node-cron": "^3.0.11",
"eslint": "^9",
"nodemon": "^3.1.9",
"typescript": "^5"
},
"packageManager": "yarn@4.6.0"
}
}
8 changes: 6 additions & 2 deletions packages/executor/src/scan/ScanExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Scan, ScanModel } from "extension-a11y-checker-storage";
import {
DocumentType,
isDocument,
Scan,
ScanModel,
} from "extension-a11y-checker-storage";
import { ScanEngineFactory } from "./engines/ScanEngine.js";
import { DocumentType, isDocument } from "@typegoose/typegoose";
import { logger } from "../logger.js";

const log = logger.child({ module: "ScanExecutor" });
Expand Down
9 changes: 7 additions & 2 deletions packages/executor/src/scan/engines/Pa11yScanEngine.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Issue, Page, Scan } from "extension-a11y-checker-storage";
import {
DocumentType,
isDocument,
Issue,
Page,
Scan,
} from "extension-a11y-checker-storage";
import pa11y, { Pa11yIssue, Pa11yOptions, Pa11yResults } from "pa11y";
import { DocumentType, isDocument } from "@typegoose/typegoose";
import { PageResult, ScanEngine, ScanResults } from "./ScanEngine.js";
import { logger } from "../../logger.js";
import { Lighthouse } from "../Lighthouse.js";
Expand Down
8 changes: 6 additions & 2 deletions packages/executor/src/scan/engines/ScanEngine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { DocumentType } from "@typegoose/typegoose";
import { Issue, Page, Scan } from "extension-a11y-checker-storage";
import {
DocumentType,
Issue,
Page,
Scan,
} from "extension-a11y-checker-storage";
import { Pa11yScanEngine } from "./Pa11yScanEngine.js";

export type PageResult = Pick<
Expand Down
7 changes: 3 additions & 4 deletions packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"dev": "tsc --watch",
"build": "tsc",
"compile": "yarn build",
"compile": "pnpm build",
"format": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}' --write",
"format:check": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}' --check"
},
Expand All @@ -33,9 +33,8 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/node": "^24",
"eslint": "^9",
"typescript": "^5"
},
"packageManager": "yarn@4.6.0"
}
}
4 changes: 4 additions & 0 deletions packages/storage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ export { dbConnect };
export * from "./context/context.model.js";
export * from "./scan/scan.model.js";
export * from "./scanProfile/scanProfile.model.js";

// Re-exported so consumers share storage's typegoose/mongoose instance;
// isDocument() relies on instanceof checks against that instance.
export { isDocument, type DocumentType } from "@typegoose/typegoose";
22 changes: 14 additions & 8 deletions packages/web2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
FROM node:22 AS builder
FROM node:24 AS builder

WORKDIR /app

COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml nx.json ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml nx.json ./
# pnpm checks every workspace project against the lockfile, so the executor
# manifest is needed even though only web2 and storage get installed.
COPY packages/executor/package.json ./packages/executor/

COPY packages/web2 ./packages/web2
COPY packages/storage ./packages/storage

RUN corepack enable && yarn install
RUN corepack enable \
&& pnpm install --frozen-lockfile --filter . --filter "extension-a11y-checker-web2..."

ENV NX_DAEMON=false
# Must be production: a development NODE_ENV makes the React plugin emit the
# jsxDEV runtime, which crashes against react-dom's production server build.
ENV NODE_ENV=production
RUN yarn nx run extension-a11y-checker-web2:build
RUN pnpm nx run extension-a11y-checker-web2:build

FROM node:22-slim
FROM node:24-slim

WORKDIR /app

# The Vite server bundle externalises dependencies, so the installed tree is required at runtime.
# pnpm keeps the packages in the root store and links each project's own
# dependencies into its node_modules, so both are needed.
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json /app/yarn.lock /app/.yarnrc.yml ./
COPY --from=builder /app/package.json /app/pnpm-lock.yaml /app/pnpm-workspace.yaml ./
COPY --from=builder /app/packages/storage ./packages/storage
COPY --from=builder /app/packages/web2/package.json ./packages/web2/package.json
COPY --from=builder /app/packages/web2/node_modules ./packages/web2/node_modules
COPY --from=builder /app/packages/web2/dist ./packages/web2/dist

WORKDIR /app/packages/web2

EXPOSE 3000
CMD ["/app/node_modules/.bin/srvx", "--prod", "-s", "../client", "dist/server/server.js"]
CMD ["/app/packages/web2/node_modules/.bin/srvx", "--prod", "-s", "../client", "dist/server/server.js"]
6 changes: 5 additions & 1 deletion packages/web2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite dev --port 3000",
"build": "vite build",
"start": "srvx --prod -s ../client dist/server/server.js",
"compile": "yarn build",
"compile": "pnpm build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest run",
Expand All @@ -18,6 +18,7 @@
"format:check": "prettier $@ '**/*.{ts,tsx,yaml,yml,json,md,mdx}' --check"
},
"dependencies": {
"@internationalized/date": "^3.12.3",
"@mittwald/api-client": "^4.131.0",
"@mittwald/ext-bridge": "^1.5.67",
"@mittwald/flow-remote-react-components": "^1.5.67",
Expand All @@ -32,11 +33,13 @@
"@weissaufschwarz/mitthooks": "^0.2.1",
"axios": "^1.18.0",
"cheerio": "^1.1.2",
"cron-parser": "^4.9.0",
"cronstrue": "^3.2.0",
"extension-a11y-checker-storage": "workspace:*",
"fast-xml-parser": "^5.10.1",
"hyphen": "^1.14.1",
"luxon": "^3.7.2",
"mongodb": "^6.12.0",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"react": "^19.2.0",
Expand All @@ -50,6 +53,7 @@
"@tanstack/react-table": "^8.21.3",
"@types/hyphen": "^1",
"@types/luxon": "^3.7.6",
"@types/node": "^24",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@vitejs/plugin-react": "^5.2.0",
Expand Down
Loading
Loading