Skip to content

Remove all npm scripts in favour of nx targets#2445

Open
rfontanarosa wants to merge 7 commits intomasterfrom
rfontanarosa/2341/code-health-replace-all-npm-scripts-with-nx-targets-2
Open

Remove all npm scripts in favour of nx targets#2445
rfontanarosa wants to merge 7 commits intomasterfrom
rfontanarosa/2341/code-health-replace-all-npm-scripts-with-nx-targets-2

Conversation

@rfontanarosa
Copy link
Collaborator

closes #2341

@rfontanarosa rfontanarosa requested a review from gino-m March 6, 2026 14:56
@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 significantly refactors the project's script execution strategy by migrating all existing npm scripts to nx targets. This change aims to consolidate and standardize how tasks are run across the monorepo, leveraging Nx's capabilities for improved build performance, dependency management, and overall developer experience. The migration impacts various projects, including e2e tests, Firebase functions, shared libraries, and protobuf generation, by embedding their operational commands directly into the Nx configuration.

Highlights

  • Migration to Nx Targets: All npm scripts across the monorepo have been systematically removed and reconfigured as nx targets within their respective package.json files. This centralizes script management under the Nx build system.
  • Standardized Command Execution: Commands previously executed via npm run are now executed using nx run <project>:<target>, ensuring consistent invocation and leveraging Nx's caching and dependency graph features.
  • Enhanced Build and Test Orchestration: Complex workflows, such as e2e tests involving start-server-and-test and Firebase emulator interactions, have been adapted to use Nx targets, improving their integration and management within the monorepo.
  • Consolidated Protobuf Generation: The proto project's build process for protobufs has been streamlined into a single Nx build target, utilizing nx:run-commands to execute multiple steps sequentially.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • e2e-tests/package.json
    • Moved test:create, test:create:debug, test:verify, test:verify:debug, lint, and fix scripts from the scripts section to nx.targets.
    • Removed the scripts section.
  • functions/package.json
    • Moved build, shell, emulate, logs, deploy, and watch scripts from the scripts section to nx.targets.
    • Introduced a deploy target with staging and production configurations, depending on the build target.
    • Removed the scripts section.
  • lib/package.json
    • Moved the build script from the scripts section to nx.targets.
    • Removed the scripts section, including build-local-deps, build-all, build-and-test, and build-all-and-test.
  • package.json
    • Moved export:local, start-and-export:test, and all test:e2e:* scripts from the scripts section to nx.targets.
    • Updated start-server-and-test commands to use nx run syntax for calling other targets.
    • Removed the scripts section.
  • proto/package.json
    • Moved build, format, generate:pbjs, generate:pbjson, generate:pbts, pbjs, and postbuild scripts from the scripts section to nx.targets.
    • Consolidated protobuf generation steps into a single build target using nx:run-commands.
    • Added a format:write target for buf format --write.
    • Removed the scripts section.
  • web/package.json
    • Removed pretest, posttest, and extract-i18n from the scripts section.
    • Modified the test Nx target to execute pretest.sh and posttest.sh as part of its command.
Activity
  • No activity (comments, reviews) was found for this pull request.
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.

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 migrates all npm scripts from package.json files into nx targets. This is a great move for standardizing script execution within the monorepo. The migration is mostly well-executed, but I've found a few areas for improvement. Specifically, I've pointed out a potential issue with a hardcoded placeholder in a production deployment script, a missing task dependency that could lead to running tests on stale code, and a minor redundancy in a build script. Addressing these points will make the new setup more robust and maintainable.

Note: Security Review has been skipped due to the limited scope of the PR.

@rfontanarosa rfontanarosa self-assigned this Mar 6, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.97%. Comparing base (3fdb34b) to head (2976a0d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2445   +/-   ##
=======================================
  Coverage   58.97%   58.97%           
=======================================
  Files         111      111           
  Lines        2747     2747           
  Branches      408      408           
=======================================
  Hits         1620     1620           
  Misses       1065     1065           
  Partials       62       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Code health] Replace all npm scripts with nx targets

2 participants