-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): support direct import of outputted dts files (#6977)
Things like package.json might import both the .d.ts and .js version of a file. Those can come from source .d.ts or .ts. --- ### Changes are visible to end-users: no ### Test plan - New test cases added GitOrigin-RevId: 500e11903f791b324a15c05ad2fca9a0a843a058
- Loading branch information
Showing
9 changed files
with
95 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# gazelle:js_package_rule_kind npm_package |
33 changes: 33 additions & 0 deletions
33
gazelle/js/tests/npm_package_deps_tsconfig/scenario1/BUILD.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("@aspect_rules_js//npm:defs.bzl", "npm_package") | ||
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
|
||
# gazelle:js_package_rule_kind npm_package | ||
|
||
npm_link_all_packages(name = "node_modules") | ||
|
||
ts_project( | ||
name = "tsc", | ||
srcs = [ | ||
"src/index.ts", | ||
"src/types/index.ts", | ||
], | ||
declaration = True, | ||
declaration_map = True, | ||
out_dir = "dist", | ||
root_dir = "src", | ||
tsconfig = ":tsconfig", | ||
) | ||
|
||
npm_package( | ||
name = "pkg", | ||
srcs = [ | ||
"package.json", | ||
":tsc", | ||
], | ||
) | ||
|
||
ts_config( | ||
name = "tsconfig", | ||
src = "tsconfig.json", | ||
) |
9 changes: 9 additions & 0 deletions
9
gazelle/js/tests/npm_package_deps_tsconfig/scenario1/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "scenario1", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./types": "./dist/types/index.d.ts" | ||
} | ||
} |
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions
12
gazelle/js/tests/npm_package_deps_tsconfig/scenario1/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"experimentalDecorators": true, | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"isolatedModules": false, | ||
"declaration": true, | ||
"declarationMap": true | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules"] | ||
} |