-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: migrate from npm to pnpm #1
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
base: main
Are you sure you want to change the base?
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,11 +9,14 @@ | |||||||||
| # ── Stage 1: Builder ───────────────────────────────────────────────────────── | ||||||||||
| FROM node:22-alpine AS builder | ||||||||||
|
|
||||||||||
| # Install pnpm | ||||||||||
| RUN npm install -g pnpm | ||||||||||
|
Comment on lines
+12
to
+13
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. 🧹 Nitpick | 🔵 Trivial Pin the pnpm version for reproducible builds. Same issue as Option 1: Pin via npm # Install pnpm
-RUN npm install -g pnpm
+RUN npm install -g pnpm@9.15.9Option 2: Use corepack (preferred)-# Install pnpm
-RUN npm install -g pnpm
+# Enable corepack to use pnpm version from package.json
+RUN corepack enable📝 Committable suggestion
Suggested change
🧰 Tools🪛 Hadolint (2.14.0)[warning] 13-13: Pin versions in npm. Instead of (DL3016) 🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| WORKDIR /app | ||||||||||
|
|
||||||||||
| # Install root dependencies (layer-cached until package.json changes) | ||||||||||
| COPY package.json package-lock.json ./ | ||||||||||
| RUN npm ci --ignore-scripts | ||||||||||
| COPY package.json pnpm-lock.yaml ./ | ||||||||||
| RUN pnpm install --frozen-lockfile --ignore-scripts | ||||||||||
|
|
||||||||||
| # Copy full source | ||||||||||
| COPY . . | ||||||||||
|
|
@@ -24,7 +27,7 @@ RUN node docker/build-handlers.mjs | |||||||||
|
|
||||||||||
| # Build Vite frontend (outputs to dist/) | ||||||||||
| # Skip blog build — blog-site has its own deps not installed here | ||||||||||
| RUN npx tsc && npx vite build | ||||||||||
| RUN pnpm exec tsc && pnpm exec vite build | ||||||||||
|
|
||||||||||
| # ── Stage 2: Runtime ───────────────────────────────────────────────────────── | ||||||||||
| FROM node:22-alpine AS final | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .PHONY: help lint generate breaking format check clean deps install install-buf install-plugins install-npm install-playwright | ||
| .PHONY: help lint generate breaking format check clean deps install install-buf install-plugins install-pnpm install-playwright | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| # Variables | ||
|
|
@@ -22,7 +22,7 @@ help: ## Show this help message | |
| @echo 'Targets:' | ||
| @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
|
||
| install: install-buf install-plugins install-npm install-playwright deps ## Install everything (buf, sebuf plugins, npm deps, proto deps, browsers) | ||
| install: install-buf install-plugins install-pnpm install-playwright deps ## Install everything (buf, sebuf plugins, pnpm deps, proto deps, browsers) | ||
|
|
||
| install-buf: ## Install buf CLI | ||
| @if command -v buf >/dev/null 2>&1; then \ | ||
|
|
@@ -40,11 +40,11 @@ install-plugins: ## Install sebuf protoc plugins (requires Go) | |
| @$(GO_INSTALL) github.com/SebastienMelki/sebuf/cmd/protoc-gen-openapiv3@$(SEBUF_VERSION) | ||
| @echo "Plugins installed!" | ||
|
|
||
| install-npm: ## Install npm dependencies | ||
| npm install | ||
| install-pnpm: ## Install pnpm dependencies | ||
| pnpm install | ||
|
Comment on lines
+43
to
+44
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. 🧹 Nitpick | 🔵 Trivial Use frozen lockfile in the Make target to catch drift earlier Line [44] uses Suggested diff install-pnpm: ## Install pnpm dependencies
- pnpm install
+ pnpm install --frozen-lockfile🤖 Prompt for AI Agents |
||
|
|
||
| install-playwright: ## Install Playwright browsers for e2e tests | ||
| npx playwright install chromium | ||
| pnpm exec playwright install chromium | ||
|
|
||
| deps: ## Install/update buf proto dependencies | ||
| cd $(PROTO_DIR) && buf dep update | ||
|
|
||
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:
Repository: protoLabsAI/worldmonitor
Length of output: 236
🏁 Script executed:
Repository: protoLabsAI/worldmonitor
Length of output: 3648
🌐 Web query:
tauri-action default tauriScript npx💡 Result:
In the tauri-apps/tauri-action GitHub Action, the tauriScript input specifies the command to run the Tauri CLI (without 'build' or args). If not explicitly set (default is empty string ''), the action automatically determines it by detecting the package manager in the project (npm, pnpm, yarn, bun) and uses formats like "npm run tauri", "yarn tauri", etc. If no suitable project CLI is found or it needs to install the CLI globally, it falls back to just "tauri" (after installing
@tauri-apps/cliglobally via npm). This auto-detection supports npx usage internally for projects without a local tauri script, but users typically set tauriScript explicitly for custom needs like "npx tauri" to avoid issues in npm workspaces.Citations:
Add explicit
tauriScript: pnpm taurito full variant build steps for consistency.The full variant builds (lines 207, 232) omit
tauriScriptand rely on tauri-action's auto-detection, while the tech variant builds (lines 270, 290) explicitly specifytauriScript: pnpm tauri. Although auto-detection should handle pnpm correctly, being explicit ensures consistency across all build variants and avoids relying on implicit behavior.🤖 Prompt for AI Agents