Skip to content

Commit 9604e39

Browse files
committed
fix: emit cts types
1 parent 6abecc3 commit 9604e39

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ jobs:
173173
env:
174174
CYPRESS_INSTALL_BINARY: 0
175175

176-
- name: Build types
177-
run: pnpm run build:types
178-
179176
- name: Check scripts
180177
run: pnpm run ts-check
181178

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ This is a shorthand for running the following scripts in order:
2424
- `pnpm run lint` - runs [ESLint](https://github.com/eslint/eslint) to enforce project code standards
2525
- `pnpm run build:clean` - removes artifacts from previous builds
2626
- `pnpm run build:code` - builds the code, both CommonJS and ESM versions
27-
- `pnpm run build:types` - builds the TypeScript type definitions
2827
- `pnpm run test:update-snapshots` - runs all tests, and updates any snapshots if needed
2928
- `pnpm run ts-check` - checks that there are no TypeScript errors in any files
3029

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,26 @@
3232
"type": "module",
3333
"main": "dist/index.cjs",
3434
"module": "dist/index.js",
35-
"types": "index.d.ts",
36-
"typesVersions": {
37-
">=5.0": {
38-
"*": [
39-
"dist/types/*"
40-
]
41-
}
42-
},
4335
"exports": {
4436
".": {
45-
"types": "./dist/types/index.d.ts",
46-
"import": "./dist/index.js",
47-
"require": "./dist/index.cjs",
48-
"default": "./dist/index.js"
37+
"require": {
38+
"types": "./dist/index.d.cts",
39+
"default": "./dist/index.cjs"
40+
},
41+
"default": {
42+
"types": "./dist/index.d.ts",
43+
"default": "./dist/index.js"
44+
}
4945
},
5046
"./locale/*": {
51-
"types": "./dist/types/locale/*.d.ts",
52-
"import": "./dist/locale/*.js",
53-
"require": "./dist/locale/*.cjs",
54-
"default": "./dist/locale/*.js"
47+
"require": {
48+
"types": "./dist/locale/*.d.cts",
49+
"default": "./dist/locale/*.cjs"
50+
},
51+
"default": {
52+
"types": "./dist/locale/*.d.ts",
53+
"default": "./dist/locale/*.js"
54+
}
5555
},
5656
"./package.json": "./package.json"
5757
},
@@ -63,8 +63,7 @@
6363
"clean": "rimraf coverage .eslintcache dist docs/.vitepress/cache docs/.vitepress/dist node_modules",
6464
"build:clean": "rimraf dist",
6565
"build:code": "tsup-node",
66-
"build:types": "tsc --project tsconfig.build.json",
67-
"build": "run-s build:clean build:code build:types",
66+
"build": "run-s build:clean build:code",
6867
"generate": "run-s generate:locales generate:api-docs",
6968
"generate:api-docs": "tsx ./scripts/apidocs.ts",
7069
"generate:locales": "tsx ./scripts/generate-locales.ts",

scripts/apidocs/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { Project } from 'ts-morph';
44
export function getProject(options: Partial<ProjectOptions> = {}): Project {
55
return new Project({
66
...options,
7-
tsConfigFilePath: options.tsConfigFilePath ?? 'tsconfig.build.json',
7+
tsConfigFilePath: options.tsConfigFilePath ?? 'tsconfig.json',
88
});
99
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ESNext",
4-
"moduleResolution": "node",
4+
"moduleResolution": "Node",
55
"module": "ESNext",
66
"strict": true,
77
"noEmit": true,

tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineConfig({
1010
clean: true,
1111
format: ['esm', 'cjs'],
1212
target: ['es2022', 'node18'],
13-
dts: false, // will be generated with the "build:types" script
13+
dts: true,
1414
minify: true,
1515
sourcemap: false,
1616
splitting: true,

0 commit comments

Comments
 (0)