opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
89 stars 72 forks source link

Integrate commons package to Client #7353

Open rikukissa opened 4 months ago

naftis commented 6 days ago

Me and @tumbledwyer have worked on this earlier @jamil314

Atleast remember client needing "moduleResolution": "bundler" which the old TypeScript version didn't support.

jamil314 commented 4 days ago

@tumbledwyer @naftis What is it that you were trying to achieve when working on this?

tumbledwyer commented 4 days ago

@tumbledwyer @naftis What is it that you were trying to achieve when working on this?

@jamil314 The issue is that exports from the commons project cannot be imported into the client. So all pseudo imports are done via generating the gateway.ts file. The main issue I encountered was the mix of module types. client is using ES modules and some of the other packages too, but commons is using commonjs. Simply changing to ES modules everywhere doesn't work because jest doesn't natively support ES modules so all the tests break. Vite is supposed to be able to import commonjs modules but that doesn't seem to be working properly either.

So I think the idea is to change moduleResolution to bundler to be able to handle mixed module types.

jamil314 commented 4 days ago

https://github.com/opencrvs/opencrvs-core/pull/8008