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

[jnigen] What to name the file that exports the whole package #2073

Open
HosseinYousefi opened this issue Mar 5, 2025 · 3 comments
Open

Comments

@HosseinYousefi
Copy link
Member

HosseinYousefi commented Mar 5, 2025

This is analogous to importing foo.bar.* in Java.

The file is currently named _package.dart and there are currently a few problems with it.

  • A Java class named _package could technically exist.
  • It is only one level deep, so we have import 'foo/bar/_package.dart' but not import 'foo/_package.dart', we should generate this at each level.
  • It's not immediately obvious to the user that _package.dart, especially starting with an underscore is the file to look for.

Some thoughts:

  • *.dart is not supported in Windows so that's not possible
  • In Dart usually the file that exports everything in foo/bar is called bar.dart, but a class bar or Bar could exist which clashes with this name.
  • We could do -.dart or anything that has a dash in it since it won't clash with a class name
  • Same with +.dart or anything with a plus – Maybe this looks the most like import everything?

cc @dcharkes @liamappelbe

@dcharkes
Copy link
Collaborator

dcharkes commented Mar 5, 2025

Yeah, I pondered this question when we first started this project. And, I still don't know a good solution. 🙃

@liamappelbe
Copy link
Contributor

Is this a configurable option? Making it a config option is an easy work around. Then it doesn't matter so much what the default is.

@HosseinYousefi
Copy link
Member Author

Sure. We could make it configurable as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants