wilkinsona / project-generator

3 stars 4 forks source link

Prepare structure for merge in main project #76

Closed snicoll closed 5 years ago

snicoll commented 5 years ago

This spike project comes to an end and we should consider how the code is going to be integrated into the main project.

Ultimately, I think a module split would be a good thing where:

There are a few things we need to shuffle around. Ideally I'd like this initializr-generator-project to only contain the strict minimum and move all interesting helpers to initializr-generator.

snicoll commented 5 years ago

We have now a core module and a "spring" module: the first is the base API that provides what we need to generate a project while the second gathers the contributors that generate a "Spring project" suitable for start.spring.io.

We need now to integrate this work in the existing github repo and it looks like the "service layer" between the web endpoint and the new API is all that's remaining.

snicoll commented 5 years ago

Looking at the current initializr-generator here is a raw proposal to shuffle things around that should allow us to merge the new API in main repo:

Potentially, it would be more clear to move ProjectRequest, InvalidProjectRequestException and the code that maps a ProjectRequest to ProjectDescription in initializr-web. It would make more clear that this object is web specific.

We also need a base class that serves two purposes: the metadata is invalid and the request is invalid. I don't really see how we could have a common exception type for this as our new low-level module now is the project generator. More in #67

An idea would be to create a initializr-metadata with only the metadata so that initializr-generator-spring can depend on it. That way, all contributors that require the metadata to operate can make use of it (most of the spike package, actually).

snicoll commented 5 years ago

Good progress has been made here but we're still relying on ProjectRequest in tests quite a lot so we need to review that still.