@eliceio/cdk-cli 0.1.0-alpha.4 → 0.1.0-alpha.5
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 +182 -146
- package/es/cli.js +65 -66
- package/es/commands/build/index.js +17 -4
- package/es/commands/create/index.d.ts +1 -1
- package/es/commands/create/index.js +5 -9
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +4 -4
- package/es/commands/doctor/index.d.ts +18 -1
- package/es/commands/doctor/index.js +136 -26
- package/es/commands/mcp/index.d.ts +0 -12
- package/es/commands/mcp/index.js +6 -57
- package/es/commands/setup/index.d.ts +11 -3
- package/es/commands/setup/index.js +112 -37
- package/es/commands/skill/index.d.ts +46 -8
- package/es/commands/skill/index.js +151 -35
- package/es/commands/uninstall/index.d.ts +54 -0
- package/es/commands/uninstall/index.js +304 -0
- package/es/commands/update/index.d.ts +59 -0
- package/es/commands/update/index.js +251 -0
- package/es/commands/{check → validate}/index.d.ts +1 -1
- package/es/commands/{check → validate}/index.js +1 -1
- package/es/core/config.d.ts +20 -37
- package/es/core/config.js +36 -89
- package/es/core/latest.d.ts +21 -0
- package/es/core/latest.js +43 -0
- package/es/core/prepare.js +3 -2
- package/es/core/project-check.d.ts +2 -2
- package/es/core/project-check.js +2 -2
- package/es/core/templates.d.ts +1 -3
- package/es/core/templates.js +1 -4
- package/es/dev/grading.d.ts +7 -8
- package/es/dev/grading.js +6 -16
- package/es/dev/host-page.d.ts +1 -1
- package/es/dev/host-page.js +11 -9
- package/es/dev/mock-api.d.ts +8 -12
- package/es/dev/mock-api.js +50 -65
- package/es/dev/server.js +7 -26
- package/es/rules/check.js +11 -35
- package/es/rules/index.d.ts +1 -1
- package/es/rules/index.js +1 -1
- package/es/rules/manifest.d.ts +28 -20
- package/es/rules/manifest.js +58 -55
- package/es/rules/types.d.ts +1 -13
- package/es/rules.json.js +1 -1
- package/package.json +2 -3
- package/rules.json +12 -43
- package/skills/_shared/always.md +3 -3
- package/skills/elice-content-check/SKILL.md +10 -9
- package/skills/elice-content-create/SKILL.md +7 -7
- package/skills/elice-content-guide/SKILL.md +42 -0
- package/skills/elice-content-guide/topics/00-what-the-person-decides.md +11 -0
- package/skills/elice-content-guide/topics/01-check-the-environment.md +10 -0
- package/skills/elice-content-guide/topics/02-design-the-material.md +35 -0
- package/skills/elice-content-guide/topics/03-create-the-project.md +22 -0
- package/skills/elice-content-guide/topics/04-rules.md +12 -0
- package/skills/elice-content-guide/topics/05-screen-code.md +101 -0
- package/skills/elice-content-guide/topics/06-using-the-quiz-template.md +22 -0
- package/skills/elice-content-guide/topics/07-move-existing-html.md +10 -0
- package/skills/elice-content-guide/topics/08-fix-check-errors.md +24 -0
- package/skills/elice-content-guide/topics/09-check.md +10 -0
- package/skills/elice-content-guide/topics/10-build.md +8 -0
- package/skills/elice-content-guide/topics/11-more.md +4 -0
- package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +41 -0
- package/skills/elice-content-migrate/SKILL.md +8 -7
- package/skills/elice-content-publish/SKILL.md +8 -8
- package/templates/_shared/lib/cdk-mock.d.ts +5 -13
- package/templates/_shared/lib/cdk-mock.js +40 -135
- package/templates/_shared/lib/elice-content.css +60 -1
- package/templates/_shared/lib/elice-content.d.ts +6 -37
- package/templates/_shared/lib/elice-content.js +23 -236
- package/templates/blank/README.md +5 -6
- package/templates/blank/metadata.json +1 -3
- package/templates/blank/package.json +2 -2
- package/templates/blank/screens/edit.js +1 -1
- package/templates/blank/template.json +2 -2
- package/templates/quiz/README.md +3 -3
- package/templates/quiz/core/behaviors.js +4 -1
- package/templates/quiz/core/editor.d.ts +9 -9
- package/templates/quiz/core/editor.js +16 -26
- package/templates/quiz/core/model.js +3 -3
- package/templates/quiz/metadata.json +1 -3
- package/templates/quiz/package.json +2 -2
- package/templates/quiz/screens/edit.js +17 -6
- package/templates/quiz/screens/learn.js +5 -2
- package/templates/quiz/styles.css +23 -27
- package/templates/quiz/template.json +2 -2
- package/templates/quiz/ui/templates/edit.js +29 -15
- package/templates/quiz/ui/templates/group.js +10 -2
- package/templates/quiz/ui/texts.js +4 -6
- package/es/commands/guide/index.d.ts +0 -29
- package/es/commands/guide/index.js +0 -120
- package/guides/content-development.md +0 -302
- package/templates/blank/completion.html +0 -15
- package/templates/blank/screens/completion.js +0 -7
package/es/rules/manifest.js
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 완료 정책 화면의 옛 이름들 (2026-11-12 없앰, ADR 0012). metadata.json screens에 있으면 오류 대신 경고하고 무시한다
|
|
3
|
+
* (completion · grading은 2026-11-11 completionPolicy로 바뀌기 전 이름)
|
|
4
|
+
*/
|
|
5
|
+
const LEGACY_COMPLETION_SCREENS = ['completionPolicy', 'completion', 'grading'];
|
|
6
|
+
/** 완료 정책은 LXP 설정 (ADR 0012): metadata.json에 남은 완료 정책 필드 · 화면 안내 */
|
|
7
|
+
const COMPLETION_POLICIES_IGNORED = '완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고릅니다 (2026-11-12, ADR 0012). metadata.json에서 지워 주세요 (ecdk build는 zip에서 뺍니다)';
|
|
1
8
|
const isRecord = v => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
2
9
|
/**
|
|
3
10
|
* metadata.json에 적는 파일 이름(진입 파일 · 학습 참고 내용): zip 최상위, 영문 · 숫자 · `.` · `_` · `-`만.
|
|
4
11
|
* LXP가 배포 주소 뒤에 그대로 붙여 열므로 공백 · 한글 · `?` · `#` · `%`처럼 URL 인코딩이 필요한 글자는 받지 않는다.
|
|
5
12
|
*/
|
|
13
|
+
/** metadata.json에 남은 옛 완료 정책 필드 (ADR 0012에서 없앰, completion은 2026-11-11 전 이름) */
|
|
14
|
+
const LEGACY_COMPLETION_FIELDS = ['completionPolicies', 'completion'];
|
|
15
|
+
/**
|
|
16
|
+
* build가 zip의 metadata.json에서 빼는 옛 완료 정책 필드 · 화면 (ADR 0012). 작성자 metadata.json(JSON 객체)을 받아
|
|
17
|
+
* 뺀 사본을 돌려준다. 뺄 것이 없으면 같은 객체
|
|
18
|
+
*/
|
|
19
|
+
function stripCompletionPolicy(raw) {
|
|
20
|
+
const out = {
|
|
21
|
+
...raw
|
|
22
|
+
};
|
|
23
|
+
let changed = false;
|
|
24
|
+
for (const key of LEGACY_COMPLETION_FIELDS) if (key in out) {
|
|
25
|
+
delete out[key];
|
|
26
|
+
changed = true;
|
|
27
|
+
}
|
|
28
|
+
if (isRecord(out.screens)) {
|
|
29
|
+
const screens = {
|
|
30
|
+
...out.screens
|
|
31
|
+
};
|
|
32
|
+
for (const key of LEGACY_COMPLETION_SCREENS) if (key in screens) {
|
|
33
|
+
delete screens[key];
|
|
34
|
+
changed = true;
|
|
35
|
+
}
|
|
36
|
+
out.screens = screens;
|
|
37
|
+
}
|
|
38
|
+
return changed ? out : raw;
|
|
39
|
+
}
|
|
6
40
|
const SAFE_FILE_NAME = /^[A-Za-z0-9._-]+$/;
|
|
7
41
|
const HTML_FILE = /\.html?$/i;
|
|
8
42
|
function fileNameError(name, label) {
|
|
@@ -10,39 +44,12 @@ function fileNameError(name, label) {
|
|
|
10
44
|
if (!SAFE_FILE_NAME.test(name) || name.startsWith('.')) return `${label} 이름은 영문 · 숫자 · . · _ · -만 씁니다 (LXP가 주소에 그대로 붙임): ${name}`;
|
|
11
45
|
return null;
|
|
12
46
|
}
|
|
13
|
-
/**
|
|
14
|
-
* 완료 정책 하나 검사 (metadata `completionPolicies`의 값 · 로컬 `.ecdk/completion.json`, ADR 0009).
|
|
15
|
-
* 문제가 없으면 null. 수동 채점(manual) · 채점 없음(none)은 Custom HTML에서 쓰지 않는다.
|
|
16
|
-
*/
|
|
17
|
-
function completionPolicyError(value, allowed) {
|
|
18
|
-
if (value === 'manual') return `수동 채점(manual)은 Custom HTML 자료에서 쓰지 않습니다. 완료 정책은 ${allowed.join(' · ')} 중에서 고르세요.`;
|
|
19
|
-
if (value === 'none') return '채점 없음(none)은 Custom HTML 자료에서 쓰지 않습니다. 보기만 하는 자료는 on_access, 제출만 받는 자료는 on_submit.';
|
|
20
|
-
if (typeof value !== 'string' || !allowed.includes(value)) return `알 수 없는 완료 정책입니다: ${String(value)} (가능: ${allowed.join(', ')})`;
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
/** 채점 방식 하나 검사 (on_graded일 때 `settings.grading.type`: pattern · rubric). 문제가 없으면 null */
|
|
47
|
+
/** 채점 방식 하나 검사 (`settings.grading.type`: pattern · rubric). 문제가 없으면 null */
|
|
24
48
|
function graderTypeError(value, allowed) {
|
|
25
49
|
if (value === 'code_exec') return `코드 실행 채점(code_exec)은 아직 지원하지 않습니다 (Custom HTML은 브라우저에서 돌고 서버 실행 환경이 정해지지 않음). ${allowed.join(' · ')} 중에서 고르세요.`;
|
|
26
50
|
if (typeof value !== 'string' || !allowed.includes(value)) return value === 'regex' || value === 'ai_rubric' ? `채점 방식 이름은 grading.type과 같은 ${allowed.join(' · ')}입니다 (${value} → ${value === 'regex' ? 'pattern' : 'rubric'}, 2026-11-11).` : `알 수 없는 채점 방식입니다: ${String(value)} (가능: ${allowed.join(', ')})`;
|
|
27
51
|
return null;
|
|
28
52
|
}
|
|
29
|
-
/** completionPolicies 예시 (오류 문구에 같이 보인다) */
|
|
30
|
-
const COMPLETION_POLICIES_EXAMPLE = '예: "completionPolicies": ["on_submit"] · 고를 수 있게 ["on_submit", "on_access"] · 채점하는 퀴즈 ["on_graded"]';
|
|
31
|
-
/**
|
|
32
|
-
* `completionPolicies` 검사 (metadata.json · 옛 elice.config.json, ADR 0009 2026-11-11 결정 2): 알려진 완료 정책의 배열,
|
|
33
|
-
* 같은 값 두 번 없음. 문제가 있으면 문장, 없으면 배열. 빈 배열은 여기서 통과시키고 검사 규칙
|
|
34
|
-
* manifest.completion-policies-missing이 알린다 (없는 것과 같은 문제)
|
|
35
|
-
*/
|
|
36
|
-
function parseCompletionPolicies(value, spec) {
|
|
37
|
-
if (!Array.isArray(value)) return `completionPolicies는 완료 정책 배열입니다. ${COMPLETION_POLICIES_EXAMPLE}`;
|
|
38
|
-
for (const policy of value) {
|
|
39
|
-
const error = completionPolicyError(policy, spec.manifest.completionPolicies);
|
|
40
|
-
if (error) return `completionPolicies: ${error}`;
|
|
41
|
-
}
|
|
42
|
-
const twice = value.find((p, i) => value.indexOf(p) !== i);
|
|
43
|
-
if (twice !== undefined) return `completionPolicies에 ${String(twice)}가 두 번 있습니다.`;
|
|
44
|
-
return value;
|
|
45
|
-
}
|
|
46
53
|
/**
|
|
47
54
|
* metadata.json (zip 최상위): 용도, 화면(모드)별 사용 여부와 진입 파일, 빌드 정보. 정답은 넣지 않는다.
|
|
48
55
|
*
|
|
@@ -51,19 +58,17 @@ function parseCompletionPolicies(value, spec) {
|
|
|
51
58
|
* "screens": { // 알려진 화면을 적는다. 적지 않은 화면은 꺼짐
|
|
52
59
|
* "learn": { "enabled": true, "entry": "index.html" },
|
|
53
60
|
* "instructor": { "enabled": true, "entry": "instructor.html" },
|
|
54
|
-
* "edit": { "enabled": true, "entry": "edit.html" }
|
|
55
|
-
* "completionPolicy": { "enabled": false } // 완료 정책 화면 (ADR 0009)
|
|
61
|
+
* "edit": { "enabled": true, "entry": "edit.html" } // 내용 편집 + 채점 방식 · 답 (ADR 0009)
|
|
56
62
|
* },
|
|
57
|
-
* // 자료 본문은 필수: 지원하는 완료 정책, 서버는 첫 값으로 정한다. 하나면 고정(퀴즈 ["on_graded"]),
|
|
58
|
-
* // 여럿이면 완료 정책 화면이 그 안에서 바꾼다
|
|
59
|
-
* "completionPolicies": ["on_submit", "on_access"],
|
|
60
63
|
* "commentary": "commentary.txt", // 선택. 학습 참고 내용 파일 (zip 최상위, 일반 텍스트)
|
|
61
64
|
* "build": { "cli": "0.1.0", "rules": "0.2.0", "protocol": 1, "engine": "static" } // 선택
|
|
62
65
|
* }
|
|
63
66
|
*
|
|
64
67
|
* 파싱 결과의 `entries`는 켠 화면만 담는다. 서버 `material_draft.manifest`(JSONB) · SDK `MaterialManifest`의
|
|
65
68
|
* `{ entries }`가 이 모양이라 서버는 그대로 저장할 수 있다. 형식은 서버·디자인과 확정 전 제안안 (ADR 0004).
|
|
66
|
-
* `gradingTypes`(2026-11-10 삭제, ADR 0008)가 있으면 받아 주고 경고만 낸다:
|
|
69
|
+
* `gradingTypes`(2026-11-10 삭제, ADR 0008)가 있으면 받아 주고 경고만 낸다: 채점 방식은 편집 화면이 정한다.
|
|
70
|
+
* 완료 정책은 LXP 설정이라 metadata에 없다 (ADR 0012). 옛 `completionPolicies` · `completion`과 완료 정책 화면
|
|
71
|
+
* (`screens.completionPolicy`)은 받아 주고 경고만 낸다 (manifest.completion-policies-ignored, build가 zip에서 뺌).
|
|
67
72
|
*/
|
|
68
73
|
function parseManifest(text, spec) {
|
|
69
74
|
const fail = error => ({
|
|
@@ -80,13 +85,18 @@ function parseManifest(text, spec) {
|
|
|
80
85
|
if (!isRecord(json) || !isRecord(json.screens)) return fail('"screens" 객체가 없습니다. 예: { "screens": { "learn": { "enabled": true, "entry": "index.html" }, "instructor": { "enabled": false }, "edit": { "enabled": false } } }');
|
|
81
86
|
if (json.kind !== undefined && !spec.manifest.kinds.includes(json.kind)) return fail(`"kind"는 ${spec.manifest.kinds.join(' · ')} 중 하나여야 합니다 (material: 자료 본문, description: 문제 설명). 없으면 ${spec.manifest.defaultKind}.`);
|
|
82
87
|
const kind = json.kind;
|
|
83
|
-
const
|
|
84
|
-
|
|
88
|
+
const warnings = [];
|
|
89
|
+
const legacyScreens = Object.keys(json.screens).filter(m => LEGACY_COMPLETION_SCREENS.includes(m));
|
|
90
|
+
if (legacyScreens.length > 0) warnings.push({
|
|
91
|
+
id: 'manifest.completion-policies-ignored',
|
|
92
|
+
message: `완료 정책 화면(screens.${legacyScreens.join(' · screens.')})은 더 쓰지 않습니다. ${COMPLETION_POLICIES_IGNORED}.`
|
|
93
|
+
});
|
|
94
|
+
const unknown = Object.keys(json.screens).find(m => !spec.manifest.modes.includes(m) && !legacyScreens.includes(m));
|
|
85
95
|
if (unknown) return fail(`알 수 없는 화면입니다: ${unknown} (가능: ${spec.manifest.modes.join(', ')})`);
|
|
86
96
|
const entries = {};
|
|
87
97
|
for (const mode of spec.manifest.modes) {
|
|
88
98
|
const s = json.screens[mode];
|
|
89
|
-
// 적지 않은 화면은 꺼짐
|
|
99
|
+
// 적지 않은 화면은 꺼짐
|
|
90
100
|
if (s === undefined) continue;
|
|
91
101
|
if (!isRecord(s) || typeof s.enabled !== 'boolean') return fail(`${mode} 화면은 { "enabled": true|false, "entry": "파일" } 모양이어야 합니다.`);
|
|
92
102
|
if (!s.enabled) {
|
|
@@ -107,16 +117,15 @@ function parseManifest(text, spec) {
|
|
|
107
117
|
if (extra.length > 0) return fail(`${kind === 'description' ? '문제 설명' : kind} 용도는 ${allowed.join(' · ')} 화면만 지원합니다: ${extra.join(', ')}를 { "enabled": false }로 바꿔 주세요.`);
|
|
108
118
|
// 채점 설정(정답 · 기준)은 metadata에 넣지 않는다: zip은 학생에게도 내려간다. 편집 화면이 settings.grading에 저장
|
|
109
119
|
if (json.grading !== undefined) return fail('"grading"(채점 설정)은 metadata.json에 넣지 않습니다. 정답이 학생에게 보입니다. 채점 방식 · 답은 편집 화면에서 정합니다 (ADR 0009).');
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (json.gradingTypes !== undefined) warnings.push('"gradingTypes"는 더 쓰지 않습니다 (2026-11-10). 완료 정책은 "completionPolicies"와 완료 정책 화면(screens.completionPolicy)이, 채점 방식 · 답은 편집 화면이 정합니다 (ADR 0009). ecdk build로 다시 만들면 빠집니다.');
|
|
120
|
+
const legacyFields = LEGACY_COMPLETION_FIELDS.filter(k => json[k] !== undefined);
|
|
121
|
+
if (legacyFields.length > 0) warnings.push({
|
|
122
|
+
id: 'manifest.completion-policies-ignored',
|
|
123
|
+
message: `"${legacyFields.join('" · "')}"는 더 쓰지 않습니다. ${COMPLETION_POLICIES_IGNORED}.`
|
|
124
|
+
});
|
|
125
|
+
if (json.gradingTypes !== undefined) warnings.push({
|
|
126
|
+
id: 'manifest.grading-types',
|
|
127
|
+
message: '"gradingTypes"는 더 쓰지 않습니다 (2026-11-10). 채점 방식 · 답은 편집 화면이 정하고 (ADR 0009), 완료 정책은 LXP 설정 탭에서 교육자가 고릅니다 (ADR 0012). ecdk build로 다시 만들면 빠집니다.'
|
|
128
|
+
});
|
|
120
129
|
const commentary = json.commentary;
|
|
121
130
|
if (commentary !== undefined) {
|
|
122
131
|
if (typeof commentary !== 'string' || commentary.trim() === '') return fail('"commentary"(학습 참고 내용)는 파일 이름이어야 합니다. 예: "commentary.txt"');
|
|
@@ -145,9 +154,6 @@ function parseManifest(text, spec) {
|
|
|
145
154
|
kind
|
|
146
155
|
} : {}),
|
|
147
156
|
entries,
|
|
148
|
-
...(completionPolicies ? {
|
|
149
|
-
completionPolicies
|
|
150
|
-
} : {}),
|
|
151
157
|
...(typeof commentary === 'string' ? {
|
|
152
158
|
commentary: commentary.trim()
|
|
153
159
|
} : {}),
|
|
@@ -161,7 +167,7 @@ function parseManifest(text, spec) {
|
|
|
161
167
|
};
|
|
162
168
|
}
|
|
163
169
|
/**
|
|
164
|
-
* 알려진 화면의 사용 여부(enabled)를 모두 적는다. 필드 순서(kind · screens ·
|
|
170
|
+
* 알려진 화면의 사용 여부(enabled)를 모두 적는다. 필드 순서(kind · screens · commentary · build)와 화면 순서(learn · instructor · edit)를
|
|
165
171
|
* 고정해 같은 입력이면 같은 파일이 나오게 한다. kind가 없으면 기본값을 적는다.
|
|
166
172
|
*/
|
|
167
173
|
function serializeManifest(manifest, spec) {
|
|
@@ -177,9 +183,6 @@ function serializeManifest(manifest, spec) {
|
|
|
177
183
|
const out = {
|
|
178
184
|
kind: manifest.kind ?? spec.manifest.defaultKind,
|
|
179
185
|
screens,
|
|
180
|
-
...(manifest.completionPolicies ? {
|
|
181
|
-
completionPolicies: manifest.completionPolicies
|
|
182
|
-
} : {}),
|
|
183
186
|
...(manifest.commentary !== undefined ? {
|
|
184
187
|
commentary: manifest.commentary
|
|
185
188
|
} : {}),
|
|
@@ -190,4 +193,4 @@ function serializeManifest(manifest, spec) {
|
|
|
190
193
|
return `${JSON.stringify(out, null, 2)}\n`;
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
export {
|
|
196
|
+
export { COMPLETION_POLICIES_IGNORED, LEGACY_COMPLETION_FIELDS, LEGACY_COMPLETION_SCREENS, graderTypeError, parseManifest, serializeManifest, stripCompletionPolicy };
|
package/es/rules/types.d.ts
CHANGED
|
@@ -26,13 +26,7 @@ export interface RulesSpec {
|
|
|
26
26
|
required: string[];
|
|
27
27
|
/** 용도별로 지원할 수 있는 화면. 문제 설명은 학생 화면만 */
|
|
28
28
|
kindModes: Record<string, string[]>;
|
|
29
|
-
/**
|
|
30
|
-
* metadata `completionPolicies`에 쓸 수 있는 완료 정책 (2026-11-11 결정 2). 서버는 그 첫 값으로 완료 정책을 정하고,
|
|
31
|
-
* 완료 정책 화면 · SDK `saveCompletionPolicy`가 그 안에서 바꾼다.
|
|
32
|
-
* on_access(열면 완료) · on_submit(제출하면 완료) · on_graded(채점해 통과하면 완료)
|
|
33
|
-
*/
|
|
34
|
-
completionPolicies: string[];
|
|
35
|
-
/** 채점 방식 (on_graded일 때만): `settings.grading.type`. code_exec는 이번 범위 밖 */
|
|
29
|
+
/** 채점 방식: `settings.grading.type`. code_exec는 이번 범위 밖. 완료 정책은 LXP 설정이라 여기 없다 (ADR 0012) */
|
|
36
30
|
graderTypes: string[];
|
|
37
31
|
/** 학습 참고 내용(commentary) 파일의 기본 이름 (zip 최상위, 일반 텍스트). metadata.json `commentary`가 가리킨다 */
|
|
38
32
|
commentaryFile: string;
|
|
@@ -146,12 +140,6 @@ export interface Manifest {
|
|
|
146
140
|
kind?: string | undefined;
|
|
147
141
|
/** 켠 화면 → 진입 파일 (metadata.json `screens`에서 enabled: true인 것만) */
|
|
148
142
|
entries: Record<string, string>;
|
|
149
|
-
/**
|
|
150
|
-
* 이 자료가 지원하는 완료 정책 (ADR 0009 2026-11-11 결정 2). 서버는 첫 값으로 완료 정책을 정한다.
|
|
151
|
-
* 하나면 고정(퀴즈: ["on_graded"]), 여럿이면 완료 정책 화면(`screens.completionPolicy`)이 그 안에서 바꾼다.
|
|
152
|
-
* 자료 본문은 필수(검사 규칙 manifest.completion-policies-missing), 문제 설명에는 넣지 않는다
|
|
153
|
-
*/
|
|
154
|
-
completionPolicies?: string[] | undefined;
|
|
155
143
|
/** 학습 참고 내용 파일 (zip 최상위 .txt). LXP "AI헬피 설정 → 학습 참고 내용"(lecture page `commentary`)으로 들어간다 */
|
|
156
144
|
commentary?: string | undefined;
|
|
157
145
|
/** ecdk build가 채움. 직접 만든 zip에는 없어도 됨 */
|
package/es/rules.json.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const version="0.7.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit","completionPolicy"],required:["learn"],kindModes:{material:["learn","instructor","edit","completionPolicy"],description:["learn"]},completionPolicies:["on_access","on_submit","on_graded"],graderTypes:["pattern","rubric"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const minVersions={sdk:"1.0.0-alpha.3"};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (sandbox에서 예외가 남)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (sandbox에서 예외가 남, 입력값 저장은 SDK 사용)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"새 창 열기 (sandbox에서 막힘)"},{id:"api.external-send",pattern:"\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (LXP sandbox에서 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 completionPolicies · 완료 정책 화면, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-missing",level:"error",scope:"server",title:"자료 본문인데 completionPolicies(지원하는 완료 정책)가 없거나 비어 있음"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"completion.no-submit",level:"warn",scope:"client",title:"제출 · 채점으로 완료하는데 화면 코드에 제출이 없음"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"completion.no-save",level:"warn",scope:"client",title:"완료 정책 화면인데 저장(useCompletion · saveCompletionPolicy)이 없음"},{id:"completion.no-screen",level:"warn",scope:"client",title:"완료 정책이 여럿인데 완료 정책 화면(completionPolicy)이 없어 첫 값만 쓰임"},{id:"completion.screen-unused",level:"warn",scope:"client",title:"완료 정책이 하나(고정)인데 완료 정책 화면(completionPolicy)이 켜져 있음"},{id:"completion.no-edit",level:"error",scope:"server",title:"채점(on_graded)으로 완료하는데 채점 방식 · 답을 정할 편집 화면이 없음"},{id:"completion.no-grading",level:"warn",scope:"client",title:"채점(on_graded)으로 완료하는데 편집 화면 코드가 채점 설정(getGrading · useGradingBlock)을 저장하지 않음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"warn",scope:"client",title:"외부 리소스 요청 (글꼴·이미지 등이 막힐 수 있음)"},{id:"ref.insecure",level:"warn",scope:"client",title:"http:// 외부 리소스 (https 페이지에서 막힘)"},{id:"sandbox.module-src",level:"error",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): LXP sandbox에서 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"error",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: LXP sandbox에서 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox에서 막힘, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"error",scope:"client",title:"쿠키 사용"},{id:"api.storage",level:"error",scope:"client",title:"브라우저 저장소 사용"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"새 창 열기"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"warn",scope:"client",title:"옛 lib/cdk.js 복사본 (package.json에 @eliceio/cdk가 없음, 프로젝트 검사만. SDK를 package.json 의존성으로 옮기기)"}];var rulesJson = {version:version,manifest:manifest,minVersions:minVersions,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
|
|
1
|
+
const version="0.9.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit"],required:["learn"],kindModes:{material:["learn","instructor","edit"],description:["learn"]},graderTypes:["pattern","rubric"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const minVersions={sdk:"1.0.0-alpha.4"};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (sandbox에서 예외가 남)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (sandbox에서 예외가 남, 입력값 저장은 SDK 사용)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"새 창 열기 (sandbox에서 막힘)"},{id:"api.external-send",pattern:"\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (LXP sandbox에서 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-ignored",level:"warn",scope:"client",title:"쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"grading.no-submit",level:"warn",scope:"client",title:"편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"warn",scope:"client",title:"외부 리소스 요청 (글꼴·이미지 등이 막힐 수 있음)"},{id:"ref.insecure",level:"warn",scope:"client",title:"http:// 외부 리소스 (https 페이지에서 막힘)"},{id:"sandbox.module-src",level:"error",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): LXP sandbox에서 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"error",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: LXP sandbox에서 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox에서 막힘, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"error",scope:"client",title:"쿠키 사용"},{id:"api.storage",level:"error",scope:"client",title:"브라우저 저장소 사용"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"새 창 열기"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"warn",scope:"client",title:"옛 lib/cdk.js 복사본 (package.json에 @eliceio/cdk가 없음, 프로젝트 검사만. SDK를 package.json 의존성으로 옮기기)"}];var rulesJson = {version:version,manifest:manifest,minVersions:minVersions,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
|
|
2
2
|
|
|
3
3
|
export { allowedExtensions, rulesJson as default, excluded, forbiddenApis, imageExtensions, limits, manifest, minVersions, rules, secretPatterns, version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eliceio/cdk-cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"description": "교육자용 Custom HTML 콘텐츠 CLI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"es",
|
|
18
|
-
"guides",
|
|
19
18
|
"rules.json",
|
|
20
19
|
"skills",
|
|
21
20
|
"templates"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
"rollup": "^4.0.0",
|
|
42
41
|
"tslib": "^2.6.1",
|
|
43
42
|
"typescript": "~5.9.3",
|
|
44
|
-
"@eliceio/cdk": "^1.0.0-alpha.
|
|
43
|
+
"@eliceio/cdk": "^1.0.0-alpha.5"
|
|
45
44
|
},
|
|
46
45
|
"scripts": {
|
|
47
46
|
"prebuild": "del-cli \"buildcache/*\" \"es/*\"",
|
package/rules.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.9.0",
|
|
3
3
|
"manifest": {
|
|
4
4
|
"file": "metadata.json",
|
|
5
5
|
"kinds": ["material", "description"],
|
|
6
6
|
"defaultKind": "material",
|
|
7
|
-
"modes": ["learn", "instructor", "edit"
|
|
7
|
+
"modes": ["learn", "instructor", "edit"],
|
|
8
8
|
"required": ["learn"],
|
|
9
9
|
"kindModes": {
|
|
10
|
-
"material": ["learn", "instructor", "edit"
|
|
10
|
+
"material": ["learn", "instructor", "edit"],
|
|
11
11
|
"description": ["learn"]
|
|
12
12
|
},
|
|
13
|
-
"completionPolicies": ["on_access", "on_submit", "on_graded"],
|
|
14
13
|
"graderTypes": ["pattern", "rubric"],
|
|
15
14
|
"commentaryFile": "commentary.txt",
|
|
16
15
|
"defaultEntry": "index.html"
|
|
17
16
|
},
|
|
18
17
|
"minVersions": {
|
|
19
|
-
"sdk": "1.0.0-alpha.
|
|
18
|
+
"sdk": "1.0.0-alpha.4"
|
|
20
19
|
},
|
|
21
20
|
"limits": {
|
|
22
21
|
"maxZipBytes": 20971520,
|
|
@@ -366,13 +365,13 @@
|
|
|
366
365
|
"id": "manifest.grading-types",
|
|
367
366
|
"level": "warn",
|
|
368
367
|
"scope": "server",
|
|
369
|
-
"title": "쓰지 않는 gradingTypes (완료 정책은
|
|
368
|
+
"title": "쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"
|
|
370
369
|
},
|
|
371
370
|
{
|
|
372
|
-
"id": "manifest.completion-policies-
|
|
373
|
-
"level": "
|
|
374
|
-
"scope": "
|
|
375
|
-
"title": "
|
|
371
|
+
"id": "manifest.completion-policies-ignored",
|
|
372
|
+
"level": "warn",
|
|
373
|
+
"scope": "client",
|
|
374
|
+
"title": "쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"
|
|
376
375
|
},
|
|
377
376
|
{
|
|
378
377
|
"id": "entry.missing",
|
|
@@ -483,10 +482,10 @@
|
|
|
483
482
|
"title": "학생에게 내려가는 JSON에 정답처럼 보이는 키"
|
|
484
483
|
},
|
|
485
484
|
{
|
|
486
|
-
"id": "
|
|
485
|
+
"id": "grading.no-submit",
|
|
487
486
|
"level": "warn",
|
|
488
487
|
"scope": "client",
|
|
489
|
-
"title": "
|
|
488
|
+
"title": "편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"
|
|
490
489
|
},
|
|
491
490
|
{
|
|
492
491
|
"id": "edit.no-save",
|
|
@@ -494,36 +493,6 @@
|
|
|
494
493
|
"scope": "client",
|
|
495
494
|
"title": "편집 화면인데 저장이 없음"
|
|
496
495
|
},
|
|
497
|
-
{
|
|
498
|
-
"id": "completion.no-save",
|
|
499
|
-
"level": "warn",
|
|
500
|
-
"scope": "client",
|
|
501
|
-
"title": "완료 정책 화면인데 저장(useCompletion · saveCompletionPolicy)이 없음"
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
"id": "completion.no-screen",
|
|
505
|
-
"level": "warn",
|
|
506
|
-
"scope": "client",
|
|
507
|
-
"title": "완료 정책이 여럿인데 완료 정책 화면(completionPolicy)이 없어 첫 값만 쓰임"
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"id": "completion.screen-unused",
|
|
511
|
-
"level": "warn",
|
|
512
|
-
"scope": "client",
|
|
513
|
-
"title": "완료 정책이 하나(고정)인데 완료 정책 화면(completionPolicy)이 켜져 있음"
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"id": "completion.no-edit",
|
|
517
|
-
"level": "error",
|
|
518
|
-
"scope": "server",
|
|
519
|
-
"title": "채점(on_graded)으로 완료하는데 채점 방식 · 답을 정할 편집 화면이 없음"
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
"id": "completion.no-grading",
|
|
523
|
-
"level": "warn",
|
|
524
|
-
"scope": "client",
|
|
525
|
-
"title": "채점(on_graded)으로 완료하는데 편집 화면 코드가 채점 설정(getGrading · useGradingBlock)을 저장하지 않음"
|
|
526
|
-
},
|
|
527
496
|
{
|
|
528
497
|
"id": "project.legacy-file",
|
|
529
498
|
"level": "warn",
|
|
@@ -666,7 +635,7 @@
|
|
|
666
635
|
"id": "sdk.outdated",
|
|
667
636
|
"level": "error",
|
|
668
637
|
"scope": "client",
|
|
669
|
-
"title": "SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk
|
|
638
|
+
"title": "SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"
|
|
670
639
|
},
|
|
671
640
|
{
|
|
672
641
|
"id": "sdk.lib-copy",
|
package/skills/_shared/always.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
- Never put correct answers in the content zip. The edit screen saves them to `settings.grading` (locally `.ecdk/settings.json` from `ecdk dev`).
|
|
4
4
|
- The content runs in a sandboxed iframe on another origin: use the SDK (`app.useSubmit`, `app.useSave`) instead of storage, cookies, `alert`/`confirm`, new windows, the parent window or external requests.
|
|
5
5
|
- If `ecdk`, `node` or `npm` is "command not found", the app started without the person's shell PATH (macOS desktop apps such as Helpy Code Desktop). Run each command through their login shell instead: `"$SHELL" -ilc 'ecdk build --json'` (use `zsh -ilc` when `$SHELL` is empty). With `--json`, read only the last JSON block of the output (a login shell may print other text first). If that also fails, ask the person how Node was installed.
|
|
6
|
-
- Fix every `ecdk
|
|
7
|
-
- Ask the person before you settle correct answers, install anything globally, or upload or save to LXP (a saved version is visible to learners at once).
|
|
8
|
-
- LXP draws its own 이전 · 다음 bar under the material to move between lecture pages. For steps inside a material use the kit's `app.usePaging` (side chevrons, `n / N`; on the first and last step they become "이전 자료" · "다음 자료" to the previous / next lecture page,
|
|
6
|
+
- Fix every `ecdk validate` / `ecdk build` error before you report. Do not edit `lib/` (the screen kit). The SDK comes from npm through `package.json` (`npm update @eliceio/cdk`); `ecdk build` adds it to the zip as `lib/cdk.js`.
|
|
7
|
+
- Ask the person before you settle correct answers, install anything globally, or upload or save to LXP (a saved version is visible to learners at once). Before uploading, confirm the exact target page (기관 · 과목 · 수업 · 페이지) with the person.
|
|
8
|
+
- LXP draws its own 이전 · 다음 bar under the material to move between lecture pages. For steps inside a material use the kit's `app.usePaging` (side chevrons, `n / N`; on the first and last step they become "이전 자료" · "다음 자료" to the previous / next lecture page, `../elice-content-guide/topics/02-design-the-material.md`), never a look-alike bottom 이전 · 다음 bar.
|
|
9
9
|
- Answer the person in their language. The guide is in English.
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: elice-content-check
|
|
3
|
-
description: Find and fix problems in an Elice Custom HTML learning material - ecdk
|
|
3
|
+
description: Find and fix problems in an Elice Custom HTML learning material - ecdk validate or ecdk build errors, blocked browser APIs, missing or wrongly cased files, a zip that LXP rejects, or a material that stays on "Loading" or shows nothing in LXP. Use when the person reports an error with an Elice or LXP material or with ecdk.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Fix an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Read guide topics with the Read tool from the sibling `elice-content-guide` skill folder (same parent folder as this skill), e.g. `../elice-content-guide/topics/05-screen-code.md`; its `SKILL.md` lists every topic. If that folder is missing, ask the person to run `ecdk setup --only skills` (it installs all five skills together; when these skills are in a project's `.claude/skills/`, run `ecdk setup --only skills --project` in that project folder instead), then continue. Topics for this skill: `../elice-content-guide/topics/08-fix-check-errors.md`, `../elice-content-guide/topics/04-rules.md`, `../elice-content-guide/topics/09-check.md`.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Reproduce with the CLI.** In the project, `ecdk doctor --json` and `ecdk
|
|
15
|
-
2. **Fix by the guide.** Look the id up in
|
|
14
|
+
1. **Reproduce with the CLI.** In the project, `ecdk doctor --json` and `ecdk validate --json`. For a zip someone made, `ecdk validate <file>.zip --json`. Each issue has an id, a file and a line.
|
|
15
|
+
2. **Fix by the guide.** Look the id up in `../elice-content-guide/topics/08-fix-check-errors.md`. Fix the cause in the source, not in `dist/`. Do not silence a rule with an `ecdk-ignore` comment unless the guide says so.
|
|
16
16
|
3. **Problems that show only in LXP.**
|
|
17
|
-
- Stays on "Loading" or shows nothing: rebuild with the current `ecdk build` (it adapts the pages to the LXP sandbox) and check the built zip with `ecdk
|
|
18
|
-
- Upload rejected: check `ecdk
|
|
17
|
+
- Stays on "Loading" or shows nothing: rebuild with the current `ecdk build` (it adapts the pages to the LXP sandbox) and check the built zip with `ecdk validate dist/content.zip`. Ask the person for the browser console error.
|
|
18
|
+
- Upload rejected: check `ecdk validate dist/content.zip`; a material needs `commentary.txt` and every file named in `metadata.json`.
|
|
19
19
|
- Screens show "아직 내용이 없습니다": nothing is saved yet; create the content in the edit screen (there is no default content file). `project.legacy-file`: an old `content.json` · `grading.json`; re-enter it in the edit screen and delete the file. An old `elice.config.json`, or `sdk.lib-copy` (an old `lib/cdk.js` copy): `ecdk doctor --fix`, then `npm install`.
|
|
20
|
-
- Answers or grading wrong: check the answers on the edit screen (saving in the `ecdk dev` content edit view writes `.ecdk/settings.json`) and `
|
|
21
|
-
-
|
|
22
|
-
|
|
20
|
+
- Answers or grading wrong: check the answers on the edit screen (saving in the `ecdk dev` content edit view writes `.ecdk/settings.json`) and that the submitted answer string matches the regex (`../elice-content-guide/topics/02-design-the-material.md`, `../elice-content-guide/topics/06-using-the-quiz-template.md`). In `ecdk dev` a submission is graded only when grading is saved; otherwise it is only accepted. Completing at the wrong time is the completion policy: 완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (not in the project; an old `completionPolicies` in `metadata.json` is ignored with `manifest.completion-policies-ignored`).
|
|
21
|
+
- doctor `cli.latest` warns: a newer ecdk is out and fixes may depend on it. Tell the person and, after they agree, run `ecdk update` (it installs the CLI globally, refreshes the skills and runs `npm update @eliceio/cdk` in a project); afterwards relay its closing note (Claude Code picks up changed skills in open sessions; `/reload-skills` only when it says the skills folder was just created; Helpy Code desktop needs a restart).
|
|
22
|
+
- `@eliceio/cdk 패키지를 찾지 못했습니다` or doctor `project.deps` fails: run `npm install` in the project. `sdk.outdated` (SDK 1.0.0-alpha.3 or older: saving in the LXP edit screen - draft save - fails): `npm update @eliceio/cdk` (on an old `lib/cdk.js` copy: `ecdk doctor --fix && npm install`), then build again.
|
|
23
|
+
4. **Confirm.** `ecdk validate` has no errors, `ecdk dev` works, and `ecdk build --json` returns `ok: true`. Tell the person what caused it and what you changed.
|
|
23
24
|
|
|
24
25
|
{{version}}
|
|
@@ -5,18 +5,18 @@ description: Create a new Elice Custom HTML learning material (LXP material type
|
|
|
5
5
|
|
|
6
6
|
# Create an Elice learning material
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Read guide topics with the Read tool from the sibling `elice-content-guide` skill folder (same parent folder as this skill), e.g. `../elice-content-guide/topics/05-screen-code.md`; its `SKILL.md` lists every topic. If that folder is missing, ask the person to run `ecdk setup --only skills` (it installs all five skills together; when these skills are in a project's `.claude/skills/`, run `ecdk setup --only skills --project` in that project folder instead), then continue. Read only the topics you need.
|
|
9
9
|
|
|
10
10
|
{{always}}
|
|
11
11
|
|
|
12
12
|
## Steps
|
|
13
13
|
|
|
14
|
-
1. **Design before code.** Read
|
|
15
|
-
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`ecdk
|
|
16
|
-
3. **Write the screens.** You build the template: screens and code (
|
|
14
|
+
1. **Design before code.** Read `../elice-content-guide/topics/00-what-the-person-decides.md` (what the person decides) and `../elice-content-guide/topics/02-design-the-material.md`. Decide ① what the student does, ② whether the student submits and the grading (`type` `pattern` or `rubric`, set on the edit screen; the quiz template uses `pattern`, so do not ask for a quiz). Do not decide the completion policy: 완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (the instructor picks `on_access` · `on_submit` · `on_graded` in the LXP settings tab after the upload; do not write it in `metadata.json`). Only tell the person which policy fits, ③ the instructor screen, ④ the content edit screen, ⑤ the purpose. Decide what the request leaves out and tell the person briefly; ask only when the learning goal is unclear.
|
|
15
|
+
2. **Environment and project.** `ecdk --version && ecdk doctor --json` (`../elice-content-guide/topics/01-check-the-environment.md`; when `cli.latest` warns, offer `ecdk update` and run it only after the person agrees), then `ecdk create --list` to pick a template and `ecdk create <folder> --template <name>` (`../elice-content-guide/topics/03-create-the-project.md`; it runs `npm install` for the SDK, so when that fails run `npm install` in the project).
|
|
16
|
+
3. **Write the screens.** You build the template: screens and code (`../elice-content-guide/topics/05-screen-code.md`, following its UI patterns: kit icon buttons, list rows, drop zones; the quiz template: `../elice-content-guide/topics/06-using-the-quiz-template.md`), and `commentary.txt` (key concepts and intent, no answers). The real content and answers are entered in the LXP edit screen after upload; there is no default content file. In `ecdk dev`, try the edit and learn screens with a little sample input (saved only locally in `.ecdk/settings.json`, never uploaded); do not author the full question set locally.
|
|
17
17
|
- If the person describes the content (for example "5 questions about perceptrons"), give it as draft text with the answers for the person to enter in the LXP edit screen. A quiz material holds one question, so several questions mean several quiz materials (pages).
|
|
18
|
-
4. **Check.** `ecdk
|
|
19
|
-
5. **Build and report.** `ecdk build --json` must return `ok: true`. Report as
|
|
20
|
-
6. **Upload** only after the person approves: the elice-content-publish skill (
|
|
18
|
+
4. **Check.** `ecdk validate`, fix errors (`../elice-content-guide/topics/08-fix-check-errors.md`), then `ecdk dev` and go through the screens (`../elice-content-guide/topics/09-check.md`). The person looks at the screens too.
|
|
19
|
+
5. **Build and report.** `ecdk build --json` must return `ok: true`. Report as `../elice-content-guide/topics/10-build.md` says.
|
|
20
|
+
6. **Upload** only after the person approves: the elice-content-publish skill (`../elice-content-guide/topics/12-upload-with-the-material-mcp.md`), or the person uploads `dist/content.zip` in LXP. Then the person enters the content and answers in the LXP edit screen and saves the page (the edit screen's button, then 저장 at the bottom of the LXP edit page; learners see it after that).
|
|
21
21
|
|
|
22
22
|
{{version}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elice-content-guide
|
|
3
|
+
description: The Elice Custom HTML learning material development guide (LXP material type 17, ecdk CLI) - design, the LXP sandbox rules, screen code and SDK, templates, fixing ecdk validate or build errors, checking, building and uploading. The other elice-content skills (create, migrate, check, publish) read its topic files; read it when you work on an Elice or LXP learning material.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Developing Elice Custom HTML learning materials
|
|
7
|
+
|
|
8
|
+
A Custom HTML learning material is **a small web app in one zip**. Anything that runs in a browser can be a learning material: an explanation, an interactive simulation or visualization, a guided exercise, a game-like activity, flashcards, a self-check or survey, a quiz, or the description of a practice problem.
|
|
9
|
+
|
|
10
|
+
Build it with the `ecdk` CLI (`@eliceio/cdk-cli`). This guide is split into topic files in `topics/` next to this file: read only the topics you need, with the Read tool (table below). For a command's options, run `ecdk <command> --help`.
|
|
11
|
+
|
|
12
|
+
One zip has up to three screens. The completion policy is not part of the zip: the instructor picks it in the LXP settings tab after the upload (ADR 0012).
|
|
13
|
+
|
|
14
|
+
| Screen | Files | What it does |
|
|
15
|
+
| ----------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| Student (required) | `index.html` + `screens/learn.js` | The learning activity (read, interact, solve, make). Submits a result when needed |
|
|
17
|
+
| Instructor (optional) | `instructor.html` + `screens/instructor.js` | What only instructors see: activity summary, explanations, teaching tips |
|
|
18
|
+
| Content edit (optional) | `edit.html` + `screens/edit.js` | Instructors edit text and data without code and save it → `app.content` of the other screens. Also sets the grader and the answers or rubric, saved to `settings.grading` (never sent to students) |
|
|
19
|
+
|
|
20
|
+
Elice opens the content in a **sandboxed (`allow-scripts`) iframe on another origin**. There is no server: everything runs as browser JS, and only submission, saving and grading go to the Elice server.
|
|
21
|
+
|
|
22
|
+
## Topics
|
|
23
|
+
|
|
24
|
+
The other elice-content skills point to these files as `../elice-content-guide/topics/<file>` (this skill is installed next to them by `ecdk setup --only skills`). Cross references inside a topic ("see 2 ②") use the topic number.
|
|
25
|
+
|
|
26
|
+
| Topic file | Read when |
|
|
27
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `topics/00-what-the-person-decides.md` | Before you design or upload: what the person decides (goal, answers, grading, learning notes, upload) |
|
|
29
|
+
| `topics/01-check-the-environment.md` | At the start: `ecdk doctor`, installing or updating ecdk, registering the material MCP |
|
|
30
|
+
| `topics/02-design-the-material.md` | Designing: screens, submission and grading, learning notes, which completion policy fits |
|
|
31
|
+
| `topics/03-create-the-project.md` | Picking a template and running `ecdk create` |
|
|
32
|
+
| `topics/04-rules.md` | Before writing code: what the LXP sandbox blocks and what never goes in the zip |
|
|
33
|
+
| `topics/05-screen-code.md` | Writing screens: the SDK, the screen kit and its UI patterns |
|
|
34
|
+
| `topics/06-using-the-quiz-template.md` | Working on the quiz template |
|
|
35
|
+
| `topics/07-move-existing-html.md` | Moving existing HTML or a web demo into a project |
|
|
36
|
+
| `topics/08-fix-check-errors.md` | `ecdk validate` or `ecdk build` reports an error or warning (look the id up) |
|
|
37
|
+
| `topics/09-check.md` | Checking the screens in `ecdk dev` before you report |
|
|
38
|
+
| `topics/10-build.md` | Building the zip and reporting to the person |
|
|
39
|
+
| `topics/11-more.md` | Where to find more (SDK docs, `--help`) |
|
|
40
|
+
| `topics/12-upload-with-the-material-mcp.md` | Uploading to LXP with the `elice-material` MCP |
|
|
41
|
+
|
|
42
|
+
{{version}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# 0. What the person decides
|
|
2
|
+
|
|
3
|
+
The person (the instructor or author) is responsible for the content and its answers. Do not settle the following on your own; ask, or get a confirmation.
|
|
4
|
+
|
|
5
|
+
1. **The learning goal, when it is unclear.** Decide the rest of the design to fit the goal and tell the person briefly what you decided.
|
|
6
|
+
2. **Correct answers.** You may draft answers and rubrics, but the person confirms that they are right.
|
|
7
|
+
3. **How it is graded**: whether the student submits, and the grader (`pattern` or `rubric`) set on the edit screen. Propose what fits the material and get a confirmation. The completion policy is not decided here: the instructor picks it in the LXP settings tab after the upload (완료 정책은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다). Tell the person which policy fits (see the table in 2 ②).
|
|
8
|
+
4. **What the learning notes say** (`commentary.txt`). A material needs them (LXP rejects the upload without them); once they are filled in, AI Helpy answers only questions about this material, so let the person check the wording.
|
|
9
|
+
5. **Checking the screens.** The person looks at the student, tutoring, instructor, edit and mobile views in the preview. When they cannot, tell them what to check and in which order.
|
|
10
|
+
6. **Uploading to LXP.** A saved version is **visible to learners at once** (when the page is open). Before uploading, show what changes and get approval. The same goes for changing a material that is already open, changing answers, and restoring an older version.
|
|
11
|
+
7. **Global installs, accounts and permissions.** Leave them to the person.
|