Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install dependencies
working-directory: packages/cli
run: npm install

- name: Build
working-directory: packages/cli
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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.

5 changes: 4 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import * as os from 'os';

const program = new Command();

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

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';


program
.name('jules_cli')
.description('Jules CLI')
.version('0.1.0');
.version(version);

program
.command('list')
Expand Down
Loading