@module-federation/bridge-shared
Advanced tools
Comparing version 0.0.0-next-20241101093646 to 0.0.0-next-20241104024700
# @module-federation/bridge-shared | ||
## 0.0.0-next-20241101093646 | ||
## 0.0.0-next-20241104024700 | ||
## 0.6.15 | ||
## 0.6.14 | ||
### Patch Changes | ||
- ad605d2: chore: unified logger | ||
## 0.6.13 | ||
## 0.6.12 | ||
## 0.6.11 | ||
@@ -6,0 +18,0 @@ |
export type { RenderFnParams, ProviderParams } from './type'; | ||
export { Logger } from './logger'; | ||
export { dispatchPopstateEnv } from './env'; |
@@ -1,39 +0,7 @@ | ||
var a = Object.defineProperty; | ||
var c = (s, e, t) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t; | ||
var i = (s, e, t) => (c(s, typeof e != "symbol" ? e + "" : e, t), t); | ||
class g { | ||
constructor(e) { | ||
i(this, "name"); | ||
i(this, "isDebugEnabled"); | ||
i(this, "color"); | ||
this.name = e, this.isDebugEnabled = !1, this.color = this.stringToColor(e), typeof window < "u" && typeof localStorage < "u" && (this.isDebugEnabled = localStorage.getItem("debug") === "true"), typeof process < "u" && process.env && (this.isDebugEnabled = process.env.DEBUG === "true"); | ||
} | ||
log(...e) { | ||
var t, n; | ||
if (this.isDebugEnabled) { | ||
const o = `color: ${this.color}; font-weight: bold`, l = `%c[${this.name}]`, r = ((n = (t = new Error().stack) == null ? void 0 : t.split(` | ||
`)[2]) == null ? void 0 : n.trim()) || "Stack information not available"; | ||
typeof console < "u" && console.debug && console.debug(l, o, ...e, ` | ||
(${r})`); | ||
} | ||
} | ||
stringToColor(e) { | ||
let t = 0; | ||
for (let o = 0; o < e.length; o++) | ||
t = e.charCodeAt(o) + ((t << 5) - t); | ||
let n = "#"; | ||
for (let o = 0; o < 3; o++) { | ||
const l = t >> o * 8 & 255; | ||
n += ("00" + l.toString(16)).substr(-2); | ||
} | ||
return n; | ||
} | ||
function e() { | ||
const t = new PopStateEvent("popstate", { state: window.history.state }); | ||
window.dispatchEvent(t); | ||
} | ||
function f() { | ||
const s = new PopStateEvent("popstate", { state: window.history.state }); | ||
window.dispatchEvent(s); | ||
} | ||
export { | ||
g as Logger, | ||
f as dispatchPopstateEnv | ||
e as dispatchPopstateEnv | ||
}; |
@@ -1,3 +0,1 @@ | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["bridge-shared"]={}))})(this,function(e){"use strict";var f=Object.defineProperty;var u=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var d=(e,t,n)=>(u(e,typeof t!="symbol"?t+"":t,n),n);class t{constructor(s){d(this,"name");d(this,"isDebugEnabled");d(this,"color");this.name=s,this.isDebugEnabled=!1,this.color=this.stringToColor(s),typeof window<"u"&&typeof localStorage<"u"&&(this.isDebugEnabled=localStorage.getItem("debug")==="true"),typeof process<"u"&&process.env&&(this.isDebugEnabled=process.env.DEBUG==="true")}log(...s){var i,l;if(this.isDebugEnabled){const o=`color: ${this.color}; font-weight: bold`,r=`%c[${this.name}]`,c=((l=(i=new Error().stack)==null?void 0:i.split(` | ||
`)[2])==null?void 0:l.trim())||"Stack information not available";typeof console<"u"&&console.debug&&console.debug(r,o,...s,` | ||
(${c})`)}}stringToColor(s){let i=0;for(let o=0;o<s.length;o++)i=s.charCodeAt(o)+((i<<5)-i);let l="#";for(let o=0;o<3;o++){const r=i>>o*8&255;l+=("00"+r.toString(16)).substr(-2)}return l}}function n(){const a=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(a)}e.Logger=t,e.dispatchPopstateEnv=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["bridge-shared"]={}))})(this,function(e){"use strict";function t(){const n=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(n)}e.dispatchPopstateEnv=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@module-federation/bridge-shared", | ||
"version": "0.0.0-next-20241101093646", | ||
"version": "0.0.0-next-20241104024700", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
export type { RenderFnParams, ProviderParams } from './type'; | ||
export { Logger } from './logger'; | ||
export { dispatchPopstateEnv } from './env'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6206
19
121