benchsci / rules_nodejs_gazelle

Build file generation is provided as a plugin for gazelle
Apache License 2.0
22 stars 11 forks source link

Supported versions of rules_jest and aspect_rules_ts #58

Open tomasz-wozniak75 opened 5 months ago

tomasz-wozniak75 commented 5 months ago

Hi This is more question than issue, I'm trying to convert TS project created by someone else to Bazel using this gazelle plugin. First result looks good but I'm facing few problems:

  1. Generated code depends on external libraries like rules_jest or aspect_rules_ts it would be good to have for each release, versions of these deps or at least for the most recent plugin version
  2. rules_jest has breaking change in version 0.17.0 and I see that generated code is for earlier versions, do you plan to support rules_jest never versions ?
  3. In the project there are index files with extension tsx which are excluded by plugin. I would like to confirm that tsx files are not allowed for index file or this condition was created for earlier TS spec.
  4. When I'm trying to build ts_project I'm getting an error which stack trace which I will paste below, This error could be caused cos I have newer version of aspect_rules_ts or there is some problem in the gazelle config, could you advice?

    ERROR: Traceback (most recent call last): File "/Users/tomaszw/Desktop/projects/bp/bp-digital/Integration_and_RPA/bp-ihub-root/frontend-apps/bp-integrationhub-ui/src/components/template-subscriptions/BUILD.bazel", line 4, column 11, in <toplevel> ts_project( File "/private/var/tmp/_bazel_tomaszw/05754fe7a642186c1336102808a46c85/external/aspect_rules_ts/ts/defs.bzl", line 276, column 17, in ts_project fail("No tsconfig.json file found in {}/. You must set the tsconfig attribute on {}.".format( Error in fail: No tsconfig.json file found in frontend-apps/bp-integrationhub-ui/src/components/template-subscriptions/. You must set the tsconfig attribute on @//frontend-apps/bp-integrationhub-ui/src/components/template-subscriptions:template-subscriptions. Thanks Tomasz

tomasz-wozniak75 commented 5 months ago

Hi Problem with tsconfig is caused by ts_project which requires tsconfig attribute, I solved this temporally by custom macro and map_kind directive, in marco I'm adding missing filed but we need directive to pass tsconfig like it is done for jest_config because now I'm able to hardcode path to only single value I think.

Issue with jest_test I will be able to solve also by macro and map_kind and here I can wait for this change until it will be implemented no rush.