Skip to content

Monorepo #2414

Open
Open
@gchoqueux

Description

Adopt a monorepo structure for itowns. The goal is to split itowns down into reusable and standalone feature packages.
As an example, I've started with the geographic features. (@itowns/geographic)

Context

For the moment, itowns provides an api in a single package.
this architecture poses several problems :

  • Users must install the full api even if they want to use a specific feature.
  • The majority of features aren't independent, as users are obliged to use a Viewer instance.
  • It's more difficult for developers to add feature, re-use, test and dependency management.

Description of the proposal

Split code in packages for clearly structured code.
Simplifies development and facilitates contributions.
Increases the scope of users who only want to use a few features.
This structure makes it necessary to make features independent and improves the architecture

For the moment only one new package is proposed: Geographic

Identified use-cases

Users can use only the packages they are interested in.
Three.js developers can use itowns features more easily.
Developers more easily merge their codes (I received feedsbacks for this architecture)

Implementation

see #2300

Comments

This monorepo structure supports Yarn
There is not breaking change for itowns users

Potential Problems

Rebasing but generally Git does the job, Except when there are bumps and new files or move files
The new publishing, only tested on my npm account

iTowns Monorepo Structure Proposal

1. @itowns/core : ⚠️

  • Description: Manages processing, scheduling, rendering and 3D scene management

2. @itowns/geographic ⚠️

  • Description: Contains the Coordinates, Extent, Crs, Ellipsoid and OrientationUtils

4. @itowns/sources

  • Description: Handles data sources
  • Sub-packages:
    • @itowns/sources/wms
    • @itowns/sources/wmts
    • @itowns/sources/3dtiles
    • @itowns/sources/gpx
    • @itowns/sources/kml

4. @itowns/layers

  • Description: Manages different types of layers and Style
  • Sub-packages:
    • @itowns/layers/raster
      • @itowns/layers/colorLayer
      • @itowns/layers/colorElevation
    • @itowns/layers/vector
      • @itowns/sources/3dtiles
      • @itowns/sources/featureGeometryLayer
    • @itowns/layers/terrain

5. @itowns/mouseControls

  • Description: Manages user mouse controls for navigating the 3D scene (panning, zooming, rotating, etc.).
  • Sub-packages:
    • @itowns/controls/Globe
    • @itowns/controls/Planar
    • @itowns/controls/Immersion
    • @itowns/controls/firstperson

6. @itowns/widget ⚠️

  • Description: Contains additional modules for graphic user interface
  • Sub-packages:
    • @itowns/widget/navigation
    • @itowns/widget/minmap
    • @itowns/widget/scale
    • ...

6. @itowns/plugins

  • Description: Contains additional modules or extensions for non-essential features.
  • Sub-packages:
    • @itowns/plugins/debug: dev debug tools ⚠️
    • @itowns/plugins/measure: Measurement tools (distance, area)
    • @itowns/plugins/analysis: Analysis tools (elevation profiles, cut sections)

To validate

The first validation step is the specified modules with the logo ⚠️ that are included in the PR #2300.

The Following modules must be validated to begin the PR review :

  • @itowns/core
  • @itowns/geographic
  • @itowns/widget
  • @itowns/plugins/debug

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions