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

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

Open
tahini opened this issue Jun 11, 2024 · 5 comments · May be fixed by #831
Open

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

tahini opened this issue Jun 11, 2024 · 5 comments · May be fixed by #831
Assignees
Labels
generator About Evolution-Generator packages

Comments

@tahini
Copy link
Contributor

tahini commented Jun 11, 2024

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
Copy link
Collaborator

samuel-duhaime commented Jun 11, 2024

@tahini Could you provide an example?

@tahini
Copy link
Contributor Author

tahini commented Jun 11, 2024

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!

@samuel-duhaime samuel-duhaime added the generator About Evolution-Generator packages label Jun 14, 2024
@tahini
Copy link
Contributor Author

tahini commented Jun 17, 2024

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
Copy link
Contributor Author

tahini commented Jul 29, 2024

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 tahini changed the title generator: Use common types with the main survey generator: Use types and function from the with the main evolution packages Jul 29, 2024
@samuel-duhaime
Copy link
Collaborator

samuel-duhaime commented Jul 29, 2024

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.

@samuel-duhaime samuel-duhaime self-assigned this Dec 18, 2024
samuel-duhaime added a commit that referenced this issue Dec 18, 2024
…of evolution-common

Fix #532
Breaking changes: Validations type is now ValidationFunction
Many types from inputTypes are now in WidgetConfig.
You need to do 'yarn generateSurvey' for the Generator surveys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator About Evolution-Generator packages
Projects
None yet
2 participants