@simplysm/sd-claude 14.0.98 → 14.0.99

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 (77) hide show
  1. package/claude/references/sd-simplysm14/README.md +16 -16
  2. package/claude/references/sd-simplysm14/apis/angular/README.md +81 -153
  3. package/claude/references/sd-simplysm14/apis/angular/controls.md +179 -205
  4. package/claude/references/sd-simplysm14/apis/angular/crud.md +71 -57
  5. package/claude/references/sd-simplysm14/apis/angular/directives.md +49 -109
  6. package/claude/references/sd-simplysm14/apis/angular/features.md +58 -86
  7. package/claude/references/sd-simplysm14/apis/angular/kanban.md +32 -40
  8. package/claude/references/sd-simplysm14/apis/angular/layout.md +38 -52
  9. package/claude/references/sd-simplysm14/apis/angular/overlay.md +86 -110
  10. package/claude/references/sd-simplysm14/apis/angular/routing-appstructure.md +54 -86
  11. package/claude/references/sd-simplysm14/apis/angular/shared-data.md +82 -74
  12. package/claude/references/sd-simplysm14/apis/angular/sheet.md +56 -80
  13. package/claude/references/sd-simplysm14/apis/capacitor-plugin-auto-update/README.md +15 -15
  14. package/claude/references/sd-simplysm14/apis/capacitor-plugin-file-system/README.md +21 -21
  15. package/claude/references/sd-simplysm14/apis/capacitor-plugin-intent/README.md +79 -53
  16. package/claude/references/sd-simplysm14/apis/capacitor-plugin-usb-storage/README.md +9 -11
  17. package/claude/references/sd-simplysm14/apis/core-browser/README.md +15 -15
  18. package/claude/references/sd-simplysm14/apis/core-browser/dom-element.md +20 -20
  19. package/claude/references/sd-simplysm14/apis/core-browser/indexed-db.md +18 -18
  20. package/claude/references/sd-simplysm14/apis/core-common/README.md +20 -49
  21. package/claude/references/sd-simplysm14/apis/core-common/async-runtime.md +66 -55
  22. package/claude/references/sd-simplysm14/apis/core-common/collection-ext.md +83 -56
  23. package/claude/references/sd-simplysm14/apis/core-common/errors.md +32 -21
  24. package/claude/references/sd-simplysm14/apis/core-common/obj.md +57 -39
  25. package/claude/references/sd-simplysm14/apis/core-common/serialization.md +36 -30
  26. package/claude/references/sd-simplysm14/apis/core-common/value-types.md +69 -41
  27. package/claude/references/sd-simplysm14/apis/core-node/README.md +4 -4
  28. package/claude/references/sd-simplysm14/apis/core-node/consola.md +15 -13
  29. package/claude/references/sd-simplysm14/apis/core-node/cpx.md +11 -7
  30. package/claude/references/sd-simplysm14/apis/core-node/fs-watcher.md +8 -8
  31. package/claude/references/sd-simplysm14/apis/core-node/fsx.md +29 -20
  32. package/claude/references/sd-simplysm14/apis/core-node/pathx.md +14 -6
  33. package/claude/references/sd-simplysm14/apis/core-node/worker.md +3 -3
  34. package/claude/references/sd-simplysm14/apis/excel/README.md +3 -3
  35. package/claude/references/sd-simplysm14/apis/excel/cell.md +32 -32
  36. package/claude/references/sd-simplysm14/apis/excel/conditional-format.md +23 -24
  37. package/claude/references/sd-simplysm14/apis/excel/style.md +24 -30
  38. package/claude/references/sd-simplysm14/apis/excel/utils.md +20 -23
  39. package/claude/references/sd-simplysm14/apis/excel/workbook-worksheet.md +60 -71
  40. package/claude/references/sd-simplysm14/apis/excel/wrapper.md +36 -36
  41. package/claude/references/sd-simplysm14/apis/lint/README.md +7 -9
  42. package/claude/references/sd-simplysm14/apis/lint/recommended.md +59 -37
  43. package/claude/references/sd-simplysm14/apis/lint/rules.md +81 -74
  44. package/claude/references/sd-simplysm14/apis/orm-common/README.md +6 -6
  45. package/claude/references/sd-simplysm14/apis/orm-common/db-context.md +112 -78
  46. package/claude/references/sd-simplysm14/apis/orm-common/expr.md +131 -75
  47. package/claude/references/sd-simplysm14/apis/orm-common/queryable.md +126 -82
  48. package/claude/references/sd-simplysm14/apis/orm-common/schema.md +170 -113
  49. package/claude/references/sd-simplysm14/apis/orm-common/types.md +102 -48
  50. package/claude/references/sd-simplysm14/apis/orm-node/README.md +12 -13
  51. package/claude/references/sd-simplysm14/apis/orm-node/db-conn.md +3 -3
  52. package/claude/references/sd-simplysm14/apis/sd-cli/README.md +5 -5
  53. package/claude/references/sd-simplysm14/apis/sd-cli/SdTsCompiler.md +67 -65
  54. package/claude/references/sd-simplysm14/apis/sd-cli/sd-config-types.md +130 -123
  55. package/claude/references/sd-simplysm14/apis/service-client/README.md +63 -63
  56. package/claude/references/sd-simplysm14/apis/service-client/orm.md +22 -22
  57. package/claude/references/sd-simplysm14/apis/service-client/transport.md +30 -26
  58. package/claude/references/sd-simplysm14/apis/service-common/README.md +8 -8
  59. package/claude/references/sd-simplysm14/apis/service-common/app-structure.md +13 -6
  60. package/claude/references/sd-simplysm14/apis/service-common/protocol.md +1 -1
  61. package/claude/references/sd-simplysm14/apis/service-server/README.md +43 -47
  62. package/claude/references/sd-simplysm14/apis/service-server/built-in-services.md +35 -0
  63. package/claude/references/sd-simplysm14/apis/service-server/service-authoring.md +20 -19
  64. package/claude/references/sd-simplysm14/apis/service-server/transport-internals.md +23 -25
  65. package/claude/references/sd-simplysm14/apis/service-server/v1-legacy.md +9 -9
  66. package/claude/references/sd-simplysm14/apis/storage/README.md +26 -26
  67. package/claude/references/sd-simplysm14/manuals/client-component.md +9 -1
  68. package/claude/references/sd-simplysm14/manuals/client-crud.md +1 -1
  69. package/claude/references/sd-simplysm14/manuals/client-orm.md +1 -0
  70. package/claude/references/sd-simplysm14/manuals/client-service.md +1 -0
  71. package/claude/references/sd-simplysm14/manuals/client-shared-data.md +1 -0
  72. package/claude/references/sd-simplysm14/manuals/client-ssg.md +1 -0
  73. package/claude/sd-system-prompt.md +11 -26
  74. package/claude/skills/sd-docs/references/subagent-prompt.md +4 -3
  75. package/claude/skills/sd-spec/SKILL.md +87 -18
  76. package/claude/skills/sd-spec/references/format.md +2 -2
  77. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  # @simplysm/orm-node — 저수준 DB 연결
