Skip to content

Commit

Permalink
fix: changed recommended link command to work with npm
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed Jun 15, 2022
1 parent 165f702 commit a204163
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ This will publish the plugin to a local [yalc](https://github.com/wclr/yalc) reg
In another shell, in your test Sanity Studio directory, run:

```sh
npx yalc add <your-plugin-package> --link && yarn install
npx yalc add <your-plugin-package> && npx yalc add <your-plugin-package> --link && npm install
```

You can now change your plugin code, which will:
Expand Down
12 changes: 9 additions & 3 deletions src/actions/link-watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import fs from 'fs'
import path from 'path'
import log from '../util/log'
import {getPackage} from '../npm/package'
import outdent from 'outdent'

interface YalcWatchConfig {
folder?: string
Expand Down Expand Up @@ -58,9 +59,14 @@ export async function linkWatch({basePath}: {basePath: string}) {

nodemon
.on('start', function () {
log.info(`Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}`)
log.info(`\nTo test this package in another repository directory run:`)
log.success(`yalc add --link \n${pkg.name} && yarn install`)
log.info(
outdent`
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
To test this package in another repository directory run:
${chalk.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
`.trimStart()
)
})
.on('quit', function () {
process.exit()
Expand Down

0 comments on commit a204163

Please sign in to comment.