@eclipse-lyra/extension-memory-usage 0.0.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.
- package/dist/i18n.json.d.ts +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/memory-usage-extension-JQAD38xf.js +63 -0
- package/dist/memory-usage-extension-JQAD38xf.js.map +1 -0
- package/dist/memory-usage-extension.d.ts +1 -0
- package/dist/memory-usage-extension.d.ts.map +1 -0
- package/dist/memory-usage.d.ts +13 -0
- package/dist/memory-usage.d.ts.map +1 -0
- package/package.json +28 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"namespace": "extensions",
|
|
3
|
+
"en": {
|
|
4
|
+
"EXT_MEMORYUSAGE_NAME": "Memory Usage Monitor",
|
|
5
|
+
"EXT_MEMORYUSAGE_DESC": "Displays JavaScript heap memory usage in the bottom toolbar"
|
|
6
|
+
},
|
|
7
|
+
"de": {
|
|
8
|
+
"EXT_MEMORYUSAGE_NAME": "Speicherverbrauch-Monitor",
|
|
9
|
+
"EXT_MEMORYUSAGE_DESC": "Zeigt die JavaScript-Heap-Speichernutzung in der unteren Symbolleiste an"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default _default;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { contributionRegistry, SYSTEM_LANGUAGE_BUNDLES, i18nLazy, extensionRegistry } from "@eclipse-lyra/core";
|
|
2
|
+
import pkg from "../package.json";
|
|
3
|
+
const namespace = "extensions";
|
|
4
|
+
const en = { "EXT_MEMORYUSAGE_NAME": "Memory Usage Monitor", "EXT_MEMORYUSAGE_DESC": "Displays JavaScript heap memory usage in the bottom toolbar" };
|
|
5
|
+
const de = { "EXT_MEMORYUSAGE_NAME": "Speicherverbrauch-Monitor", "EXT_MEMORYUSAGE_DESC": "Zeigt die JavaScript-Heap-Speichernutzung in der unteren Symbolleiste an" };
|
|
6
|
+
const bundle = {
|
|
7
|
+
namespace,
|
|
8
|
+
en,
|
|
9
|
+
de
|
|
10
|
+
};
|
|
11
|
+
contributionRegistry.registerContribution(SYSTEM_LANGUAGE_BUNDLES, bundle);
|
|
12
|
+
const t = i18nLazy("extensions");
|
|
13
|
+
extensionRegistry.registerExtension({
|
|
14
|
+
id: pkg.name,
|
|
15
|
+
name: t("EXT_MEMORYUSAGE_NAME"),
|
|
16
|
+
description: t("EXT_MEMORYUSAGE_DESC"),
|
|
17
|
+
loader: () => import("./memory-usage-extension-JQAD38xf.js"),
|
|
18
|
+
icon: "microchip"
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { extensionRegistry, i18nLazy, contributionRegistry, SYSTEM_LANGUAGE_BUNDLES } from '@eclipse-lyra/core';\nimport bundle from './i18n.json';\nimport pkg from '../package.json';\n\ncontributionRegistry.registerContribution(SYSTEM_LANGUAGE_BUNDLES, bundle as any);\n\nconst t = i18nLazy('extensions');\n\nextensionRegistry.registerExtension({\n id: pkg.name,\n name: t('EXT_MEMORYUSAGE_NAME'),\n description: t('EXT_MEMORYUSAGE_DESC'),\n loader: () => import(\"./memory-usage-extension\"),\n icon: \"microchip\",\n \n \n});\n"],"names":[],"mappings":";;;;;;;;;;AAIA,qBAAqB,qBAAqB,yBAAyB,MAAa;AAEhF,MAAM,IAAI,SAAS,YAAY;AAE/B,kBAAkB,kBAAkB;AAAA,EAClC,IAAI,IAAI;AAAA,EACR,MAAM,EAAE,sBAAsB;AAAA,EAC9B,aAAa,EAAE,sBAAsB;AAAA,EACrC,QAAQ,MAAM,OAAO,sCAA0B;AAAA,EAC/C,MAAM;AAGR,CAAC;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LyraElement, contributionRegistry, TOOLBAR_BOTTOM } from "@eclipse-lyra/core";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
import { html } from "lit";
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
6
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
7
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8
|
+
if (decorator = decorators[i])
|
|
9
|
+
result = decorator(result) || result;
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
let LyraMemoryUsage = class extends LyraElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.updateInterval = null;
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
this.updateInterval = window.setInterval(() => {
|
|
20
|
+
this.requestUpdate();
|
|
21
|
+
}, 2e3);
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
super.disconnectedCallback();
|
|
25
|
+
if (this.updateInterval !== null) {
|
|
26
|
+
clearInterval(this.updateInterval);
|
|
27
|
+
this.updateInterval = null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const memory = performance.memory;
|
|
32
|
+
if (!memory) {
|
|
33
|
+
return html``;
|
|
34
|
+
}
|
|
35
|
+
const usedMB = (memory.usedJSHeapSize / 1048576).toFixed(1);
|
|
36
|
+
const limitMB = (memory.jsHeapSizeLimit / 1048576).toFixed(0);
|
|
37
|
+
const percentageNum = memory.usedJSHeapSize / memory.jsHeapSizeLimit * 100;
|
|
38
|
+
const percentage = percentageNum.toFixed(0);
|
|
39
|
+
const barColor = percentageNum > 80 ? "#ff4444" : percentageNum > 60 ? "#ffaa00" : "#44aa44";
|
|
40
|
+
return html`
|
|
41
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; height: 100%; padding-left: 0.5rem; gap: 0.25rem; font-size: 0.85em; color: var(--wa-color-neutral-text);" title="Main thread memory consumption only (excludes web workers)">
|
|
42
|
+
<wa-icon name="microchip" label="Memory usage"></wa-icon>
|
|
43
|
+
<span style="display: flex; align-items: center; gap: 0.25rem;">
|
|
44
|
+
<span>${usedMB} / ${limitMB} MB</span>
|
|
45
|
+
<span style="position: relative; display: inline-block; width: 60px; height: 14px; vertical-align: middle;">
|
|
46
|
+
<span style="display: block; position: absolute; width: 100%; height: 100%; background: rgba(255,255,255,0.1); border-radius: 4px;"></span>
|
|
47
|
+
<span style="display: block; position: absolute; width: ${percentage}%; height: 100%; background: ${barColor}; border-radius: 4px; transition: width 0.3s ease;"></span>
|
|
48
|
+
<span style="position: absolute; width: 100%; text-align: center; font-size: 0.7em; line-height: 14px; font-weight: 600; color: white; text-shadow: 0 0 2px rgba(0,0,0,0.8);">${percentage}%</span>
|
|
49
|
+
</span>
|
|
50
|
+
</span>
|
|
51
|
+
</span>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
LyraMemoryUsage = __decorateClass([
|
|
56
|
+
customElement("lyra-memory-usage")
|
|
57
|
+
], LyraMemoryUsage);
|
|
58
|
+
contributionRegistry.registerContribution(TOOLBAR_BOTTOM, {
|
|
59
|
+
target: TOOLBAR_BOTTOM,
|
|
60
|
+
label: "Memory",
|
|
61
|
+
html: `<lyra-memory-usage></lyra-memory-usage>`
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=memory-usage-extension-JQAD38xf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-usage-extension-JQAD38xf.js","sources":["../src/memory-usage.ts","../src/memory-usage-extension.ts"],"sourcesContent":["import {customElement} from \"lit/decorators.js\";\nimport {LyraElement} from \"@eclipse-lyra/core\";\nimport {html} from \"lit\";\n\n@customElement('lyra-memory-usage')\nexport class LyraMemoryUsage extends LyraElement {\n \n private updateInterval: number | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.updateInterval = window.setInterval(() => {\n this.requestUpdate();\n }, 2000);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this.updateInterval !== null) {\n clearInterval(this.updateInterval);\n this.updateInterval = null;\n }\n }\n\n protected render() {\n const memory = (performance as any).memory;\n if (!memory) {\n return html``;\n }\n \n const usedMB = (memory.usedJSHeapSize / 1048576).toFixed(1);\n const limitMB = (memory.jsHeapSizeLimit / 1048576).toFixed(0);\n const percentageNum = (memory.usedJSHeapSize / memory.jsHeapSizeLimit) * 100;\n const percentage = percentageNum.toFixed(0);\n \n const barColor = percentageNum > 80 ? '#ff4444' : percentageNum > 60 ? '#ffaa00' : '#44aa44';\n \n return html`\n <span style=\"display: inline-flex; align-items: center; justify-content: center; height: 100%; padding-left: 0.5rem; gap: 0.25rem; font-size: 0.85em; color: var(--wa-color-neutral-text);\" title=\"Main thread memory consumption only (excludes web workers)\">\n <wa-icon name=\"microchip\" label=\"Memory usage\"></wa-icon>\n <span style=\"display: flex; align-items: center; gap: 0.25rem;\">\n <span>${usedMB} / ${limitMB} MB</span>\n <span style=\"position: relative; display: inline-block; width: 60px; height: 14px; vertical-align: middle;\">\n <span style=\"display: block; position: absolute; width: 100%; height: 100%; background: rgba(255,255,255,0.1); border-radius: 4px;\"></span>\n <span style=\"display: block; position: absolute; width: ${percentage}%; height: 100%; background: ${barColor}; border-radius: 4px; transition: width 0.3s ease;\"></span>\n <span style=\"position: absolute; width: 100%; text-align: center; font-size: 0.7em; line-height: 14px; font-weight: 600; color: white; text-shadow: 0 0 2px rgba(0,0,0,0.8);\">${percentage}%</span>\n </span>\n </span>\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'lyra-memory-usage': LyraMemoryUsage\n }\n}\n\n","import {contributionRegistry, HTMLContribution} from \"@eclipse-lyra/core\";\nimport {TOOLBAR_BOTTOM} from \"@eclipse-lyra/core\";\nimport \"./memory-usage\";\n\ncontributionRegistry.registerContribution(TOOLBAR_BOTTOM, {\n target: TOOLBAR_BOTTOM,\n label: \"Memory\",\n html: `<lyra-memory-usage></lyra-memory-usage>`\n} as HTMLContribution)\n\n"],"names":[],"mappings":";;;;;;;;;;;AAKO,IAAM,kBAAN,cAA8B,YAAY;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA;AAEH,SAAQ,iBAAgC;AAAA,EAAA;AAAA,EAExC,oBAAoB;AAChB,UAAM,kBAAA;AACN,SAAK,iBAAiB,OAAO,YAAY,MAAM;AAC3C,WAAK,cAAA;AAAA,IACT,GAAG,GAAI;AAAA,EACX;AAAA,EAEA,uBAAuB;AACnB,UAAM,qBAAA;AACN,QAAI,KAAK,mBAAmB,MAAM;AAC9B,oBAAc,KAAK,cAAc;AACjC,WAAK,iBAAiB;AAAA,IAC1B;AAAA,EACJ;AAAA,EAEU,SAAS;AACf,UAAM,SAAU,YAAoB;AACpC,QAAI,CAAC,QAAQ;AACT,aAAO;AAAA,IACX;AAEA,UAAM,UAAU,OAAO,iBAAiB,SAAS,QAAQ,CAAC;AAC1D,UAAM,WAAW,OAAO,kBAAkB,SAAS,QAAQ,CAAC;AAC5D,UAAM,gBAAiB,OAAO,iBAAiB,OAAO,kBAAmB;AACzE,UAAM,aAAa,cAAc,QAAQ,CAAC;AAE1C,UAAM,WAAW,gBAAgB,KAAK,YAAY,gBAAgB,KAAK,YAAY;AAEnF,WAAO;AAAA;AAAA;AAAA;AAAA,4BAIa,MAAM,MAAM,OAAO;AAAA;AAAA;AAAA,kFAGmC,UAAU,gCAAgC,QAAQ;AAAA,wMACoE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK9M;AACJ;AA9Ca,kBAAN,gBAAA;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB,eAAA;ACDb,qBAAqB,qBAAqB,gBAAgB;AAAA,EACtD,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AACV,CAAqB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=memory-usage-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-usage-extension.d.ts","sourceRoot":"","sources":["../src/memory-usage-extension.ts"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LyraElement } from '@eclipse-lyra/core';
|
|
2
|
+
export declare class LyraMemoryUsage extends LyraElement {
|
|
3
|
+
private updateInterval;
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
disconnectedCallback(): void;
|
|
6
|
+
protected render(): import('lit-html').TemplateResult<1>;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'lyra-memory-usage': LyraMemoryUsage;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=memory-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-usage.d.ts","sourceRoot":"","sources":["../src/memory-usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAG/C,qBACa,eAAgB,SAAQ,WAAW;IAE5C,OAAO,CAAC,cAAc,CAAuB;IAE7C,iBAAiB;IAOjB,oBAAoB;IAQpB,SAAS,CAAC,MAAM;CA2BnB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,mBAAmB,EAAE,eAAe,CAAA;KACvC;CACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eclipse-lyra/extension-memory-usage",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@eclipse-lyra/core": "*"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^5.9.3",
|
|
17
|
+
"vite": "^7.1.12",
|
|
18
|
+
"vite-plugin-dts": "^4.5.4"
|
|
19
|
+
},
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "vite build"
|
|
27
|
+
}
|
|
28
|
+
}
|