Releases: jaydenseric/extract-files
Version 13.0.0
Major
- Updated Node.js support to
^14.17.0 || ^16.0.0 || >= 18.0.0. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Use the
node:URL scheme for Node.js builtin module imports in tests.
Patch
- Updated dependencies.
- Simplified dev dependencies and config for ESLint.
- Updated GitHub Actions CI config:
- Run tests with Node.js v14, v16, v18.
- Updated
actions/checkoutto v3. - Updated
actions/setup-nodeto v3.
- Updated
jsconfig.json:- Set
compilerOptions.maxNodeModuleJsDepthto10. - Set
compilerOptions.moduletonodenext.
- Set
- Removed the now redundant
not IE > 0from the Browserslist query. - Replaced TypeScript
Recordtypes with index signatures. - Tweaked formatting of a JSDoc comment.
- Revamped the readme:
- Removed the badges.
- Removed the detailed API docs. The JSDoc comments and TypeScript types in the exported modules are now the primary documentation.
- Added Browserslist links.
- Added information about Deno, import maps, TypeScript config, and optimal JavaScript module design.
Version 12.0.0
Major
-
Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0. -
Added a new
is-plain-objdependency that is ESM. -
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
-
Public modules are now individually listed in the package
filesandexportsfields. -
Removed
./packagefrom the packageexportsfield; the fullpackage.jsonfilename must be used in arequirepath. -
Removed the package main index module; deep imports must be used.
-
Shortened public module deep import paths, removing the
/public/. -
The API is now ESM in
.mjsfiles instead of CJS in.jsfiles, accessible viaimportbut notrequire. -
Implemented TypeScript types via JSDoc and
@deno-typescomments, fixing #7. -
Changed the function
extractFilesparameters. The previously thirdisExtractableFileparameter has been renamedisExtractable, is now the second parameter, and no longer defaults to the functionisExtractableFileto avoid a redundant import when a custom function is specified. -
The function
extractFilesnow does basic runtime argument type validation. -
The function
extractFilesnow also deep clones “plain” objects that aren’tObjectinstances (e.g.Object.create(null)). -
Removed out of the box React Native support. The class
ReactNativeFileis no longer exported, or matched by the functionisExtractableFile.This class was bloating non React Native environments with an extra module, increasing bundle sizes when building and adding an extra step to ESM loading waterfalls in browsers.
It’s the responsibility of Facebook to adhere to web standards and implement spec-complaint
File,Glob, andFormDataglobals in the React Native environment.In the meantime, React Native projects can manually implement a class
ReactNativeFileand match it with a custom functionisReactNativeFilefor use with the functionextractFiles.
Patch
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Check TypeScript types via a new package
typesscript. - Removed the
jsdoc-mddev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section. - Reorganized the test file structure.
- Test the bundle sizes for public modules individually.
- Use a new
assertBundleSizefunction to assert module bundle size in tests:- Failure message contains details about the bundle size and how much the limit was exceeded.
- Errors when the surplus is greater than 25% of the limit, suggesting the limit should be reduced.
- Resolves the minified bundle and its gzipped size for debugging in tests.
- Fixed an
extractFilesfunction test bug. - Added an
extractFilesfunction test clarifying that object properties withSymbolkeys don’t get cloned. - Configured Prettier option
singleQuoteto the default,false. - Updated the package description.
- Documentation tweaks.
- Added a
license.mdMIT License file, fixing #19 via #20. - Amended the changelog entry for v10.0.0.
Version 11.0.0
Major
- The function
extractFilesnow deeply clones an input value containing multiple references of an object or array with a mirrored reference structure instead of creating multiple objects or arrays. This change shouldn’t affect typicalJSON.stringifyuse with cloned values. - The function
extractFilesnow usesfor…ofto iterateFileListinstances.
Patch
- Updated dev dependencies.
- Reverted the more specific package
mainfield path. - The function
extractFilesnow correctly handles circular references within the input value by recreating the circular references in the returned clone instead of infinitely recursing to the point of aMaximum call stack size exceedederror, fixing #14. - Renamed imports in the test index module.
- Refactored
extractFilestests to useObject.freezewith input objects and arrays to ensure input isn’t mutated. - Updated a code example to use a deep import.
- Amended the changelog entries for v8.0.0 and v9.0.0.
Version 10.0.0
Major
- Updated Node.js support to
^12.20 || >= 14.13. - Stopped supporting Internet Explorer.
- Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Replaced the the
package.jsonexportsfield public subpath folder mapping (deprecated by Node.js) with a subpath pattern, fixing #17. Deeprequirepaths withinextract-files/public/must now include the.jsfile 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.
- The tests are now ESM in
.mjsfiles instead of CJS in.jsfiles.
Patch
- Stop using
hard-rejectionto detect unhandledPromiserejections in tests, as Node.js v15+ does this natively. - Used
revertable-globalsto define globals per-test. - Test the bundle size manually using
esbuildandgzip-size, removingsize-limitrelated dev dependencies, config, and scripts. - Removed
npm-debug.logfrom the.gitignorefile as npm v4.2.0+ doesn’t create it in the current working directory. - Fixed a test of
extractFileswith anundefinedvalue. - Updated GitHub Actions CI config:
- Run tests with Node.js v12, v14, v16.
- Updated
actions/checkoutto v2. - Updated
actions/setup-nodeto v2. - Don’t specify the
CIenvironment variable as it’s set by default.
- More specific package
mainfield path. - Simplified JSDoc related package scripts now that
jsdoc-mdv10 automatically generates a Prettier formatted readme. - Added a package
test:jsdocscript that checks the readme API docs are up to date with the source JSDoc. - Use the
.jsfile extension in internalrequirepaths. - Improved documentation.
- The file
changelog.mdis no longer published. - Updated URLs in the changelog entries for v3.1.0 and v5.0.1.
Version 9.0.0
Major
- Updated Node.js support to
^10.17.0 || ^12.0.0 || >= 13.7.0. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Renamed the
libdirectory topublic; existing deep import or require paths must be updated. - Removed the package
modulefield.
Patch
- Removed Node.js v13 and added v14 to the versions tested in GitHub Actions.
- Simplified the GitHub Actions CI config with the
npm install-testcommand. - Improved JSDoc code examples.
- Updated EditorConfig.
- No longer transpile tests with Babel, or test ESM.
- Simplified the Babel config and scripts, ensuring
.jsfiles are parsed as scripts. - Removed unnecessary
.jsfile extensions fromrequirepaths. - Documented all the ways to
importandrequirethe public API. - Tweaked the readme setup instructions.
Version 8.1.0
Minor
-
Updated the package
exportsfield:-
Deep imports to specific files are now allowed, e.g.
import extractFiles from 'extract-files/lib/extractFiles.js';
const extractFiles = require('extract-files/lib/extractFiles');
-
The
package.jsoncan now be required, e.g.const pkg = require('extract-files/package.json');
// With Node.js --experimental-json-modules flag. import pkg from 'extract-files/package.json';
-
Patch
- Updated dev dependencies.
- Updated the package
engines.nodefield to10 - 12 || >= 13.7to reflect the packageexportsrelated breaking changes inextract-files@8.0.0. - Improved the package
prepare:prettierandtest:prettierscripts. - Reordered the package
test:eslintscript args for consistency withtest:prettier. - Configured Prettier option
semito the default,true. - Restructured the
srcdirectory solibandtestfiles are separate with their own.babelrc.jsfiles.
Version 8.0.0
Major
- Added a package
exportsfield to support native ESM in Node.js. - Some source and published files are now
.js(CJS) instead of.mjs(ESM), so undocumented deep imports may no longer work. This approach avoids the dual package hazard.
Patch
- Updated dependencies.
- Removed
@babel/plugin-proposal-class-propertiesfrom dev dependencies and the Babel config. - Lint fixes for
prettierv2. - Ensure GitHub Actions run on pull request.
- Improved the
ExtractableFileMatcherJSDoc typedef. - Size limit test the published CJS files as well as the ESM.
Version 7.0.0
Major
- Updated Node.js support from v8.10+ to v10+.
- Replaced
tapandnycwithtest-director,coverage-nodeandhard-rejectionto improve the dev experience, test ESM natively with Node.js, and reduce the dev install size by ~78.8 MB. These new dev dependencies require Node.js v10+.
Patch
- Updated dev dependencies.
- Removed the now redundant
eslint-plugin-import-order-alphabeticaldev dependency. - Stop using
huskyandlint-staged. - More thorough tests.
- Use strict mode for scripts.
- Renamed some package scripts.
Version 6.0.0
Major
- Updated Node.js support from v6+ to v8.10+.
Minor
- Added the ability to customize what are extractable files, fixing #10 via #11:
- Added a new third parameter to the
extractFilesfunction, for specifying a custom extractable file matcher. - Export a new
isExtractableFilefunction that is used as the default extractable file matcher for theextractFilesfunction. This can be used in a custom extractable file matcher implementation to match the default extractable files, along with additional custom files.
- Added a new third parameter to the
- Setup GitHub Sponsors funding:
- Added
.github/funding.ymlto display a sponsor button in GitHub. - Added a
package.jsonfundingfield to enable npm CLI funding features.
- Added
Patch
- Updated dev dependencies.
- Replaced the
size-limitdev dependency with@size-limit/preset-small-lib. - Added a new
babel-plugin-transform-require-extensionsdev dependency and ensured ESM import specifiers in both source and published.mjsfiles contain file names with extensions, which are mandatory in the final Node.js ESM implementation. Published CJS.jsfiles now also have file extensions inrequirepaths. - Added a package
modulefield. - Removed now redundant ESLint disable
require-jsdoccomments. - Use GitHub Actions instead of Travis for CI.
- Redid the test scripts and enforced 100% code coverage.
- Run size limit tests last in the package
testscript as they are the slowest. - Only size limit test the ESM build.
- Updated the package
test:tapscript to workaround atapbug. - Simplified the
prepublishOnlyscript. - Ordered
pluginsbeforepresetsin Babel config as they run first. - Reduced the size of the published
package.jsonby moving dev tool config to files. - Only target the root
libdirectory in.gitignoreand.eslintignore. - Removed
package-lock.jsonfrom.gitignoreand.prettierignoreas it’s disabled in.npmrcanyway. - Prevented ESLint from ignoring dotfiles.
- Clarified that Opera Mini isn’t supported in the Browserslist queries and readme “Support” section.
Version 5.0.1
Patch
- Updated dev dependencies.
- Instance (e.g.
new Date()) references are copied to the clone instead of recursed as objects; fixing jaydenseric/apollo-upload-client#138 via #9. - Test more types of input.