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

feat(cli): wing pack #3938

Merged
merged 61 commits into from
Oct 5, 2023
Merged

feat(cli): wing pack #3938

merged 61 commits into from
Oct 5, 2023

Conversation

Chriscbr
Copy link
Contributor

@Chriscbr Chriscbr commented Aug 23, 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

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • 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.

libs/wingc/src/ast.rs Outdated Show resolved Hide resolved
libs/wingc/src/parser.rs Outdated Show resolved Hide resolved
libs/wingc/src/lsp/hover.rs Outdated Show resolved Hide resolved
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 23, 2023
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Oct 4, 2023
apps/wing/src/cli.ts Outdated Show resolved Hide resolved
apps/wing/src/cli.ts Outdated Show resolved Hide resolved
apps/wing/src/commands/pack.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Shippppppit

apps/wing/src/commands/pack.ts Outdated Show resolved Hide resolved
apps/wing/src/commands/pack.test.ts Show resolved Hide resolved
apps/wing/src/commands/pack.ts Outdated Show resolved Hide resolved
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Oct 5, 2023
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Oct 5, 2023
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Oct 5, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2023

Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if rybickic/wing-pack is up-to-date with main and the queue is empty.

@mergify mergify bot merged commit a496713 into main Oct 5, 2023
23 checks passed
@mergify mergify bot deleted the rybickic/wing-pack branch October 5, 2023 21:57
throw new Error(`No package.json found in the current directory. Run \`npm init\` first.`);
}

const pkgJson = JSON.parse(await fs.readFile(pkgJsonPath, "utf8"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why read the file again? Isn't this the same as the originalJsonFile above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, you're right

@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.35.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants