Emdash source with visual editor image upload fix

Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
2026-05-03 10:44:54 +07:00
parent 78f81bebb6
commit 2d1be52177
2352 changed files with 662964 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env node
// Relink workspace bin symlinks after build, but only when needed.
// pnpm only creates bin links when the target file exists at install time.
// Since the CLI lives in dist/, it doesn't exist until after the first build.
import { execSync } from "node:child_process";
import { existsSync } from "node:fs";
// Skip in CI — bins are handled by the CI setup step
if (process.env.CI) process.exit(0);
const CLI_SRC = "packages/core/dist/cli/index.mjs";
// If the built CLI doesn't exist, the build itself failed — nothing to relink
if (!existsSync(CLI_SRC)) process.exit(0);
const binDir = execSync("pnpm bin", { encoding: "utf-8" }).trim();
const cliBin = `${binDir}/emdash`;
// If the bin symlink is missing or broken, relink
if (!existsSync(cliBin)) {
console.log("CLI bin missing — relinking...");
execSync("pnpm install --frozen-lockfile", { stdio: "inherit" });
}