Skip to content

ts_project tsconfig attr should be able to take ts_config labels #1931

Closed

Description

@vpanta

🚀 feature request

Relevant Rules

ts_project

Description

ts_project has a tsconfig attribute which expects a json file name, and for the transitive set of parent config files to be provided via the extends attribute. Meanwhile, if the tsconfig attribute accepted a ts_config definition, which already contains the transitive set of parent configs, then the extends attribute would be unnecessary.

Describe the solution you'd like

Take advantage of the pre-existing ts_config rule (and TsConfigInfo provider) so we don't need to manage our own list of transitive deps in the extends attribute.

Describe alternatives you've considered

For the given set of rules, no, as I don't think this requires any new rules. I will say that there might be a reason this doesn't exist to begin with, but I don't have that knowledge myself.

Activity

  1. alexeagle commented on Jun 4, 2020

    @alexeagle
    Collaborator

    Yeah I think this makes sense. IIRC I didn't do it this way originally just to keep ts_project simple, and because there's no generated tsconfig.json file involved. But this would be an optional way to supply a list of tsconfig files through that provider you point to. Maybe a wrinkle here is we need to know which one to pass to tsc with -p flag, so I think the TsConfigInfo might need to change to have a direct project and then a depset of transitive ones.

  2. added 2 commits that reference this issue on Aug 24, 2020
    26451b0
    23111d2
  3. alexeagle commented on Aug 24, 2020

    @alexeagle
    Collaborator

    Not a problem to know which one to pass with -p since it has a DefaultInfo with just the relevant top-level tsconfig we can use ctx.file.tsconfig to get it.

  4. added a commit that references this issue on Jan 6, 2021
    91ad116
  5. added a commit that references this issue on Jan 15, 2021
    9671291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions