@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.
@@ -52,11 +52,12 @@ var LionRapid = (() => {
52
52
  })(LogLevel || {});
53
53
 
54
54
  // src/utils/logger.ts
55
- var IS_PRODUCTION = true;
56
- var IS_DEVELOPMENT = false;
57
- var IS_CI = false;
58
- var LIONRAPID_DEV = false;
59
- var PERFORMANCE_TRACKING = false;
55
+ var _ENV = typeof process !== "undefined" && process.env ? process.env : {};
56
+ var IS_PRODUCTION = _ENV.NODE_ENV === "production";
57
+ var IS_DEVELOPMENT = _ENV.NODE_ENV === "development";
58
+ var IS_CI = _ENV.CI === "true";
59
+ var LIONRAPID_DEV = _ENV.LIONRAPID_DEV === "true";
60
+ var PERFORMANCE_TRACKING = _ENV.LIONRAPID_PERFORMANCE_TRACKING === "true";
60
61
  function readBrowserLogLevel() {
61
62
  try {
62
63
  if (typeof localStorage !== "undefined") {
@@ -67,7 +68,7 @@ var LionRapid = (() => {
67
68
  }
68
69
  return null;
69
70
  }
70
- var LOG_LEVEL_ENV = readBrowserLogLevel() || "" || "WARN";
71
+ var LOG_LEVEL_ENV = readBrowserLogLevel() || _ENV.LOG_LEVEL || "WARN";
71
72
  var Colors = {
72
73
  // Reset
73
74
  RESET: "\x1B[0m",
@@ -339,7 +340,9 @@ var LionRapid = (() => {
339
340
  constructor() {
340
341
  // ✅ Properly typed event listeners without `any`
341
342
  __publicField(this, "eventListeners", /* @__PURE__ */ new Map());
342
- __publicField(this, "debugMode", false);
343
+ // Browser-safe: `process` is undeclared in browsers; guard before reading.
344
+ // Bundlers still substitute `process.env.NODE_ENV` at build time.
345
+ __publicField(this, "debugMode", typeof process !== "undefined" && false);
343
346
  }
344
347
  /**
345
348
  * Subscribe to events (PUBLIC API) - Fully type-safe
@@ -1196,7 +1199,8 @@ var LionRapid = (() => {
1196
1199
  function parseTranslationParams(secondParam, thirdParam) {
1197
1200
  let defaultValue;
1198
1201
  let params;
1199
- if (typeof secondParam === "object" && typeof thirdParam === "object" && false) {
1202
+ const _isNotProd = typeof process === "undefined" || false;
1203
+ if (typeof secondParam === "object" && typeof thirdParam === "object" && _isNotProd) {
1200
1204
  console.warn(
1201
1205
  "[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."
1202
1206
  );