Skip to content
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

[Packaging] export addons (widgets and debug tools) #2197

Open
3 tasks
mgermerie opened this issue Sep 28, 2023 · 2 comments
Open
3 tasks

[Packaging] export addons (widgets and debug tools) #2197

mgermerie opened this issue Sep 28, 2023 · 2 comments

Comments

@mgermerie
Copy link
Contributor

mgermerie commented Sep 28, 2023

Context

Currently, widgets are exported within itowns bundle - in itowns/widgets. GuiTools are available as a single js file download within examples/js/GUI folder. Debug tools are not published and not suitable for use within an external project, as discussed in #2061.
There are also a few addons - some of which could get an update - available as a js file download in examples/js/plugins folder.

The packaging of these addons could be harmonized, making them available and simple to use in an external project. Meanwhile, the following addons would need to be rewritten/updated :

There is also the question of GitHub repository. We can either extract those addons to a separate repository in iTowns organization or keep them in iTowns/itowns repo. On this matter, three.js opted for the single repository option. It has the advantage of a simpler setup and maintenance.

These subjects are open to discussion.

Suggested solutions for packaging

Provided we opt for the single GitHub repository option, we could do as three.js addons :

  • Gather them within an addons folder which could be at root level or in ./examples. The equivalent in three.js is the examples/jsm folder.
  • Export them under an itowns/addons sub-package - as done here by three.js - or as a package of an @itowns npm organization we could create.

If we choose the separate GitHub repository approach, I don't know if we could still publish addons as an itowns sub-package, but we could still publish them as a package of @itowns npm organization.

@valentinMachado
Copy link
Contributor

I rather the single Github repository option for the reasons you said. Theses packages/addons are going to be related each other it would be easier to maintain them if all modifications for a feature can be wrapped into one PR. CI can be done on all addons/packages.

I rather also the npm packages approach (in @itowns npm organization):

  • dependencies update is handle with npm (and no copy paste)
  • dependencies (external not @itowns one) are not part of the github repo (lighter)
  • dependencies is more readable in the package.json
  • dependencies between addons/packages is done with an id (name of the package) instead of a path

@jailln
Copy link
Contributor

jailln commented Oct 3, 2023

agree with you both and same opinion than @valentinMachado on the implementation for all the reasons you've both given

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

No branches or pull requests

3 participants