Skip to content

Commit e5db11f

Browse files
committed
chore: Use 'pnpm' for internal package development
1 parent fc00144 commit e5db11f

File tree

7 files changed

+4806
-11757
lines changed

7 files changed

+4806
-11757
lines changed

.github/workflows/cicd.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@ jobs:
1010
persist-credentials: false
1111
fetch-depth: 0
1212

13+
- name: Set Up pnpm
14+
uses: pnpm/action-setup@v4
15+
with:
16+
run_install: false
17+
1318
- name: Set Up NodeJs
1419
uses: actions/[email protected]
1520
with:
1621
node-version-file: '.nvmrc'
17-
cache: npm
22+
cache: 'pnpm'
1823

1924
- name: Install Dependencies
20-
run: npm ci
25+
run: pnpm install
2126

2227
- name: Lint
23-
run: npm run lint
28+
run: pnpm run lint
2429

2530
- name: Test
26-
run: npm test
31+
run: pnpm run test
2732

2833
- name: Build
29-
run: npm run build
34+
run: pnpm run build
3035

3136
- name: Cache Deployment
3237
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
@@ -54,7 +59,7 @@ jobs:
5459
env:
5560
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5661
run: |
57-
npm run release:check
62+
pnpm run release:check
5863
5964
Deploy:
6065
needs: CheckRelease
@@ -85,7 +90,7 @@ jobs:
8590
8691
- name: Create Git Release
8792
run: |
88-
npm run release
93+
pnpm run release
8994
9095
- name: Push Git Release
9196
run: |
@@ -95,18 +100,18 @@ jobs:
95100
env:
96101
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
97102
run: |
98-
npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
103+
pnpm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
99104
100-
- name: Publish NPM Package
105+
- name: Publish Package
101106
id: publish
102107
run: |
103-
npm publish
108+
pnpm publish
104109
105110
- name: Publish Release Notes
106111
env:
107112
GH_TOKEN: ${{ secrets.GH_TOKEN }}
108113
run: |
109-
npm run release:post
114+
pnpm run release:post
110115
111116
- name: Revert Git Release
112117
if: failure() && steps.publish.outcome == 'failure'

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typings/
5151
# TypeScript cache
5252
*.tsbuildinfo
5353

54-
# Optional npm cache directory
54+
# Optional module cache directory
5555
.npm
5656

5757
# Optional eslint cache
@@ -66,7 +66,7 @@ typings/
6666
# Optional REPL history
6767
.node_repl_history
6868

69-
# Output of 'npm pack'
69+
# Output of 'pnpm pack'
7070
*.tgz
7171

7272
# Yarn Integrity file

CONTRIBUTING.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ v20.10.0
1313
After cloning the repository, install dependencies and build the project:
1414

1515
```
16-
npm ci
16+
pnpm install
1717
```
1818

1919
Build the library and watch for changes:
2020

2121
```
22-
npm start
22+
pnpm run start
2323
```
2424

2525
Link your local copy:
2626

27+
{/* TODO: pnpm link? */}
28+
2729
```
28-
npm link
30+
pnpm link
2931
```
3032

3133
`markdown-inject` commands in any terminal will now run using your local copy.
@@ -35,13 +37,13 @@ npm link
3537
This app ships with a local suite of [jest](https://jestjs.io/) tests, [eslint](https://eslint.org/) + [prettier](https://prettier.io/) configurations for code consistency and formatting, and [TypeScript](https://www.typescriptlang.org/) type validation. Each of these features can be validated using...
3638

3739
```bash
38-
npm test
39-
npm run lint
40-
npm run build
40+
pnpm run test
41+
pnpm run lint
42+
pnpm run build
4143
```
4244

4345
A `validate` utility script chains these calls together, and is called on every commit.
4446

4547
```bash
46-
npm run validate
48+
pnpm run validate
4749
```

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,16 @@ Add file or command output to markdown documents.
1010

1111
Download and invoke in one command:
1212

13-
```
13+
```sh
1414
npx markdown-inject
1515
```
1616

17-
Local npm installation:
17+
Local installation:
1818

19-
```
19+
```sh
2020
npm install markdown-inject --save-dev
2121
```
2222

23-
or with Yarn:
24-
25-
```
26-
yarn add markdown-inject --dev
27-
```
28-
2923
Optionally, wire up `markdown-inject` to a git pre-commit hook tool like [husky](https://github.com/typicode/husky) to automatically update markdown injection as part of your workflow.
3024

3125
## Usage
@@ -36,7 +30,7 @@ Optionally, wire up `markdown-inject` to a git pre-commit hook tool like [husky]
3630
CODEBLOCK_START
3731
{
3832
"type": "command",
39-
"value": "npm run --silent markdown-inject -- --help",
33+
"value": "pnpm run --silent markdown-inject -- --help",
4034
"hideValue": true
4135
}
4236
-->

0 commit comments

Comments
 (0)