Unverified Commit 9b970ef1 authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge tag '1.8.3'

Fedify 1.8.3
parents 7733c1d8 acaec866
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -354,8 +354,8 @@ jobs:
        name: dist
        path: |
          fedify-*.tgz
          cli/fedify-cli-*.tar.xz
          cli/fedify-cli-*.zip
          packages/cli/fedify-cli-*.tar.xz
          packages/cli/fedify-cli-*.zip
    - if: github.event_name == 'push' && github.ref_type == 'tag'
      uses: softprops/action-gh-release@v1
      with:
@@ -363,8 +363,8 @@ jobs:
        name: Fedify ${{ github.ref_name }}
        files: |
          fedify-*.tgz
          cli/fedify-cli-*.tar.xz
          cli/fedify-cli-*.zip
          packages/cli/fedify-cli-*.tar.xz
          packages/cli/fedify-cli-*.zip
        generate_release_notes: false
    - run: |
        set -ex
+37 −0
Original line number Diff line number Diff line
@@ -9,6 +9,43 @@ Version 1.9.0
To be released.


Version 1.8.3
-------------

Released on August 6, 2025.

### @fedify/cli

 -  Restored image resizing functionality in `fedify lookup` command by using
    the existing [Jimp] library for image manipulation. This properly displays
    `icon` and `image` fields with appropriate sizing in terminals.

 -  Added support for Ghostty terminal emulator for image rendering in
    `fedify lookup` command.

[Jimp]: https://jimp-dev.github.io/jimp/


Version 1.8.2
-------------

Released on August 6, 2025.

### @fedify/cli

 -  Fixed `npx @fedify/cli` command not working on various platforms by
    correcting the binary path resolution in the Node.js wrapper script.

 -  Temporarily removed Sharp dependency to resolve installation issues
    across different platforms. As a result, `fedify lookup` command will no
    longer resize images when displaying them in the terminal. This is a
    temporary workaround and image resizing functionality will be restored
    in a future patch version using an alternative approach.

 -  Fixed build artifact paths in GitHub Actions workflow to correctly
    reference CLI package location in the monorepo structure.


Version 1.8.1
-------------

+17 −17
Original line number Diff line number Diff line
import { encodeBase64 } from "@std/encoding/base64";
import sharp from "sharp";
import { Jimp } from "./nodeinfo.ts";

export type TerminalType = "kitty" | "iterm2" | "none";

@@ -10,6 +10,7 @@ const KITTY_IDENTIFIERS: string[] = [
  "warp",
  "wayst",
  "st",
  "ghostty",
];

type KittyCommand = Record<string, string | number>;
@@ -77,7 +78,7 @@ export async function renderImageKitty(

    const command = serializeGrCommand(chunkCmd, chunk);

    Deno.stdout.writeSync(command);
    await Deno.stderr.write(command);

    isFirst = false;
  }
@@ -93,7 +94,7 @@ export async function renderImageITerm2(
  const command = encoder.encode(
    `\x1b]1337;File=inline=1preserveAspectRatio=1:${base64Data}\x07\n`,
  );
  Deno.stdout.writeSync(command);
  await Deno.stderr.write(command);
}

export async function downloadImage(url: string): Promise<string | null> {
@@ -114,31 +115,30 @@ export async function downloadImage(url: string): Promise<string | null> {
export async function renderImages(
  imageUrls: URL[],
): Promise<void> {
  const graphicsProtocol = await detectTerminalCapabilities();
  const graphicsProtocol = detectTerminalCapabilities();
  for (const url of imageUrls) {
    const tempPath = await downloadImage(url.toString());
    if (!tempPath) {
      continue;
    }
    const resizedPath = tempPath + "_resized." +
      (tempPath.split(".").pop() || "png");
    const tempPath = await downloadImage(url.href);
    if (!tempPath) continue;

    await sharp(tempPath)
      .resize(300)
      .toFile(resizedPath);
    const convertedImagePath: `${string}.png` = `${tempPath}.converted.png`;
    const image = await Jimp.read(tempPath);
    await image.write(convertedImagePath);
    await Deno.remove(tempPath);

    console.log(""); // clear the line before rendering image
    console.error(); // clear the line before rendering image

    if (graphicsProtocol === "kitty") {
      await renderImageKitty(resizedPath, {
      await renderImageKitty(convertedImagePath, {
        a: "T",
        f: 100, // specify the image format is png
      });
    } else if (graphicsProtocol === "iterm2") {
      await renderImageITerm2(resizedPath);
      await renderImageITerm2(convertedImagePath);
    } else {
      continue;
    }
    console.log(""); // clear the line after rendering image
    console.error(); // clear the line after rendering image
  }
}

// cSpell: ignore ghostty iterm konsole magick wezterm wayst
+2 −2
Original line number Diff line number Diff line
@@ -2,11 +2,11 @@
import { spawnSync } from "node:child_process";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { isFile, main as install } from "./install.mjs";
import { main as install, isFile } from "./install.mjs";

async function main() {
  const filename = fileURLToPath(import.meta.url);
  const dirName = dirname(filename);
  const dirName = dirname(dirname(filename));
  const binPath = join(
    dirName,
    "bin",