From c58a628e2ff449f8cbbdcd6bb8baeaba1ea95a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 4 Sep 2024 13:55:30 +0100 Subject: feat(add): strip package subpath when adding a package (#25419) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These now works: ``` $ deno add @std/dotenv/load $ deno add npm:preact/hooks ``` Previously we were erroring out, because this is a "package reference" including a subpath. Closes https://github.com/denoland/deno/issues/25385 --------- Signed-off-by: Bartek IwaƄczuk Co-authored-by: David Sherret --- tests/specs/add/add_with_subpath/wrong_constraint_npm.out | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/specs/add/add_with_subpath/wrong_constraint_npm.out (limited to 'tests/specs/add/add_with_subpath/wrong_constraint_npm.out') diff --git a/tests/specs/add/add_with_subpath/wrong_constraint_npm.out b/tests/specs/add/add_with_subpath/wrong_constraint_npm.out new file mode 100644 index 000000000..4adcf9ef6 --- /dev/null +++ b/tests/specs/add/add_with_subpath/wrong_constraint_npm.out @@ -0,0 +1,4 @@ +error: Failed to parse package required: npm:preact/hooks@10 + +Caused by: + Invalid package specifier 'npm:preact/hooks@10'. Did you mean to write 'npm:preact@10/hooks'? -- cgit v1.2.3