@eliceio/cdk-cli 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +110 -84
- package/es/cli.js +7 -22
- package/es/commands/build/index.d.ts +5 -3
- package/es/commands/build/index.js +20 -11
- package/es/commands/create/scaffold.d.ts +2 -0
- package/es/commands/create/scaffold.js +15 -1
- package/es/commands/dev/index.d.ts +1 -1
- package/es/commands/dev/index.js +1 -1
- package/es/commands/doctor/index.d.ts +1 -1
- package/es/commands/doctor/index.js +5 -6
- package/es/commands/setup/index.d.ts +4 -7
- package/es/commands/setup/index.js +41 -70
- package/es/commands/uninstall/index.d.ts +9 -8
- package/es/commands/uninstall/index.js +41 -47
- package/es/commands/update/index.d.ts +4 -2
- package/es/commands/update/index.js +27 -18
- package/es/core/collect.js +1 -1
- package/es/core/config.d.ts +1 -1
- package/es/core/config.js +3 -3
- package/es/{commands/mcp/index.d.ts → core/mcp.d.ts} +11 -18
- package/es/{commands/mcp/index.js → core/mcp.js} +29 -51
- package/es/core/minify.js +31 -2
- package/es/core/prepare.js +1 -1
- package/es/core/sandbox.d.ts +25 -0
- package/es/core/sandbox.js +110 -8
- package/es/{commands/skill/index.d.ts → core/skills.d.ts} +1 -17
- package/es/{commands/skill/index.js → core/skills.js} +6 -22
- package/es/dev/grading.d.ts +1 -1
- package/es/dev/grading.js +1 -1
- package/es/dev/host-page.js +20 -5
- package/es/dev/inject.d.ts +6 -0
- package/es/dev/inject.js +16 -1
- package/es/dev/mock-api.js +0 -16
- package/es/dev/server.d.ts +4 -2
- package/es/dev/server.js +11 -3
- package/es/rules/check.js +71 -8
- package/es/rules/csp.d.ts +26 -0
- package/es/rules/csp.js +42 -0
- package/es/rules/index.d.ts +2 -1
- package/es/rules/index.js +2 -1
- package/es/rules/refs.d.ts +12 -2
- package/es/rules/refs.js +50 -18
- package/es/rules/types.d.ts +5 -0
- package/es/rules/unused.d.ts +2 -0
- package/es/rules/unused.js +4 -3
- package/es/rules.json.js +2 -2
- package/package.json +2 -2
- package/rules.json +37 -15
- package/skills/_shared/always.md +2 -1
- package/skills/elice-content-create/SKILL.md +2 -1
- package/skills/elice-content-guide/SKILL.md +1 -1
- package/skills/elice-content-guide/topics/01-check-the-environment.md +2 -2
- package/skills/elice-content-guide/topics/02-design-the-material.md +2 -0
- package/skills/elice-content-guide/topics/03-create-the-project.md +2 -2
- package/skills/elice-content-guide/topics/04-rules.md +3 -1
- package/skills/elice-content-guide/topics/05-screen-code.md +44 -13
- package/skills/elice-content-guide/topics/07-move-existing-html.md +1 -1
- package/skills/elice-content-guide/topics/08-fix-check-errors.md +21 -18
- package/skills/elice-content-guide/topics/09-check.md +1 -0
- package/skills/elice-content-guide/topics/10-build.md +1 -1
- package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +2 -2
- package/skills/elice-content-migrate/SKILL.md +4 -3
- package/skills/elice-content-publish/SKILL.md +1 -1
- package/templates/_shared/lib/cdk-mock.js +3 -3
- package/templates/_shared/lib/elice-content-editor.d.ts +80 -0
- package/templates/_shared/lib/elice-content-editor.js +1062 -0
- package/templates/_shared/lib/elice-content.css +354 -1
- package/templates/_shared/lib/elice-content.js +10 -3
- package/templates/blank/README.md +27 -2
- package/templates/blank/commentary.txt +5 -0
- package/templates/blank/screens/edit.js +38 -17
- package/templates/blank/screens/instructor.js +20 -8
- package/templates/blank/screens/learn.js +151 -13
- package/templates/blank/styles.css +171 -0
- package/templates/blank/template.json +2 -2
- package/templates/quiz/README.md +2 -2
- package/templates/quiz/core/editor.d.ts +2 -0
- package/templates/quiz/core/editor.js +16 -6
- package/templates/quiz/core/model.js +1 -1
- package/templates/quiz/screens/edit.js +117 -24
- package/templates/quiz/styles.css +86 -12
- package/templates/quiz/template.json +1 -1
- package/templates/quiz/ui/templates/edit.d.ts +4 -0
- package/templates/quiz/ui/templates/edit.js +46 -10
- package/templates/quiz/ui/templates/page.js +1 -2
- package/templates/quiz/ui/templates/text.js +10 -7
- package/templates/quiz/ui/texts.js +13 -9
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* - 시나리오: 주소에 ?mock=session_expired | rate_limited | request_failed | external_service_error
|
|
18
18
|
* | slow | content_not_ready | unauthorized | draft_not_ready
|
|
19
19
|
*
|
|
20
|
-
* 실제 SDK: @eliceio/cdk 1.x
|
|
20
|
+
* 실제 SDK: @eliceio/cdk 1.x 기준
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
export const ErrorCode = Object.freeze({
|
|
@@ -125,7 +125,7 @@ export function normalizeGradingSettings(grading) {
|
|
|
125
125
|
* elice-material 채점 흉내 (채점 방식 → 점수). 실제 서버처럼 요청 안에서 바로 채점한 `{ isCorrect, score }`만
|
|
126
126
|
* 돌려준다. 완료 정책은 LXP 설정이라 보지 않는다 (ADR 0012): 채점 설정이 있으면 채점하고, 없으면 제출만 받는다.
|
|
127
127
|
* - pattern: 정답 정규식(문자열 하나)이 답 문자열 전체와 맞으면 100, 아니면 0
|
|
128
|
-
* - rubric: 바로 80점으로 흉내, 통과로 봄 (통과 기준 pass_threshold는 정해지지
|
|
128
|
+
* - rubric: 바로 80점으로 흉내, 통과로 봄 (통과 기준 pass_threshold는 정해지지 않음)
|
|
129
129
|
* - 채점 설정 없음: 점수 없음 `{ isCorrect: null, score: null }`
|
|
130
130
|
* @param {object | null} grading settings.grading
|
|
131
131
|
* @param {unknown} answer
|
|
@@ -405,7 +405,7 @@ export class MockEliceCDK {
|
|
|
405
405
|
);
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
/**
|
|
408
|
+
/** The real SDK stops its token expiry timer and hashchange listener. The mock has neither. */
|
|
409
409
|
dispose() {}
|
|
410
410
|
|
|
411
411
|
/** mock 전용: 저장한 내용·제출·결과 지우기 */
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// 편집기 자동완성용 타입. lib/elice-content-editor.js와 같이 고치지 않습니다.
|
|
2
|
+
|
|
3
|
+
export type ContentFieldType = 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
4
|
+
|
|
5
|
+
/** 스키마 칸 하나 (JSON Schema를 줄인 것) */
|
|
6
|
+
export interface ContentField {
|
|
7
|
+
/** 칸 이름 (없으면 키) */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** 종류 (없으면 견본 값에서) */
|
|
10
|
+
type?: ContentFieldType;
|
|
11
|
+
/** 비우면 저장을 막음 */
|
|
12
|
+
required?: boolean;
|
|
13
|
+
/** 숫자는 범위, 목록은 개수 */
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
/** 여러 줄 글 칸 */
|
|
17
|
+
multiline?: boolean;
|
|
18
|
+
/** 고르기 (select) */
|
|
19
|
+
enum?: Array<string | number | boolean>;
|
|
20
|
+
/** 칸 아래 도움말 */
|
|
21
|
+
hint?: string;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** 목록 항목 모양 (칸 하나 또는 이름 → 칸 묶음) */
|
|
24
|
+
item?: ContentField | ContentSchema;
|
|
25
|
+
/** 묶음 안 칸들 (이름 → 칸) */
|
|
26
|
+
fields?: ContentSchema;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 이름 → 칸 */
|
|
30
|
+
export type ContentSchema = Record<string, ContentField>;
|
|
31
|
+
|
|
32
|
+
export interface ContentEditorOptions<C> {
|
|
33
|
+
/** 저장한 내용이 없을 때 시작할 견본 (정답 넣지 않음) */
|
|
34
|
+
initial?: C;
|
|
35
|
+
schema?: ContentSchema;
|
|
36
|
+
/** 스키마 검사 다음에 할 검사. 통과면 true, 아니면 보여 줄 문장 */
|
|
37
|
+
validate?: (content: C) => true | string | false;
|
|
38
|
+
/** 편집기를 그릴 곳 (기본 #app, 안을 비움) */
|
|
39
|
+
root?: Element;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ContentEditor<C> {
|
|
43
|
+
element: Element;
|
|
44
|
+
readonly view: 'form' | 'code';
|
|
45
|
+
/** 보기 바꾸기. 코드 → 폼은 JSON이 올바를 때만 (아니면 false) */
|
|
46
|
+
showView(view: 'form' | 'code'): boolean;
|
|
47
|
+
/** useSave getContent에 넘김 */
|
|
48
|
+
getContent(): C;
|
|
49
|
+
setContent(content: C): void;
|
|
50
|
+
/** useSave validate에 넘김: 코드 JSON 오류(줄 · 칸) → 스키마(경로) → options.validate */
|
|
51
|
+
validate(content?: C): true | string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** 편집 화면의 JSON 내용 편집기 (폼 보기 · 코드 보기). app은 start({ screen: 'edit' })가 준 것 */
|
|
55
|
+
export declare function useContentEditor<C = Record<string, unknown>>(
|
|
56
|
+
app: { screen: string; hasContent: boolean; content: unknown },
|
|
57
|
+
options?: ContentEditorOptions<C>
|
|
58
|
+
): ContentEditor<C>;
|
|
59
|
+
|
|
60
|
+
export declare const UNDO_MS: number;
|
|
61
|
+
export declare function typeOf(value: unknown): ContentFieldType | undefined;
|
|
62
|
+
export declare function asNode(schema: unknown): ContentField;
|
|
63
|
+
export declare function inferSchema(value: unknown): ContentField;
|
|
64
|
+
export declare function mergeSchema(user: unknown, inferred: unknown): ContentField;
|
|
65
|
+
export declare function emptyValue(field: unknown): unknown;
|
|
66
|
+
export declare function joinPath(base: string, key: string | number): string;
|
|
67
|
+
export declare function validateContent(
|
|
68
|
+
value: unknown,
|
|
69
|
+
schema: unknown,
|
|
70
|
+
path?: string
|
|
71
|
+
): { path: string; message: string; kind: 'type' | 'rule' }[];
|
|
72
|
+
export declare function labelPath(schema: unknown, path: string): string;
|
|
73
|
+
export declare function parseJson(
|
|
74
|
+
text: string
|
|
75
|
+
):
|
|
76
|
+
| { ok: true; value: unknown }
|
|
77
|
+
| { ok: false; index: number; line: number; column: number; message: string };
|
|
78
|
+
export declare function lineColumn(text: string, index: number): { line: number; column: number };
|
|
79
|
+
export declare function highlightJson(text: string, errorAt?: number): DocumentFragment;
|
|
80
|
+
export declare function moveItem(list: unknown[], from: number, to: number): boolean;
|