From 9738af66e1efb88d76bdcad8f7748bd9e8cbffe3 Mon Sep 17 00:00:00 2001 From: Otavio Jacobi Date: Thu, 2 Jan 2025 09:38:38 -0300 Subject: [PATCH 1/3] Remove deprecated husky script header Change-type: patch --- .husky/pre-commit | 3 --- 1 file changed, 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 41ae0d5..718da8a 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - npx --no lint-staged From 1821181ebcaf0f3dfd3f720c47d10ebfb1d6b247 Mon Sep 17 00:00:00 2001 From: Otavio Jacobi Date: Thu, 2 Jan 2025 09:40:34 -0300 Subject: [PATCH 2/3] Use node16 module resolution in tsconfig Change-type: patch --- lib/index.ts | 2 +- package.json | 1 + tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index b5b0fb2..6833430 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -14,7 +14,7 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; import type { webResourceHandler } from '@balena/pinejs'; import type { WebResourceType as WebResource } from '@balena/sbvr-types'; -import * as memoize from 'memoizee'; +import memoize from 'memoizee'; import { randomUUID } from 'node:crypto'; import type { AnyObject } from 'pinejs-client-core'; import { TypedError } from 'typed-error'; diff --git a/package.json b/package.json index 6f2f495..d2d69fb 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@balena/pinejs-webresource-s3", "version": "0.2.0", "description": "A PineJS WebResource handler for storing & serving files on S3", + "type": "commonjs", "main": "build/index.js", "scripts": { "build": "tsc", diff --git a/tsconfig.json b/tsconfig.json index 84619e8..cff1c31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "commonjs", + "module": "Node16", "outDir": "build", "noUnusedParameters": true, "noUnusedLocals": true, From 92d1e2bdcacc5ac98a755b3c7145a3940bfa413e Mon Sep 17 00:00:00 2001 From: Otavio Jacobi Date: Thu, 2 Jan 2025 09:42:46 -0300 Subject: [PATCH 3/3] Update dependencies Change-type: patch --- lib/index.ts | 6 +++--- package.json | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 6833430..f2c2235 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -243,7 +243,7 @@ export class S3Handler implements webResourceHandler.WebResourceHandler { uploadId: string, payload: BeginMultipartUploadPayload, ): Promise { - const chunkSizesWithParts = await this.getChunkSizesWithParts( + const chunkSizesWithParts = this.getChunkSizesWithParts( payload.size, payload.chunk_size, ); @@ -280,10 +280,10 @@ export class S3Handler implements webResourceHandler.WebResourceHandler { }); } - private async getChunkSizesWithParts( + private getChunkSizesWithParts( size: number, chunkSize: number, - ): Promise>> { + ): Array> { const chunkSizesWithParts = []; let partNumber = 1; let remainingSize = size; diff --git a/package.json b/package.json index d2d69fb..808838d 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,18 @@ "author": "Balena Inc. ", "license": "Apache-2.0", "devDependencies": { - "@balena/lint": "^8.0.0", - "@balena/pinejs": "^16.0.0", - "@balena/sbvr-types": "^7.0.6", - "husky": "^9.0.11", - "lint-staged": "^15.2.2", - "typescript": "^5.4.3" + "@balena/lint": "^9.1.3", + "@balena/pinejs": "^19.7.1", + "@balena/sbvr-types": "^9.1.0", + "husky": "^9.1.7", + "lint-staged": "^15.3.0", + "typescript": "^5.7.2" }, "dependencies": { - "@aws-sdk/client-s3": "^3.556.0", - "@aws-sdk/lib-storage": "^3.556.0", - "@aws-sdk/s3-request-presigner": "^3.556.0", - "memoizee": "^0.4.15", + "@aws-sdk/client-s3": "^3.717.0", + "@aws-sdk/lib-storage": "^3.717.0", + "@aws-sdk/s3-request-presigner": "^3.717.0", + "memoizee": "^0.4.17", "typed-error": "^3.2.2" }, "versionist": {