Skip to content

Commit 62eccf4

Browse files
committed
Transition from npm to pnpm
1 parent e8ae193 commit 62eccf4

File tree

15 files changed

+4987
-7903
lines changed

15 files changed

+4987
-7903
lines changed

.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NODE_COMPILE_CACHE="$(pwd)/.cache"
1+
NODE_COMPILE_CACHE="./.cache"

.env.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NODE_COMPILE_CACHE="$(pwd)/.cache"
1+
NODE_COMPILE_CACHE="./.cache"
22
VITEST=1

.github/actions/setup/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'Setup'
2+
description: 'Setup Node.js and pnpm with caching'
3+
4+
inputs:
5+
node-version:
6+
description: 'Node.js version'
7+
required: false
8+
default: '22'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Setup pnpm
14+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
15+
with:
16+
version: '^10.16.0'
17+
18+
- name: Setup Node.js with pnpm cache
19+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
20+
with:
21+
node-version: ${{ inputs.node-version }}
22+
cache: 'pnpm'
23+
24+
- name: Install dependencies
25+
shell: bash
26+
run: pnpm install

.github/workflows/lint.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
linting:
22+
name: 'Linting'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
- uses: SocketDev/socket-sdk-js/.github/actions/setup@e8ae193eb686db288e09cbacce75a828681ccae9
27+
with:
28+
node-version: '22'
29+
30+
- name: Run linting
31+
run: pnpm run check-ci

.github/workflows/provenance.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
options:
1212
- '0'
1313
- '1'
14-
1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
@@ -22,15 +21,18 @@ jobs:
2221

2322
steps:
2423
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
25+
with:
26+
version: 10
27+
run_install: false
2528
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2629
with:
2730
node-version: '22'
2831
registry-url: 'https://registry.npmjs.org'
29-
cache: npm
32+
cache: pnpm
3033
scope: '@socketregistry'
31-
- run: npm install -g npm@latest
32-
- run: npm ci
33-
- run: npm publish --provenance --access public
34+
- run: pnpm install
35+
- run: pnpm publish --provenance --access public
3436
env:
3537
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36-
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
38+
SOCKET_CLI_DEBUG: ${{ inputs.debug }}

.github/workflows/test.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@ concurrency:
2020

2121
jobs:
2222
test:
23-
name: 'Tests'
24-
uses: SocketDev/workflows/.github/workflows/reusable-base.yml@master
25-
with:
26-
no-lockfile: true
27-
npm-test-script: 'test-ci'
28-
node-versions: '18,20,22,24'
29-
os: 'ubuntu-latest,windows-latest'
23+
runs-on: ${{ matrix.os }}
24+
timeout-minutes: 10
25+
strategy:
26+
matrix:
27+
node-version: [20, 22, 24]
28+
os: [ubuntu-latest, windows-latest]
29+
steps:
30+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31+
- uses: SocketDev/socket-sdk-js/.github/actions/setup@e8ae193eb686db288e09cbacce75a828681ccae9
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- name: Run tests
36+
run: pnpm run test-ci

.github/workflows/types.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ permissions:
1515

1616
jobs:
1717
type-check:
18-
uses: SocketDev/workflows/.github/workflows/type-check.yml@master
19-
with:
20-
no-lockfile: true
21-
ts-versions: '5.9'
22-
ts-libs: 'esnext'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
- uses: SocketDev/socket-sdk-js/.github/actions/setup@e8ae193eb686db288e09cbacce75a828681ccae9
22+
with:
23+
node-version: '22'
24+
25+
- name: Run type check
26+
run: pnpm run check:tsc

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.DS_Store
22
._.DS_Store
33
Thumbs.db
4-
/.cache
54
/.env
65
/.nvm
76
/.type-coverage
87
/.vscode
98
/coverage
109
/npm-debug.log
10+
**/.cache
1111
**/dist
1212
**/node_modules
1313
/*.tsbuildinfo

.pnpmrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Delayed dependency updates - wait 7 days (10080 minutes) before allowing new packages.
2+
minimumReleaseAge=10080
3+
4+
# Auto-install peers.
5+
auto-install-peers=true
6+
7+
# Strict peer dependencies.
8+
strict-peer-dependencies=false
9+
10+
# Use node-linker to ensure better compatibility.
11+
node-linker=hoisted
12+
13+
# Save exact versions (like npm --save-exact).
14+
save-exact=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SDK for the Socket API client, generated by `api`.
1111
## Usage
1212

1313
```bash
14-
npm install @socketsecurity/sdk
14+
pnpm add @socketsecurity/sdk
1515
```
1616

1717
### ESM / TypeScript

0 commit comments

Comments
 (0)