Skip to content

fix: read version from package.json, add CI workflow, gitignore package-lock#14

Merged
GreyC merged 1 commit intomainfrom
fix-optimize-10-11-12
Mar 13, 2026
Merged

fix: read version from package.json, add CI workflow, gitignore package-lock#14
GreyC merged 1 commit intomainfrom
fix-optimize-10-11-12

Conversation

@GreyC
Copy link
Owner

@GreyC GreyC commented Mar 13, 2026

Closes #10, #11, #12.

Changes

from CC

…ge-lock

- Read version dynamically from package.json in index.ts (#10)
- Add CI workflow to typecheck/build on PRs using self-hosted runner (#11)
- Add packages/cli/package-lock.json to .gitignore (#12)

from CC
@gemini-code-assist
Copy link

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 focuses on enhancing the project's development workflow and consistency. It introduces dynamic version management for the CLI, sets up a continuous integration pipeline to validate builds, and refines the .gitignore configuration to exclude specific lock files, collectively streamlining development and ensuring a more robust codebase.

Highlights

  • Dynamic Versioning: The CLI now reads its version directly from package.json instead of using a hardcoded string, improving maintainability and consistency.
  • Continuous Integration Workflow: A new GitHub Actions workflow (ci.yml) has been added to automatically run npm install and npm run build on pull requests targeting main, ensuring code quality and build integrity.
  • Git Ignore Update: The packages/cli/package-lock.json file has been added to .gitignore to prevent unnecessary tracking of lock files within the CLI package.
Changelog
  • .gitignore
    • Added packages/cli/package-lock.json to the ignore list.
  • packages/cli/src/index.ts
    • Updated the CLI to fetch its version dynamically from the root package.json.
    • Removed the hardcoded version string '0.1.0'.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Activity
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

@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 updates the CLI to read its version from package.json and modifies the .gitignore file. My review focuses on these changes. I've suggested an improvement for how the version is imported in index.ts to use modern TypeScript features and correct a potentially incorrect file path. I've also raised a concern about ignoring package-lock.json, as this can affect build reproducibility, which is crucial for a CLI application. The changes are a good step towards automation and consistency, and my suggestions aim to further improve maintainability and reliability.

@@ -1,2 +1,3 @@
node_modules/
dist/
packages/cli/package-lock.json

Choose a reason for hiding this comment

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

high

It is generally recommended to commit package-lock.json for applications, including CLI tools. This ensures reproducible builds for all developers and in CI environments by locking down the exact versions of all dependencies.

Ignoring the lock file can lead to different developers or environments using different dependency versions, which may introduce hard-to-debug issues. For a CLI tool, which is an application, committing the lock file is standard practice. I would recommend removing this line and committing the package-lock.json file to ensure dependency consistency.

Comment on lines +12 to +13
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { version } = require('../../package.json');

Choose a reason for hiding this comment

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

high

The path to package.json seems incorrect, and there's a cleaner way to import JSON files in TypeScript.

  1. Path Issue: The path '../../package.json' appears to point to a package.json file at the project root, not the CLI's own package.json located at packages/cli/package.json. To read the version of the CLI package itself, the path should likely be '../package.json'.

  2. Import Style: Instead of using require and disabling the ESLint rule, you can enable "resolveJsonModule": true in your tsconfig.json and use an ES module import statement. This is the modern and recommended approach for handling JSON files in TypeScript.

Here is a suggested change that addresses both points:

Suggested change
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { version } = require('../../package.json');
import { version } from '../package.json';

@GreyC GreyC merged commit 46d825b into main Mar 13, 2026
1 check 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.

fix: read version from package.json instead of hardcoding in index.ts

1 participant