From b8ed6f822174b2322fbe9f8b58698b76b5505b4a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 3 Sep 2024 15:56:39 +0200 Subject: fix(task): correct name for scoped npm package binaries (#25390) This is for when not using a node_modules directory or when using auto install for a node_modules dir. --- tests/specs/task/bin_pkg_with_scope_auto/__test__.jsonc | 5 +++++ tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out | 14 ++++++++++++++ tests/specs/task/bin_pkg_with_scope_auto/bin_none.out | 12 ++++++++++++ tests/specs/task/bin_pkg_with_scope_auto/deno.json | 3 +++ tests/specs/task/bin_pkg_with_scope_auto/package.json | 9 +++++++++ tests/specs/task/bin_pkg_with_scope_none/__test__.jsonc | 5 +++++ tests/specs/task/bin_pkg_with_scope_none/bin_none.out | 12 ++++++++++++ tests/specs/task/bin_pkg_with_scope_none/deno.json | 3 +++ tests/specs/task/bin_pkg_with_scope_none/package.json | 9 +++++++++ 9 files changed, 72 insertions(+) create mode 100644 tests/specs/task/bin_pkg_with_scope_auto/__test__.jsonc create mode 100644 tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out create mode 100644 tests/specs/task/bin_pkg_with_scope_auto/bin_none.out create mode 100644 tests/specs/task/bin_pkg_with_scope_auto/deno.json create mode 100644 tests/specs/task/bin_pkg_with_scope_auto/package.json create mode 100644 tests/specs/task/bin_pkg_with_scope_none/__test__.jsonc create mode 100644 tests/specs/task/bin_pkg_with_scope_none/bin_none.out create mode 100644 tests/specs/task/bin_pkg_with_scope_none/deno.json create mode 100644 tests/specs/task/bin_pkg_with_scope_none/package.json (limited to 'tests') diff --git a/tests/specs/task/bin_pkg_with_scope_auto/__test__.jsonc b/tests/specs/task/bin_pkg_with_scope_auto/__test__.jsonc new file mode 100644 index 000000000..2e126f6b1 --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_auto/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "task bin extra", + "output": "bin_auto.out" +} diff --git a/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out b/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out new file mode 100644 index 000000000..20865898e --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_auto/bin_auto.out @@ -0,0 +1,14 @@ +Download http://localhost:4260/@denotest/bin +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/0.5.0.tgz +Initialize @denotest/bin@0.5.0 +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Initialize @denotest/bin@1.0.0 +[UNORDERED_END] +Task bin bin hi && cli-esm testing this out && npx cli-cjs test "extra" +hi +testing +this +out +test +extra diff --git a/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out b/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out new file mode 100644 index 000000000..066c67bd8 --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_auto/bin_none.out @@ -0,0 +1,12 @@ +Download http://localhost:4260/@denotest/bin +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/0.5.0.tgz +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +[UNORDERED_END] +Task bin bin hi && cli-esm testing this out && npx cli-cjs test "extra" +hi +testing +this +out +test +extra diff --git a/tests/specs/task/bin_pkg_with_scope_auto/deno.json b/tests/specs/task/bin_pkg_with_scope_auto/deno.json new file mode 100644 index 000000000..fbd70ec48 --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_auto/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "auto" +} diff --git a/tests/specs/task/bin_pkg_with_scope_auto/package.json b/tests/specs/task/bin_pkg_with_scope_auto/package.json new file mode 100644 index 000000000..2ee4c2bbb --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_auto/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "bin": "bin hi && cli-esm testing this out && npx cli-cjs test" + }, + "dependencies": { + "@denotest/bin": "0.5", + "other": "npm:@denotest/bin@1.0" + } +} diff --git a/tests/specs/task/bin_pkg_with_scope_none/__test__.jsonc b/tests/specs/task/bin_pkg_with_scope_none/__test__.jsonc new file mode 100644 index 000000000..9f88b275f --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_none/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "tempDir": true, + "args": "task bin extra", + "output": "bin_none.out" +} diff --git a/tests/specs/task/bin_pkg_with_scope_none/bin_none.out b/tests/specs/task/bin_pkg_with_scope_none/bin_none.out new file mode 100644 index 000000000..066c67bd8 --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_none/bin_none.out @@ -0,0 +1,12 @@ +Download http://localhost:4260/@denotest/bin +[UNORDERED_START] +Download http://localhost:4260/@denotest/bin/0.5.0.tgz +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +[UNORDERED_END] +Task bin bin hi && cli-esm testing this out && npx cli-cjs test "extra" +hi +testing +this +out +test +extra diff --git a/tests/specs/task/bin_pkg_with_scope_none/deno.json b/tests/specs/task/bin_pkg_with_scope_none/deno.json new file mode 100644 index 000000000..38af4024b --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_none/deno.json @@ -0,0 +1,3 @@ +{ + "nodeModulesDir": "none" +} diff --git a/tests/specs/task/bin_pkg_with_scope_none/package.json b/tests/specs/task/bin_pkg_with_scope_none/package.json new file mode 100644 index 000000000..2ee4c2bbb --- /dev/null +++ b/tests/specs/task/bin_pkg_with_scope_none/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "bin": "bin hi && cli-esm testing this out && npx cli-cjs test" + }, + "dependencies": { + "@denotest/bin": "0.5", + "other": "npm:@denotest/bin@1.0" + } +} -- cgit v1.2.3