2
2
 
3
- `createOrm` 추상화를 거치지 않고 raw SQL·파라미터 쿼리·bulk insert·수동 트랜잭션을 직접 다루거나, dialect별 접속 설정 타입을 작성하거나, `DbContext` executor 를 손수 조립할 때 함께 읽히는 묶음. 연결 인스턴스 생성·연결 인터페이스·접속 설정·executor·dialect 헬퍼·상수로 구성.
3
+ `createOrm` 추상화를 거치지 않고 raw SQL·파라미터 쿼리·bulk insert·수동 트랜잭션을 직접 다루거나, dialect별 접속 설정 타입을 작성하거나, `DbContext` executor 를 손수 조립할 때 함께 읽히는 묶음. 연결 인스턴스 생성·연결 인터페이스·접속 설정·executor·dialect 헬퍼·상수로 구성.
4
4
 
5
5
  ## createDbConn
6
6
 
@@ -8,7 +8,7 @@
8
8
  function createDbConn(config: DbConnConfig): Promise<DbConn>
9
9
  ```
10
10
 
11
- `config.dialect` 에 맞는 드라이버를 **지연 import** 해 연결 인스턴스를 만든다(mysql → `mysql2/promise`, postgresql → `pg` + `pg-copy-streams`, mssql/mssql-azure → `tedious`). 한 번 로드한 드라이버는 모듈 캐시에 보관해 재사용. 반환 객체는 아직 **미연결** 상태이므로 `connect()` 를 별도 호출해야 함.
11
+ `config.dialect` 에 맞는 드라이버를 **지연 import** 해 연결 인스턴스를 생성(mysql → `mysql2/promise`, postgresql → `pg` + `pg-copy-streams`, mssql/mssql-azure → `tedious`). 한 번 로드한 드라이버는 모듈 캐시에 보관해 재사용. 반환 객체는 아직 **미연결** 상태이므로 `connect()` 를 별도로 호출해야 함.
12
12
 
13
13
  ```typescript
