Skip to content

Commit e9bea93

Browse files
authored
fix types (#77)
`.d.ts` files need to exist next to `.js` files for them to be auto detected by Typescript. Placing type files in their own directory only works when there is only a single types file or when using `exports`.
1 parent 5443ae0 commit e9bea93

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
44

5+
#### v5.2.1
6+
7+
- Fix location of `.d.ts` files so that `sources.d.ts` is correctly detected.
8+
59
#### v5.2.0
610

711
- Add `set-methods` polyfills [`#40`](https://github.com/mrhenry/polyfill-library/pull/40) by @mhassan1

types/index.d.ts lib/index.d.ts

File renamed without changes.
File renamed without changes.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@mrhenry/polyfill-library",
3-
"version": "5.2.0",
3+
"version": "5.2.1",
44
"description": "A polyfill combinator",
55
"main": "lib/index.js",
6-
"types": "types/index.d.ts",
6+
"types": "lib/index.d.ts",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/mrhenry/polyfill-library.git"
@@ -19,7 +19,7 @@
1919
"lint-config": "node tasks/lint-config/index.js",
2020
"clean": "node tasks/clean",
2121
"build": "npm run clean && node tasks/updatesources && node tasks/buildsources/buildsources && npm run build-types",
22-
"build-types": "tsc lib/*.js --declaration --allowJs --emitDeclarationOnly --outDir types",
22+
"build-types": "tsc lib/*.js --declaration --allowJs --emitDeclarationOnly --outDir lib",
2323
"watch": "npm run clean && node tasks/updatesources && node tasks/buildsources/watchsource",
2424
"fmt": "eslint . --fix",
2525
"test-end-to-end": "node --test 'test/end-to-end/**/*.test.js'",

tasks/clean.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const cwd = path.join(__dirname, '../');
99
const globOptions = { cwd: cwd };
1010

1111
console.log('Cleaning dist...');
12-
fs.rmSync('./polyfills/__dist', { recursive: true, force: true });
12+
fs.rmSync(path.join('polyfills', '__dist'), { recursive: true, force: true });
1313

1414
console.log('Cleaning types...');
15-
fs.rmSync('./types', { recursive: true, force: true });
15+
fs.rmSync(path.join('lib', 'index.d.ts'), { recursive: true, force: true });
16+
fs.rmSync(path.join('lib', 'sources.d.ts'), { recursive: true, force: true });
1617

1718
console.log('Cleaning polyfills...');
1819
glob('polyfills/**/config.toml', globOptions).then((files) => {

0 commit comments

Comments
 (0)