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

Stop exporting internals from the gem #261

Merged
merged 2 commits into from
Mar 16, 2021
Merged

Stop exporting internals from the gem #261

merged 2 commits into from
Mar 16, 2021

Conversation

paracycle
Copy link
Member

Motivation

Tapioca should have never really been exporting its internal types from the gem. All the compilers, etc are for the CLI to operate properly and should not be exported by default.

Implementation

Moved all the internal requires to tapioca/internal.rb. Also, moved the sorbet-runtime initialization and configuration to tapioca/cli.rb since that is the application which should be configuring the runtime.

Moving the Sorbet runtime configuration to CLI entrypoint also meant that we are running runtime typechecking during test runs now. That surfaced a few type errors that are fixed in this PR as well.

Tests

No extra added tests.

@paracycle paracycle requested a review from a team March 16, 2021 22:35
@@ -859,7 +859,7 @@ def signature_of(method)
nil
end

sig { params(constant: Module).returns(String) }
sig { params(constant: T::Types::Base).returns(String) }
def type_of(constant)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I wonder if we should move this method as a service of T::Types::Base since we monkey patch it now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't yet monkey-patch it, but yes, that's a good idea. I'll do that once I've merged the first PR that starts the monkey-patching business.

@paracycle paracycle merged commit 0e7cb75 into master Mar 16, 2021
@paracycle paracycle deleted the uk-fix-public-api branch March 16, 2021 22:55
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

Successfully merging this pull request may close these issues.

None yet

2 participants