14
14
  const conn = await createDbConn({ dialect: "postgresql", host: "localhost", username: "u", password: "p", database: "db" });
@@ -23,7 +23,7 @@ await conn.connect();
23
23
  - isConnected: boolean — 현재 연결 여부. `connect` 성공 시 `true`, `close`/드라이버 `end` 이벤트 시 `false`. 재연결 판단·정리 분기에 사용.
24
24
  - isInTransaction: boolean — 트랜잭션 진행 여부. `beginTransaction` 후 `true`, 커밋·롤백 후 `false`. 중첩 방지·상태 확인에 사용.
25
25
  - connect(): Promise\<void\> — 연결 수립. 이미 연결돼 있으면 `DB_CONN_ERRORS.ALREADY_CONNECTED` throw.
26
- - close(): Promise\<void\> — 연결 종료. 미연결 상태면 아무 동작 없이 반환(throw 안 함). 재호출 안전.
26
+ - close(): Promise\<void\> — 연결 종료. 미연결 상태면 아무 동작 없이 반환(throw 안 함) 재호출 안전.
27
27
  - beginTransaction(isolationLevel?: IsolationLevel): Promise\<void\> — 트랜잭션 시작. `isolationLevel` 미지정 시 `config.defaultIsolationLevel`, 그것도 없으면 `READ_UNCOMMITTED` 로 시작. 테스트로 확인된 값: `"READ_UNCOMMITTED" | "READ_COMMITTED" | "REPEATABLE_READ" | "SERIALIZABLE"`. 더티 리드 차단이 필요하면 `READ_COMMITTED` 이상.
28
28
  - commitTransaction(): Promise\<void\> — 진행 중 트랜잭션 커밋, `isInTransaction` 을 `false` 로.
29
29
  - rollbackTransaction(): Promise\<void\> — 진행 중 트랜잭션 롤백, `isInTransaction` 을 `false` 로.
@@ -1,11 +1,11 @@
1
1
  # @simplysm/sd-cli
2
2
 
3
- simplysm 모노레포의 빌드/배포 오케스트레이터 CLI. entry(`src/index.ts`)가 외부로 노출하는 건 CLI 실행 코드가 아니라 세 묶음뿐 — ① `sd.config.ts` 작성용 설정 타입군, ② 패키지 단위 TypeScript/Angular AOT 증분 컴파일러 `SdTsCompiler` 와 옵션·결과 타입, ③ Vitest 전용 Angular Vite 플러그인 `sdAngularPlugin`.
3
+ simplysm 모노레포의 빌드/배포 오케스트레이터 CLI. 라이브러리 entry(`src/index.ts`)가 노출하는 건 CLI 실행 코드가 아니라 세 묶음 — ① `sd.config.ts` 작성용 설정 타입군(`export *`), ② 패키지 단위 TypeScript/Angular AOT 증분 컴파일러 `SdTsCompiler` 와 옵션·결과 타입, ③ Vitest 전용 Angular Vite 플러그인 `sdAngularPlugin`. CLI 서브커맨드 내부 구현은 entry 에서 노출되지 않아 문서 대상이 아니다.
4
4
 
5
5
  ## 사용 트리거 인덱스
6
6
 
7
- - **sd.config.ts 설정 타입** — 프로젝트 루트 `sd.config.ts` 를 작성·수정하며 패키지별 빌드 타겟(`node`/`browser`/`neutral`/`client`/`server`/`scripts`), 배포(npm/로컬/FTP)·Capacitor/Electron/PWA·서버 옵션·의존성 교체를 지정할 때. 자세히: [sd-config-types.md](./sd-config-types.md)
8
- - **SdTsCompiler / ISdTsCompilerOptions / ISdTsCompilerResult / ISdTsCompilerEmitOptions** — sd-cli 외부에서 패키지 1개의 TS(또는 Angular AOT) 증분 컴파일을 직접 구동하거나 그 결과(emit·진단·lint·SCSS)를 다룰 때. 자세히: [SdTsCompiler.md](./SdTsCompiler.md)
7
+ - **sd.config.ts 설정 타입** (`SdConfigFn`·`SdConfig`·`SdConfigParams`·`SdPackageConfig` 와 그 하위 타겟·배포·Capacitor·Electron·PWA 설정) — 프로젝트 루트 `sd.config.ts` 를 작성·수정하며 패키지별 빌드 타겟·배포·앱 패키징·의존성 교체를 지정할 때. 자세히: [sd-config-types.md](./sd-config-types.md)
8
+ - **SdTsCompiler / ISdTsCompilerOptions / ISdTsCompilerResult** — sd-cli 외부에서 패키지 1개의 TS(또는 Angular AOT) 증분 컴파일을 직접 구동하거나 그 결과(emit·진단·lint·SCSS)를 다룰 때. 자세히: [SdTsCompiler.md](./SdTsCompiler.md)
9
9
  - **sdAngularPlugin / SdAngularPluginOptions** — Vitest 에서 Angular 패키지의 `.ts` 를 AOT 컴파일해 주입하는 Vite 플러그인을 설정할 때. 아래 인라인 섹션 참조.
10
10
 
11
11
  ## sdAngularPlugin
@@ -18,9 +18,9 @@ interface SdAngularPluginOptions {
18
18
  }
19
19
  ```
20
20
 
21
- Angular AOT 컴파일을 수행하는 **Vitest 전용** Vite 플러그인. 내부에서 `SdTsCompiler` 로 대상 패키지의 `.ts`(tests 포함 — `includeTests: true`, `output: { js: true, dts: false }`)를 AOT 컴파일하고, Vite `transform` 훅에서 컴파일된 JS 를 반환한다. `enforce: "pre"` 다른 transform 보다 먼저 동작하며, 컴파일러가 emit 한 인라인 base64 소스맵을 분리해 Vite 호환 형태(`{ code, map }`)로 넘긴다. `compilerOptionsTransformer` 로 `noEmit:false`·`declaration:false`·`inlineSourceMap:true`·`rootDir = cwd` 를 강제하고, `buildEnd` 마다 내부 컴파일러를 폐기해 다음 watch 재빌드 시 재생성하며, `watchChange` 로 모은 변경 파일을 `buildStart` 의 증분 캐시 무효화에 쓴다.
21
+ Angular AOT 컴파일을 수행하는 **Vitest 전용** Vite 플러그인(`name: "sd-angular"`, `enforce: "pre"`). 내부에서 `SdTsCompiler` 로 대상 패키지의 `.ts`(tests 포함 — `includeTests: true`, `output: { js: true, dts: false }`)를 AOT 컴파일하고, Vite `transform` 훅에서 컴파일된 JS 를 반환한다. `enforce: "pre"` 다른 transform 보다 먼저 동작하며, 컴파일러가 emit 한 인라인 base64 소스맵을 분리해 Vite 호환 형태(`{ code, map }`)로 넘긴다. `compilerOptionsTransformer` 로 `noEmit:false`·`declaration:false`·`sourceMap:false`·`inlineSourceMap:true`·`rootDir = process.cwd()` 를 강제한다. `buildEnd` 마다 내부 컴파일러를 폐기(`undefined`)해 다음 watch 재빌드 시 재생성하고, `watchChange` 로 모은 변경 파일을 `buildStart` 의 증분 캐시 무효화에 쓴다.
22
22
 
23
- - **pkg**: string — 컴파일 대상 패키지 디렉토리명. `sd.config.ts` 의 `packages` 키(`@simplysm/` 접두사 제외한 짧은 이름, 예: `"angular"`)와 동일. 플러그인은 `process.cwd()/packages/<pkg>` 를 컴파일 루트로 잡으므로, 테스트하려는 Angular 패키지명을 그대로 넣는다.
23
+ - **pkg**: string — 컴파일 대상 패키지 디렉토리명. `sd.config.ts` 의 `packages` 키(`@simplysm/` 접두사 제외한 짧은 이름, 예: `"angular"`)와 동일. 플러그인은 `process.cwd()/packages/<pkg>` 를 컴파일 루트로 잡으므로 테스트하려는 Angular 패키지명을 그대로 넣는다. `config()` 훅 전에 `buildStart` 가 불리면 에러.
24
24
 
25
25
  ```typescript
26
26
  // vitest.config.ts
@@ -1,43 +1,64 @@
1
1
  # @simplysm/sd-cli — SdTsCompiler
2
2
 
