chairemobilite / evolution

Online survey platform for travel survey
MIT License
4 stars 9 forks source link

generator: Use types and function from the with the main evolution packages #532

Open tahini opened 5 months ago

tahini commented 5 months ago

With #531 the types in the main evolution packages are not generic anymore, so it can be easier for the generator types to use those, as some of the main types are more complete than the generator ones.

samuel-duhaime commented 5 months ago

@tahini Could you provide an example?

tahini commented 5 months ago

InterviewPathFunction c'est la même chose que ParsingFunction<T>. Beaucoup des types du genre { fr: bla, en: bla } sont en fait des I18nData (qui inclut des parsingFunction), etc. Avant, ces types étaient génériques et donc difficile d'utiliser dans le générateur, mais maintenant, ça peut presque être du find & replace!

tahini commented 5 months ago

Also the SectionConfig and SectionConfigs from the generator (in sectionsTypes.ts) should be replaced with SurveySection and SurveySections in interview.ts (evolution-frontend), once the main type is updated. In the generator, it types more fields, but the main one uses some ParsingFunction type where necessary.

tahini commented 4 months ago

To extend this issue, I think it's not just the types that need to be in main evolution packages, but everything that is code in the generator.

The generator should be a dev package, used to generate the survey, but once generated, there should be no imports from evolution-generator, everything used should be in the evolution-common and evolution-frontend packages.

samuel-duhaime commented 4 months ago

To extend this issue, I think it's not just the types that need to be in main evolution packages, but everything that is code in the generator.

The generator should be a dev package, used to generate the survey, but once generated, there should be no imports from evolution-generator, everything used should be in the evolution-common and evolution-frontend packages.

@tahini After giving it some thought, I'm on board with this. Do you want to open an issue on this?

So evolution-generator will only be the python scripts.