Skip to content

Commit

Permalink
Replace the package exports field public subpath folder mapping with …
Browse files Browse the repository at this point in the history
…a subpath pattern.

Fixes #17 .
  • Loading branch information
jaydenseric committed Apr 23, 2021
1 parent ba4c930 commit 600ca21
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: ['10', '12', '14', '15', '16']
node: ['12', '14', '15', '16']
steps:
- uses: actions/checkout@v2
- name: Setup Node.js v${{ matrix.node }}
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

### Major

- Updated Node.js support to `^12.19 || >= 14.13`.
- Stopped supporting Internet Explorer.
- Replaced the the `package.json` `exports` field public [subpath folder mapping](https://nodejs.org/api/packages.html#packages_subpath_folder_mappings) (deprecated by Node.js) with a [subpath pattern](https://nodejs.org/api/packages.html#packages_subpath_patterns), fixing [#17](https://github.com/jaydenseric/extract-files/issues/17). Deep `require` paths within `extract-files/public/` must now include the file extension.
- Removed Babel related dev dependencies, config, and scripts. Published modules now contain more modern ES syntax.
- Published modules now contain JSDoc comments, which might affect TypeScript projects.

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
"import": "./public/index.mjs",
"require": "./public/index.js"
},
"./public/": "./public/",
"./public/*": "./public/*",
"./package": "./package.json",
"./package.json": "./package.json"
},
"engines": {
"node": "^10.17.0 || ^12.0.0 || >= 13.7.0"
"node": "^12.19 || >= 14.13"
},
"browserslist": "Node 10.17 - 11 and Node < 11, Node 12 - 13 and Node < 13, Node >= 13.7, > 0.5%, not OperaMini all, not IE > 0, not dead",
"browserslist": "Node 12.19 - 13 and Node < 13, Node >= 14.13, > 0.5%, not OperaMini all, not IE > 0, not dead",
"devDependencies": {
"coverage-node": "^4.0.0",
"esbuild": "^0.11.12",
Expand Down
2 changes: 1 addition & 1 deletion public/ReactNativeFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* ```
*
* ```js
* const ReactNativeFile = require('extract-files/public/ReactNativeFile');
* const ReactNativeFile = require('extract-files/public/ReactNativeFile.js');
* ```
* @example <caption>An extractable file in React Native.</caption>
* ```js
Expand Down
2 changes: 1 addition & 1 deletion public/extractFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const defaultIsExtractableFile = require('./isExtractableFile');
* ```
*
* ```js
* const extractFiles = require('extract-files/public/extractFiles');
* const extractFiles = require('extract-files/public/extractFiles.js');
* ```
* @example <caption>Extract files from an object.</caption>
* For the following:
Expand Down
2 changes: 1 addition & 1 deletion public/isExtractableFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ReactNativeFile = require('./ReactNativeFile');
* ```
*
* ```js
* const isExtractableFile = require('extract-files/public/isExtractableFile');
* const isExtractableFile = require('extract-files/public/isExtractableFile.js');
* ```
*/
module.exports = function isExtractableFile(value) {
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ See the [`extractFiles`](#function-extractfiles) documentation to get started.

## Support

- [Node.js](https://nodejs.org): `^10.17.0 || ^12.0.0 || >= 13.7.0`
- [Node.js](https://nodejs.org): `^12.19 || >= 14.13`
- [Browsers](https://npm.im/browserslist): `> 0.5%, not OperaMini all, not IE > 0, not dead`
- [React Native](https://reactnative.dev)

Expand Down Expand Up @@ -62,7 +62,7 @@ _Ways to `require`._
> ```
>
> ```js
> const ReactNativeFile = require('extract-files/public/ReactNativeFile');
> const ReactNativeFile = require('extract-files/public/ReactNativeFile.js');
> ```
_An extractable file in React Native._
Expand Down Expand Up @@ -110,7 +110,7 @@ _Ways to `require`._
> ```
>
> ```js
> const extractFiles = require('extract-files/public/extractFiles');
> const extractFiles = require('extract-files/public/extractFiles.js');
> ```
_Extract files from an object._
Expand Down Expand Up @@ -181,7 +181,7 @@ _Ways to `require`._
> ```
>
> ```js
> const isExtractableFile = require('extract-files/public/isExtractableFile');
> const isExtractableFile = require('extract-files/public/isExtractableFile.js');
> ```
---
Expand Down

0 comments on commit 600ca21

Please sign in to comment.