@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.
Files changed (39) hide show
  1. package/dist/angular/angular-compiler.d.ts +3 -0
  2. package/dist/angular/angular-compiler.d.ts.map +1 -1
  3. package/dist/angular/angular-compiler.js +3 -0
  4. package/dist/angular/angular-compiler.js.map +1 -1
  5. package/dist/dev-server/hmr-service.d.ts.map +1 -1
  6. package/dist/dev-server/hmr-service.js +10 -5
  7. package/dist/dev-server/hmr-service.js.map +1 -1
  8. package/dist/esbuild/esbuild-angular-compiler-plugin.js +5 -5
  9. package/dist/esbuild/esbuild-angular-compiler-plugin.js.map +1 -1
  10. package/dist/esbuild/esbuild-client-config.d.ts.map +1 -1
  11. package/dist/esbuild/esbuild-client-config.js +10 -5
  12. package/dist/esbuild/esbuild-client-config.js.map +1 -1
  13. package/dist/workers/client.worker.d.ts.map +1 -1
  14. package/dist/workers/client.worker.js +6 -1
  15. package/dist/workers/client.worker.js.map +1 -1
  16. package/package.json +6 -7
  17. package/src/angular/angular-compiler.ts +3 -0
  18. package/src/dev-server/hmr-service.ts +10 -5
  19. package/src/esbuild/esbuild-angular-compiler-plugin.ts +5 -5
  20. package/src/esbuild/esbuild-client-config.ts +17 -12
  21. package/src/workers/client.worker.ts +6 -1
  22. package/README.md +0 -125
  23. package/docs/angular-vite-plugin/sd-angular-plugin.md +0 -54
  24. package/docs/config/build-target.md +0 -31
  25. package/docs/config/npm-config.md +0 -27
  26. package/docs/config/sd-browser-support-config.md +0 -19
  27. package/docs/config/sd-build-package-config.md +0 -21
  28. package/docs/config/sd-capacitor-config.md +0 -109
  29. package/docs/config/sd-client-package-config.md +0 -33
  30. package/docs/config/sd-config.md +0 -73
  31. package/docs/config/sd-electron-config.md +0 -27
  32. package/docs/config/sd-package-config.md +0 -18
  33. package/docs/config/sd-post-publish-script-config.md +0 -19
  34. package/docs/config/sd-publish-config.md +0 -72
  35. package/docs/config/sd-pwa-config.md +0 -41
  36. package/docs/config/sd-scripts-package-config.md +0 -19
  37. package/docs/config/sd-server-package-config.md +0 -32
  38. package/docs/config/sd-watch-hook-config.md +0 -19
  39. package/docs/ts-compiler/sd-ts-compiler.md +0 -152
