Skip to content

Commit

Permalink
fix(publish): add node specifiers (denoland#22213)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Feb 1, 2024
1 parent 66e6ed6 commit e58b190
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cli/tests/integration/publish_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions cli/tests/testdata/publish/node_specifier.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Checking fast check type graph for errors...
Ensuring type checks...
Download http:https://localhost:4545/npm/registry/@types/node
Download http:https://localhost:4545/npm/registry/@types/node/node-[WILDCARD].tgz
Check file:https:///[WILDCARD]/publish/node_specifier/mod.ts
Publishing @foo/[email protected] ...
Successfully published @foo/[email protected]
Visit http:https://127.0.0.1:4250/@foo/[email protected] for details
7 changes: 7 additions & 0 deletions cli/tests/testdata/publish/node_specifier/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@foo/bar",
"version": "1.0.0",
"exports": {
".": "./mod.ts"
}
}
5 changes: 5 additions & 0 deletions cli/tests/testdata/publish/node_specifier/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "node:http";

export function foobar(): string {
return "string";
}
2 changes: 1 addition & 1 deletion cli/tools/registry/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit e58b190

Please sign in to comment.