https://github.com/devongovett/workspace-registry
Virtual NPM registry for Yarn workspaces
https://github.com/devongovett/workspace-registry
Last synced: 8 months ago
JSON representation
Virtual NPM registry for Yarn workspaces
- Host: GitHub
- URL: https://github.com/devongovett/workspace-registry
- Owner: devongovett
- Created: 2021-01-31T20:52:48.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-31T20:53:03.000Z (over 5 years ago)
- Last Synced: 2025-04-05T07:14:26.821Z (about 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# workspace-registry
A virtual NPM registry server for testing packages locally without needing to manually publish.
It uses [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) as the source of truth,
and implements the [NPM registry API](https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md)
to respond to metadata and tarball requests on the fly.
The version of each package is based on a hash of all of the files in the package. This means that whenever
you change any file in a package, the version changes automatically. Note that this means that only a single
version of the package is available at a time. No historical versions are retained.
Any dependency that is not in the Yarn workspaces monorepo is
proxied from the public NPM registry.
## Usage
1. Run the `workspace-registry` command within the root directory of your Yarn workspaces monorepo.
This starts a local registry server on port 4321.
2. In the project where you want to install packages from your monorepo, run
`yarn add PACKAGE_NAME --registry http://localhost:4321`.
3. When you want to update the packages from the monorepo, just `rm -rf node_modules yarn.lock` and run `yarn` again.
## License
MIT