Skip to content

Commit a27d9b0

Browse files
authored
chore: update docs (#494)
1 parent 7971af1 commit a27d9b0

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,21 @@ First [install the GitHub Application](https://github.com/apps/pkg-pr-new).
127127
> [!IMPORTANT]
128128
> Make sure it's installed on the repository before trying to publish a package. To read about the permissions the app needs, check [#305](https://github.com/stackblitz-labs/pkg.pr.new/issues/305).
129129
130-
After installing on your repository, you can run `npx pkg-pr-new publish` in your workflows and then you have continuous releases!
130+
After installing on your repository, run `pkg-pr-new` from your lockfile in workflows (for example with `pnpm exec pkg-pr-new publish`) to get continuous releases.
131131

132132
```sh
133-
npm install --save-dev pkg-pr-new # or `npx pkg-pr-new publish`
133+
npm install --save-dev pkg-pr-new
134134
```
135135

136136
For workspaces and monorepos:
137137

138138
```sh
139-
npx pkg-pr-new publish './packages/A' './packages/B' # or `npx pkg-pr-new publish './packages/*'`
139+
pnpm exec pkg-pr-new publish './packages/A' './packages/B' # or `pnpm exec pkg-pr-new publish './packages/*'`
140140
```
141141

142+
> [!CAUTION]
143+
> In CI environments, avoid `npx`, `pnpm dlx`, `yarn dlx`, and `bunx` for this step. Install `pkg-pr-new` as a dependency and execute it from the lockfile (`npm exec`, `pnpm exec`, `yarn`, or `bun run`).
144+
142145
> [!IMPORTANT]
143146
> Make sure the pkg-pr-new command runs only once in a defined workflow (that's part of how it avoids spam)! So instead of multiple times running pkg-pr-new for each workspace package, the command should be run one time for all the desired packages using the pattern above.
144147
@@ -148,15 +151,15 @@ For templates (experimental):
148151
> With templates, pkg.pr.new will generate Stackblitz instances for the given directories with the new built packages.
149152
150153
```sh
151-
npx pkg-pr-new publish './packages/A' --template './examples/*'
154+
pnpm exec pkg-pr-new publish './packages/A' --template './examples/*'
152155
```
153156

154157
By default, pkg.pr.new will generate a template called "default" which includes each built package in the dependencies. This can be disabled with `--no-template`.
155158

156159
Compact URLs are the default (and will fall back to long form if npm metadata is unavailable). To force long-form URLs, use `--no-compact`:
157160

158161
```sh
159-
npx pkg-pr-new publish --no-compact './packages/A' './packages/B'
162+
pnpm exec pkg-pr-new publish --no-compact './packages/A' './packages/B'
160163
```
161164

162165
> Compact URLs rely on your package being published on npm with a valid `repository` field in `package.json`. See [this](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#repository). pkg.pr.new is case sensitive, if the GitHub owner is `PuruVJ`, the package.json `repository` field should not have `puruvj`.
@@ -176,7 +179,7 @@ npm i https://pkg.pr.new/tinylibs/tinybench/tinybench@a832a55
176179
For CLI applications you might want to show `npx` instead of `npm i` for the preview command. This can be accomplished with the `--bin` flag:
177180

178181
```sh
179-
npx pkg-pr-new publish --bin
182+
pnpm exec pkg-pr-new publish --bin
180183
```
181184

182185
With `--bin`:
@@ -194,7 +197,7 @@ npm i https://pkg.pr.new/pkg-pr-new@a832a55
194197
You can control publishing comments with `--comment`:
195198

196199
```sh
197-
npx pkg-pr-new publish --comment=update # default
200+
pnpm exec pkg-pr-new publish --comment=update # default
198201
```
199202

200203
Using `--comment=update`, pkg.pr.new would generate one initial comment and then edit it in the following commits.
@@ -271,7 +274,7 @@ jobs:
271274
- name: Build
272275
run: pnpm build
273276

274-
- run: pnpm dlx pkg-pr-new publish
277+
- run: pnpm exec pkg-pr-new publish
275278
```
276279
277280
#### Release approved pull requests only:
@@ -318,7 +321,7 @@ jobs:
318321
- name: Install dependencies
319322
run: pnpm install
320323

321-
- run: pnpm dlx pkg-pr-new publish
324+
- run: pnpm exec pkg-pr-new publish
322325
```
323326
324327
> Releasing approved pull requests is the recommended way of having continuous releases. This ensures users always install approved and safe packages.
@@ -379,7 +382,7 @@ jobs:
379382
run: pnpm build
380383
381384
- id: publish
382-
run: pnpm dlx pkg-pr-new publish
385+
run: pnpm exec pkg-pr-new publish
383386
384387
e2e-test:
385388
runs-on: ubuntu-latest
@@ -415,7 +418,7 @@ For advanced use cases where you want more control over the messages posted by p
415418

416419
```yml
417420
- name: Publish packages
418-
run: npx pkg-pr-new publish --json output.json --comment=off
421+
run: pnpm exec pkg-pr-new publish --json output.json --comment=off
419422
```
420423

421424
2. Add a custom step in your workflow to process the JSON output and create a custom comment:

packages/app/app/components/GettingStarted.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
releases.
2424
</div>
2525

26-
<CodeSnippet code="npx pkg-pr-new publish" />
26+
<CodeSnippet code="pnpm exec pkg-pr-new publish" />
2727

2828
<template #actions>
2929
<UButton

packages/cli/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ${Object.values(dependencies)
4141
To use this feature as a maintainer, you can run the following command:
4242
4343
\`\`\`sh
44-
npx pkg-pr-new publish './packages/A' --template './examples/*'${isCommentWithDev ? " --commentWithDev" : ""}
44+
pnpm exec pkg-pr-new publish './packages/A' --template './examples/*'${isCommentWithDev ? " --commentWithDev" : ""}
4545
\`\`\`
4646
4747
## Benefits

0 commit comments

Comments
 (0)