Skip to content

Commit

Permalink
refactor!: drop CommonJS distribution from package
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removes the CommonJS distribution from the package

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops authored and rolandjitsu committed Oct 30, 2024
1 parent ad592cd commit 0670bd2
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 1,568 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ console.log(files);
> [!NOTE]
> The above is experimental and subject to change.
### CommonJS

Convert a `DragEvent` to File objects:

```js
const {fromEvent} = require('file-selector');

document.addEventListener('drop', async (event) => {
const files = await fromEvent(event);
console.log(files);
});
```

## Browser Support
Most browser support basic File selection with drag 'n' drop or file input:
* [File API](https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility)
Expand Down
25 changes: 14 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
import { createDefaultEsmPreset } from 'ts-jest'

const defaultPreset = createDefaultEsmPreset()

/** @type {import('ts-jest').JestConfigWithTsJest} */
const jestConfig = {
...defaultPreset,
testEnvironment: 'jsdom',
transform: {
'^.+.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
},
};
// Convert `.js` imports to one without an extension to support 'NodeNext' module resolution.
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
}
}

export default jestConfig
Loading

0 comments on commit 0670bd2

Please sign in to comment.