Skip to content

Commit e480be9

Browse files
committed
move to index.ts file
1 parent 2fc110f commit e480be9

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

package.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22
"name": "@npm/types",
33
"version": "1.0.2",
44
"description": "Typescript definitions for npm registry content",
5-
"types": "./src/index.d.ts",
6-
"main": "",
5+
"main": "./dist/commonjs/index.js",
6+
"types": "./dist/commonjs/index.d.ts",
7+
"exports": {
8+
"./package.json": "./package.json",
9+
".": {
10+
"import": {
11+
"types": "./dist/esm/index.d.ts",
12+
"default": "./dist/esm/index.js"
13+
},
14+
"require": {
15+
"types": "./dist/commonjs/index.d.ts",
16+
"default": "./dist/commonjs/index.js"
17+
}
18+
}
19+
},
720
"scripts": {
821
"template-oss-apply": "template-oss-apply --force",
922
"lintfix": "npm run lint -- --fix",
@@ -48,5 +61,11 @@
4861
"type": "module",
4962
"tap": {
5063
"typecheck": true
64+
},
65+
"tshy": {
66+
"exports": {
67+
"./package.json": "./package.json",
68+
".": "./src/index.ts"
69+
}
5170
}
5271
}
File renamed without changes.

test/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join, dirname } from 'path'
33
import { fileURLToPath } from 'url'
44
import t from 'tap'
55

6-
import type * as npm from '../src/index.d.ts'
6+
import type * as npm from '../src/index.ts'
77

88
t.test('types', async () => {
99
const dir = dirname(fileURLToPath(import.meta.url))

0 commit comments

Comments
 (0)