-
Notifications
You must be signed in to change notification settings - Fork 196
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
feat(compiler): bring directories #4210
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chriscbr
commented
Sep 18, 2023
Chriscbr
commented
Sep 18, 2023
Console preview environment is available at https://wing-console-pr-4210.fly.dev 🚀 Updated (UTC): 2023-09-27 17:56 |
Signed-off-by: monada-bot[bot] <monabot@monada.co>
monadabot
added
the
⚠️ pr/review-mutation
PR has been mutated and will not auto-merge. Clear this label if the changes look good!
label
Sep 20, 2023
Chriscbr
changed the title
[WIP] feat(compiler): bring directories
feat(compiler): bring directories
Sep 25, 2023
Chriscbr
commented
Sep 25, 2023
Chriscbr
removed
the
⚠️ pr/review-mutation
PR has been mutated and will not auto-merge. Clear this label if the changes look good!
label
Sep 25, 2023
eladb
reviewed
Sep 26, 2023
Signed-off-by: monada-bot[bot] <monabot@monada.co>
monadabot
added
the
⚠️ pr/review-mutation
PR has been mutated and will not auto-merge. Clear this label if the changes look good!
label
Sep 26, 2023
Chriscbr
removed
the
⚠️ pr/review-mutation
PR has been mutated and will not auto-merge. Clear this label if the changes look good!
label
Sep 26, 2023
MarkMcCulloh
approved these changes
Sep 26, 2023
eladb
approved these changes
Sep 27, 2023
Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if |
14 tasks
Congrats! 🚀 This was released in Wing 0.33.17. |
Horray! |
mergify bot
pushed a commit
that referenced
this pull request
Oct 5, 2023
Introduces the `wing pack` command - a standard way to package libraries in Wing. `wing pack` can be run in any Wing project directory that has a `package.json` in it. `wing pack` will validate your `package.json` produce a tarball that contains the libraries source files. For more documentation, see https://winglang.io/docs/libraries. ## Implementation When you `bring "foo"`, the parser now performs some Node module resolution to look up the `foo` package and see if it's a JSII library or a Wing library based on its `package.json`. If `bring "foo"` refers to a Wing library, then it's equivalent to bringing that library's root directory, per #4210. ## Future related work - #4415 - #4294 - #2171 ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [x] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for bringing directories. Bringing a directory will make all types defined in the files in a directory accessible through the alias defined by the user:
If a symbol like "Bucket" is defined multiple times inside files at the same hierarchical level of "aws", an error will be raised saying that there are multiple definitions of "Bucket" inside the directory. If the directory contains subdirectories, it will be available through a child namespace inside
aws
. For example,aws.storage
will contain types from allaws/storage/*.w
files.To achieve this, I had to figure out some way to model symbol lookups in a directory, where there might be multiple symbol environments that have to be looked up before finding a symbol. To that end, I changed
Namespace
so instead of storing a single single environment, it stores a vector of symbol environments, as this seemed like the least invasive change.Future items:
bring "./"
#4276Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.