Closed mwangi-njuguna closed 2 months ago
@mwangi-njuguna Can you please elaborate on where/why you are using the artifactDirectory
config? I understand what the config does in Relay, I contributed it, but I need to understand why we would need it inside MS?
@alloy the reason we're currently using it is because of the following:
e.g. If my package is app-package
and I run the relay compiler there, I don't want relay-compiler
to write files into a dependency-package
. So what we've done so is to use artifactDirectory
to generate all the files for an app in 1JS inside the apps package and have webpack pick up the files from there using either @graphitation/embedded-document-artefact-loader/webpack or @swc/plugin-relay.
This has been working great so far for the app, but right now we're trying to fix up our tests and thus the reason for this PR :)
As an FYI, this isn't for Jana, we're using this for Org Explorer.
I'm worried about runtime values being imported from a centralised artefact directory with a manual written import, which then wouldn't work in a host app that doesn't use a centralised artefact directory.. I guess it should normally only be typings, so I'll approve this, but let's be mindful of that.
Adds support for explicitly passing
artifactDirectory
option in jest-config when using artifactDirectory in relay config.