Skip to content

Commit

Permalink
fix(template): api type declaration merging for scripts (#11367)
Browse files Browse the repository at this point in the history
Make imports in scripts (files in `scripts/`) find our mirror types used
for declaration merging also for `api/src/` imports (not just web
imports)
  • Loading branch information
Tobbe authored Aug 30, 2024
1 parent 6635e2e commit 327ffc2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changesets/11367.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- fix(template): api type declaration merging for scripts (#11367) by @Tobbe

Make imports in scripts (files in `scripts/`) find our mirror types used for declaration merging also for `api/src/` imports (not just web imports)

Users upgrading are adviced to manually upgrade their tsconfig files to match
what is now in the template.
2 changes: 2 additions & 0 deletions __fixtures__/test-project/scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"paths": {
"$api/*": ["../api/*"],
"api/*": ["../api/*"],
"$api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"$web/*": ["../web/*"],
"web/*": ["../web/*"],
"$web/src/*": ["../web/src/*", "../.redwood/types/mirror/web/src/*"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"paths": {
"$api/*": ["../api/*"],
"api/*": ["../api/*"],
"$api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"$web/*": ["../web/*"],
"web/*": ["../web/*"],
"$web/src/*": ["../web/src/*", "../.redwood/types/mirror/web/src/*"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"paths": {
"$api/*": ["../api/*"],
"api/*": ["../api/*"],
"$api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"api/src/*": ["../api/src/*", "../.redwood/types/mirror/api/src/*"],
"$web/*": ["../web/*"],
"web/*": ["../web/*"],
"$web/src/*": ["../web/src/*", "../.redwood/types/mirror/web/src/*"],
Expand Down

0 comments on commit 327ffc2

Please sign in to comment.