fix(publish): add node specifiers (#22213)

This commit is contained in:
Leo Kettmeir 2024-02-01 05:18:44 +01:00 committed by GitHub
parent 66e6ed65e9
commit e58b1900a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 32 additions and 1 deletions

View File

@ -101,6 +101,17 @@ itest!(successful {
http_server: true,
});
itest!(node_specifier {
args: "publish --token 'sadfasdf'",
output: "publish/node_specifier.out",
cwd: Some("publish/node_specifier"),
envs: env_vars_for_registry()
.into_iter()
.chain(env_vars_for_npm_tests().into_iter())
.collect(),
http_server: true,
});
itest!(config_file_jsonc {
args: "publish --token 'sadfasdf'",
output: "publish/deno_jsonc.out",

View File

@ -0,0 +1,8 @@
Checking fast check type graph for errors...
Ensuring type checks...
Download http://localhost:4545/npm/registry/@types/node
Download http://localhost:4545/npm/registry/@types/node/node-[WILDCARD].tgz
Check file:///[WILDCARD]/publish/node_specifier/mod.ts
Publishing @foo/bar@1.0.0 ...
Successfully published @foo/bar@1.0.0
Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details

View File

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

View File

@ -0,0 +1,5 @@
import "node:http";
export function foobar(): string {
return "string";
}

View File

@ -79,7 +79,7 @@ pub fn collect_invalid_external_imports(
|skip_specifiers: &mut HashSet<Url>, resolution: &ResolutionResolved| {
if visited.insert(resolution.specifier.clone()) {
match resolution.specifier.scheme() {
"file" | "data" => {}
"file" | "data" | "node" => {}
"jsr" | "npm" => {
skip_specifiers.insert(resolution.specifier.clone());
}