@simplysm/sd-cli 14.0.51 → 14.0.53
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/dist/angular/angular-compiler.d.ts +3 -0
- package/dist/angular/angular-compiler.d.ts.map +1 -1
- package/dist/angular/angular-compiler.js +3 -0
- package/dist/angular/angular-compiler.js.map +1 -1
- package/dist/dev-server/hmr-service.d.ts.map +1 -1
- package/dist/dev-server/hmr-service.js +10 -5
- package/dist/dev-server/hmr-service.js.map +1 -1
- package/dist/esbuild/esbuild-angular-compiler-plugin.js +5 -5
- package/dist/esbuild/esbuild-angular-compiler-plugin.js.map +1 -1
- package/dist/esbuild/esbuild-client-config.d.ts.map +1 -1
- package/dist/esbuild/esbuild-client-config.js +10 -5
- package/dist/esbuild/esbuild-client-config.js.map +1 -1
- package/dist/workers/client.worker.d.ts.map +1 -1
- package/dist/workers/client.worker.js +6 -1
- package/dist/workers/client.worker.js.map +1 -1
- package/package.json +6 -7
- package/src/angular/angular-compiler.ts +3 -0
- package/src/dev-server/hmr-service.ts +10 -5
- package/src/esbuild/esbuild-angular-compiler-plugin.ts +5 -5
- package/src/esbuild/esbuild-client-config.ts +17 -12
- package/src/workers/client.worker.ts +6 -1
- package/README.md +0 -125
- package/docs/angular-vite-plugin/sd-angular-plugin.md +0 -54
- package/docs/config/build-target.md +0 -31
- package/docs/config/npm-config.md +0 -27
- package/docs/config/sd-browser-support-config.md +0 -19
- package/docs/config/sd-build-package-config.md +0 -21
- package/docs/config/sd-capacitor-config.md +0 -109
- package/docs/config/sd-client-package-config.md +0 -33
- package/docs/config/sd-config.md +0 -73
- package/docs/config/sd-electron-config.md +0 -27
- package/docs/config/sd-package-config.md +0 -18
- package/docs/config/sd-post-publish-script-config.md +0 -19
- package/docs/config/sd-publish-config.md +0 -72
- package/docs/config/sd-pwa-config.md +0 -41
- package/docs/config/sd-scripts-package-config.md +0 -19
- package/docs/config/sd-server-package-config.md +0 -32
- package/docs/config/sd-watch-hook-config.md +0 -19
- package/docs/ts-compiler/sd-ts-compiler.md +0 -152
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SdScriptsPackageConfig
|
|
2
|
-
|
|
3
|
-
`scripts` 타겟 패키지 설정. 빌드 엔진이 없으며, `watch` 훅이 설정된 경우에만 watch/typecheck 대상에 포함된다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
export interface SdScriptsPackageConfig {
|
|
7
|
-
target: "scripts";
|
|
8
|
-
publish?: SdPublishConfig;
|
|
9
|
-
watch?: SdWatchHookConfig;
|
|
10
|
-
}
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Members
|
|
14
|
-
|
|
15
|
-
| Field | Type | Description |
|
|
16
|
-
|-------|------|-------------|
|
|
17
|
-
| `target` | `"scripts"` | 빌드 타겟 식별자 |
|
|
18
|
-
| `publish` | [`SdPublishConfig?`](./sd-publish-config.md) | 배포 설정 |
|
|
19
|
-
| `watch` | [`SdWatchHookConfig?`](./sd-watch-hook-config.md) | watch 훅 설정. 설정 시 watch 모드에 패키지가 포함된다 |
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# SdServerPackageConfig
|
|
2
|
-
|
|
3
|
-
`server` 타겟 패키지 설정. esbuild로 단일 번들 빌드되며 Fastify 서버로 실행된다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
export interface SdServerPackageConfig {
|
|
7
|
-
target: "server";
|
|
8
|
-
env?: Record<string, string>;
|
|
9
|
-
publish?: SdPublishConfig;
|
|
10
|
-
configs?: Record<string, unknown>;
|
|
11
|
-
externals?: string[];
|
|
12
|
-
pm2?: {
|
|
13
|
-
name?: string;
|
|
14
|
-
ignoreWatchPaths?: string[];
|
|
15
|
-
};
|
|
16
|
-
packageManager?: "volta" | "mise";
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Members
|
|
21
|
-
|
|
22
|
-
| Field | Type | Description |
|
|
23
|
-
|-------|------|-------------|
|
|
24
|
-
| `target` | `"server"` | 빌드 타겟 식별자 |
|
|
25
|
-
| `env` | `Record<string, string>?` | 빌드 시 치환할 환경 변수. `process.env.KEY`를 상수로 치환 |
|
|
26
|
-
| `publish` | [`SdPublishConfig?`](./sd-publish-config.md) | 배포 설정 |
|
|
27
|
-
| `configs` | `Record<string, unknown>?` | 런타임 설정. 빌드 시 `dist/.config.json`으로 기록 |
|
|
28
|
-
| `externals` | `string[]?` | esbuild 번들에 포함하지 않을 외부 모듈. 자동 `binding.gyp` 감지 목록에 추가 |
|
|
29
|
-
| `pm2` | `{ name?: string; ignoreWatchPaths?: string[] }?` | PM2 설정. 지정 시 `dist/pm2.config.cjs` 생성 |
|
|
30
|
-
| `pm2.name` | `string?` | PM2 프로세스 이름. 미지정 시 `package.json`의 `name`에서 생성 |
|
|
31
|
-
| `pm2.ignoreWatchPaths` | `string[]?` | PM2 watch에서 제외할 경로 |
|
|
32
|
-
| `packageManager` | `"volta" \| "mise"?` | 사용할 패키지 매니저. `mise.toml` 또는 `volta` 설정 생성에 영향 |
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# SdWatchHookConfig
|
|
2
|
-
|
|
3
|
-
watch 모드에서 파일 변경을 감지하고 명령어를 실행하는 훅 설정. [`SdBuildPackageConfig`](./sd-build-package-config.md) 및 [`SdScriptsPackageConfig`](./sd-scripts-package-config.md)의 `watch` 필드에 사용한다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
export interface SdWatchHookConfig {
|
|
7
|
-
target: string[];
|
|
8
|
-
cmd: string;
|
|
9
|
-
args?: string[];
|
|
10
|
-
}
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Members
|
|
14
|
-
|
|
15
|
-
| Field | Type | Description |
|
|
16
|
-
|-------|------|-------------|
|
|
17
|
-
| `target` | `string[]` | 감시할 glob 패턴 목록. 패키지 디렉토리 기준 상대 경로 |
|
|
18
|
-
| `cmd` | `string` | 파일 변경 시 실행할 명령어 |
|
|
19
|
-
| `args` | `string[]?` | 명령어 인수 |
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
# SdTsCompiler
|
|
2
|
-
|
|
3
|
-
TypeScript AOT 컴파일러. Angular 패키지(`angularCompilerOptions`가 `tsconfig.json`에 있는 경우)와 일반 TypeScript 패키지를 모두 지원한다. 증분 빌드, lint 통합, SCSS 컴파일을 관리한다.
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
export class SdTsCompiler {
|
|
7
|
-
constructor(options: ISdTsCompilerOptions);
|
|
8
|
-
|
|
9
|
-
async compileAsync(
|
|
10
|
-
modifiedFiles?: ReadonlySet<string>,
|
|
11
|
-
emitOptions?: ISdTsCompilerEmitOptions,
|
|
12
|
-
): Promise<ISdTsCompilerResult>;
|
|
13
|
-
|
|
14
|
-
compileSideEffectScss(): void;
|
|
15
|
-
|
|
16
|
-
findAffectedByScss(scssPath: string): string[];
|
|
17
|
-
|
|
18
|
-
get sideEffectScssRegistry(): Map<string, SideEffectScssEntry>;
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Members
|
|
23
|
-
|
|
24
|
-
| Member | Kind | Type | Description |
|
|
25
|
-
|--------|------|------|-------------|
|
|
26
|
-
| `compileAsync` | method | `(modifiedFiles?, emitOptions?) => Promise<ISdTsCompilerResult>` | TypeScript 컴파일 실행. `modifiedFiles` 지정 시 증분 빌드 수행 |
|
|
27
|
-
| `compileSideEffectScss` | method | `() => void` | `sideEffectScssRegistry`의 모든 항목을 CSS로 컴파일 |
|
|
28
|
-
| `findAffectedByScss` | method | `(scssPath: string) => string[]` | SCSS 경로에 의존하는 TypeScript 파일 목록 반환. watch 역방향 추적용 |
|
|
29
|
-
| `sideEffectScssRegistry` | getter | `Map<string, SideEffectScssEntry>` | Angular 컴포넌트 `@Component.styles` 항목 저장소 |
|
|
30
|
-
|
|
31
|
-
## Related Types
|
|
32
|
-
|
|
33
|
-
### `ISdTsCompilerOptions`
|
|
34
|
-
|
|
35
|
-
`SdTsCompiler` 생성 옵션.
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
export interface ISdTsCompilerOptions {
|
|
39
|
-
pkgDir: string;
|
|
40
|
-
cwd: string;
|
|
41
|
-
output: { js: boolean; dts: boolean };
|
|
42
|
-
includeTests?: boolean;
|
|
43
|
-
env?: TypecheckEnv;
|
|
44
|
-
sourceFileCache?: AngularSourceFileCache;
|
|
45
|
-
transformStylesheet?: (
|
|
46
|
-
data: string,
|
|
47
|
-
containingFile: string,
|
|
48
|
-
stylesheetFile?: string,
|
|
49
|
-
) => Promise<string | null>;
|
|
50
|
-
externalStylesheets?: Map<string, string>;
|
|
51
|
-
compilerOptionsTransformer?: (options: ts.CompilerOptions) => ts.CompilerOptions;
|
|
52
|
-
lint?: boolean;
|
|
53
|
-
globalScss?: boolean;
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
| Field | Type | Description |
|
|
58
|
-
|-------|------|-------------|
|
|
59
|
-
| `pkgDir` | `string` | 패키지 디렉토리 (절대 경로) |
|
|
60
|
-
| `cwd` | `string` | workspace 루트. diagnostics 필터링 등에 사용 |
|
|
61
|
-
| `output` | `{ js: boolean; dts: boolean }` | emit 제어 플래그. `js`: JavaScript emit, `dts`: 타입 선언 emit |
|
|
62
|
-
| `includeTests` | `boolean?` | `tests/` 파일을 rootNames에 포함할지 여부. 기본값 `false` |
|
|
63
|
-
| `env` | `TypecheckEnv?` | 타입체크 환경. 설정 시 `getCompilerOptionsForEnv()` 적용 |
|
|
64
|
-
| `sourceFileCache` | `AngularSourceFileCache?` | Angular 증분 빌드용 SourceFile 캐시. 미제공 시 내부 생성 |
|
|
65
|
-
| `transformStylesheet` | `(data, containingFile, stylesheetFile?) => Promise<string \| null>?` | 스타일시트 변환 콜백. Angular 패키지 전용 |
|
|
66
|
-
| `externalStylesheets` | `Map<string, string>?` | 외부 스타일시트 맵. 클라이언트 빌드용, `resourceNameToFileName`에서 사용 |
|
|
67
|
-
| `compilerOptionsTransformer` | `(options: ts.CompilerOptions) => ts.CompilerOptions?` | `compilerOptions` 후처리. 클라이언트의 `target`/`module` 강제 등에 사용 |
|
|
68
|
-
| `lint` | `boolean?` | lint 실행 여부. `true`이면 `compileAsync` 결과에 lint 결과 포함 |
|
|
69
|
-
| `globalScss` | `boolean?` | 글로벌 SCSS 컴파일 여부. `true`이면 `scss/styles.scss` → `dist/styles.css` 생성 |
|
|
70
|
-
|
|
71
|
-
### `ISdTsCompilerResult`
|
|
72
|
-
|
|
73
|
-
`compileAsync()` 반환 타입.
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
export interface ISdTsCompilerResult {
|
|
77
|
-
program: ts.Program;
|
|
78
|
-
builderProgram: ts.EmitAndSemanticDiagnosticsBuilderProgram;
|
|
79
|
-
isForAngular: boolean;
|
|
80
|
-
affectedFiles: ReadonlySet<string> | undefined;
|
|
81
|
-
diagnostics: SerializedDiagnostic[];
|
|
82
|
-
errorCount: number;
|
|
83
|
-
warningCount: number;
|
|
84
|
-
errors?: string[];
|
|
85
|
-
ngtscProgram?: NgtscProgram;
|
|
86
|
-
emitResults?: EmitResult[];
|
|
87
|
-
lint?: LintWithProgramResult;
|
|
88
|
-
scssErrors: string[];
|
|
89
|
-
scssDependencies: ReadonlyMap<string, ReadonlySet<string>>;
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
| Field | Type | Description |
|
|
94
|
-
|-------|------|-------------|
|
|
95
|
-
| `program` | `ts.Program` | TypeScript Program 참조. lint, 외부 도구용 |
|
|
96
|
-
| `builderProgram` | `ts.EmitAndSemanticDiagnosticsBuilderProgram` | Builder Program 참조. 증분 빌드 상태 보유 |
|
|
97
|
-
| `isForAngular` | `boolean` | Angular 패키지 여부. `tsconfig.json`에 `angularCompilerOptions` 존재 시 `true` |
|
|
98
|
-
| `affectedFiles` | `ReadonlySet<string> \| undefined` | 이 빌드에서 영향받은 파일 (posix 경로). `undefined` = 전역 변경 (전체 리빌드) |
|
|
99
|
-
| `diagnostics` | `SerializedDiagnostic[]` | 직렬화된 진단 정보. Worker 경계 통과용 |
|
|
100
|
-
| `errorCount` | `number` | Error 카테고리 진단 수 |
|
|
101
|
-
| `warningCount` | `number` | Warning 카테고리 진단 수 |
|
|
102
|
-
| `errors` | `string[]?` | Error 카테고리 진단을 `"파일:줄:열: TS코드: 메시지"` 형식으로 포맷한 배열. 에러 없으면 `undefined` |
|
|
103
|
-
| `ngtscProgram` | `NgtscProgram?` | NgtscProgram 참조. Angular 패키지 전용, HMR용. Non-Angular이면 `undefined` |
|
|
104
|
-
| `emitResults` | `EmitResult[]?` | Angular emit 결과. Non-Angular이면 `undefined` (writeFile 훅으로 디스크 직접 쓰기) |
|
|
105
|
-
| `lint` | `LintWithProgramResult?` | lint 결과. `lint` 옵션 활성 시 반환 |
|
|
106
|
-
| `scssErrors` | `string[]` | SCSS 컴파일 에러 목록 |
|
|
107
|
-
| `scssDependencies` | `ReadonlyMap<string, ReadonlySet<string>>` | SCSS 의존성 맵. key: 소유자 파일, value: 의존 SCSS 경로 집합. watch 역방향 탐색용 |
|
|
108
|
-
|
|
109
|
-
## Usage
|
|
110
|
-
|
|
111
|
-
### 초기 컴파일
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
import { SdTsCompiler } from "@simplysm/sd-cli";
|
|
115
|
-
|
|
116
|
-
const compiler = new SdTsCompiler({
|
|
117
|
-
pkgDir: "/workspace/packages/my-lib",
|
|
118
|
-
cwd: "/workspace",
|
|
119
|
-
output: { js: true, dts: true },
|
|
120
|
-
lint: true,
|
|
121
|
-
globalScss: true,
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const result = await compiler.compileAsync();
|
|
125
|
-
|
|
126
|
-
if (result.errors) {
|
|
127
|
-
console.error("Compilation errors:", result.errors);
|
|
128
|
-
process.exit(1);
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### watch 모드에서 증분 컴파일
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { SdTsCompiler } from "@simplysm/sd-cli";
|
|
136
|
-
|
|
137
|
-
const compiler = new SdTsCompiler({
|
|
138
|
-
pkgDir: "/workspace/packages/my-lib",
|
|
139
|
-
cwd: "/workspace",
|
|
140
|
-
output: { js: true, dts: true },
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
// 초기 컴파일
|
|
144
|
-
let result = await compiler.compileAsync();
|
|
145
|
-
|
|
146
|
-
// 파일 변경 감지 시 증분 컴파일
|
|
147
|
-
const changedFiles = new Set(["/workspace/packages/my-lib/src/foo.ts"]);
|
|
148
|
-
result = await compiler.compileAsync(changedFiles);
|
|
149
|
-
|
|
150
|
-
// SCSS 의존성이 변경된 TS 파일 찾기
|
|
151
|
-
const affectedByScss = compiler.findAffectedByScss("/workspace/packages/my-lib/scss/variables.scss");
|
|
152
|
-
```
|