diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5ef9f..19bf002 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **[BREAKING]** API Hosting runtime version from Node.js 18 to [Node.js 24](https://nodejs.org/en/blog/release/v24.11.0) - Require minimum [Node.js 24](https://nodejs.org/en/blog/release/v24.11.0) +- moved transfer monitor from s3 sync ### Removed diff --git a/src/cdn/commands/deploy.ts b/src/cdn/commands/deploy.ts index 0499aca..cfda08f 100644 --- a/src/cdn/commands/deploy.ts +++ b/src/cdn/commands/deploy.ts @@ -6,7 +6,7 @@ import { PutObjectCommandInput, S3Client, } from '@aws-sdk/client-s3' -import { S3SyncClient, TransferMonitor, TransferStatus } from 's3-sync-client' +import { S3SyncClient } from 's3-sync-client' import mime from 'mime-types' import confirm from '../utils/confirm.js' @@ -51,19 +51,10 @@ export default async function ( const { sync } = new S3SyncClient({ client: s3Client }) - const monitor = new TransferMonitor() - monitor.on('progress', (transferStatus: TransferStatus) => { - progress = Math.floor( - (transferStatus.size.current / transferStatus.size.total) * 100, - ) - spinner.text = `Uploading to CDN: ${progress}%` - }) - // Allow deployment of files in a sub directory to the current working directory const cwd = path.join(flags.cwd, input[0] || '.') const options: SyncLocalWithBucketOptions = { del: flags.prune, - monitor, commandInput: (input) => { const putObjectCommandInput: Partial = { ContentType: @@ -73,6 +64,7 @@ export default async function ( return putObjectCommandInput as unknown as GetObjectCommandInput }, } + await sync(cwd, `s3://${cfg.scope}/${flags.env}`, options) spinner.succeed('Upload(s) complete!') } catch (error) {