tfjs-layers/DEVELOPMENT.md
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 build which compiles the project to ES5 Javascript.yarn format to format your code.yarn lint to check for linter errors.yarn test to 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-layers repo, run yarn publish-local. This builds the
project and publishes a new package in a local registry.
In the tfjs repo, run yarn link-local @tensorflow/tfjs-layers. This makes
tfjs depend on the locally published tfjs-layers package.
In the tfjs repo, run yarn build-npm to build a new npm package.
Every time you make a change in tfjs-layers, re-run:
yarn publish-local in the tfjs-layers repoyarn build-npm in the tfjs repo 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