critique 0.0.21 → 0.0.22
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/cli.tsx +15 -15
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/cli.tsx
CHANGED
|
@@ -676,8 +676,8 @@ cli
|
|
|
676
676
|
.command("web [ref]", "Generate web preview of diff")
|
|
677
677
|
.option("--staged", "Show staged changes")
|
|
678
678
|
.option("--commit <ref>", "Show changes from a specific commit")
|
|
679
|
-
.option("--
|
|
680
|
-
.option("--
|
|
679
|
+
.option("--cols <cols>", "Number of columns for rendering (use ~100 for mobile)", { default: 240 })
|
|
680
|
+
.option("--rows <rows>", "Number of rows for rendering", { default: 2000 })
|
|
681
681
|
.option("--local", "Open local preview instead of uploading")
|
|
682
682
|
.action(async (ref, options) => {
|
|
683
683
|
const pty = await import("@xmorse/bun-pty");
|
|
@@ -690,8 +690,8 @@ cli
|
|
|
690
690
|
return "git add -N . && git diff --no-prefix";
|
|
691
691
|
})();
|
|
692
692
|
|
|
693
|
-
const
|
|
694
|
-
const
|
|
693
|
+
const cols = parseInt(options.cols) || 240;
|
|
694
|
+
const rows = parseInt(options.rows) || 2000;
|
|
695
695
|
|
|
696
696
|
console.log("Capturing diff output...");
|
|
697
697
|
|
|
@@ -713,12 +713,12 @@ cli
|
|
|
713
713
|
process.argv[1]!, // path to cli.tsx
|
|
714
714
|
"web-render",
|
|
715
715
|
diffFile,
|
|
716
|
-
"--
|
|
717
|
-
"--
|
|
716
|
+
"--cols", String(cols),
|
|
717
|
+
"--rows", String(rows),
|
|
718
718
|
], {
|
|
719
719
|
name: "xterm-256color",
|
|
720
|
-
cols:
|
|
721
|
-
rows:
|
|
720
|
+
cols: cols,
|
|
721
|
+
rows: rows,
|
|
722
722
|
|
|
723
723
|
cwd: process.cwd(),
|
|
724
724
|
env: { ...process.env, TERM: "xterm-256color" } as Record<string, string>,
|
|
@@ -752,7 +752,7 @@ cli
|
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
// Convert ANSI to HTML document
|
|
755
|
-
const html = ansiToHtmlDocument(ansiOutput, { cols
|
|
755
|
+
const html = ansiToHtmlDocument(ansiOutput, { cols, rows });
|
|
756
756
|
|
|
757
757
|
if (options.local) {
|
|
758
758
|
// Save locally and open
|
|
@@ -812,11 +812,11 @@ cli
|
|
|
812
812
|
// Internal command for web rendering (captures output to PTY)
|
|
813
813
|
cli
|
|
814
814
|
.command("web-render <diffFile>", "Internal: Render diff for web capture", { allowUnknownOptions: true })
|
|
815
|
-
.option("--
|
|
816
|
-
.option("--
|
|
815
|
+
.option("--cols <cols>", "Terminal columns", { default: 120 })
|
|
816
|
+
.option("--rows <rows>", "Terminal rows", { default: 1000 })
|
|
817
817
|
.action(async (diffFile: string, options) => {
|
|
818
|
-
const
|
|
819
|
-
const
|
|
818
|
+
const cols = parseInt(options.cols) || 120;
|
|
819
|
+
const rows = parseInt(options.rows) || 40;
|
|
820
820
|
|
|
821
821
|
const [diffModule, { parsePatch }] = await Promise.all([
|
|
822
822
|
import("./diff.tsx"),
|
|
@@ -850,8 +850,8 @@ cli
|
|
|
850
850
|
const { FileEditPreview, ErrorBoundary } = diffModule;
|
|
851
851
|
|
|
852
852
|
// Override terminal size
|
|
853
|
-
process.stdout.columns =
|
|
854
|
-
process.stdout.rows =
|
|
853
|
+
process.stdout.columns = cols;
|
|
854
|
+
process.stdout.rows = rows;
|
|
855
855
|
|
|
856
856
|
const renderer = await createCliRenderer({
|
|
857
857
|
exitOnCtrlC: false,
|