Switch back to npm (#766)

This commit is contained in:
Louis Lam 2025-03-29 16:17:49 +08:00 committed by GitHub
parent 970a826d5a
commit c62b91682e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 10542 additions and 6964 deletions

View File

@ -19,45 +19,26 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout Code - name: Checkout Code
run: | # Mainly for Windows
git config --global core.autocrlf false
git config --global core.eol lf
uses: actions/checkout@v4 uses: actions/checkout@v4
- run: git config --global core.autocrlf false # Mainly for Windows
- uses: actions/checkout@v3
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{matrix.node}} node-version: ${{matrix.node}}
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies - name: Install dependencies
run: pnpm install run: npm install
- name: Lint - name: Lint
run: pnpm run lint run: npm run lint
- name: Check Typescript - name: Check Typescript
run: pnpm run check-ts run: npm run check-ts
- name: Build - name: Build
run: pnpm run build:frontend run: npm run build:frontend
# more things can be add later like tests etc.. # more things can be add later like tests etc..

View File

@ -16,27 +16,5 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Close Incorrect Issue - name: Close Incorrect Issue
run: node extra/close-incorrect-issue.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.issue.number }} ${{ github.event.issue.user.login }} run: node extra/close-incorrect-issue.js ${{ secrets.GITHUB_TOKEN }} ${{ github.event.issue.number }} ${{ github.event.issue.user.login }}

View File

