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: add @bazel/angular package #1048

Merged
merged 23 commits into from
Nov 8, 2021
Merged

feat: add @bazel/angular package #1048

merged 23 commits into from
Nov 8, 2021

Conversation

alexeagle
Copy link
Contributor

@alexeagle alexeagle commented Oct 28, 2021

This provides a very small shim builder, which spawns the Bazel build tool under an ng build or ng test command.
It can be useful during a migration, where developers use Angular CLI but some parts of the workspace build and test with Bazel.

It is moving from https://github.com/bazelbuild/rules_nodejs/tree/stable/packages/angular
because that project is cutting scope.

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

Feature

What is the current behavior?

Issue Number: #1047

What is the new behavior?

See added README

Does this PR introduce a breaking change?

No

Other information

This provides a very small shim builder, which spawns the Bazel build tool under an ng build or ng test command.
It can be useful during a migration, where developers use Angular CLI but some parts of the workspace build and test with Bazel.

It is moving from https://github.com/bazelbuild/rules_nodejs/tree/stable/packages/angular
because that project is cutting scope.

Fixes #1047
@alexeagle
Copy link
Contributor Author

@just-jeb could you help fit this new code into your lerna model for build and release?

@alan-agius4 can probably help upgrade it to Angular 12 so it is version-aligned with the other builders in here

alexeagle added a commit to bazel-contrib/rules_nodejs that referenced this pull request Oct 28, 2021
It is moving to just-jeb/angular-builders#1048

We announced the deprecation in the README of this package for 4.x
alexeagle added a commit to bazel-contrib/rules_nodejs that referenced this pull request Oct 28, 2021
It is moving to just-jeb/angular-builders#1048

We announced the deprecation in the README of this package for 4.x
@just-jeb
Copy link
Owner

just-jeb commented Oct 31, 2021

Hey @alexeagle, I'll do the upgrade, no problem.
Are there any tests (e2e o UT) that can be added? Example app, to validate the flow? Any open issues that should be moved here as well?

@just-jeb
Copy link
Owner

Also, can I have write access to the repo so that I could push to this PR please?

@alexeagle
Copy link
Contributor Author

Sure, I invited you to that repo with write access. I'm surprised my usual GitHub settings for "Allow edits by project maintainers" didn't apply here to give you push access to that branch automatically.

Nope no open issues for this code, and also no automated tests. It's a very simple bit of glue, which hasn't changed since we added it. Also, since it doesn't have any conditional logic, it's not very unit-testable. I could imagine an integration test if that's important to you.

@just-jeb
Copy link
Owner

Well I was thinking about a simple Angular app (even the auto generated one) with Bazel config that uses this builder, just to have a regression test and make sure I'm not breaking anything.
Alas I don't have much experience with Bazel, so if you just added such an app here (under examples directory, just like the other builders) or alternatively pointed me out to an example that I can copy, this would be great.

@alexeagle
Copy link
Contributor Author

Here's an old example that uses this builder
https://github.com/angular/angular-bazel-example/blob/master/angular.json

Note that to test this, there's no need to even have an angular app. We just want to run ng build and have bazel perform some simple action like write a file containing "hello world" or something.

Test with npx @angular/cli build in the packages/bazel/example folder
@alexeagle
Copy link
Contributor Author

I added a commit with a bit of bare files. Didn't try adding a package.json in there yet - I'm not sure how much fixture is required to make your monorepo e2e test runner work here.

@alan-agius4
Copy link

Thanks @just-jeb for accepting to add this in your repo and thanks @alexeagle for porting this.

If anyone needs helps feel free to reach out 😁

alexeagle added a commit to bazel-contrib/rules_nodejs that referenced this pull request Nov 1, 2021
It is moving to just-jeb/angular-builders#1048

We announced the deprecation in the README of this package for 4.x
alexeagle added a commit to bazel-contrib/rules_nodejs that referenced this pull request Nov 3, 2021
It is moving to just-jeb/angular-builders#1048

We announced the deprecation in the README of this package for 4.x
@just-jeb just-jeb mentioned this pull request Nov 8, 2021
@just-jeb just-jeb merged commit c651c3a into just-jeb:master Nov 8, 2021
@just-jeb
Copy link
Owner

just-jeb commented Nov 8, 2021

@all-contributors please add @alexeagle for code.

@allcontributors
Copy link
Contributor

@just-jeb

I've put up a pull request to add @alexeagle! 🎉

@just-jeb
Copy link
Owner

just-jeb commented Nov 8, 2021

@all-contributors please add @alan-agius4 for code.

@allcontributors
Copy link
Contributor

@just-jeb

I've put up a pull request to add @alan-agius4! 🎉

@just-jeb
Copy link
Owner

just-jeb commented Nov 8, 2021

@Mawi137 Hey, I'm sorry, how is that related to @angular-builders in general and to @angular-builders/bazel in particular?

@Mawi137
Copy link

Mawi137 commented Nov 8, 2021

Ah sorry, must have thought that this was the Angular 13 issue 😅

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.

4 participants