@xylabs/base 4.13.13 → 4.13.14
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.
package/dist/neutral/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var disableGloballyUnique = () => {
|
|
|
10
10
|
xyoGlobal().uniqueDisabled = true;
|
|
11
11
|
};
|
|
12
12
|
var globallyUnique = (name, value, domain = "global") => {
|
|
13
|
-
const uniqueName = [domain, name].join(":");
|
|
13
|
+
const uniqueName = domain === "bundle" ? [domain, name].join(":") : [domain, import.meta.url, name].join(":");
|
|
14
14
|
if (!xyoGlobal().uniqueDisabled) {
|
|
15
15
|
const xylabs = globalThis.xylabs = globalThis.xylabs ?? {};
|
|
16
16
|
const unique = xylabs.unique = xylabs.unique ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Base.ts","../../src/globallyUnique.ts"],"sourcesContent":["import type {\n Meter,\n MeterProvider, Tracer, TracerProvider,\n} from '@opentelemetry/api'\nimport { assertEx } from '@xylabs/assert'\nimport type { Logger } from '@xylabs/logger'\nimport type { EmptyObject } from '@xylabs/object'\n\nimport { globallyUnique } from './globallyUnique.ts'\n\nconst DEFAULT_HISTORY_INTERVAL = 1000 * 5\nconst DEFAULT_HISTORY_TIME = 60 * 60 * 1000\nconst MAX_GC_FREQUENCY = 1000 * 60\nconst MIN_GC_FREQUENCY = 1000\nconst MIN_HISTORY_INTERVAL = 1000\n\nexport type BaseClassName = Exclude<string, 'base-class-name-reserved-32546239486'>\n\nexport type BaseParamsFields = {\n logger?: Logger\n meterProvider?: MeterProvider\n traceProvider?: TracerProvider\n}\n\nexport type BaseParams<TAdditionalParams extends EmptyObject = EmptyObject> = TAdditionalParams & BaseParamsFields\n\nexport abstract class Base<TParams extends BaseParams = BaseParams> {\n static defaultLogger?: Logger\n static readonly globalInstances: Record<BaseClassName, WeakRef<Base>[]> = {}\n static readonly globalInstancesCountHistory: Record<BaseClassName, number[]> = {}\n static readonly uniqueName = globallyUnique(this.name, this, 'xyo')\n private static _historyInterval = DEFAULT_HISTORY_INTERVAL\n private static _historyTime = DEFAULT_HISTORY_TIME\n private static _historyTimeout?: ReturnType<typeof setTimeout>\n private static _lastGC = 0\n private static _maxGcFrequency = MAX_GC_FREQUENCY\n private _params: BaseParams<TParams>\n\n constructor(params: BaseParams<TParams>) {\n this._params = params\n params?.logger?.debug(`Base constructed [${Object(this).name}]`)\n this.recordInstance()\n }\n\n static get historyInterval() {\n return this._historyInterval\n }\n\n static set historyInterval(value: number) {\n assertEx(value <= this.historyTime, () => `historyInterval [${value}] must be less than or equal to historyTime [${this.historyTime}]`)\n this._historyInterval = Math.max(value, MIN_HISTORY_INTERVAL)\n }\n\n static get historyTime() {\n return this._historyTime\n }\n\n static set historyTime(value: number) {\n assertEx(value >= this.historyInterval, () => `historyTime [${value}] must be greater than or equal to historyInterval [${this.historyInterval}]`)\n this._historyInterval = value\n }\n\n static get maxGcFrequency() {\n return this._maxGcFrequency\n }\n\n static set maxGcFrequency(value: number) {\n this._maxGcFrequency = Math.max(value, MIN_GC_FREQUENCY)\n }\n\n static get maxHistoryDepth() {\n return Math.floor(this.historyTime / this.historyInterval)\n }\n\n get logger() {\n return this.params?.logger ?? Base.defaultLogger\n }\n\n get meter(): Meter | undefined {\n return this.params?.meterProvider?.getMeter(this.constructor.name)\n }\n\n get params() {\n return this._params\n }\n\n get tracer(): Tracer | undefined {\n return this.params?.traceProvider?.getTracer(this.constructor.name)\n }\n\n static gc(force?: boolean): void\n static gc(className: string): void\n static gc(classNameOrForce: string | boolean = false): void {\n if (typeof classNameOrForce === 'string') {\n this.gcClass(classNameOrForce)\n } else {\n if (classNameOrForce || Date.now() - this._lastGC > this._maxGcFrequency) {\n this.gcAll()\n }\n }\n }\n\n static instanceCount(className: string): number {\n return this.globalInstances[className]?.length ?? 0\n }\n\n static instanceCounts(): Record<BaseClassName, number> {\n this.gc()\n const result: Record<BaseClassName, number> = {}\n for (const [className, instances] of Object.entries(this.globalInstances)) result[className] = instances.length\n return result\n }\n\n static startHistory(): void {\n if (this._historyTimeout) {\n this.stopHistory()\n }\n\n const timeoutHandler = () => {\n if (this._historyTimeout) {\n this.addToHistory()\n this._historyTimeout = setTimeout(timeoutHandler, this.historyInterval)\n }\n }\n\n this._historyTimeout = setTimeout(timeoutHandler, this.historyInterval)\n }\n\n static stopHistory(): void {\n if (this._historyTimeout) {\n clearTimeout(this._historyTimeout)\n this._historyTimeout = undefined\n }\n }\n\n private static addToHistory() {\n const counts = this.instanceCounts()\n for (const className of Object.keys(this.globalInstances)) {\n this.globalInstancesCountHistory[className] = this.globalInstancesCountHistory[className]?.slice(-this.maxHistoryDepth) ?? []\n this.globalInstancesCountHistory[className].push(counts[className])\n }\n }\n\n private static gcAll() {\n for (const className of Object.keys(this.globalInstances)) {\n this.gcClass(className)\n }\n }\n\n private static gcClass(className: BaseClassName) {\n // remove all the weak refs that are now empty\n this.globalInstances[className] = this.globalInstances[className]?.filter(ref => ref.deref() !== null) ?? []\n }\n\n private recordInstance() {\n const instanceArray = Base.globalInstances[this.constructor.name] ?? []\n instanceArray.push(new WeakRef(this))\n Base.globalInstances[this.constructor.name] = instanceArray\n }\n}\n","declare global {\n var xylabs: {\n unique: Record<string, unknown>\n uniqueDisabled?: boolean\n }\n}\n\nconst xyoGlobal = () => {\n globalThis.xylabs = globalThis.xylabs ?? {}\n return globalThis.xylabs\n}\n\nexport const disableGloballyUnique = () => {\n xyoGlobal().uniqueDisabled = true\n}\n\nexport const globallyUnique = (name: string, value: unknown, domain = 'global') => {\n const uniqueName = [domain, name].join(':')\n if (!xyoGlobal().uniqueDisabled) {\n const xylabs = globalThis.xylabs = globalThis.xylabs ?? {}\n const unique = (xylabs.unique = xylabs.unique ?? {})\n if (unique[uniqueName] === undefined) {\n unique[uniqueName] = value\n } else {\n if (unique[uniqueName] !== value) {\n throw new Error(\n `Global unique item ${uniqueName} already defined. Make sure you are not importing two versions of the package that contains this item`,\n )\n }\n }\n }\n return uniqueName\n}\n"],"mappings":";AAIA,SAAS,gBAAgB;;;ACGzB,IAAM,YAAY,MAAM;AACtB,aAAW,SAAS,WAAW,UAAU,CAAC;AAC1C,SAAO,WAAW;AACpB;AAEO,IAAM,wBAAwB,MAAM;AACzC,YAAU,EAAE,iBAAiB;AAC/B;AAEO,IAAM,iBAAiB,CAAC,MAAc,OAAgB,SAAS,aAAa;AACjF,QAAM,aAAa,CAAC,QAAQ,IAAI,EAAE,KAAK,GAAG;
|
|
1
|
+
{"version":3,"sources":["../../src/Base.ts","../../src/globallyUnique.ts"],"sourcesContent":["import type {\n Meter,\n MeterProvider, Tracer, TracerProvider,\n} from '@opentelemetry/api'\nimport { assertEx } from '@xylabs/assert'\nimport type { Logger } from '@xylabs/logger'\nimport type { EmptyObject } from '@xylabs/object'\n\nimport { globallyUnique } from './globallyUnique.ts'\n\nconst DEFAULT_HISTORY_INTERVAL = 1000 * 5\nconst DEFAULT_HISTORY_TIME = 60 * 60 * 1000\nconst MAX_GC_FREQUENCY = 1000 * 60\nconst MIN_GC_FREQUENCY = 1000\nconst MIN_HISTORY_INTERVAL = 1000\n\nexport type BaseClassName = Exclude<string, 'base-class-name-reserved-32546239486'>\n\nexport type BaseParamsFields = {\n logger?: Logger\n meterProvider?: MeterProvider\n traceProvider?: TracerProvider\n}\n\nexport type BaseParams<TAdditionalParams extends EmptyObject = EmptyObject> = TAdditionalParams & BaseParamsFields\n\nexport abstract class Base<TParams extends BaseParams = BaseParams> {\n static defaultLogger?: Logger\n static readonly globalInstances: Record<BaseClassName, WeakRef<Base>[]> = {}\n static readonly globalInstancesCountHistory: Record<BaseClassName, number[]> = {}\n static readonly uniqueName = globallyUnique(this.name, this, 'xyo')\n private static _historyInterval = DEFAULT_HISTORY_INTERVAL\n private static _historyTime = DEFAULT_HISTORY_TIME\n private static _historyTimeout?: ReturnType<typeof setTimeout>\n private static _lastGC = 0\n private static _maxGcFrequency = MAX_GC_FREQUENCY\n private _params: BaseParams<TParams>\n\n constructor(params: BaseParams<TParams>) {\n this._params = params\n params?.logger?.debug(`Base constructed [${Object(this).name}]`)\n this.recordInstance()\n }\n\n static get historyInterval() {\n return this._historyInterval\n }\n\n static set historyInterval(value: number) {\n assertEx(value <= this.historyTime, () => `historyInterval [${value}] must be less than or equal to historyTime [${this.historyTime}]`)\n this._historyInterval = Math.max(value, MIN_HISTORY_INTERVAL)\n }\n\n static get historyTime() {\n return this._historyTime\n }\n\n static set historyTime(value: number) {\n assertEx(value >= this.historyInterval, () => `historyTime [${value}] must be greater than or equal to historyInterval [${this.historyInterval}]`)\n this._historyInterval = value\n }\n\n static get maxGcFrequency() {\n return this._maxGcFrequency\n }\n\n static set maxGcFrequency(value: number) {\n this._maxGcFrequency = Math.max(value, MIN_GC_FREQUENCY)\n }\n\n static get maxHistoryDepth() {\n return Math.floor(this.historyTime / this.historyInterval)\n }\n\n get logger() {\n return this.params?.logger ?? Base.defaultLogger\n }\n\n get meter(): Meter | undefined {\n return this.params?.meterProvider?.getMeter(this.constructor.name)\n }\n\n get params() {\n return this._params\n }\n\n get tracer(): Tracer | undefined {\n return this.params?.traceProvider?.getTracer(this.constructor.name)\n }\n\n static gc(force?: boolean): void\n static gc(className: string): void\n static gc(classNameOrForce: string | boolean = false): void {\n if (typeof classNameOrForce === 'string') {\n this.gcClass(classNameOrForce)\n } else {\n if (classNameOrForce || Date.now() - this._lastGC > this._maxGcFrequency) {\n this.gcAll()\n }\n }\n }\n\n static instanceCount(className: string): number {\n return this.globalInstances[className]?.length ?? 0\n }\n\n static instanceCounts(): Record<BaseClassName, number> {\n this.gc()\n const result: Record<BaseClassName, number> = {}\n for (const [className, instances] of Object.entries(this.globalInstances)) result[className] = instances.length\n return result\n }\n\n static startHistory(): void {\n if (this._historyTimeout) {\n this.stopHistory()\n }\n\n const timeoutHandler = () => {\n if (this._historyTimeout) {\n this.addToHistory()\n this._historyTimeout = setTimeout(timeoutHandler, this.historyInterval)\n }\n }\n\n this._historyTimeout = setTimeout(timeoutHandler, this.historyInterval)\n }\n\n static stopHistory(): void {\n if (this._historyTimeout) {\n clearTimeout(this._historyTimeout)\n this._historyTimeout = undefined\n }\n }\n\n private static addToHistory() {\n const counts = this.instanceCounts()\n for (const className of Object.keys(this.globalInstances)) {\n this.globalInstancesCountHistory[className] = this.globalInstancesCountHistory[className]?.slice(-this.maxHistoryDepth) ?? []\n this.globalInstancesCountHistory[className].push(counts[className])\n }\n }\n\n private static gcAll() {\n for (const className of Object.keys(this.globalInstances)) {\n this.gcClass(className)\n }\n }\n\n private static gcClass(className: BaseClassName) {\n // remove all the weak refs that are now empty\n this.globalInstances[className] = this.globalInstances[className]?.filter(ref => ref.deref() !== null) ?? []\n }\n\n private recordInstance() {\n const instanceArray = Base.globalInstances[this.constructor.name] ?? []\n instanceArray.push(new WeakRef(this))\n Base.globalInstances[this.constructor.name] = instanceArray\n }\n}\n","declare global {\n var xylabs: {\n unique: Record<string, unknown>\n uniqueDisabled?: boolean\n }\n}\n\nconst xyoGlobal = () => {\n globalThis.xylabs = globalThis.xylabs ?? {}\n return globalThis.xylabs\n}\n\nexport const disableGloballyUnique = () => {\n xyoGlobal().uniqueDisabled = true\n}\n\nexport const globallyUnique = (name: string, value: unknown, domain = 'global') => {\n const uniqueName = domain === 'bundle' ? [domain, name].join(':') : [domain, import.meta.url, name].join(':')\n if (!xyoGlobal().uniqueDisabled) {\n const xylabs = globalThis.xylabs = globalThis.xylabs ?? {}\n const unique = (xylabs.unique = xylabs.unique ?? {})\n if (unique[uniqueName] === undefined) {\n unique[uniqueName] = value\n } else {\n if (unique[uniqueName] !== value) {\n throw new Error(\n `Global unique item ${uniqueName} already defined. Make sure you are not importing two versions of the package that contains this item`,\n )\n }\n }\n }\n return uniqueName\n}\n"],"mappings":";AAIA,SAAS,gBAAgB;;;ACGzB,IAAM,YAAY,MAAM;AACtB,aAAW,SAAS,WAAW,UAAU,CAAC;AAC1C,SAAO,WAAW;AACpB;AAEO,IAAM,wBAAwB,MAAM;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AC;AACpC,UAAK,gBAAgB,KAAK,YAAY,IAAI,IAAI;AAAA,EAChD;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/base",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.14",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
|
-
"@xylabs/assert": "^4.13.
|
|
34
|
-
"@xylabs/logger": "^4.13.
|
|
35
|
-
"@xylabs/object": "^4.13.
|
|
33
|
+
"@xylabs/assert": "^4.13.14",
|
|
34
|
+
"@xylabs/logger": "^4.13.14",
|
|
35
|
+
"@xylabs/object": "^4.13.14"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.
|
|
39
|
-
"@xylabs/tsconfig": "^7.0.0-rc.
|
|
38
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.12",
|
|
39
|
+
"@xylabs/tsconfig": "^7.0.0-rc.12",
|
|
40
40
|
"tslib": "^2.8.1",
|
|
41
41
|
"typescript": "^5.8.3"
|
|
42
42
|
},
|
package/src/globallyUnique.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const disableGloballyUnique = () => {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const globallyUnique = (name: string, value: unknown, domain = 'global') => {
|
|
18
|
-
const uniqueName = [domain, name].join(':')
|
|
18
|
+
const uniqueName = domain === 'bundle' ? [domain, name].join(':') : [domain, import.meta.url, name].join(':')
|
|
19
19
|
if (!xyoGlobal().uniqueDisabled) {
|
|
20
20
|
const xylabs = globalThis.xylabs = globalThis.xylabs ?? {}
|
|
21
21
|
const unique = (xylabs.unique = xylabs.unique ?? {})
|