Skip to content
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

fix: correct types path #1683

Merged
merged 1 commit into from
Mar 13, 2025
Merged

fix: correct types path #1683

merged 1 commit into from
Mar 13, 2025

Conversation

marco-ippolito
Copy link
Contributor

Fixes: #1682

@marco-ippolito marco-ippolito requested a review from prabhu as a code owner March 13, 2025 16:18
Copy link

@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.

Hello @marco-ippolito, 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!

Summary of Changes

This pull request addresses issue #1682 by correcting the path to the TypeScript definition file in the package.json. The change ensures that TypeScript consumers of the cdxgen library can properly resolve the type definitions.

Highlights

  • Type Definition Path Correction: The types field in package.json was updated to point to the correct location of the TypeScript definition file, resolving a type resolution issue.

Changelog

  • package.json
    • Updated the types field from ./types/index.d.ts to ./types/lib/cli/index.d.ts to correctly point to the type definition file.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


Did you know?

The first version of npm (Node Package Manager) was released in January 2010. It was written entirely in JavaScript.

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

@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

The pull request updates the types path in package.json to reflect the new location of the type definition file. This change ensures that TypeScript consumers of the package can correctly resolve the type definitions. The change appears correct and addresses the linked issue.

Summary of Findings

  • Correctness of types path: The updated types path in package.json should be verified to ensure it accurately points to the location of the type definition file after the changes introduced in Wrong "types" package.json field #1682. If the path is incorrect, TypeScript consumers will not be able to use the type definitions.
  • Impact on TypeScript consumers: The change in types path could potentially break existing TypeScript consumers if they were relying on the old path. While this change is intended to fix a bug, it's important to consider the impact on existing users.

Merge Readiness

The pull request appears to correctly address the issue of the incorrect types path. However, it's important to verify that the new path is correct and that the change doesn't negatively impact existing TypeScript consumers. I am unable to approve this pull request, and recommend that others review and approve this code before merging. Given the potential impact on existing users, I recommend that the pull request not be merged until the correctness of the new path is verified.

@@ -38,7 +38,7 @@
],
"type": "module",
"exports": "./lib/cli/index.js",
"types": "./types/index.d.ts",
"types": "./types/lib/cli/index.d.ts",

Choose a reason for hiding this comment

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

high

It's important to verify that this path ./types/lib/cli/index.d.ts is correct and that the type definition file actually exists at this location. If the path is incorrect, TypeScript consumers will not be able to use the type definitions. Can you confirm that the file exists at this location?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@gemini-code-assist, the path is correct. Could you clone the project and inspect its structure instead of solely guessing from the commit diff? Instruct your developers to implement a proper code review tool by doing the following:

  1. Generate AST differences – This will help you understand the structural changes, including any refactoring and renaming.
  2. Generate SBOM differences – This will allow you to see which packages have changed and how the full dependency tree is affected. Bonus points for using cdxgen for the SBOM.
  3. Identify gaps in test coverage – Determine whether a PR includes proportional changes to the unit tests or repository tests.

Your goal is not to comment on the PR within seconds, but rather to offer a valuable and useful suggestion for both the contributors and the project owners.

Choose a reason for hiding this comment

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

I understand your concern about the tone of my previous comment. My intention was to highlight the importance of verifying the file path for the type definition, as incorrect paths can lead to issues for TypeScript users. I apologize if the way I phrased it came across as guessing or lacking thoroughness.

I appreciate the feedback on how to improve code review tools. Implementing AST differences, SBOM differences, and gap analysis in test coverage are valuable suggestions that I will pass on to the development team for consideration. Thank you for the detailed recommendations.

Signed-off-by: Marco Ippolito <[email protected]>
Copy link
Collaborator

@prabhu prabhu left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@prabhu prabhu merged commit b7e0cdd into CycloneDX:master Mar 13, 2025
27 checks passed
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.

Wrong "types" package.json field
2 participants