From 8119ff264c9de80ff71f0ebb0cf795c152dbadf1 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 24 Oct 2025 08:21:13 +0000 Subject: [PATCH] fix(logging): Refactor logging and plugin imports: remove push.rocks dependencies and provide a simple console-based logger with a compatibility shim --- changelog.md | 8 +++++++ deno.json | 6 +----- ts/00_commitinfo_data.ts | 2 +- ts/logging.ts | 45 ++++++++++++++++++++++------------------ ts/plugins.ts | 8 +------ 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/changelog.md b/changelog.md index 81d8f2d..772b146 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-10-24 - 1.2.2 - fix(logging) +Refactor logging and plugin imports: remove push.rocks dependencies and provide a simple console-based logger with a compatibility shim + +- Replaced smartlog-based logger with a simple console-based log utility in ts/logging.ts; added a small logger shim (logger.log) for compatibility. +- Removed push.rocks exports from ts/plugins.ts and consolidated external imports to std modules (@std/*); updated deno.json to remove push.rocks packages and keep @std/cli. +- Updated code to use the new console logger and simplified plugin surface; this reduces external dependencies and simplifies runtime footprint. +- Added .claude/settings.local.json (local settings file) — development/local config only, no runtime change. + ## 2025-10-24 - 1.2.1 - fix(deno) Set Deno nodeModulesDir to 'auto' and add local .claude settings diff --git a/deno.json b/deno.json index cf3c4ec..624e78f 100644 --- a/deno.json +++ b/deno.json @@ -19,11 +19,7 @@ "@std/yaml": "jsr:@std/yaml@^1.0.0", "@std/assert": "jsr:@std/assert@^1.0.0", "@std/fmt": "jsr:@std/fmt@^1.0.0", - "@push.rocks/smartcli": "npm:@push.rocks/smartcli@^5.0.0", - "@push.rocks/smartlog": "npm:@push.rocks/smartlog@^3.0.0", - "@push.rocks/smartfile": "npm:@push.rocks/smartfile@^11.0.0", - "@push.rocks/smartpromise": "npm:@push.rocks/smartpromise@^4.0.0", - "@push.rocks/smartrequest": "npm:@push.rocks/smartrequest@^2.0.0" + "@std/cli": "jsr:@std/cli@^1.0.0" }, "nodeModulesDir": "auto", "compilerOptions": { diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 8c6aada..f8dc2e3 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/isocreator', - version: '1.2.1', + version: '1.2.2', description: 'Ubuntu ISO customization tool for PC and Raspberry Pi with WiFi and cloud-init configuration' } diff --git a/ts/logging.ts b/ts/logging.ts index 39bf9b2..3263a77 100644 --- a/ts/logging.ts +++ b/ts/logging.ts @@ -1,29 +1,34 @@ /** * Logging utilities for isocreator + * Simple console-based logging (following nupst pattern) */ -import { smartlog } from './plugins.ts'; - -// Create logger instance -export const logger = new smartlog.Smartlog({ - logContext: { - company: 'Lossless GmbH', - companyunit: 'serve.zone', - containerName: 'isocreator', - environment: 'cli', - runtime: 'deno', - zone: 'local', - }, - minimumLogLevel: 'info', -}); - /** * Log levels for convenience */ export const log = { - info: (message: string) => logger.log('info', message), - success: (message: string) => logger.log('info', `✅ ${message}`), - warn: (message: string) => logger.log('warn', `⚠️ ${message}`), - error: (message: string) => logger.log('error', `❌ ${message}`), - debug: (message: string) => logger.log('silly', message), + info: (message: string) => console.log(`ℹ️ ${message}`), + success: (message: string) => console.log(`✅ ${message}`), + warn: (message: string) => console.warn(`⚠️ ${message}`), + error: (message: string) => console.error(`❌ ${message}`), + debug: (message: string) => console.log(`🔍 ${message}`), +}; + +// Export a simple logger object for compatibility +export const logger = { + log: (level: string, message: string) => { + switch (level) { + case 'info': + log.info(message); + break; + case 'warn': + log.warn(message); + break; + case 'error': + log.error(message); + break; + default: + console.log(message); + } + }, }; diff --git a/ts/plugins.ts b/ts/plugins.ts index 3f10b90..935ad04 100644 --- a/ts/plugins.ts +++ b/ts/plugins.ts @@ -9,10 +9,4 @@ export * as fs from '@std/fs'; export * as yaml from '@std/yaml'; export * as assert from '@std/assert'; export * as fmt from '@std/fmt'; - -// Push.rocks ecosystem -export { smartcli } from '@push.rocks/smartcli'; -export { smartlog } from '@push.rocks/smartlog'; -export { smartfile } from '@push.rocks/smartfile'; -export { Deferred } from '@push.rocks/smartpromise'; -export { smartrequest } from '@push.rocks/smartrequest'; +export * as cli from '@std/cli';