Skip to content

Commit

Permalink
Iterate on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Dec 6, 2024
1 parent f6b1abd commit be485bd
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions packages/docs/site/docs/main/contributing/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,17 @@ Playground consists of a number of packages, some of which are published to npmj

Additionally, it's possible to test-publish packages to a local registry, so that changes can be tested without publishing the package to npmjs.com.

### How it works
### Issuing a new release

TODO

- Publishing to npmjs.com

### Publishing to a local registry

Instead of publishing to npmjs.com, you can publish packages to a local registry that is running in your machine. This local registry is provided by [verdaccio](https://verdaccio.org).
Instead of publishing to npmjs.com, you can publish packages to a local registry that is running in your machine. This local registry is provided by [verdaccio](https://verdaccio.org). The sections below describe how to do this.

### Enabling the local registry

Start the local registry with:

Expand All @@ -103,26 +107,34 @@ npm run local-registry:start

> You should now be able to access the local registry's UI at [http://localhost:4873](http://localhost:4873)
Now that the local registry is running, we want `npm` commands to go to it instead of npmjs.com. You can switch the target registry of `npm` with the following command:
To switch the target registry of `npm` so that it uses the local registry instead of npmjs.com, you can use the following command:

```shell
npm run local-registry:enable
```

At this point, all `npm` commands will target the local registry, so you can publish packages as you would normally, but they will be published to the local registry instead.
### Releasing to the local registry

To make `npm` talk to npmjs.com again, you need to disable the local-registry:
At this point, the local registry is running and all `npm` commands will target it, so you can publish packages as you normally would, but they will be published to the local registry instead:

```shell
npm run local-registry:disable
# Note that we're using `release:no-push` instead of `release` because we don't
# want commits or tags to be created, as we're just test-publishing.
npm run release:no-push
```

To clear all data of the local registry (useful if, for example, you have test-published a package and want to test-publish it again), you can use the following script:
Once the above command has ran, packages have been published to the local registry, and should be visible (and downloadable) from the local registry's UI at [http://localhost:4873](http://localhost:4873).

### Disabling the local registry

To disable the local registry, and make `npm` talk to npmjs.com again, you can:

```shell
npm run local-registry:clear
npm run local-registry:disable
```

### Publishing to npmjs.com
To clear all data of the local registry (useful if, for example, you have test-published a package and want to test-publish it again), you can use the following:

TODO
```shell
npm run local-registry:clear
```

0 comments on commit be485bd

Please sign in to comment.