Skip to content
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

[Bug]: Gazelle extension should not generate targets for packages with only types #422

Closed
purkhusid opened this issue Apr 11, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@purkhusid
Copy link

What happened?

When the Gazelle extension encounters an folder with only type declarations it will generate an ts_project for the folder.
The issue is that ts_project does not support typecheck-only and fails with the following error when built:

Error in fail: ts_project target //src/nodejs/nextjs_bootstrap/src/nextjs_bootstrap:nextjs_bootstrap only has typings in srcs.
Since there is no `tsc` action to perform, there are no generated outputs.

> ts_project doesn't support "typecheck-only"; see https://github.com/aspect-build/rules_ts/issues/88

This should be changed to js_library, which can be done by running:

    buildozer 'new_load @aspect_rules_js//js:defs.bzl js_library' //src/nodejs/nextjs_bootstrap/src/nextjs_bootstrap:__pkg__
    buildozer 'set kind js_library' //src/nodejs/nextjs_bootstrap/src/nextjs_bootstrap:nextjs_bootstrap
    buildozer 'remove declaration' //src/nodejs/nextjs_bootstrap/src/nextjs_bootstrap:nextjs_bootstrap

Version

Development (host) and target OS/architectures:

Output of bazel --version: 6.1.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
rules_js: 1.24.0
rules_ts: 1.3.3
aspect-cli: Commit e95892c

Language(s) and/or frameworks involved:
Typescript

How to reproduce

Create an folder that only contains `d.ts` files with types and run the gazelle extension. Then build the generated target.

Any other information?

No response

@purkhusid purkhusid added the bug Something isn't working label Apr 11, 2023
@github-actions github-actions bot added the untriaged Requires traige label Apr 11, 2023
@jbedard jbedard self-assigned this Apr 12, 2023
@jbedard jbedard removed the untriaged Requires traige label Apr 12, 2023
@jbedard jbedard closed this as completed Jun 2, 2023
gregmagolan pushed a commit that referenced this issue Jun 2, 2023
Fix #422

GitOrigin-RevId: d009c6c127f4c4e887c2b523d9e1caf477c34183
gregmagolan pushed a commit that referenced this issue Jun 3, 2023
Fix #422

GitOrigin-RevId: d009c6c127f4c4e887c2b523d9e1caf477c34183
gregmagolan pushed a commit that referenced this issue Jun 3, 2023
Fix #422

GitOrigin-RevId: d009c6c127f4c4e887c2b523d9e1caf477c34183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants