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

Can we use loadProjectFromDir()? #114

Open
deinspanjer opened this issue Nov 5, 2019 · 4 comments
Open

Can we use loadProjectFromDir()? #114

deinspanjer opened this issue Nov 5, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@deinspanjer
Copy link

I found that function, and tracked down that it is used in tests, but I think it would be useful to have available in our actual project.

That way, we could have one or more directories with .graphqls and permission.json files in it instead of either defining them statically in the source, or writing the same file handling code you already have.

Thoughts?

@deinspanjer
Copy link
Author

I found a way to get it to work:
const {loadProjectFromDir} = require("cruddl/dist/src/project/project-from-fs");

Does this seem sane?

@frankmayer
Copy link

This seems nice. It's been a long time 😄 , but did you encounter any issues with that approach?
Thanks

@Yogu
Copy link
Member

Yogu commented Nov 1, 2022

This function is only used in tests of cruddl. We can't export it in the package currently because it would introduce a dependency to node modules. cruddl has three exports:

  • cruddl/core - Project etc. - most functionality lives here. Works in node and in the browser
  • cruddl/arangodb - ArangoDBAdapter. only works in node
  • cruddl/inmemory - InMemoryAdapter. Works in node and in the browser
  • cruddl - combines all three

We would need to add a fourth export for node-utils. Can do that, but it's not very high on the priority list.

I found a way to get it to work:
const {loadProjectFromDir} = require("cruddl/dist/src/project/project-from-fs");

That's an internal import which could break anytime, e.g. when the internal structure of file in the package changes. I would suggest to just copy the methods you require.

@Yogu Yogu added the enhancement New feature or request label Nov 1, 2022
@frankmayer
Copy link

OK, thank you very much. Will do that. 👍

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

No branches or pull requests

3 participants