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

fix(builtin): only generate a .tar pkg_npm output when requested #2428

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

mattem
Copy link
Collaborator

@mattem mattem commented Jan 28, 2021

Adds an optional attribute to the pkg_npm macro to generate the .tar target. When set, the value is used as the filename, which must end in .tgz. If using this, the pkg_npm files must include a valid package.json file, otherwise npm will error.

@google-cla google-cla bot added the cla: yes label Jan 28, 2021
@@ -109,6 +118,12 @@ You can use values from the workspace status command using curly braces, for exa
See the section on stamping in the [README](stamping)
""",
),
"tgz": attr.string(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can it be an attr.output ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh wait I see, this attribute isn't actually used? this is just here to document how the macro works? smelly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👃 Yeah, perhaps we refactor it like you suggested to be like ts_project macro, for another PR as that seems an independent change

internal/pkg_npm/pkg_npm.bzl Outdated Show resolved Hide resolved
@mattem mattem force-pushed the fix/pkg_npm_tar_warn branch 2 times, most recently from ef8fe21 to 9c975f5 Compare January 29, 2021 11:59
@mattem mattem marked this pull request as ready for review January 29, 2021 12:24
name = "my_package",
srcs = ["package.json"],
deps = [":my_typescript_lib"],
tgz = "my_package_tgz",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be .tgz here right?

@mattem mattem force-pushed the fix/pkg_npm_tar_warn branch from 9c975f5 to 0bd3269 Compare January 29, 2021 17:53
@mattem mattem merged commit 4d8f15c into bazel-contrib:stable Jan 29, 2021
@mattem mattem deleted the fix/pkg_npm_tar_warn branch January 29, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants