ultimate-jekyll-manager 0.0.45 → 0.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ const RECHECK_DAYS = 0;
39
39
  const AI_MODEL = 'gpt-4.1-mini';
40
40
  const TRANSLATION_BRANCH = 'uj-translations';
41
41
  // const LOUD = false;
42
- const LOUD = process.env.UJ_LOUD_LOGS === 'true';
42
+ const LOUD = Manager.isServer() || process.env.UJ_LOUD_LOGS === 'true';
43
43
  const CONTROL = 'UJ-TRANSLATION-CONTROL';
44
44
 
45
45
  const TRANSLATION_DELAY_MS = 500; // wait between each translation
@@ -196,13 +196,13 @@ async function processTranslation() {
196
196
  try {
197
197
  meta = jetpack.read(metaPath, 'json');
198
198
  } catch (e) {
199
- logger.warn(`⚠️ Failed to parse meta for [${lang}], starting fresh`);
199
+ logger.warn(`⚠️ Meta: [${lang}] Failed to parse - starting fresh`);
200
200
  }
201
201
  }
202
202
 
203
203
  // Check if the promptHash matches; if not, invalidate the cache
204
204
  if (meta.prompt?.hash !== promptHash) {
205
- logger.warn(`⚠️ Prompt hash mismatch for [${lang}]. Invalidating cache.`);
205
+ logger.warn(`⚠️ Meta: [${lang}] Prompt hash mismatch - invalidating cache.`);
206
206
  meta = {};
207
207
  }
208
208
 
@@ -262,7 +262,7 @@ async function processTranslation() {
262
262
  const logTag = `[${lang}] ${relativePath}`;
263
263
 
264
264
  // Log
265
- logger.log(`🌐 Translation started: ${logTag}`);
265
+ logger.log(`🌐 Started: ${logTag}`);
266
266
 
267
267
  // Skip if the file is not in the meta or if it has no text nodes
268
268
  let translated = null;
@@ -295,14 +295,14 @@ async function processTranslation() {
295
295
  && jetpack.exists(cachePath)
296
296
  ) {
297
297
  translated = jetpack.read(cachePath);
298
- logger.log(`📦 Translation cache: ${logTag}`);
298
+ logger.log(`📦 Success: ${logTag} - Using cache`);
299
299
  } else {
300
300
  try {
301
301
  const { result, usage } = await translateWithAPI(openAIKey, bodyText, lang);
302
302
 
303
303
  // Log
304
304
  const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
305
- logger.log(`✅ Translation succeeded: ${logTag} (Elapsed time: ${elapsedTime}s)`);
305
+ logger.log(`✅ Success: ${logTag} - Translated (Elapsed time: ${elapsedTime}s)`);
306
306
 
307
307
  // Set translated result
308
308
  translated = result;
@@ -318,7 +318,7 @@ async function processTranslation() {
318
318
  setResult(true);
319
319
  } catch (e) {
320
320
  const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
321
- logger.error(`❌ Translation failed: ${logTag} — ${e.message} (Elapsed time: ${elapsedTime}s)`);
321
+ logger.error(`❌ Failed: ${logTag} — ${e.message} (Elapsed time: ${elapsedTime}s)`);
322
322
 
323
323
  // Set translated result
324
324
  translated = bodyText;
@@ -343,7 +343,7 @@ async function processTranslation() {
343
343
  const translation = match?.[1];
344
344
 
345
345
  if (!translation) {
346
- return logger.warn(`⚠️ Translation warning: ${logTag} - Could not find translated tag for index ${i}`);
346
+ return logger.warn(`⚠️ Warning: ${logTag} - Could not find translated tag for index ${i}`);
347
347
  }
348
348
 
349
349
  // Extract original leading and trailing whitespace
@@ -373,7 +373,7 @@ async function processTranslation() {
373
373
  controlTag.length === 0
374
374
  || controlTag.text() !== CONTROL
375
375
  ) {
376
- logger.error(`❌ Translation failed: ${logTag} — Control tag mismatch or missing`);
376
+ logger.error(`❌ Failed: ${logTag} — Control tag mismatch or missing`);
377
377
 
378
378
  return setResult(false);
379
379
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-jekyll-manager",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "Ultimate Jekyll dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {