-
Notifications
You must be signed in to change notification settings - Fork 303
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
Monorepo structure #2300
base: master
Are you sure you want to change the base?
Monorepo structure #2300
Conversation
9431214
to
e23cfef
Compare
@Desplandis I resolve some issues
|
@gchoqueux Nice! I will take a quick look of your changes and write a todo list of things that should absolutely be tested before reviewing more thoroughly this PR. Expect it for tomorrow or next tuesday! @jailln @mgermerie @ftoromanoff @AnthonyGlt I think we'll need your inputs on this change! ;) This should be a good start to fix #2197, #1930, #2201 (list not exhaustive, feel free to complete). Shall we create a meta-issue to aggregate all those issues? |
e5ec2ea
to
b2308ff
Compare
ea0116d
to
962c99d
Compare
Hi, I'm currently reviewing your PR. I didn't had time to answer to the proposal. I'll submit both review and answer to the proposal tomorrow morning (TLDR; I agree with the package-splitting of this PR and have a few comments for future package-splitting). |
for the moment I haven't completely correlated the proposal with the PR. For example: |
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.
Hi! This is first batch of my review of this PR. Unfortunately I'm kinda blocked on testing the distribution since the compiled code for the itowns
package is incorrect (especially with imports to relative modules).
Moreover, there is a lot of points that I would like you to address. I'll resume the review once those points have been resolved.
Since this PR is massive, @jailln there may be some things that eluded me, do not hesitate to complement this review. =)
"test-with-coverage_lcov": "c8 -n src --reporter=lcov cross-env npm run test-unit", | ||
"watch": "cross-env BABEL_DISABLE_CACHE=1 babel --watch src --out-dir lib", | ||
"postinstall": "cross-env NO_UPDATE_NOTIFIER=true node ./scripts/prepare.mjs && node ./scripts/replace.config.mjs", | ||
"prepublishOnly": "npx copyfiles -u 1 \"../../examples/**/*\" ./examples/ && npx copyfiles -u 1 \"../../docs/**/*\" ./docs/ && npx copyfiles -u 1 \"../../dist/**/*\" ./dist/ ", |
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.
Or just not distribute examples and docs like most other packages.
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.
to be decided
packages/Widget/.babelrc
Outdated
"alias": { | ||
"@itowns/geodesy": "../Geodesy/src/Main.js", | ||
"itowns": "../Main/src/Main.js" | ||
} |
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.
Once again this leads to incorrect compilation of path.
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.
removed
packages/Widget/.babelrc
Outdated
["babel-plugin-inline-import", { | ||
"extensions": [ | ||
".json", | ||
".geojson", | ||
".glsl", | ||
".css" | ||
] | ||
}], |
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.
Not necessary since we do not imports from file with those extensions.
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.
removed
packages/Widget/.babelrc
Outdated
["minify-replace", { | ||
"replacements": [{ | ||
"identifierName": "__DEBUG__", | ||
"replacement": { | ||
"type": "booleanLiteral", | ||
"value": false | ||
} | ||
}] | ||
}], | ||
["minify-dead-code-elimination"] |
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.
Same here, unused.
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.
removed
d578888
to
1bd17ac
Compare
f0ddd49
to
61e950f
Compare
I've finished answering/fixing all your comments. |
61e950f
to
af45df1
Compare
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.
Not much to add to @Desplandis review.
I just think we should explain this new structure in the README and add sub package installation possibilities.
Also, how does it work with releasing and versioning? does subpackage all have the same version or can we (should we?) release them independently ?
@@ -0,0 +1,51 @@ | |||
## iTowns Geographic |
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.
Just a thought: we may update the doc template to be structured per subpackage and export this page as the welcome page of the subpackage. WDYT @gchoqueux @Desplandis?
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.
yes, I think it would be recommended for future implementations to structure documentation by sub-module.
* [Extent](http://www.itowns-project.org/itowns/docs/#api/Geographic/Extent) : Extent is geographical bounding rectangle defined by 4 limits: west, east, south and north. | ||
* [Crs](http://www.itowns-project.org/itowns/docs/#api/Geographic/CRS) : This module provides basic methods to manipulate a CRS (as a string). Visiting [epsg.io](https://epsg.io/) to more coordinate system worldwide. Use **Proj4js** definition in epsg.io. | ||
* [OrientationUtils](http://www.itowns-project.org/itowns/docs/#api/Geographic/OrientationUtils) : it provides methods to compute the quaternion that models a rotation defined with various conventions, including between different CRS. | ||
* Ellipsoid : In geodesy, a reference ellipsoid is a mathematically defined surface that approximates the geoid. |
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'm not sure we should add all classes here as they already each have their own doc? WDYT @Desplandis? If we keep this list, we should add all classes though
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 think it's a good idea to introduce the module's features and point to the detailed documentation.
If we keep this list, we should add all classes though
Except for the Main sub-module, which has yet to be divided.
ac0a1ad
to
451da03
Compare
Yes, I'll document
In a monorepo, it's more complicated to manage a different version for each module, but if we can find a simple and robust solution we can implement it later. |
6f3ada2
to
d4616ba
Compare
d4616ba
to
b1d0ba1
Compare
Description
Refactoring iTowns to monorepo structure.
The goal is to split itowns down into feature packages.
As an example, I've started with the geographic functionalities. (@itowns/geographic)
exportsFields
For the moment
Debug
andWidget
modules are private.Motivation and Context
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 functions.
This structure makes it necessary to make functions independent
Code movement
The classes
Coordinates, Crs, Ellipsoid, Extent, OrientationUtils
files are moved to./packages/geographic/src
.The
proj4
dependency moves to geographic package.The unit tests moves to
packages/xxx/test
.the code
utils/debug
movespackages/Debug
the code
src/Utils/Gui
movespackages/Widget
dependencies
This proposal from monorepo doesn't use monorepo package (by example Lerna).
New dev dependency is
Concurrently
, it's used to watch script in parallelItowns dependencies
(three, proj4...) are moved to the packages that use themnode scripts
The scripts uses the options
--workspaces
or-ws
, to call the corresponding script in each sub packages.