From a9ba9de6bef3c62bce19318a36a0fc6de4d14bf8 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Sun, 23 Nov 2025 22:42:47 +0000 Subject: [PATCH] BREAKING CHANGE(Smarts3): Migrate Smarts3 configuration to nested server/storage objects and remove legacy flat config support --- changelog.md | 8 ++++++++ test/test.aws-sdk.node.ts | 10 +++++++--- test/test.ts | 8 ++++++-- ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index 9bbd305..547b88a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-11-23 - 4.0.0 - BREAKING CHANGE(Smarts3) +Migrate Smarts3 configuration to nested server/storage objects and remove legacy flat config support + +- Smarts3.createAndStart() and Smarts3 constructor now accept ISmarts3Config with nested `server` and `storage` objects. +- Removed support for the legacy flat config shape (top-level `port` and `cleanSlate`) / ILegacySmarts3Config. +- Updated tests to use new config shape (server:{ port, silent } and storage:{ cleanSlate }). +- mergeConfig and Smarts3Server now rely on the nested config shape; consumers must update their initialization code. + ## 2025-11-23 - 3.2.0 - feat(multipart) Add multipart upload support with MultipartUploadManager and controller integration diff --git a/test/test.aws-sdk.node.ts b/test/test.aws-sdk.node.ts index d3dead6..2353c53 100644 --- a/test/test.aws-sdk.node.ts +++ b/test/test.aws-sdk.node.ts @@ -18,9 +18,13 @@ async function streamToString(stream: Readable): Promise { tap.test('should start the S3 server and configure client', async () => { testSmarts3Instance = await smarts3.Smarts3.createAndStart({ - port: 3337, - cleanSlate: true, - silent: true, + server: { + port: 3337, + silent: true, + }, + storage: { + cleanSlate: true, + }, }); const descriptor = await testSmarts3Instance.getS3Descriptor(); diff --git a/test/test.ts b/test/test.ts index 99090bd..d6a7f80 100644 --- a/test/test.ts +++ b/test/test.ts @@ -7,8 +7,12 @@ let testSmarts3Instance: smarts3.Smarts3; tap.test('should create a smarts3 instance and run it', async (toolsArg) => { testSmarts3Instance = await smarts3.Smarts3.createAndStart({ - port: 3333, - cleanSlate: true, + server: { + port: 3333, + }, + storage: { + cleanSlate: true, + }, }); console.log(`Let the instance run for 2 seconds`); await toolsArg.delayFor(2000); diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 71bead7..fc4057a 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smarts3', - version: '3.2.0', + version: '4.0.0', description: 'A Node.js TypeScript package to create a local S3 endpoint for simulating AWS S3 operations using mapped local directories for development and testing purposes.' } diff --git a/ts/index.ts b/ts/index.ts index dd8bacc..f223184 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -153,7 +153,7 @@ function mergeConfig(userConfig: ISmarts3Config): Required { */ export class Smarts3 { // STATIC - public static async createAndStart(configArg: ISmarts3Config | ILegacySmarts3Config = {}) { + public static async createAndStart(configArg: ISmarts3Config = {}) { const smartS3Instance = new Smarts3(configArg); await smartS3Instance.start(); return smartS3Instance; @@ -163,7 +163,7 @@ export class Smarts3 { public config: Required; public s3Instance: Smarts3Server; - constructor(configArg: ISmarts3Config | ILegacySmarts3Config = {}) { + constructor(configArg: ISmarts3Config = {}) { this.config = mergeConfig(configArg); }