-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(info): resolve bare specifier pointing to workspace member (#27020)
Fixes #26721 Previously, we were applying only the import map, which would result in `@scope/foo` expanding to (e.g.) `jsr:@scope/[email protected]`. Since that didn't exist it would error and fail to resolve.
- Loading branch information
1 parent
6a5dadf
commit 27757e8
Showing
14 changed files
with
120 additions
and
13 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
22 changes: 17 additions & 5 deletions
22
tests/specs/info/package_json_basic_auto_install/__test__.jsonc
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
{ | ||
"tempDir": true, | ||
"steps": [ | ||
{ | ||
"args": "info --quiet main.ts", | ||
"output": "info.out" | ||
"tests": { | ||
"resolves_npm_deps": { | ||
"steps": [ | ||
{ | ||
"args": "info --quiet main.ts", | ||
"output": "info.out" | ||
} | ||
] | ||
}, | ||
"bare_specifier": { | ||
"steps": [ | ||
{ | ||
"args": "info --quiet @denotest/esm-basic", | ||
"output": "info_bare.out" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/specs/info/package_json_basic_auto_install/info_bare.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,4 @@ | ||
dependencies: 0 unique | ||
size: 471B | ||
|
||
npm:/@denotest/[email protected] (471B) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"workspace": ["./member"] | ||
"workspace": ["./member", "./member2", "./member3"] | ||
} |
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,6 @@ | ||
local: [WILDCARD]mod.ts | ||
type: TypeScript | ||
dependencies: 0 unique | ||
size: [WILDCARD] | ||
|
||
file://[WILDCARD]member/mod.ts ([WILDCARD]) |
6 changes: 6 additions & 0 deletions
6
tests/specs/info/workspace_member/info_bare_specifier_package_json.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,6 @@ | ||
local: [WILDCARD]mod.ts | ||
type: TypeScript | ||
dependencies: 0 unique | ||
size: [WILDCARD] | ||
|
||
file://[WILDCARD]member3/mod.ts ([WILDCARD]) |
6 changes: 6 additions & 0 deletions
6
tests/specs/info/workspace_member/info_bare_specifier_package_json_subpath.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,6 @@ | ||
local: [WILDCARD]bar.ts | ||
type: TypeScript | ||
dependencies: 0 unique | ||
size: [WILDCARD] | ||
|
||
file://[WILDCARD]member3/bar.ts ([WILDCARD]) |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"name": "@denotest/workspace-member", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"foo": "./sub/file.ts" | ||
} | ||
|
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,3 @@ | ||
export function hi() { | ||
console.log("hi"); | ||
} |
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 @@ | ||
{} |
Empty file.
Empty file.
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,7 @@ | ||
{ | ||
"name": "@denotest/workspace-member-package-json", | ||
"exports": { | ||
".": "./mod.ts", | ||
"./foo": "./bar.ts" | ||
} | ||
} |