jkpark 1.0.0
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/index.js +69 -0
- package/package.json +20 -0
package/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const inquirer = require('inquirer');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
// 패키지 리스트 예시 (형이 원하는 리스트로 나중에 바꿀 수 있어요)
|
|
8
|
+
const packageChoices = [
|
|
9
|
+
{ name: 'React', value: 'react' },
|
|
10
|
+
{ name: 'TypeScript', value: 'typescript' },
|
|
11
|
+
{ name: 'Tailwind CSS', value: 'tailwindcss' },
|
|
12
|
+
{ name: 'Axios', value: 'axios' },
|
|
13
|
+
{ name: 'Zustand', value: 'zustand' },
|
|
14
|
+
{ name: 'Lucide React (Icons)', value: 'lucide-react' }
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
async function runWizard() {
|
|
18
|
+
console.log('\n🐾 jkpark 패키지 마법사에 오신 걸 환영합니다!\n');
|
|
19
|
+
|
|
20
|
+
const answers = await inquirer.prompt([
|
|
21
|
+
{
|
|
22
|
+
type: 'checkbox',
|
|
23
|
+
name: 'packages',
|
|
24
|
+
message: '설치하고 싶은 패키지를 선택하세요:',
|
|
25
|
+
choices: packageChoices,
|
|
26
|
+
validate: (answer) => {
|
|
27
|
+
if (answer.length < 1) {
|
|
28
|
+
return '최소 하나 이상의 패키지를 선택해야 합니다.';
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'confirm',
|
|
35
|
+
name: 'confirm',
|
|
36
|
+
message: '선택한 패키지를 현재 폴더에 설치할까요?',
|
|
37
|
+
default: true
|
|
38
|
+
}
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
if (answers.confirm) {
|
|
42
|
+
const installCmd = `npm install ${answers.packages.join(' ')}`;
|
|
43
|
+
console.log(`\n🚚 설치 중: ${installCmd}...`);
|
|
44
|
+
try {
|
|
45
|
+
execSync(installCmd, { stdio: 'inherit' });
|
|
46
|
+
console.log('\n✅ 설치가 완료되었습니다! 형, 이제 개발 시작하세요! 🐾');
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('\n❌ 설치 중 오류가 발생했습니다.');
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
console.log('\n👋 설치를 취소했습니다.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
program
|
|
56
|
+
.name('jkpark')
|
|
57
|
+
.description('JK Park의 개인용 패키지 관리 도구')
|
|
58
|
+
.version('1.0.0');
|
|
59
|
+
|
|
60
|
+
program
|
|
61
|
+
.command('install')
|
|
62
|
+
.description('패키지 설치 마법사를 실행합니다')
|
|
63
|
+
.action(runWizard);
|
|
64
|
+
|
|
65
|
+
program.parse(process.argv);
|
|
66
|
+
|
|
67
|
+
if (!process.argv.slice(2).length) {
|
|
68
|
+
program.outputHelp();
|
|
69
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "jkpark",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"commander": "^14.0.3",
|
|
15
|
+
"inquirer": "^8.2.7"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"jkpark": "index.js"
|
|
19
|
+
}
|
|
20
|
+
}
|