-
Notifications
You must be signed in to change notification settings - Fork 5
Development Guide
Before we demonstrate how to have simultaneous development of NeuroMynerva with dependent packages, you need to follow the instructions here to first install the development version of NeuroMynerva.
We'll use the neu3d dependency as an example.
Suppose you have a folder called FBL with all the FlyBrainLab packages included within as follows:
FBL
├── FBLClient
├── neu3d # develop this one
├── Neuroballad
└── NeuroMynerva # also develop this one
We have 2 objectives here:
- To make sure that
Neuromynervauses the local copy ofneu3d - To make sure that any changes in
neu3dis reflected within the compiledneu3d.min.js - To make sure that the updated
neu3d.min.jsis reflected in the builtNeuroMynerva.
To do this we need to do the following steps:
- Navigate to
neu3dfolder andjlpm linkthe local copy of theneu3dpackage:
$ cd neu3d
$ jlpm link
yarn link v1.21.1
success Registered "neu3d".
info You can now run `yarn link "neu3d"` in the projects where you want to use this package and it will be used instead.
Done in 0.03s.- Navigate to
NeuroMynervafolder and use the linkedneu3dpackage:
$ cd ../NeuroMynerva
$ jlpm link "neu3d"
yarn link v1.21.1
success Using linked package for "neu3d".
Done in 0.39s.
- Watch and rebuild for changes on both sides:
$ jlpm run watch # in Neuromynerva
# in a separate terminal
$ cd neu3d
$ npm run watch
Afterwards, any changes to neu3d package should trigger first a rebuilding of the neu3d:
asset neu3d.min.js 3.47 MiB [emitted] (name: main)
cached modules 3.15 MiB [cached] 40 modules
runtime modules 1.25 KiB 6 modules
./src/neu3d.js 62.7 KiB [built] [code generated]
webpack 5.72.0 compiled successfully in 145 ms
Followed by an update on the NeuroMynerva side:
Watch Compilation starting…
Removed old assets: [ 'remoteEntry.db52a83904db47132e98.js' ]
Watch Compilation finished
assets by status 6.68 MiB [cached] 12 assets
assets by status 3.5 MiB [emitted]
asset neu3d_lib_neu3d_min_js.1d8fbaf709110ad3e228.js 3.47 MiB [emitted] [immutable] 1 related asset
asset remoteEntry.c2815236baea3ae7af0f.js 36.1 KiB [emitted] [immutable] (name: @flybrainlab/neuromynerva) 1 related asset
cached modules 6.03 MiB (javascript) 336 bytes (share-init) 882 bytes (consume-shared) [cached] 737 modules
runtime modules 26.2 KiB 13 modules
../neu3d/lib/neu3d.min.js 3.47 MiB [built] [code generated]
webpack 5.55.1 compiled successfully in 375 ms
You will need to refresh the browser to see the updated change.
Neuromynerva is considered a prebuilt extension by JLab and can be released on both PyPI and NPM.
The preferred installation/upgrade is via PyPI (pip install neuromynerva --upgrade) so we mainly focus on PyPI installation for JLab 3.x+.
Perform the following steps:
0. Bump Version:
- Since the only place where the version is specified is in package.json under version, just change this value.
- Create distribution:
make dist- This will clean up the repository for any python dummy files before creating a pip wheel and a tar-ball in
dist/
- This will clean up the repository for any python dummy files before creating a pip wheel and a tar-ball in
- Test local installation:
pip install dist/neuromynerva-x.x.xx-py3-none-any.whlorpip install dist/neuromynerva-x.x.xx.tar.gz- Sanity check to make sure that the changes are reflected and the package still works
- [Optional] Upload to TestPyPI:
twine upload -r testpypi dist/*- TestPyPI is like PyPI except for testing publishing
- [Optional] Test installation from TestPyPI:
pip install -i https://test.pypi.org/simple/ neuromynerva- This just installs from
test.pypi, everything else is the same aspip install neuromynerva
- This just installs from
- Upload to PyPI:
twine upload dist/* - Upload to NPM:
npm upload --access public - Tag the git commit and push to master:
git tag vx.x.xx && git push --tags - Create a release on GitHub with the latest version tag.
- Include CHANGELOG in the release
Some checks during the process:
- Did I bump the package version?
- Did the version of the installed packages match what I expect?
- Did the desired features show up in the test installation?
- Did I publish to both PyPI and NPM?
- Did I create a new tagged release on GitHub
- Did I include a CHANGELOG with the release?