3
- 패키지 디렉토리 1개의 `.ts` 를 TypeScript 또는 Angular AOT 로 **증분** 컴파일하는 클래스. 한 번의 `compileAsync` 호출로 직렬화된 진단 + emit 결과 + lint + SCSS 결과를 한 묶음(`ISdTsCompilerResult`)으로 반환한다. tsconfig 의 `angularCompilerOptions` 존재 여부로 Angular/일반 모드를 자동 판별. 빌드 엔진과 `sdAngularPlugin` 내부에서 사용. 진단은 worker 경계를 통과하도록 `SerializedDiagnostic` 으로 직렬화되며, 내부 크래시는 단계별로 잡아 진단으로 보고(부분 복구)한다.
3
+ 패키지 디렉토리 1개의 `.ts` 를 TypeScript 또는 Angular AOT 로 **증분** 컴파일하는 클래스. 한 번의 `compileAsync` 호출이 직렬화된 진단 + emit 결과 + lint + SCSS 결과를 한 묶음(`ISdTsCompilerResult`)으로 반환한다. tsconfig 의 `angularCompilerOptions` 존재 여부로 Angular/일반 모드를 자동 판별한다. 진단은 worker 경계를 통과하도록 `SerializedDiagnostic` 으로 직렬화되며, 내부 크래시는 단계별로 잡아 진단으로 보고(부분 복구)한다.
4
4
 
5
- ## ISdTsCompilerOptions (생성자 인자)
5
+ ## 생성자 / ISdTsCompilerOptions
6
6
 
7
7
  ```typescript
8
+ class SdTsCompiler {
9
+ constructor(options: ISdTsCompilerOptions);
10
+ }
11
+
8
12
  interface ISdTsCompilerOptions {
9
13
  pkgDir: string;
10
14
  cwd: string;
11
15
  output: { js: boolean; dts: boolean };
12
16
  includeTests?: boolean;
13
- env?: TypecheckEnv;
17
+ env?: TypecheckEnv; // "node" | "browser"
18
+
14
19
  // Angular 전용 (isForAngular 시 활성)
15
20
  sourceFileCache?: AngularSourceFileCache;
16
21
  transformStylesheet?: (data: string, containingFile: string, stylesheetFile?: string) => Promise<string | null>;
17
22
  externalStylesheets?: Map<string, string>;
18
23
  compilerOptionsTransformer?: (options: ts.CompilerOptions) => ts.CompilerOptions;
19
- // SCSS/lint 통합
24
+
25
+ // SCSS / lint 통합
20
26
  lint?: boolean;
21
27
  globalScss?: boolean;
22
28
  }
23
29
  ```
24
30
 
