Skip to content

Commit

Permalink
fix types (#77)
Browse files Browse the repository at this point in the history
`.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`.
  • Loading branch information
romainmenke authored Oct 18, 2024
1 parent 5443ae0 commit e9bea93
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

#### v5.2.1

- Fix location of `.d.ts` files so that `sources.d.ts` is correctly detected.

#### v5.2.0

- Add `set-methods` polyfills [`#40`](https://github.com/mrhenry/polyfill-library/pull/40) by @mhassan1
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@mrhenry/polyfill-library",
"version": "5.2.0",
"version": "5.2.1",
"description": "A polyfill combinator",
"main": "lib/index.js",
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/mrhenry/polyfill-library.git"
Expand All @@ -19,7 +19,7 @@
"lint-config": "node tasks/lint-config/index.js",
"clean": "node tasks/clean",
"build": "npm run clean && node tasks/updatesources && node tasks/buildsources/buildsources && npm run build-types",
"build-types": "tsc lib/*.js --declaration --allowJs --emitDeclarationOnly --outDir types",
"build-types": "tsc lib/*.js --declaration --allowJs --emitDeclarationOnly --outDir lib",
"watch": "npm run clean && node tasks/updatesources && node tasks/buildsources/watchsource",
"fmt": "eslint . --fix",
"test-end-to-end": "node --test 'test/end-to-end/**/*.test.js'",
Expand Down
5 changes: 3 additions & 2 deletions tasks/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ const cwd = path.join(__dirname, '../');
const globOptions = { cwd: cwd };

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

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

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

0 comments on commit e9bea93

Please sign in to comment.