diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5ef9f..6b362d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ 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) +### Removed +- transfer monitor from s3 sync + ### Removed - **[BREAKING]** support for Node.js 18. diff --git a/src/cdn/commands/deploy.ts b/src/cdn/commands/deploy.ts index 0499aca..7b1ade5 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' @@ -37,8 +37,6 @@ export default async function ( const spinner = ora({ spinner: 'dots', text: 'Uploading to CDN' }) spinner.start() - let progress = 0 - try { const s3Client = new S3Client({ region: tenant.region, @@ -51,19 +49,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,10 +62,11 @@ 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) { - spinner.fail(`Upload(s) failed: ${progress}%`) + spinner.fail(`Upload(s) failed`) throw error }