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: use new read/load assembly functions everywhere #3600

Merged
merged 51 commits into from
Jun 28, 2022

Conversation

kaizencc
Copy link
Contributor

@kaizencc kaizencc commented Jun 14, 2022

This PR utilizes the functions added in #3570 everywhere in the jsii monorepo. The benefit of this is two-fold -- it refactors all places where we load/read assemblies and points them to the source of truth (introduced in #3570). This also means the logic for compressing assemblies will be available for all packages in the jsii monorepo if/when we flip that switch.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kaizencc kaizencc marked this pull request as draft June 14, 2022 18:42
@kaizencc kaizencc changed the title feat: use @jsii/utils everywhere feat: use new read/load assembly functions everywhere Jun 27, 2022
@kaizencc kaizencc marked this pull request as ready for review June 27, 2022 21:22
Comment on lines 121 to 124
} catch {
throw new Error(
`Package tarball ${req.tarball} must have a file named ${spec.SPEC_FILE_NAME} at the root`,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Blind catch is a bit of an anti-pattern. The throw underneath makes wild assumptions about what failed. It should at least log the actual thing it caught here...

Comment on lines +121 to +122
} catch (e: any) {
throw new Error(`Error for package tarball ${req.tarball}: ${e.message}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, @RomainMuller, is this better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yap

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Jun 28, 2022
@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

Merging (with squash)...

1 similar comment
@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2022

Merging (with squash)...

@mergify mergify bot merged commit 623c0c1 into main Jun 28, 2022
@mergify mergify bot deleted the conroy/jsiiutils-extension branch June 28, 2022 16:22
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Jun 28, 2022
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.

2 participants