relayax-cli 0.1.999 → 0.2.13
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/commands/follow.d.ts +2 -0
- package/dist/commands/follow.js +45 -0
- package/dist/commands/install.js +0 -18
- package/dist/index.js +2 -0
- package/dist/lib/command-adapter.js +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerFollow = registerFollow;
|
|
4
|
+
const api_js_1 = require("../lib/api.js");
|
|
5
|
+
const config_js_1 = require("../lib/config.js");
|
|
6
|
+
function registerFollow(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('follow <username>')
|
|
9
|
+
.description('빌더를 팔로우합니다 (새 버전 알림)')
|
|
10
|
+
.action(async (username) => {
|
|
11
|
+
const json = program.opts().json ?? false;
|
|
12
|
+
// Strip @ prefix if present
|
|
13
|
+
const cleanUsername = username.startsWith('@') ? username.slice(1) : username;
|
|
14
|
+
const token = await (0, config_js_1.getValidToken)();
|
|
15
|
+
if (!token) {
|
|
16
|
+
const msg = '로그인이 필요합니다. `relay login`을 먼저 실행하세요.';
|
|
17
|
+
if (json) {
|
|
18
|
+
console.log(JSON.stringify({ error: 'NO_TOKEN', message: msg }));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.error(msg);
|
|
22
|
+
}
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
await (0, api_js_1.followBuilder)(cleanUsername);
|
|
27
|
+
if (json) {
|
|
28
|
+
console.log(JSON.stringify({ ok: true, following: cleanUsername }));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
console.log(`\x1b[32m✓ @${cleanUsername} 팔로우 완료\x1b[0m — 새 버전 알림을 받습니다.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
36
|
+
if (json) {
|
|
37
|
+
console.log(JSON.stringify({ error: 'FOLLOW_FAILED', message }));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.error(`팔로우 실패: ${message}`);
|
|
41
|
+
}
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
package/dist/commands/install.js
CHANGED
|
@@ -121,24 +121,6 @@ function registerInstall(program) {
|
|
|
121
121
|
}
|
|
122
122
|
console.log(` \x1b[90m└${'─'.repeat(44)}┘\x1b[0m`);
|
|
123
123
|
}
|
|
124
|
-
// Follow prompt (only when logged in)
|
|
125
|
-
const token = await (0, config_js_1.getValidToken)();
|
|
126
|
-
if (authorUsername && token) {
|
|
127
|
-
try {
|
|
128
|
-
const { confirm } = await import('@inquirer/prompts');
|
|
129
|
-
const shouldFollow = await confirm({
|
|
130
|
-
message: `@${authorUsername}을 팔로우하시겠습니까? (이메일로 새 소식을 받습니다)`,
|
|
131
|
-
default: true,
|
|
132
|
-
});
|
|
133
|
-
if (shouldFollow) {
|
|
134
|
-
await (0, api_js_1.followBuilder)(authorUsername);
|
|
135
|
-
console.log(`\x1b[32m ✓ @${authorUsername} 팔로우 완료\x1b[0m`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
// non-critical: skip on error or non-interactive terminal
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
124
|
console.log('\n 에이전트가 /relay-install로 환경을 구성합니다.');
|
|
143
125
|
}
|
|
144
126
|
}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const login_js_1 = require("./commands/login.js");
|
|
|
14
14
|
const update_js_1 = require("./commands/update.js");
|
|
15
15
|
const outdated_js_1 = require("./commands/outdated.js");
|
|
16
16
|
const check_update_js_1 = require("./commands/check-update.js");
|
|
17
|
+
const follow_js_1 = require("./commands/follow.js");
|
|
17
18
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
18
19
|
const pkg = require('../package.json');
|
|
19
20
|
const program = new commander_1.Command();
|
|
@@ -34,4 +35,5 @@ program
|
|
|
34
35
|
(0, update_js_1.registerUpdate)(program);
|
|
35
36
|
(0, outdated_js_1.registerOutdated)(program);
|
|
36
37
|
(0, check_update_js_1.registerCheckUpdate)(program);
|
|
38
|
+
(0, follow_js_1.registerFollow)(program);
|
|
37
39
|
program.parse();
|
|
@@ -51,6 +51,27 @@ const LOGIN_JIT_GUIDE = `
|
|
|
51
51
|
1. 사용자에게 "이 팀은 로그인이 필요합니다"라고 안내합니다.
|
|
52
52
|
2. \`relay login\` 명령어를 실행합니다.
|
|
53
53
|
3. 로그인 완료 후 원래 커맨드를 재실행합니다.`;
|
|
54
|
+
// ─── 명함 표시 포맷 ───
|
|
55
|
+
const BUSINESS_CARD_FORMAT = `
|
|
56
|
+
### 빌더 명함 표시
|
|
57
|
+
CLI 출력에 포함된 빌더 명함 정보를 아래 포맷으로 사용자에게 보여줍니다:
|
|
58
|
+
|
|
59
|
+
\`\`\`
|
|
60
|
+
┌─ {빌더이름}의 명함 ─────────────────────────┐
|
|
61
|
+
│ │
|
|
62
|
+
│ 💬 "{환영 메시지}" │
|
|
63
|
+
│ │
|
|
64
|
+
│ 📧 {이메일} │
|
|
65
|
+
│ 🔗 {웹사이트 또는 기타 연락처} │
|
|
66
|
+
│ 👤 relayax.com/@{username} │
|
|
67
|
+
│ │
|
|
68
|
+
└──────────────────────────────────────────────┘
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
- CLI 출력의 ┌─ ... ┘ 박스를 그대로 복사하지 말고, 위 마크다운 포맷으로 다시 렌더링합니다.
|
|
72
|
+
- 연락처가 여러 개면 각각 한 줄씩 표시합니다.
|
|
73
|
+
- 환영 메시지가 없으면 💬 줄을 생략합니다.
|
|
74
|
+
- 명함이 비어있으면 명함 블록 전체를 생략합니다.`;
|
|
54
75
|
// ─── User Commands (글로벌 설치) ───
|
|
55
76
|
exports.USER_COMMANDS = [
|
|
56
77
|
{
|
|
@@ -120,6 +141,10 @@ ${LOGIN_JIT_GUIDE}
|
|
|
120
141
|
|
|
121
142
|
### 5. 완료 안내
|
|
122
143
|
- 배치된 파일과 활성화된 커맨드 목록을 보여줍니다.
|
|
144
|
+
${BUSINESS_CARD_FORMAT}
|
|
145
|
+
- **팔로우 제안**: 사용자에게 "@{username}을 팔로우할까요? 새 버전 알림을 받을 수 있습니다. (Y/n)"라고 반드시 물어봅니다.
|
|
146
|
+
- 수락하면: \`relay follow @{username}\` 실행. 로그인이 안 되어 있으면 먼저 \`relay login\` 실행 후 재시도.
|
|
147
|
+
- 거절하면: 건너뜁니다
|
|
123
148
|
- "바로 사용해볼까요?" 제안
|
|
124
149
|
|
|
125
150
|
## 예시
|
|
@@ -169,6 +194,7 @@ ${LOGIN_JIT_GUIDE}
|
|
|
169
194
|
### 특정 팀 업데이트
|
|
170
195
|
- 사용자가 팀 이름을 지정한 경우: \`relay update <@author/slug> --json\` 실행
|
|
171
196
|
- 업데이트 결과를 보여줍니다 (이전 버전 → 새 버전)
|
|
197
|
+
${BUSINESS_CARD_FORMAT}
|
|
172
198
|
|
|
173
199
|
### 전체 업데이트 확인
|
|
174
200
|
- 팀 이름을 지정하지 않은 경우:
|
|
@@ -368,6 +394,7 @@ portfolio:
|
|
|
368
394
|
### 7. 배포
|
|
369
395
|
- \`relay publish\` 명령어를 실행합니다.
|
|
370
396
|
- 배포 결과와 마켓플레이스 URL을 보여줍니다.
|
|
397
|
+
${BUSINESS_CARD_FORMAT}
|
|
371
398
|
|
|
372
399
|
## 예시
|
|
373
400
|
|