-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: remove vendored jasmine versions, user must provider their own jasmine from their node_modules #44
Conversation
1e0a1ff
to
d0acdaa
Compare
@jbedard the behind the scenes package_json attribute doesn't seem possible with this pattern but maybe the problem goes away entirely when switching to use the user's jasmine? |
d0acdaa
to
70c6496
Compare
@@ -0,0 +1,8 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for tests now? WDYT about putting it alongside tests so it's clear it's only for tests, and also to prepare for testing with multiple versions...
jasmine/defs.bzl
Outdated
|
||
node_modules: Label pointing to the linked node_modules target where jasmine is linked, e.g. `//:node_modules`. | ||
|
||
`jasmine` and `jasmine-reporters` must be linked into the node_modules supplied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we don't want any reporting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its on by default and can't be disabled. It's required to get junit xml out that Bazel consumes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the user didn't need to know that though :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not a change from the current behaviour where the attribute is mandatory,
"junit_reporter": attr.label(
mandatory = True,
allow_single_file = True,
),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, its would be easy to opt-out with an attribute in the macro. I'll add that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
generate_junit_xml: Add a custom reporter to output junit XML to `process.env.XML_OUTPUT_FILE` where Bazel expects to find it.
When enabled, `jasmine-reporters` must be linked to the supplied node_modules tree.
that defaults to True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're removing all the vendoring the same as rules_webpack. Its a much better pattern to have users supply their npm deps with these rule sets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know removing it is the goal. I was just mentioning how previously if the user didn't care about reporting they didn't have to do anything, now (at least before adding generate_junit_xml
) they would have to install a package they don't even want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a BREAKING CHANGES for users just like the webpack change but this is pre-1.0 so fair game on a minor release. Long term there will be less maintenance here (and less complexity) since there is no versions.bzl to update with new versions. This also make running tools more similar to how tools are run outside of Bazel which is good and doesn't force users to have to keep versions aligned between their package.json & WORKSPACE file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care about the breakage, I want a good API. Forcing users to install an npm package they don't even know or care about isn't a great API. I think the generate_junit_xml
solves that fine though 👍
The issue is the users @dgp1130 found + fixed this one... any thought's on this? |
I think |
2ac4a32
to
a651d2d
Compare
Roger. Will delete it for now. |
a651d2d
to
c030c9f
Compare
Can we try reproducing 5cbd285? Maybe clone the |
I think renaming |
Ahh. Yes, I may have hit the same issue then and the rename fixed it. I'll rename the files as well. Forgot to do that. |
…own jasmine from their node_modules
c030c9f
to
3b2a61b
Compare
If all the files are named |
I see. That makes sense. There is only the two .cjs files in rules_jasmine |
I think what @dgp1130 mentioned might be a concern? Now that the files are running in a directory essentially owned by the user they will be effected by things like a Can we put them in a subdirectory that contains the empty package.json? I'm not certain that is required though. |
I imagine we're probably fine. The There's always the risk of other |
Thanks for the info and suggestions @dgp1130 👍 |
In the same spirit as aspect-build/rules_webpack#110