-
-
Notifications
You must be signed in to change notification settings - Fork 18
chore: add pnpm workspace configuration for backend, rocketadmin-agent, and shared-code packages #1720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add pnpm workspace configuration for backend, rocketadmin-agent, and shared-code packages #1720
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node-linker=hoisted |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the backend command docs to match
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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ### Frontend | ||||||||||||||||||||||||
|
|
@@ -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) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, find the Dockerfile and workspace configuration
find . -name "Dockerfile*" -o -name "pnpm-workspace.yaml" -o -name "package.json" | head -30Repository: 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; fiRepository: 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 -laRepository: 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.jsonRepository: 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 -5Repository: 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/nullRepository: rocket-admin/rocketadmin Length of output: 50 Use pnpm workspace execution for the shared-code TypeScript build. The current approach using 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 |
||
|
|
||
| RUN chown -R appuser:appuser /app | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the Dockerfile mentioned
find . -name "Dockerfile" -path "*autoadmin-ws-server*" | head -5Repository: 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 -10Repository: rocket-admin/rocketadmin Length of output: 111 🏁 Script executed: # Read the autoadmin-ws-server/Dockerfile
cat -n ./autoadmin-ws-server/DockerfileRepository: rocket-admin/rocketadmin Length of output: 852 🏁 Script executed: # Read .npmrc content
cat .npmrcRepository: rocket-admin/rocketadmin Length of output: 87 🏁 Script executed: # Read the other Dockerfiles to compare
cat -n ./DockerfileRepository: rocket-admin/rocketadmin Length of output: 2652 🏁 Script executed: # Also check rocketadmin-agent/Dockerfile
cat -n ./rocketadmin-agent/DockerfileRepository: rocket-admin/rocketadmin Length of output: 1970 Copy This Dockerfile does not copy 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-lockfileAlso 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| COPY tsconfig.json ./ | ||||||||||
| COPY src ./src | ||||||||||
|
|
||||||||||
| RUN yarn build | ||||||||||
| RUN pnpm build | ||||||||||
|
|
||||||||||
| FROM node:24-alpine | ||||||||||
|
|
||||||||||
|
|
@@ -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 | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "version": "1.0.0", | ||
| "type": "module", | ||
| "license": "UNLICENSED", | ||
| "packageManager": "pnpm@10.33.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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 -20Repository: 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 -100Repository: rocket-admin/rocketadmin Length of output: 1363 🏁 Script executed: # Check ws-server.yml for pnpm configuration
cat .github/workflows/ws-server.yml | head -100Repository: 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 🤖 Prompt for AI Agents |
||
| "scripts": { | ||
| "dev": "tsx watch src/index.ts", | ||
| "build": "tsc", | ||
|
|
@@ -27,5 +28,10 @@ | |
| "@types/ws": "^8.18.1", | ||
| "tsx": "^4.21.0", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "pnpm": { | ||
| "onlyBuiltDependencies": [ | ||
| "esbuild" | ||
| ] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Check the workflow file cat -n .github/workflows/code-quality.ymlRepository: rocket-admin/rocketadmin
Length of output: 1671
🏁 Script executed:
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.ymlRepository: rocket-admin/rocketadmin
Length of output: 173
Remove the conflicting pnpm version specification.
The workflow specifies
version: 10whilepackage.jsondeclarespackageManager: 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 letpnpm/action-setup@v4read and use the exact version frompackageManager.Proposed fix
- name: Setup pnpm uses: pnpm/action-setup@v4 - with: - version: 10📝 Committable suggestion
🤖 Prompt for AI Agents