swarm-tickets 1.0.0 → 1.0.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 (2) hide show
  1. package/package.json +1 -1
  2. package/setup.js +9 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swarm-tickets",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lightweight ticket tracking system for AI-powered bug fixing with Claude-flow/Claude Code",
5
5
  "main": "ticket-server.js",
6
6
  "bin": {
package/setup.js CHANGED
@@ -1,21 +1,20 @@
1
1
  #!/usr/bin/env node
2
-
3
2
  const fs = require('fs');
4
3
  const path = require('path');
5
4
 
6
5
  console.log('\nšŸŽ« Setting up Swarm Tickets...\n');
7
6
 
8
- // Get the project root (where package.json is)
9
- const projectRoot = process.cwd();
7
+ // Get the project root - use INIT_CWD during npm install, fallback to cwd for manual runs
8
+ const projectRoot = process.env.INIT_CWD || process.cwd();
10
9
 
11
- // Create .claude/skills/swarm-tickets directory (correct location!)
10
+ // Create .claude/skills/swarm-tickets directory
12
11
  const skillsDir = path.join(projectRoot, '.claude', 'skills', 'swarm-tickets');
13
12
 
14
13
  try {
15
14
  // Create directories
16
15
  fs.mkdirSync(skillsDir, { recursive: true });
17
16
  console.log('āœ… Created .claude/skills/swarm-tickets/');
18
-
17
+
19
18
  // Copy SKILL.md to the skills directory
20
19
  const skillSource = path.join(__dirname, 'SKILL.md');
21
20
  const skillDest = path.join(skillsDir, 'SKILL.md');
@@ -24,7 +23,7 @@ try {
24
23
  fs.copyFileSync(skillSource, skillDest);
25
24
  console.log('āœ… Installed swarm skill');
26
25
  }
27
-
26
+
28
27
  // Copy ticket-tracker.html to project root
29
28
  const htmlSource = path.join(__dirname, 'ticket-tracker.html');
30
29
  const htmlDest = path.join(projectRoot, 'ticket-tracker.html');
@@ -35,25 +34,24 @@ try {
35
34
  } else {
36
35
  console.log('āš ļø ticket-tracker.html already exists, skipping');
37
36
  }
38
-
37
+
39
38
  // Create tickets.json if it doesn't exist
40
39
  const ticketsFile = path.join(projectRoot, 'tickets.json');
40
+
41
41
  if (!fs.existsSync(ticketsFile)) {
42
42
  fs.writeFileSync(ticketsFile, JSON.stringify({ tickets: [] }, null, 2));
43
43
  console.log('āœ… Created tickets.json');
44
44
  }
45
-
45
+
46
46
  console.log('\nšŸŽ‰ Setup complete!\n');
47
47
  console.log('To start the ticket tracker:');
48
- console.log(' npm start\n');
48
+ console.log(' npx swarm-tickets\n');
49
49
  console.log('Then open: http://localhost:3456/ticket-tracker.html\n');
50
50
  console.log('The swarm can now access tickets via ./tickets.json');
51
51
  console.log('Skill documentation: .claude/skills/swarm-tickets/SKILL.md\n');
52
-
53
52
  console.log('šŸ“ Note: Add these to your .gitignore if you don\'t want to commit tickets:');
54
53
  console.log(' tickets.json');
55
54
  console.log(' ticket-backups/\n');
56
-
57
55
  } catch (error) {
58
56
  console.error('āŒ Setup failed:', error.message);
59
57
  process.exit(1);