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

Nested packages private by default #11

Open
wildmaples opened this issue Sep 25, 2020 · 0 comments
Open

Nested packages private by default #11

wildmaples opened this issue Sep 25, 2020 · 0 comments
Labels
explore Some exploration or investigation needed

Comments

@wildmaples
Copy link
Contributor

Currently, all nested packages are accessible by any other package. We may want to reconsider this model so that nested packages are not "exported" by default, unless explicitly requested by the parent package:

# tree
.
└── foo
    ├── package.yml
    └── bar
        └── package.yml

# cat foo/package.yml
enforce_privacy: true
enforce_dependencies: true
dependencies:
  - "foo/bar"
export_packages:
  - "foo/bar"

This would allow those who depend on foo to be able to also access bar, otherwise any access to or dependency on bar would be a violation. If we want to export a subset of bar to the rest of the world, we would use aliasing:

# cat foo/app/public/foo/stuff.rb
module Foo
  Stuff = ::Foo::Bar::Stuff
end

We've briefly described a project where packages could put more constraints on incoming edges (in the dependency graph).

@thegedge sees two possibilities for those constraints: a whitelist option or a blacklist option (not both). In this case, we would whitelist the parent package in the nested package, which means any other package would be a violation.

@wildmaples wildmaples added the explore Some exploration or investigation needed label Sep 25, 2020
shioyama pushed a commit that referenced this issue May 21, 2021
custom inflections for associations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
explore Some exploration or investigation needed
Projects
None yet
Development

No branches or pull requests

1 participant