-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(publish): error on invalid external imports (#22088)
- Loading branch information
1 parent
52ad1ef
commit 316093f
Showing
10 changed files
with
237 additions
and
39 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
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,32 @@ | ||
Download http://localhost:4545/welcome.ts | ||
Download http://localhost:4545/echo.ts | ||
Download http://localhost:4545/npm/registry/chalk | ||
Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz | ||
Checking fast check type graph for errors... | ||
Ensuring type checks... | ||
Check file://[WILDCARD]mod.ts | ||
error[invalid-external-import]: invalid import to a non-JSR 'http' specifier | ||
--> [WILDCARD]mod.ts:1:8 | ||
| | ||
1 | import "http://localhost:4545/welcome.ts"; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier | ||
= hint: replace this import with one from jsr or npm, or vendor the dependency into your package | ||
|
||
info: the import was resolved to 'http://localhost:4545/welcome.ts' | ||
info: this specifier is not allowed to be imported on jsr | ||
info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers | ||
docs: https://jsr.io/go/invalid-external-import | ||
|
||
error[invalid-external-import]: invalid import to a non-JSR 'http' specifier | ||
--> [WILDCARD]mod.ts:2:8 | ||
| | ||
2 | import "$echo"; | ||
| ^^^^^^^ the specifier | ||
= hint: replace this import with one from jsr or npm, or vendor the dependency into your package | ||
|
||
info: the import was resolved to 'http://localhost:4545/echo.ts' | ||
info: this specifier is not allowed to be imported on jsr | ||
info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers | ||
docs: https://jsr.io/go/invalid-external-import | ||
|
||
error: Found 2 problems |
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,10 @@ | ||
{ | ||
"name": "@foo/bar", | ||
"version": "1.0.0", | ||
"imports": { | ||
"$echo": "http://localhost:4545/echo.ts" | ||
}, | ||
"exports": { | ||
".": "./mod.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,9 @@ | ||
import "http://localhost:4545/welcome.ts"; | ||
import "$echo"; | ||
|
||
import "data:application/javascript,console.log(1)"; | ||
import "npm:chalk@5"; | ||
|
||
export function foobar(): string { | ||
return "string"; | ||
} |
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
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
Oops, something went wrong.