@ -58,8 +58,7 @@ I personally do not like something that requires so many configurations before y
## Tools ## Tools
- [`Node.js`](https://nodejs.org/) >= 20 - [`Node.js`](https://nodejs.org/) >= 22.14.0
- [`pnpm`](https://pnpm.io/)
- [`git`](https://git-scm.com/) - [`git`](https://git-scm.com/)
- IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/)) - IDE that supports [`ESLint`](https://eslint.org/) and EditorConfig (I am using [`IntelliJ IDEA`](https://www.jetbrains.com/idea/))
- A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/)) - A SQLite GUI tool (f.ex. [`SQLite Expert Personal`](https://www.sqliteexpert.com/download.html) or [`DBeaver Community`](https://dbeaver.io/download/))
@ -67,14 +66,14 @@ I personally do not like something that requires so many configurations before y
## Install Dependencies for Development ## Install Dependencies for Development
```bash ```bash
pnpm install npm install
``` ```
## Dev Server ## Dev Server
``` ```
pnpm run dev:frontend npm run dev:frontend
pnpm run dev:backend npm run dev:backend
``` ```
## Backend Dev Server ## Backend Dev Server
@ -94,7 +93,7 @@ You can use Vue.js devtools Chrome extension for debugging.
### Build the frontend ### Build the frontend
```bash ```bash
pnpm run build npm run build
``` ```
## Database Migration ## Database Migration
@ -117,7 +116,7 @@ Both frontend and backend share the same package.json. However, the frontend dep
Should only be done by the maintainer. Should only be done by the maintainer.
```bash ```bash
pnpm update npm update
```` ````
It should update the patch release version only. It should update the patch release version only.

View File

@ -1,6 +1,4 @@
FROM node:22-bookworm-slim FROM node:22-bookworm-slim
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN apt update && apt install --yes --no-install-recommends \ RUN apt update && apt install --yes --no-install-recommends \
curl \ curl \
ca-certificates \ ca-certificates \
@ -19,5 +17,4 @@ RUN apt update && apt install --yes --no-install-recommends \
docker-ce-cli \ docker-ce-cli \
docker-compose-plugin \ docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& npm install pnpm -g \ && npm install -g tsx
&& pnpm install -g tsx

View File

@ -9,8 +9,8 @@ FROM louislam/dockge:build-healthcheck AS build_healthcheck
FROM louislam/dockge:base AS build FROM louislam/dockge:base AS build
WORKDIR /app WORKDIR /app
COPY --chown=node:node ./package.json ./package.json COPY --chown=node:node ./package.json ./package.json
COPY --chown=node:node ./pnpm-lock.yaml ./pnpm-lock.yaml COPY --chown=node:node ./package-lock.json ./package-lock.json
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile RUN npm ci
############################################ ############################################
# ⭐ Main Image # ⭐ Main Image
@ -39,4 +39,4 @@ CMD ["tsx", "./backend/index.ts"]
# Mark as Nightly # Mark as Nightly
############################################ ############################################
FROM release AS nightly FROM release AS nightly
RUN pnpm run mark-as-nightly RUN npm run mark-as-nightly

10520
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,23 +3,23 @@
"version": "1.4.2", "version": "1.4.2",
"type": "module", "type": "module",
"engines": { "engines": {
"node": ">= 18.0.0 && <= 18.17.1" "node": ">= 22.14.0"
}, },
"scripts": { "scripts": {
"fmt": "eslint \"**/*.{ts,vue}\" --fix", "fmt": "eslint \"**/*.{ts,vue}\" --fix",
"lint": "eslint \"**/*.{ts,vue}\"", "lint": "eslint \"**/*.{ts,vue}\"",
"check-ts": "tsc --noEmit", "check-ts": "tsc --noEmit",
"start": "tsx ./backend/index.ts", "start": "tsx ./backend/index.ts",
"dev": "concurrently -k -r \"wait-on tcp:5000 && pnpm run dev:backend \" \"pnpm run dev:frontend\"", "dev": "concurrently -k -r \"wait-on tcp:5000 && npm run dev:backend \" \"npm run dev:frontend\"",
"dev:backend": "cross-env NODE_ENV=development tsx watch --inspect ./backend/index.ts", "dev:backend": "cross-env NODE_ENV=development tsx watch --inspect ./backend/index.ts",
"dev:frontend": "cross-env NODE_ENV=development vite --host --config ./frontend/vite.config.ts", "dev:frontend": "cross-env NODE_ENV=development vite --host --config ./frontend/vite.config.ts",
"release-final": "tsx ./extra/test-docker.ts && tsx extra/update-version.ts && pnpm run build:frontend && npm run build:docker", "release-final": "tsx ./extra/test-docker.ts && tsx extra/update-version.ts && npm run build:frontend && npm run build:docker",
"release-beta": "tsx ./extra/test-docker.ts && tsx extra/update-version.ts && pnpm run build:frontend && npm run build:docker-beta", "release-beta": "tsx ./extra/test-docker.ts && tsx extra/update-version.ts && npm run build:frontend && npm run build:docker-beta",
"build:frontend": "vite build --config ./frontend/vite.config.ts", "build:frontend": "vite build --config ./frontend/vite.config.ts",
"build:docker-base": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:base -f ./docker/Base.Dockerfile . --push", "build:docker-base": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:base -f ./docker/Base.Dockerfile . --push",
"build:docker": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:latest -t louislam/dockge:1 -t louislam/dockge:$VERSION -t louislam/dockge:beta -t louislam/dockge:nightly --target release -f ./docker/Dockerfile . --push", "build:docker": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:latest -t louislam/dockge:1 -t louislam/dockge:$VERSION -t louislam/dockge:beta -t louislam/dockge:nightly --target release -f ./docker/Dockerfile . --push",
"build:docker-beta": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:beta -t louislam/dockge:$VERSION --target release -f ./docker/Dockerfile . --push", "build:docker-beta": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:beta -t louislam/dockge:$VERSION --target release -f ./docker/Dockerfile . --push",
"build:docker-nightly": "pnpm run build:frontend && docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:nightly --target nightly -f ./docker/Dockerfile . --push", "build:docker-nightly": "npm run build:frontend && docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:nightly --target nightly -f ./docker/Dockerfile . --push",
"build:healthcheck": "docker buildx build -f docker/BuildHealthCheck.Dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:build-healthcheck . --push", "build:healthcheck": "docker buildx build -f docker/BuildHealthCheck.Dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:build-healthcheck . --push",
"start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest", "start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest",
"mark-as-nightly": "tsx ./extra/mark-as-nightly.ts", "mark-as-nightly": "tsx ./extra/mark-as-nightly.ts",

6897
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff