-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Support For Typecheck-Only Validation Action #574
Support For Typecheck-Only Validation Action #574
Conversation
@jacobgardner Thanks for working on this! I tested it out in our repo at Figma, and it works well. I did have to make an addition on top of your changes, to support an explicit |
Sweet. I will merge your changes in soon. |
I merged the no_emit code. I want to add some tests for that later this week as well though. |
I've found another hiccup with this approach: when using it in tandem with rules_lint / aspect lint, the typechecking actions will trigger even when you're just trying to run eslint. This is because the validations output group "is special in that its outputs are always requested, regardless of the value of the I think perhaps |
TestFailed tests (1)//docs:update_0_test [k8-fastbuild] 80ms 💡 To reproduce the test failures, run
Buildifier Format |
A more serious issue with this approach is that it negates the performance optimization of using Is a validation action actually providing value in this case? It still requires a "marker" output. Could we instead just have a normal action that outputs the same marker? |
@@ -133,6 +134,7 @@ function ts_project() { | |||
local source_map="" | |||
local declaration="" | |||
local composite="" | |||
local tranpsiler="" |
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.
local tranpsiler="" | |
local transpiler="" |
@@ -146,6 +148,7 @@ function ts_project() { | |||
--source-map) shift; source_map="source_map = True," ;; | |||
--declaration) shift; declaration="declaration = True," ;; | |||
--composite) shift; composite="composite = True," ;; | |||
--mockTranspiler) shift; composite="transpiler = mock," ;; |
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.
--mockTranspiler) shift; composite="transpiler = mock," ;; | |
--mockTranspiler) shift; transpiler="transpiler = mock," ;; |
And then $transpiler
should be inserted in the appropriate place in the heredoc string below.
* fix: lint.sh pass norun_validations See aspect-build/rules_ts#574 (comment) * Update lint.sh
run_cmd = "{} $@".format(executable.path) | ||
arguments.add_all(["--bazelValidationFile", validation_output.short_path]) | ||
else: | ||
run_cmd = """{} $@ && echo "" > {} """.format(executable.path, validation_output.path) |
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.
instead of echo ""
could we just use https://github.com/aspect-build/rules_js/blob/main/js/private/js_binary.sh.tpl#L22 - merely adding JS_BINARY__STDOUT_OUTPUT_FILE
to the env of this action will yield a useful "marker file"
Type of change
My attempt at fixing #88 as a validation action.
For changes visible to end-users
Breaking change (this change will force users to change their own code or config)
Relevant documentation has been updated
Suggested release notes are provided below:
ts_project no longer needs to emit declaration files in order to work with a non-tsc transpiler. If no declaration emit and no transpilation takes place,
tsc --noEmit
is still run as a validation action.Test plan