Skip to content

Commit

Permalink
fix: update dependencies (#460)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Requires Node >=20.5.0. Uses `text/javascript` instead of `application/javascript` as mimetype.
  • Loading branch information
wkillerud authored Nov 15, 2024
1 parent 1ba1936 commit 1b69224
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- run: npm install

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18, 20]
node-version: [20, 22]
runs-on: ${{ matrix.os }}

steps:
Expand Down
6 changes: 3 additions & 3 deletions lib/multipart/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HttpError from "http-errors";
import Busboy from "busboy";
import abslog from "abslog";
import ssri from "ssri";
import tar from "tar";
import { Parser } from "tar";

import { createFilePathToAsset } from "../utils/path-builders-fs.js";
import FormField from "./form-field.js";
Expand Down Expand Up @@ -131,9 +131,9 @@ const MultipartParser = class MultipartParser {
file.emit("error", new HttpError.PayloadTooLarge());
});

const extract = new tar.Parse({
const extract = new Parser({
strict: true,
onentry: (entry) => {
onReadEntry: (entry) => {
// Entries not supported must be thrown
// away for extraction to continue
if (entry.type.toLowerCase() !== "file") {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@
"author": "",
"license": "MIT",
"dependencies": {
"@eik/common": "4.1.1",
"@eik/common": "5.0.0",
"@eik/sink": "1.2.5",
"@eik/sink-file-system": "1.0.1",
"@eik/sink-memory": "1.1.2",
"@eik/sink-file-system": "2.0.0",
"@eik/sink-memory": "2.0.0",
"@metrics/client": "2.5.4",
"abslog": "2.4.4",
"busboy": "1.6.0",
"http-errors": "2.0.0",
"mime": "3.0.0",
"mime": "4.0.4",
"original-url": "1.2.3",
"semver": "7.6.3",
"ssri": "10.0.6",
"tar": "6.2.1",
"unique-slug": "4.0.0"
"ssri": "12.0.0",
"tar": "7.4.3",
"unique-slug": "5.0.0"
},
"devDependencies": {
"@eik/eslint-config": "1.0.4",
"@eik/eslint-config": "1.0.5",
"@eik/prettier-config": "1.0.1",
"@eik/semantic-release-config": "1.0.0",
"@eik/typescript-config": "1.0.0",
"@types/readable-stream": "4.0.18",
"eslint": "9.13.0",
"eslint": "9.14.0",
"form-data": "4.0.1",
"mkdirp": "3.0.1",
"node-fetch": "3.3.2",
"npm-run-all2": "5.0.2",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"semantic-release": "24.1.2",
"tap": "18.8.0",
"typescript": "5.5.4"
"semantic-release": "24.2.0",
"tap": "21.0.1",
"typescript": "5.6.3"
}
}
36 changes: 21 additions & 15 deletions tap-snapshots/test/multipart/parser.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
* Re-generate by setting TAP_SNAPSHOT=1 and running tests.
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/multipart/parser.js > TAP > Parser() - Request contains multiple files and fields > parsed request should match snapshot 1`] = `
"use strict";
exports[
`test/multipart/parser.js > TAP > Parser() - Request contains multiple files and fields > parsed request should match snapshot 1`
] = `
Array [
FormFile {
"_name": "tgz",
"_value": Array [
Asset {
"_integrity": "sha512-i1oU4MCMKNS1akPh2DGG4w4SKDxj0mg7XW7jvIGx+/6wRxWREm5CCLhugpsnzc8MvhBW1h/7AT3nINtGT++nTQ==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/ie11/index.js",
Expand All @@ -32,7 +34,7 @@ Array [
},
Asset {
"_integrity": "sha512-lq9ovpg4+LD6vF+yOFaZTnuT43fVPmCDg9FjFKl4TM3/UI8TrXeQa3WlpkoFB1WoucVwQcP9pFvZrBjtts4uHA==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/main/index.js",
Expand Down Expand Up @@ -85,7 +87,7 @@ Array [
"_value": Array [
Asset {
"_integrity": "sha512-i1oU4MCMKNS1akPh2DGG4w4SKDxj0mg7XW7jvIGx+/6wRxWREm5CCLhugpsnzc8MvhBW1h/7AT3nINtGT++nTQ==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/ie11/index.js",
Expand All @@ -105,7 +107,7 @@ Array [
},
Asset {
"_integrity": "sha512-lq9ovpg4+LD6vF+yOFaZTnuT43fVPmCDg9FjFKl4TM3/UI8TrXeQa3WlpkoFB1WoucVwQcP9pFvZrBjtts4uHA==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/main/index.js",
Expand Down Expand Up @@ -146,9 +148,11 @@ Array [
],
},
]
`
`;

exports[`test/multipart/parser.js > TAP > Parser() - Request contains only fields > parsed request should match snapshot 1`] = `
exports[
`test/multipart/parser.js > TAP > Parser() - Request contains only fields > parsed request should match snapshot 1`
] = `
Array [
FormField {
"_name": "foo",
Expand All @@ -159,16 +163,18 @@ Array [
"_value": "value-bar",
},
]
`
`;

exports[`test/multipart/parser.js > TAP > Parser() - Request contains only files > parsed request should match snapshot 1`] = `
exports[
`test/multipart/parser.js > TAP > Parser() - Request contains only files > parsed request should match snapshot 1`
] = `
Array [
FormFile {
"_name": "tgz",
"_value": Array [
Asset {
"_integrity": "sha512-i1oU4MCMKNS1akPh2DGG4w4SKDxj0mg7XW7jvIGx+/6wRxWREm5CCLhugpsnzc8MvhBW1h/7AT3nINtGT++nTQ==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/ie11/index.js",
Expand All @@ -188,7 +194,7 @@ Array [
},
Asset {
"_integrity": "sha512-lq9ovpg4+LD6vF+yOFaZTnuT43fVPmCDg9FjFKl4TM3/UI8TrXeQa3WlpkoFB1WoucVwQcP9pFvZrBjtts4uHA==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/main/index.js",
Expand Down Expand Up @@ -233,7 +239,7 @@ Array [
"_value": Array [
Asset {
"_integrity": "sha512-i1oU4MCMKNS1akPh2DGG4w4SKDxj0mg7XW7jvIGx+/6wRxWREm5CCLhugpsnzc8MvhBW1h/7AT3nINtGT++nTQ==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/ie11/index.js",
Expand All @@ -253,7 +259,7 @@ Array [
},
Asset {
"_integrity": "sha512-lq9ovpg4+LD6vF+yOFaZTnuT43fVPmCDg9FjFKl4TM3/UI8TrXeQa3WlpkoFB1WoucVwQcP9pFvZrBjtts4uHA==",
"_mimeType": "application/javascript",
"_mimeType": "text/javascript",
"_name": "buz",
"_org": "biz",
"_pathname": "/main/index.js",
Expand Down Expand Up @@ -294,4 +300,4 @@ Array [
],
},
]
`
`;
4 changes: 2 additions & 2 deletions test/classes/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tap.test("Asset() - Set values to the arguments on the constructor", (t) => {
);
t.equal(
obj.mimeType,
"application/javascript",
"text/javascript",
'.mimeType should contain value matching type of file set on "pathname"',
);
t.equal(
Expand Down Expand Up @@ -141,7 +141,7 @@ tap.test("Asset() - Stringify object to JSON", (t) => {
);
t.equal(
o.mimeType,
"application/javascript",
"text/javascript",
'.mimeType should contain value matching type of file set on "pathname" on the origin object',
);
t.equal(o.type, "pkg", ".type should contain value set on origin object");
Expand Down
8 changes: 2 additions & 6 deletions test/classes/http-outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ tap.test("HttpOutgoing() - Set .location to legal value", (t) => {

tap.test("HttpOutgoing() - Set .mimeType to legal value", (t) => {
const obj = new HttpOutgoing();
obj.mimeType = "application/javascript";
t.equal(
obj.mimeType,
"application/javascript",
".location should be the set value",
);
obj.mimeType = "text/javascript";
t.equal(obj.mimeType, "text/javascript", ".location should be the set value");
t.end();
});

Expand Down

0 comments on commit 1b69224

Please sign in to comment.