fix(build): modernize project tooling and package metadata

This commit is contained in:
2026-05-01 15:48:19 +00:00
parent 2302632f11
commit 73a8389ec5
12 changed files with 3366 additions and 5868 deletions
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartantivirus',
version: '1.3.2',
version: '1.3.3',
description: 'A Node.js package providing integration with ClamAV for anti-virus scanning, facilitating both Docker containerized management and direct connection to a ClamAV daemon.'
}
+8 -4
View File
@@ -110,8 +110,11 @@ export class ClamAVManager extends EventEmitter {
}
} catch (error) {
// Check if the error is due to freshclam already running
if (error.stderr?.includes('ERROR: Problem with internal logger') ||
error.stdout?.includes('Resource temporarily unavailable')) {
const execError = error as { stderr?: string; stdout?: string };
if (
execError.stderr?.includes('ERROR: Problem with internal logger') ||
execError.stdout?.includes('Resource temporarily unavailable')
) {
console.log('Freshclam is already running, skipping manual update');
return;
}
@@ -153,7 +156,7 @@ export class ClamAVManager extends EventEmitter {
logProcess.stdout.on('data', (data) => {
const lines = data.toString().split('\n');
lines.forEach(line => {
lines.forEach((line: string) => {
if (!line.trim()) return;
const event: ClamAVLogEvent = {
@@ -255,7 +258,8 @@ export class ClamAVManager extends EventEmitter {
// Service not ready yet, will retry
if (checkCount >= maxChecks) {
cleanup();
reject(new Error(`ClamAV initialization timed out after ${maxChecks} seconds. Last error: ${error.message}`));
const errorMessage = error instanceof Error ? error.message : String(error);
reject(new Error(`ClamAV initialization timed out after ${maxChecks} seconds. Last error: ${errorMessage}`));
return;
}
checkCount++;
+2 -11
View File
@@ -17,26 +17,17 @@ export {
EventEmitter,
net,
http,
https
https,
};
// @push.rocks scope
import * as smartpath from '@push.rocks/smartpath';
import * as smartfile from '@push.rocks/smartfile';
import * as smartstream from '@push.rocks/smartstream';
export {
smartpath,
smartfile,
smartstream,
};
// Third party scope
import axios from 'axios';
export {
axios
};
// Common utilities
export const execAsync = promisify(exec);
export const execAsync = promisify(exec);