@simplysm/sd-claude 14.0.47 → 14.0.49

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 (130) hide show
  1. package/{claude/references/sd-simplysm14/sd-claude/usage.md → README.md} +2 -2
  2. package/claude/rules/sd-claude-rules.md +25 -10
  3. package/claude/rules/sd-options.md +11 -6
  4. package/claude/sd-subagent-start.sh +6 -0
  5. package/claude/settings.json +1 -12
  6. package/claude/skills/sd-check/SKILL.md +43 -12
  7. package/claude/skills/sd-claude-docs/SKILL.md +30 -58
  8. package/claude/skills/sd-claude-docs/references/package-claudemd.md +12 -0
  9. package/claude/skills/sd-claude-docs/references/package-doc-gen.md +26 -13
  10. package/claude/skills/sd-commit/SKILL.md +1 -1
  11. package/claude/skills/sd-debug/SKILL.md +5 -3
  12. package/claude/skills/sd-deliverable/SKILL.md +1 -1
  13. package/claude/skills/sd-dev/SKILL.md +14 -9
  14. package/claude/skills/sd-doc-extract/SKILL.md +8 -10
  15. package/claude/skills/sd-doc-extract/_common.py +8 -1
  16. package/claude/skills/sd-doc-extract/_extract_docx.py +74 -34
  17. package/claude/skills/sd-doc-extract/_extract_pdf.py +12 -1
  18. package/claude/skills/sd-doc-extract/_extract_pptx.py +103 -23
  19. package/claude/skills/sd-doc-extract/_extract_xlsb.py +93 -4
  20. package/claude/skills/sd-doc-extract/_extract_xlsx.py +98 -36
  21. package/claude/skills/sd-doc-extract/extract.py +22 -3
  22. package/claude/skills/sd-inner-clarify/SKILL.md +78 -0
  23. package/claude/skills/sd-inner-debug/SKILL.md +1 -1
  24. package/claude/skills/sd-inner-review/SKILL.md +13 -0
  25. package/claude/skills/sd-issue/SKILL.md +1 -1
  26. package/claude/skills/sd-outlook/SKILL.md +1 -1
  27. package/claude/skills/sd-plan/SKILL.md +50 -17
  28. package/claude/skills/sd-prompt/SKILL.md +180 -178
  29. package/claude/skills/sd-prompt/references/eval-runner.md +5 -30
  30. package/claude/skills/sd-prompt/references/sd-eval-env-template.md +23 -0
  31. package/claude/skills/sd-refactor/SKILL.md +2 -2
  32. package/claude/skills/sd-tdd/SKILL.md +45 -16
  33. package/claude/skills/sd-use/SKILL.md +84 -80
  34. package/claude/skills/sd-wbs/SKILL.md +84 -27
  35. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/assets.md +2 -3
  36. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/hooks.md +7 -6
  37. package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/scripts.md +1 -9
  38. package/package.json +3 -2
  39. package/scripts/sync.mjs +4 -2
  40. package/claude/references/sd-simplysm14/angular/docs/bootstrap.md +0 -48
  41. package/claude/references/sd-simplysm14/angular/docs/directives.md +0 -236
  42. package/claude/references/sd-simplysm14/angular/docs/features.md +0 -379
  43. package/claude/references/sd-simplysm14/angular/docs/pipes.md +0 -32
  44. package/claude/references/sd-simplysm14/angular/docs/plugins.md +0 -37
  45. package/claude/references/sd-simplysm14/angular/docs/provider-types.md +0 -283
  46. package/claude/references/sd-simplysm14/angular/docs/providers.md +0 -379
  47. package/claude/references/sd-simplysm14/angular/docs/styling.md +0 -222
  48. package/claude/references/sd-simplysm14/angular/docs/type-utilities.md +0 -250
  49. package/claude/references/sd-simplysm14/angular/docs/ui-data.md +0 -275
  50. package/claude/references/sd-simplysm14/angular/docs/ui-form.md +0 -490
  51. package/claude/references/sd-simplysm14/angular/docs/ui-layout.md +0 -140
  52. package/claude/references/sd-simplysm14/angular/docs/ui-navigation.md +0 -273
  53. package/claude/references/sd-simplysm14/angular/docs/ui-overlay.md +0 -157
  54. package/claude/references/sd-simplysm14/angular/docs/ui-visual.md +0 -127
  55. package/claude/references/sd-simplysm14/angular/docs/utils.md +0 -295
  56. package/claude/references/sd-simplysm14/angular/usage.md +0 -489
  57. package/claude/references/sd-simplysm14/capacitor-plugin-auto-update/usage.md +0 -182
  58. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/file-operations.md +0 -154
  59. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/permissions.md +0 -84
  60. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/storage-paths.md +0 -107
  61. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/docs/types.md +0 -83
  62. package/claude/references/sd-simplysm14/capacitor-plugin-file-system/usage.md +0 -133
  63. package/claude/references/sd-simplysm14/capacitor-plugin-intent/usage.md +0 -203
  64. package/claude/references/sd-simplysm14/capacitor-plugin-usb-storage/usage.md +0 -258
  65. package/claude/references/sd-simplysm14/core-browser/usage.md +0 -306
  66. package/claude/references/sd-simplysm14/core-common/docs/errors.md +0 -82
  67. package/claude/references/sd-simplysm14/core-common/docs/extensions.md +0 -167
  68. package/claude/references/sd-simplysm14/core-common/docs/features.md +0 -136
  69. package/claude/references/sd-simplysm14/core-common/docs/types.md +0 -245
  70. package/claude/references/sd-simplysm14/core-common/docs/utils.md +0 -591
  71. package/claude/references/sd-simplysm14/core-common/usage.md +0 -255
  72. package/claude/references/sd-simplysm14/core-node/docs/child-process.md +0 -182
  73. package/claude/references/sd-simplysm14/core-node/docs/features.md +0 -214
  74. package/claude/references/sd-simplysm14/core-node/docs/file-system.md +0 -509
  75. package/claude/references/sd-simplysm14/core-node/docs/file-watching.md +0 -139
  76. package/claude/references/sd-simplysm14/core-node/docs/logging.md +0 -180
  77. package/claude/references/sd-simplysm14/core-node/docs/path.md +0 -176
  78. package/claude/references/sd-simplysm14/core-node/docs/utilities-cpx.md +0 -194
  79. package/claude/references/sd-simplysm14/core-node/docs/utilities-fsx.md +0 -469
  80. package/claude/references/sd-simplysm14/core-node/docs/utilities-pathx.md +0 -151
  81. package/claude/references/sd-simplysm14/core-node/docs/worker-threads.md +0 -334
  82. package/claude/references/sd-simplysm14/core-node/docs/worker.md +0 -205
  83. package/claude/references/sd-simplysm14/core-node/usage.md +0 -259
  84. package/claude/references/sd-simplysm14/excel/docs/core-classes.md +0 -453
  85. package/claude/references/sd-simplysm14/excel/docs/types.md +0 -459
  86. package/claude/references/sd-simplysm14/excel/docs/utilities.md +0 -194
  87. package/claude/references/sd-simplysm14/excel/docs/wrapper.md +0 -73
  88. package/claude/references/sd-simplysm14/excel/usage.md +0 -134
  89. package/claude/references/sd-simplysm14/lint/usage.md +0 -130
  90. package/claude/references/sd-simplysm14/orm-common/docs/core.md +0 -188
  91. package/claude/references/sd-simplysm14/orm-common/docs/expression.md +0 -190
  92. package/claude/references/sd-simplysm14/orm-common/docs/models.md +0 -17
  93. package/claude/references/sd-simplysm14/orm-common/docs/query-builder.md +0 -97
  94. package/claude/references/sd-simplysm14/orm-common/docs/queryable-executable.md +0 -250
  95. package/claude/references/sd-simplysm14/orm-common/docs/schema-builders.md +0 -364
  96. package/claude/references/sd-simplysm14/orm-common/docs/types.md +0 -522
  97. package/claude/references/sd-simplysm14/orm-common/usage.md +0 -229
  98. package/claude/references/sd-simplysm14/orm-node/docs/connections.md +0 -137
  99. package/claude/references/sd-simplysm14/orm-node/docs/core.md +0 -131
  100. package/claude/references/sd-simplysm14/orm-node/docs/types.md +0 -173
  101. package/claude/references/sd-simplysm14/orm-node/usage.md +0 -143
  102. package/claude/references/sd-simplysm14/sd-cli/usage.md +0 -782
  103. package/claude/references/sd-simplysm14/service-client/docs/features.md +0 -217
  104. package/claude/references/sd-simplysm14/service-client/docs/main.md +0 -148
  105. package/claude/references/sd-simplysm14/service-client/docs/protocol.md +0 -53
  106. package/claude/references/sd-simplysm14/service-client/docs/transport.md +0 -131
  107. package/claude/references/sd-simplysm14/service-client/docs/types.md +0 -129
  108. package/claude/references/sd-simplysm14/service-client/usage.md +0 -202
  109. package/claude/references/sd-simplysm14/service-common/docs/app-structure.md +0 -175
  110. package/claude/references/sd-simplysm14/service-common/docs/events.md +0 -64
  111. package/claude/references/sd-simplysm14/service-common/docs/protocol.md +0 -331
  112. package/claude/references/sd-simplysm14/service-common/docs/service-types.md +0 -90
  113. package/claude/references/sd-simplysm14/service-common/docs/types.md +0 -19
  114. package/claude/references/sd-simplysm14/service-common/usage.md +0 -154
  115. package/claude/references/sd-simplysm14/service-server/docs/auth.md +0 -64
  116. package/claude/references/sd-simplysm14/service-server/docs/core.md +0 -174
  117. package/claude/references/sd-simplysm14/service-server/docs/legacy.md +0 -25
  118. package/claude/references/sd-simplysm14/service-server/docs/main.md +0 -88
  119. package/claude/references/sd-simplysm14/service-server/docs/protocol.md +0 -33
  120. package/claude/references/sd-simplysm14/service-server/docs/services.md +0 -94
  121. package/claude/references/sd-simplysm14/service-server/docs/transport-http.md +0 -93
  122. package/claude/references/sd-simplysm14/service-server/docs/transport-socket.md +0 -119
  123. package/claude/references/sd-simplysm14/service-server/docs/types.md +0 -36
  124. package/claude/references/sd-simplysm14/service-server/docs/utils.md +0 -22
  125. package/claude/references/sd-simplysm14/service-server/usage.md +0 -171
  126. package/claude/references/sd-simplysm14/storage/usage.md +0 -301
  127. package/claude/references/sd-simplysm14.md +0 -35
  128. package/claude/rules/sd-clarify.md +0 -23
  129. package/claude/sd-session-start.sh +0 -10
  130. /package/{claude/references/sd-simplysm14/sd-claude/docs → docs}/cli.md +0 -0
