tarsk 0.3.2 → 0.3.3

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 (2) hide show
  1. package/dist/index.js +12 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -22,11 +22,20 @@ import { createGitRoutes } from './routes/git.js';
22
22
  import { AVAILABLE_PROGRAMS } from './types/models.js';
23
23
  const __filename = fileURLToPath(import.meta.url);
24
24
  const __dirname = path.dirname(__filename);
25
+ // Parse arguments
26
+ const args = process.argv.slice(2);
27
+ const isDebug = args.includes('--debug');
28
+ // Suppress console.log unless debug is enabled
29
+ if (!isDebug) {
30
+ console.log = () => { };
31
+ }
32
+ const positionalArgs = args.filter(arg => !arg.startsWith('--'));
33
+ const rootFolderArg = positionalArgs[0];
25
34
  const app = new Hono();
26
35
  // Configure CORS middleware
27
36
  app.use('/*', cors());
28
37
  // Initialize managers
29
- const rootFolder = process.env.ROOT_FOLDER || process.cwd();
38
+ const rootFolder = rootFolderArg ? path.resolve(process.cwd(), rootFolderArg) : (process.env.ROOT_FOLDER || process.cwd());
30
39
  const metadataManager = new MetadataManager(rootFolder);
31
40
  const gitManager = new GitManagerImpl();
32
41
  const projectManager = new ProjectManagerImpl(rootFolder, metadataManager, gitManager);
@@ -86,7 +95,8 @@ app.all('*', (c) => {
86
95
  });
87
96
  const port = process.env.PORT ? parseInt(process.env.PORT) : 641;
88
97
  const url = `http://localhost:${port}`;
89
- console.log(`Tarsk started on ${url}`);
98
+ // Use process.stdout.write to ensure this message is shown even if console.log is suppressed
99
+ process.stdout.write(`Tarsk started on ${url}\n`);
90
100
  serve({
91
101
  fetch: app.fetch,
92
102
  port
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tarsk",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "CLI for Tarsk - Project Threads Manager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "@neovate/code"
16
16
  ],
17
17
  "scripts": {
18
- "dev": "tsx watch src/index.ts",
18
+ "dev": "NODE_ENV=development tsx watch src/index.ts",
19
19
  "build": "tsc",
20
20
  "start": "node dist/index.js",
21
21
  "lint": "eslint .",