@lionrapid/core 0.1.4-beta.2 → 0.2.0

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.
@@ -68,11 +68,12 @@ var LionRapid = (() => {
68
68
  })(LogLevel || {});
69
69
 
70
70
  // src/utils/logger.ts
71
- var IS_PRODUCTION = false;
72
- var IS_DEVELOPMENT = true;
73
- var IS_CI = false;
74
- var LIONRAPID_DEV = true;
75
- var PERFORMANCE_TRACKING = true;
71
+ var _ENV = typeof process !== "undefined" && process.env ? process.env : {};
72
+ var IS_PRODUCTION = _ENV.NODE_ENV === "production";
73
+ var IS_DEVELOPMENT = _ENV.NODE_ENV === "development";
74
+ var IS_CI = _ENV.CI === "true";
75
+ var LIONRAPID_DEV = _ENV.LIONRAPID_DEV === "true";
76
+ var PERFORMANCE_TRACKING = _ENV.LIONRAPID_PERFORMANCE_TRACKING === "true";
76
77
  function readBrowserLogLevel() {
77
78
  try {
78
79
  if (typeof localStorage !== "undefined") {
@@ -83,7 +84,7 @@ var LionRapid = (() => {
83
84
  }
84
85
  return null;
85
86
  }
86
- var LOG_LEVEL_ENV = readBrowserLogLevel() || "DEBUG";
87
+ var LOG_LEVEL_ENV = readBrowserLogLevel() || _ENV.LOG_LEVEL || "WARN";
87
88
  var Colors = {
88
89
  // Reset
89
90
  RESET: "\x1B[0m",
@@ -408,7 +409,9 @@ var LionRapid = (() => {
408
409
  constructor() {
409
410
  // ✅ Properly typed event listeners without `any`
410
411
  __publicField(this, "eventListeners", /* @__PURE__ */ new Map());
411
- __publicField(this, "debugMode", true);
412
+ // Browser-safe: `process` is undeclared in browsers; guard before reading.
413
+ // Bundlers still substitute `process.env.NODE_ENV` at build time.
414
+ __publicField(this, "debugMode", typeof process !== "undefined" && true);
412
415
  }
413
416
  /**
414
417
  * Subscribe to events (PUBLIC API) - Fully type-safe
@@ -1265,7 +1268,8 @@ var LionRapid = (() => {
1265
1268
  function parseTranslationParams(secondParam, thirdParam) {
1266
1269
  let defaultValue;
1267
1270
  let params;
1268
- if (typeof secondParam === "object" && typeof thirdParam === "object" && true) {
1271
+ const _isNotProd = typeof process === "undefined" || true;
1272
+ if (typeof secondParam === "object" && typeof thirdParam === "object" && _isNotProd) {
1269
1273
  console.warn(
1270
1274
  "[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."
1271
1275
  );