repo.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. .. _developer-guide:
  2. General Codebase Orientation
  3. ============================
  4. The ``jupyterlab`` repository is a monorepo: it contains code for many
  5. packages that are versioned and published independently.
  6. In particular, there are many TypeScript packages and a single Python package.
  7. The Python package contains server-side code, and also distributes
  8. the bundled-and-compiled TypeScript code.
  9. See the `Contributing Guidelines <https://github.com/jupyterlab/jupyterlab/blob/3.4.x/CONTRIBUTING.md>`__
  10. for detailed developer installation instructions.
  11. Directories
  12. -----------
  13. The repository contains a number of top-level directories, the contents of which
  14. are described here.
  15. Python package: ``jupyterlab/``
  16. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  17. This, along with the ``setup.py``, comprises the Python code for the project.
  18. This includes the notebook server extension, JupyterLab's command line interface,
  19. entrypoints, and Python tests.
  20. It also contains the final built JavaScript assets which are distributed with
  21. the Python package.
  22. NPM packages: ``packages/``
  23. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  24. This contains the many TypeScript sub-packages which are independently versioned
  25. and published to ``npmjs.org``. These are compiled to JavaScript and bundled with
  26. the Python package.
  27. The bulk of JupyterLab's codebase resides in these packages.
  28. A common pattern for the various components in JupyterLab is to have one package
  29. that implements the component, and a second package postfixed with ``-extension``
  30. that integrates that component with the rest of the application.
  31. Inspection of the contents of this directory shows many such packages.
  32. You can build these packages by running ``jlpm build:packages``.
  33. Binder setup: ``binder/``
  34. ^^^^^^^^^^^^^^^^^^^^^^^^^
  35. This contains an environment specification for ``repo2docker`` which allows
  36. the repository to be tested on `mybinder.org <https://mybinder.org>`__.
  37. This specification is developer focused.
  38. For a more user-focused binder see the
  39. `JupyterLab demo <https://mybinder.org/v2/gh/jupyterlab/jupyterlab-demo/master?urlpath=lab/tree/demo/Lorenz.ipynb>`__
  40. The binder instance adds two endpoints in addition to ``/lab``: ``/lab-dev`` and ``/lab-spliced``.
  41. The ``lab-dev`` endpoint is the equivalent of checking out the repo locally and running ``jupyter lab --dev-mode``.
  42. The ``lab-spliced`` endpoint is the equivalent of building JupyterLab in spliced mode and running ``jupyter lab``.
  43. See the `Development workflow for source extensions <../extension/extension_dev.html#development-workflow-for-source-extensions>`__ for more information on spliced mode.
  44. Build utilities: ``builtutils/``
  45. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  46. An ``npm`` package that contains several utility scripts for managing
  47. the JupyterLab build process.
  48. You can build this package by running ``jlpm build:utils``.
  49. Design: ``design/``
  50. ^^^^^^^^^^^^^^^^^^^
  51. A directory containing a series of design documents motivating various
  52. choices made in the course of building JupyterLab.
  53. Development-Mode: ``dev_mode/``
  54. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  55. An application directory containing built JavaScript assets which are used
  56. when developing the TypeScript sources. If you are running JupyterLab
  57. in ``dev-mode``, you are serving the application out of this directory.
  58. Documentation: ``docs/``
  59. ^^^^^^^^^^^^^^^^^^^^^^^^
  60. This directory contains the Sphinx project for this documentation.
  61. You can create an environment to build the documentation using ``conda create -f environment.yml``,
  62. and you can build the documentation by running ``make html``.
  63. The entry point to the built docs will then be in ``docs/build/index.html``.
  64. Examples: ``examples/``
  65. ^^^^^^^^^^^^^^^^^^^^^^^
  66. The ``examples/`` directory contains stand-alone examples of components,
  67. such as a simple notebook on a page, a console, terminal, and a
  68. file browser. The ``app`` example illustrates a simplified combination of
  69. several of the components used in JupyterLab.
  70. Jupyter Server Configuration: ``jupyter-config/``
  71. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  72. This directory contains metadata distributed with the Python package that
  73. allows it to automatically enable the Jupyter server extension upon installation.
  74. Utility Scripts: ``scripts/``
  75. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  76. This directory contains a series of utility scripts which are primarily used
  77. in continuous integration testing for JupyterLab.
  78. Testing: ``tests/``
  79. ^^^^^^^^^^^^^^^^^^^
  80. Tests for the TypeScript packages in the ``packages/`` directory.
  81. These test directories are themselves small ``npm`` packages which pull in the
  82. TypeScript sources and exercise their APIs.
  83. Test Utilities: ``testutils/``
  84. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  85. A small ``npm`` package which is aids in running the tests in ``tests/``.
  86. TypeDoc Theming: ``typedoc-theme``
  87. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  88. A small theme used to help render our
  89. `TypeDoc <../api/index.html>`__ documentation.