@lsproxy/cli 0.4.2 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsproxy/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Standalone refactor CLI driving any LSP server: project-wide rename, file-move with importer updates, and move-symbol",
5
5
  "private": false,
6
6
  "keywords": [
@@ -49,8 +49,8 @@
49
49
  "commander": "^15.0.0",
50
50
  "zod": "^4.4.3",
51
51
  "@lspeasy/client": "3.1.2",
52
- "@lsproxy/proxy": "1.0.1",
53
- "@lspeasy/core": "2.3.0"
52
+ "@lspeasy/core": "2.3.0",
53
+ "@lsproxy/proxy": "1.0.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@skillit/cli": "^0.4.0",
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
  const fs = require('node:fs');
4
+ const os = require('node:os');
4
5
  const path = require('node:path');
5
6
 
6
7
  const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
@@ -15,11 +16,11 @@ const npxPrefix = 'npx ' + pkgName;
15
16
  const skillsDir = path.join(__dirname, 'skills');
16
17
  if (!fs.existsSync(skillsDir)) process.exit(0);
17
18
 
18
- function walk(dir) {
19
+ function rewrite(dir) {
19
20
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
20
21
  const full = path.join(dir, entry.name);
21
22
  if (entry.isDirectory()) {
22
- walk(full);
23
+ rewrite(full);
23
24
  } else if (entry.isFile() && entry.name.endsWith('.md')) {
24
25
  const content = fs.readFileSync(full, 'utf8');
25
26
  const updated = content.replaceAll(npxPrefix, binName);
@@ -28,4 +29,29 @@ function walk(dir) {
28
29
  }
29
30
  }
30
31
 
31
- walk(skillsDir);
32
+ function copyDir(src, dest) {
33
+ fs.mkdirSync(dest, { recursive: true });
34
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
35
+ const srcPath = path.join(src, entry.name);
36
+ const destPath = path.join(dest, entry.name);
37
+ if (entry.isDirectory()) {
38
+ copyDir(srcPath, destPath);
39
+ } else {
40
+ fs.copyFileSync(srcPath, destPath);
41
+ }
42
+ }
43
+ }
44
+
45
+ rewrite(skillsDir);
46
+
47
+ const userSkillsDir = path.join(os.homedir(), '.claude', 'skills');
48
+ try {
49
+ fs.mkdirSync(userSkillsDir, { recursive: true });
50
+ for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
51
+ if (!entry.isDirectory()) continue;
52
+ copyDir(path.join(skillsDir, entry.name), path.join(userSkillsDir, entry.name));
53
+ }
54
+ console.log('[skillit] Skills installed to ' + userSkillsDir);
55
+ } catch (err) {
56
+ console.warn('[skillit] Could not install skills to ' + userSkillsDir + ': ' + err.message);
57
+ }