-
Notifications
You must be signed in to change notification settings - Fork 24
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
[FR]: How to integrate custom test rules with configure #778
Comments
Ideally all you should need is a starlark extension that generates the vitest target and takes the pre-compiled See #439 for the As a workaround you can do for now... use
|
Hi @jbedard , Thanks a lot for your answer! :)
I can do this, but then I end up with two
and I want Following your suggestion, I could add a custom plugin that only generates the
But this doesn't seem a great solution, because
Please let me know what you think! :)
yes that's exactly what I want :) I agree with the suggestion in the FR, you can add a different Perhaps the best solution long term is to move away from pre-compiled binaries (removing the Because essentially, the real hard things that [0] In fact, I find |
By default it actually has 2
A source file should only be in one
What do you consider to be "extra"? Each
You can name the targets whatever you want and provide whatever source globs you want, see https://docs.aspect.build/cli/help/directives/#javascript While configure can understand the outputs of any target, it can only generate attributes for targets it generates. So unfortunately if you want
I haven't looked at this in a long time but from what I can recall it wasn't that easy because |
What is the current behavior?
Hi,
I am using
rules_ts
with bazel, and by default it will create ats_project
rule for each.ts
file found in a directory. The same applies to test files ending in.spec.ts.
.This behavior can be modified to a limited extent using gazelle directives, but I don't see a way to get the behavior I want.
Describe the feature
I have a custom rule I want to use for tests. Nothing special, but it combines a
ts_project
for the test file with avitest
run fromload("@npm//:vitest/package_json.bzl", vitest_bin = "bin")
.So the idea is that I would be able to write
and that's all. I don't see how to get the behavior I want though.
aspect:map_kind
directive, because I want the substitutionts_project
->ts_test
to happen only for test files, not for every filetype (otherts
files should still use thets_project
rule).ts_project
behavior is not changes, so now I have both ats_test
rule and ats_project
rule, which is not what I wantts_test
dependencies. Here I just want to reuse the same logic fromts_project
, just set in a different macro - but I don't want to rewrite the whole 'parse file import to add dependencies' logic.So my question is - what can I do about this? I am very new to this space, so perhaps there's something obvious I am missing.
One thing that I think might work is to add a
gazelle
directive to specify which rule should be used for the.spec.ts
targets, so that I could set it to my own rule using theaspect:map_kind
directive and have everything else work as it is, without having to write a custom starlark pluginAnother idea would be exporting the whole logic as a starlark extension so one could change it without having to fork / recompile the CLI, but directly adding a new plugin.
Any help would be appreciated. Thanks a lot!
The text was updated successfully, but these errors were encountered: