Using yalc
is the best way to test a library in another
local package.
First, choose a package to compile and build:
% cd packages/hooks
hooks % yarn dbuild
And publish to yalc
:
hooks % yalc publish
The yalc:publish
script will also achieve the above.
Then in your app, link to this package:
other-app % yalc link @dolthub/react-hooks
And you will see and up-to-date version of the react-hooks
package. When you make a
change to the package, you can push the change by running yarn yalc:push
and you should
see it automatically reflected in your app.
To remove the yalc package in your app, run yalc remove --all
.
You can use yalc
to watch for changes in the components
package and automatically push.
- In the root of
react-library
:
yarn && yarn dbuild
- Publish the
components
package, inpackages/components
:
yarn yalc:publish
- Link the local package in your app:
yarn yalc @dolthub/react-components
- Start watch mode in
packages/components
:
yarn dbuild:watch
-
Make the changes, wait for the watch to finish building and pushing.
-
Refresh the page in your browser to see the change.