From f396b3d1c8aaa7bf40fb1960f9ec81c3708ea2a8 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 4 Jul 2024 20:41:01 -0400 Subject: fix(publish): unfurling should always be done with the package json (#24435) Closes https://github.com/denoland/deno/issues/24430 --- tests/specs/publish/byonm_with_package_json/__test__.jsonc | 13 +++++++++++++ tests/specs/publish/byonm_with_package_json/jsr.json | 12 ++++++++++++ tests/specs/publish/byonm_with_package_json/package.json | 8 ++++++++ tests/specs/publish/byonm_with_package_json/publish.out | 3 +++ tests/specs/publish/byonm_with_package_json/src/index.ts | 3 +++ 5 files changed, 39 insertions(+) create mode 100644 tests/specs/publish/byonm_with_package_json/__test__.jsonc create mode 100644 tests/specs/publish/byonm_with_package_json/jsr.json create mode 100644 tests/specs/publish/byonm_with_package_json/package.json create mode 100644 tests/specs/publish/byonm_with_package_json/publish.out create mode 100644 tests/specs/publish/byonm_with_package_json/src/index.ts (limited to 'tests') diff --git a/tests/specs/publish/byonm_with_package_json/__test__.jsonc b/tests/specs/publish/byonm_with_package_json/__test__.jsonc new file mode 100644 index 000000000..77c23bae1 --- /dev/null +++ b/tests/specs/publish/byonm_with_package_json/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "envs": { + "DENO_FUTURE": "1" + }, + "tempDir": true, + "steps": [{ + "args": "install", + "output": "[WILDCARD]" + }, { + "args": "publish --log-level=debug --dry-run --allow-dirty", + "output": "publish.out" + }] +} diff --git a/tests/specs/publish/byonm_with_package_json/jsr.json b/tests/specs/publish/byonm_with_package_json/jsr.json new file mode 100644 index 000000000..c92b1a60c --- /dev/null +++ b/tests/specs/publish/byonm_with_package_json/jsr.json @@ -0,0 +1,12 @@ +{ + "name": "@scope/package", + "version": "0.0.0", + "exports": { + ".": "./src/index.ts" + }, + "publish": { + "include": [ + "src/**/*" + ] + } +} diff --git a/tests/specs/publish/byonm_with_package_json/package.json b/tests/specs/publish/byonm_with_package_json/package.json new file mode 100644 index 000000000..eb93c075e --- /dev/null +++ b/tests/specs/publish/byonm_with_package_json/package.json @@ -0,0 +1,8 @@ +{ + "name": "@scope/pkg", + "module": "src/index.ts", + "type": "module", + "dependencies": { + "@denotest/add": "1" + } +} diff --git a/tests/specs/publish/byonm_with_package_json/publish.out b/tests/specs/publish/byonm_with_package_json/publish.out new file mode 100644 index 000000000..6ce644bac --- /dev/null +++ b/tests/specs/publish/byonm_with_package_json/publish.out @@ -0,0 +1,3 @@ +[WILDCARD]Unfurled specifier: @denotest/add from [WILDLINE]/src/index.ts -> npm:@denotest/add@1 +[WILDCARD] +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/byonm_with_package_json/src/index.ts b/tests/specs/publish/byonm_with_package_json/src/index.ts new file mode 100644 index 000000000..1ca631410 --- /dev/null +++ b/tests/specs/publish/byonm_with_package_json/src/index.ts @@ -0,0 +1,3 @@ +import { add } from "@denotest/add"; + +console.log(add(1, 2)); -- cgit v1.2.3