25
- - pkgDir: string — 컴파일 대상 패키지 디렉토리. `<pkgDir>/tsconfig.json` 파싱하고 `<pkgDir>/dist` emit, `<pkgDir>/.cache` 에 tsbuildinfo 를 둔다.
26
- - cwd: string — 워크스페이스 루트. 진단 필터링(`isWorkspaceDiagnostic`)·경로 상대화·에러 포맷 기준점.
27
- - output.js: boolean — JS emit 여부. true `.js` 산출(non-Angular import `.js` 확장자 부착 + 경로 재작성, Angular `emitResults` 로 반환).
28
- - output.dts: boolean — `.d.ts` emit 여부. `js`/`dts` 조합에 따라 emit-only·declaration-only·noEmit( false = 타입체크만) 으로 분기.
29
- - includeTests?: boolean — `tests/` 파일을 rootNames 포함할지. 기본 false. 테스트까지 컴파일해야 하면 true(예: `sdAngularPlugin`).
30
- - env?: TypecheckEnv타입체크 환경. 지정 `getCompilerOptionsForEnv()` 환경별 compilerOptions 적용하고 tsbuildinfo 파일명에 접미사를 붙임. 환경 분리 타입체크에 쓴다.
31
- - sourceFileCache?: AngularSourceFileCache — Angular 증분용 SourceFile 캐시. 미제공 내부 생성. 여러 `compileAsync` 라운드 캐시를 공유하려면 외부에서 주입.
32
- - transformStylesheet?: (data, containingFile, stylesheetFile?) => Promise<string|null>컴포넌트 스타일 변환 콜백(Angular only). `null` 반환 변환 함. 미제공이고 Angular 라이브러리용 SCSS 변환 콜백을 자동 생성. 클라이언트 빌드처럼 커스텀 스타일 파이프라인이 필요할 때 직접 제공.
33
- - externalStylesheets?: Map<string, string>외부 스타일시트 맵(클라이언트 빌드용). 지정 비-템플릿 스타일 리소스를 해시 기반 `.css` 외부 파일명으로 매핑(`resourceNameToFileName`). 스타일을 별도 청크로 뽑을 때.
34
- - compilerOptionsTransformer?: (options) => ts.CompilerOptions 최종 compilerOptions 후처리 훅. 클라이언트의 `target`/`module`/`rootDir` 강제, Vitest `inlineSourceMap` 강제 등에 쓴다.
35
- - lint?: boolean — true 면 `compileAsync` program 기반 lint함께 돌려 결과를 `result.lint` 에 담는다(affected 파일만 대상, globalScss 와 병렬 실행). 컴파일과 동시에 lint 하고 싶을 때.
36
- - globalScss?: boolean — true 면 `scss/styles.scss` → `styles.css`(패키지 루트) 글로벌 SCSS 를 컴파일하고 에러를 `result.scssErrors` 에 더한다.
37
-
38
- ## ISdTsCompilerEmitOptions (compileAsync 2번째 인자)
31
+ - **pkgDir**: string — 컴파일 대상 패키지 디렉토리. 출력은 아래 `dist/`, 캐시는 `.cache/*.tsbuildinfo` 에 떨어진다.
32
+ - **cwd**: string — workspace 루트. 진단 필터링(`isWorkspaceDiagnostic`)·경로 상대화에 사용.
33
+ - **output**: `{ js: boolean; dts: boolean }` 출력 제어. `js+dts` JS+선언파일, `js` JS 만(`declaration:false`), `dts` 선언파일만(`emitDeclarationOnly:true`), false `noEmit:true`(타입체크 전용). tsBuildInfo 파일명도 이에 따라 달라짐.
34
+ - **includeTests**: boolean — `true` `tests/` 파일을 rootNames 에 포함(`getPackageFiles`), 기본/`false` 소스만(`getPackageSourceFiles`).
35
+ - **env**: `TypecheckEnv`(`"node" | "browser"`) 지정 시 `getCompilerOptionsForEnv()` env lib 등을 조정. tsBuildInfo 파일명에 `-<env>` 접미사가 붙는다.
36
+ - **sourceFileCache**: `AngularSourceFileCache`Angular 증분 빌드용 SourceFile 캐시. 미제공 내부 생성. 여러 `compileAsync` SourceFile 재사용.
37
+ - **transformStylesheet**: `(data, containingFile, stylesheetFile?) => Promise<string|null>` 스타일시트 변환 콜백(Angular only). 컴포넌트 인라인/외부 스타일을 변환. 미제공 + Angular 면 내부 라이브러리용 콜백을 자동 생성. 반환 `null` 이면 변환 없음.
38
+ - **externalStylesheets**: `Map<string, string>`외부 스타일시트 (클라이언트 빌드용). 해석된 스타일 경로를 해시 ID 매핑해 `<id>.css` 가상 파일명으로 분리.
39
+ - **compilerOptionsTransformer**: `(options) => options` 최종 `compilerOptions` 후처리. 클라이언트의 target/module 강제, `inlineSourceMap` 강제에 사용(`sdAngularPlugin` 이걸 씀).
40
+ - **lint**: boolean `true` `compileAsync` ESLint 같은 Program 으로 실행하고 결과를 `result.lint` 담는다(중복 Program 생성 방지). 글로벌 SCSS 와 병렬 실행.
41
+ - **globalScss**: boolean — `true` 면 `scss/styles.scss` 패키지 루트 `styles.css`생성. 에러는 `result.scssErrors` 에 누적.
42
+
43
+ ```typescript
44
+ import { SdTsCompiler } from "@simplysm/sd-cli";
45
+
46
+ const compiler = new SdTsCompiler({
47
+ pkgDir: path.resolve(cwd, "packages/excel"),
48
+ cwd,
49
+ output: { js: true, dts: true },
50
+ });
51
+ const result = await compiler.compileAsync();
52
+ ```
53
+
54
+ ## compileAsync
39
55
 
40
56
  ```typescript
57
+ compileAsync(
58
+ modifiedFiles?: ReadonlySet<string>,
59
+ emitOptions?: ISdTsCompilerEmitOptions,
60
+ ): Promise<ISdTsCompilerResult>;
61
+
41
62
  interface ISdTsCompilerEmitOptions {
42
63
  sourceFilter?: (fileName: string) => boolean;
43
64
  additionalTransformers?: {
@@ -47,43 +68,18 @@ interface ISdTsCompilerEmitOptions {
47
68
  }
48
69
  ```
49
70
 
