Skip to content

Angular migration#10019

Merged
christhompsongoogle merged 10 commits into
mainfrom
migrateAngular
Mar 13, 2026
Merged

Angular migration#10019
christhompsongoogle merged 10 commits into
mainfrom
migrateAngular

Conversation

@christhompsongoogle
Copy link
Copy Markdown
Contributor

@christhompsongoogle christhompsongoogle commented Mar 4, 2026

Angular migration. This one is a little verbose but it's mostly the launch.json bit we want to capture here.

@gemini-code-assist
Copy link
Copy Markdown
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 enhances the migration tool by introducing support for Angular projects. It enables the tool to detect the project's framework and dynamically generate appropriate VS Code debug configurations, specifically adding a new configuration tailored for Angular applications while maintaining existing support for Next.js.

Highlights

  • Framework Detection: Implemented framework detection within the migration process to identify Angular projects.
  • Angular VS Code Debugging: Added logic to generate specific VS Code 'launch.json' configurations for Angular projects, enabling server-side debugging.
  • Test Coverage: Expanded the test suite to include a dedicated test case verifying the successful migration and 'launch.json' generation for Angular projects.

🧠 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
  • src/firebase_studio/migrate.spec.ts
    • Imported the 'frameworks' module for mocking.
    • Renamed an existing test to clarify it covers Next.js (default) migration.
    • Added a mock for 'frameworks.discover' to simulate framework detection.
    • Introduced a new test case to verify a full migration for Angular projects, including mocking file system operations and asserting the correct Angular-specific 'launch.json' content.
  • src/firebase_studio/migrate.ts
    • Imported the 'discover' function from the 'frameworks' module.
    • Modified the 'writeAgyConfigs' function to accept an optional 'framework' parameter.
    • Updated the 'writeAgyConfigs' function to conditionally generate VS Code 'launch.json' configurations: an 'Angular: debug server-side' configuration if Angular is detected, otherwise defaulting to the 'Next.js: debug server-side' configuration.
    • Integrated framework discovery into the main 'migrate' function, logging the detected framework and passing it to 'writeAgyConfigs'.
Activity
  • No specific activity was provided 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
Copy Markdown
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 adds support for migrating Angular projects from Firebase Studio by detecting the framework and generating the appropriate VS Code launch configuration. The changes are well-structured, but there are opportunities to improve code quality by adhering more strictly to the style guide (avoiding any) and reducing code duplication in both the implementation and the tests. I've provided specific suggestions to address these points.

).to.be.true;
});

it("should perform a full migration for Angular successfully", async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This test case is very similar to the 'Next.js' test case above. To improve maintainability and reduce code duplication, consider extracting the common mocking logic into a setup function that can be called by both tests. The setup function could take the framework as an argument to handle framework-specific stubs.

References
  1. The style guide recommends using helper functions to encapsulate branching and reduce nesting. This principle applies to reducing duplication in tests for better maintainability. (link)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed - some of this could definitely be moved into a beforeEach or a helper function. Not blocking tho.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed the copy-pasta, much better now

Comment thread src/firebase_studio/migrate.spec.ts Outdated
sandbox.stub(prompt, "confirm").resolves(false);

// Mock framework discovery as Angular
sandbox.stub(frameworks, "discover").resolves({ framework: "angular" } as any);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using as any is an escape hatch that should be avoided according to the repository's style guide. The discover function returns a Discovery object. Please provide an object that matches the expected type to avoid using as any.

Suggested change
sandbox.stub(frameworks, "discover").resolves({ framework: "angular" } as any);
sandbox.stub(frameworks, "discover").resolves({ framework: "angular", mayWantBackend: true });
References
  1. The style guide prohibits using any as an escape hatch. Proper types or interfaces should be used instead. (link)

logger.info("✅ Updated .vscode/settings.json with startup preferences");

const launchJson = {
const launchJson: any = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using any is an escape hatch that should be avoided according to the repository's style guide. Please define a proper type for launchJson. You could define an interface for the VS Code launch configuration structure, for example:

interface LaunchConfiguration {
  type: string;
  request: string;
  name: string;
  runtimeExecutable: string;
  runtimeArgs: string[];
  port: number;
  console: string;
  preLaunchTask: string;
}

interface LaunchJson {
  version: string;
  configurations: LaunchConfiguration[];
}
References
  1. The style guide prohibits using any as an escape hatch. Proper types or interfaces should be used instead. (link)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good suggestion.

Comment thread src/firebase_studio/migrate.ts Outdated
Comment on lines +330 to +353
if (framework === "angular") {
launchJson.configurations.push({
type: "node",
request: "launch",
name: "Angular: debug server-side",
runtimeExecutable: "npm",
runtimeArgs: ["run", "start"],
port: 9002,
console: "integratedTerminal",
preLaunchTask: "npm-install",
});
} else {
// Default to Next.js (or "next" in discovery)
launchJson.configurations.push({
type: "node",
request: "launch",
name: "Next.js: debug server-side",
runtimeExecutable: "npm",
runtimeArgs: ["run", "dev"],
port: 9002,
console: "integratedTerminal",
preLaunchTask: "npm-install",
});
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The launch configurations for Angular and Next.js are very similar. To reduce code duplication and improve maintainability, you can extract the common properties into a base configuration object and then spread it into the framework-specific configurations.

  const baseConfiguration = {
    type: "node",
    request: "launch",
    runtimeExecutable: "npm",
    port: 9002,
    console: "integratedTerminal",
    preLaunchTask: "npm-install",
  };

  if (framework === "angular") {
    launchJson.configurations.push({
      ...baseConfiguration,
      name: "Angular: debug server-side",
      runtimeArgs: ["run", "start"],
    });
  } else {
    // Default to Next.js (or "next" in discovery)
    launchJson.configurations.push({
      ...baseConfiguration,
      name: "Next.js: debug server-side",
      runtimeArgs: ["run", "dev"],
    });
  }
References
  1. The style guide recommends reducing nesting and considering helper functions to encapsulate branching. This principle can be applied here to reduce duplication by creating a base configuration. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verbose is good

Copy link
Copy Markdown
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM, tho the ai suggestion are good here

).to.be.true;
});

it("should perform a full migration for Angular successfully", async () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed - some of this could definitely be moved into a beforeEach or a helper function. Not blocking tho.

logger.info("✅ Updated .vscode/settings.json with startup preferences");

const launchJson = {
const launchJson: any = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good suggestion.

@christhompsongoogle christhompsongoogle marked this pull request as ready for review March 4, 2026 20:47
@christhompsongoogle christhompsongoogle enabled auto-merge (squash) March 4, 2026 21:52
Comment thread src/firebase_studio/migrate.ts Outdated
@christhompsongoogle christhompsongoogle enabled auto-merge (squash) March 13, 2026 10:47
@christhompsongoogle christhompsongoogle merged commit 11be973 into main Mar 13, 2026
47 checks passed
@christhompsongoogle christhompsongoogle deleted the migrateAngular branch March 13, 2026 10:57
andrewbrook pushed a commit that referenced this pull request Mar 25, 2026
* Angular migration
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.

3 participants