@lionrapid/core 0.1.4-beta.2 → 0.2.1

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.
@@ -80,11 +80,12 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
80
80
  })(LogLevel || {});
81
81
 
82
82
  // src/utils/logger.ts
83
- var IS_PRODUCTION = true;
84
- var IS_DEVELOPMENT = false;
85
- var IS_CI = false;
86
- var LIONRAPID_DEV = false;
87
- var PERFORMANCE_TRACKING = false;
83
+ var _ENV = typeof process !== "undefined" && process.env ? process.env : {};
84
+ var IS_PRODUCTION = _ENV.NODE_ENV === "production";
85
+ var IS_DEVELOPMENT = _ENV.NODE_ENV === "development";
86
+ var IS_CI = _ENV.CI === "true";
87
+ var LIONRAPID_DEV = _ENV.LIONRAPID_DEV === "true";
88
+ var PERFORMANCE_TRACKING = _ENV.LIONRAPID_PERFORMANCE_TRACKING === "true";
88
89
  function readBrowserLogLevel() {
89
90
  try {
90
91
  if (typeof localStorage !== "undefined") {
@@ -95,7 +96,7 @@ function readBrowserLogLevel() {
95
96
  }
96
97
  return null;
97
98
  }
98
- var LOG_LEVEL_ENV = readBrowserLogLevel() || "" || "WARN";
99
+ var LOG_LEVEL_ENV = readBrowserLogLevel() || _ENV.LOG_LEVEL || "WARN";
99
100
  var Colors = {
100
101
  // Reset
101
102
  RESET: "\x1B[0m",
@@ -420,7 +421,9 @@ var EventEmitter = class {
420
421
  constructor() {
421
422
  // ✅ Properly typed event listeners without `any`
422
423
  __publicField(this, "eventListeners", /* @__PURE__ */ new Map());
423
- __publicField(this, "debugMode", false);
424
+ // Browser-safe: `process` is undeclared in browsers; guard before reading.
425
+ // Bundlers still substitute `process.env.NODE_ENV` at build time.
426
+ __publicField(this, "debugMode", typeof process !== "undefined" && false);
424
427
  }
425
428
  /**
426
429
  * Subscribe to events (PUBLIC API) - Fully type-safe
@@ -1277,7 +1280,8 @@ function prepareTranslationRequest(key, currentLocale, defaultValueOrParams, par
1277
1280
  function parseTranslationParams(secondParam, thirdParam) {
1278
1281
  let defaultValue;
1279
1282
  let params;
1280
- if (typeof secondParam === "object" && typeof thirdParam === "object" && false) {
1283
+ const _isNotProd = typeof process === "undefined" || false;
1284
+ if (typeof secondParam === "object" && typeof thirdParam === "object" && _isNotProd) {
1281
1285
  console.warn(
1282
1286
  "[LionRapid] Warning: Both secondParam and thirdParam are objects. Expected pattern: t(key, params, defaultValue) or t(key, defaultValue, params). Second object will be ignored as it cannot be a defaultValue."
1283
1287
  );