50
- - sourceFilter?: (fileName) => boolean emit 결과 필터(Angular only). true 소스만 `emitResults` 남긴다. 특정 파일의 emit 필요할 때(예: HMR 단일 파일).
51
- - additionalTransformers?.before / .after Angular 기본 transformers 앞/뒤에 끼울 추가 TS transformer 배열(Angular only). before = 변환 전, after = 변환 단계에 주입. 커스텀 코드 변환을 끼울 때.
71
+ - **modifiedFiles**: `ReadonlySet<string>` 직전 호출 이후 변경된 파일 집합. 지정 SourceFile 캐시를 무효화하고, `node_modules` 경로가 포함되면 package.json 해석 캐시도 클리어. 미지정 전체 기준으로 진행. watch 재빌드에서 증분 컴파일에 쓴다.
72
+ - **emitOptions.sourceFilter**: `(fileName) => boolean` Angular only. emit 결과 필터를 통과한 소스만 `emitResults` 남긴다.
73
+ - **emitOptions.additionalTransformers**: Angular only. Angular transformer 뒤에 `before`/`after` 커스텀 transformer 를 덧붙인다.
52
74
 
53
- ## SdTsCompiler 메서드
75
+ 여러 단계(analyze/affected 탐색/emit/진단 수집/lint+globalScss)를 각각 try-catch 로 감싸 한 단계가 크래시해도 나머지를 진행하고, 크래시는 `ISdTsCompilerResult.diagnostics` 에 에러 진단으로 합산된다.
54
76
 
55
77
  ```typescript
56
- class SdTsCompiler {
57
- constructor(options: ISdTsCompilerOptions);
58
- compileAsync(modifiedFiles?: ReadonlySet<string>, emitOptions?: ISdTsCompilerEmitOptions): Promise<ISdTsCompilerResult>;
59
- get sideEffectScssRegistry(): Map<string, SideEffectScssEntry>;
60
- compileSideEffectScss(): void;
61
- findAffectedByScss(scssPath: string): string[];
62
- }
63
- ```
64
-
65
- - compileAsync(modifiedFiles?, emitOptions?) — 1회 증분 컴파일 실행. `modifiedFiles` = 직전 변경된 파일 절대경로 집합(증분 무효화용, 미지정·빈 집합이면 캐시 그대로 사용; node_modules 포함 변경 시 packageJsonCache 클리어). `emitOptions` 는 위 emit 필터/transformer. 같은 인스턴스로 반복 호출해 증분 빌드를 이어간다.
66
- - sideEffectScssRegistry (getter) — side-effect SCSS 등록부(`Map<소스, SideEffectScssEntry>`) 참조. emit 코드가 항목을 등록하는 통로.
67
- - compileSideEffectScss() — 위 레지스트리의 모든 항목을 CSS 로 컴파일하고 에러/의존성을 내부 상태에 반영.
68
- - findAffectedByScss(scssPath) — 주어진 SCSS 경로에 의존하는 소유자 파일 경로 배열을 반환(역방향 탐색). watch 에서 SCSS 변경 시 재컴파일 대상 산출에 쓴다.
69
-
70
- 사용 예:
71
-
72
- ```typescript
73
- import { SdTsCompiler } from "@simplysm/sd-cli";
74
-
75
- const compiler = new SdTsCompiler({
76
- pkgDir: "/repo/packages/core-common",
77
- cwd: "/repo",
78
- output: { js: true, dts: true },
79
- });
80
- const result = await compiler.compileAsync();
81
- if (result.errorCount > 0) console.error(result.errors);
82
- // watch 라운드: 변경 파일만 넘겨 증분 컴파일
83
- const next = await compiler.compileAsync(new Set(["/repo/packages/core-common/src/foo.ts"]));
78
+ // watch 재빌드: 변경 파일만 넘겨 증분 컴파일
79
+ const result = await compiler.compileAsync(new Set(["packages/excel/src/a.ts"]));
84
80
  ```
85
81
 
86
- ## ISdTsCompilerResult (compileAsync 반환)
82
+ ## ISdTsCompilerResult
87
83
 
88
84
  ```typescript
89
85
  interface ISdTsCompilerResult {
@@ -96,23 +92,29 @@ interface ISdTsCompilerResult {
96
92
  warningCount: number;
97
93
  errors?: string[];
98
94
  ngtscProgram?: NgtscProgram;
99
- emitResults?: EmitResult[]; // EmitResult: { filename; contents; sourceFileName }
100
- lint?: LintWithProgramResult;
95
+ emitResults?: EmitResult[]; // { filename, contents, sourceFileName }
96
+ lint?: LintWithProgramResult; // { success, errorCount, warningCount, formattedOutput }
101
97
  scssErrors: string[];
102
98
  scssDependencies: ReadonlyMap<string, ReadonlySet<string>>;
103
99
  }
104
100
  ```
105
101
 
