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

Add support for global installation #74

Merged
merged 11 commits into from
Jan 3, 2025
Merged

Conversation

BowTiedRadone
Copy link
Collaborator

@BowTiedRadone BowTiedRadone commented Dec 20, 2024

This PR supports global installation using npm --global flag. The rv executable is now accessible globally, allowing users to run it from anywhere on their system.

Key updates:

  • The addition of the bin field in package.json so that the rv command points to the built app.js in the dist directory.
  • The removal of the rv script since the app.js can now be run directly globally.

@BowTiedRadone BowTiedRadone requested a review from a team as a code owner December 20, 2024 16:29
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Just a small nit in #74 (comment) 🙌

Have you tried on Linux and Windows or just macOS? (We will have to setup some CI checks soon.)

app.ts Show resolved Hide resolved
@BowTiedRadone
Copy link
Collaborator Author

BowTiedRadone commented Dec 20, 2024

Just a small nit in #74 (comment) 🙌

Have you tried on Linux and Windows or just macOS? (We will have to setup some CI checks soon.)

The current approach was tested on macOS, Windows, and Linux. Steps for quickly replicating the cross-platform testing:

1. clone the repo and switch to the current branch
2. npm install
3. npm run build
4. npm i -g .
5. run rv from anywhere

The last remaining item in this PR is to update the README before merging.

Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

package.json Outdated Show resolved Hide resolved
@moodmosaic
Copy link
Member

/cc @friedger

Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Merge after CI setup in #75 or another round of manual checks.

This commit updates `tsconfig.json`` to ensure build files are emitted into the
`dist` folder. This change supports the npm publishing process by placing the
compiled files in a location suitable for distribution. Additionally, it helps
with global installations by mapping the bin to the `./dist/app.js` path. To
resolve the correct version from `package.json`, the `resolveJsonModule` option
has been added to the `tsconfig.json`. Additionally, the `dist` folder has been
added to the `.gitignore`.
This commit introduces a Node.js shebang (#!/usr/bin/env node) to ensure the
app.ts script is executable as a CLI tool. Additionally, the package.json is
updated to declare dist/app.js as the entry point for the rv CLI tool,
providing support for custom installation and global execution.
@BowTiedRadone BowTiedRadone force-pushed the fix/global-installation branch from 3758c94 to 2d164fb Compare December 30, 2024 17:17
@BowTiedRadone BowTiedRadone force-pushed the fix/global-installation branch from b61a743 to 677d20a Compare December 30, 2024 18:26
@BowTiedRadone BowTiedRadone force-pushed the fix/global-installation branch from 6a1caba to 1a94bfe Compare January 3, 2025 12:33
The tests should not be included in the build, as  takes care of them.
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

☄️🪐

@moodmosaic moodmosaic merged commit bd9c2ae into master Jan 3, 2025
15 checks passed
@moodmosaic moodmosaic deleted the fix/global-installation branch January 3, 2025 14:22
moodmosaic added a commit that referenced this pull request Jan 17, 2025
moodmosaic added a commit that referenced this pull request Jan 17, 2025
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.

2 participants