Releases: jaydenseric/graphql-upload
Version 17.0.0
Major
-
Updated Node.js support to
^18.18.0 || ^20.9.0 || >=22.0.0. -
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
-
Use the TypeScript v5.5+ JSDoc tag
@importto import types in modules. -
Removed JSDoc tag
@typedefthat were unintentionally re-exporting types; to migrate import TypeScript types from the correct module:- import type { GraphQLUpload } from "graphql-upload/Upload.mjs"; + import type GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
- import type { processRequest } from "graphql-upload/Upload.mjs"; + import type processRequest from "graphql-upload/processRequest.mjs";
- import type { GraphQLUpload } from "graphql-upload/processRequest.mjs"; + import type GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
-
Refactored tests to use the standard
AbortController,fetch,File, andFormDataAPIs available in modern Node.js and removed the dev dependenciesnode-abort-controllerandnode-fetch. -
Replaced the test utility function
streamToStringwith the functiontextfromnode:stream/consumersthat’s available in modern Node.js. -
Use the Node.js test runner API and remove the dev dependency
test-director.
Minor
- Support Express v5 by updating the optional peer dependency
@types/expressto4.0.29 - 5and the dev dependencyexpressto v5, via #389.
Patch
- Tweaked the package description.
- Updated the
package.jsonfieldrepositoryto conform to new npm requirements. - Updated the package scripts:
- Reordered the scripts.
- Replaced
npm runwithnode --run.
- Updated GitHub Actions CI config:
- No longer run the workflow on pull request.
- Enable manual workflow dispatching.
- Run checks in seperate jobs.
- Removed custom step names.
- Replaced
npm runwithnode --run. - Updated the tested Node.js versions to v18, v20, v22.
- Updated
actions/checkoutto v4. - Updated
actions/setup-nodeto v4.
- Migrated to the ESLint v9 CLI and “flat” config.
- Integrated a new dev dependency
eslint-plugin-jsdocand revised types. - Removed the Node.js CLI option
--unhandled-rejections=throwin the package scripttestsas it’s now the default for all supported Node.js versions. - Avoid hardcoding a default value in the type
FileUploadCreateReadStreamOptionspropertyhighWaterMarkdescription and use the functiongetDefaultHighWaterMarkfromnode:streamin tests. - Replaced the test helper class
Deferredwith polyfilledPromise.withResolvers. - Removed an unnecessary
awaitin tests. - Omit unused catch bindings in the function
processRequest. - Corrected the JSDoc type
FileUploadCreateReadStreamOptionsin the moduleprocessRequest.mjs. - Avoid using
returnin the middleware. - Added a new dev dependency
async-listento replace the test utility functionlisten. - Enabled the TypeScript compiler options
noUnusedLocalsandnoUnusedParametersand used the prefix_for purposefully unused function parameters in tests. - Updated the GitHub Markdown syntax for alerts in the readme.
- Tweaked wording in the readme and JSDoc descriptions.
Version 16.0.2
Patch
- Updated dev dependencies.
- Use the
node:URL scheme for Node.js builtin module imports. - Improved JSDoc in the module
GraphQLUpload.mjs. - Revamped the readme:
- Removed the badges.
- More detailed installation instructions.
- Added information about TypeScript config and optimal JavaScript module design.
Version 16.0.1
Version 16.0.0
Major
-
Updated the
fs-capacitordependency to v8, fixing #318. -
The type
FileUploadCreateReadStreamOptionsfrom theprocessRequest.mjsmodule now uses types fromfs-capacitorthat are slightly more specific. -
The API is now ESM in
.mjsfiles instead of CJS in.jsfiles, accessible viaimportbut notrequire. To migrate imports:- import GraphQLUpload from "graphql-upload/GraphQLUpload.js"; + import GraphQLUpload from "graphql-upload/GraphQLUpload.mjs";
- import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js"; + import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";
- import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js"; + import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.mjs";
- import processRequest from "graphql-upload/processRequest.js"; + import processRequest from "graphql-upload/processRequest.mjs";
- import Upload from "graphql-upload/Upload.js"; + import Upload from "graphql-upload/Upload.mjs";
Patch
- Updated dev dependencies.
- Updated examples in JSDoc comments.
- Updated the changelog entry for v14.0.0 to show how to migrate imports.
Version 15.0.2
Patch
- Updated dev dependencies.
- Corrected the TypeScript type for the Koa context
ctxparameter for the Koa middleware created by the functiongraphqlUploadKoa, fromimport("koa").Contexttoimport("koa").ParameterizedContext.
Version 15.0.1
Patch
- Don’t import and link types from the middlware modules
graphqlUploadExpress.jsandgraphqlUploadKoa.jswithin the moduleprocessRequest.js, fixing #314.
Version 15.0.0
Major
- Updated the
busboydependency to v1, fixing #311.- This important update addresses the vulnerability CVE-2022-24434 (GHSA-wm7h-9275-46v2).
- Some error messages have changed.
- Temporarily until mscdex/busboy#297 is fixed upstream, for the function
processRequestand the middlewaregraphqlUploadExpressandgraphqlUploadKoathe optionmaxFileSizeis actually 1 byte less than the amount specified.
Patch
- Updated the
typescriptdev dependency. - In the function
processRequestuse theonmethod instead ofonceto listen forerrorevents on thebusboyparser, as in edge cases the same parser could have multipleerrorevents and all must be handled to prevent the Node.js process exiting with an error. - Simplified error handling within the function
processRequest. - Added a test for the function
processRequestwith a maliciously malformed multipart request.
Version 14.0.0
Major
-
Updated Node.js support to
^14.17.0 || ^16.0.0 || >= 18.0.0. -
Updated the
graphqlpeer dependency to^16.3.0. -
Updated the
http-errorsdependency to v2. -
Public modules are now individually listed in the package
filesandexportsfields. -
Removed the package main index module; deep imports must be used. To migrate imports:
- import { GraphQLUpload } from "graphql-upload"; + import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
- import { graphqlUploadExpress } from "graphql-upload"; + import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js";
- import { graphqlUploadKoa } from "graphql-upload"; + import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js";
- import { processRequest } from "graphql-upload"; + import processRequest from "graphql-upload/processRequest.js";
- import { Upload } from "graphql-upload"; + import Upload from "graphql-upload/Upload.js";
-
Shortened public module deep import paths, removing the
/public/. To migrate imports:- import GraphQLUpload from "graphql-upload/public/GraphQLUpload.js"; + import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
- import graphqlUploadExpress from "graphql-upload/public/graphqlUploadExpress.js"; + import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.js";
- import graphqlUploadKoa from "graphql-upload/public/graphqlUploadKoa.js"; + import graphqlUploadKoa from "graphql-upload/graphqlUploadKoa.js";
- import processRequest from "graphql-upload/public/processRequest.js"; + import processRequest from "graphql-upload/processRequest.js";
- import Upload from "graphql-upload/public/Upload.js"; + import Upload from "graphql-upload/Upload.js";
-
Implemented TypeScript types via JSDoc comments, closing #282.
-
The
GraphQLUploadscalar no longer uses deprecatedGraphQLErrorconstructor parameters.
Patch
- Updated dev dependencies.
- Simplified dev dependencies and config for ESLint.
- 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. - Removed the
hard-rejectiondev dependency. Instead, tests are run with the Node.js CLI flag--unhandled-rejections=throwto make Node.js v14 behave like newer versions. - Removed the
formdata-nodedev dependency. Instead,FileandFormDataare imported fromnode-fetch. - Updated GitHub Actions CI config:
- Run tests with Node.js v14, v16, v18.
- Updated
actions/checkoutto v3. - Updated
actions/setup-nodeto v3.
- Reorganized the test file structure.
- Use the
.jsfile extension inrequirepaths. - Use the Node.js
ReadablepropertyreadableEncodinginstead of_readableState.encodingin tests. - Use
substringinstead of the deprecated string methodsubstrin tests. - Fixed a typo in a code comment.
- Updated documentation.
- Added a
license.mdMIT License file, closing #86.
Version 13.0.0
Major
- Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Removed
./packagefrom the packageexportsfield; the fullpackage.jsonfilename must be used in arequirepath.
Patch
- Updated the
graphqlpeer dependency to0.13.1 - 16. - Updated dependencies.
- Also run GitHub Actions CI with Node.js v17.
- Simplified package scripts.
- Renamed imports in the test index module.
- Test the
processRequestfunction with a GraphQL multipart request that has no files. - Test the
processRequestfunction with an unparsable multipart request. - Replaced the
form-datadev dependency withformdata-node,formdata-node, andnode-abort-controllerand refactored tests to align with web standards. - Refactored the
processRequestfunction to remove theisobjectdependency. - Improved the
processRequestfunction, via #273:- Fixed ending requests from being handled incorrectly as aborting in edge cases, closing #272.
- Fixed read streams created via the resolved
Uploadscalar valuecreateReadStreammethod:- Not emitting the
errorevent when the multipart request is aborted certain ways while the file is uploading. - Emitting incorrect
errorevent details for multipart request file field parse errors.
- Not emitting the
- Configured Prettier option
singleQuoteto the default,false. - Documentation tweaks.
Version 12.0.0
Major
- Updated Node.js support to
^12.20 || >= 14.13. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- The tests are now ESM in
.mjsfiles instead of CJS in.jsfiles. - Replaced the the
package.jsonexportsfield public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deeprequirepaths must now include the.jsfile extension.
Minor
- Added a package
sideEffectsfield.
Patch
- Updated dependencies.
- Lint fixes for the updated Prettier version.
- Updated GitHub Actions CI config:
- Updated the tested Node.js versions to v12, v14, v16.
- Updated
actions/checkoutto v2. - Updated
actions/setup-nodeto v2. - Simplify config with the
npm install-testcommand. - Don’t specify the
CIenvironment variable as it’s set by default.
- Removed
npm-debug.logfrom the.gitignorefile as npm v4.2.0+ doesn’t create it in the current working directory. - Updated the EditorConfig URL.
- Updated the package
keywordsfield. - 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. - Refactored private constants from exports of a single module to individual modules.
- Fixed test name and comment typos.
- Updated external URLs in docs.
- Prettier format for a JSDoc code example.
- Updated a
GraphQLUploadcode example to use@graphql-tools/schemainstead ofgraphql-tools. - Removed from the readme the notice that the package was previously published as
apollo-upload-server. - Simplified the readme “Setup” and “Support” sections.