106
- - program: ts.Program TS Program 참조. lint·외부 도구에 넘길 때.
107
- - builderProgram: ts.EmitAndSemanticDiagnosticsBuilderProgram증분 BuilderProgram 참조.
108
- - isForAngular: booleanAngular 모드로 컴파일됐는지(tsconfig `angularCompilerOptions` 유무로 결정). 후속 처리 분기에 쓴다.
109
- - affectedFiles: ReadonlySet<string> | undefined 이번 빌드에서 영향받은 파일(posix 경로). `undefined` = 전역 변경(전체 리빌드). 부분 재처리 범위 판단에 쓴다.
110
- - diagnostics: SerializedDiagnostic[] 직렬화된 진단 전체(worker 경계 통과용). 내부 크래시 진단도 합산됨.
111
- - errorCount: number — Error 카테고리 진단 수. 크래시는 여기에 가산.
112
- - warningCount: numberWarning 카테고리 진단 수.
113
- - errors?: string[] — Error 진단을 `"파일:줄:열: TS코드: 메시지"` 형식으로 포맷한 배열(없으면 undefined). 로그 출력에 바로 쓴다.
114
- - ngtscProgram?: NgtscProgramNgtscProgram 참조(Angular only, HMR 용). non-Angular 이면 undefined.
115
- - emitResults?: EmitResult[] — Angular emit 결과 배열. 각 항목 `{ filename; contents; sourceFileName }`(sourceFileName = 원본 소스 경로). non-Angular 은 writeFile 훅으로 디스크에 직접 쓰므로 undefined. 메모리상 컴파일 결과가 필요한 플러그인이 소비.
116
- - lint?: LintWithProgramResultlint 결과(`lint: true` 때만). `{ success; errorCount; warningCount; formattedOutput }` 형상.
117
- - scssErrors: string[] — SCSS 컴파일 에러 목록.
118
- - scssDependencies: ReadonlyMap<string, ReadonlySet<string>> — SCSS 의존성 맵(소유자 파일 → 의존 SCSS 경로 집합). watch 역방향 탐색용.
102
+ - **program / builderProgram**: TypeScript Program Builder Program 참조(lint·외부 도구·증분 빌드용).
103
+ - **isForAngular**: booleantsconfig `angularCompilerOptions` 가 있어 Angular AOT 모드로 컴파일됐는지.
104
+ - **affectedFiles**: `ReadonlySet<string> | undefined` 이번 빌드에서 영향받은 파일(posix 경로). `undefined` 전역 변경(전체 리빌드).
105
+ - **diagnostics**: `SerializedDiagnostic[]`직렬화된 진단(worker 경계 통과용). workspace 외부 진단은 필터링됨.
106
+ - **errorCount / warningCount**: Error/Warning 카테고리 진단 (크래시 진단 포함).
107
+ - **errors**: string[] — Error 진단을 `"파일:줄:열: TS코드: 메시지"` 형식으로 포맷한 배열. 에러 없으면 `undefined`.
108
+ - **ngtscProgram**: `NgtscProgram`Angular only(HMR 용). Non-Angular 이면 `undefined`.
109
+ - **emitResults**: `EmitResult[]`Angular emit 결과(`{ filename, contents, sourceFileName }`). **Non-Angular 이면 `undefined`** Non-Angular writeFile 훅으로 디스크에 직접 쓰기 때문(메모리 반환 아님).
110
+ - **lint**: `LintWithProgramResult``lint:true` 때만. `{ success, errorCount, warningCount, formattedOutput }`.
111
+ - **scssErrors**: string[] — SCSS 컴파일 에러 목록(글로벌/side-effect/스타일시트 변환 누적).
112
+ - **scssDependencies**: `ReadonlyMap<string, ReadonlySet<string>>` 소유자 파일 의존 SCSS 경로 집합. watch 에서 SCSS 변경의 역방향 탐색에 사용.
113
+
114
+ ## 보조 메서드
115
+
116
+ `SdTsCompiler` 는 SCSS 처리용 보조 멤버도 노출한다(주로 빌드 엔진 내부 배선용):
117
+
118
+ - **get sideEffectScssRegistry**: `Map<string, SideEffectScssEntry>` — side-effect SCSS 레지스트리 참조. emit 코드에서 항목 등록용.
119
+ - **compileSideEffectScss()**: 레지스트리의 모든 항목을 CSS 로 컴파일. 에러는 `scssErrors` 에 누적.
120
+ - **findAffectedByScss(scssPath)**: `string[]` — 주어진 SCSS 경로에 의존하는 파일 목록 반환(watch 역방향 탐색).