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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
- name: Download Shai-Hulud IOC list
run: |
curl -o iocs.csv https://raw.githubusercontent.com/DataDog/indicators-of-compromise/refs/heads/main/shai-hulud-2.0/consolidated_iocs.csv
Expand All @@ -40,15 +40,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: corepack enable && pnpm install --frozen-lockfile
- name: Build back
run: cd api && yarn build
run: cd api && pnpm build
- name: Migrate db
run: cd api && yarn migrate latest
run: cd api && pnpm migrate latest
- name: Fullcheck
run: yarn fullcheck
run: pnpm fullcheck

e2e:
name: E2E tests
Expand All @@ -58,13 +58,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
node-version: "24"
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: corepack enable && pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: cd e2e && npx playwright install --with-deps chromium
- name: Run e2e tests
run: cd e2e && yarn test:e2e
run: cd e2e && pnpm test:e2e

check_if_version_upgraded:
name: Check if version upgrade
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
24
14 changes: 7 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"type": "node",
"request": "launch",
"name": "yarn dev",
"runtimeExecutable": "yarn",
"name": "pnpm dev",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"dev"
Expand All @@ -18,7 +18,7 @@
"type": "node",
"request": "launch",
"name": "Import Data",
"runtimeExecutable": "yarn",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}/api",
"runtimeArgs": [
"run",
Expand All @@ -29,7 +29,7 @@
"type": "node",
"request": "launch",
"name": "Update Data",
"runtimeExecutable": "yarn",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}/api",
"runtimeArgs": [
"run",
Expand All @@ -40,7 +40,7 @@
"type": "node",
"request": "launch",
"name": "Fullcheck",
"runtimeExecutable": "yarn",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"fullcheck"
Expand All @@ -50,7 +50,7 @@
"type": "node",
"request": "launch",
"name": "Import From Inner Identifers",
"runtimeExecutable": "yarn",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}/api",
"runtimeArgs": [
"run",
Expand All @@ -61,7 +61,7 @@
"type": "node",
"request": "launch",
"name": "Fullcheck",
"runtimeExecutable": "yarn",
"runtimeExecutable": "pnpm",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"run",
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
# SPDX-FileCopyrightText: 2024-2025 Université Grenoble Alpes
# SPDX-License-Identifier: MIT

FROM node:22-alpine as build
FROM node:24-alpine as build
RUN apk add --no-cache \
git \
openssh-client \
ca-certificates
RUN corepack enable && corepack prepare pnpm@10.32.1 --activate

WORKDIR /app
COPY package.json yarn.lock ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY api/package.json api/
COPY api/update-then-wait.sh api/

RUN yarn install --frozen-lockfile --ignore-scripts
RUN pnpm install --frozen-lockfile --ignore-scripts

COPY turbo.json ./
COPY api/ api/

WORKDIR /app/api
RUN chmod +x /app/api/update-then-wait.sh
RUN yarn build
RUN pnpm build

CMD ["yarn", "start"]
CMD ["pnpm", "start"]
11 changes: 6 additions & 5 deletions Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
# SPDX-License-Identifier: MIT

# build step
FROM node:22-alpine as build
FROM node:24-alpine as build
RUN corepack enable && corepack prepare pnpm@10.32.1 --activate
WORKDIR /app
COPY package.json yarn.lock ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY api/package.json api/
COPY web/package.json web/
COPY web/public/ web/public/
COPY web/index.html web/

RUN yarn install --frozen-lockfile --ignore-scripts
RUN cd web && yarn postinstall
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN cd web && pnpm postinstall

COPY turbo.json ./
COPY api/ api/
COPY web/src/ web/src/
COPY web/vite.config.ts web/tsconfig.json web/.env.declaration web/

WORKDIR /app
RUN yarn build
RUN pnpm build

WORKDIR /app
COPY web/nginx.conf web/
Expand Down
20 changes: 11 additions & 9 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
"type": "git",
"url": "git://github.com/codegouvfr/sill.git"
},
"main": "dist/src/lib/index.js",
"types": "dist/src/lib/index.d.ts",
"main": "./src/lib/index.ts",
"types": "./src/lib/index.ts",
"scripts": {
"test": "vitest --watch=false --no-file-parallelism",
"dev": "yarn build && yarn start",
"dev": "dotenv -e ../.env -- tsx watch src/entrypoints/start-api.ts",
"generate-translation-schema": "node scripts/generate-translation-schema.js",
"build": "tsc && cp -r src/customization dist/src/",
"start": "yarn db:up --no-outdated-check && dotenv -e ../.env -- node dist/src/entrypoints/start-api.js",
"start": "pnpm db:up --no-outdated-check && dotenv -e ../.env -- node dist/src/entrypoints/start-api.js",
"job:import": "dotenv -e ../.env -- node dist/src/entrypoints/import.js",
"job:import-from-inner-identifiers": "dotenv -e ../.env -- node dist/src/entrypoints/import-from-inner-identifiers.js",
"job:update": "dotenv -e ../.env -- node dist/src/entrypoints/update.js",
"update-then-wait": "./update-then-wait.sh",
"_format": "prettier \"**/*.{ts,tsx,json,md}\"",
"format": "yarn run _format --write",
"format:check": "yarn run _format --list-different",
"format": "pnpm run _format --write",
"format:check": "pnpm run _format --list-different",
"link-in-web": "ts-node --skipProject scripts/link-in-app.ts sill-web",
"db:seed": "yarn build && dotenv -e ../.env -- node dist/scripts/seed.js",
"db:seed": "dotenv -e ../.env -- tsx scripts/seed.ts",
"typecheck": "tsc --noEmit",
"migrate": "dotenv -e ../.env -- kysely migrate",
"db:up": "yarn migrate latest",
"db:up": "pnpm migrate latest",
"dev:db:up": "docker compose -f ../docker-compose.resources.yml up -d",
"dev:db:down": "docker compose -f ../docker-compose.resources.yml down",
"dev:db:flush": "rm -rf ../docker-data",
"dev:db:reset": "yarn dev:db:down && yarn dev:db:flush && yarn dev:db:up",
"dev:db:reset": "pnpm dev:db:down && pnpm dev:db:flush && pnpm dev:db:up",
"dev:dbs:mig:up": "dotenv -e ../.env -- kysely migrate up",
"dev:dbs:mig:down": "dotenv -e ../.env -- kysely migrate down",
"knip": "knip"
Expand All @@ -44,6 +44,7 @@
"keywords": [],
"homepage": "https://github.com/codegouvfr/sill",
"devDependencies": {
"@octokit/types": "^16.0.0",
"@types/compression": "^1.7.2",
"@types/cookie-parser": "^1.4.9",
"@types/cors": "^2.8.12",
Expand All @@ -67,6 +68,7 @@
"run-exclusive": "^2.2.19",
"superjson": "^1.12.2",
"ts-node": "^10.9.1",
"tsx": "^4.19.0",
"typescript": "^5.7.3",
"vitest": "^1.2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion api/src/core/adapters/GitLab/getExternalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const getGitLabSoftwareExternalData: GetSoftwareExternal = memoize(
image: project.avatar_url ?? undefined,
url: undefined,
codeRepositoryUrl: project.web_url,
softwareHelp: project.readme_url,
softwareHelp: project.readme_url ?? undefined,
license: project.license?.name,
latestVersion: lastRelease?.tag_name
? { version: lastRelease.tag_name, releaseDate: publicationIso }
Expand Down
2 changes: 1 addition & 1 deletion api/src/core/adapters/GitLab/getSoftwareFormData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getGitLabSoftwareForm: GetSoftwareFormData = memoize(

const formData: SoftwareFormData = {
name: project.name,
description: project?.description,
description: project?.description ?? "",
...resolveOsAndPlatforms(project.topics ?? []), // Someting else to rely on ?
externalIdForSource: project.web_url,
sourceSlug: source.slug,
Expand Down
2 changes: 1 addition & 1 deletion api/src/core/adapters/GitLab/getSoftwareOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const gitLabSoftwareToExternalOption =
return {
externalId: gitLabItem.id.toString(),
name: gitLabItem.name,
description: gitLabItem.description,
description: gitLabItem.description ?? "",
isLibreSoftware: false,
sourceSlug: source.slug
};
Expand Down
4 changes: 2 additions & 2 deletions api/update-then-wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ START_DATETIME=$(date "+%Y-%m-%d %H:%M:%S")

echo "Starting update at ${START_DATETIME}"
# Run the update command
yarn job:import-from-inner-identifiers
yarn job:update
pnpm job:import-from-inner-identifiers
pnpm job:update

END_DATETIME=$(date "+%Y-%m-%d %H:%M:%S")

Expand Down
4 changes: 2 additions & 2 deletions deployment-examples/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- postgres
env_file: .env
restart: unless-stopped
command: yarn start
command: pnpm start
volumes:
- ./customization:/app/api/dist/src/customization

Expand All @@ -34,7 +34,7 @@ services:
env_file: .env
restart: always
# runs every 4 hours (240 minutes)
command: yarn update-then-wait 240
command: pnpm update-then-wait 240

# this is nginx managing the proxy (sending /api requests to the api container, the rest to the web container)
nginx:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.preprod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
dockerfile: Dockerfile.api
env_file: .env
restart: unless-stopped
command: yarn start
command: pnpm start

update:
depends_on:
Expand All @@ -23,7 +23,7 @@ services:
env_file: .env
restart: always
# runs every 4 hours (240 minutes)
command: yarn update-then-wait 240
command: pnpm update-then-wait 240

web:
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
dockerfile: Dockerfile.api
env_file: .env
restart: unless-stopped
command: yarn start
command: pnpm start

update:
depends_on:
Expand All @@ -23,7 +23,7 @@ services:
env_file: .env
restart: always
# runs every 4 hours (240 minutes)
command: yarn update-then-wait 240
command: pnpm update-then-wait 240

web:
depends_on:
Expand Down
8 changes: 4 additions & 4 deletions docs/2-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
To run the application in local, you need :

- docker and docker-compose, do setup the database, and local keycloak server.
- nodejs 22 and yarn to run the web application (front and back)
- nodejs 22 and pnpm to run the web application (front and back)

1. Clone the repository

Expand All @@ -22,7 +22,7 @@ git clone git@github.com:codegouvfr/catalogi.git

```bash
cd catalogi
yarn install
pnpm install
```

3. Create a `.env` file and set the environment variables as needed. You can copy the `.env.sample` file to start with a template.
Expand All @@ -42,13 +42,13 @@ docker compose -f docker-compose.resources.yml up --build -d
5. load the database with some data by running seed

```bash
cd api && yarn db:seed
cd api && pnpm db:seed
```

6. start the frontend and backend in dev

```bash
yarn dev # from the root, this will run both the frontend and backend `yarn dev`
pnpm dev # from the root, this will run both the frontend and backend `pnpm dev`
```

The docker-compose.resources.yml will start:
Expand Down
4 changes: 2 additions & 2 deletions e2e/scripts/start-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const main = async () => {

console.log("Starting containers and building API in parallel...");

const apiBuildPromise = execCommand("yarn", ["build"], { cwd: API_DIR });
const apiBuildPromise = execCommand("pnpm", ["build"], { cwd: API_DIR });

const pgPromise = new PostgreSqlContainer("postgres:16-alpine").start();

Expand Down Expand Up @@ -202,7 +202,7 @@ const main = async () => {

try {
console.log("Running migrations...");
await execCommand("yarn", ["migrate", "latest"], { cwd: API_DIR, env: apiEnv });
await execCommand("pnpm", ["migrate", "latest"], { cwd: API_DIR, env: apiEnv });

console.log("Seeding database...");
await execCommand("node", ["dist/scripts/seed.js"], { cwd: API_DIR, env: apiEnv });
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/catalogi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: catalogi
description: A Helm chart for deploying the Catalogi open source software catalog.
type: application
version: 2.0.34
version: 2.0.39
appVersion: 1.54.4
dependencies:
- name: postgresql
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/catalogi/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
{{- toYaml .Values.api.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ include "catalogi.imageTag" (dict "image" .Values.api.image "root" .) }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
command: ["yarn", "start"]
command: ["pnpm", "start"]
ports:
- name: http
containerPort: 3000
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/catalogi/templates/update-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
{{- toYaml .Values.update.securityContext | nindent 16 }}
image: "{{ .Values.update.image.repository }}:{{ include "catalogi.imageTag" (dict "image" .Values.update.image "root" .) }}"
imagePullPolicy: {{ .Values.update.image.pullPolicy }}
command: ["yarn", "update"]
command: ["pnpm", "update"]
resources:
{{- toYaml .Values.update.resources | nindent 16 }}
env:
Expand Down
Loading
Loading