relayax-cli 0.1.999 → 0.2.12
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 +6 -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();
|
|
@@ -120,6 +120,10 @@ ${LOGIN_JIT_GUIDE}
|
|
|
120
120
|
|
|
121
121
|
### 5. 완료 안내
|
|
122
122
|
- 배치된 파일과 활성화된 커맨드 목록을 보여줍니다.
|
|
123
|
+
- CLI 출력에 포함된 **빌더 명함**(💬 환영 메시지, 📇 연락처, 👤 프로필 URL)을 사용자에게 그대로 보여줍니다.
|
|
124
|
+
- **팔로우 제안**: 사용자에게 "@{username}을 팔로우할까요? 새 버전 알림을 받을 수 있습니다. (Y/n)"라고 반드시 물어봅니다.
|
|
125
|
+
- 수락하면: \`relay follow @{username}\` 실행. 로그인이 안 되어 있으면 먼저 \`relay login\` 실행 후 재시도.
|
|
126
|
+
- 거절하면: 건너뜁니다
|
|
123
127
|
- "바로 사용해볼까요?" 제안
|
|
124
128
|
|
|
125
129
|
## 예시
|
|
@@ -169,6 +173,7 @@ ${LOGIN_JIT_GUIDE}
|
|
|
169
173
|
### 특정 팀 업데이트
|
|
170
174
|
- 사용자가 팀 이름을 지정한 경우: \`relay update <@author/slug> --json\` 실행
|
|
171
175
|
- 업데이트 결과를 보여줍니다 (이전 버전 → 새 버전)
|
|
176
|
+
- CLI 출력에 포함된 **빌더 명함**(💬 환영 메시지, 📇 연락처, 👤 프로필 URL)을 사용자에게 그대로 보여줍니다.
|
|
172
177
|
|
|
173
178
|
### 전체 업데이트 확인
|
|
174
179
|
- 팀 이름을 지정하지 않은 경우:
|
|
@@ -368,6 +373,7 @@ portfolio:
|
|
|
368
373
|
### 7. 배포
|
|
369
374
|
- \`relay publish\` 명령어를 실행합니다.
|
|
370
375
|
- 배포 결과와 마켓플레이스 URL을 보여줍니다.
|
|
376
|
+
- CLI 출력에 포함된 **빌더 명함 미리보기**(💬 환영 메시지, 📇 연락처, 👤 프로필 URL)를 사용자에게 그대로 보여줍니다.
|
|
371
377
|
|
|
372
378
|
## 예시
|
|
373
379
|
|