chore(frontend): switch from pnpm to npm

This commit is contained in:
sam 2025-04-17 15:03:38 +02:00
parent 1adb26e8b8
commit a89a5b3494
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
8 changed files with 6369 additions and 4249 deletions

View file

@ -3,12 +3,8 @@
"tasks": [
{
"name": "run-prettier",
"command": "pnpm",
"args": [
"prettier",
"-w",
"${staged}"
],
"command": "npx",
"args": ["prettier", "-w", "${staged}"],
"include": [
"Foxnouns.Frontend/**/*.ts",
"Foxnouns.Frontend/**/*.json",
@ -22,13 +18,8 @@
{
"name": "run-csharpier",
"command": "dotnet",
"args": [
"csharpier",
"${staged}"
],
"include": [
"**/*.cs"
]
"args": ["csharpier", "${staged}"],
"include": ["**/*.cs"]
}
]
}

View file

@ -1,9 +1,5 @@
FROM docker.io/node:23-slim
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY ./Foxnouns.Frontend /app
COPY ./docker/frontend.env /app/.env.local
WORKDIR /app
@ -11,7 +7,7 @@ WORKDIR /app
ENV PRIVATE_API_HOST=http://rate:5003/api
ENV PRIVATE_INTERNAL_API_HOST=http://backend:5000/api
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN npm ci
RUN npm run build
CMD ["pnpm", "node", "build/index.js"]
CMD ["node", "build/index.js"]

View file

@ -1,6 +1,6 @@
// This script regenerates the list of icons for the frontend (Foxnouns.Frontend/src/lib/icons.ts)
// and the backend (Foxnouns.Backend/Utils/BootstrapIcons.Icons.cs) from the currently installed version of Bootstrap Icons.
// Run with `pnpm node icons.js` in the frontend directory.
// Run with `node icons.js` in the frontend directory.
import { writeFileSync } from "fs";
import icons from "bootstrap-icons/font/bootstrap-icons.json" with { type: "json" };

6354
Foxnouns.Frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -38,7 +38,6 @@
"typescript-eslint": "^8.29.0",
"vite": "^6.2.5"
},
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
"dependencies": {
"@fontsource/firago": "^5.2.5",
"@sentry/sveltekit": "^9.11.0",

File diff suppressed because it is too large Load diff

View file

@ -25,12 +25,12 @@ echo "Building Node.js frontend"
cd "$ROOT_DIR/Foxnouns.Frontend"
[ -d "$ROOT_DIR/Foxnouns.Frontend/build" ] && rm -r "$ROOT_DIR/Foxnouns.Frontend/build"
pnpm install
pnpm build
npm ci
npm run build
mkdir "$ROOT_DIR/build/fe"
cp -r build .env* package.json pnpm-lock.yaml "$ROOT_DIR/build/fe"
cp -r build .env* package.json package-lock.json "$ROOT_DIR/build/fe"
cd "$ROOT_DIR/build/fe"
pnpm install -P
NODE_ENV=production npm ci
echo "Finished building Foxnouns.NET"

View file

@ -4,8 +4,7 @@
},
"scripts": {
"watch:be": "dotnet watch --no-hot-reload --project Foxnouns.Backend -- --migrate-and-start",
"dev": "concurrently -n .net,node,rate -c magenta,yellow,blue -i 'pnpm watch:be' 'cd Foxnouns.Frontend && pnpm dev' 'cd rate && go run -v .'",
"format": "dotnet csharpier . && cd Foxnouns.Frontend && pnpm format"
},
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
"dev": "concurrently -n .net,node,rate -c magenta,yellow,blue -i 'npm run watch:be' 'cd Foxnouns.Frontend && npm run dev' 'cd rate && go run -v .'",
"format": "dotnet csharpier . && cd Foxnouns.Frontend && npm run format"
}
}