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 CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.22
2
+
3
+ - Web preview:
4
+ - Rename `--width`/`--height` options to `--cols`/`--rows` for clarity
5
+ - Add hint in help text: use `--cols ~100` for mobile-friendly output
6
+
1
7
  # 0.0.21
2
8
 
3
9
  - Update `@xmorse/bun-pty` to 0.4.0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "critique",
3
3
  "module": "src/diff.tsx",
4
4
  "type": "module",
5
- "version": "0.0.21",
5
+ "version": "0.0.22",
6
6
  "private": false,
7
7
  "bin": "./src/cli.tsx",
8
8
  "scripts": {
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("--width <width>", "Terminal width for rendering", { default: 240 })
680
- .option("--height <height>", "Terminal height for rendering", { default: 2000 })
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 width = parseInt(options.width) || 240;
694
- const height = parseInt(options.height) || 2000;
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
- "--width", String(width),
717
- "--height", String(height),
716
+ "--cols", String(cols),
717
+ "--rows", String(rows),
718
718
  ], {
719
719
  name: "xterm-256color",
720
- cols: width,
721
- rows: height,
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: width, rows: height });
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("--width <width>", "Terminal width", { default: 120 })
816
- .option("--height <height>", "Terminal height", { default: 1000 })
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 width = parseInt(options.width) || 120;
819
- const height = parseInt(options.height) || 40;
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 = width;
854
- process.stdout.rows = height;
853
+ process.stdout.columns = cols;
854
+ process.stdout.rows = rows;
855
855
 
856
856
  const renderer = await createCliRenderer({
857
857
  exitOnCtrlC: false,