@masslessai/push-todo 3.4.9 → 3.5.1

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.
Files changed (3) hide show
  1. package/lib/cli.js +20 -1
  2. package/lib/index.js +19 -2
  3. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -6,6 +6,9 @@
6
6
 
7
7
  import { parseArgs } from 'util';
8
8
  import { spawn } from 'child_process';
9
+ import { readFileSync } from 'fs';
10
+ import { join, dirname } from 'path';
11
+ import { fileURLToPath } from 'url';
9
12
  import * as fetch from './fetch.js';
10
13
  import * as api from './api.js';
11
14
  import { runConnect } from './connect.js';
@@ -15,7 +18,23 @@ import { ensureDaemonRunning, getDaemonStatus, startDaemon, stopDaemon } from '.
15
18
  import { getScreenshotPath, screenshotExists, openScreenshot } from './utils/screenshots.js';
16
19
  import { bold, red, cyan, dim, green } from './utils/colors.js';
17
20
 
18
- const VERSION = '3.4.7';
21
+ const __filename = fileURLToPath(import.meta.url);
22
+ const __dirname = dirname(__filename);
23
+
24
+ /**
25
+ * Read version from package.json (DRY - single source of truth)
26
+ */
27
+ function getVersion() {
28
+ try {
29
+ const pkgPath = join(__dirname, '..', 'package.json');
30
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
31
+ return pkg.version || '3.0.0';
32
+ } catch {
33
+ return '3.0.0';
34
+ }
35
+ }
36
+
37
+ const VERSION = getVersion();
19
38
 
20
39
  const HELP_TEXT = `
21
40
  ${bold('push-todo')} - Voice tasks from Push iOS app for Claude Code
package/lib/index.js CHANGED
@@ -6,6 +6,13 @@
6
6
  * @module @masslessai/push-todo
7
7
  */
8
8
 
9
+ import { readFileSync } from 'fs';
10
+ import { join, dirname } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+
9
16
  // CLI entry point
10
17
  export { run } from './cli.js';
11
18
 
@@ -110,5 +117,15 @@ export {
110
117
  colorsEnabled
111
118
  } from './utils/colors.js';
112
119
 
113
- // Version
114
- export const VERSION = '3.0.0';
120
+ // Version - read from package.json (DRY - single source of truth)
121
+ function getVersion() {
122
+ try {
123
+ const pkgPath = join(__dirname, '..', 'package.json');
124
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
125
+ return pkg.version || '3.0.0';
126
+ } catch {
127
+ return '3.0.0';
128
+ }
129
+ }
130
+
131
+ export const VERSION = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "3.4.9",
3
+ "version": "3.5.1",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {