@rushinglabs/taskfile 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  A simple todo list CLI, runnable via `npx`.
4
4
 
5
+ ## Install
6
+
7
+ Download the installer for your platform from the
8
+ [latest release](https://github.com/meddlin/taskfile/releases/latest) — no Node.js required:
9
+
10
+ - **macOS**: `taskfile-<version>-macos-arm64.pkg` (Apple Silicon) or `…-macos-x64.pkg` (Intel)
11
+ - **Debian/Ubuntu**: `sudo apt install ./taskfile_<version>_amd64.deb` (or `_arm64.deb`)
12
+ - **Windows**: `taskfile-<version>-windows-x64-setup.exe`
13
+
14
+ Then run `taskfile`. Details, uninstall steps, and how to build installers yourself are in
15
+ [docs/installers.md](docs/installers.md). Or use npm, below.
16
+
5
17
  ## Usage
6
18
 
7
19
  ```bash
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ process.on("warning", (warning) => {
6
6
  }
7
7
  console.warn(warning);
8
8
  });
9
+ import "./production-env.js"; // must stay first: sets NODE_ENV before react is loaded
9
10
  import { readFileSync } from "node:fs";
10
11
  import { dirname, join } from "node:path";
11
12
  import { fileURLToPath } from "node:url";
@@ -0,0 +1,7 @@
1
+ // React picks its development or production build the first time it is imported, based on
2
+ // NODE_ENV. The development build records ~10 `performance.measure` entries per render, and Node
3
+ // buffers those forever. The TUI re-renders ~10 times a second for its animations, so a
4
+ // long-running session leaked ~3 KB per render until the process hit the V8 heap limit (~28 hours
5
+ // at 4 GB). This module must be imported before anything that imports react or ink.
6
+ process.env.NODE_ENV = "production";
7
+ export {};
package/dist/tui/App.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
- import { useApp, useInput } from "ink";
3
+ import { useApp, useInput, useWindowSize } from "ink";
4
4
  import { Frame } from "./Frame.js";
5
5
  import { TodosPage } from "./TodosPage.js";
6
6
  import { SettingsPage } from "./SettingsPage.js";
7
7
  import { AddTaskInput } from "./AddTaskInput.js";
8
8
  import { SnapshotsModal } from "./SnapshotsModal.js";
9
9
  import { SnapshotDetailView } from "./SnapshotDetailView.js";
10
+ import { fitFrameToWindow } from "./frameSize.js";
10
11
  import { loadSettings, saveSettings } from "../settings.js";
11
12
  import { computeProgress, createList, loadLists, loadTasks, renameList } from "../store.js";
12
13
  import { deleteSnapshot, listSnapshots, loadSnapshotDetail, } from "../snapshots.js";
@@ -27,6 +28,7 @@ export function App() {
27
28
  const { exit } = useApp();
28
29
  const [lists, setLists] = useState(() => loadLists());
29
30
  const [settings, setSettings] = useState(() => loadSettings());
31
+ const frameSize = fitFrameToWindow(settings, useWindowSize());
30
32
  const [page, setPage] = useState(() => {
31
33
  const savedId = settings.lastActiveListId;
32
34
  const match = savedId !== null && lists.some((list) => list.id === savedId);
@@ -188,7 +190,7 @@ export function App() {
188
190
  }
189
191
  }
190
192
  });
191
- return (_jsxs(Frame, { message: message, hint: hint, width: settings.width, height: settings.height, lists: lists, activePage: page, progress: progress, progressAnimated: settings.progressAnimation, navFocused: focus === "nav", snapshotDate: viewingSnapshot?.date, children: [lists.map((list) => {
193
+ return (_jsxs(Frame, { message: message, hint: hint, width: frameSize.width, height: frameSize.height, lists: lists, activePage: page, progress: progress, progressAnimated: settings.progressAnimation, navFocused: focus === "nav", snapshotDate: viewingSnapshot?.date, children: [lists.map((list) => {
192
194
  const visible = !viewingSnapshot && mode === "normal" && page.type === "list" && page.listId === list.id;
193
195
  return (_jsx(TodosPage, { listId: list.id, listName: list.name, onListRenamed: refreshLists, visible: visible, active: visible && focus === "content", setMessage: setMessage, onNavLockChange: setNavLocked, onHintChange: setHint, onProgressChange: setProgress }, list.id));
194
196
  }), _jsx(SettingsPage, { visible: !viewingSnapshot && mode === "normal" && page.type === "settings", active: !viewingSnapshot && mode === "normal" && page.type === "settings" && focus === "content", settings: settings, onSettingsChange: setSettings, setMessage: setMessage, onNavLockChange: setNavLocked, onHintChange: setHint }), viewingSnapshot && _jsx(SnapshotDetailView, { detail: viewingSnapshot }), mode === "snapshots" && (_jsx(SnapshotsModal, { summaries: snapshotSummaries, selectedIndex: snapshotSelectedIndex, modalMode: snapshotModalMode, pendingDeleteId: pendingDeleteSnapshotId })), mode === "new-list" && (_jsx(AddTaskInput, { label: "New list: ", onSubmit: (name) => {
@@ -0,0 +1,11 @@
1
+ // Ink switches to a clear-and-redraw mode once the output is as tall as the
2
+ // terminal, so leave the last row free to keep rendering flicker-free.
3
+ const RESERVED_ROWS = 1;
4
+ // The width/height settings are maximums: the frame shrinks to fit a smaller
5
+ // terminal instead of overflowing it, and follows the terminal as it resizes.
6
+ export function fitFrameToWindow(configured, window) {
7
+ return {
8
+ width: Math.max(Math.min(configured.width, window.columns), 1),
9
+ height: Math.max(Math.min(configured.height, window.rows - RESERVED_ROWS), 1),
10
+ };
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushinglabs/taskfile",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A simple todo list CLI, runnable via npx",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -15,6 +15,7 @@
15
15
  "scripts": {
16
16
  "build": "tsc",
17
17
  "dev": "tsx src/index.ts",
18
+ "installers": "tsx scripts/installers/build.ts",
18
19
  "test": "vitest run",
19
20
  "prepublishOnly": "npm run build"
20
21
  },
@@ -40,7 +41,7 @@
40
41
  "@types/react": "^19.2.0",
41
42
  "ink-testing-library": "^4.0.0",
42
43
  "tsx": "^4.23.12",
43
- "typescript": "^5.7.3",
44
- "vitest": "^4.1.11"
44
+ "typescript": "^7.0.2",
45
+ "vitest": "^5.0.0"
45
46
  }
46
47
  }