-
Notifications
You must be signed in to change notification settings - Fork 711
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
Move the typedoc and typedoc-default-themes packages to a monorepo structure. #741
Conversation
* Adds guard against empty `model.readme` * Use correct name for `flags` array This patch ensures the flags are made visible, flags such as `static` and `optional` were not appearing. * Style changes
Icons and styles to render generic type aliases, including icon and type parameter output.
…ut content for the tag.
Added support for generic type aliases
Fixing tag comment display.
…into feature/move-to-monorepo
The move to monorepo entails that we're using the latest themes for testing. The latest themes introduce changes that had not yet been committed to the typedoc repo. This commit incorporates these changes.
👏 Thanks for putting this together! I look forward to reviewing it soon. Any idea on how to handle any open PRs that should be merged? Would it be best to merge those first or recreate them after? |
On the basis of what I know, and a few tests I performed just now, I'd expect all ordering options to require essentially the same amount of work overall to harmonize the PRs. In the merging tests I did git was able to intelligently follow renames. Ultimately, the conflicts I saw were not primarily caused by the change in structure but by issues that would have arisen anyway, even without the structure change. There's a difference though in terms of managing the PR submitters. If a PR made with the old structure needs some work on the part of the submitter before it can be merged, it is somewhat easier for the submitter to make any necessary changes if the old structure is still the one in use. If they need to adjust their PR after the move to the monorepo, the adjustments will probably require them to learn new things. It may be very trivial things (e.g. a file moved to a new location), or it may be more complicated. For instance, if they changed the build process in their PR, the harmonization work required will be more substantial. But if the move to a monorepo is desirable (and I think it is), there's going to be a point at which we'll have to bite the bullet and make the move even if it causes some pain elsewhere. |
FYI, this would make installing from git no longer work. The package managers do have open issues to support this but none currently do (see npm/npm#2974 and yarnpkg/yarn#4725). Since it is no longer valid I think UPDATING.md should be removed. Because of this, it might be time to finally move TypeScript to a peer dependency. That should probably be a separate PR though. |
I've just pushed a new commit that fixes an erroneous target name in the scripts in True. Installing through a reference to a remote git repository is no longer trivial once the switch to the monorepo is performed. I already use many packages that don't support installation through references to repositories (including many of my own projects), and there are issues that sometimes make installing from repo a major pain (e.g. npm/npm#4191). So I tend to not think about that scenario anymore. I've looked at the workarounds provided with npm/npm#2974 but I did not see anything that would work correctly in our setup. I tried a little experiment though. I modified the top
With this in place, it would be possible for someone wanting to install typedoc from a branch to install I tried it with a project of mine and was able to run the monorepo's version of |
Though Lerna imposes some constraints on the structure of a project, it still leaves many decisions up to the developers. One aspect is how to organize the build process for a monorepo. Solutions fall on a continuum between these two extremes:
have each package be built in isolation of the other packages (each package has its own build setup, e.g. its own gruntfile or equivalent),
have a single build system that builds everything.
There are advantages and disadvantages to each. However, in issue after issue filed on Lerna's GitHub repository, I've seen solutions that privilege the 2nd extreme. For instance, multiple issues disappear if all
devDependencies
are moved from the individualpackage.json
of each package to thepackage.json
for the whole monorepo, and using--hoist
.Greenkeeper won't be fully usable in the short term. It will process the top-level
package.json
. However, it is currently unable to processpackage.json
files in subdirectories. There's a WIP that aims to provide Greenkeeper support forpackage.json
files in subdirectories, but it is anyone's guess when it will land in a stable release.(The loss of Greenkeeper functionality was enough for me to second-guess the choice of Lerna. I've looked for alternatives but the alternatives I found were worse than Lerna, overall. Some of them were alpha-level software. Some required major custom scripting to work, etc. Whatever Lerna's faults may be, I found it to be the least objectionable option.)
This monorepo setup was tested by publishing to a local repository and installing the resulting packages. I used them in a project of mine. They worked fine.
Misc additional notes:
I noticed travis was running the test suite twice. Once when
npm install
executes (because that triggers thepublish
script, which in turn runsgrunt build_and_test
). A second time when travis executes the default value for thescript
setting, which isnpm test
. The new travis setup runs the test suite only once.I've added Node 8 to the Travis setup.