From 823a5f60151f71846468205f70115d862586b0aa Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 24 Nov 2022 13:13:51 -0500 Subject: fix(npm/types): resolve main entrypoint declaration file when no types entry (#16791) Closes #16782 --- .../npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.d.ts | 1 + .../npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.js | 1 + .../npm/registry/@denotest/types-no-types-entry/1.0.0/package.json | 5 +++++ cli/tests/testdata/npm/types_no_types_entry/main.out | 4 ++++ cli/tests/testdata/npm/types_no_types_entry/main.ts | 4 ++++ 5 files changed, 15 insertions(+) create mode 100644 cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.d.ts create mode 100644 cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.js create mode 100644 cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/package.json create mode 100644 cli/tests/testdata/npm/types_no_types_entry/main.out create mode 100644 cli/tests/testdata/npm/types_no_types_entry/main.ts (limited to 'cli/tests/testdata') diff --git a/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.d.ts b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.d.ts new file mode 100644 index 000000000..2341a14f0 --- /dev/null +++ b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.d.ts @@ -0,0 +1 @@ +export function getValue(): 5; diff --git a/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.js b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.js new file mode 100644 index 000000000..d0c5dbc70 --- /dev/null +++ b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/dist/main.js @@ -0,0 +1 @@ +module.exports.getValue = () => 5; diff --git a/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/package.json new file mode 100644 index 000000000..377af2bae --- /dev/null +++ b/cli/tests/testdata/npm/registry/@denotest/types-no-types-entry/1.0.0/package.json @@ -0,0 +1,5 @@ +{ + "name": "@denotest/types-no-types-entry", + "version": "1.0.0", + "main": "./dist/main.js" +} diff --git a/cli/tests/testdata/npm/types_no_types_entry/main.out b/cli/tests/testdata/npm/types_no_types_entry/main.out new file mode 100644 index 000000000..6c5d45222 --- /dev/null +++ b/cli/tests/testdata/npm/types_no_types_entry/main.out @@ -0,0 +1,4 @@ +Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry +Download http://localhost:4545/npm/registry/@denotest/types-no-types-entry/1.0.0.tgz +Check file://[WILDCARD]/types_no_types_entry/main.ts +5 diff --git a/cli/tests/testdata/npm/types_no_types_entry/main.ts b/cli/tests/testdata/npm/types_no_types_entry/main.ts new file mode 100644 index 000000000..15e060402 --- /dev/null +++ b/cli/tests/testdata/npm/types_no_types_entry/main.ts @@ -0,0 +1,4 @@ +import { getValue } from "npm:@denotest/types-no-types-entry"; + +const result: 5 = getValue(); +console.log(result); -- cgit v1.2.3