Contributions welcome! Please follow the code of conduct.
Yarn workspaces are used to manage dependencies and
build config across packages in the umbrella visx
monorepo, and
lerna is used to manage versioning.
visx/
lerna.json
package.json
packages/
visx-package-1/
src/
test/
build/
package.json
...
visx-package-2/
...
...
Run the following to setup your local dev environment:
# Install `yarn`, alternatives at https://yarnpkg.com/en/docs/install
curl -o- -L https://yarnpkg.com/install.sh | bash
# Clone or fork `visx`
git clone [email protected]:airbnb/visx.git # or your fork
cd visx
# install dependencies, and have `yarn` symlink within-`visx` dependencies
yarn
# build packages and generate types for local development
yarn build
Upon modification of a single package
you can run
# build the package as cjs version
yarn build-one --workspaces=@visx/package
# build the esm version (the @visx/demo next server sources these files)
yarn build-one --workspaces=@visx/package --esm
# generate d.ts(definition files) for a lib
yarn type-one --workspaces=@visx/package --esm
from the visx
monorepo root to re-build the package with your changes.
You can use the local next.js
dev server within packages/visx-demo
to view
and iterate on your changes in the gallery. From the packages/visx-demo
folder run yarn dev
to
start the next server which (if correctly sym-linked) will also watch for changes you make to other
packages (upon re-building them).
visx
uses @airbnb/nimbus
to generate build configuration for
eslint
, prettier
, jest
, babel
, and typescript
.