package/README.md DELETED
@@ -1,125 +0,0 @@
1
- # @simplysm/sd-cli
2
-
3
- Simplysm 모노레포용 빌드/개발/배포 CLI 도구. `sd.config.ts` 설정 타입과 Angular AOT Vite 플러그인(`sdAngularPlugin`)을 export한다.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @simplysm/sd-cli
9
- ```
10
-
11
- ## API Overview
12
-
13
- ### Config
14
-
15
- | Entry | Kind | Description |
16
- |-------|------|-------------|
17
- | [`NpmConfig`](./docs/config/npm-config.md) | interface | npm package.json 구조 |
18
- | [`BuildTarget`](./docs/config/build-target.md) | type | 빌드 타겟 타입 (`"node"` \| `"browser"` \| `"neutral"`) |
19
- | [`SdPublishConfig`](./docs/config/sd-publish-config.md) | type | 패키지 배포 설정 discriminated union (`SdNpmPublishConfig` \| `SdLocalDirectoryPublishConfig` \| `SdStoragePublishConfig`) |
20
- | [`SdPostPublishScriptConfig`](./docs/config/sd-post-publish-script-config.md) | interface | postPublish 스크립트 설정 |
21
- | [`SdBuildPackageConfig`](./docs/config/sd-build-package-config.md) | interface | node/browser/neutral 패키지 설정 |
22
- | [`SdCapacitorConfig`](./docs/config/sd-capacitor-config.md) | interface | Capacitor 설정 (관련 타입: `SdCapacitorSignConfig`, `SdCapacitorPermission`, `SdCapacitorIntentFilter`, `SdCapacitorAndroidConfig` 포함) |
23
- | [`SdElectronConfig`](./docs/config/sd-electron-config.md) | interface | Electron 설정 |
24
- | [`SdPwaConfig`](./docs/config/sd-pwa-config.md) | interface | PWA 설정 (관련 타입: `SdPwaManifestConfig` 포함) |
25
- | [`SdBrowserSupportConfig`](./docs/config/sd-browser-support-config.md) | interface | 클라이언트 패키지용 브라우저 지원 설정 |
26
- | [`SdClientPackageConfig`](./docs/config/sd-client-package-config.md) | interface | 클라이언트 패키지 설정 |
27
- | [`SdServerPackageConfig`](./docs/config/sd-server-package-config.md) | interface | 서버 패키지 설정 |
28
- | [`SdWatchHookConfig`](./docs/config/sd-watch-hook-config.md) | interface | watch 훅 설정 |
29
- | [`SdScriptsPackageConfig`](./docs/config/sd-scripts-package-config.md) | interface | 스크립트 전용 패키지 설정 |
30
- | [`SdPackageConfig`](./docs/config/sd-package-config.md) | type | 패키지 설정 discriminated union (target 필드로 분기) |
31
- | [`SdConfig`](./docs/config/sd-config.md) | interface | sd.config.ts 설정 타입 (관련 타입: `SdConfigParams`, `SdConfigFn` 포함) |
32
-
33
- ### TypeScript Compiler
34
-
35
- | Entry | Kind | Description |
36
- |-------|------|-------------|
37
- | [`SdTsCompiler`](./docs/ts-compiler/sd-ts-compiler.md) | class | TypeScript AOT 컴파일러 (Angular 및 일반 TS 패키지 지원, 관련 타입: `ISdTsCompilerOptions`, `ISdTsCompilerResult` 포함) |
38
-
39
- ### Angular Vite Plugin
40
-
41
- | Entry | Kind | Description |
42
- |-------|------|-------------|
43
- | [`sdAngularPlugin`](./docs/angular-vite-plugin/sd-angular-plugin.md) | function | Angular AOT 컴파일을 수행하는 Vite 플러그인 (Vitest 전용, 관련 타입: `SdAngularPluginOptions` 포함) |
44
-
45
- ## Usage Examples
46
-
47
- ### SdTsCompiler를 사용한 TypeScript 컴파일
48
-
49
- ```typescript
50
- import { SdTsCompiler } from "@simplysm/sd-cli";
51
-
52
- const compiler = new SdTsCompiler({
53
- pkgDir: "/workspace/packages/my-lib",
54
- cwd: "/workspace",
55
- output: { js: true, dts: true },
56
- lint: true,
57
- globalScss: true,
58
- });
59
-
60
- // 초기 컴파일
61
- const result = await compiler.compileAsync();
62
-
63
- if (result.errors) {
64
- console.error("Compilation errors:", result.errors);
65
- process.exit(1);
66
- }
67
-
68
- console.log(`Compiled ${result.affectedFiles?.size ?? "all"} files`);
69
- ```
70
-
71
- ### watch 모드에서 증분 컴파일
72
-
73
- ```typescript
74
- import { SdTsCompiler } from "@simplysm/sd-cli";
75
-
76
- const compiler = new SdTsCompiler({
77
- pkgDir: "/workspace/packages/my-lib",
78
- cwd: "/workspace",
79
- output: { js: true, dts: true },
80
- });
81
-
82
- // 초기 컴파일
83
- let result = await compiler.compileAsync();
84
-
85
- // 파일 변경 감지 시 증분 컴파일
86
- const changedFiles = new Set(["/workspace/packages/my-lib/src/foo.ts"]);
87
- result = await compiler.compileAsync(changedFiles);
88
-
89
- // SCSS 의존성이 변경된 TS 파일 찾기
90
- const affectedByScss = compiler.findAffectedByScss("/workspace/packages/my-lib/scss/variables.scss");
91
- ```
92
-
93
- ### sd.config.ts 작성
94
-
95
- ```typescript
96
- import type { SdConfigFn } from "@simplysm/sd-cli";
97
-
98
- const config: SdConfigFn = (params) => ({
99
- packages: {
100
- "core-common": { target: "neutral" },
101
- "core-node": { target: "node" },
102
- "my-client": {
103
- target: "client",
104
- server: "my-server",
105
- },
106
- "my-server": {
107
- target: "server",
108
- publish: { type: "npm" },
109
- },
110
- },
111
- });
112
-
113
- export default config;
114
- ```
115
-
116
- ### Vite에서 Angular AOT 플러그인 사용
117
-
118
- ```typescript
119
- import { defineConfig } from "vite";
120
- import { sdAngularPlugin } from "@simplysm/sd-cli";
121
-
122
- export default defineConfig({
123
- plugins: [sdAngularPlugin({ pkg: "my-client" })],
124
- });
125
- ```
@@ -1,54 +0,0 @@
1
- # sdAngularPlugin
2
-
3
- Angular AOT 컴파일을 수행하는 Vite 플러그인. Vitest 환경에서 Angular 컴포넌트를 포함한 TypeScript 패키지를 컴파일할 때 사용한다.
4
-
5
- ```typescript
6
- export function sdAngularPlugin(options: SdAngularPluginOptions): Plugin;
7
- ```
8
-
9
- ## Parameters
10
-
11
- | Param | Type | Description |
12
- |-------|------|-------------|
13
- | `options` | `SdAngularPluginOptions` | 플러그인 옵션 |
14
-
15
- ## Returns
16
-
17
- `Plugin` — Vite 플러그인 객체
18
-
19
- ## Vite 훅
20
-
21
- | 훅 | 동작 |
22
- |----|------|
23
- | `config` | `process.cwd()/packages/{pkg}` 경로를 `resolvedPkgDir`로 초기화 |
24
- | `watchChange` | Vitest watch 모드에서 변경된 파일 경로를 `pendingWatchChanges`에 수집 |
25
- | `buildStart` | `SdTsCompiler` 초기화 → `compileAsync()` → emit 결과를 내부 맵에 캐싱. watch 재빌드 시 변경 파일로 증분 재컴파일 |
26
- | `transform` | `.ts` 파일 요청 시 캐싱된 컴파일 결과 반환 + 인라인 소스맵 분리 |
27
- | `buildEnd` | `SdTsCompiler` 참조 해제 |
28
-
29
- ## Related Types
30
-
31
- ### `SdAngularPluginOptions`
32
-
33
- ```typescript
34
- export interface SdAngularPluginOptions {
35
- pkg: string;
36
- }
37
- ```
38
-
39
- | Field | Type | Description |
40
- |-------|------|-------------|
41
- | `pkg` | `string` | `sd.config.ts` `packages` 키 (패키지 디렉토리명). 예: `"my-client"` |
42
-
43
- ## Usage
44
-
45
- `vite.config.ts` 또는 `vitest.config.ts`에 플러그인을 등록한다.
46
-
47
- ```typescript
48
- import { defineConfig } from "vite";
49
- import { sdAngularPlugin } from "@simplysm/sd-cli";
50
-
51
- export default defineConfig({
52
- plugins: [sdAngularPlugin({ pkg: "my-client" })],
53
- });
54
- ```
@@ -1,31 +0,0 @@
1
- # BuildTarget
2
-
3
- esbuild로 빌드되는 라이브러리 패키지의 타겟 플랫폼을 나타내는 타입.
4
-
5
- ```typescript
6
- export type BuildTarget = "node" | "browser" | "neutral";
7
- ```
8
-
9
- | 값 | 설명 |
10
- |----|------|
11
- | `"node"` | Node.js 전용 패키지. esbuild `platform: "node"` |
12
- | `"browser"` | 브라우저 전용 패키지. esbuild `platform: "browser"` |
13
- | `"neutral"` | Node/브라우저 공용 패키지. esbuild `platform: "neutral"` |
14
-
15
- ## Usage
16
-
17
- [`SdBuildPackageConfig`](./sd-build-package-config.md)의 `target` 필드에 사용한다.
18
-
19
- ```typescript
20
- import type { SdConfigFn } from "@simplysm/sd-cli";
21
-
22
- const config: SdConfigFn = () => ({
23
- packages: {
24
- "core-common": { target: "neutral" },
25
- "core-node": { target: "node" },
26
- "core-browser": { target: "browser" },
27
- },
28
- });
29
-
30
- export default config;
31
- ```
@@ -1,27 +0,0 @@
1
- # NpmConfig
2
-
3
- npm `package.json` 구조를 나타내는 인터페이스. 패키지 의존성 탐색, 버전 조회 등 내부 유틸리티에서 사용한다.
4
-
5
- ```typescript
6
- export interface NpmConfig {
7
- name: string;
8
- version: string;
9
- description?: string;
10
- dependencies?: Record<string, string>;
11
- devDependencies?: Record<string, string>;
12
- peerDependencies?: Record<string, string>;
13
- volta?: unknown;
14
- }
15
- ```
16
-
17
- ## Members
18
-
19
- | Field | Type | Description |
20
- |-------|------|-------------|
21
- | `name` | `string` | 패키지명 |
22
- | `version` | `string` | 패키지 버전 |
23
- | `description` | `string?` | 패키지 설명 |
24
- | `dependencies` | `Record<string, string>?` | 프로덕션 의존성 |
25
- | `devDependencies` | `Record<string, string>?` | 개발 의존성 |
26
- | `peerDependencies` | `Record<string, string>?` | 피어 의존성 |
27
- | `volta` | `unknown?` | Volta 설정 |
@@ -1,19 +0,0 @@
1
- # SdBrowserSupportConfig
2
-
3
- 클라이언트 패키지의 브라우저 지원 설정. [`SdClientPackageConfig`](./sd-client-package-config.md)의 `browserSupport` 필드에 사용한다.
4
-
5
- ```typescript
6
- export interface SdBrowserSupportConfig {
7
- browserslist?: string | string[];
8
- postCss?: { plugins: [string, (object | string)?][] };
9
- legacyModule?: boolean;
10
- }
11
- ```
12
-
13
- ## Members
14
-
15
- | Field | Type | Description |
16
- |-------|------|-------------|
17
- | `browserslist` | `string \| string[]?` | browserslist 쿼리. esbuild target으로 변환되어 문법(syntax)만 다운레벨 컴파일된다. 예: `"last 2 Chrome versions"` |
18
- | `postCss` | `{ plugins: [string, (object \| string)?][] }?` | PostCSS 플러그인 설정. `[패키지명, 옵션]` 튜플 배열 |
19
- | `legacyModule` | `boolean?` | 레거시 모듈 지원. `true`이면 코드 분할 비활성화 + `import.meta` 치환 |
@@ -1,21 +0,0 @@
1
- # SdBuildPackageConfig
2
-
3
- `node` / `browser` / `neutral` 타겟 라이브러리 패키지 설정. esbuild + tsc로 빌드된다.
4
-
5
- ```typescript
6
- export interface SdBuildPackageConfig {
7
- target: BuildTarget;
8
- publish?: SdPublishConfig;
9
- copySrc?: string[];
10
- watch?: SdWatchHookConfig;
11
- }
12
- ```
13
-
14
- ## Members
15
-
16
- | Field | Type | Description |
17
- |-------|------|-------------|
18
- | `target` | [`BuildTarget`](./build-target.md) | 빌드 타겟 (`"node"` \| `"browser"` \| `"neutral"`) |
19
- | `publish` | [`SdPublishConfig?`](./sd-publish-config.md) | 배포 설정 |
20
- | `copySrc` | `string[]?` | `src/`에서 `dist/`로 복사할 파일의 glob 패턴 (`src/` 기준 상대 경로) |
21
- | `watch` | [`SdWatchHookConfig?`](./sd-watch-hook-config.md) | watch 훅 설정. 설정 시 watch 모드에서 빌드 엔진과 함께 훅이 실행된다 |
@@ -1,109 +0,0 @@
1
- # SdCapacitorConfig
2
-
3
- Capacitor 모바일 앱 설정. [`SdClientPackageConfig`](./sd-client-package-config.md)의 `capacitor` 필드에 사용한다.
4
-
5
- ```typescript
6
- export interface SdCapacitorConfig {
7
- appId: string;
8
- appName: string;
9
- plugins?: Record<string, Record<string, unknown> | true>;
10
- icon?: string;
11
- debug?: boolean;
12
- platform?: {
13
- android?: SdCapacitorAndroidConfig;
14
- };
15
- }
16
- ```
17
-
18
- ## Members
19
-
20
- | Field | Type | Description |
21
- |-------|------|-------------|
22
- | `appId` | `string` | 앱 ID (예: `"com.example.app"`) |
23
- | `appName` | `string` | 앱 이름 |
24
- | `plugins` | `Record<string, Record<string, unknown> \| true>?` | Capacitor 플러그인 설정. key: 패키지명, value: `true` 또는 플러그인 옵션 객체 |
25
- | `icon` | `string?` | 앱 아이콘 경로 (패키지 디렉토리 기준 상대 경로) |
26
- | `debug` | `boolean?` | 디버그 빌드 플래그 |
27
- | `platform` | `{ android?: SdCapacitorAndroidConfig }?` | 플랫폼별 설정 |
28
-
29
- ## Related Types
30
-
31
- ### `SdCapacitorAndroidConfig`
32
-
33
- Capacitor Android 플랫폼 설정.
34
-
35
- ```typescript
36
- export interface SdCapacitorAndroidConfig {
37
- config?: Record<string, string>;
38
- bundle?: boolean;
39
- intentFilters?: SdCapacitorIntentFilter[];
40
- sign?: SdCapacitorSignConfig;
41
- sdkVersion?: number;
42
- permissions?: SdCapacitorPermission[];
43
- }
44
- ```
45
-
46
- | Field | Type | Description |
47
- |-------|------|-------------|
48
- | `config` | `Record<string, string>?` | AndroidManifest.xml `application` 태그 속성 (예: `{ requestLegacyExternalStorage: "true" }`) |
49
- | `bundle` | `boolean?` | AAB 번들 빌드 플래그. `false`이면 APK |
50
- | `intentFilters` | `SdCapacitorIntentFilter[]?` | Intent Filter 설정 |
51
- | `sign` | `SdCapacitorSignConfig?` | APK/AAB 서명 설정 |
52
- | `sdkVersion` | `number?` | Android SDK 버전 (minSdk, targetSdk에 동시 적용) |
53
- | `permissions` | `SdCapacitorPermission[]?` | 추가 권한 설정 |
54
-
55
- ### `SdCapacitorSignConfig`
56
-
57
- Android APK/AAB 서명 설정.
58
-
59
- ```typescript
60
- export interface SdCapacitorSignConfig {
61
- keystore: string;
62
- storePassword: string;
63
- alias: string;
64
- password: string;
65
- keystoreType?: string;
66
- }
67
- ```
68
-
69
- | Field | Type | Description |
70
- |-------|------|-------------|
71
- | `keystore` | `string` | keystore 파일 경로 (패키지 디렉토리 기준 상대 경로) |
72
- | `storePassword` | `string` | keystore 비밀번호 |
73
- | `alias` | `string` | 키 별칭 |
74
- | `password` | `string` | 키 비밀번호 |
75
- | `keystoreType` | `string?` | keystore 타입 (기본값: `"jks"`) |
76
-
77
- ### `SdCapacitorPermission`
78
-
79
- Android 권한 설정.
80
-
81
- ```typescript
82
- export interface SdCapacitorPermission {
83
- name: string;
84
- maxSdkVersion?: number;
85
- ignore?: string;
86
- }
87
- ```
88
-
89
- | Field | Type | Description |
90
- |-------|------|-------------|
91
- | `name` | `string` | 권한 이름 (예: `"CAMERA"`, `"WRITE_EXTERNAL_STORAGE"`) |
92
- | `maxSdkVersion` | `number?` | 이 권한을 적용할 최대 SDK 버전 |
93
- | `ignore` | `string?` | `tools:ignore` 속성 값 |
94
-
95
- ### `SdCapacitorIntentFilter`
96
-
97
- Android Intent Filter 설정.
98
-
99
- ```typescript
100
- export interface SdCapacitorIntentFilter {
101
- action?: string;
102
- category?: string;
103
- }
104
- ```
105
-
106
- | Field | Type | Description |
107
- |-------|------|-------------|
108
- | `action` | `string?` | intent 액션 (예: `"android.intent.action.VIEW"`) |
109
- | `category` | `string?` | intent 카테고리 (예: `"android.intent.category.DEFAULT"`) |
@@ -1,33 +0,0 @@
1
- # SdClientPackageConfig
2
-
3
- `client` 타겟 패키지 설정. esbuild 기반으로 빌드되며 개발 시 Vite dev server를 사용한다.
4
-
5
- ```typescript
6
- export interface SdClientPackageConfig {
7
- target: "client";
8
- server: string | number;
9
- env?: Record<string, string>;
10
- publish?: SdPublishConfig;
11
- capacitor?: SdCapacitorConfig;
12
- electron?: SdElectronConfig;
13
- configs?: Record<string, unknown>;
14
- exclude?: string[];
15
- browserSupport?: SdBrowserSupportConfig;
16
- pwa?: false | SdPwaConfig;
17
- }
18
- ```
19
-
20
- ## Members
21
-
22
- | Field | Type | Description |
23
- |-------|------|-------------|
24
- | `target` | `"client"` | 빌드 타겟 식별자 |
25
- | `server` | `string \| number` | 연결할 서버 패키지명 (예: `"my-server"`) 또는 포트 직접 지정 (하위 호환) |
26
- | `env` | `Record<string, string>?` | 빌드 시 치환할 환경 변수. `process.env`를 객체로 치환 |
27
- | `publish` | [`SdPublishConfig?`](./sd-publish-config.md) | 배포 설정 |
28
- | `capacitor` | [`SdCapacitorConfig?`](./sd-capacitor-config.md) | Capacitor 모바일 앱 설정 |
29
- | `electron` | [`SdElectronConfig?`](./sd-electron-config.md) | Electron 데스크톱 앱 설정 |
30
- | `configs` | `Record<string, unknown>?` | 런타임 설정. 빌드 시 `dist/.config.json`으로 기록 |
31
- | `exclude` | `string[]?` | Capacitor/Electron `package.json`에 추가할 패키지 목록 |
32
- | `browserSupport` | [`SdBrowserSupportConfig?`](./sd-browser-support-config.md) | 브라우저 지원 설정 |
33
- | `pwa` | `false \| SdPwaConfig?` | PWA 설정. `false`이면 비활성화. 미지정 시 기본값으로 활성화 |
@@ -1,73 +0,0 @@
1
- # SdConfig
2
-
3
- `sd.config.ts` 설정 타입. `sd.config.ts`는 반드시 [`SdConfigFn`](#sdconfigfn) 형식의 함수를 default export해야 한다.
4
-
5
- ```typescript
6
- export interface SdConfig {
7
- packages: Record<string, SdPackageConfig | undefined>;
8
- replaceDeps?: Record<string, string>;
9
- postPublish?: SdPostPublishScriptConfig[];
10
- }
11
- ```
12
-
13
- ## Members
14
-
15
- | Field | Type | Description |
16
- |-------|------|-------------|
17
- | `packages` | `Record<string, SdPackageConfig \| undefined>` | 패키지별 설정. key: `packages/` 하위 디렉토리명 (예: `"core-common"`) |
18
- | `replaceDeps` | `Record<string, string>?` | 의존성 교체 설정. `node_modules` 패키지를 로컬 소스로 심링크 교체. key: 패키지 glob 패턴, value: 소스 디렉토리 경로. key의 `*`에서 캡처된 값이 value의 `*`에 치환됨 |
19
- | `postPublish` | [`SdPostPublishScriptConfig[]?`](./sd-post-publish-script-config.md) | 배포 완료 후 실행할 스크립트 목록 |
20
-
21
- ## Related Types
22
-
23
- ### `SdConfigParams`
24
-
25
- `sd.config.ts` 함수에 전달되는 매개변수.
26
-
27
- ```typescript
28
- export interface SdConfigParams {
29
- cwd: string;
30
- dev: boolean;
31
- opt: string[];
32
- }
33
- ```
34
-
35
- | Field | Type | Description |
36
- |-------|------|-------------|
37
- | `cwd` | `string` | 현재 작업 디렉토리 |
38
- | `dev` | `boolean` | 개발 모드 플래그 (`pnpm dev` 실행 시 `true`) |
39
- | `opt` | `string[]` | 추가 옵션 (`-o` 플래그에서 전달된 값 배열) |
40
-
41
- ### `SdConfigFn`
42
-
43
- `sd.config.ts`가 default export해야 하는 함수 타입.
44
-
45
- ```typescript
46
- export type SdConfigFn = (params: SdConfigParams) => SdConfig | Promise<SdConfig>;
47
- ```
48
-
49
- ## Usage
50
-
51
- ```typescript
52
- import type { SdConfigFn } from "@simplysm/sd-cli";
53
-
54
- const config: SdConfigFn = (params) => ({
55
- packages: {
56
- "core-common": { target: "neutral" },
57
- "core-node": { target: "node" },
58
- "my-client": {
59
- target: "client",
60
- server: "my-server",
61
- },
62
- "my-server": {
63
- target: "server",
64
- publish: { type: "npm" },
65
- },
66
- },
67
- replaceDeps: {
68
- "@simplysm/*": "../simplysm/packages/*",
69
- },
70
- });
71
-
72
- export default config;
73
- ```
@@ -1,27 +0,0 @@
1
- # SdElectronConfig
2
-
3
- Electron 데스크톱 앱 설정. [`SdClientPackageConfig`](./sd-client-package-config.md)의 `electron` 필드에 사용한다.
4
-
5
- ```typescript
6
- export interface SdElectronConfig {
7
- appId: string;
8
- portable?: boolean;
9
- installerIcon?: string;
10
- reinstallDependencies?: string[];
11
- postInstallScript?: string;
12
- nsisOptions?: Record<string, unknown>;
13
- env?: Record<string, string>;
14
- }
15
- ```
16
-
17
- ## Members
18
-
19
- | Field | Type | Description |
20
- |-------|------|-------------|
21
- | `appId` | `string` | Electron 앱 ID (예: `"com.example.myapp"`) |
22
- | `portable` | `boolean?` | `true`이면 포터블 `.exe`, `false`/미지정이면 NSIS 설치 프로그램 |
23
- | `installerIcon` | `string?` | 설치 프로그램 아이콘 경로 (`.ico`, 패키지 디렉토리 기준 상대 경로) |
24
- | `reinstallDependencies` | `string[]?` | Electron에 포함할 npm 패키지 목록 (네이티브 모듈 등 별도 설치 필요 패키지) |
25
- | `postInstallScript` | `string?` | npm `postinstall` 스크립트 |
26
- | `nsisOptions` | `Record<string, unknown>?` | NSIS 옵션. `portable`이 `false`일 때 적용 |
27
- | `env` | `Record<string, string>?` | 환경 변수. `electron-main.ts`에서 `process.env`로 접근 가능 |
@@ -1,18 +0,0 @@
1
- # SdPackageConfig
2
-
3
- `sd.config.ts`의 패키지별 설정. `target` 필드로 분기하는 discriminated union이다.
4
-
5
- ```typescript
6
- export type SdPackageConfig =
7
- | SdBuildPackageConfig
8
- | SdClientPackageConfig
9
- | SdServerPackageConfig
10
- | SdScriptsPackageConfig;
11
- ```
12
-
13
- | `target` 값 | 타입 | 설명 |
14
- |-------------|------|------|
15
- | `"node"` \| `"browser"` \| `"neutral"` | [`SdBuildPackageConfig`](./sd-build-package-config.md) | esbuild+tsc로 빌드되는 라이브러리 패키지 |
16
- | `"client"` | [`SdClientPackageConfig`](./sd-client-package-config.md) | Vite/esbuild로 빌드되는 프론트엔드 패키지 |
17
- | `"server"` | [`SdServerPackageConfig`](./sd-server-package-config.md) | esbuild로 빌드되는 Fastify 서버 패키지 |
18
- | `"scripts"` | [`SdScriptsPackageConfig`](./sd-scripts-package-config.md) | 빌드 없이 watch 훅만 실행하는 스크립트 패키지 |
@@ -1,19 +0,0 @@
1
- # SdPostPublishScriptConfig
2
-
3
- 배포 완료 후 실행할 스크립트 설정. [`SdConfig`](./sd-config.md)의 `postPublish` 배열 항목으로 사용한다.
4
-
5
- ```typescript
6
- export interface SdPostPublishScriptConfig {
7
- type: "script";
8
- cmd: string;
9
- args: string[];
10
- }
11
- ```
12
-
13
- ## Members
14
-
15
- | Field | Type | Description |
16
- |-------|------|-------------|
17
- | `type` | `"script"` | 타입 식별자 |
18
- | `cmd` | `string` | 실행할 명령어 |
19
- | `args` | `string[]` | 명령어 인수. 환경 변수 치환 지원: `%VER%` (버전), `%PROJECT%` (프로젝트명) |
@@ -1,72 +0,0 @@
1
- # SdPublishConfig
2
-
3
- 패키지 배포 설정. `type` 필드로 분기하는 discriminated union이다.
4
-
5
- ```typescript
6
- export type SdPublishConfig =
7
- | SdNpmPublishConfig
8
- | SdLocalDirectoryPublishConfig
9
- | SdStoragePublishConfig;
10
- ```
11
-
12
- | `type` 값 | 타입 | 설명 |
13
- |-----------|------|------|
14
- | `"npm"` | `SdNpmPublishConfig` | npm 레지스트리 배포 |
15
- | `"local-directory"` | `SdLocalDirectoryPublishConfig` | 로컬 디렉토리 복사 |
16
- | `"ftp"` \| `"ftps"` \| `"sftp"` | `SdStoragePublishConfig` | 스토리지 업로드 |
17
-
18
- ## Related Types
19
-
20
- ### `SdNpmPublishConfig`
21
-
22
- npm 레지스트리에 배포한다. 버전은 자동으로 증가된다.
23
-
24
- ```typescript
25
- export interface SdNpmPublishConfig {
26
- type: "npm";
27
- }
28
- ```
29
-
30
- | Field | Type | Description |
31
- |-------|------|-------------|
32
- | `type` | `"npm"` | 배포 타입 식별자 |
33
-
34
- ### `SdLocalDirectoryPublishConfig`
35
-
36
- 로컬 디렉토리로 빌드 산출물을 복사한다.
37
-
38
- ```typescript
39
- export interface SdLocalDirectoryPublishConfig {
40
- type: "local-directory";
41
- path: string;
42
- }
43
- ```
44
-
45
- | Field | Type | Description |
46
- |-------|------|-------------|
47
- | `type` | `"local-directory"` | 배포 타입 식별자 |
48
- | `path` | `string` | 배포 대상 경로. 환경 변수 치환 지원: `%VER%` (버전), `%PROJECT%` (프로젝트명) |
49
-
50
- ### `SdStoragePublishConfig`
51
-
52
- FTP/FTPS/SFTP 서버에 빌드 산출물을 업로드한다.
53
-
54
- ```typescript
55
- export interface SdStoragePublishConfig {
56
- type: "ftp" | "ftps" | "sftp";
57
- host: string;
58
- port?: number;
59
- path?: string;
60
- user?: string;
61
- password?: string;
62
- }
63
- ```
64
-
65
- | Field | Type | Description |
66
- |-------|------|-------------|
67
- | `type` | `"ftp" \| "ftps" \| "sftp"` | 스토리지 프로토콜 |
68
- | `host` | `string` | 서버 호스트 |
69
- | `port` | `number?` | 서버 포트 |
70
- | `path` | `string?` | 원격 경로 |
71
- | `user` | `string?` | 사용자명 |
72
- | `password` | `string?` | 비밀번호 |
@@ -1,41 +0,0 @@
1
- # SdPwaConfig
2
-
3
- PWA(Progressive Web App) 설정. [`SdClientPackageConfig`](./sd-client-package-config.md)의 `pwa` 필드에 사용한다.
4
-
5
- ```typescript
6
- export interface SdPwaConfig {
7
- manifest?: SdPwaManifestConfig;
8
- }
9
- ```
10
-
11
- ## Members
12
-
13
- | Field | Type | Description |
14
- |-------|------|-------------|
15
- | `manifest` | `SdPwaManifestConfig?` | PWA manifest 설정 |
16
-
17
- ## Related Types
18
-
19
- ### `SdPwaManifestConfig`
20
-
21
- PWA `manifest.json` 설정.
22
-
23
- ```typescript
24
- export interface SdPwaManifestConfig {
25
- name?: string;
26
- short_name?: string;
27
- display?: "standalone" | "fullscreen" | "minimal-ui" | "browser";
28
- theme_color?: string;
29
- background_color?: string;
30
- icons?: Array<{ src: string; sizes: string; type?: string }>;
31
- }
32
- ```
33
-
34
- | Field | Type | Description |
35
- |-------|------|-------------|
36
- | `name` | `string?` | 앱 이름 |
37
- | `short_name` | `string?` | 앱 짧은 이름 |
38
- | `display` | `"standalone" \| "fullscreen" \| "minimal-ui" \| "browser"?` | 디스플레이 모드 |
39
- | `theme_color` | `string?` | 테마 색상 (hex 코드) |
40
- | `background_color` | `string?` | 배경 색상 (hex 코드) |
41
- | `icons` | `Array<{ src: string; sizes: string; type?: string }>?` | 아이콘 목록 |