@eliceio/cdk-cli 0.1.0-alpha.6 → 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.
Files changed (59) hide show
  1. package/README.md +70 -71
  2. package/es/cli.js +7 -22
  3. package/es/commands/build/index.d.ts +5 -3
  4. package/es/commands/build/index.js +16 -7
  5. package/es/commands/create/scaffold.d.ts +2 -0
  6. package/es/commands/create/scaffold.js +15 -1
  7. package/es/commands/doctor/index.d.ts +1 -1
  8. package/es/commands/doctor/index.js +4 -5
  9. package/es/commands/setup/index.d.ts +4 -7
  10. package/es/commands/setup/index.js +41 -70
  11. package/es/commands/uninstall/index.d.ts +9 -8
  12. package/es/commands/uninstall/index.js +41 -47
  13. package/es/commands/update/index.d.ts +4 -2
  14. package/es/commands/update/index.js +27 -18
  15. package/es/core/config.d.ts +1 -1
  16. package/es/core/config.js +2 -2
  17. package/es/{commands/mcp/index.d.ts → core/mcp.d.ts} +11 -18
  18. package/es/{commands/mcp/index.js → core/mcp.js} +29 -51
  19. package/es/core/minify.js +31 -2
  20. package/es/core/sandbox.d.ts +25 -0
  21. package/es/core/sandbox.js +104 -5
  22. package/es/{commands/skill/index.d.ts → core/skills.d.ts} +1 -17
  23. package/es/{commands/skill/index.js → core/skills.js} +6 -22
  24. package/es/dev/grading.d.ts +1 -1
  25. package/es/dev/grading.js +1 -1
  26. package/es/dev/host-page.js +2 -2
  27. package/es/rules/check.js +3 -3
  28. package/es/rules/csp.d.ts +1 -1
  29. package/es/rules/csp.js +1 -1
  30. package/es/rules/index.d.ts +1 -1
  31. package/es/rules/index.js +1 -1
  32. package/es/rules/unused.d.ts +2 -0
  33. package/es/rules/unused.js +4 -3
  34. package/package.json +2 -2
  35. package/skills/elice-content-create/SKILL.md +2 -1
  36. package/skills/elice-content-guide/topics/01-check-the-environment.md +2 -2
  37. package/skills/elice-content-guide/topics/02-design-the-material.md +2 -0
  38. package/skills/elice-content-guide/topics/03-create-the-project.md +2 -2
  39. package/skills/elice-content-guide/topics/05-screen-code.md +44 -13
  40. package/skills/elice-content-guide/topics/10-build.md +1 -1
  41. package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +2 -2
  42. package/skills/elice-content-publish/SKILL.md +1 -1
  43. package/templates/_shared/lib/cdk-mock.js +2 -2
  44. package/templates/_shared/lib/elice-content-editor.d.ts +80 -0
  45. package/templates/_shared/lib/elice-content-editor.js +1062 -0
  46. package/templates/_shared/lib/elice-content.css +332 -0
  47. package/templates/_shared/lib/elice-content.js +10 -3
  48. package/templates/blank/README.md +27 -2
  49. package/templates/blank/commentary.txt +5 -0
  50. package/templates/blank/screens/edit.js +38 -17
  51. package/templates/blank/screens/instructor.js +20 -8
  52. package/templates/blank/screens/learn.js +151 -13
  53. package/templates/blank/styles.css +171 -0
  54. package/templates/blank/template.json +2 -2
  55. package/templates/quiz/core/model.js +1 -1
  56. package/templates/quiz/screens/edit.js +14 -2
  57. package/templates/quiz/styles.css +11 -0
  58. package/templates/quiz/template.json +1 -1
  59. package/templates/quiz/ui/texts.js +1 -1
@@ -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;