-
Notifications
You must be signed in to change notification settings - Fork 213
Trusted Library Ecosystem #1037
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
Labels
Milestone
Comments
This is a duplicate of #130 |
I wouldn't say that this is a duplicate. This is about the "managed ecosystem" of libraries while #130 is just the mechanism in the language. |
Got ya |
Closed
5 tasks
mergify bot
pushed a commit
that referenced
this issue
Nov 6, 2023
Introduces the capability to bring trusted libraries using the `bring module_name;` syntax, as a short-hand for `bring "@winglibs/module_name" as module_name;`. If the module hasn't been installed, it will be a parsing error (as it's not possible to type check usage of that module until it has been installed). Part of #1037 ## 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)*.
Chunking up some of the feature ideas above into tasks:
|
Added a prioritized roadmap at the end of the issue description based on Chris's excellent list. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Community Note
Feature Spec
Originally #652
A wing library is a collection of types that can be used by other wing libraries or apps.
Open-source supply-chain attacks are becoming one of the most common and dangerous attack vectors in the industry. To increase the trust, safety and quality of the wing library ecosystem, wing takes a unique approach to package publishing.
The basic idea is that "trusted" winglang libraries are normal npm packages that are published under the
@winglang
scope, and their code is hosted under thewinglang
github org. These libraries can be authored by anyone but they are always published by the winglang project and not their authors.This serves two purposes:
Let's walk through the user experience of installing and publishing trusted and untrusted wing libraries.
Installing wing packages
To install a trusted wing package, use:
Use it like so:
Under the hood, wing uses npm to install the package
@winglang/redis
into yourpackage.json
.Publishing trusted wing packages
To publish a new trusted wing library, all you have to do is simply submit a pull request to the https://github.com/winglang/libs repository.
This repository includes a directory for each library, and is already set up to take care of builds, tests and releases. Just put your code in the right place and we'll take care of the rest.
Your pull request will be go through a quick review by one of our community members. The purpose of this review is to help you make your library awesome and that it meets the wing standards. Once reviewed, it will be merged and immediately released.
Out of the box best in class library publishing
The following will automatically happen for all libraries in the trusted namespace:
wing help foo
shows api docsUntrusted libraries
As mentioned above, winglang libraries are simply npm (JSII) packages, so anyone can publish anything to npm.
You can then use
npm
to install this library:And use
bring
like normal:But:
$ wing compile hello.w ERROR: trying to bring untrusted library "my-wing-lib". Use --allow-untrusted=my-wing-lib to allow.
So you'll have to explicitly opt-in to allow this library:
Use Cases
Implementation Notes
No response
Roadmap
P1
P2
winglibs
repo #5264bring
statements #5265tf-aws
and other targets)P3
wing help foo
shows API docsThe text was updated successfully, but these errors were encountered: