fix(npm/check): prioritize exports over types entry (#16788)

This commit is contained in:
David Sherret 2022-11-24 12:07:36 -05:00 committed by GitHub
parent 04afc06b00
commit b6f49cf479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 17 deletions

View file

@ -3,6 +3,5 @@ Download http://localhost:4545/npm/registry/@types/node
Download http://localhost:4545/npm/registry/@denotest/globals/1.0.0.tgz
Download http://localhost:4545/npm/registry/@types/node/node-18.8.2.tgz
Check file:///[WILDCARD]/npm/compare_globals/main.ts
Check file:///[WILDCARD]/std/node/module_all.ts
true
[]

View file

@ -1,6 +1,5 @@
Download http://localhost:4545/npm/registry/chalk
Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz
Check [WILDCARD]/std/node/module_all.ts
running 1 test from ./npm/esm/test.js
test ...
------- output -------

View file

@ -1,5 +1,4 @@
Download http://localhost:4545/npm/registry/@denotest/no-types-in-conditional-exports
Download http://localhost:4545/npm/registry/@denotest/no-types-in-conditional-exports/1.0.0.tgz
Check [WILDCARD]npm/no_types_in_conditional_exports/main.ts
[WILDCARD]
{ foo: "bar" }

View file

@ -0,0 +1 @@
export function getValue(): 5;

View file

@ -0,0 +1 @@
module.exports.getValue = () => 5;

View file

@ -0,0 +1,13 @@
{
"name": "@denotest/types-entry-value-not-exists",
"version": "1.0.0",
"main": "./dist/main.js",
"types": "./index.d.ts",
"exports": {
".": {
"types": "./dist/main.d.ts",
"node": "./dist/main.js",
"require": "./dist/main.js"
}
}
}

View file

@ -0,0 +1,4 @@
Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists
Download http://localhost:4545/npm/registry/@denotest/types-entry-value-not-exists/1.0.0.tgz
Check file://[WILDCARD]/types_entry_value_not_exists/main.ts
5

View file

@ -0,0 +1,4 @@
import { getValue } from "npm:@denotest/types-entry-value-not-exists";
const result: 5 = getValue();
console.log(result);