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, runyarn publish-local
. This builds the project and publishes a new package in a local registry. -
In the
tfjs
repo, runyarn link-local @tensorflow/tfjs-layers
. This makestfjs
depend on the locally publishedtfjs-layers
package. -
In the
tfjs
repo, runyarn build-npm
to build a new npm package.
Every time you make a change in tfjs-layers
, re-run:
yarn publish-local
in thetfjs-layers
repoyarn build-npm
in thetfjs
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