@eliceio/cdk-cli 0.1.0-alpha.2 → 0.1.0-alpha.3
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/README.md +158 -138
- package/es/cli.js +88 -33
- package/es/commands/build/index.d.ts +1 -1
- package/es/commands/build/index.js +16 -6
- package/es/commands/check/index.d.ts +8 -2
- package/es/commands/check/index.js +45 -5
- package/es/commands/create/index.d.ts +2 -0
- package/es/commands/create/index.js +28 -3
- package/es/commands/create/scaffold.d.ts +2 -0
- package/es/commands/create/scaffold.js +10 -6
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +6 -2
- package/es/commands/doctor/index.d.ts +11 -0
- package/es/commands/doctor/index.js +155 -26
- package/es/commands/mcp/index.d.ts +134 -0
- package/es/commands/mcp/index.js +399 -0
- package/es/commands/setup/index.d.ts +40 -0
- package/es/commands/setup/index.js +157 -0
- package/es/commands/skill/index.d.ts +2 -5
- package/es/commands/skill/index.js +1 -29
- package/es/core/config.d.ts +63 -19
- package/es/core/config.js +108 -32
- package/es/core/prepare.js +3 -5
- package/es/core/project-check.d.ts +15 -0
- package/es/core/project-check.js +26 -0
- package/es/core/templates.d.ts +25 -0
- package/es/core/templates.js +41 -0
- package/es/dev/grading.d.ts +14 -7
- package/es/dev/grading.js +27 -13
- package/es/dev/host-page.d.ts +1 -1
- package/es/dev/host-page.js +33 -33
- package/es/dev/mock-api.d.ts +20 -4
- package/es/dev/mock-api.js +70 -9
- package/es/dev/server.d.ts +7 -0
- package/es/dev/server.js +84 -23
- package/es/rules/check.js +56 -7
- package/es/rules/index.d.ts +1 -1
- package/es/rules/index.js +1 -1
- package/es/rules/manifest.d.ts +23 -9
- package/es/rules/manifest.js +60 -35
- package/es/rules/node.js +3 -1
- package/es/rules/semver.d.ts +5 -0
- package/es/rules/semver.js +32 -0
- package/es/rules/types.d.ts +27 -6
- package/es/rules.json.js +1 -1
- package/guides/content-development.md +136 -49
- package/package.json +2 -2
- package/rules.json +62 -7
- package/skills/_shared/always.md +3 -1
- package/skills/elice-content-check/SKILL.md +1 -1
- package/skills/elice-content-create/SKILL.md +4 -4
- package/skills/elice-content-migrate/SKILL.md +1 -1
- package/skills/elice-content-publish/SKILL.md +22 -0
- package/templates/_shared/lib/cdk-mock.d.ts +21 -3
- package/templates/_shared/lib/cdk-mock.js +239 -80
- package/templates/_shared/lib/cdk.js +2 -2
- package/templates/_shared/lib/elice-content.css +196 -0
- package/templates/_shared/lib/elice-content.d.ts +110 -5
- package/templates/_shared/lib/elice-content.js +643 -38
- package/templates/blank/README.md +12 -3
- package/templates/blank/completion.html +15 -0
- package/templates/blank/elice.config.json +3 -5
- package/templates/blank/gitignore +1 -0
- package/templates/blank/screens/completion.js +7 -0
- package/templates/blank/screens/edit.js +3 -0
- package/templates/blank/template.json +6 -0
- package/templates/quiz/README.md +35 -28
- package/templates/quiz/content.json +17 -63
- package/templates/quiz/core/behaviors.d.ts +5 -0
- package/templates/quiz/core/behaviors.js +12 -0
- package/templates/quiz/core/model.d.ts +27 -1
- package/templates/quiz/core/model.js +199 -4
- package/templates/quiz/elice.config.json +1 -6
- package/templates/quiz/gitignore +1 -0
- package/templates/quiz/grading.json +1 -10
- package/templates/quiz/screens/edit.js +105 -31
- package/templates/quiz/screens/learn.js +7 -8
- package/templates/quiz/template.json +6 -0
- package/templates/quiz/ui/templates/edit.d.ts +2 -0
- package/templates/quiz/ui/templates/edit.js +16 -9
- package/templates/quiz/ui/texts.js +52 -27
package/es/cli.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { parseArgs } from 'node:util';
|
|
2
|
-
import { usage as usage$
|
|
3
|
-
import { usage as usage$
|
|
4
|
-
import { usage as usage$
|
|
5
|
-
import { usage as usage$
|
|
6
|
-
import { usage as usage$
|
|
7
|
-
import { usage as usage$
|
|
8
|
-
import { usage, run } from './commands/
|
|
2
|
+
import { usage as usage$7, run as run$7 } from './commands/build/index.js';
|
|
3
|
+
import { usage as usage$8, run as run$8 } from './commands/check/index.js';
|
|
4
|
+
import { usage as usage$6, list, run as run$6 } from './commands/create/index.js';
|
|
5
|
+
import { usage as usage$5, run as run$5 } from './commands/dev/index.js';
|
|
6
|
+
import { usage as usage$4, run as run$4 } from './commands/doctor/index.js';
|
|
7
|
+
import { usage as usage$3, run as run$3 } from './commands/guide/index.js';
|
|
8
|
+
import { usage, run } from './commands/mcp/index.js';
|
|
9
|
+
import { usage as usage$1, run as run$1 } from './commands/setup/index.js';
|
|
10
|
+
import { usage as usage$2, run as run$2 } from './commands/skill/index.js';
|
|
9
11
|
import 'fflate';
|
|
10
12
|
import { RULES_VERSION } from './rules/spec.js';
|
|
11
13
|
import { VERSION } from './version.js';
|
|
@@ -13,13 +15,15 @@ import { VERSION } from './version.js';
|
|
|
13
15
|
const help = `ecdk ${VERSION} · Elice CDK CLI (Custom HTML 콘텐츠 도구)
|
|
14
16
|
|
|
15
17
|
명령:
|
|
16
|
-
create <폴더> 새 프로젝트 (--template quiz|blank, --theme light|dark)
|
|
18
|
+
create <폴더> 새 프로젝트 (--template quiz|blank, --theme light|dark, --list로 템플릿 목록)
|
|
17
19
|
check [경로] 업로드 전 검사 (서버와 같은 규칙)
|
|
18
20
|
build [폴더] 정답·비밀 제외 → 검사 → content.zip
|
|
19
21
|
dev [폴더] 운영과 같은 조건의 로컬 서버 (--port)
|
|
20
22
|
doctor [폴더] 환경·프로젝트 점검 (--fix)
|
|
21
23
|
guide [주제] 에이전트용 개발 가이드 (주제 목록 · 한 절 · all)
|
|
24
|
+
setup 처음 한 번: 스킬 설치 + 학습자료 서버 MCP 등록 + 점검 (--env prod|qa5, --dry-run)
|
|
22
25
|
skill install Claude Code 스킬 설치 (--project, --force)
|
|
26
|
+
mcp setup 학습자료 서버 MCP 등록 (--target, --env prod|qa5, --url, --dry-run)
|
|
23
27
|
|
|
24
28
|
공통 옵션: --json, --help, --version`;
|
|
25
29
|
const usageError = (message, usage) => ({
|
|
@@ -61,6 +65,23 @@ async function main(argv) {
|
|
|
61
65
|
type: 'string',
|
|
62
66
|
short: 'p'
|
|
63
67
|
},
|
|
68
|
+
target: {
|
|
69
|
+
type: 'string'
|
|
70
|
+
},
|
|
71
|
+
env: {
|
|
72
|
+
type: 'string'
|
|
73
|
+
},
|
|
74
|
+
url: {
|
|
75
|
+
type: 'string'
|
|
76
|
+
},
|
|
77
|
+
'dry-run': {
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
default: false
|
|
80
|
+
},
|
|
81
|
+
list: {
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
64
85
|
help: {
|
|
65
86
|
type: 'boolean',
|
|
66
87
|
short: 'h',
|
|
@@ -94,63 +115,64 @@ async function main(argv) {
|
|
|
94
115
|
{
|
|
95
116
|
if (values.help) return {
|
|
96
117
|
exitCode: 0,
|
|
97
|
-
output: usage$
|
|
118
|
+
output: usage$8
|
|
98
119
|
};
|
|
99
|
-
if (rest.length > 1) return usageError('경로는 하나만 줄 수 있습니다.', usage$
|
|
120
|
+
if (rest.length > 1) return usageError('경로는 하나만 줄 수 있습니다.', usage$8);
|
|
100
121
|
try {
|
|
101
|
-
return await run$
|
|
122
|
+
return await run$8({
|
|
102
123
|
target: rest[0] ?? '.',
|
|
103
124
|
json: values.json
|
|
104
125
|
});
|
|
105
126
|
} catch (e) {
|
|
106
127
|
const message = e.code === 'ENOENT' ? `경로가 없습니다: ${rest[0] ?? '.'}` : e.message;
|
|
107
|
-
return usageError(message, usage$
|
|
128
|
+
return usageError(message, usage$8);
|
|
108
129
|
}
|
|
109
130
|
}
|
|
110
131
|
case 'build':
|
|
111
132
|
{
|
|
112
133
|
if (values.help) return {
|
|
113
134
|
exitCode: 0,
|
|
114
|
-
output: usage$
|
|
135
|
+
output: usage$7
|
|
115
136
|
};
|
|
116
|
-
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$
|
|
137
|
+
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$7);
|
|
117
138
|
try {
|
|
118
|
-
return await run$
|
|
139
|
+
return await run$7({
|
|
119
140
|
target: rest[0] ?? '.',
|
|
120
141
|
json: values.json
|
|
121
142
|
});
|
|
122
143
|
} catch (e) {
|
|
123
144
|
const message = e.code === 'ENOENT' ? `폴더가 없습니다: ${rest[0] ?? '.'}` : e.message;
|
|
124
|
-
return usageError(message, usage$
|
|
145
|
+
return usageError(message, usage$7);
|
|
125
146
|
}
|
|
126
147
|
}
|
|
127
148
|
case 'create':
|
|
128
149
|
{
|
|
129
150
|
if (values.help) return {
|
|
130
151
|
exitCode: 0,
|
|
131
|
-
output: usage$
|
|
152
|
+
output: usage$6
|
|
132
153
|
};
|
|
133
|
-
if (
|
|
154
|
+
if (values.list) return list(values.json);
|
|
155
|
+
if (rest.length !== 1) return usageError('만들 폴더를 하나 적어 주세요.', usage$6);
|
|
134
156
|
try {
|
|
135
|
-
return await run$
|
|
157
|
+
return await run$6({
|
|
136
158
|
target: rest[0] ?? '',
|
|
137
159
|
template: values.template ?? 'quiz',
|
|
138
160
|
theme: values.theme ?? 'light',
|
|
139
161
|
json: values.json
|
|
140
162
|
});
|
|
141
163
|
} catch (e) {
|
|
142
|
-
return usageError(e.message, usage$
|
|
164
|
+
return usageError(e.message, usage$6);
|
|
143
165
|
}
|
|
144
166
|
}
|
|
145
167
|
case 'dev':
|
|
146
168
|
{
|
|
147
169
|
if (values.help) return {
|
|
148
170
|
exitCode: 0,
|
|
149
|
-
output: usage$
|
|
171
|
+
output: usage$5
|
|
150
172
|
};
|
|
151
|
-
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$
|
|
173
|
+
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$5);
|
|
152
174
|
try {
|
|
153
|
-
return await run$
|
|
175
|
+
return await run$5({
|
|
154
176
|
target: rest[0] ?? '.',
|
|
155
177
|
...(values.port === undefined ? {} : {
|
|
156
178
|
port: values.port
|
|
@@ -158,18 +180,18 @@ async function main(argv) {
|
|
|
158
180
|
});
|
|
159
181
|
} catch (e) {
|
|
160
182
|
const err = e;
|
|
161
|
-
const message = err.code === 'EADDRINUSE' ?
|
|
162
|
-
return usageError(message, usage$
|
|
183
|
+
const message = err.code === 'EADDRINUSE' ? `${err.message.includes('포트') ? err.message : '포트가 이미 쓰이고 있습니다.'} ecdk dev는 화면 포트(N)와 콘텐츠 포트(N+1) 두 개를 씁니다. --port로 다른 값을 주세요 (예: --port 4180).` : err.code === 'ENOENT' ? `폴더가 없습니다: ${rest[0] ?? '.'}` : err.message;
|
|
184
|
+
return usageError(message, usage$5);
|
|
163
185
|
}
|
|
164
186
|
}
|
|
165
187
|
case 'doctor':
|
|
166
188
|
{
|
|
167
189
|
if (values.help) return {
|
|
168
190
|
exitCode: 0,
|
|
169
|
-
output: usage$
|
|
191
|
+
output: usage$4
|
|
170
192
|
};
|
|
171
|
-
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$
|
|
172
|
-
return run$
|
|
193
|
+
if (rest.length > 1) return usageError('프로젝트 폴더는 하나만 줄 수 있습니다.', usage$4);
|
|
194
|
+
return run$4({
|
|
173
195
|
target: rest[0] ?? '.',
|
|
174
196
|
json: values.json,
|
|
175
197
|
fix: values.fix
|
|
@@ -179,24 +201,57 @@ async function main(argv) {
|
|
|
179
201
|
{
|
|
180
202
|
if (values.help) return {
|
|
181
203
|
exitCode: 0,
|
|
182
|
-
output: usage$
|
|
204
|
+
output: usage$3
|
|
183
205
|
};
|
|
184
|
-
if (rest.length > 1) return usageError('주제는 하나만 줄 수 있습니다.', usage$
|
|
185
|
-
return run$
|
|
206
|
+
if (rest.length > 1) return usageError('주제는 하나만 줄 수 있습니다.', usage$3);
|
|
207
|
+
return run$3({
|
|
186
208
|
topic: rest[0],
|
|
187
209
|
json: values.json
|
|
188
210
|
});
|
|
189
211
|
}
|
|
190
212
|
case 'skill':
|
|
213
|
+
{
|
|
214
|
+
if (values.help) return {
|
|
215
|
+
exitCode: 0,
|
|
216
|
+
output: usage$2
|
|
217
|
+
};
|
|
218
|
+
if (rest.length !== 1) return usageError('하위 명령을 하나 적어 주세요: install', usage$2);
|
|
219
|
+
return run$2({
|
|
220
|
+
sub: rest[0],
|
|
221
|
+
project: values.project,
|
|
222
|
+
force: values.force,
|
|
223
|
+
json: values.json
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
case 'setup':
|
|
227
|
+
{
|
|
228
|
+
if (values.help) return {
|
|
229
|
+
exitCode: 0,
|
|
230
|
+
output: usage$1
|
|
231
|
+
};
|
|
232
|
+
if (rest.length > 0) return usageError('setup은 인자를 받지 않습니다.', usage$1);
|
|
233
|
+
return run$1({
|
|
234
|
+
target: values.target,
|
|
235
|
+
envName: values.env,
|
|
236
|
+
url: values.url,
|
|
237
|
+
dryRun: values['dry-run'],
|
|
238
|
+
force: values.force,
|
|
239
|
+
json: values.json
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
case 'mcp':
|
|
191
243
|
{
|
|
192
244
|
if (values.help) return {
|
|
193
245
|
exitCode: 0,
|
|
194
246
|
output: usage
|
|
195
247
|
};
|
|
196
|
-
if (rest.length !== 1) return usageError('하위 명령을 하나 적어 주세요:
|
|
248
|
+
if (rest.length !== 1) return usageError('하위 명령을 하나 적어 주세요: setup', usage);
|
|
197
249
|
return run({
|
|
198
250
|
sub: rest[0],
|
|
199
|
-
|
|
251
|
+
target: values.target,
|
|
252
|
+
envName: values.env,
|
|
253
|
+
url: values.url,
|
|
254
|
+
dryRun: values['dry-run'],
|
|
200
255
|
force: values.force,
|
|
201
256
|
json: values.json
|
|
202
257
|
});
|
|
@@ -3,7 +3,7 @@ import { type SandboxReport } from '../../core/sandbox.js';
|
|
|
3
3
|
import { type CheckResult } from '../../rules/index.js';
|
|
4
4
|
import type { Excluded } from '../../core/collect.js';
|
|
5
5
|
import type { CommandResult } from '../../types.js';
|
|
6
|
-
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk build [\uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354] [--json]\n\n elice.config.json\uC758 root(\uAE30\uBCF8 .)\uB97C \uBAA8\uC544 \uC815\uB2F5\u00B7\uBE44\uBC00\u00B7\uD504\uB85C\uC81D\uD2B8 \uD30C\uC77C\uC744 \uBE7C\uACE0,\n screens \uC124\uC815\uC73C\uB85C metadata.json\uC744 \uB9CC\uB4E0 \uB4A4, \uAC80\uC0AC\uB97C \uD1B5\uACFC\uD558\uBA74 <outDir>/content.zip\uC744 \uB9CC\uB4E0\uB2E4\n (outDir \uAE30\uBCF8 dist). \
|
|
6
|
+
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk build [\uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354] [--json]\n\n elice.config.json\uC758 root(\uAE30\uBCF8 .)\uB97C \uBAA8\uC544 \uC815\uB2F5\u00B7\uBE44\uBC00\u00B7\uD504\uB85C\uC81D\uD2B8 \uD30C\uC77C\uC744 \uBE7C\uACE0,\n screens \uC124\uC815\uC73C\uB85C metadata.json\uC744 \uB9CC\uB4E0 \uB4A4, \uAC80\uC0AC\uB97C \uD1B5\uACFC\uD558\uBA74 <outDir>/content.zip\uC744 \uB9CC\uB4E0\uB2E4\n (outDir \uAE30\uBCF8 dist). \uCC44\uC810 \uBC29\uC2DD \u00B7 \uC815\uB2F5(grading.json)\uC740 \uB123\uC9C0 \uC54A\uB294\uB2E4 (\uC6B4\uC601\uC740 \uD3B8\uC9D1 \uD654\uBA74\uC774 \uC815\uD568), \uB85C\uCEEC \uC644\uB8CC \uC815\uCC45(.ecdk/completion.json)\uB3C4 \uBE60\uC9C4\uB2E4.\n \uC6D0\uBCF8 \uCD5C\uC0C1\uC704 commentary.txt(\uD559\uC2B5 \uCC38\uACE0 \uB0B4\uC6A9)\uAC00 \uC788\uC73C\uBA74 zip\uC5D0 \uB123\uACE0 metadata.json commentary\uC5D0 \uC801\uB294\uB2E4.\n \uC124\uC815\uC5D0 \"minify\": true\uBA74 JS \u00B7 CSS \u00B7 JSON\uC744 \uC904\uC5EC\uC11C \uB123\uB294\uB2E4 (\uAC80\uC0AC\uB294 \uC904\uC774\uAE30 \uC804 \uC6D0\uBCF8\uC73C\uB85C),\n \"sourcemap\": true\uBA74 \uC904\uC778 \uD30C\uC77C\uC758 .map\uB3C4 \uB123\uB294\uB2E4. metadata.json build\uC5D0 \uBC84\uC804\uACFC \uB0B4\uC6A9 \uC9C0\uBB38(digest)\uC744 \uC801\uB294\uB2E4.\n LXP\uB294 \uC790\uB8CC\uB97C sandbox(origin null)\uC5D0\uC11C \uC5F4\uC5B4 \uBAA8\uB4C8 \uC2A4\uD06C\uB9BD\uD2B8 \uD30C\uC77C \u00B7 fetch\uAC00 \uB9C9\uD788\uBBC0\uB85C,\n HTML\uC758 <script type=\"module\" src>\uB97C \uBB36\uC5B4 HTML \uC548\uC5D0 \uB123\uACE0 zip \uC548 JSON\uB3C4 \uD398\uC774\uC9C0\uC5D0 \uB123\uB294\uB2E4.\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uC131\uACF5 \u00B7 1 \uAC80\uC0AC \uC624\uB958 (zip \uB9CC\uB4E4\uC9C0 \uC54A\uC74C) \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
|
|
7
7
|
export interface BuildResult {
|
|
8
8
|
ok: boolean;
|
|
9
9
|
engine: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { rm, mkdir, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { join, dirname, relative } from 'node:path';
|
|
3
|
-
import { loadConfig } from '../../core/config.js';
|
|
3
|
+
import { loadConfig, loadGradingFile, legacyGradingTypesWarning, CONFIG_FILE } from '../../core/config.js';
|
|
4
4
|
import { contentDigest } from '../../core/manifest.js';
|
|
5
5
|
import { minifyFiles } from '../../core/minify.js';
|
|
6
6
|
import { prepareContent } from '../../core/prepare.js';
|
|
7
|
+
import { projectCheckOptions } from '../../core/project-check.js';
|
|
7
8
|
import { inlineModuleScripts } from '../../core/sandbox.js';
|
|
8
9
|
import { createZip } from '../../core/zip.js';
|
|
9
10
|
import { checkFiles } from '../../rules/check.js';
|
|
@@ -16,7 +17,7 @@ const usage = `사용법: ecdk build [프로젝트 폴더] [--json]
|
|
|
16
17
|
|
|
17
18
|
elice.config.json의 root(기본 .)를 모아 정답·비밀·프로젝트 파일을 빼고,
|
|
18
19
|
screens 설정으로 metadata.json을 만든 뒤, 검사를 통과하면 <outDir>/content.zip을 만든다
|
|
19
|
-
(outDir 기본 dist).
|
|
20
|
+
(outDir 기본 dist). 채점 방식 · 정답(grading.json)은 넣지 않는다 (운영은 편집 화면이 정함), 로컬 완료 정책(.ecdk/completion.json)도 빠진다.
|
|
20
21
|
원본 최상위 commentary.txt(학습 참고 내용)가 있으면 zip에 넣고 metadata.json commentary에 적는다.
|
|
21
22
|
설정에 "minify": true면 JS · CSS · JSON을 줄여서 넣는다 (검사는 줄이기 전 원본으로),
|
|
22
23
|
"sourcemap": true면 줄인 파일의 .map도 넣는다. metadata.json build에 버전과 내용 지문(digest)을 적는다.
|
|
@@ -50,11 +51,12 @@ async function build(projectDir) {
|
|
|
50
51
|
digest
|
|
51
52
|
});
|
|
52
53
|
const zip = createZip(files);
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
// 프로젝트 검사: grading.json(로컬 채점 설정, zip에는 없음)도 완료 정책과 맞춰 본다. 형식이 틀리면 사용 오류
|
|
55
|
+
const grading = config.kind === 'description' ? undefined : await loadGradingFile(projectDir);
|
|
56
|
+
const check = checkFiles(sources, projectCheckOptions(config, {
|
|
55
57
|
zipBytes: zip.byteLength,
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
+
grading
|
|
59
|
+
}));
|
|
58
60
|
// .map을 더했으면 파일 수 한도는 실제 zip으로 다시 본다
|
|
59
61
|
const realCount = files.filter(f => !f.path.endsWith('/')).length;
|
|
60
62
|
if (realCount > rules.limits.maxFiles && !check.issues.some(i => i.id === 'limit.file-count')) {
|
|
@@ -65,6 +67,14 @@ async function build(projectDir) {
|
|
|
65
67
|
});
|
|
66
68
|
check.ok = false;
|
|
67
69
|
}
|
|
70
|
+
// 옛 elice.config.json gradingTypes: 옮기지 않고 지워 달라고만 알린다 (ADR 0008 · 0009)
|
|
71
|
+
const legacy = legacyGradingTypesWarning(config);
|
|
72
|
+
if (legacy) check.issues.push({
|
|
73
|
+
id: 'manifest.grading-types',
|
|
74
|
+
level: 'warn',
|
|
75
|
+
message: legacy,
|
|
76
|
+
path: CONFIG_FILE
|
|
77
|
+
});
|
|
68
78
|
// 산출물은 <outDir>/content/ 와 <outDir>/content.zip만 건드린다
|
|
69
79
|
const contentDir = join(outDir, 'content');
|
|
70
80
|
const zipPath = join(outDir, 'content.zip');
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { CheckResult } from '../../rules/index.js';
|
|
2
2
|
import type { CommandResult } from '../../types.js';
|
|
3
|
-
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk check [\uACBD\uB85C] [--json]\n\n \uACBD\uB85C \uD3F4\uB354, .zip, .html (\uAE30\uBCF8\uAC12: \uD604\uC7AC \uD3F4\uB354)\n --json \uAE30\uACC4\uC6A9 \uCD9C\uB825 (Claude \uC2A4\uD0AC\u00B7CI)\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uD1B5\uACFC \u00B7 1 \uC624\uB958 \uC788\uC74C \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
|
|
3
|
+
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk check [\uACBD\uB85C] [--json]\n\n \uACBD\uB85C \uD3F4\uB354, .zip, .html (\uAE30\uBCF8\uAC12: \uD604\uC7AC \uD3F4\uB354)\n ecdk \uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354(elice.config.json\uC774 \uC788\uC74C)\uB294 ecdk build\uAC00 \uB9CC\uB4E4 zip \uAE30\uC900\uC73C\uB85C \uAC80\uC0AC\uD55C\uB2E4\n (\uC815\uB2F5 \u00B7 \uC124\uC815 \u00B7 \uAC1C\uBC1C\uC6A9 \uD30C\uC77C\uC744 \uBE7C\uACE0 metadata.json\uC744 \uB9CC\uB4E0 \uB4A4). \uADF8 \uBC16\uC758 \uD3F4\uB354\uB294 \uADF8\uB300\uB85C \uC62C\uB9B4 zip\uC73C\uB85C \uBCF8\uB2E4\n --json \uAE30\uACC4\uC6A9 \uCD9C\uB825 (Claude \uC2A4\uD0AC\u00B7CI)\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uD1B5\uACFC \u00B7 1 \uC624\uB958 \uC788\uC74C \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
|
|
4
|
+
/** 검사 방식: project = build가 만들 zip 기준, path = 주어진 폴더 · zip · html을 그대로 */
|
|
5
|
+
export type CheckMode = 'project' | 'path';
|
|
6
|
+
/** ecdk 프로젝트 폴더인지: elice.config.json이 있거나 package.json이 @eliceio/cdk-cli를 쓴다 */
|
|
7
|
+
export declare function isProjectDir(dir: string): Promise<boolean>;
|
|
8
|
+
/** build와 같은 준비(제외 · metadata.json)를 거친 파일로 검사한다. 모듈 묶기는 build가 하므로 module-src는 보지 않는다 */
|
|
9
|
+
export declare function checkProject(dir: string): Promise<CheckResult>;
|
|
4
10
|
export declare function formatIssues(r: CheckResult): string[];
|
|
5
|
-
export declare function formatText(target: string, r: CheckResult): string;
|
|
11
|
+
export declare function formatText(target: string, r: CheckResult, mode?: CheckMode): string;
|
|
6
12
|
export declare function run(args: {
|
|
7
13
|
target: string;
|
|
8
14
|
json: boolean;
|
|
@@ -1,19 +1,55 @@
|
|
|
1
|
+
import { stat, readFile, access } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { CONFIG_FILE, loadConfig, loadGradingFile } from '../../core/config.js';
|
|
4
|
+
import { prepareContent } from '../../core/prepare.js';
|
|
5
|
+
import { projectCheckOptions } from '../../core/project-check.js';
|
|
6
|
+
import { createZip } from '../../core/zip.js';
|
|
7
|
+
import { checkFiles } from '../../rules/check.js';
|
|
8
|
+
import '../../rules/spec.js';
|
|
9
|
+
import 'fflate';
|
|
1
10
|
import { checkPath } from '../../rules/node.js';
|
|
2
11
|
|
|
3
12
|
const usage = `사용법: ecdk check [경로] [--json]
|
|
4
13
|
|
|
5
14
|
경로 폴더, .zip, .html (기본값: 현재 폴더)
|
|
15
|
+
ecdk 프로젝트 폴더(elice.config.json이 있음)는 ecdk build가 만들 zip 기준으로 검사한다
|
|
16
|
+
(정답 · 설정 · 개발용 파일을 빼고 metadata.json을 만든 뒤). 그 밖의 폴더는 그대로 올릴 zip으로 본다
|
|
6
17
|
--json 기계용 출력 (Claude 스킬·CI)
|
|
7
18
|
|
|
8
19
|
종료 코드: 0 통과 · 1 오류 있음 · 2 잘못된 사용`;
|
|
20
|
+
const exists = p => access(p).then(() => true, () => false);
|
|
21
|
+
/** ecdk 프로젝트 폴더인지: elice.config.json이 있거나 package.json이 @eliceio/cdk-cli를 쓴다 */
|
|
22
|
+
async function isProjectDir(dir) {
|
|
23
|
+
if (!(await stat(dir)).isDirectory()) return false;
|
|
24
|
+
if (await exists(join(dir, CONFIG_FILE))) return true;
|
|
25
|
+
try {
|
|
26
|
+
const pkg = JSON.parse(await readFile(join(dir, 'package.json'), 'utf8'));
|
|
27
|
+
return ['dependencies', 'devDependencies'].some(k => pkg[k]?.['@eliceio/cdk-cli'] !== undefined);
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** build와 같은 준비(제외 · metadata.json)를 거친 파일로 검사한다. 모듈 묶기는 build가 하므로 module-src는 보지 않는다 */
|
|
33
|
+
async function checkProject(dir) {
|
|
34
|
+
const config = await loadConfig(dir);
|
|
35
|
+
const {
|
|
36
|
+
files
|
|
37
|
+
} = await prepareContent(dir, config);
|
|
38
|
+
const grading = config.kind === 'description' ? undefined : await loadGradingFile(dir);
|
|
39
|
+
return checkFiles(files, projectCheckOptions(config, {
|
|
40
|
+
zipBytes: createZip(files).byteLength,
|
|
41
|
+
grading
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
9
44
|
function formatIssues(r) {
|
|
10
45
|
return r.issues.map(i => {
|
|
11
46
|
const at = i.path ? ` ${i.path}${i.line ? `:${i.line}` : ''}` : '';
|
|
12
47
|
return `[${i.level}] ${i.id}${at}\n ${i.message}`;
|
|
13
48
|
});
|
|
14
49
|
}
|
|
15
|
-
function formatText(target, r) {
|
|
16
|
-
const lines =
|
|
50
|
+
function formatText(target, r, mode = 'path') {
|
|
51
|
+
const lines = mode === 'project' ? ['프로젝트로 검사: ecdk build가 만들 zip 기준', ''] : [];
|
|
52
|
+
lines.push(...formatIssues(r));
|
|
17
53
|
const errors = r.issues.filter(i => i.level === 'error').length;
|
|
18
54
|
const warns = r.issues.length - errors;
|
|
19
55
|
const size = r.stats.zipBytes < 1024 * 1024 ? `${(r.stats.zipBytes / 1024).toFixed(1)}KB` : `${(r.stats.zipBytes / 1024 / 1024).toFixed(1)}MB`;
|
|
@@ -21,11 +57,15 @@ function formatText(target, r) {
|
|
|
21
57
|
return lines.join('\n');
|
|
22
58
|
}
|
|
23
59
|
async function run(args) {
|
|
24
|
-
const
|
|
60
|
+
const mode = (await isProjectDir(args.target)) ? 'project' : 'path';
|
|
61
|
+
const result = mode === 'project' ? await checkProject(args.target) : await checkPath(args.target);
|
|
25
62
|
return {
|
|
26
63
|
exitCode: result.ok ? 0 : 1,
|
|
27
|
-
output: args.json ? JSON.stringify(
|
|
64
|
+
output: args.json ? JSON.stringify({
|
|
65
|
+
mode,
|
|
66
|
+
...result
|
|
67
|
+
}, null, 2) : formatText(args.target, result, mode)
|
|
28
68
|
};
|
|
29
69
|
}
|
|
30
70
|
|
|
31
|
-
export { formatIssues, formatText, run, usage };
|
|
71
|
+
export { checkProject, formatIssues, formatText, isProjectDir, run, usage };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CommandResult } from '../../types.js';
|
|
2
2
|
export declare const usage: string;
|
|
3
|
+
/** ecdk create --list: 템플릿 이름 · 버전 · 설명 · 화면 · 완료 정책 */
|
|
4
|
+
export declare function list(json: boolean): CommandResult;
|
|
3
5
|
export declare function run(args: {
|
|
4
6
|
target: string;
|
|
5
7
|
template: string;
|
|
@@ -1,22 +1,47 @@
|
|
|
1
|
+
import { listTemplates } from '../../core/templates.js';
|
|
1
2
|
import { TEMPLATES, THEMES, createProject } from './scaffold.js';
|
|
2
3
|
|
|
3
4
|
const usage = `사용법: ecdk create <폴더> [--template ${TEMPLATES.join('|')}] [--theme ${THEMES.join('|')}] [--json]
|
|
5
|
+
ecdk create --list [--json]
|
|
4
6
|
|
|
5
7
|
학생 화면 · 교육자 화면 · 내용 편집(CMS) 화면과 SDK 연결 로직(lib/)이 든 프로젝트를 만든다.
|
|
6
|
-
quiz:
|
|
8
|
+
quiz: 여러 문항 퀴즈(선택 · 순서 · 주관식 · 그룹 분류, 편집 화면 포함, 기본)
|
|
9
|
+
blank: 퀴즈가 아닌 모든 자료(시뮬레이션 · 시각화 · 활동 · 설명 · 플래시카드 · 설문)를 직접 만들 때. 화면 3개 골격
|
|
10
|
+
--list: 템플릿 목록과 버전 · 설명 (템플릿마다 버전이 따로 있음)
|
|
7
11
|
--theme dark: Elice Design System 어두운 화면 (기본 light)
|
|
8
12
|
|
|
9
13
|
종료 코드: 0 성공 · 2 잘못된 사용 (비어 있지 않은 폴더 포함)`;
|
|
14
|
+
/** ecdk create --list: 템플릿 이름 · 버전 · 설명 · 화면 · 완료 정책 */
|
|
15
|
+
function list(json) {
|
|
16
|
+
const templates = listTemplates();
|
|
17
|
+
if (json) return {
|
|
18
|
+
exitCode: 0,
|
|
19
|
+
output: JSON.stringify({
|
|
20
|
+
templates
|
|
21
|
+
}, null, 2)
|
|
22
|
+
};
|
|
23
|
+
const lines = templates.map(t => {
|
|
24
|
+
const p = t.completionPolicies ?? [];
|
|
25
|
+
const completion = p.length === 0 ? '-' : p.length === 1 ? `${p[0]} 고정` : `${p.join(' · ')} (기본 ${p[0]}, 완료 정책 화면에서 고름)`;
|
|
26
|
+
return `${t.name}@${t.version} ${t.title}\n ${t.description}\n 화면: ${t.screens.join(' · ')} · 완료 정책: ${completion}`;
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
exitCode: 0,
|
|
30
|
+
output: `${lines.join('\n\n')}\n\n만들기: ecdk create <폴더> --template <이름>`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
10
33
|
async function run(args) {
|
|
11
34
|
const r = await createProject({
|
|
12
35
|
dir: args.target,
|
|
13
36
|
template: args.template,
|
|
14
37
|
theme: args.theme
|
|
15
38
|
});
|
|
39
|
+
// 고칠 화면 코드: 템플릿에 있는 screens/*.js (blank는 완료 정책 화면 screens/completion.js까지)
|
|
40
|
+
const screens = ['learn', 'instructor', 'edit', 'completion'].map(s => `screens/${s}.js`).filter(f => r.files.includes(f));
|
|
16
41
|
return {
|
|
17
42
|
exitCode: 0,
|
|
18
|
-
output: args.json ? JSON.stringify(r, null, 2) : `[ok] ${r.dir} (${r.template} 템플릿${r.theme === 'dark' ? ' · 어두운 테마' : ''}, 파일 ${r.files.length}개)\n\n고칠 파일: screens
|
|
43
|
+
output: args.json ? JSON.stringify(r, null, 2) : `[ok] ${r.dir} (${r.template}@${r.version} 템플릿${r.theme === 'dark' ? ' · 어두운 테마' : ''}, 파일 ${r.files.length}개)\n\n고칠 파일: ${[...screens, 'content.json', 'styles.css'].join(' · ')}\n\n cd ${args.target}\n ecdk doctor\n ecdk build`
|
|
19
44
|
};
|
|
20
45
|
}
|
|
21
46
|
|
|
22
|
-
export { run, usage };
|
|
47
|
+
export { list, run, usage };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readdir, mkdir, cp, rename, readFile, writeFile } from 'node:fs/promises';
|
|
1
|
+
import { readdir, mkdir, cp, rm, rename, readFile, writeFile } from 'node:fs/promises';
|
|
3
2
|
import { resolve, join, basename } from 'node:path';
|
|
4
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { listTemplates } from '../../core/templates.js';
|
|
5
5
|
|
|
6
6
|
const TEMPLATES = ['quiz', 'blank'];
|
|
7
7
|
/** 화면 테마. dark는 화면 HTML에 data-eds-theme="dark"를 붙여 EDS 어두운 팔레트를 쓴다 */
|
|
8
8
|
const THEMES = ['light', 'dark'];
|
|
9
9
|
/** 패키지 루트의 templates/ (es/commands/create/와 src/commands/create/ 모두 세 단계 위) */
|
|
10
10
|
const TEMPLATE_ROOT = fileURLToPath(new URL('../../../templates', import.meta.url));
|
|
11
|
-
/** 템플릿을 묶어 배포하는 @eliceio/cdk-cli 버전 (패키지 루트의 package.json) */
|
|
12
|
-
const PACKAGE_VERSION = JSON.parse(readFileSync(fileURLToPath(new URL('../../../package.json', import.meta.url)), 'utf8')).version;
|
|
13
11
|
async function listFiles(dir, base = '') {
|
|
14
12
|
const out = [];
|
|
15
13
|
for (const e of await readdir(join(dir, base), {
|
|
@@ -43,6 +41,10 @@ async function createProject(options) {
|
|
|
43
41
|
await cp(join(TEMPLATE_ROOT, options.template), dir, {
|
|
44
42
|
recursive: true
|
|
45
43
|
});
|
|
44
|
+
// template.json은 CLI가 템플릿을 고를 때만 쓴다 (프로젝트 · zip에는 넣지 않음)
|
|
45
|
+
await rm(join(dir, 'template.json'), {
|
|
46
|
+
force: true
|
|
47
|
+
});
|
|
46
48
|
// npm은 패키지 안의 .gitignore를 빼고 배포하므로 이름을 바꿔 두었다가 되돌린다
|
|
47
49
|
await rename(join(dir, 'gitignore'), join(dir, '.gitignore'));
|
|
48
50
|
if (theme === 'dark') {
|
|
@@ -53,11 +55,12 @@ async function createProject(options) {
|
|
|
53
55
|
await writeFile(path, html.replace(/<html(?![^>]*data-eds-theme)/, '<html data-eds-theme="dark"'));
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
// 어떤 템플릿 · 버전으로 만들었는지 (build가 metadata.json build.template에 적음)
|
|
58
|
+
// 어떤 템플릿 · 버전으로 만들었는지 (템플릿마다 따로 올리는 template.json version. build가 metadata.json build.template에 적음)
|
|
59
|
+
const version = listTemplates().find(t => t.name === options.template)?.version ?? '0.0.0';
|
|
57
60
|
const configPath = join(dir, 'elice.config.json');
|
|
58
61
|
const config = JSON.parse(await readFile(configPath, 'utf8'));
|
|
59
62
|
await writeFile(configPath, `${JSON.stringify({
|
|
60
|
-
template: `${options.template}@${
|
|
63
|
+
template: `${options.template}@${version}`,
|
|
61
64
|
...config
|
|
62
65
|
}, null, 2)}\n`);
|
|
63
66
|
const name = options.name ?? basename(dir);
|
|
@@ -74,6 +77,7 @@ async function createProject(options) {
|
|
|
74
77
|
return {
|
|
75
78
|
dir,
|
|
76
79
|
template: options.template,
|
|
80
|
+
version,
|
|
77
81
|
theme,
|
|
78
82
|
files: await listFiles(dir)
|
|
79
83
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandResult } from '../../types.js';
|
|
2
|
-
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk dev [\uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354] [--port 4170]\n\n \uB85C\uCEEC\uC5D0\uC11C \uC6B4\uC601\uACFC \uAC19\uC740 \uC870\uAC74\uC73C\uB85C \uCF58\uD150\uCE20\uB97C \uB744\uC6B4\uB2E4.\n - http://localhost:<port> LXP \uD749\uB0B4 \uD654\uBA74: \uD559\uC0DD \u00B7 \uD29C\uD130\uB9C1 \u00B7 \uAD50\uC721\uC790 \uD654\uBA74 \u00B7 \uB0B4\uC6A9 \uD3B8\uC9D1\n - \uCF58\uD150\uCE20\uB294 \uB2E4\uB978 \uCD9C\uCC98(127.0.0.1:<port+1>)\uC5D0\uC11C \uC6B4\uC601 \uD5E4\uB354(CSP sandbox allow-scripts)\uB85C\n - \uC2E4\uC81C @eliceio/cdk\uAC00 elice-material \uD749\uB0B4 API\uC640 \uD1B5\uC2E0
|
|
2
|
+
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk dev [\uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354] [--port 4170]\n\n \uB85C\uCEEC\uC5D0\uC11C \uC6B4\uC601\uACFC \uAC19\uC740 \uC870\uAC74\uC73C\uB85C \uCF58\uD150\uCE20\uB97C \uB744\uC6B4\uB2E4.\n - http://localhost:<port> LXP \uD749\uB0B4 \uD654\uBA74: \uD559\uC0DD \u00B7 \uD29C\uD130\uB9C1 \u00B7 \uAD50\uC721\uC790 \uD654\uBA74 \u00B7 \uB0B4\uC6A9 \uD3B8\uC9D1 \u00B7 \uC644\uB8CC \uC815\uCC45\n - \uCF58\uD150\uCE20\uB294 \uB2E4\uB978 \uCD9C\uCC98(127.0.0.1:<port+1>)\uC5D0\uC11C \uC6B4\uC601 \uD5E4\uB354(CSP sandbox allow-scripts)\uB85C\n - \uD3EC\uD2B8\uB97C \uB450 \uAC1C(N \u00B7 N+1) \uC4F4\uB2E4. --port \uC5C6\uC774 \uC5F4 \uB54C 4170 \u00B7 4171\uC774 \uC4F0\uC774\uACE0 \uC788\uC73C\uBA74 \uB2E4\uC74C \uC30D(4172 \u00B7 4173 \u2026)\uC744 \uC4F4\uB2E4\n - \uC2E4\uC81C @eliceio/cdk\uAC00 elice-material \uD749\uB0B4 API\uC640 \uD1B5\uC2E0. \uCC44\uC810 \uC124\uC815\uC740 grading.json(\uCC44\uC810 \uBC29\uC2DD type \u00B7 \uB2F5),\n \uC644\uB8CC \uC815\uCC45\uC740 elice.config.json completionPolicies \uCCAB \uAC12 (\uC644\uB8CC \uC815\uCC45 \uBCF4\uAE30\uC5D0\uC11C \uACE0\uB974\uBA74 .ecdk/completion.json).\n \uB0B4\uC6A9 \uD3B8\uC9D1\uC5D0\uC11C \uC800\uC7A5\uD558\uBA74 grading.json, \uC644\uB8CC \uC815\uCC45 \uBCF4\uAE30(screens.completionPolicy\uB97C \uCF20 \uC790\uB8CC\uB9CC)\uC5D0\uC11C \uC800\uC7A5\uD558\uBA74\n .ecdk/completion.json\uC5D0 \uC4F4\uB2E4 (\uC6B4\uC601\uC740 SDK saveCompletionPolicy \u2192 \uC11C\uBC84 completion_policy)\n - \uD30C\uC77C\uC744 \uACE0\uCE58\uBA74 \uB2E4\uC2DC \uAC80\uC0AC\uD558\uACE0 \uD654\uBA74\uC744 \uC0C8\uB85C \uB744\uC6C0, \uCF58\uD150\uCE20\uC758 \uCF58\uC194 \uC624\uB958\uC640 404\uB97C \uC5EC\uAE30\uC5D0 \uD45C\uC2DC\n\n\uB05D\uB0B4\uAE30: Ctrl+C";
|
|
3
3
|
export declare function run(args: {
|
|
4
4
|
target: string;
|
|
5
5
|
port?: string;
|
package/es/commands/dev/index.js
CHANGED
|
@@ -3,9 +3,13 @@ import { startDevServer } from '../../dev/server.js';
|
|
|
3
3
|
const usage = `사용법: ecdk dev [프로젝트 폴더] [--port 4170]
|
|
4
4
|
|
|
5
5
|
로컬에서 운영과 같은 조건으로 콘텐츠를 띄운다.
|
|
6
|
-
- http://localhost:<port> LXP 흉내 화면: 학생 · 튜터링 · 교육자 화면 · 내용 편집
|
|
6
|
+
- http://localhost:<port> LXP 흉내 화면: 학생 · 튜터링 · 교육자 화면 · 내용 편집 · 완료 정책
|
|
7
7
|
- 콘텐츠는 다른 출처(127.0.0.1:<port+1>)에서 운영 헤더(CSP sandbox allow-scripts)로
|
|
8
|
-
-
|
|
8
|
+
- 포트를 두 개(N · N+1) 쓴다. --port 없이 열 때 4170 · 4171이 쓰이고 있으면 다음 쌍(4172 · 4173 …)을 쓴다
|
|
9
|
+
- 실제 @eliceio/cdk가 elice-material 흉내 API와 통신. 채점 설정은 grading.json(채점 방식 type · 답),
|
|
10
|
+
완료 정책은 elice.config.json completionPolicies 첫 값 (완료 정책 보기에서 고르면 .ecdk/completion.json).
|
|
11
|
+
내용 편집에서 저장하면 grading.json, 완료 정책 보기(screens.completionPolicy를 켠 자료만)에서 저장하면
|
|
12
|
+
.ecdk/completion.json에 쓴다 (운영은 SDK saveCompletionPolicy → 서버 completion_policy)
|
|
9
13
|
- 파일을 고치면 다시 검사하고 화면을 새로 띄움, 콘텐츠의 콘솔 오류와 404를 여기에 표시
|
|
10
14
|
|
|
11
15
|
끝내기: Ctrl+C`;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ContentConfig } from '../../core/config.js';
|
|
2
|
+
import { type McpEnv } from '../mcp/index.js';
|
|
1
3
|
import type { CommandResult } from '../../types.js';
|
|
2
4
|
export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk doctor [\uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354] [--fix] [--json]\n\n \uD658\uACBD(Node, \uD328\uD0A4\uC9C0 \uB9E4\uB2C8\uC800)\uACFC \uD504\uB85C\uC81D\uD2B8(\uC124\uC815, \uC6D0\uBCF8, \uC815\uB2F5 \uC720\uCD9C, \uAC80\uC0AC)\uB97C \uC810\uAC80\uD55C\uB2E4.\n --fix \uC790\uB3D9\uC73C\uB85C \uACE0\uCE60 \uC218 \uC788\uB294 \uD56D\uBAA9(auto)\uC744 \uACE0\uCE5C\uB2E4\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uC2E4\uD328 \uC5C6\uC74C \u00B7 1 \uC2E4\uD328 \uC788\uC74C \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
|
|
3
5
|
export type DoctorLevel = 'ok' | 'warn' | 'fail' | 'skip';
|
|
@@ -19,10 +21,19 @@ export interface DoctorResult {
|
|
|
19
21
|
checks: DoctorCheck[];
|
|
20
22
|
}
|
|
21
23
|
export declare function checkNode(version: string): DoctorCheck;
|
|
24
|
+
/** Claude Code 스킬: 프로젝트(.claude/skills) 또는 홈(~/.claude/skills)에 모두 있고 CLI와 같은 버전인지 */
|
|
25
|
+
export declare function checkSkills(dir: string, home?: string): DoctorCheck;
|
|
26
|
+
/** 프로젝트를 만든 템플릿 · 버전 (elice.config.json template). 이 CLI에 더 새 버전이 있으면 알리기만 한다 (자동 갱신 없음) */
|
|
27
|
+
export declare function checkTemplate(config: ContentConfig): DoctorCheck;
|
|
28
|
+
/** dir부터 위로 올라가며 <폴더>/.claude/skills 목록. 홈 폴더나 파일 시스템 루트에서 멈춘다 (홈은 사용자 위치라 따로) */
|
|
29
|
+
export declare function projectSkillDirs(dir: string, home?: string): string[];
|
|
30
|
+
/** 학습자료 서버 MCP(elice-material)가 찾은 도구 중 하나에라도 등록돼 있는지 (읽기만) */
|
|
31
|
+
export declare function checkMcp(env: McpEnv): DoctorCheck;
|
|
22
32
|
export declare function doctor(target: string, opts: {
|
|
23
33
|
fix: boolean;
|
|
24
34
|
nodeVersion?: string;
|
|
25
35
|
home?: string | undefined;
|
|
36
|
+
mcp?: McpEnv | undefined;
|
|
26
37
|
}): Promise<DoctorResult>;
|
|
27
38
|
export declare function formatText(r: DoctorResult): string;
|
|
28
39
|
export declare function run(args: {
|