forked from nilbuild/diffity
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.ts
More file actions
56 lines (49 loc) · 1.69 KB
/
Copy pathdev.ts
File metadata and controls
56 lines (49 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env node
import { execSync } from 'child_process';
import { dirname, resolve, join } from 'path';
import { fileURLToPath } from 'url';
import concurrently from 'concurrently';
import { cleanManagedSkills, DEV_SKILL_PREFIX } from './lib/utils.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
const rootDir = resolve(__dirname, '..');
execSync('tsx scripts/link-dev.ts && npm run build:skills', {
cwd: rootDir,
stdio: 'inherit',
});
const homeDir = process.env.HOME || process.env.USERPROFILE || '';
const globalClaudeSkillsDir = join(homeDir, '.claude', 'skills');
function cleanupDevSkills() {
try {
cleanManagedSkills(globalClaudeSkillsDir, DEV_SKILL_PREFIX);
console.log('Cleaned up dev skills');
} catch {}
}
process.on('SIGINT', () => {
cleanupDevSkills();
process.exit(0);
});
process.on('SIGTERM', () => {
cleanupDevSkills();
process.exit(0);
});
concurrently(
[
{ command: 'npm run dev -w @diffity/parser', name: 'parser' },
{ command: 'npm run dev -w @diffity/api', name: 'api' },
{ command: 'npm run dev -w @diffity/git', name: 'git' },
{ command: 'npm run dev -w @diffity/github', name: 'github' },
{ command: 'npm run dev:watch -w @naturalcycles/diffity', name: 'cli' },
// `vite build --watch` instead of `vite dev` so the output lands in dist/ui
// where the CLI server can serve it. `vite dev` only serves from memory.
{ command: 'npx -w @diffity/ui vite build --watch', name: 'ui' },
{
command: 'tsx --watch-path=packages/skills scripts/build-skills.ts',
name: 'skills',
},
],
{
prefixColors: ['blue', 'green', 'yellow', 'magenta', 'cyan'],
}
).result.finally(() => {
cleanupDevSkills();
});