From 565ac11576c9ad366043aa38d9919f4530ee3c35 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Tue, 10 Sep 2024 17:04:10 -0400 Subject: [PATCH 1/2] chore(release): 0.0.1-alpha.13 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- src/utils/directoryUtils.ts | 24 ++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bde2874..ed611a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.13](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.10...v0.0.1-alpha.13) (2024-09-10) + + +### Features + +* add plimit to directory add ([468cff2](https://github.com/DIG-Network/dig-chia-sdk/commit/468cff28397c993b22af7388a8472b1d2068aebd)) + ### [0.0.1-alpha.12](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.10...v0.0.1-alpha.12) (2024-09-10) diff --git a/package-lock.json b/package-lock.json index 13908d1..71efcfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.12", + "version": "0.0.1-alpha.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.12", + "version": "0.0.1-alpha.13", "license": "ISC", "dependencies": { "bip39": "^3.1.0", diff --git a/package.json b/package.json index 8251f61..9ea6efb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.12", + "version": "0.0.1-alpha.13", "description": "", "type": "commonjs", "main": "./dist/index.js", diff --git a/src/utils/directoryUtils.ts b/src/utils/directoryUtils.ts index 4008332..eea4852 100644 --- a/src/utils/directoryUtils.ts +++ b/src/utils/directoryUtils.ts @@ -76,3 +76,27 @@ export const addDirectory = async ( // Run tasks with limited concurrency (set the concurrency limit as needed) await limitConcurrency(10, tasks); // Adjust 10 based on your system limits }; + +/** + * Calculate the total size of the DIG_FOLDER_PATH + * @param folderPath - The path of the folder to calculate size. + * @returns The total size of the folder in bytes. + */ +export const calculateFolderSize = (folderPath: string): bigint => { + let totalSize = BigInt(0); + + const files = fs.readdirSync(folderPath); + + for (const file of files) { + const filePath = path.join(folderPath, file); + const stat = fs.statSync(filePath); + + if (stat.isDirectory()) { + totalSize += calculateFolderSize(filePath); + } else { + totalSize += BigInt(stat.size); + } + } + + return totalSize; +}; \ No newline at end of file From 65c53b5d1db9960249096f82e4fbf68a3ba9e11f Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Tue, 10 Sep 2024 17:09:20 -0400 Subject: [PATCH 2/2] chore(release): 0.0.1-alpha.14 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed611a9..dfdd0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.14](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.10...v0.0.1-alpha.14) (2024-09-10) + + +### Features + +* add plimit to directory add ([468cff2](https://github.com/DIG-Network/dig-chia-sdk/commit/468cff28397c993b22af7388a8472b1d2068aebd)) + ### [0.0.1-alpha.13](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.10...v0.0.1-alpha.13) (2024-09-10) diff --git a/package-lock.json b/package-lock.json index 71efcfb..3f19a8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.13", + "version": "0.0.1-alpha.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.13", + "version": "0.0.1-alpha.14", "license": "ISC", "dependencies": { "bip39": "^3.1.0", diff --git a/package.json b/package.json index 9ea6efb..aa01262 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.13", + "version": "0.0.1-alpha.14", "description": "", "type": "commonjs", "main": "./dist/index.js",