-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a devcontainer #637
base: master
Are you sure you want to change the base?
Add a devcontainer #637
Conversation
Add a devcontainer for easy codespace startup. It will start the container with a preconfigured python environment and all needed dev tooling to start working on the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on, love to see a streamlined dev setup! I left a few minor grammatical nits, things that seemed unclear to me as a first-time reader.
CONTRIBUTING.md
Outdated
|
||
## Updating Javascript packages. | ||
|
||
This project uses lerna to manage the multiple packages inside the packages folder. If you run npm command at the root it will run the command for each subpackage. This is good for working across packages, however more commonly we want to work with an individual package. To do this change directories into the package you wish to alter, then npm will run only for that package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably say "npm commands" here, or "an npm command"
.devcontainer/scripts/setup.sh
Outdated
jupyter nbextension enable --py nbdime --sys-prefix | ||
|
||
jupyter labextension link ./packages/nbdime --no-build | ||
jupyter labextension install ./packages/labextension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidartf This codespace now includes Jupyter Lab, this will allow people starting up the codespace to have a pre-install Jupyter Lab to develop against.
However I am not sure the best way to link the local version of nbdime to the JupyterLab server.
This works, but I am not sure how to get changes to show up, I need to rebuild the docker container every time which is not great.
Is there some sort of script I could put together to automatically update Jupyter Lab? Thanks..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to use this command
jupyter labextension develop --overwrite .
But it was not working as I would expect. I wonder if there is some prereq I am not aware of that the cookie cutter does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jupyter labextension develop . --overwrite
is correct, but not sufficient on its own. If you change some code in the nbdime
package, you would then need to
- build the nbdime code (
npm run build
in packages/nbdime) - build typescript code of tha labextension, and then bundle it into the prebuilt extension (both covered by command
npm run build:dev
in packages/labextension)
To have it build automatically (and quicker), you can set up watchers:
npm run watch
in packages/nbdimenpm run watch
in packages/labextensionjupyter labextension watch
? This one currently doesn't work for me, so might be worth asking lab devs about if there is a good watch command..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool thanks. I will dig into this
.vscode/scripts/watch-webapp.sh
Outdated
@@ -0,0 +1,14 @@ | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't run these shell script tasks on Windows :( If you could write those shell scripts as npm commands, that would be much more platform independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could run them in linux on a codespace 😅, not a windows fan my self. I will move them.
.vscode/tasks.json
Outdated
@@ -0,0 +1,86 @@ | |||
{ | |||
"tasks": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I would prefer not to include IDE specific files in a repo. Especially since that means that whoever maintains that repo will then have to maintain all the config files for those IDEs, even if they don't use it themselves. Making these tasks into "convenience" npm commands, and documenting them would be a better alternative.
@vidartf I have made some updates to this to make it more codespaces centric. Wanna kick the tires and see what you think? |
I am just going to simplify this and go for docs for now. |
Add a devcontainer for easy codespace startup. It will start the container with a preconfigured python environment and all needed dev tooling to start workin on the project.
cc @craiglpeters