Is it possible to remove or edit the default JupyterLab launcher using an extension?
Yes. You can disable the launcher extension, or write your own extension to replace it.
Hi @jasongrout, thanks for the explanation.
I tried disabling the default launcher and rebuilding, but haven’t been able to get it to work. I am using jupyterlab version 1.2.5 at this point.
The two test I ran were disabling @jupyterlab/launcher with: jupyter labextension disable @jupyterlab/launcher
Then trying to rebuild with npm i @jupyterlab/launcher@1.2.1
. This did not produce a launcher I got the message:
npm WARN saveError ENOENT: no such file or directory, open ‘/Users/berk.serbetcioglu/Desktop/launcher-test/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/berk.serbetcioglu/Desktop/launcher-test/package.json’
npm WARN launcher-test No description
npm WARN launcher-test No repository field.
npm WARN launcher-test No README data
npm WARN launcher-test No license field.
@jupyterlab/launcher@1.2.1
added 8 packages from 2 contributors and audited 2674 packages in 2.124s
15 packages are looking for funding
runnpm fund
for details
found 0 vulnerabilities
I then tried copying the launcher extension directly from the juyterlab repo (with the right version) and got the error:
error TS6053: File ‘/Users/username/Desktop/apputils/tsconfig.json’ not found.
It seemed like an issue. with paths, but I wasn’t able to figure out how to modify the paths.
I then tried to do the same for @jupyterlab/launcher-extension. I repeated the same steps with no luck.
My next idea is to try and use a tar-balled launcher. Will spend time on that today.
Here are a few more details and tips:
Copy the jlab launcher-extension plugin to your own directory outside of jupyterlab. The tsconfig file in the launcher-extension directory references the tsconfig file in the root jlab directory: https://github.com/jupyterlab/jupyterlab/blob/2534ac6d96587b8bf21754fc8e5f3d0e134dbf9b/packages/launcher-extension/tsconfig.json#L2 references https://github.com/jupyterlab/jupyterlab/blob/2534ac6d96587b8bf21754fc8e5f3d0e134dbf9b/tsconfigbase.json. So you can copy the base config and change the reference to the new location, or you can manually combine them into a single tsconfig your plugin would use.
As for copying the launcher plugin, you may need to do that depending on how you are customizing the launcher. You’ll probably want to import the token from the launcher plugin and use that, though, rather than making your own token.