aspect-build / aspect-build/rules_ts

[Bug]: copy_files = True for ts_proto_library doesn't copy d.ts files to source tree

Open
#545 6 comments 3 reactions 0 assignees View on GitHub
bug need: repro
Dominant language
Starlark
Stars
138
Forks
87
Avg merge
2d 8h
Merged PRs (30d)
3

Description

### What happened?

Read that `ts_proto_library` copy generated files automaticly to source tree: https://github.com/aspect-build/rules_ts/blob/main/ts/proto.bzl#L59

> copy_files: whether to copy the resulting .d.ts files back to the source tree, for the editor to locate them.

But that behaviour doesn't work in `rule_ts` examples

### Version

Development (host) and target OS/architectures: MacOS, darwin_arm64

Output of `bazel --version`: aspect 5.8.19

Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
Reproducing in source code of https://github.com/aspect-build/rules_ts/

Language(s) and/or frameworks involved:
Reproducing in source code of https://github.com/aspect-build/rules_ts/

### How to reproduce

```shell
1 - git clone https://github.com/aspect-build/rules_ts.git
2 - cd rules_ts/examples/proto_grpc
3 - rm -rf logger_connect.d.ts logger_pb.d.ts
4 - bazel build proto_grpc

Expected:
logger_connect.d.ts logger_pb.d.ts was copied from `output`

Actual:
Nothing was copied

INFO: Analyzed target //examples/proto_grpc:proto_grpc (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //examples/proto_grpc:proto_grpc up-to-date:
bazel-bin/examples/proto_grpc/main.js
INFO: Elapsed time: 0.143s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
```
```

### Any other information?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at ts/proto.bzl#L59 and reproduce the behavior from examples/proto_grpc by removing logger_connect.d.ts and logger_pb.d.ts, then building //examples/proto_grpc:proto_grpc. Trace why the generated declaration files are not copied back to the source tree; done means both files are restored after a successful build.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.