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

[v13] Compilier does not create artifactDirectory if does not exist #3727

Closed
erictaylor opened this issue Jan 7, 2022 · 3 comments
Closed

Comments

@erictaylor
Copy link

Testing the new compiler in v13 we have noticed that usage of artifactDirectory does not work the same as v12. If specified artifact directory does not exist, no directory is created the following error is thrown:

 - The `artifactDirectory` does not exist at `./src/__generated__`.

I'm curious if this is intended behavior or not.

In our project we do not check-in the generated files for Relay into our repo, but opt to rebuild them during build time. So since our artifact directory is git ignored this new behavior breaks our CI usage.

This wouldn't be a problem if I could use a .gitkeep in our artifact directory, but the compiler removes non generated files from the directory.

@alunyov
Copy link
Contributor

alunyov commented Jan 7, 2022

I'm curious if this is intended behavior or not.

Yes, it was intentional. The idea here is that the compiler cannot safely assume that the value in the configuration is valid. It is possible to misspell the directory name, and the compiler will automatically create it.

This wouldn't be a problem if I could use a .gitkeep in our artifact directory, but the compiler removes non generated files from the directory.

There is PR for this should land soon: #3700

@erictaylor
Copy link
Author

Thank you for the info!

Closing this issue as the PR you linked should address our issue.

facebook-github-bot pushed a commit that referenced this issue Jan 31, 2022
…ctories

Summary:
This diff is an alternative to this PR: #3700

Relay removes all files in the generated directories. And GIT could not keep empty directories, so people have to add .gitkeep/README or similar to push directories.

This should address these issues:
- #3727
- #3782

Reviewed By: mofeiZ

Differential Revision: D33893146

fbshipit-source-id: 665f9ec07e3c2650e8b1d6e0fed7f9fdd8da201e
@alunyov
Copy link
Contributor

alunyov commented Feb 1, 2022

Adding README/.gitkeep files to artifactDirectory should be possible with this 0b5a8b9 change. Should be available as relay-compiler@main on NPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants