jkpark 2.2.0 → 2.3.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.
- package/dist/index.js +70 -19
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { createRequire } from "node:module";
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -25708,9 +25707,21 @@ class PathManager {
|
|
|
25708
25707
|
static getWorkspaces(root) {
|
|
25709
25708
|
if (!fs.existsSync(root))
|
|
25710
25709
|
return [];
|
|
25711
|
-
|
|
25710
|
+
let entries;
|
|
25711
|
+
try {
|
|
25712
|
+
entries = fs.readdirSync(root);
|
|
25713
|
+
} catch (e) {
|
|
25714
|
+
return [];
|
|
25715
|
+
}
|
|
25716
|
+
return entries.filter((f) => {
|
|
25717
|
+
if (f.startsWith("."))
|
|
25718
|
+
return false;
|
|
25712
25719
|
const fullPath = path2.join(root, f);
|
|
25713
|
-
|
|
25720
|
+
try {
|
|
25721
|
+
return fs.statSync(fullPath).isDirectory();
|
|
25722
|
+
} catch {
|
|
25723
|
+
return false;
|
|
25724
|
+
}
|
|
25714
25725
|
});
|
|
25715
25726
|
}
|
|
25716
25727
|
static resolveFinalPath(baseDir, relativeOrAbsolute) {
|
|
@@ -25737,7 +25748,9 @@ class PluginManager {
|
|
|
25737
25748
|
if (fs2.existsSync(pluginJsonPath)) {
|
|
25738
25749
|
try {
|
|
25739
25750
|
config = { ...config, ...JSON.parse(fs2.readFileSync(pluginJsonPath, "utf8")) };
|
|
25740
|
-
} catch (e) {
|
|
25751
|
+
} catch (e) {
|
|
25752
|
+
console.warn(`Failed to parse plugin config at ${pluginJsonPath}:`, e);
|
|
25753
|
+
}
|
|
25741
25754
|
}
|
|
25742
25755
|
return { ...config, value: dir };
|
|
25743
25756
|
});
|
|
@@ -25746,8 +25759,23 @@ class PluginManager {
|
|
|
25746
25759
|
const skillsDir = path3.join(this.pluginsDir, category, "skills");
|
|
25747
25760
|
if (!fs2.existsSync(skillsDir))
|
|
25748
25761
|
return [];
|
|
25749
|
-
const skills = fs2.readdirSync(skillsDir).filter((
|
|
25750
|
-
return skills.map((skill) =>
|
|
25762
|
+
const skills = fs2.readdirSync(skillsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
|
|
25763
|
+
return skills.map((skill) => {
|
|
25764
|
+
const skillPath = path3.join(skillsDir, skill, "SKILL.md");
|
|
25765
|
+
let description = "No description provided";
|
|
25766
|
+
if (fs2.existsSync(skillPath)) {
|
|
25767
|
+
const content = fs2.readFileSync(skillPath, "utf8");
|
|
25768
|
+
const match = content.match(/^description:\s*(.*)$/m);
|
|
25769
|
+
if (match && match[1]) {
|
|
25770
|
+
description = match[1].trim();
|
|
25771
|
+
}
|
|
25772
|
+
}
|
|
25773
|
+
return {
|
|
25774
|
+
name: skill,
|
|
25775
|
+
description,
|
|
25776
|
+
value: skill
|
|
25777
|
+
};
|
|
25778
|
+
});
|
|
25751
25779
|
}
|
|
25752
25780
|
getSkillSourcePath(category, skill) {
|
|
25753
25781
|
return path3.join(this.pluginsDir, category, "skills", skill);
|
|
@@ -25757,7 +25785,7 @@ class PluginManager {
|
|
|
25757
25785
|
// src/commands/install.ts
|
|
25758
25786
|
async function runInstallWizard(projectRoot) {
|
|
25759
25787
|
console.log(`
|
|
25760
|
-
\uD83D\uDC3E jkpark 설치 마법사에 오신 걸 환영합니다!
|
|
25788
|
+
\uD83D\uDC3E jkpark 설치 마법사에 오신 걸 환영합니다!
|
|
25761
25789
|
`);
|
|
25762
25790
|
const pluginManager = new PluginManager(projectRoot);
|
|
25763
25791
|
const categoryChoices = await pluginManager.getCategories();
|
|
@@ -25769,11 +25797,11 @@ async function runInstallWizard(projectRoot) {
|
|
|
25769
25797
|
{
|
|
25770
25798
|
type: "list",
|
|
25771
25799
|
name: "targetType",
|
|
25772
|
-
message: "
|
|
25800
|
+
message: "설치할 서비스(Target)를 선택하세요:",
|
|
25773
25801
|
choices: [
|
|
25774
|
-
{ name: "OpenClaw", value: "openclaw" },
|
|
25775
|
-
{ name: "Claude", value: "claude" },
|
|
25776
|
-
{ name: "GitHub", value: "github" }
|
|
25802
|
+
{ name: "\uD83C\uDFD7️ OpenClaw".padEnd(15) + " - OpenClaw Agents & Shared Skills", value: "openclaw" },
|
|
25803
|
+
{ name: "\uD83E\uDD16 Claude".padEnd(15) + " - Claude Code CLI & Global Skills", value: "claude" },
|
|
25804
|
+
{ name: "\uD83D\uDC19 GitHub".padEnd(15) + " - GitHub CLI Extensions (gh-extension)", value: "github" }
|
|
25777
25805
|
]
|
|
25778
25806
|
}
|
|
25779
25807
|
]);
|
|
@@ -25782,11 +25810,14 @@ async function runInstallWizard(projectRoot) {
|
|
|
25782
25810
|
type: "list",
|
|
25783
25811
|
name: "selectedCategory",
|
|
25784
25812
|
message: "설치할 플러그인 카테고리를 선택하세요:",
|
|
25785
|
-
choices: categoryChoices
|
|
25813
|
+
choices: categoryChoices.map((c) => ({
|
|
25814
|
+
name: `${c.name.padEnd(15)} - ${c.description}`,
|
|
25815
|
+
value: c.value
|
|
25816
|
+
}))
|
|
25786
25817
|
}
|
|
25787
25818
|
]);
|
|
25788
|
-
const
|
|
25789
|
-
if (
|
|
25819
|
+
const skills = await pluginManager.getSkills(selectedCategory);
|
|
25820
|
+
if (skills.length === 0) {
|
|
25790
25821
|
console.log(`
|
|
25791
25822
|
⚠️ ${selectedCategory} 카테고리에 설치 가능한 스킬이 없습니다.`);
|
|
25792
25823
|
return;
|
|
@@ -25795,12 +25826,14 @@ async function runInstallWizard(projectRoot) {
|
|
|
25795
25826
|
{
|
|
25796
25827
|
type: "checkbox",
|
|
25797
25828
|
name: "selectedSkills",
|
|
25798
|
-
message: "설치할 스킬들을
|
|
25799
|
-
choices:
|
|
25829
|
+
message: "설치할 스킬들을 선택하세요 (Space로 선택, Enter로 완료):",
|
|
25830
|
+
choices: skills.map((s) => ({
|
|
25831
|
+
name: `${s.name.padEnd(25)} - ${s.description}`,
|
|
25832
|
+
value: s.value
|
|
25833
|
+
})),
|
|
25800
25834
|
validate: (answer) => answer.length > 0 ? true : "최소 하나 이상의 스킬을 선택해야 합니다."
|
|
25801
25835
|
}
|
|
25802
25836
|
]);
|
|
25803
|
-
let finalTargetDir;
|
|
25804
25837
|
let rootPath;
|
|
25805
25838
|
if (targetType === "openclaw") {
|
|
25806
25839
|
rootPath = PathManager.getOpenClawRoot();
|
|
@@ -25831,6 +25864,7 @@ async function runInstallWizard(projectRoot) {
|
|
|
25831
25864
|
default: 0
|
|
25832
25865
|
}
|
|
25833
25866
|
]);
|
|
25867
|
+
let finalTargetDir;
|
|
25834
25868
|
if (scope === "custom") {
|
|
25835
25869
|
const { customPath } = await dist_default14.prompt([
|
|
25836
25870
|
{
|
|
@@ -25882,15 +25916,32 @@ async function runInstallWizard(projectRoot) {
|
|
|
25882
25916
|
❌ 설치가 취소되었습니다.`);
|
|
25883
25917
|
}
|
|
25884
25918
|
}
|
|
25919
|
+
async function runListCommand(projectRoot) {
|
|
25920
|
+
const pluginManager = new PluginManager(projectRoot);
|
|
25921
|
+
const categories = await pluginManager.getCategories();
|
|
25922
|
+
console.log(`
|
|
25923
|
+
\uD83D\uDCE6 사용 가능한 플러그인 목록:
|
|
25924
|
+
`);
|
|
25925
|
+
for (const cat of categories) {
|
|
25926
|
+
console.log(`\uD83D\uDCC2 ${cat.name} (${cat.description})`);
|
|
25927
|
+
const skills = await pluginManager.getSkills(cat.value);
|
|
25928
|
+
for (const skill of skills) {
|
|
25929
|
+
console.log(` - ${skill.name}: ${skill.description}`);
|
|
25930
|
+
}
|
|
25931
|
+
console.log("");
|
|
25932
|
+
}
|
|
25933
|
+
}
|
|
25885
25934
|
|
|
25886
25935
|
// src/index.ts
|
|
25887
25936
|
var __filename2 = fileURLToPath(import.meta.url);
|
|
25888
25937
|
var __dirname2 = path5.dirname(__filename2);
|
|
25889
25938
|
var projectRoot = process.env.JKPARK_CLI_ROOT || path5.join(__dirname2, "..");
|
|
25890
25939
|
var program2 = new Command;
|
|
25891
|
-
program2.name("jkpark").description("JK Park의 개인용 패키지 관리 도구
|
|
25940
|
+
program2.name("jkpark").description("JK Park의 개인용 패키지 관리 도구").version("2.3.0");
|
|
25892
25941
|
program2.command("install").description("패키지 설치 마법사를 실행합니다").action(() => runInstallWizard(projectRoot));
|
|
25893
|
-
program2.
|
|
25942
|
+
program2.command("list").description("사용 가능한 모든 플러그인과 스킬을 나열합니다").action(() => runListCommand(projectRoot));
|
|
25894
25943
|
if (!process.argv.slice(2).length) {
|
|
25895
25944
|
program2.outputHelp();
|
|
25945
|
+
} else {
|
|
25946
|
+
program2.parse(process.argv);
|
|
25896
25947
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jkpark",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "JK Park's Personal Package Manager (Bun Powered)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"inquirer": "^13.3.0"
|
|
18
18
|
},
|
|
19
19
|
"bin": {
|
|
20
|
-
"jkpark": "dist/index.js"
|
|
20
|
+
"jkpark": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist",
|
|
24
|
-
"plugins"
|
|
25
|
-
],
|
|
26
22
|
"devDependencies": {
|
|
27
23
|
"@types/commander": "^2.12.5",
|
|
28
24
|
"@types/fs-extra": "^11.0.4",
|
|
29
25
|
"@types/inquirer": "^9.0.9",
|
|
30
26
|
"@types/node": "^25.3.0",
|
|
31
27
|
"typescript": "^5.9.3"
|
|
32
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"plugins"
|
|
32
|
+
]
|
|
33
33
|
}
|