@eliceio/cdk-cli 0.1.0-alpha.4 → 0.1.0-alpha.6

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.
Files changed (107) hide show
  1. package/README.md +215 -152
  2. package/es/cli.js +65 -66
  3. package/es/commands/build/index.d.ts +1 -1
  4. package/es/commands/build/index.js +20 -7
  5. package/es/commands/create/index.d.ts +1 -1
  6. package/es/commands/create/index.js +5 -9
  7. package/es/commands/dev/index.d.ts +1 -1
  8. package/es/commands/dev/index.js +5 -5
  9. package/es/commands/doctor/index.d.ts +18 -1
  10. package/es/commands/doctor/index.js +137 -27
  11. package/es/commands/mcp/index.d.ts +0 -12
  12. package/es/commands/mcp/index.js +6 -57
  13. package/es/commands/setup/index.d.ts +11 -3
  14. package/es/commands/setup/index.js +112 -37
  15. package/es/commands/skill/index.d.ts +46 -8
  16. package/es/commands/skill/index.js +151 -35
  17. package/es/commands/uninstall/index.d.ts +54 -0
  18. package/es/commands/uninstall/index.js +304 -0
  19. package/es/commands/update/index.d.ts +59 -0
  20. package/es/commands/update/index.js +251 -0
  21. package/es/commands/{check → validate}/index.d.ts +1 -1
  22. package/es/commands/{check → validate}/index.js +1 -1
  23. package/es/core/collect.js +1 -1
  24. package/es/core/config.d.ts +20 -37
  25. package/es/core/config.js +36 -89
  26. package/es/core/latest.d.ts +21 -0
  27. package/es/core/latest.js +43 -0
  28. package/es/core/prepare.js +4 -3
  29. package/es/core/project-check.d.ts +2 -2
  30. package/es/core/project-check.js +2 -2
  31. package/es/core/sandbox.js +6 -3
  32. package/es/core/templates.d.ts +1 -3
  33. package/es/core/templates.js +1 -4
  34. package/es/dev/grading.d.ts +7 -8
  35. package/es/dev/grading.js +6 -16
  36. package/es/dev/host-page.d.ts +1 -1
  37. package/es/dev/host-page.js +29 -12
  38. package/es/dev/inject.d.ts +6 -0
  39. package/es/dev/inject.js +16 -1
  40. package/es/dev/mock-api.d.ts +8 -12
  41. package/es/dev/mock-api.js +50 -81
  42. package/es/dev/server.d.ts +4 -2
  43. package/es/dev/server.js +18 -29
  44. package/es/rules/check.js +80 -41
  45. package/es/rules/csp.d.ts +26 -0
  46. package/es/rules/csp.js +42 -0
  47. package/es/rules/index.d.ts +2 -1
  48. package/es/rules/index.js +2 -1
  49. package/es/rules/manifest.d.ts +28 -20
  50. package/es/rules/manifest.js +58 -55
  51. package/es/rules/refs.d.ts +12 -2
  52. package/es/rules/refs.js +50 -18
  53. package/es/rules/types.d.ts +6 -13
  54. package/es/rules.json.js +2 -2
  55. package/package.json +2 -3
  56. package/rules.json +48 -57
  57. package/skills/_shared/always.md +5 -4
  58. package/skills/elice-content-check/SKILL.md +10 -9
  59. package/skills/elice-content-create/SKILL.md +7 -7
  60. package/skills/elice-content-guide/SKILL.md +42 -0
  61. package/skills/elice-content-guide/topics/00-what-the-person-decides.md +11 -0
  62. package/skills/elice-content-guide/topics/01-check-the-environment.md +10 -0
  63. package/skills/elice-content-guide/topics/02-design-the-material.md +35 -0
  64. package/skills/elice-content-guide/topics/03-create-the-project.md +22 -0
  65. package/skills/elice-content-guide/topics/04-rules.md +14 -0
  66. package/skills/elice-content-guide/topics/05-screen-code.md +101 -0
  67. package/skills/elice-content-guide/topics/06-using-the-quiz-template.md +22 -0
  68. package/skills/elice-content-guide/topics/07-move-existing-html.md +10 -0
  69. package/skills/elice-content-guide/topics/08-fix-check-errors.md +27 -0
  70. package/skills/elice-content-guide/topics/09-check.md +11 -0
  71. package/skills/elice-content-guide/topics/10-build.md +8 -0
  72. package/skills/elice-content-guide/topics/11-more.md +4 -0
  73. package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +41 -0
  74. package/skills/elice-content-migrate/SKILL.md +10 -8
  75. package/skills/elice-content-publish/SKILL.md +8 -8
  76. package/templates/_shared/lib/cdk-mock.d.ts +5 -13
  77. package/templates/_shared/lib/cdk-mock.js +41 -136
  78. package/templates/_shared/lib/elice-content.css +81 -1
  79. package/templates/_shared/lib/elice-content.d.ts +6 -37
  80. package/templates/_shared/lib/elice-content.js +23 -236
  81. package/templates/blank/README.md +5 -6
  82. package/templates/blank/metadata.json +1 -3
  83. package/templates/blank/package.json +2 -2
  84. package/templates/blank/screens/edit.js +1 -1
  85. package/templates/blank/template.json +2 -2
  86. package/templates/quiz/README.md +4 -4
  87. package/templates/quiz/core/behaviors.js +4 -1
  88. package/templates/quiz/core/editor.d.ts +11 -9
  89. package/templates/quiz/core/editor.js +32 -32
  90. package/templates/quiz/core/model.js +3 -3
  91. package/templates/quiz/metadata.json +1 -3
  92. package/templates/quiz/package.json +2 -2
  93. package/templates/quiz/screens/edit.js +121 -29
  94. package/templates/quiz/screens/learn.js +5 -2
  95. package/templates/quiz/styles.css +96 -37
  96. package/templates/quiz/template.json +2 -2
  97. package/templates/quiz/ui/templates/edit.d.ts +4 -0
  98. package/templates/quiz/ui/templates/edit.js +69 -19
  99. package/templates/quiz/ui/templates/group.js +10 -2
  100. package/templates/quiz/ui/templates/page.js +1 -2
  101. package/templates/quiz/ui/templates/text.js +10 -7
  102. package/templates/quiz/ui/texts.js +14 -12
  103. package/es/commands/guide/index.d.ts +0 -29
  104. package/es/commands/guide/index.js +0 -120
  105. package/guides/content-development.md +0 -302
  106. package/templates/blank/completion.html +0 -15
  107. package/templates/blank/screens/completion.js +0 -7
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiz",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "title": "퀴즈",
5
- "description": "한 문항 퀴즈 (여러 문항은 페이지를 여러 개로). 문항 없이 시작해 편집 화면 \"문항 추가\"로 선택 · 순서 · 주관식 · 그룹 분류 문항 하나를 만듦. 정답은 편집 화면에서 정하고 채점해 완료(on_graded) 고정"
5
+ "description": "한 문항 퀴즈 (여러 문항은 페이지를 여러 개로). 문항 없이 시작해 편집 화면 \"문항 추가\"로 선택 · 순서 · 주관식 · 그룹 분류 문항 하나를 만듦. 정답은 편집 화면에서 정하고 기준 답안(pattern)으로 채점 (완료 정책은 LXP 설정 탭에서 교육자가 고름)"
6
6
  }
@@ -14,3 +14,7 @@ export declare const addQuestion: Template;
14
14
  export declare const answersIntro: Template;
15
15
  export declare const textAnswers: Template;
16
16
  export declare const singleQuestion: Template;
17
+ export declare const typeWarning: Template;
18
+ export declare const answerError: Template;
19
+ export declare const undoNotice: Template;
20
+ export declare const displayOptions: Template;
@@ -5,6 +5,19 @@ import { html } from '../../core/dom.js';
5
5
  import { texts } from '../texts.js';
6
6
 
7
7
  const t = texts.edit;
8
+ /** 삭제 아이콘 (문항은 휴지통, 보기 · 그룹은 ✕). 요소는 한 자리에만 들어가므로 쓸 때마다 새로 만든다 (색은 버튼 글자색을 따름) */
9
+ const icons = {
10
+ trash: () => html`
11
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
12
+ <path d="M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4h6v3" />
13
+ </svg>
14
+ `,
15
+ xmark: () => html`
16
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true">
17
+ <path d="M6 6l12 12M18 6L6 18" />
18
+ </svg>
19
+ `,
20
+ };
8
21
  /** 보기 · 그룹 목록에서 종류마다 다른 문구와 번호 표시 */
9
22
  const KIND = {
10
23
  option: {
@@ -29,31 +42,27 @@ const KIND = {
29
42
 
30
43
  /**
31
44
  * 글 입력 칸. data-role="input" (input · textarea), 있으면 data-role="count" (글자 수)
32
- * markdown이면 data-role="preview-toggle" (미리보기 버튼) · data-role="preview" (미리보기 자리, hidden)
45
+ * 필수면 "*", 아니면 "선택" (showOptional: false면 표시 없음)
33
46
  */
34
47
  export const field = ({
35
48
  label,
36
49
  required = false,
50
+ showOptional = true,
37
51
  hint,
38
52
  max,
39
53
  multiline = false,
40
- markdown = false,
41
54
  }) => {
42
55
  const mark = required
43
56
  ? html`<b class="qe-required">${t.required}</b>`
44
- : html`<span class="qe-optional">${t.optional}</span>`;
45
- const preview =
46
- markdown &&
47
- html`<button type="button" class="qe-link" data-role="preview-toggle">${t.preview}</button>`;
57
+ : showOptional && html`<span class="qe-optional">${t.optional}</span>`;
48
58
  return html`
49
59
  <label class="qe-field">
50
- <span class="qe-label">${label}${mark}${preview}</span>
60
+ <span class="qe-label">${label}${mark}</span>
51
61
  ${hint && html`<span class="qe-hint">${hint}</span>`}
52
62
  ${multiline
53
63
  ? html`<textarea class="qe-input" data-role="input"></textarea>`
54
64
  : html`<input class="qe-input" data-role="input" />`}
55
65
  ${max && html`<span class="qe-count" data-role="count"></span>`}
56
- ${markdown && html`<div class="qe-preview" data-role="preview" hidden></div>`}
57
66
  </label>
58
67
  `;
59
68
  };
@@ -83,8 +92,22 @@ export const section = ({ label, hint, body }) => html`
83
92
  </div>
84
93
  `;
85
94
 
86
- /** 보기 · 그룹 목록. rows: row()들 (같은 부모 아래 형제로 두어야 끌어서 순서 바꾸기가 됨) */
87
- export const list = ({ rows, add }) => html`<div class="qe-options">${rows}${add}</div>`;
95
+ /**
96
+ * 보기 · 그룹 목록. rows: row()들 (같은 부모 아래 형제로 두어야 끌어서 순서 바꾸기가 됨)
97
+ * answer: 정답 칸 종류(있으면 줄의 정답 칸 위에 "정답" 열 머리, data-role="answer-head") ·
98
+ * atMin: 최소 개수라 지울 수 없음 (목록 아래 안내)
99
+ */
100
+ export const list = ({ kind, rows, add, answer, atMin, min }) => html`
101
+ <div class="qe-options">
102
+ ${answer &&
103
+ html`<div class="qe-option qe-answer-head qe-answer-head-${answer}" data-role="answer-head" aria-hidden="true">
104
+ <span class="qe-handle-space"></span>
105
+ <span class="qe-answer-col">${t.answer}</span>
106
+ </div>`}
107
+ ${rows}${add}
108
+ ${atMin && html`<p class="qe-caption">${KIND[kind].min(min)}</p>`}
109
+ </div>
110
+ `;
88
111
 
89
112
  /**
90
113
  * 보기 줄의 정답 칸. type: 'radio'(단일) · 'checkbox'(복수) · 'select'(그룹 고르기, choices: [그룹 id, 이름]).
@@ -104,14 +127,13 @@ const answerControl = ({ type, name, choices = [] }, index) =>
104
127
  </select>
105
128
  `
106
129
  : html`
107
- <label class="qe-answer">
130
+ <label class="qe-answer qe-answer-col">
108
131
  <input
109
132
  type="${type}"
110
133
  data-role="answer"
111
134
  name="${name}"
112
135
  aria-label="${t.answerLabel(index + 1)}"
113
136
  />
114
- <span aria-hidden="true">${t.answer}</span>
115
137
  </label>
116
138
  `;
117
139
 
@@ -133,18 +155,19 @@ export const row = ({ kind, index, canDelete, min, answer }) => {
133
155
  >
134
156
  ${t.handle}
135
157
  </button>
158
+ ${answer && answer.type !== 'select' && answerControl(answer, index)}
136
159
  <span class="qe-option-no">${k.marker(index)}</span>
137
160
  <input class="qe-input qe-option-text" data-role="input" aria-label="${k.input(index)}" />
138
- ${answer && answerControl(answer, index)}
161
+ ${answer && answer.type === 'select' && answerControl(answer, index)}
139
162
  <button
140
163
  type="button"
141
- class="qe-icon"
164
+ class="ec-icon-button ec-danger"
142
165
  data-role="delete"
143
166
  aria-label="${k.remove(index)}"
144
167
  title="${canDelete ? '' : k.min(min)}"
145
168
  ${!canDelete && 'disabled'}
146
169
  >
147
- ${t.delete}
170
+ ${icons.xmark()}
148
171
  </button>
149
172
  </div>
150
173
  `;
@@ -165,6 +188,7 @@ export const addButton = ({ kind, full, max }) => html`
165
188
  /**
166
189
  * 문항 카드. body: 문항 칸들 · types: [[값, 이름], …]
167
190
  * data-role="type" (유형 select) · data-role="up" · data-role="down" · data-role="delete"
191
+ * 문항이 하나뿐이면 ↑ · ↓는 숨긴다 (옮길 곳이 없음)
168
192
  */
169
193
  export const card = ({ q, index, count, types, body }) => html`
170
194
  <section class="qe-card">
@@ -178,35 +202,61 @@ export const card = ({ q, index, count, types, body }) => html`
178
202
  </select>
179
203
  <button
180
204
  type="button"
181
- class="qe-icon"
205
+ class="ec-icon-button"
182
206
  data-role="up"
183
207
  aria-label="${t.questionUp(index + 1)}"
184
208
  ${index === 0 && 'disabled'}
209
+ ${count === 1 && 'hidden'}
185
210
  >
186
211
  ${t.up}
187
212
  </button>
188
213
  <button
189
214
  type="button"
190
- class="qe-icon"
215
+ class="ec-icon-button"
191
216
  data-role="down"
192
217
  aria-label="${t.questionDown(index + 1)}"
193
218
  ${index === count - 1 && 'disabled'}
219
+ ${count === 1 && 'hidden'}
194
220
  >
195
221
  ${t.down}
196
222
  </button>
197
223
  <button
198
224
  type="button"
199
- class="qe-icon"
225
+ class="ec-icon-button"
200
226
  data-role="delete"
201
227
  aria-label="${t.questionDelete(index + 1)}"
202
228
  >
203
- ${t.delete}
229
+ ${icons.trash()}
204
230
  </button>
205
231
  </header>
206
232
  ${body}
207
233
  </section>
208
234
  `;
209
235
 
236
+ /** 문항 카드 맨 위 알림 (유형을 바꿔 정답이 초기화됨). data-role="type-warning" */
237
+ export const typeWarning = ({ text }) =>
238
+ html`<p class="qe-warning" data-role="type-warning" role="status">${text}</p>`;
239
+
240
+ /** 저장하지 못한 정답 문제 (정답 자리 위). data-role="answer-error" */
241
+ export const answerError = ({ text }) =>
242
+ html`<p class="qe-answer-error" data-role="answer-error" role="alert">${text}</p>`;
243
+
244
+ /** 문항 삭제 뒤 되돌리기 알림. data-role="undo" (되돌리기 버튼) */
245
+ export const undoNotice = ({ text, action }) => html`
246
+ <div class="ec-notice" role="status">
247
+ <span>${text}</span>
248
+ <button type="button" class="ec-text-button" data-role="undo">${action}</button>
249
+ </div>
250
+ `;
251
+
252
+ /** 표시 옵션 묶음 (답안 순서 섞기 · 해설): 보기 목록과 줄로 나눈다 */
253
+ export const displayOptions = ({ label, body }) => html`
254
+ <div class="qe-section qe-display">
255
+ <span class="qe-label">${label}</span>
256
+ ${body}
257
+ </div>
258
+ `;
259
+
210
260
  /** 편집 화면 맨 위 안내 (정답을 어디서 고르는지) */
211
261
  export const answersIntro = ({ text }) => html`<p class="qe-hint qe-answers-intro">${text}</p>`;
212
262
 
@@ -63,6 +63,14 @@ export const group = {
63
63
  `,
64
64
  /** 보기를 모두 그룹에 놓았을 때 풀에 보이는 안내 */
65
65
  poolEmpty: () => html`<p class="qz-empty">${t.groupPoolEmpty}</p>`,
66
- /** 빈 그룹 안내 */
67
- boxEmpty: () => html`<p class="qz-empty">${t.groupEmpty}</p>`,
66
+ /** 빈 그룹: 파일 올리기 칸처럼 점선 상자 + 아이콘 + 안내 */
67
+ boxEmpty: () => html`
68
+ <div class="ec-dropzone">
69
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
70
+ <path d="M12 4v10M8 10l4 4 4-4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" />
71
+ </svg>
72
+ <p class="ec-dropzone-title">${t.groupEmptyTitle}</p>
73
+ <p>${t.groupEmpty}</p>
74
+ </div>
75
+ `,
68
76
  };
@@ -6,9 +6,8 @@ import { texts } from '../texts.js';
6
6
  /** 내용을 받기 전까지 보이는 문구 (학생 · 교육자 · 편집 공통) */
7
7
  export const loading = () => html`<p class="ec-muted">${texts.page.loading}</p>`;
8
8
 
9
- /** 학생 화면 머리: 배지 · 제목 · 안내 */
9
+ /** 학생 화면 머리: 제목 · 안내 */
10
10
  export const learnHeader = ({ title, description }) => html`
11
- <span class="qz-badge">${texts.learn.badge}</span>
12
11
  <h1 class="qz-title">${title}</h1>
13
12
  ${description ? markdown(description, 'qz-markdown qz-lead') : null}
14
13
  `;
@@ -5,12 +5,15 @@ import { texts } from '../texts.js';
5
5
 
6
6
  const t = texts.question;
7
7
 
8
- /** @param {{ q: object }} props */
8
+ /** @param {{ q: object }} props. 아래 안내: 채점은 앞뒤 공백을 지우고 비교 (정답은 보이지 않음) */
9
9
  export const text = ({ q }) => html`
10
- <textarea
11
- class="qz-text"
12
- data-role="input"
13
- placeholder="${q.placeholder || t.textPlaceholder}"
14
- aria-label="${t.textLabel}"
15
- ></textarea>
10
+ <div class="qz-text-field">
11
+ <textarea
12
+ class="qz-text"
13
+ data-role="input"
14
+ placeholder="${q.placeholder || t.textPlaceholder}"
15
+ aria-label="${t.textLabel}"
16
+ ></textarea>
17
+ <p class="qz-muted">${t.textTrim}</p>
18
+ </div>
16
19
  `;
@@ -22,16 +22,17 @@ export const texts = {
22
22
  /** 편집 화면의 정답 (ADR 0009: 퀴즈는 채점해 통과하면 완료 · 기준 답안 고정, 정답은 문항마다 여기서 고름) */
23
23
  answers: {
24
24
  intro:
25
- '정답은 문항마다 고릅니다 (객관식 · 그룹 분류는 보기 줄에서, 순서 맞추기 · 주관식은 "정답"에서). 저장하면 고른 정답으로 기준 답안(정규표현식)을 만들어 채점에 씁니다. 학생은 모든 문항을 맞혀야 완료(100점)됩니다. 정답은 학생에게 보이지 않습니다.',
25
+ '정답은 보기 줄에서 고릅니다(순서 맞추기 · 주관식은 "정답"에서). 저장하면 고른 정답으로 채점하며, 정답은 학생에게 보이지 않습니다.',
26
26
  label: '정답',
27
27
  hint: {
28
- select_one: '정답 보기 옆의 "정답"을 고르세요.',
29
- select_multiple: '정답 보기 옆의 "정답"을 모두 고르세요.',
28
+ select_one: "정답인 보기를 '정답' 열에서 고르세요.",
29
+ select_multiple: "정답인 보기를 '정답' 열에서 모두 고르세요.",
30
30
  order: '정답 순서대로 칸에 놓으세요.',
31
- group: '보기마다 정답 그룹을 고르세요. "그룹 없음"인 보기는 오답 보기입니다.',
32
- text: '정답으로 인정할 답을 줄마다 하나씩 적으세요. 앞뒤 공백은 무시합니다.',
31
+ group: "보기마다 들어갈 그룹을 '정답' 열에서 고르세요. \"오답 (그룹 없음)\"인 보기는 어느 그룹에도 넣지 않는 오답 보기입니다.",
32
+ text: '정답으로 인정할 답을 한 줄에 하나씩 적으세요. 여러 줄이면 그중 하나만 맞아도 정답입니다. 앞뒤 공백은 무시합니다.',
33
33
  },
34
34
  textPlaceholder: '예: 가중치\nweight',
35
+ typeChanged: '유형을 바꾸면 고른 정답이 초기화됩니다. 정답을 다시 고른 뒤 저장하세요.',
35
36
  unreadable:
36
37
  '저장된 정답(기준 답안)을 이 화면이 읽지 못했어요. 문항마다 정답을 다시 골라 저장해 주세요.',
37
38
  validation: {
@@ -46,7 +47,6 @@ export const texts = {
46
47
 
47
48
  /** 학생 화면 */
48
49
  learn: {
49
- badge: '확인 문제',
50
50
  unanswered: no => `${no}번 문항에 답해 주세요.`,
51
51
  },
52
52
 
@@ -62,10 +62,11 @@ export const texts = {
62
62
  question: {
63
63
  title: (no, title) => `${no}. ${title}`,
64
64
  correct: '정답',
65
- wrong: '다시 한번 풀어보세요.',
65
+ wrong: '다시 한번 풀어보세요. 답을 고친 뒤 다시 제출하세요.',
66
66
  explanation: '퀴즈 해설 보기',
67
67
  textPlaceholder: '답안을 작성해 주세요.',
68
68
  textLabel: '답안',
69
+ textTrim: '앞뒤 공백은 무시하고 비교합니다.',
69
70
  pool: '보기',
70
71
  answer: '답안',
71
72
  orderPoolEmpty: '항목을 다시 이곳으로 옮길 수 있습니다.',
@@ -74,7 +75,8 @@ export const texts = {
74
75
  groupRemove: '빼기',
75
76
  groupRemoveLabel: option => `${option} 빼기`,
76
77
  groupPoolEmpty: '모든 보기를 그룹에 배치하였습니다.',
77
- groupEmpty: '보기를 영역에 끌어 넣거나, 보기를 누른 뒤 이곳을 눌러 주세요.',
78
+ groupEmptyTitle: '보기를 여기로 끌어 놓으세요',
79
+ groupEmpty: '또는 보기를 누른 뒤 이곳을 눌러 주세요.',
78
80
  },
79
81
 
80
82
  /** 내용 편집 화면 */
@@ -85,13 +87,13 @@ export const texts = {
85
87
  optional: ' 선택',
86
88
  required: ' *',
87
89
  count: (length, max) => `${length} / ${max}`,
88
- preview: '미리보기',
89
- previewClose: '미리보기 닫기',
90
90
  question: no => `문항 ${no}`,
91
91
  questionType: no => `문항 ${no} 유형`,
92
92
  questionUp: no => `문항 ${no} 위로`,
93
93
  questionDown: no => `문항 ${no} 아래로`,
94
94
  questionDelete: no => `문항 ${no} 삭제`,
95
+ questionDeleted: no => `문항 ${no}을 삭제했습니다.`,
96
+ undo: '되돌리기',
95
97
  addQuestion: '+ 문항 추가',
96
98
  singleQuestion: '퀴즈 하나에 문항은 하나입니다. 여러 문항은 퀴즈 페이지를 여러 개 만들어 주세요.',
97
99
  title: '질문',
@@ -112,17 +114,17 @@ export const texts = {
112
114
  answer: '정답',
113
115
  answerLabel: no => `보기 ${no} 정답`,
114
116
  answerGroup: no => `보기 ${no} 정답 그룹`,
115
- answerNoGroup: '그룹 없음 (오답)',
117
+ answerNoGroup: '오답 (그룹 없음)',
116
118
  slots: '답안 칸 수',
117
119
  slotsHint: '보기 중 답안 칸에 놓을 개수. 나머지 보기는 오답 보기가 됩니다.',
118
120
  placeholder: '입력란 힌트',
119
121
  placeholderHint: '비우면 "답안을 작성해 주세요."',
122
+ display: '표시 옵션',
120
123
  shuffle: '답안 순서 섞기 (학생마다 보기 순서가 달라집니다)',
121
124
  explanationOn: '해설 사용 (학생이 한 번 제출하면 보입니다)',
122
125
  explanation: '해설',
123
126
  sortLabel: label => `${label} 순서 바꾸기 (끌거나 ↑ · ↓ 키)`,
124
127
  sortTitle: '끌어서 순서 바꾸기',
125
- delete: '×',
126
128
  up: '↑',
127
129
  down: '↓',
128
130
  handle: '⠿',
@@ -1,29 +0,0 @@
1
- import type { CommandResult } from '../../types.js';
2
- export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk guide [\uC8FC\uC81C] [--json]\n\n \uC5D0\uC774\uC804\uD2B8(Claude \uB4F1)\uAC00 \uD559\uC2B5\uC790\uB8CC\uB97C \uB9CC\uB4E4 \uB54C \uC77D\uB294 \uAC1C\uBC1C \uAC00\uC774\uB4DC(\uC601\uC5B4)\uB97C \uCD9C\uB825\uD55C\uB2E4.\n \uC8FC\uC81C \uC5C6\uC774: \uC8FC\uC81C \uBAA9\uB85D \u00B7 \uC8FC\uC81C: \uADF8 \uC808\uB9CC (\uBC88\uD638\uB098 \uC55E\uBD80\uBD84\uB9CC \uC801\uC5B4\uB3C4 \uB428, \uC608: build \u00B7 10) \u00B7 all: \uC804\uCCB4\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uC131\uACF5 \u00B7 2 \uC5C6\uB294 \uC8FC\uC81C";
3
- /** CLI 패키지에 들어 있는 가이드: CLI와 같은 버전이라 명령 · 규칙과 어긋나지 않는다 */
4
- export declare const GUIDE_FILE: string;
5
- export interface GuideTopic {
6
- /** 제목을 소문자 · 하이픈으로 (예: "10. Build" → "10-build") */
7
- id: string;
8
- title: string;
9
- /** 제목 줄을 포함한 절 본문 */
10
- body: string;
11
- }
12
- export interface Guide {
13
- title: string;
14
- /** 첫 `##` 앞 (무엇을 만드는지 · 화면 표) */
15
- intro: string;
16
- topics: GuideTopic[];
17
- }
18
- /** 제목 → 주제 id: 소문자, 글자 · 숫자가 아닌 것이 이어지면 하이픈 하나 */
19
- export declare function toTopicId(title: string): string;
20
- /** `##` 절로 나눈다. 코드 블록 안의 `##`는 제목이 아니다 */
21
- export declare function parseGuide(markdown: string): Guide;
22
- export declare function loadGuide(file?: string): Guide;
23
- /** 주제 찾기: id 그대로 → 번호(10) → id 안의 낱말(build) 순. 여럿이면 찾지 못한 것으로 */
24
- export declare function findTopic(guide: Guide, query: string): GuideTopic | undefined;
25
- export declare function run(args: {
26
- topic?: string | undefined;
27
- json: boolean;
28
- file?: string;
29
- }): CommandResult;
@@ -1,120 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { fileURLToPath } from 'node:url';
3
- import { VERSION } from '../../version.js';
4
-
5
- const usage = `사용법: ecdk guide [주제] [--json]
6
-
7
- 에이전트(Claude 등)가 학습자료를 만들 때 읽는 개발 가이드(영어)를 출력한다.
8
- 주제 없이: 주제 목록 · 주제: 그 절만 (번호나 앞부분만 적어도 됨, 예: build · 10) · all: 전체
9
-
10
- 종료 코드: 0 성공 · 2 없는 주제`;
11
- /** CLI 패키지에 들어 있는 가이드: CLI와 같은 버전이라 명령 · 규칙과 어긋나지 않는다 */
12
- const GUIDE_FILE = fileURLToPath(new URL('../../../guides/content-development.md', import.meta.url));
13
- /** 제목 → 주제 id: 소문자, 글자 · 숫자가 아닌 것이 이어지면 하이픈 하나 */
14
- function toTopicId(title) {
15
- return title.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, '-').replace(/^-+|-+$/g, '');
16
- }
17
- /** `##` 절로 나눈다. 코드 블록 안의 `##`는 제목이 아니다 */
18
- function parseGuide(markdown) {
19
- const title = /^#\s+(.+?)\s*$/m.exec(markdown)?.[1] ?? '';
20
- const intro = [];
21
- const topics = [];
22
- let current = null;
23
- let fence = null;
24
- const flush = () => {
25
- if (current) topics.push({
26
- id: toTopicId(current.title),
27
- title: current.title,
28
- body: current.lines.join('\n').trimEnd()
29
- });
30
- };
31
- for (const line of markdown.split('\n')) {
32
- const marker = /^\s*(`{3,}|~{3,})/.exec(line)?.[1];
33
- if (marker) {
34
- if (fence === null) fence = marker;else if (marker.startsWith(fence[0] ?? '') && marker.length >= fence.length) fence = null;
35
- }
36
- const heading = fence === null ? /^##\s+(.+?)\s*#*\s*$/.exec(line)?.[1] : undefined;
37
- if (heading) {
38
- flush();
39
- current = {
40
- title: heading,
41
- lines: [line]
42
- };
43
- } else if (current) current.lines.push(line);else if (!/^#\s/.test(line)) intro.push(line);
44
- }
45
- flush();
46
- return {
47
- title,
48
- intro: intro.join('\n').trim(),
49
- topics
50
- };
51
- }
52
- function loadGuide(file = GUIDE_FILE) {
53
- return parseGuide(readFileSync(file, 'utf8'));
54
- }
55
- /** 주제 찾기: id 그대로 → 번호(10) → id 안의 낱말(build) 순. 여럿이면 찾지 못한 것으로 */
56
- function findTopic(guide, query) {
57
- const q = toTopicId(query);
58
- if (!q) return undefined;
59
- const exact = guide.topics.find(t => t.id === q);
60
- if (exact) return exact;
61
- const byNumber = guide.topics.find(t => t.id.startsWith(`${q}-`) && /^\d+$/.test(q));
62
- if (byNumber) return byNumber;
63
- // 번호 없이 적은 id (예: what-the-person-decides → 0-what-the-person-decides)
64
- const byName = guide.topics.find(t => t.id.replace(/^\d+-/, '') === q);
65
- if (byName) return byName;
66
- const partial = guide.topics.filter(t => t.id.split('-').some(word => word === q) || t.id.startsWith(q));
67
- return partial.length === 1 ? partial[0] : undefined;
68
- }
69
- function list(guide) {
70
- return [`# ${guide.title} (ecdk ${VERSION})`, '', guide.intro, '', 'Topics (read one with `ecdk guide <topic>`, everything with `ecdk guide all`):', ...guide.topics.map(t => `- ${t.id}: ${t.title}`)].join('\n');
71
- }
72
- function run(args) {
73
- const guide = loadGuide(args.file);
74
- const topics = guide.topics.map(({
75
- id,
76
- title
77
- }) => ({
78
- id,
79
- title
80
- }));
81
- if (args.topic === undefined) {
82
- return {
83
- exitCode: 0,
84
- output: args.json ? JSON.stringify({
85
- title: guide.title,
86
- version: VERSION,
87
- intro: guide.intro,
88
- topics
89
- }, null, 2) : list(guide)
90
- };
91
- }
92
- if (args.topic === 'all') {
93
- const text = readFileSync(args.file ?? GUIDE_FILE, 'utf8');
94
- return {
95
- exitCode: 0,
96
- output: args.json ? JSON.stringify({
97
- title: guide.title,
98
- version: VERSION,
99
- markdown: text
100
- }, null, 2) : text
101
- };
102
- }
103
- const topic = findTopic(guide, args.topic);
104
- if (!topic) {
105
- const message = `없는 주제입니다: ${args.topic}`;
106
- return {
107
- exitCode: 2,
108
- output: args.json ? JSON.stringify({
109
- error: message,
110
- topics
111
- }, null, 2) : `${message}\n\n${topics.map(t => `- ${t.id}: ${t.title}`).join('\n')}`
112
- };
113
- }
114
- return {
115
- exitCode: 0,
116
- output: args.json ? JSON.stringify(topic, null, 2) : topic.body
117
- };
118
- }
119
-
120
- export { GUIDE_FILE, findTopic, loadGuide, parseGuide, run, toTopicId, usage };