relayax-cli 0.2.17 → 0.2.18

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.
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerChangelog(program: Command): void;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.registerChangelog = registerChangelog;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const js_yaml_1 = __importDefault(require("js-yaml"));
10
+ function registerChangelog(program) {
11
+ const changelog = program
12
+ .command('changelog')
13
+ .description('팀 패키지의 changelog를 관리합니다');
14
+ changelog
15
+ .command('add')
16
+ .description('relay.yaml에 changelog 엔트리를 추가합니다')
17
+ .argument('[message]', 'changelog 메시지 (없으면 에디터에서 입력)')
18
+ .action(async (message) => {
19
+ const yamlPath = path_1.default.resolve('relay.yaml');
20
+ if (!fs_1.default.existsSync(yamlPath)) {
21
+ console.error('relay.yaml을 찾을 수 없습니다. 팀 패키지 디렉토리에서 실행하세요.');
22
+ process.exit(1);
23
+ }
24
+ const content = fs_1.default.readFileSync(yamlPath, 'utf-8');
25
+ const doc = js_yaml_1.default.load(content) ?? {};
26
+ if (!message) {
27
+ // Read from stdin if piped, otherwise prompt
28
+ const readline = await import('readline');
29
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
30
+ message = await new Promise((resolve) => {
31
+ rl.question('Changelog 메시지: ', (answer) => {
32
+ rl.close();
33
+ resolve(answer);
34
+ });
35
+ });
36
+ }
37
+ if (!message || message.trim() === '') {
38
+ console.error('changelog 메시지가 비어있습니다.');
39
+ process.exit(1);
40
+ }
41
+ const version = String(doc.version ?? '1.0.0');
42
+ const date = new Date().toISOString().split('T')[0];
43
+ const entry = `## v${version} (${date})\n\n- ${message.trim()}`;
44
+ const existing = doc.changelog ? String(doc.changelog) : '';
45
+ doc.changelog = existing ? `${entry}\n\n${existing}` : entry;
46
+ fs_1.default.writeFileSync(yamlPath, js_yaml_1.default.dump(doc, { lineWidth: -1, noRefs: true }), 'utf-8');
47
+ console.log(`\x1b[32m✓\x1b[0m changelog 추가됨 (v${version})`);
48
+ console.log(` ${message.trim()}`);
49
+ });
50
+ changelog
51
+ .command('show')
52
+ .description('현재 relay.yaml의 changelog를 표시합니다')
53
+ .action(() => {
54
+ const yamlPath = path_1.default.resolve('relay.yaml');
55
+ if (!fs_1.default.existsSync(yamlPath)) {
56
+ console.error('relay.yaml을 찾을 수 없습니다.');
57
+ process.exit(1);
58
+ }
59
+ const content = fs_1.default.readFileSync(yamlPath, 'utf-8');
60
+ const doc = js_yaml_1.default.load(content) ?? {};
61
+ if (!doc.changelog) {
62
+ console.log('changelog가 없습니다. `relay changelog add "메시지"`로 추가하세요.');
63
+ return;
64
+ }
65
+ console.log(String(doc.changelog));
66
+ });
67
+ }
@@ -101,6 +101,21 @@ function registerUpdate(program) {
101
101
  const authorDisplayName = team.author?.display_name ?? authorUsername ?? '';
102
102
  const contactParts = (0, contact_format_js_1.formatContactParts)(team.author?.contact_links);
103
103
  const hasCard = team.welcome || contactParts.length > 0 || authorUsername;
104
+ // Show changelog for this version
105
+ try {
106
+ const versions = await (0, api_js_1.fetchTeamVersions)(slug);
107
+ const thisVersion = versions.find((v) => v.version === latestVersion);
108
+ if (thisVersion?.changelog) {
109
+ console.log(`\n \x1b[90m── Changelog ──────────────────────────────\x1b[0m`);
110
+ for (const line of thisVersion.changelog.split('\n').slice(0, 5)) {
111
+ console.log(` ${line}`);
112
+ }
113
+ console.log(` \x1b[90m───────────────────────────────────────────\x1b[0m`);
114
+ }
115
+ }
116
+ catch {
117
+ // Non-critical: skip changelog display
118
+ }
104
119
  if (hasCard) {
105
120
  console.log(`\n \x1b[90m┌─ ${authorDisplayName || '빌더'}의 명함 ${'─'.repeat(Math.max(0, 34 - (authorDisplayName || '빌더').length))}┐\x1b[0m`);
106
121
  if (team.welcome) {
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ 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
17
  const follow_js_1 = require("./commands/follow.js");
18
+ const changelog_js_1 = require("./commands/changelog.js");
18
19
  // eslint-disable-next-line @typescript-eslint/no-var-requires
19
20
  const pkg = require('../package.json');
20
21
  const program = new commander_1.Command();
@@ -36,4 +37,5 @@ program
36
37
  (0, outdated_js_1.registerOutdated)(program);
37
38
  (0, check_update_js_1.registerCheckUpdate)(program);
38
39
  (0, follow_js_1.registerFollow)(program);
40
+ (0, changelog_js_1.registerChangelog)(program);
39
41
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayax-cli",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "RelayAX Agent Team Marketplace CLI - Install and manage agent teams",
5
5
  "main": "dist/index.js",
6
6
  "bin": {