Start first by cloning the package and installing the development dependencies:
cd ecstra && yarn
You can run the tests using:
yarn test
Alternatively, you can run a single file:
yarn test -- [PATH_TO_FILE]
You can start the development server using:
yarn start
This will listen for changes in the src/
directory.
In order to try your local changes, you can either use the tests, or create an example making good use of your feature / bug fix.
You can start the web server for the examples with:
yarn example
You can then navigate to http://localhost:8080/example/[EXAMPLE_NAME]
to try
it out.
In order to link this package to another one, you can either use yarn add file:[PATH_TO_ECSTRA]
with a local path, or yarn link
.
Just be careful: the package that is published (and so that you should link)
is in the dist
folder.
yarn build
cd dist
yarn link # Link the package generated in the `dist` folder
In you local application, you can now use the ecstra
package:
cd my-app
yarn link ecstra
import { World } from 'ecstra';
// You can use Ecstra as if it was a npm-installed dependency
const world = new World();
Before being merged, the code is passed into the benchmark test suite to ensure no performance has been lost.
To run the benchmark locally, you can use:
npm run benchmark -- -o [PATH_TO_OUTPUT_FILE]
If you wish to compare the benchmark with a previous result, you can use:
npm run benchmark -- -c [PATH_TO_FILE_TO_COMPARE]