Skip to content

switched docker to use pnpm instead of npm#805

Merged
CodeWithCJ merged 1 commit intomainfrom
dev
Mar 1, 2026
Merged

switched docker to use pnpm instead of npm#805
CodeWithCJ merged 1 commit intomainfrom
dev

Conversation

@CodeWithCJ
Copy link
Owner

Tip

Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run pnpm run validate to check for any errors.
PRs that include tests and clear screenshots are highly preferred!

Description

Provide a brief summary of your changes.

Related Issue

PR type [x] Issue [ ] New Feature [ ] Documentation
Linked Issue: # #803

Checklist

Please check all that apply:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers
  • Tests: I have included automated tests for my changes.
  • [MANDATORY for UI changes] Screenshots: I have attached "Before" vs "After" screenshots below.
  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate (especially for Frontend).
  • Translations: I have only updated the English (en) translation file (if applicable).
  • Architecture: My code follows the existing architecture standards.
  • Database Security: I have updated rls_policies.sql for any new user-specific tables.
  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code(phishing, malware, etc.) and I agree to the License terms.

Screenshots (if applicable)

Before

[Insert screenshot/GIF here]

After

[Insert screenshot/GIF here]

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request transitions the frontend Docker build processes from using 'npm' to 'pnpm'. This change aims to standardize the package manager used within the Docker environments, potentially leading to more efficient dependency management and consistent builds across development and production setups.

Highlights

  • Package Manager Migration: The Docker configurations for the frontend (both production and development) have been updated to use 'pnpm' instead of 'npm' for dependency management and script execution.
  • Dockerfile Updates: Modified 'Dockerfile.frontend' and 'Dockerfile.frontend.dev' to include 'pnpm' installation steps, update 'COPY' commands to use 'pnpm-lock.yaml', and change 'npm' commands to 'pnpm'.
Changelog
  • docker/Dockerfile.frontend
    • Installed 'pnpm' using 'corepack enable' and 'corepack prepare pnpm@latest --activate'.
    • Updated 'COPY' command to use 'pnpm-lock.yaml' instead of 'package-lock.json'.
    • Replaced 'npm install' with 'pnpm install --frozen-lockfile'.
    • Replaced 'npm run build' with 'pnpm run build'.
  • docker/Dockerfile.frontend.dev
    • Updated 'WORKDIR' to '/app/SparkyFitnessFrontend'.
    • Installed 'pnpm' using 'corepack enable' and 'corepack prepare pnpm@latest --activate'.
    • Updated 'COPY' command to use 'pnpm-lock.yaml' instead of 'package-lock.json'.
    • Replaced 'npm install' with 'pnpm install'.
    • Replaced 'CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]' with 'CMD ["pnpm", "run", "dev", "--host", "0.0.0.0"]'.
Activity
  • The author linked this PR to issue [Bug]: Fronted build errors in v0.16.4.7 #803.
  • The author confirmed that automated tests are included.
  • The author confirmed that 'pnpm run validate' was executed for frontend quality.
  • The author confirmed that the code follows existing architecture standards.
  • The author certified the integrity and license of the work.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@CodeWithCJ CodeWithCJ merged commit 3e23bee into main Mar 1, 2026
1 check passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully switches the frontend Dockerfiles from npm to pnpm. The changes are mostly correct, but I've identified a couple of areas for improvement to ensure build reproducibility and correctness. Specifically, the pnpm version should be pinned to avoid unexpected changes from @latest, and the pnpm-workspace.yaml file should be copied before installing dependencies to ensure the workspace configuration is respected. These changes will make the Docker builds more robust and predictable.

# Copy package files and install dependencies
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/package-lock.json ./
RUN npm install
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml ./
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The pnpm-workspace.yaml file is not being copied before pnpm install. This file can contain important workspace configuration that affects how dependencies are installed. To ensure a consistent and correct installation, it should be copied along with package.json and pnpm-lock.yaml.

COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml SparkyFitnessFrontend/pnpm-workspace.yaml ./

# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate

COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml ./
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The pnpm-workspace.yaml file is not being copied before pnpm install. This file can contain important workspace configuration that affects how dependencies are installed. To ensure a consistent and correct installation, it should be copied along with package.json and pnpm-lock.yaml.

COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml SparkyFitnessFrontend/pnpm-workspace.yaml ./

WORKDIR /app/SparkyFitnessFrontend

# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For reproducible builds, it's best to pin the version of pnpm instead of using @latest. This prevents unexpected issues if a new major version of pnpm is released with breaking changes. Based on your pnpm-lock.yaml, you are using a version compatible with lockfile version 9, which corresponds to pnpm v9.

RUN corepack enable && corepack prepare pnpm@9 --activate

WORKDIR /app/SparkyFitnessFrontend

# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For reproducible builds, it's best to pin the version of pnpm instead of using @latest. This prevents unexpected issues if a new major version of pnpm is released with breaking changes. Based on your pnpm-lock.yaml, you are using a version compatible with lockfile version 9, which corresponds to pnpm v9.

RUN corepack enable && corepack prepare pnpm@9 --activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant