Skip to content

Commit cda3e4c

Browse files
committed
chore: add missing typings
1 parent 5d9920f commit cda3e4c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
"description": "Detects animated images in browser & node. Supports GIT, APNG & WebP",
55
"sideEffects": false,
66
"exports": {
7-
"default": "./src/index.mjs"
7+
"default": "./src/index.mjs",
8+
"types": "./dist/index.d.ts"
89
},
910
"main": "./src/index.mjs",
10-
"module": "./src/index.mjs",
11+
"types": "./dist/index.d.ts",
12+
"module": "./dist/index.mjs",
1113
"unpkg": "./dist/is-animated.umd.js",
1214
"scripts": {
13-
"typecheck": "tsc --project tsconfig.json",
15+
"typecheck": "tsc --project tsconfig.json --noEmit",
1416
"start": "pnpm clean && concurrently \"microbundle watch -i ./src/index.mjs -o docs -f umd\" \"node ./scripts/build-docs.mjs --watch\" \"serve docs\"",
15-
"build": "pnpm clean && microbundle -i ./src/index.mjs -o dist -f umd && microbundle -i ./src/index.mjs -o docs -f umd && node ./scripts/build-docs.mjs",
17+
"build": "pnpm clean && microbundle -i ./src/index.mjs -o dist -f umd --no-sourcemap && microbundle -i ./src/index.mjs -o docs -f umd && node ./scripts/build-docs.mjs && tsc --project tsconfig.json --declaration --emitDeclarationOnly && node ./scripts/postbuild.mjs",
1618
"lint": "eslint . --max-warnings 0 && prettier --check .",
1719
"fix": "eslint . --fix && prettier --write .",
1820
"release": "semantic-release",

scripts/postbuild.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { writeFileSync } from 'node:fs';
2+
import { resolve } from 'node:path';
3+
4+
writeFileSync(
5+
resolve(import.meta.dirname, '..', 'dist', 'is-animated.umd.d.ts'),
6+
"export * from './index.d.mts';",
7+
{ encoding: 'utf-8' },
8+
);

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ESNext",
4+
"outDir": "./dist",
45
"lib": ["ESNext", "dom"],
56
"strict": true,
67
"strictFunctionTypes": true,
@@ -15,8 +16,7 @@
1516
"moduleResolution": "Node16",
1617
"checkJs": true,
1718
"allowJs": true,
18-
"skipLibCheck": true,
19-
"noEmit": true
19+
"skipLibCheck": true
2020
},
2121
"include": ["src/**/*.mjs", "src/index.mjs"]
2222
}

0 commit comments

Comments
 (0)