As a preparatory step, run yarn which installs all dev dependencies.
Before submitting a PR with a change, make sure the following commands succeed:
yarn buildwhich compiles the project to ES5 Javascript.yarn formatto format your code.yarn lintto check for linter errors.yarn testto run unit tests in Chrome and Firefox. Make sure all unit tests pass.
When you send a PR, the above commands will also run on Cloud Build
and show up as Github checks. If you see Cloud Build failing, click on the Details
link next to the check to open the log.
Often we want to make a change in tfjs-layers/core and create a new
tfjs package that reflects that change. There is a 3-step initial process to
set this up. The instructions below are for tfjs-layers, but they should work
for developing tfjs-core if you replace tfjs-layers with tfjs-core.
-
In the
tfjs-layersrepo, runyarn publish-local. This builds the project and publishes a new package in a local registry. -
In the
tfjsrepo, runyarn link-local @tensorflow/tfjs-layers. This makestfjsdepend on the locally publishedtfjs-layerspackage. -
In the
tfjsrepo, runyarn build-npmto build a new npm package.
Every time you make a change in tfjs-layers, re-run:
yarn publish-localin thetfjs-layersrepoyarn build-npmin thetfjsrepo to make a new package.
This is an integration test that checks the models exported by tfjs-layers can be loaded correctly by Keras in Python. To run this test, do:
yarn tfjs2keras