test(publish): check specifiers outside fast check module graph (#23369)

Closes #23023
This commit is contained in:
Asher Gomez 2024-04-18 09:46:33 +10:00 committed by GitHub
parent 24fa5c784a
commit 25a80bc523
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{
"args": "publish --dry-run",
"output": "main.out",
"exitCode": 1
}

View file

@ -0,0 +1,5 @@
{
"name": "@example/foo",
"version": "1.0.0",
"exports": "./mod.ts"
}

View file

@ -0,0 +1 @@
export * from "https://deno.land/std/assert/assert.ts";

View file

@ -0,0 +1,17 @@
[WILDCARD]
Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts
Checking for slow types in the public API...
Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts
error[invalid-external-import]: invalid import to a non-JSR 'https' specifier
--> [WILDLINE]deps.ts:1:15
|
1 | export * from "https://deno.land/std/assert/assert.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 'https://deno.land/std/assert/assert.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 1 problem

View file

@ -0,0 +1,5 @@
export * from "./subtract.ts";
export function add(a: number, b: number): number {
return a + b;
}

View file

@ -0,0 +1,5 @@
import * as blah from "./deps.ts";
export function subtract(a: number, b: number): number {
return a - b;
}