mirror of
https://github.com/denoland/deno
synced 2024-08-28 20:39:51 +00:00
fix(publish): add node specifiers (#22213)
This commit is contained in:
parent
66e6ed65e9
commit
e58b1900a7
|
@ -101,6 +101,17 @@ itest!(successful {
|
||||||
http_server: true,
|
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 {
|
itest!(config_file_jsonc {
|
||||||
args: "publish --token 'sadfasdf'",
|
args: "publish --token 'sadfasdf'",
|
||||||
output: "publish/deno_jsonc.out",
|
output: "publish/deno_jsonc.out",
|
||||||
|
|
8
cli/tests/testdata/publish/node_specifier.out
vendored
Normal file
8
cli/tests/testdata/publish/node_specifier.out
vendored
Normal 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
|
7
cli/tests/testdata/publish/node_specifier/deno.json
vendored
Normal file
7
cli/tests/testdata/publish/node_specifier/deno.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"name": "@foo/bar",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"exports": {
|
||||||
|
".": "./mod.ts"
|
||||||
|
}
|
||||||
|
}
|
5
cli/tests/testdata/publish/node_specifier/mod.ts
vendored
Normal file
5
cli/tests/testdata/publish/node_specifier/mod.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import "node:http";
|
||||||
|
|
||||||
|
export function foobar(): string {
|
||||||
|
return "string";
|
||||||
|
}
|
|
@ -79,7 +79,7 @@ pub fn collect_invalid_external_imports(
|
||||||
|skip_specifiers: &mut HashSet<Url>, resolution: &ResolutionResolved| {
|
|skip_specifiers: &mut HashSet<Url>, resolution: &ResolutionResolved| {
|
||||||
if visited.insert(resolution.specifier.clone()) {
|
if visited.insert(resolution.specifier.clone()) {
|
||||||
match resolution.specifier.scheme() {
|
match resolution.specifier.scheme() {
|
||||||
"file" | "data" => {}
|
"file" | "data" | "node" => {}
|
||||||
"jsr" | "npm" => {
|
"jsr" | "npm" => {
|
||||||
skip_specifiers.insert(resolution.specifier.clone());
|
skip_specifiers.insert(resolution.specifier.clone());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue