Skip to content

Commit 47ac2a0

Browse files
committed
fix: show correct yalc command for both npm and yarn
Thanks to @davydog187 for this fix!
1 parent b97d73d commit 47ac2a0

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,26 @@ npx @sanity/plugin-kit init sanity-plugin-testing-it-out
5757
cd sanity-plugin-testing-it-out
5858
npm run link-watch
5959

60-
# In another shell, link the plugin to your Sanity studio using the command indicated by link-watch
60+
# In another shell
6161
cd /path/to/my-studio
62+
# now link the plugin to your Sanity studio using the command indicated by link-watch output (see below)
63+
```
64+
65+
Run **ONE** of the below commands, **based on the package manager** used in your studio:
66+
67+
```bash
68+
# studio uses yarn
69+
cd /path/to/my-studio
70+
yalc add --link sanity-plugin-testing-it-out && yarn install
71+
```
72+
73+
```bash
74+
# studio uses npm
75+
cd /path/to/my-studio
76+
npx yalc add sanity-plugin-testing-it-out && npx yalc link sanity-plugin-testing-it-out && npm install
77+
```
78+
79+
# Use this command if your studio uses yarn
6280
npx yalc add sanity-plugin-testing-it-out && npx yalc link sanity-plugin-testing-it-out && npm install
6381

6482
```

src/actions/link-watch.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ export async function linkWatch({basePath}: {basePath: string}) {
7272
outdent`
7373
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
7474
75-
To test this package in another repository directory run:
75+
To test this package in Sanity Studio or another package, in a separate shell run:
76+
cd /path/to/sanity/studio-or-package
77+
78+
Then, run one of the below commands, based on the package manager used in studio-or-package:
79+
80+
## yarn
81+
${chalk.greenBright(`yalc add --link ${pkg.name} && yarn install`)}
82+
83+
## npm
7684
${chalk.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
7785
`.trimStart()
7886
)

0 commit comments

Comments
 (0)