@satori-sh/cli 0.0.29 → 0.0.30

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/index.js CHANGED
@@ -365,16 +365,29 @@ ${instruction}`);
365
365
  return;
366
366
  }
367
367
  const info = await getInfoDisplay();
368
- if (typeof globalThis.Element === "undefined") {
369
- globalThis.Element = class Element {
370
- };
371
- }
372
368
  if (typeof globalThis.document === "undefined") {
373
- globalThis.document = {
374
- createElement: () => ({}),
375
- createElementNS: () => ({}),
376
- createTextNode: () => ({})
377
- };
369
+ const { parseHTML } = await import("linkedom");
370
+ const { document, window } = parseHTML("<html><body></body></html>");
371
+ const domWindow = window;
372
+ const globalScope = globalThis;
373
+ globalScope.window = window;
374
+ globalScope.document = document;
375
+ globalScope.Element = domWindow.Element;
376
+ globalScope.Node = domWindow.Node;
377
+ globalScope.Text = domWindow.Text;
378
+ globalScope.HTMLElement = domWindow.HTMLElement;
379
+ if (domWindow.SVGElement) {
380
+ globalScope.SVGElement = domWindow.SVGElement;
381
+ }
382
+ if (domWindow.SVGSVGElement) {
383
+ globalScope.SVGSVGElement = domWindow.SVGSVGElement;
384
+ }
385
+ if (domWindow.navigator) {
386
+ globalScope.navigator = domWindow.navigator;
387
+ }
388
+ if (domWindow.getComputedStyle) {
389
+ globalScope.getComputedStyle = domWindow.getComputedStyle;
390
+ }
378
391
  }
379
392
  const { runInteractiveApp } = await import("./ui-OEY6KRG2.js");
380
393
  await runInteractiveApp({
@@ -0,0 +1,5 @@
1
+ Allows you to aasci-ify any .png image
2
+
3
+ chafa -s 4x2 --symbols block satori.png > chafa.ans
4
+ const { default: fs } = await import("fs");
5
+ let logo = fs.readFileSync('./chafa.ans', 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@satori-sh/cli",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "CLI tool for Satori memory server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,6 +25,7 @@
25
25
  "chalk": "^5.6.2",
26
26
  "cli-spinners": "^3.4.0",
27
27
  "commander": "^12.1.0",
28
+ "linkedom": "^0.18.12",
28
29
  "random-words": "^2.0.1",
29
30
  "solid-js": "^1.9.10"
30
31
  },