nim-webaudio is missing some critical -- for my needs -- coverage of the AudioParam class and I'd like to augment it, later submitting a PR to its author.
I've got less than 1 hour of Nim coding experience under my belt and am wondering what's a best practice for the local development of an external git package in the scope of a nim project?
I'm guessing -- please correct me if I'm wrong -- it's something akin to:
mkdir my-new-app
cd my-new-app
git clone https://github.com/ftsf/nim-webaudio
nimble develop (?)
touch index.html
echo '<script src="main.js"></script>' >index.html
touch main.nim
vim main.nim
# import webaudio
# ...
nim js main.nim
open index.html
I think I've got it.
mkdir my-new-app
cd my-new-app
git clone https://github.com/ftsf/nim-webaudio
cd nim-webaudio
vim webaudio.nim
# modify code
nim js webaudio.nim
nimble install
touch index.html
echo '<script src="main.js"></script>' >index.html
touch main.nim
vim main.nim
# import webaudio
# ...
nim js main.nim
open index.html
Correction.
cd ~/dev/nim
git clone https://github.com/ftsf/nim-webaudio
cd nim-webaudio
vim webaudio.nim
# modify code
nim js webaudio.nim
nimble install
cd ..
mkdir my-audio-app
cd my-audio-app
touch index.html
echo '<script src="main.js"></script>' >index.html
touch main.nim
vim main.nim
# import webaudio
# ...
nim js main.nim
open index.html
If you want to keep the changes of an external git project in your own project (is it a git too ?), you should use a git submodule instead: https://git-scm.com/book/en/v2/Git-Tools-Submodules
git submodule add https://github.com/ftsf/nim-webaudio
your-favorite-editor .gitmodules #See the documentation to see the entry you must add in there
git commit -am "Add nim-webaudio dependency"
Then when you want to clone your project repo on another machine:
git clone
git submodule init
git submodule update
or simply git clone --recurse-submodules These aliases can come very handy:
$ git config alias.sdiff '!'"git diff && git submodule foreach 'git diff'"
$ git config alias.spush 'push --recurse-submodules=on-demand'
$ git config alias.supdate 'submodule update --remote --merge'
From what I remember, nimble develop would work as you want.
git clone https://github.com/ftsf/nim-webaudio
cd nim-webaudio
# modify code
nimble develop # this "installs" your modified version so that it's available to other packages.
(I'm fairly sure it worked for me in the past, though you might have to uninstall the original package first)
Interesting. From my understanding, nimble develop would clone the dependencies of interest (per the nimble.develop file) somewhere (inside the project?), allowing me to work on them and, I presume, stage/commit/PR-submit to their remotes ...
At first glance, this seems to bring me closer to my original intent -- simplest way to contribute to nim dependancy while working on my project -- than the pure git submodule approach.
I will look into both options as the nuance is fuzzy (to me).
Thanks! into What would be the difference between nimble develop and nimble install (I was doing the latter to make the updated, local, package available to my other nim projects) ?