fix(build): add Node types to tsconfig and update build dependencies for tsbuild 4.4.x

This commit is contained in:
2026-04-30 08:35:36 +00:00
parent 394d4e5b27
commit 1556a14a09
9 changed files with 893 additions and 11296 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog
## 2026-04-30 - 4.6.1 - fix(build)
add Node types to tsconfig and update build dependencies for tsbuild 4.4.x
- declare Node types explicitly in tsconfig so Node globals and modules resolve during tsbuild compilation
- remove the build workaround flag and upgrade tsbuild and related package versions
- harden the watcher test setup by validating required S3 environment variables before creating the bucket client
## 2026-04-07 - 4.6.0 - feat(bucket)
expose the underlying S3 client through getStorageClient()
Generated
+269 -277
View File
File diff suppressed because it is too large Load Diff
-10417
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -9,17 +9,17 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/ --verbose --logfile --timeout 120)",
"build": "(tsbuild tsfolders --allowimplicitany)"
"build": "(tsbuild tsfolders)"
},
"devDependencies": {
"@git.zone/tsbuild": "~4.3.0",
"@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsrun": "^2.0.2",
"@git.zone/tstest": "^3.6.3",
"@push.rocks/qenv": "^6.1.3",
"@types/node": "^25.5.2"
"@types/node": "^25.6.0"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1025.0",
"@aws-sdk/client-s3": "^3.1039.0",
"@push.rocks/smartmime": "^2.0.4",
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
@@ -27,7 +27,7 @@
"@push.rocks/smartstream": "^3.4.0",
"@push.rocks/smartstring": "^4.1.0",
"@push.rocks/smartunique": "^3.0.9",
"@tsclass/tsclass": "^9.5.0",
"@tsclass/tsclass": "^9.5.1",
"minimatch": "^10.2.5"
},
"private": false,
@@ -73,5 +73,5 @@
"type": "git",
"url": "https://code.foss.global/push.rocks/smartbucket.git"
},
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
"packageManager": "pnpm@10.28.2"
}
+590 -588
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -4,5 +4,5 @@
* **No *Strict methods**: All removed (fastPutStrict, getBucketByNameStrict, getFileStrict, getSubDirectoryByNameStrict)
* metadata is handled though the MetaData class. Important!
* **BucketWatcher** - Polling-based S3 change watcher (`bucket.createWatcher()`). Detects add/modify/delete via ETag/Size/LastModified comparison. Supports RxJS Observable pattern (`changeSubject`) and EventEmitter pattern (`on('change')`). Options: `prefix`, `pollIntervalMs`, `bufferTimeMs`, `includeInitial`, `pageSize`.
* **@git.zone/tsbuild pin**: tsbuild is pinned to `~4.3.0` because tsbuild 4.4.0 brings TypeScript 6.0.2 which has a regression where `@types/node` is not auto-discovered when files are passed programmatically via `createProgram` (which tsbuild does internally). This causes "Cannot find name 'Buffer'", "Cannot find name 'node:path'", etc. errors throughout the codebase. Workarounds would require either modifying tsconfig to add `"types": ["node"]` or staying on tsbuild 4.3.x. We chose to pin tsbuild.
* **@git.zone/tsbuild 4.4.x**: tsconfig explicitly declares `"types": ["node"]` so Node globals/modules are available when tsbuild passes files programmatically to TypeScript.
* **Test assertions**: Use `@git.zone/tstest/tapbundle` for `tap` and `expect`. Note that smartexpect's `toEqual` does NOT support `expect.any()` matchers (only `toMatchObject` does, and only at the top level). For testing nested objects with type matchers, use `toHaveProperty` + `toBeTypeofNumber/String/Boolean` separately.
+15 -5
View File
@@ -14,17 +14,27 @@ let testSmartbucket: smartbucket.SmartBucket;
// Setup: Create test bucket
tap.test('should create valid smartbucket and bucket', async () => {
const accessKey = await testQenv.getEnvVarOnDemand('S3_ACCESSKEY');
const accessSecret = await testQenv.getEnvVarOnDemand('S3_SECRETKEY');
const endpoint = await testQenv.getEnvVarOnDemand('S3_ENDPOINT');
const port = await testQenv.getEnvVarOnDemand('S3_PORT');
const bucketName = await testQenv.getEnvVarOnDemand('S3_BUCKET');
if (!accessKey || !accessSecret || !endpoint || !port || !bucketName) {
throw new Error('Missing S3 test configuration.');
}
testSmartbucket = new smartbucket.SmartBucket({
accessKey: await testQenv.getEnvVarOnDemand('S3_ACCESSKEY'),
accessSecret: await testQenv.getEnvVarOnDemand('S3_SECRETKEY'),
endpoint: await testQenv.getEnvVarOnDemand('S3_ENDPOINT'),
port: parseInt(await testQenv.getEnvVarOnDemand('S3_PORT')),
accessKey,
accessSecret,
endpoint,
port: Number.parseInt(port, 10),
useSsl: false,
});
testBucket = await smartbucket.Bucket.getBucketByName(
testSmartbucket,
await testQenv.getEnvVarOnDemand('S3_BUCKET')
bucketName
);
expect(testBucket).toBeInstanceOf(smartbucket.Bucket);
});
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartbucket',
version: '4.6.0',
version: '4.6.1',
description: 'A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.'
}
+4 -1
View File
@@ -7,7 +7,10 @@
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true,
"strict": true
"strict": true,
"types": [
"node"
]
},
"exclude": [
"dist_*/**/*.d.ts"