fix(build): add Node types to tsconfig and update build dependencies for tsbuild 4.4.x
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# 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)
|
## 2026-04-07 - 4.6.0 - feat(bucket)
|
||||||
expose the underlying S3 client through getStorageClient()
|
expose the underlying S3 client through getStorageClient()
|
||||||
|
|
||||||
|
|||||||
Generated
-10417
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -9,17 +9,17 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --verbose --logfile --timeout 120)",
|
"test": "(tstest test/ --verbose --logfile --timeout 120)",
|
||||||
"build": "(tsbuild tsfolders --allowimplicitany)"
|
"build": "(tsbuild tsfolders)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "~4.3.0",
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
"@git.zone/tsrun": "^2.0.2",
|
"@git.zone/tsrun": "^2.0.2",
|
||||||
"@git.zone/tstest": "^3.6.3",
|
"@git.zone/tstest": "^3.6.3",
|
||||||
"@push.rocks/qenv": "^6.1.3",
|
"@push.rocks/qenv": "^6.1.3",
|
||||||
"@types/node": "^25.5.2"
|
"@types/node": "^25.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.1025.0",
|
"@aws-sdk/client-s3": "^3.1039.0",
|
||||||
"@push.rocks/smartmime": "^2.0.4",
|
"@push.rocks/smartmime": "^2.0.4",
|
||||||
"@push.rocks/smartpath": "^6.0.0",
|
"@push.rocks/smartpath": "^6.0.0",
|
||||||
"@push.rocks/smartpromise": "^4.2.3",
|
"@push.rocks/smartpromise": "^4.2.3",
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"@push.rocks/smartstream": "^3.4.0",
|
"@push.rocks/smartstream": "^3.4.0",
|
||||||
"@push.rocks/smartstring": "^4.1.0",
|
"@push.rocks/smartstring": "^4.1.0",
|
||||||
"@push.rocks/smartunique": "^3.0.9",
|
"@push.rocks/smartunique": "^3.0.9",
|
||||||
"@tsclass/tsclass": "^9.5.0",
|
"@tsclass/tsclass": "^9.5.1",
|
||||||
"minimatch": "^10.2.5"
|
"minimatch": "^10.2.5"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -73,5 +73,5 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/smartbucket.git"
|
"url": "https://code.foss.global/push.rocks/smartbucket.git"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
|
"packageManager": "pnpm@10.28.2"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+590
-588
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,5 +4,5 @@
|
|||||||
* **No *Strict methods**: All removed (fastPutStrict, getBucketByNameStrict, getFileStrict, getSubDirectoryByNameStrict)
|
* **No *Strict methods**: All removed (fastPutStrict, getBucketByNameStrict, getFileStrict, getSubDirectoryByNameStrict)
|
||||||
* metadata is handled though the MetaData class. Important!
|
* 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`.
|
* **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.
|
* **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.
|
||||||
|
|||||||
@@ -14,17 +14,27 @@ let testSmartbucket: smartbucket.SmartBucket;
|
|||||||
|
|
||||||
// Setup: Create test bucket
|
// Setup: Create test bucket
|
||||||
tap.test('should create valid smartbucket and bucket', async () => {
|
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({
|
testSmartbucket = new smartbucket.SmartBucket({
|
||||||
accessKey: await testQenv.getEnvVarOnDemand('S3_ACCESSKEY'),
|
accessKey,
|
||||||
accessSecret: await testQenv.getEnvVarOnDemand('S3_SECRETKEY'),
|
accessSecret,
|
||||||
endpoint: await testQenv.getEnvVarOnDemand('S3_ENDPOINT'),
|
endpoint,
|
||||||
port: parseInt(await testQenv.getEnvVarOnDemand('S3_PORT')),
|
port: Number.parseInt(port, 10),
|
||||||
useSsl: false,
|
useSsl: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
testBucket = await smartbucket.Bucket.getBucketByName(
|
testBucket = await smartbucket.Bucket.getBucketByName(
|
||||||
testSmartbucket,
|
testSmartbucket,
|
||||||
await testQenv.getEnvVarOnDemand('S3_BUCKET')
|
bucketName
|
||||||
);
|
);
|
||||||
expect(testBucket).toBeInstanceOf(smartbucket.Bucket);
|
expect(testBucket).toBeInstanceOf(smartbucket.Bucket);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartbucket',
|
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.'
|
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
@@ -7,7 +7,10 @@
|
|||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"strict": true
|
"strict": true,
|
||||||
|
"types": [
|
||||||
|
"node"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist_*/**/*.d.ts"
|
"dist_*/**/*.d.ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user