Skip to content

feat: add support for Label in nodejs_binary#entry_point - #480

Closed
manekinekko wants to merge 1 commit into
bazel-contrib:masterfrom
sfeir-open-source:feat/entry-point
Closed

manekinekko wants to merge 1 commit into
bazel-contrib:masterfrom
sfeir-open-source:feat/entry-point

Conversation

@manekinekko

@manekinekko manekinekko commented Dec 21, 2018 •

Copy link
Copy Markdown
Collaborator

Closes #32

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

nodejs_binary#entry_point was a string.

What is the new behavior?

nodejs_binary#entry_point is now a Label.

Does this PR introduce a breaking change?

  • Yes
  • No

The entry_point accepts a target's name as an entry point. If the target is a rule, it should produce the JavaScript entry file that will be passed to the nodejs_binary rule). For example:

       filegroup(
           name = "entry_file",
           srcs = ["workspace/path/to/entry/file"]
       )
       nodejs_binary(
         name = "my_binary",
         ...
         entry_point = ":entry_file",
       )

If the entry JavaScript file belongs to the same package (as the BUILD file), you can simply reference it by its relative name to the package directory:

        nodejs_binary(
          name = "my_binary",
          ...
          entry_point = ":file.js",
        )

⚠️ Downstream Rules That Need To Be Updated ⚠️

@manekinekko

Copy link
Copy Markdown
Collaborator Author

Please ignore the failing tests. This PR is in WIP.

@manekinekko

Copy link
Copy Markdown
Collaborator Author

@alexeagle you mentioned that we shouldn't actually use the expand_path_into_runfiles helpe and that Bazel has built-in function to get the path for a file. Which function did you have in mind?

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to determine that you authored the commits in this PR. Maybe you used a different email address in the git commits than was used to sign the CLA? If someone else authored these commits, then please add them to this pull request and have them confirm that they're okay with them being contributed to Google. If there are co-authors, make sure they're formatted properly.

In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@manekinekko manekinekko changed the title WIP: feat: add support for Label in nodejs_binary#entry_point feat: add support for Label in nodejs_binary#entry_point Mar 26, 2019
@googlebot

Copy link
Copy Markdown

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to determine that you authored the commits in this PR. Maybe you used a different email address in the git commits than was used to sign the CLA? If someone else authored these commits, then please add them to this pull request and have them confirm that they're okay with them being contributed to Google. If there are co-authors, make sure they're formatted properly.

In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Apr 1, 2019
@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@manekinekko

manekinekko commented Apr 12, 2019 •

Copy link
Copy Markdown
Collaborator Author

Blocked by #691

@manekinekko

manekinekko commented Apr 17, 2019 •

Copy link
Copy Markdown
Collaborator Author

Status updates (with #691 applied locally):
✅./scripts/test_packages_all.sh
✅ ./scripts/test_examples_all.sh
✅ ./scripts/test_legacy_e2e_all.sh
❌ ./scripts/test_e2e_all.sh(because of firefox)

@gregmagolan

Copy link
Copy Markdown
Collaborator

Replaced by #777

alexeagle pushed a commit that referenced this pull request Jun 6, 2019
…le entry_point change (#480)

Also updates parcel example entry_point to label
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this pull request Oct 17, 2020
Closes bazel-contrib#480

PiperOrigin-RevId: 288497658
alexeagle pushed a commit to alexeagle/rules_nodejs that referenced this pull request Oct 18, 2020
Closes bazel-contrib#480

PiperOrigin-RevId: 288497658
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.

Support for entry points relative to current BUILD file directory

4 participants