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
8 changes: 6 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ jobs:
with:
persist-credentials: false
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
Comment on lines +17 to +20
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Check the workflow file
cat -n .github/workflows/code-quality.yml

Repository: rocket-admin/rocketadmin

Length of output: 1671


🏁 Script executed:

# Check package.json for packageManager specification
cat -n package.json | head -20

Repository: rocket-admin/rocketadmin

Length of output: 583


🏁 Script executed:

# Verify pnpm/action-setup behavior by checking documentation/usage
git log --oneline -20 -- .github/workflows/code-quality.yml

Repository: rocket-admin/rocketadmin

Length of output: 173


Remove the conflicting pnpm version specification.

The workflow specifies version: 10 while package.json declares packageManager: pnpm@10.33.0. This mismatch will cause the setup action to install a potentially different 10.x version, triggering a version conflict error. Remove the explicit version constraint to let pnpm/action-setup@v4 read and use the exact version from packageManager.

Proposed fix
      - name: Setup pnpm
        uses: pnpm/action-setup@v4
-       with:
-         version: 10
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup pnpm
uses: pnpm/action-setup@v4
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/code-quality.yml around lines 17 - 20, The workflow
currently pins pnpm via the 'version: 10' input to the pnpm/action-setup@v4 step
which conflicts with the exact pnpm version declared in package.json's
packageManager; remove the explicit 'version: 10' input from the
pnpm/action-setup@v4 step so the action will read and install the exact pnpm
version from packageManager (pnpm@10.33.0) instead.

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: "yarn"
cache: "pnpm"
- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
Comment on lines +17 to +27
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
Expand Down
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,5 @@ testem.log
.DS_Store
Thumbs.db

# Yarn Integrity file
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# PGLite storage
pglite-storage
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.4.1.cjs

This file was deleted.

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

This file was deleted.

22 changes: 11 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ RocketAdmin is a database administration panel that allows users to manage datab

```bash
cd backend
yarn start:dev # Start dev server with hot reload
yarn build # Build for production
yarn lint # ESLint with auto-fix
yarn test # Run non-saas AVA tests (serial)
yarn test-all # Run all AVA tests (5min timeout, serial)
yarn test-saas # Run SaaS-specific tests
pnpm start:dev # Start dev server with hot reload
pnpm build # Build for production
pnpm lint # ESLint with auto-fix
pnpm test # Run non-saas AVA tests (serial)
pnpm test-all # Run all AVA tests (5min timeout, serial)
pnpm test-saas # Run SaaS-specific tests
Comment on lines +21 to +26
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the backend command docs to match backend/package.json.

pnpm lint is documented here, but the backend package scripts shown in this PR do not define lint. Also, test-all is documented as serial, while the script is ava --timeout=5m without --serial.

Proposed doc fix
 pnpm start:dev          # Start dev server with hot reload
 pnpm build              # Build for production
-pnpm lint               # ESLint with auto-fix
 pnpm test               # Run non-saas AVA tests (serial)
-pnpm test-all           # Run all AVA tests (5min timeout, serial)
+pnpm test-all           # Run all AVA tests (5min timeout)
 pnpm test-saas          # Run SaaS-specific tests
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pnpm start:dev # Start dev server with hot reload
pnpm build # Build for production
pnpm lint # ESLint with auto-fix
pnpm test # Run non-saas AVA tests (serial)
pnpm test-all # Run all AVA tests (5min timeout, serial)
pnpm test-saas # Run SaaS-specific tests
pnpm start:dev # Start dev server with hot reload
pnpm build # Build for production
pnpm test # Run non-saas AVA tests (serial)
pnpm test-all # Run all AVA tests (5min timeout)
pnpm test-saas # Run SaaS-specific tests
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 21 - 26, The docs list a `pnpm lint` script and mark
`pnpm test-all` as serial, but the backend/package.json in this PR doesn't
define `lint` and `test-all` uses `ava --timeout=5m` (no --serial); update
CLAUDE.md to mirror package.json exactly: remove or replace the `pnpm lint` line
with the actual lint script name if one exists in backend/package.json (e.g.,
`pnpm lint:fix`) and change the `pnpm test-all` description from "serial" to
"Run all AVA tests (5min timeout)" (or the exact wording used elsewhere),
ensuring the entries for the commands shown (pnpm start:dev, pnpm build, pnpm
test, pnpm test-all, pnpm test-saas) match the script names and flags in
backend/package.json.

```

### Frontend
Expand Down Expand Up @@ -52,17 +52,17 @@ This spins up test databases (MySQL, PostgreSQL, MSSQL, Oracle, IBM DB2, MongoDB

```bash
cd backend
yarn build # Must build first
yarn migration:generate src/migrations/MigrationName # Generate migration
yarn migration:run # Run pending migrations
yarn migration:revert # Revert last migration
pnpm build # Must build first
pnpm migration:generate src/migrations/MigrationName # Generate migration
pnpm migration:run # Run pending migrations
pnpm migration:revert # Revert last migration
```

## Architecture

### Monorepo Structure

- Uses Yarn workspaces with packages: `backend`, `rocketadmin-agent`, `shared-code`
- Uses pnpm workspaces with packages: `backend`, `rocketadmin-agent`, `shared-code`
- `shared-code` is imported as `@rocketadmin/shared-code` workspace dependency
- Frontend is a separate Angular project (not a workspace member)

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY package.json .yarnrc.yml yarn.lock /app/
RUN npm install -g pnpm@10.33.0
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc /app/
COPY backend /app/backend
COPY shared-code /app/shared-code
COPY rocketadmin-agent /app/rocketadmin-agent
COPY .yarn /app/.yarn
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --immutable --silent
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
RUN cd shared-code && ../node_modules/.bin/tsc
RUN cd backend && ../node_modules/.bin/tsc && yarn run nest build
RUN cd backend && ../node_modules/.bin/tsc && pnpm exec nest build
COPY --from=front_builder /app/frontend/dist/rocketadmin/browser /var/www/html
COPY frontend/nginx/default.conf /etc/nginx/sites-enabled/default
RUN mkdir -p /app/backend/node_modules/.cache && chown -R appuser:appuser /app/backend/node_modules/.cache
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.rocketadmin-agent
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ RUN groupadd -r -g 1001 appuser && useradd -r -u 1001 -g appuser -d /app -s /sbi
WORKDIR /app
RUN apt-get update && apt-get install -y netcat-openbsd make gcc g++ python3 libxml2

COPY package.json .yarnrc.yml yarn.lock /app/
RUN npm install -g pnpm@10.33.0
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc /app/
COPY shared-code /app/shared-code
COPY rocketadmin-agent /app/rocketadmin-agent
COPY .yarn /app/.yarn
RUN yarn install --network-timeout 1000000
RUN pnpm install --frozen-lockfile
RUN cd shared-code && ../node_modules/.bin/tsc
RUN cd rocketadmin-agent && yarn run build
RUN cd rocketadmin-agent && pnpm run build
Comment on lines +12 to +14
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, find the Dockerfile and workspace configuration
find . -name "Dockerfile*" -o -name "pnpm-workspace.yaml" -o -name "package.json" | head -30

Repository: rocket-admin/rocketadmin

Length of output: 418


🏁 Script executed:

# Check for workspace configuration in root package.json and pnpm-workspace.yaml
if [ -f pnpm-workspace.yaml ]; then cat pnpm-workspace.yaml; fi
if [ -f package.json ]; then jq '.workspaces // empty' package.json; fi

Repository: rocket-admin/rocketadmin

Length of output: 127


🏁 Script executed:

# Locate and examine the Dockerfile.rocketadmin-agent
find . -name "Dockerfile.rocketadmin-agent" -exec cat {} \;

Repository: rocket-admin/rocketadmin

Length of output: 694


🏁 Script executed:

# Check if shared-code exists and its package.json
find . -path "*/shared-code/package.json" -exec cat {} \;

Repository: rocket-admin/rocketadmin

Length of output: 1095


🏁 Script executed:

# Look for TypeScript dependencies in shared-code
find . -path "*/shared-code/*" -type f -name "package.json" -o -path "*/rocketadmin-agent/*" -type f -name "package.json"

Repository: rocket-admin/rocketadmin

Length of output: 127


🏁 Script executed:

# Check if shared-code has a build or tsc script in its package.json
cd shared-code && cat package.json | jq '.scripts // empty'

Repository: rocket-admin/rocketadmin

Length of output: 50


🏁 Script executed:

# Check rocketadmin-agent's package.json to see what its build script does
cd rocketadmin-agent && cat package.json | jq '.scripts // empty'

Repository: rocket-admin/rocketadmin

Length of output: 323


🏁 Script executed:

# Check if root package.json has typescript or any references
cat package.json | jq '.dependencies // empty, .devDependencies // empty, .workspaces // empty'

Repository: rocket-admin/rocketadmin

Length of output: 181


🏁 Script executed:

# Look for tsconfig.json files to understand the build setup
find . -name "tsconfig.json" -type f | xargs ls -la

Repository: rocket-admin/rocketadmin

Length of output: 538


🏁 Script executed:

# Check rocketadmin-agent's tsconfig and tsconfig.build.json
cat rocketadmin-agent/tsconfig.json && echo "---" && cat rocketadmin-agent/tsconfig.build.json 2>/dev/null || echo "tsconfig.build.json not found, checking alternative"

Repository: rocket-admin/rocketadmin

Length of output: 687


🏁 Script executed:

# Check shared-code's tsconfig.json
cat shared-code/tsconfig.json

Repository: rocket-admin/rocketadmin

Length of output: 590


🏁 Script executed:

# Check if there are any references from rocketadmin-agent to shared-code in imports
grep -r "from.*shared-code\|import.*shared-code" rocketadmin-agent/src --include="*.ts" --include="*.tsx" 2>/dev/null | head -5

Repository: rocket-admin/rocketadmin

Length of output: 929


🏁 Script executed:

# Verify pnpm -C syntax is valid by checking pnpm documentation or usage patterns
# Check if there are other pnpm -C usages in the repo
grep -r "pnpm -C" . --include="*.sh" --include="Dockerfile*" --include="*.md" 2>/dev/null

Repository: rocket-admin/rocketadmin

Length of output: 50


Use pnpm workspace execution for the shared-code TypeScript build.

The current approach using ../node_modules/.bin/tsc from inside shared-code is brittle and doesn't properly leverage pnpm's workspace-aware dependency resolution. Since rocketadmin-agent declares TypeScript project references to shared-code, the build order and context matter. Use pnpm -C to execute commands in the correct workspace package context.

Proposed Dockerfile fix
 RUN pnpm install --frozen-lockfile
-RUN cd shared-code && ../node_modules/.bin/tsc
-RUN cd rocketadmin-agent && pnpm run build
+RUN pnpm -C shared-code exec tsc
+RUN pnpm -C rocketadmin-agent run build
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.rocketadmin-agent` around lines 12 - 14, The Dockerfile currently
runs the TypeScript compile in shared-code via a brittle relative path to
../node_modules/.bin/tsc; replace that with pnpm's workspace-aware execution so
the build runs in the correct package context. Update the build steps to use
pnpm -C shared-code (or pnpm -C rocketadmin-agent if running its workspace-aware
build) to run tsc in the shared-code package and then run pnpm -C
rocketadmin-agent run build; keep the initial pnpm install --frozen-lockfile but
switch the manual ../node_modules/.bin/tsc invocation to pnpm -C shared-code tsc
to ensure proper workspace dependency resolution and build order.


RUN chown -R appuser:appuser /app

Expand Down
9 changes: 0 additions & 9 deletions autoadmin-ws-server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@ dist/
.env
*.log
.DS_Store

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
14 changes: 9 additions & 5 deletions autoadmin-ws-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ FROM node:24-alpine AS builder

WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install
RUN npm install -g pnpm@10.33.0

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
Comment on lines +7 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate and examine the Dockerfile mentioned
find . -name "Dockerfile" -path "*autoadmin-ws-server*" | head -5

Repository: rocket-admin/rocketadmin

Length of output: 100


🏁 Script executed:

# Check if .npmrc exists in the repo root
ls -la | grep -E "\.npmrc|package\.json|pnpm-lock"

Repository: rocket-admin/rocketadmin

Length of output: 258


🏁 Script executed:

# Check other Dockerfiles in the repo to see if they copy .npmrc
find . -name "Dockerfile" -type f | xargs grep -l "\.npmrc" 2>/dev/null | head -10

Repository: rocket-admin/rocketadmin

Length of output: 111


🏁 Script executed:

# Read the autoadmin-ws-server/Dockerfile
cat -n ./autoadmin-ws-server/Dockerfile

Repository: rocket-admin/rocketadmin

Length of output: 852


🏁 Script executed:

# Read .npmrc content
cat .npmrc

Repository: rocket-admin/rocketadmin

Length of output: 87


🏁 Script executed:

# Read the other Dockerfiles to compare
cat -n ./Dockerfile

Repository: rocket-admin/rocketadmin

Length of output: 2652


🏁 Script executed:

# Also check rocketadmin-agent/Dockerfile
cat -n ./rocketadmin-agent/Dockerfile

Repository: rocket-admin/rocketadmin

Length of output: 1970


Copy .npmrc before both pnpm installs.

This Dockerfile does not copy .npmrc while the other migrated Dockerfiles (./Dockerfile and ./rocketadmin-agent/Dockerfile) do. The repo .npmrc specifies node-linker=hoisted, which affects how pnpm resolves dependencies. Without it, Docker builds will use a different node_modules layout than local/CI builds, breaking packages that rely on hoisting.

Proposed fix
-COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
+COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
 RUN pnpm install --frozen-lockfile

Also apply at line 24:

-COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
+COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
 RUN pnpm install --prod --frozen-lockfile
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
RUN pnpm install --frozen-lockfile
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@autoadmin-ws-server/Dockerfile` around lines 7 - 8, Add a COPY for .npmrc
before the pnpm installs so the pnpm node-linker setting is applied during
Docker builds: update the COPY line that currently copies package.json,
pnpm-lock.yaml, pnpm-workspace.yaml to also include .npmrc (the COPY
package.json pnpm-lock.yaml pnpm-workspace.yaml ./ entry) and ensure .npmrc is
copied again before the second install step referenced around the later RUN pnpm
install --frozen-lockfile (apply the same change near the later install at the
location noted around line 24) so both pnpm install steps use the repo .npmrc.


COPY tsconfig.json ./
COPY src ./src

RUN yarn build
RUN pnpm build

FROM node:24-alpine

Expand All @@ -17,8 +19,10 @@ WORKDIR /app
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001

COPY package.json yarn.lock ./
RUN yarn install --production && yarn cache clean
RUN npm install -g pnpm@10.33.0

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --prod --frozen-lockfile

COPY --from=builder /app/dist ./dist

Expand Down
6 changes: 6 additions & 0 deletions autoadmin-ws-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"license": "UNLICENSED",
"packageManager": "pnpm@10.33.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all pnpm version declarations that can conflict with packageManager.
# Expected: either packageManager pins pnpm, or workflow setup pins pnpm, but not conflicting values.
rg -n -C2 'packageManager"\s*:\s*"pnpm@|pnpm/action-setup|version:\s*"?10' .

Repository: rocket-admin/rocketadmin

Length of output: 9472


🏁 Script executed:

# Find GitHub Actions workflow files
find .github/workflows -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -20

Repository: rocket-admin/rocketadmin

Length of output: 401


🏁 Script executed:

# Search specifically for pnpm version specifications in workflow files
rg -n 'pnpm.*version|version.*pnpm' .github/workflows/ 2>/dev/null || echo "No matches found or directory doesn't exist"

Repository: rocket-admin/rocketadmin

Length of output: 111


🏁 Script executed:

# Check code-quality.yml for pnpm configuration
cat .github/workflows/code-quality.yml | head -100

Repository: rocket-admin/rocketadmin

Length of output: 1363


🏁 Script executed:

# Check ws-server.yml for pnpm configuration
cat .github/workflows/ws-server.yml | head -100

Repository: rocket-admin/rocketadmin

Length of output: 3635


Unify the pnpm version source by removing the workflow version specification.

The code-quality workflow explicitly pins pnpm 10, while the package.json specifies pnpm@10.33.0. Remove the version: 10 from the pnpm/action-setup step in code-quality.yml to let the packageManager field be the single source of truth. Modern versions of pnpm/action-setup automatically respect the packageManager declaration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@autoadmin-ws-server/package.json` at line 6, The workflow pins pnpm via a
hardcoded "version: 10" in the pnpm/action-setup step while package.json already
declares "packageManager": "pnpm@10.33.0"; remove the "version: 10" key from the
pnpm/action-setup step in the code-quality workflow so the action will derive
the pnpm version from the packageManager field instead, leaving the step
otherwise unchanged.

"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
Expand All @@ -27,5 +28,10 @@
"@types/ws": "^8.18.1",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
}
}
Loading
Loading