@@ -1,73 +0,0 @@
1
- # Wrapper
2
-
3
- ## `ExcelWrapper`
4
-
5
- Zod 스키마 기반 타입 안전한 Excel 읽기/쓰기 래퍼. 스키마에서 타입 정보를 추론하여 타입 안전한 읽기/쓰기를 제공한다.
6
-
7
- ```typescript
8
- export class ExcelWrapper<TSchema extends z.ZodObject<z.ZodRawShape>> {
9
- constructor(schema: TSchema);
10
-
11
- async read(
12
- file: Bytes | Blob,
13
- wsNameOrIndex?: string | number,
14
- options?: { excludes?: (keyof z.infer<TSchema>)[] },
15
- ): Promise<z.infer<TSchema>[]>;
16
-
17
- async write(
18
- wsName: string,
19
- records: Partial<z.infer<TSchema>>[],
20
- options?: { excludes?: (keyof z.infer<TSchema>)[] },
21
- ): Promise<ExcelWorkbook>;
22
- }
23
- ```
24
-
25
- ### Constructor
26
-
27
- | Parameter | Type | Description |
28
- |-----------|------|-------------|
29
- | `schema` | `TSchema extends z.ZodObject<z.ZodRawShape>` | Zod 스키마. `.describe()`로 Excel 헤더 이름을 지정한다 |
30
-
31
- ### Methods
32
-
33
- #### `read(file, wsNameOrIndex?, options?)`
34
-
35
- Excel 파일을 레코드 배열로 읽는다. 헤더 행의 텍스트를 스키마의 `.describe()` 값과 매칭하여 필드를 연결한다. Zod 스키마로 유효성 검사를 수행하며, 실패 시 에러를 던진다.
36
-
37
- | Parameter | Type | Description |
38
- |-----------|------|-------------|
39
- | `file` | `Bytes \| Blob` | Excel 파일 데이터 |
40
- | `wsNameOrIndex` | `string \| number` | 워크시트 이름 또는 0 기반 인덱스 (기본값: `0`) |
41
- | `options.excludes` | `(keyof z.infer<TSchema>)[]` | 읽기에서 제외할 필드 키 배열 |
42
-
43
- **반환값:** `z.infer<TSchema>[]` - 스키마 타입으로 추론된 레코드 배열
44
-
45
- **타입 변환 규칙:**
46
-
47
- | 스키마 타입 | 변환 동작 |
48
- |------------|-----------|
49
- | `z.string()` | 문자열로 변환 (`String(rawValue)`) |
50
- | `z.number()` | 숫자로 파싱 (`num.parseFloat`) |
51
- | `z.boolean()` | `"1"`, `"true"` -> `true`, `"0"`, `"false"` -> `false` |
52
- | `z.optional()` / `z.nullable()` | 빈 셀을 `undefined`로 반환 |
53
- | `z.default(value)` | 빈 셀에 기본값 적용 |
54
- | `DateOnly` / `DateTime` / `Time` | `instanceof`로 직접 전달 |
55
-
56
- #### `write(wsName, records, options?)`
57
-
58
- 레코드 배열을 Excel 워크북으로 변환한다. 반환된 `ExcelWorkbook`의 리소스 관리는 호출자의 책임이다. 내부에서 에러 발생 시 워크북이 자동으로 `close()`된다.
59
-
60
- | Parameter | Type | Description |
61
- |-----------|------|-------------|
62
- | `wsName` | `string` | 워크시트 이름 |
63
- | `records` | `Partial<z.infer<TSchema>>[]` | 레코드 배열 |
64
- | `options.excludes` | `(keyof z.infer<TSchema>)[]` | 쓰기에서 제외할 필드 키 배열 |
65
-
66
- **반환값:** `ExcelWorkbook` - 호출자가 `try-finally` 블록에서 `close()`를 호출하여 리소스를 관리해야 한다
67
-
68
- **쓰기 동작:**
69
-
70
- - 첫 번째 행에 헤더 자동 생성 (스키마의 `.describe()` 값 사용)
71
- - 모든 셀에 테두리 스타일 자동 적용
72
- - 필수 비boolean 필드의 헤더에 노란색 배경(`00FFFF00`) 강조
73
- - 확대/축소 85%, 첫 번째 행 틀 고정 자동 설정
@@ -1,134 +0,0 @@
1
- # @simplysm/excel
2
-
3
- Excel 워크북(xlsx) 읽기/쓰기 라이브러리. DOM 의존성이 없어 Node.js와 브라우저 양쪽에서 동작하는 neutral 패키지다. Lazy Loading 아키텍처로 대용량 파일도 메모리 효율적으로 처리한다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/excel
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### Core Classes
14
-
15
- | API | Type | Description |
16
- |-----|------|-------------|
17
- | `ExcelWorkbook` | class | Excel 워크북 진입점. 워크시트 생성/조회, 바이트 내보내기, ZIP 리소스 관리 |
18
- | `ExcelWorksheet` | class | 워크시트. 셀/행/열 접근, 행/셀 복사, 데이터 테이블 읽기, 이미지 삽입, 시트명 변경 |
19
- | `ExcelCell` | class | 개별 셀. 값/수식 읽기/쓰기, 스타일 설정, 셀 병합 |
20
- | `ExcelRow` | class | 워크시트 행. 셀 접근, 행 전체 셀 조회 |
21
- | `ExcelCol` | class | 워크시트 열. 셀 접근, 열 너비 설정 |
22
-
23
- → See [docs/core-classes.md](./docs/core-classes.md) for details.
24
-
25
- ### Wrapper
26
-
27
- | API | Type | Description |
28
- |-----|------|-------------|
29
- | `ExcelWrapper` | class | Zod 스키마 기반 타입 안전한 Excel 읽기/쓰기. 헤더 자동 생성, 유효성 검사, 필수 필드 강조 |
30
-
31
- → See [docs/wrapper.md](./docs/wrapper.md) for details.
32
-
33
- ### Utilities
34
-
35
- | API | Type | Description |
36
- |-----|------|-------------|
37
- | `ExcelUtils` | class | 셀 주소 변환 (좌표↔문자열), 날짜↔숫자 변환, 숫자 형식 매핑 (정적 메서드) |
38
-
39
- → See [docs/utilities.md](./docs/utilities.md) for details.
40
-
41
- ### Types
42
-
43
- | API | Type | Description |
44
- |-----|------|-------------|
45
- | `ExcelValueType` | type | 셀 값 타입: number, string, DateOnly, DateTime, Time, boolean, undefined |
46
- | `ExcelNumberFormat` | type | 숫자 형식 이름: "number", "string", "DateOnly", "DateTime", "Time" |
47
- | `ExcelCellType` | type | 셀 타입: "s"(공유문자열), "b"(boolean), "str"(수식문자열), "n"(숫자), "inlineStr", "e"(에러) |
48
- | `ExcelAddressPoint` | interface | 셀 좌표 (0 기반 r, c) |
49
- | `ExcelAddressRangePoint` | interface | 셀 범위 좌표 (시작점 s, 끝점 e) |
50
- | `ExcelStyleOptions` | interface | 셀 스타일 옵션 (배경색, 테두리, 정렬, 숫자 형식) |
51
- | `ExcelBorderPosition` | type | 테두리 위치: "left", "right", "top", "bottom" |
52
- | `ExcelHorizontalAlign` | type | 가로 정렬: "left", "center", "right" |
53
- | `ExcelVerticalAlign` | type | 세로 정렬: "top", "center", "bottom" |
54
- | `ExcelXml` | interface | XML 처리 클래스가 구현하는 인터페이스 (내부용) |
55
-
56
- → See [docs/types.md](./docs/types.md) for details.
57
-
58
- ## Usage Examples
59
-
60
- ### 새 Excel 파일 생성 및 저장
61
-
62
- ```typescript
63
- import { ExcelWorkbook } from "@simplysm/excel";
64
-
65
- const wb = new ExcelWorkbook();
66
- try {
67
- const ws = await wb.addWorksheet("Sheet1");
68
-
69
- // 헤더 행
70
- await ws.cell(0, 0).setValue("이름");
71
- await ws.cell(0, 1).setValue("나이");
72
-
73
- // 데이터 행
74
- await ws.cell(1, 0).setValue("김철수");
75
- await ws.cell(1, 1).setValue(30);
76
-
77
- const bytes = await wb.toBytes();
78
- // 파일 저장 또는 전송
79
- } finally {
80
- await wb.close();
81
- }
82
- ```
83
-
84
- ### 기존 Excel 파일 읽기
85
-
86
- ```typescript
87
- import { ExcelWorkbook } from "@simplysm/excel";
88
-
89
- const bytes = /* 파일 바이트 배열 */;
90
- const wb = new ExcelWorkbook(bytes);
91
- try {
92
- // 시트명 또는 인덱스(0 기반)로 조회
93
- const ws = await wb.getWorksheet(0);
94
-
95
- // 개별 셀 읽기
96
- const value = await ws.cell(0, 0).getValue();
97
-
98
- // 전체 데이터 테이블 읽기 (첫 행이 헤더)
99
- const table = await ws.getDataTable();
100
- } finally {
101
- await wb.close();
102
- }
103
- ```
104
-
105
- ### Zod 스키마 기반 타입 안전한 작업
106
-
107
- ```typescript
108
- import { ExcelWrapper } from "@simplysm/excel";
109
- import { z } from "zod";
110
-
111
- const schema = z.object({
112
- name: z.string().describe("이름"),
113
- age: z.number().describe("나이"),
114
- email: z.string().optional().describe("이메일"),
115
- });
116
-
117
- const wrapper = new ExcelWrapper(schema);
118
-
119
- // 레코드 배열을 Excel로 쓰기
120
- const records = [
121
- { name: "김철수", age: 30, email: "kim@example.com" },
122
- { name: "이영희", age: 28 },
123
- ];
124
- const wb = await wrapper.write("사람", records);
125
- try {
126
- const bytes = await wb.toBytes();
127
- } finally {
128
- await wb.close();
129
- }
130
-
131
- // Excel 파일을 레코드 배열로 읽기 (유효성 검사 포함)
132
- const bytes = /* 파일 바이트 배열 */;
133
- const data = await wrapper.read(bytes, "사람");
134
- ```
@@ -1,130 +0,0 @@
1
- # @simplysm/lint
2
-
3
- Simplysm 모노레포 전용 ESLint 플러그인 및 공유 Flat Config 설정. 커스텀 규칙 8개와 권장 설정을 제공한다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/lint
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### Plugin (`@simplysm/lint/eslint-plugin`)
14
-
15
- | API | Type | Description |
16
- |-----|------|-------------|
17
- | `default` | object | `{ rules: {...} }` 형태의 ESLint 플러그인 객체. 8개의 커스텀 규칙을 포함한다 |
18
-
19
- #### Rules
20
-
21
- | Rule | Type | Fixable | Description |
22
- |------|------|---------|-------------|
23
- | `no-hard-private` | problem | autofix | ECMAScript `#private` 필드를 금지하고 TypeScript `private _` 스타일을 강제한다. 선언(`#field`, `#method()`, `accessor #field`)과 사용(`this.#field`) 모두 감지. 이름 충돌 시 `nameConflict` 메시지 보고 |
24
- | `no-subpath-imports-from-simplysm` | problem | autofix | `@simplysm/*` 패키지에서 `src` 하위 경로 import를 금지한다. 정적 import, 동적 import, re-export 모두 감지. `@simplysm/pkg/src/...` -> `@simplysm/pkg`로 자동 수정 |
25
- | `ts-no-throw-not-implemented-error` | suggestion | - | `@simplysm/core-common`의 `NotImplementedError` 사용을 경고한다. named import, aliased import, namespace import 모두 감지. 동적 import는 미감지 |
26
- | `ts-no-unused-injects` | problem | autofix | 미사용 Angular `inject()` 필드를 감지하여 제거한다. 클래스 내 `inject()` 호출로 초기화된 프로퍼티 중 다른 곳에서 참조되지 않는 필드를 보고 |
27
- | `ts-no-unused-protected-readonly` | problem | autofix | Angular `@Component` 클래스의 미사용 `protected readonly` 필드를 감지하여 제거한다. 인라인 템플릿과 클래스 본문 모두에서 참조 여부를 확인 |
28
- | `ng-template-no-todo-comments` | problem | - | HTML 템플릿 내 `<!-- TODO: ... -->` 주석을 경고한다. raw text regex 방식으로 동작 |
29
- | `ng-template-no-strict-null-check` | problem | - | Angular 템플릿에서 `=== null`, `!== null`, `=== undefined`, `!== undefined` 사용을 금지한다. `== null` / `!= null`로 통일하도록 강제. autofix 미제공(인라인 템플릿 offset 매핑 문제) |
30
- | `ng-template-sd-require-binding-attrs` | problem | autofix | `sd-*` 컴포넌트에서 허용 목록 외 plain attribute 사용을 금지하고 Angular property binding(`[attr]="..."`)을 강제한다 |
31
-
32
- #### `ng-template-sd-require-binding-attrs` Options
33
-
34
- 유일하게 사용자 옵션을 받는 규칙이다.
35
-
36
- | Field | Type | Default | Description |
37
- |-------|------|---------|-------------|
38
- | `selectorPrefixes` | `string[]` | `["sd-"]` | 검사 대상 엘리먼트의 태그명 접두사 목록 |
39
- | `allowAttributes` | `string[]` | `["id", "class", "style", "title", "tabindex", "role"]` | plain attribute로 허용할 속성명 목록 |
40
- | `allowAttributePrefixes` | `string[]` | `["aria-", "data-", "sd-"]` | plain attribute로 허용할 속성명 접두사 목록 |
41
-
42
- ### Recommended Config (`@simplysm/lint/eslint-recommended`)
43
-
44
- | API | Type | Description |
45
- |-----|------|-------------|
46
- | `default` | `FlatConfig.Config[]` | `tseslint.config()`으로 생성된 Flat Config 배열. 커스텀 플러그인과 외부 플러그인을 조합한 권장 설정 |
47
-
48
- #### Config 블록 구성
49
-
50
- | 파일 패턴 | 적용 플러그인 | 주요 규칙 |
51
- |-----------|-------------|-----------|
52
- | `**/*.js`, `**/*.mjs`, `**/*.cjs` | `@simplysm`, `import`, `unused-imports` | `no-hard-private`, `no-subpath-imports-from-simplysm`, `require-await`, `no-shadow` |
53
- | `**/*.ts` | `@typescript-eslint`, `@simplysm`, `import`, `unused-imports`, `angular-eslint` | 전체 커스텀 규칙 + `require-await`, `strict-boolean-expressions`, `prefer-readonly`, `only-throw-error`, `no-array-delete` 등 |
54
- | `**/*.html` | `@simplysm`, `@angular-eslint/template` (recommended + accessibility) | `ng-template-no-todo-comments`, `ng-template-sd-require-binding-attrs` |
55
- | `**/tests/**/*.ts` | - | `no-console`, `import/no-extraneous-dependencies`, `ts-no-throw-not-implemented-error` 비활성화 |
56
- | `**/vitest.config.ts` | - | `no-restricted-properties` 비활성화 (`process.env` 접근 허용) |
57
-
58
- #### 공유 규칙 변수
59
-
60
- | Variable | Description |
61
- |----------|-------------|
62
- | `commonRules` | `eqeqeq` (`null` 비교만 `==` 허용), `no-warning-comments`, `no-self-compare`, `array-callback-return` |
63
- | `noNodeBuiltinsRules` | `Buffer` 전역 사용 금지, `buffer`/`events`/`eventemitter3` import 금지 |
64
- | `noDirectEnvAccessRules` | `process.env` 및 `import.meta.env` 직접 접근 금지 (`env("...")` 사용 강제), `NODE_ENV` 환경변수 사용 금지 |
65
- | `unusedImportsRules` | 미사용 import 자동 제거 (`_` 접두사 변수 무시) |
66
-
67
- #### Ignores
68
-
69
- `node_modules/`, `dist/`, `.*` (dotfiles), `_*` (underscore-prefixed) 디렉토리를 무시한다.
70
-
71
- ### Utility (internal)
72
-
73
- | API | Type | Description |
74
- |-----|------|-------------|
75
- | `createRule` | const | `ESLintUtils.RuleCreator` 래퍼. 규칙 문서 URL을 자동 생성한다. 패키지 내부에서만 사용되며 entrypoint에서 export되지 않는다 |
76
-
77
- ## Usage Examples
78
-
79
- ### Flat Config에서 권장 설정 사용
80
-
81
- ```typescript
82
- // eslint.config.js
83
- import recommended from "@simplysm/lint/eslint-recommended";
84
-
85
- export default [
86
- ...recommended,
87
- // 프로젝트별 추가 설정
88
- ];
89
- ```
90
-
91
- ### 플러그인만 사용하여 개별 규칙 활성화
92
-
93
- ```typescript
94
- // eslint.config.js
95
- import plugin from "@simplysm/lint/eslint-plugin";
96
-
97
- export default [
98
- {
99
- plugins: {
100
- "@simplysm": plugin,
101
- },
102
- rules: {
103
- "@simplysm/no-hard-private": "error",
104
- "@simplysm/no-subpath-imports-from-simplysm": "error",
105
- },
106
- },
107
- ];
108
- ```
109
-
110
- ### `ng-template-sd-require-binding-attrs` 옵션 커스터마이징
111
-
112
- ```typescript
113
- // eslint.config.js
114
- export default [
115
- ...recommended,
116
- {
117
- files: ["**/*.html"],
118
- rules: {
119
- "@simplysm/ng-template-sd-require-binding-attrs": [
120
- "error",
121
- {
122
- selectorPrefixes: ["sd-", "app-"],
123
- allowAttributes: ["id", "class", "style", "title", "tabindex", "role", "name"],
124
- allowAttributePrefixes: ["aria-", "data-", "sd-", "app-"],
125
- },
126
- ],
127
- },
128
- },
129
- ];
130
- ```
@@ -1,188 +0,0 @@
1
- # Core
2
-
3
- ## `DbContext`
4
-
5
- DB 연결/트랜잭션/DDL/초기화를 제공하는 추상 클래스. `queryable()`/`executable()`로 테이블/프로시저를 등록한다. 각 프로퍼티가 독립 직렬화되어 40+ 테이블에서도 TS7056이 발생하지 않는다.
6
-
7
- ```typescript
8
- export abstract class DbContext implements DbContextBase {
9
- status: DbContextStatus;
10
- migrations: Migration[];
11
-
12
- constructor(
13
- executor: DbContextExecutor,
14
- opt: { database: string; schema?: string },
15
- );
16
-
17
- // 등록 메서드
18
- protected queryable<T extends TableBuilder | ViewBuilder>(builder: T): () => Queryable;
19
- protected executable<T extends ProcedureBuilder>(builder: T): () => Executable;
20
-
21
- // 연결 관리
22
- connect<TResult>(fn: () => Promise<TResult>, isolationLevel?: IsolationLevel): Promise<TResult>;
23
- connectWithoutTransaction<TResult>(callback: () => Promise<TResult>): Promise<TResult>;
24
- transaction<TResult>(fn: () => Promise<TResult>, isolationLevel?: IsolationLevel): Promise<TResult>;
25
-
26
- // DDL 실행 메서드
27
- createTable(table: TableBuilder): Promise<void>;
28
- dropTable(table: QueryDefObjectName): Promise<void>;
29
- renameTable(table: QueryDefObjectName, newName: string): Promise<void>;
30
- createView(view: ViewBuilder): Promise<void>;
31
- dropView(view: QueryDefObjectName): Promise<void>;
32
- createProc(procedure: ProcedureBuilder): Promise<void>;
33
- dropProc(procedure: QueryDefObjectName): Promise<void>;
34
- addColumn(table: QueryDefObjectName, columnName: string, column: ColumnBuilder): Promise<void>;
35
- dropColumn(table: QueryDefObjectName, column: string): Promise<void>;
36
- modifyColumn(table: QueryDefObjectName, columnName: string, column: ColumnBuilder): Promise<void>;
37
- renameColumn(table: QueryDefObjectName, column: string, newName: string): Promise<void>;
38
- addPrimaryKey(table: QueryDefObjectName, columns: string[]): Promise<void>;
39
- dropPrimaryKey(table: QueryDefObjectName): Promise<void>;
40
- addForeignKey(table: QueryDefObjectName, relationName: string, relationDef: ForeignKeyBuilder): Promise<void>;
41
- addIndex(table: QueryDefObjectName, indexBuilder: IndexBuilder): Promise<void>;
42
- dropForeignKey(table: QueryDefObjectName, relationName: string): Promise<void>;
43
- dropIndex(table: QueryDefObjectName, columns: string[]): Promise<void>;
44
- clearSchema(params: { database: string; schema?: string }): Promise<void>;
45
- schemaExists(database: string, schema?: string): Promise<boolean>;
46
- truncate(table: QueryDefObjectName): Promise<void>;
47
- switchFk(table: QueryDefObjectName, enabled: boolean): Promise<void>;
48
-
49
- // DDL QueryDef 생성기 (getCreateTableQueryDef, getDropTableQueryDef, ... 등 동일 시그니처)
50
- getCreateTableQueryDef(table: TableBuilder): QueryDef;
51
- getCreateViewQueryDef(view: ViewBuilder): QueryDef;
52
- getCreateProcQueryDef(procedure: ProcedureBuilder): QueryDef;
53
- getCreateObjectQueryDef(builder: TableBuilder | ViewBuilder | ProcedureBuilder): QueryDef;
54
- getDropTableQueryDef(table: QueryDefObjectName): QueryDef;
55
- getRenameTableQueryDef(table: QueryDefObjectName, newName: string): QueryDef;
56
- getDropViewQueryDef(view: QueryDefObjectName): QueryDef;
57
- getDropProcQueryDef(procedure: QueryDefObjectName): QueryDef;
58
- getAddColumnQueryDef(table: QueryDefObjectName, columnName: string, column: ColumnBuilder): QueryDef;
59
- getDropColumnQueryDef(table: QueryDefObjectName, column: string): QueryDef;
60
- getModifyColumnQueryDef(table: QueryDefObjectName, columnName: string, column: ColumnBuilder): QueryDef;
61
- getRenameColumnQueryDef(table: QueryDefObjectName, column: string, newName: string): QueryDef;
62
- getAddPrimaryKeyQueryDef(table: QueryDefObjectName, columns: string[]): QueryDef;
63
- getDropPrimaryKeyQueryDef(table: QueryDefObjectName): QueryDef;
64
- getAddForeignKeyQueryDef(table: QueryDefObjectName, relationName: string, relationDef: ForeignKeyBuilder): QueryDef;
65
- getAddIndexQueryDef(table: QueryDefObjectName, indexBuilder: IndexBuilder): QueryDef;
66
- getDropForeignKeyQueryDef(table: QueryDefObjectName, relationName: string): QueryDef;
67
- getDropIndexQueryDef(table: QueryDefObjectName, columns: string[]): QueryDef;
68
- getClearSchemaQueryDef(params: { database: string; schema?: string }): QueryDef;
69
- getSchemaExistsQueryDef(database: string, schema?: string): QueryDef;
70
- getTruncateQueryDef(table: QueryDefObjectName): QueryDef;
71
- getSwitchFkQueryDef(table: QueryDefObjectName, enabled: boolean): QueryDef;
72
-
73
- // 초기화
74
- initialize(options?: { dbs?: string[]; force?: boolean }): Promise<boolean>;
75
-
76
- // DbContextBase 구현
77
- get database(): string | undefined;
78
- get schema(): string | undefined;
79
- getNextAlias(): string;
80
- resetAliasCounter(): void;
81
- executeDefs<T>(defs: QueryDef[], resultMetas?: (ResultMeta | undefined)[]): Promise<T[][]>;
82
- getQueryDefObjectName(tableOrView: TableBuilder | ViewBuilder): QueryDefObjectName;
83
- }
84
- ```
85
-
86
- ### 연결/트랜잭션 패턴
87
-
88
- | 메서드 | 용도 |
89
- |--------|------|
90
- | `connect(fn)` | 연결 -> 트랜잭션 시작 -> fn -> 커밋 -> 종료. 일반 DML 작업에 사용 |
91
- | `connectWithoutTransaction(fn)` | 연결 -> fn -> 종료. 트랜잭션 없는 DDL/읽기 전용 작업에 사용 |
92
- | `transaction(fn)` | 이미 연결된 상태에서 부분 트랜잭션 시작. `connectWithoutTransaction` 내부에서 사용 |
93
-
94
- - `connect()`/`connectWithoutTransaction()`은 status가 `"ready"`가 아니면 에러를 던진다 (재진입 방지).
95
- - 트랜잭션 중 DDL 실행은 런타임 에러를 발생시킨다.
96
- - 롤백 실패 시 원래 에러의 `cause`에 롤백 에러를 첨부하여 전파한다.
97
-
98
- ## `SD_BUILDER`
99
-
100
- DbContext의 queryable/executable 프로퍼티에 부착된 builder 참조용 Symbol.
101
-
102
- ```typescript
103
- export const SD_BUILDER: unique symbol;
104
- ```
105
-
106
- ## `DbContextBase`
107
-
108
- Queryable, Executable, ViewBuilder에서 사용하는 DbContext 내부 인터페이스. DbContext class가 이 인터페이스를 구현한다.
109
-
110
- ```typescript
111
- export interface DbContextBase {
112
- status: DbContextStatus;
113
- readonly database: string | undefined;
114
- readonly schema: string | undefined;
115
- getNextAlias(): string;
116
- resetAliasCounter(): void;
117
- executeDefs<T = DataRecord>(defs: QueryDef[], resultMetas?: (ResultMeta | undefined)[]): Promise<T[][]>;
118
- getQueryDefObjectName(tableOrView: TableBuilder | ViewBuilder): QueryDefObjectName;
119
- switchFk(table: QueryDefObjectName, enabled: boolean): Promise<void>;
120
- }
121
- ```
122
-
123
- | Field | Type | Description |
124
- |-------|------|-------------|
125
- | `status` | `DbContextStatus` | 현재 연결 상태 |
126
- | `database` | `string \| undefined` | 데이터베이스 이름 |
127
- | `schema` | `string \| undefined` | 스키마 이름 |
128
-
129
- ## `DbContextStatus`
130
-
131
- DbContext 상태를 나타내는 문자열 리터럴 유니온.
132
-
133
- ```typescript
134
- export type DbContextStatus = "ready" | "connect" | "transact";
135
- ```
136
-
137
- ## `DbContextDdlMethods`
138
-
139
- DDL 실행 메서드 인터페이스. DbContext에서 사용하는 모든 DDL 메서드 시그니처를 정의한다. DDL 실행 메서드와 DDL QueryDef 생성 메서드를 모두 포함한다.
140
-
141
- ```typescript
142
- export interface DbContextDdlMethods {
143
- createTable(table: TableBuilder): Promise<void>;
144
- dropTable(table: QueryDefObjectName): Promise<void>;
145
- // ... (DbContext의 DDL 메서드와 동일한 시그니처)
146
- }
147
- ```
148
-
149
- ## `DbErrorCode`
150
-
151
- 트랜잭션 관련 에러 코드. DBMS별 네이티브 에러 코드를 추상화한다.
152
-
153
- ```typescript
154
- export enum DbErrorCode {
155
- NO_ACTIVE_TRANSACTION = "NO_ACTIVE_TRANSACTION",
156
- TRANSACTION_ALREADY_STARTED = "TRANSACTION_ALREADY_STARTED",
157
- DEADLOCK = "DEADLOCK",
158
- LOCK_TIMEOUT = "LOCK_TIMEOUT",
159
- }
160
- ```
161
-
162
- | Value | Description |
163
- |-------|-------------|
164
- | `NO_ACTIVE_TRANSACTION` | 활성 트랜잭션 없음 (ROLLBACK 시) |
165
- | `TRANSACTION_ALREADY_STARTED` | 트랜잭션 이미 시작됨 |
166
- | `DEADLOCK` | 데드락 발생 |
167
- | `LOCK_TIMEOUT` | 잠금 타임아웃 |
168
-
169
- ## `DbTransactionError`
170
-
171
- DBMS별 네이티브 에러를 표준화된 에러 코드로 래핑하는 에러 클래스.
172
-
173
- ```typescript
174
- export class DbTransactionError extends Error {
175
- override readonly name = "DbTransactionError";
176
-
177
- constructor(
178
- public readonly code: DbErrorCode,
179
- message: string,
180
- public readonly originalError?: unknown,
181
- );
182
- }
183
- ```
184
-
185
- | Field | Type | Description |
186
- |-------|------|-------------|
187
- | `code` | `DbErrorCode` | 표준화된 에러 코드 |
188
- | `originalError` | `unknown \| undefined` | 원본 DBMS 에러 (디버깅용) |