Skip to content

Commit 2b36b19

Browse files
authored
chore: switch to pnpm for security from npm (#85)
## Description <!-- Provide a brief description of your changes --> **Note:** PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat(devbox): add support for custom env vars` or `fix(snapshot): resolve pagination issue`) as they are used for automatic release notes generation. ## Type of Change <!-- Mark the relevant option with an 'x' --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test updates ## Related Issues <!-- Link to related issues using #issue-number --> Closes # ## Changes Made <!-- Describe the changes in detail --> ## Testing <!-- Describe how you tested your changes --> - [ ] I have tested locally - [ ] I have added/updated tests - [ ] All existing tests pass ## Checklist - [ ] My code follows the code style of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Add screenshots to help explain your changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent 6cb5e8f commit 2b36b19

13 files changed

Lines changed: 6798 additions & 12047 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ jobs:
2121
ref: ${{ github.event.pull_request.head.sha }}
2222
repository: ${{ github.event.pull_request.head.repo.full_name }}
2323

24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
2427
- name: Setup Node.js
2528
uses: actions/setup-node@v6
2629
with:
2730
node-version: "20"
28-
cache: "npm"
31+
cache: "pnpm"
2932

3033
- name: Install dependencies
31-
run: npm ci
34+
run: pnpm install --frozen-lockfile
3235

3336
- name: Run Prettier check
34-
run: npm run format:check
37+
run: pnpm run format:check
3538

3639
lint:
3740
runs-on: ubuntu-latest
@@ -46,17 +49,20 @@ jobs:
4649
ref: ${{ github.event.pull_request.head.sha }}
4750
repository: ${{ github.event.pull_request.head.repo.full_name }}
4851

52+
- name: Setup pnpm
53+
uses: pnpm/action-setup@v4
54+
4955
- name: Setup Node.js
5056
uses: actions/setup-node@v6
5157
with:
5258
node-version: "20"
53-
cache: "npm"
59+
cache: "pnpm"
5460

5561
- name: Install dependencies
56-
run: npm ci
62+
run: pnpm install --frozen-lockfile
5763

5864
- name: Run ESLint
59-
run: npm run lint
65+
run: pnpm run lint
6066

6167
build:
6268
runs-on: ubuntu-latest
@@ -71,17 +77,20 @@ jobs:
7177
ref: ${{ github.event.pull_request.head.sha }}
7278
repository: ${{ github.event.pull_request.head.repo.full_name }}
7379

80+
- name: Setup pnpm
81+
uses: pnpm/action-setup@v4
82+
7483
- name: Setup Node.js
7584
uses: actions/setup-node@v6
7685
with:
7786
node-version: "20"
78-
cache: "npm"
87+
cache: "pnpm"
7988

8089
- name: Install dependencies
81-
run: npm ci
90+
run: pnpm install --frozen-lockfile
8291

8392
- name: Build TypeScript
84-
run: npm run build
93+
run: pnpm run build
8594

8695
test:
8796
runs-on: ubuntu-latest
@@ -97,17 +106,20 @@ jobs:
97106
ref: ${{ github.event.pull_request.head.sha }}
98107
repository: ${{ github.event.pull_request.head.repo.full_name }}
99108

109+
- name: Setup pnpm
110+
uses: pnpm/action-setup@v4
111+
100112
- name: Setup Node.js
101113
uses: actions/setup-node@v6
102114
with:
103115
node-version: "20"
104-
cache: "npm"
116+
cache: "pnpm"
105117

106118
- name: Install dependencies
107-
run: npm ci
119+
run: pnpm install --frozen-lockfile
108120

109121
- name: Run component tests with coverage
110-
run: npm run test:components
122+
run: pnpm run test:components
111123

112124
- name: Upload coverage report
113125
uses: actions/upload-artifact@v6

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,21 @@ jobs:
3232
- name: Checkout code
3333
uses: actions/checkout@v6
3434

35+
- name: Setup pnpm
36+
uses: pnpm/action-setup@v4
37+
3538
- name: Setup Node.js
3639
uses: actions/setup-node@v6
3740
with:
3841
node-version: "24"
3942
registry-url: "https://registry.npmjs.org"
40-
cache: "npm"
43+
cache: "pnpm"
4144

4245
- name: Install dependencies
43-
run: npm ci
46+
run: pnpm install --frozen-lockfile
4447

4548
- name: Build
46-
run: npm run build
49+
run: pnpm run build
4750

4851
- name: Publish to npm
49-
run: npm publish
52+
run: pnpm publish --no-git-checks

.husky/pre-push

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
# This hook runs format:check, lint, and docs:commands
33

44
echo "Running format:check..."
5-
if ! npm run format:check; then
5+
if ! pnpm run format:check; then
66
echo ""
77
echo "❌ Code formatting check failed"
8-
echo " Please run 'npm run format' to fix formatting issues"
8+
echo " Please run 'pnpm run format' to fix formatting issues"
99
echo ""
1010
exit 1
1111
fi
1212

1313
echo "Running lint..."
14-
if ! npm run lint; then
14+
if ! pnpm run lint; then
1515
echo ""
1616
echo "❌ Linting failed"
17-
echo " Please run 'npm run lint:fix' to fix linting issues"
17+
echo " Please run 'pnpm run lint:fix' to fix linting issues"
1818
echo ""
1919
exit 1
2020
fi
2121

2222
echo "Running docs:commands to ensure README.md is up to date..."
2323

2424
# Run the docs generation script
25-
npm run docs:commands
25+
pnpm run docs:commands
2626

2727
# Check if README.md has uncommitted changes
2828
if ! git diff --quiet README.md; then

CLAUDE_SETUP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ Make sure `rli` is in your PATH. Test by running `which rli` (macOS/Linux) or `w
104104

105105
If not found:
106106
- If installed via npm globally: `npm install -g @runloop/rl-cli`
107-
- Check your npm global bin directory is in PATH: `npm config get prefix`
107+
- If installed via pnpm globally: `pnpm add -g @runloop/rl-cli`
108+
- Check your npm/pnpm global bin directory is in PATH
108109

109110
### "API key not configured"
110111

CONTRIBUTING.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Thank you for your interest in contributing to the Runloop CLI! This document pr
77
### Prerequisites
88

99
- Node.js >= 18.0.0
10-
- npm
10+
- pnpm
1111

1212
### Development Setup
1313

@@ -21,19 +21,19 @@ cd rl-cli
2121
2. Install dependencies:
2222

2323
```bash
24-
npm install
24+
pnpm install
2525
```
2626

2727
3. Build the project:
2828

2929
```bash
30-
npm run build
30+
pnpm run build
3131
```
3232

3333
4. Link for local development:
3434

3535
```bash
36-
npm link
36+
pnpm link --global
3737
```
3838

3939
Now you can use `rli` commands locally with your changes.
@@ -42,10 +42,10 @@ Now you can use `rli` commands locally with your changes.
4242

4343
```bash
4444
# Watch mode - rebuilds on file changes
45-
npm run dev
45+
pnpm run dev
4646

4747
# Run the CLI
48-
npm start -- <command>
48+
pnpm start -- <command>
4949

5050
# Or after linking
5151
rli <command>
@@ -59,33 +59,33 @@ This project uses Prettier and ESLint to maintain code quality.
5959

6060
```bash
6161
# Check formatting
62-
npm run format:check
62+
pnpm run format:check
6363

6464
# Auto-fix formatting
65-
npm run format
65+
pnpm run format
6666
```
6767

6868
### Linting
6969

7070
```bash
7171
# Run linter
72-
npm run lint
72+
pnpm run lint
7373

7474
# Auto-fix lint issues
75-
npm run lint:fix
75+
pnpm run lint:fix
7676
```
7777

7878
## Testing
7979

8080
```bash
8181
# Run all tests
82-
npm test
82+
pnpm test
8383

8484
# Run component tests with coverage
85-
npm run test:components
85+
pnpm run test:components
8686

8787
# Watch mode
88-
npm run test:watch
88+
pnpm run test:watch
8989
```
9090

9191
Please ensure all tests pass before submitting a pull request.

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ RUN apt-get update && apt-get install -y \
1010
git \
1111
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
1212
&& apt-get install -y nodejs \
13+
&& npm install -g pnpm@9 \
1314
&& apt-get clean \
1415
&& rm -rf /var/lib/apt/lists/*
1516

1617
# Set working directory
1718
WORKDIR /app
1819

1920
# Copy package files first for better caching
20-
COPY package.json package-lock.json ./
21+
COPY package.json pnpm-lock.yaml ./
2122

2223
# Install dependencies
23-
RUN npm ci
24+
RUN pnpm install --frozen-lockfile
2425

2526
# Copy source code
2627
COPY . .

MCP_COMMANDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ Message endpoint: http://localhost:3000/message
143143
### Command not found
144144

145145
If you get "command not found: rli":
146-
- Install globally: `npm install -g @runloop/rl-cli`
147-
- Check your PATH includes npm global bin directory
146+
- Install globally: `npm install -g @runloop/rl-cli` or `pnpm add -g @runloop/rl-cli`
147+
- Check your PATH includes npm/pnpm global bin directory
148148

149149
### API key not configured
150150

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ rli devbox delete <devbox-id>
3636

3737
## Installation
3838

39-
Install globally via npm:
39+
Install globally via npm or pnpm:
4040

4141
```bash
4242
npm install -g @runloop/rl-cli
43+
# or
44+
pnpm add -g @runloop/rl-cli
4345
```
4446

4547
## Setup
@@ -197,13 +199,13 @@ The TUI supports both light and dark terminal themes and will automatically sele
197199

198200
```bash
199201
# Install dependencies
200-
npm install
202+
pnpm install
201203

202204
# Build
203-
npm run build
205+
pnpm run build
204206

205207
# Watch mode
206-
npm run dev
208+
pnpm run dev
207209

208210
## Contributing
209211

0 commit comments

Comments
 (0)