Skip to content

Commit ba6474a

Browse files
committed
Transition from npm to pnpm
1 parent 9adbb36 commit ba6474a

File tree

12 files changed

+4811
-7946
lines changed

12 files changed

+4811
-7946
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ concurrency:
2020
jobs:
2121
linting:
2222
name: 'Linting'
23-
uses: SocketDev/workflows/.github/workflows/reusable-base.yml@master
24-
with:
25-
no-lockfile: true
26-
npm-test-script: 'check'
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
- uses: SocketDev/socket-packageurl-js/.github/actions/setup@9adbb36c918120919787c7030e262fc809f291c4
27+
with:
28+
node-version: '22'
29+
30+
- name: Run linting
31+
run: pnpm run check

.github/workflows/provenance.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
with:
2727
node-version: '22'
2828
registry-url: 'https://registry.npmjs.org'
29-
cache: npm
29+
cache: pnpm
3030
scope: '@socketregistry'
31-
- run: npm install -g npm@latest
32-
- run: npm ci
33-
- run: npm test
34-
- run: npm publish --provenance --tag latest --access public
31+
- run: npm install -g pnpm@latest
32+
- run: pnpm install
33+
- run: pnpm test
34+
- run: pnpm publish --provenance --tag latest --access public
3535
env:
3636
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3737
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
38-
- run: npm access set mfa=automation @socketregistry/packageurl-js
38+
- run: pnpm access set mfa=automation @socketregistry/packageurl-js
3939
env:
4040
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4141
SOCKET_CLI_DEBUG: ${{ inputs.debug }}

.github/workflows/test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ concurrency:
2121
jobs:
2222
test:
2323
name: 'Tests'
24-
uses: SocketDev/workflows/.github/workflows/reusable-base.yml@master
25-
with:
26-
no-lockfile: true
27-
npm-test-script: 'test'
28-
node-versions: '18,20,22,24'
29-
os: 'ubuntu-latest,windows-latest'
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: [ubuntu-latest, windows-latest]
28+
node-version: [18, 20, 22, 24]
29+
steps:
30+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31+
- uses: SocketDev/socket-packageurl-js/.github/actions/setup@9adbb36c918120919787c7030e262fc809f291c4
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- name: Run tests
36+
run: pnpm run test

.github/workflows/types.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ 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: 'dom,esnext'
18+
name: 'Type Check'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
- uses: SocketDev/socket-packageurl-js/.github/actions/setup@9adbb36c918120919787c7030e262fc809f291c4
23+
with:
24+
node-version: '22'
25+
26+
- name: Run type check
27+
run: pnpm run check:tsc

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.DS_Store
22
._.DS_Store
33
Thumbs.db
4-
/.cache
54
/.env
65
/.nvm
76
/.tap
87
/.vscode
98
/npm-debug.log
9+
**/.cache
1010
**/node_modules
1111
/*.tsbuildinfo

0 commit comments

Comments
 (0)