Skip to content

Latest commit

History

History
75 lines (54 loc) 路 1.95 KB

CONTRIBUTING.md

File metadata and controls

75 lines (54 loc) 路 1.95 KB

Contributing

Contributions welcome! Please follow the code of conduct.

Overview

Yarn workspaces are used to manage dependencies and build config across packages in the umbrella visx monorepo, and lerna is used to manage versioning.

Project structure

visx/
  lerna.json
  package.json
  packages/
    visx-package-1/
      src/
      test/
      build/
      package.json
      ...
    visx-package-2/
      ...
    ...

Local development

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 git@github.com: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

Rebuild one package

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.

Running demo pages

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).

Config generation

visx uses @airbnb/nimbus to generate build configuration for eslint, prettier, jest, babel, and typescript.