You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
In trying to write a packaging rule for all the typescript sources in a project, I was looking for a way to list all the typescript sources needed by a given ts_library.
I couldn't really find anything though. For example, rules_go has a documented set of providers. I was able to use GoArchive.transitive to place all the required files in a set of runfiles, for the packaging tool.
Is there something similar for rules_typescript? (Even if undocumented, I can bear the pain of updating my rules when things change ;))
The text was updated successfully, but these errors were encountered:
I aspire to have nice docs like that for providers. I've been investing in skydoc, I'll have to see if there's some way to generate such docs from sources.
Check out extra action listeners #54
and aspects as a couple of out-of-band ways to perform some action on all ts_library targets without needing to interact with outputs of the rule.
The reason I wanted them, was to be able to create a source tree, with all the original .ts and .tsx files, so I could run webpack on them.
I found a workaround though. Since I was using my own "ts_lib" macro, wrapping "ts_library" (so I didn't have to specify the tsconfig everywhere -- this was from the early days of rules_typescript, things may have changed now), I made my ts_lib macro not only wrap ts_library, but also a filegroup, which includes as srcs the sources of the ts_library, and also all the dependencies of the ts_library. This way, the :app ts_lib, also generate a :app_filegroup target, which includes all transitive dependencies. I can use this target as dependency for the genrule running webpack.
This worked great since I already had the ts_lib macro used everywhere. And in a way, I'm looking forward to getting rid of this as soon as rules_closure/rules_typescript are working together (#6) to build the prod js binary. Right now, I'm essentially building things twice, with webpack and with rules_typescript, which is a waste and slow.
Anyway, closing this. Feel free to keep as a feature request. I still think it would be nice to have the sources and transitive sources available. It can be useful for other tools. For example graphql-code-generator can search your sources for gql`` strings, and generate typings. -- The same trick above worked for that, but it would be a pain if I didn't already have this macro used everywhere.
In trying to write a packaging rule for all the typescript sources in a project, I was looking for a way to list all the typescript sources needed by a given ts_library.
I couldn't really find anything though. For example, rules_go has a documented set of providers. I was able to use GoArchive.transitive to place all the required files in a set of runfiles, for the packaging tool.
Is there something similar for rules_typescript? (Even if undocumented, I can bear the pain of updating my rules when things change ;))
The text was updated successfully, but these errors were encountered: