@simplysm/sd-cli 14.0.11 → 14.0.12

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 (263) hide show
  1. package/README.md +58 -253
  2. package/dist/angular/client-transform-stylesheet.js +1 -1
  3. package/dist/angular/client-transform-stylesheet.js.map +1 -1
  4. package/dist/angular/vite-angular-plugin.d.ts +1 -1
  5. package/dist/angular/vite-angular-plugin.d.ts.map +1 -1
  6. package/dist/angular/vite-angular-plugin.js +60 -34
  7. package/dist/angular/vite-angular-plugin.js.map +1 -1
  8. package/dist/angular/vite-postcss-inline-plugin.d.ts +1 -1
  9. package/dist/angular/vite-postcss-inline-plugin.js +1 -1
  10. package/dist/capacitor/capacitor.d.ts +14 -2
  11. package/dist/capacitor/capacitor.d.ts.map +1 -1
  12. package/dist/capacitor/capacitor.js +131 -17
  13. package/dist/capacitor/capacitor.js.map +1 -1
  14. package/dist/commands/build.d.ts +3 -10
  15. package/dist/commands/build.d.ts.map +1 -1
  16. package/dist/commands/build.js +3 -10
  17. package/dist/commands/build.js.map +1 -1
  18. package/dist/commands/check.js +3 -3
  19. package/dist/commands/check.js.map +1 -1
  20. package/dist/commands/dev.d.ts +3 -9
  21. package/dist/commands/dev.d.ts.map +1 -1
  22. package/dist/commands/dev.js +3 -9
  23. package/dist/commands/dev.js.map +1 -1
  24. package/dist/commands/device.d.ts +3 -3
  25. package/dist/commands/device.js +5 -5
  26. package/dist/commands/device.js.map +1 -1
  27. package/dist/commands/publish.d.ts +1 -1
  28. package/dist/commands/publish.d.ts.map +1 -1
  29. package/dist/commands/publish.js +18 -26
  30. package/dist/commands/publish.js.map +1 -1
  31. package/dist/commands/replace-deps.d.ts +3 -3
  32. package/dist/commands/replace-deps.d.ts.map +1 -1
  33. package/dist/commands/replace-deps.js +1 -1
  34. package/dist/commands/typecheck.d.ts +4 -3
  35. package/dist/commands/typecheck.d.ts.map +1 -1
  36. package/dist/commands/typecheck.js +5 -11
  37. package/dist/commands/typecheck.js.map +1 -1
  38. package/dist/commands/watch.d.ts +9 -9
  39. package/dist/commands/watch.js +9 -9
  40. package/dist/electron/electron.d.ts.map +1 -1
  41. package/dist/electron/electron.js +42 -3
  42. package/dist/electron/electron.js.map +1 -1
  43. package/dist/engines/BaseEngine.d.ts +1 -1
  44. package/dist/engines/BaseEngine.d.ts.map +1 -1
  45. package/dist/engines/BaseEngine.js +3 -1
  46. package/dist/engines/BaseEngine.js.map +1 -1
  47. package/dist/engines/NgtscEngine.d.ts +7 -7
  48. package/dist/engines/NgtscEngine.d.ts.map +1 -1
  49. package/dist/engines/NgtscEngine.js +3 -3
  50. package/dist/engines/ServerEsbuildEngine.d.ts +7 -7
  51. package/dist/engines/ServerEsbuildEngine.d.ts.map +1 -1
  52. package/dist/engines/ServerEsbuildEngine.js +3 -3
  53. package/dist/engines/TscEngine.d.ts +7 -7
  54. package/dist/engines/TscEngine.d.ts.map +1 -1
  55. package/dist/engines/TscEngine.js +3 -3
  56. package/dist/engines/ViteEngine.d.ts +1 -1
  57. package/dist/engines/ViteEngine.d.ts.map +1 -1
  58. package/dist/engines/ViteEngine.js +7 -12
  59. package/dist/engines/ViteEngine.js.map +1 -1
  60. package/dist/engines/index.d.ts +5 -5
  61. package/dist/engines/index.js +5 -5
  62. package/dist/engines/types.d.ts +20 -20
  63. package/dist/engines/types.d.ts.map +1 -1
  64. package/dist/infra/ResultCollector.d.ts +9 -9
  65. package/dist/infra/ResultCollector.js +8 -8
  66. package/dist/infra/SignalHandler.d.ts +7 -7
  67. package/dist/infra/SignalHandler.js +7 -7
  68. package/dist/infra/WorkerManager.d.ts +14 -14
  69. package/dist/infra/WorkerManager.js +14 -14
  70. package/dist/orchestrators/BuildOrchestrator.d.ts +25 -25
  71. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  72. package/dist/orchestrators/BuildOrchestrator.js +29 -29
  73. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  74. package/dist/orchestrators/DevWatchOrchestrator.d.ts +7 -7
  75. package/dist/orchestrators/DevWatchOrchestrator.d.ts.map +1 -1
  76. package/dist/orchestrators/DevWatchOrchestrator.js +34 -34
  77. package/dist/orchestrators/DevWatchOrchestrator.js.map +1 -1
  78. package/dist/sd-cli-entry.d.ts +2 -2
  79. package/dist/sd-cli-entry.d.ts.map +1 -1
  80. package/dist/sd-cli-entry.js +15 -8
  81. package/dist/sd-cli-entry.js.map +1 -1
  82. package/dist/sd-cli.d.ts +3 -3
  83. package/dist/sd-cli.js +16 -16
  84. package/dist/sd-cli.js.map +1 -1
  85. package/dist/sd-config.types.d.ts +105 -105
  86. package/dist/sd-config.types.d.ts.map +1 -1
  87. package/dist/utils/angular-compiler.js +5 -5
  88. package/dist/utils/angular-compiler.js.map +1 -1
  89. package/dist/utils/build-env.d.ts +1 -1
  90. package/dist/utils/build-env.js +1 -1
  91. package/dist/utils/concurrency.d.ts +7 -7
  92. package/dist/utils/concurrency.js +7 -7
  93. package/dist/utils/copy-public.d.ts +9 -9
  94. package/dist/utils/copy-public.js +17 -17
  95. package/dist/utils/copy-public.js.map +1 -1
  96. package/dist/utils/copy-src.d.ts +9 -9
  97. package/dist/utils/copy-src.js +11 -11
  98. package/dist/utils/copy-src.js.map +1 -1
  99. package/dist/utils/engine-stop.d.ts +8 -9
  100. package/dist/utils/engine-stop.d.ts.map +1 -1
  101. package/dist/utils/engine-stop.js +9 -10
  102. package/dist/utils/engine-stop.js.map +1 -1
  103. package/dist/utils/esbuild-config.d.ts +23 -23
  104. package/dist/utils/esbuild-config.d.ts.map +1 -1
  105. package/dist/utils/esbuild-config.js +25 -25
  106. package/dist/utils/esbuild-config.js.map +1 -1
  107. package/dist/utils/lint-with-program.d.ts +15 -15
  108. package/dist/utils/lint-with-program.d.ts.map +1 -1
  109. package/dist/utils/lint-with-program.js +29 -29
  110. package/dist/utils/lint-with-program.js.map +1 -1
  111. package/dist/utils/ngtsc-build-core.d.ts +8 -8
  112. package/dist/utils/ngtsc-build-core.d.ts.map +1 -1
  113. package/dist/utils/ngtsc-build-core.js +14 -14
  114. package/dist/utils/ngtsc-build-core.js.map +1 -1
  115. package/dist/utils/output-path-rewriter.d.ts +14 -14
  116. package/dist/utils/output-path-rewriter.js +18 -18
  117. package/dist/utils/output-path-rewriter.js.map +1 -1
  118. package/dist/utils/output-utils.d.ts +6 -6
  119. package/dist/utils/output-utils.js +11 -11
  120. package/dist/utils/output-utils.js.map +1 -1
  121. package/dist/utils/package-utils.d.ts +21 -21
  122. package/dist/utils/package-utils.d.ts.map +1 -1
  123. package/dist/utils/package-utils.js +56 -45
  124. package/dist/utils/package-utils.js.map +1 -1
  125. package/dist/utils/replace-deps.d.ts +25 -25
  126. package/dist/utils/replace-deps.d.ts.map +1 -1
  127. package/dist/utils/replace-deps.js +84 -65
  128. package/dist/utils/replace-deps.js.map +1 -1
  129. package/dist/utils/sd-config.d.ts +3 -3
  130. package/dist/utils/sd-config.js +3 -3
  131. package/dist/utils/tsc-build.d.ts +13 -13
  132. package/dist/utils/tsc-build.d.ts.map +1 -1
  133. package/dist/utils/tsc-build.js +9 -9
  134. package/dist/utils/tsc-build.js.map +1 -1
  135. package/dist/utils/tsconfig.d.ts +11 -9
  136. package/dist/utils/tsconfig.d.ts.map +1 -1
  137. package/dist/utils/tsconfig.js +11 -9
  138. package/dist/utils/tsconfig.js.map +1 -1
  139. package/dist/utils/typecheck-non-package.d.ts +5 -6
  140. package/dist/utils/typecheck-non-package.d.ts.map +1 -1
  141. package/dist/utils/typecheck-non-package.js +7 -8
  142. package/dist/utils/typecheck-non-package.js.map +1 -1
  143. package/dist/utils/typecheck-serialization.d.ts +8 -8
  144. package/dist/utils/typecheck-serialization.d.ts.map +1 -1
  145. package/dist/utils/typecheck-serialization.js +12 -16
  146. package/dist/utils/typecheck-serialization.js.map +1 -1
  147. package/dist/utils/vite-config.d.ts +8 -5
  148. package/dist/utils/vite-config.d.ts.map +1 -1
  149. package/dist/utils/vite-config.js +36 -29
  150. package/dist/utils/vite-config.js.map +1 -1
  151. package/dist/utils/vite-scope-watch-plugin.d.ts.map +1 -1
  152. package/dist/utils/vite-scope-watch-plugin.js +1 -1
  153. package/dist/utils/vite-scope-watch-plugin.js.map +1 -1
  154. package/dist/utils/worker-events.d.ts +12 -12
  155. package/dist/utils/worker-events.d.ts.map +1 -1
  156. package/dist/utils/worker-events.js +10 -10
  157. package/dist/utils/worker-events.js.map +1 -1
  158. package/dist/utils/worker-utils.d.ts +12 -13
  159. package/dist/utils/worker-utils.d.ts.map +1 -1
  160. package/dist/utils/worker-utils.js +12 -13
  161. package/dist/utils/worker-utils.js.map +1 -1
  162. package/dist/vitest-plugin.d.ts.map +1 -1
  163. package/dist/vitest-plugin.js +5 -7
  164. package/dist/vitest-plugin.js.map +1 -1
  165. package/dist/workers/client.worker.d.ts +4 -2
  166. package/dist/workers/client.worker.d.ts.map +1 -1
  167. package/dist/workers/client.worker.js +209 -1
  168. package/dist/workers/client.worker.js.map +1 -1
  169. package/dist/workers/library-build.worker.d.ts +1 -1
  170. package/dist/workers/library-build.worker.d.ts.map +1 -1
  171. package/dist/workers/library-build.worker.js +7 -7
  172. package/dist/workers/library-build.worker.js.map +1 -1
  173. package/dist/workers/lint.worker.d.ts +2 -2
  174. package/dist/workers/lint.worker.js +2 -2
  175. package/dist/workers/ngtsc-build.worker.js +30 -30
  176. package/dist/workers/ngtsc-build.worker.js.map +1 -1
  177. package/dist/workers/server-build.worker.d.ts +17 -17
  178. package/dist/workers/server-build.worker.d.ts.map +1 -1
  179. package/dist/workers/server-build.worker.js +46 -46
  180. package/dist/workers/server-build.worker.js.map +1 -1
  181. package/dist/workers/server-runtime.worker.d.ts +7 -7
  182. package/dist/workers/server-runtime.worker.d.ts.map +1 -1
  183. package/dist/workers/server-runtime.worker.js +17 -17
  184. package/dist/workers/server-runtime.worker.js.map +1 -1
  185. package/docs/config.md +340 -0
  186. package/docs/publish-configuration-types.md +87 -0
  187. package/docs/pwa-configuration-types.md +55 -0
  188. package/docs/vitest-plugin.md +47 -0
  189. package/package.json +9 -7
  190. package/src/angular/client-transform-stylesheet.ts +1 -1
  191. package/src/angular/vite-angular-plugin.ts +70 -37
  192. package/src/angular/vite-postcss-inline-plugin.ts +1 -1
  193. package/src/capacitor/capacitor.ts +159 -23
  194. package/src/commands/build.ts +3 -10
  195. package/src/commands/check.ts +3 -3
  196. package/src/commands/dev.ts +3 -9
  197. package/src/commands/device.ts +5 -5
  198. package/src/commands/publish.ts +30 -26
  199. package/src/commands/replace-deps.ts +3 -3
  200. package/src/commands/typecheck.ts +7 -13
  201. package/src/commands/watch.ts +9 -9
  202. package/src/electron/electron.ts +49 -4
  203. package/src/engines/BaseEngine.ts +4 -1
  204. package/src/engines/NgtscEngine.ts +7 -7
  205. package/src/engines/ServerEsbuildEngine.ts +7 -7
  206. package/src/engines/TscEngine.ts +7 -7
  207. package/src/engines/ViteEngine.ts +8 -13
  208. package/src/engines/index.ts +5 -5
  209. package/src/engines/types.ts +20 -20
  210. package/src/infra/ResultCollector.ts +9 -9
  211. package/src/infra/SignalHandler.ts +7 -7
  212. package/src/infra/WorkerManager.ts +14 -14
  213. package/src/orchestrators/BuildOrchestrator.ts +37 -37
  214. package/src/orchestrators/DevWatchOrchestrator.ts +36 -36
  215. package/src/sd-cli-entry.ts +15 -8
  216. package/src/sd-cli.ts +16 -16
  217. package/src/sd-config.types.ts +107 -107
  218. package/src/utils/angular-compiler.ts +5 -5
  219. package/src/utils/build-env.ts +1 -1
  220. package/src/utils/concurrency.ts +7 -7
  221. package/src/utils/copy-public.ts +17 -17
  222. package/src/utils/copy-src.ts +11 -11
  223. package/src/utils/engine-stop.ts +9 -10
  224. package/src/utils/esbuild-config.ts +29 -29
  225. package/src/utils/lint-with-program.ts +34 -34
  226. package/src/utils/ngtsc-build-core.ts +17 -17
  227. package/src/utils/output-path-rewriter.ts +18 -18
  228. package/src/utils/output-utils.ts +11 -11
  229. package/src/utils/package-utils.ts +57 -45
  230. package/src/utils/replace-deps.ts +92 -67
  231. package/src/utils/sd-config.ts +3 -3
  232. package/src/utils/tsc-build.ts +18 -18
  233. package/src/utils/tsconfig.ts +11 -9
  234. package/src/utils/typecheck-non-package.ts +7 -8
  235. package/src/utils/typecheck-serialization.ts +13 -15
  236. package/src/utils/vite-config.ts +45 -35
  237. package/src/utils/vite-scope-watch-plugin.ts +6 -1
  238. package/src/utils/worker-events.ts +16 -16
  239. package/src/utils/worker-utils.ts +12 -13
  240. package/src/vitest-plugin.ts +5 -8
  241. package/src/workers/client.worker.ts +236 -2
  242. package/src/workers/library-build.worker.ts +8 -8
  243. package/src/workers/lint.worker.ts +2 -2
  244. package/src/workers/ngtsc-build.worker.ts +31 -31
  245. package/src/workers/server-build.worker.ts +60 -60
  246. package/src/workers/server-runtime.worker.ts +22 -22
  247. package/tests/angular/vite-angular-plugin-hmr-fallback.spec.ts +1 -0
  248. package/tests/angular/vite-angular-plugin-hmr.spec.ts +78 -0
  249. package/tests/angular/vite-angular-plugin.spec.ts +67 -0
  250. package/tests/capacitor/capacitor-build.spec.ts +6 -4
  251. package/tests/capacitor/capacitor-icon.spec.ts +7 -5
  252. package/tests/capacitor/capacitor-init.spec.ts +120 -10
  253. package/tests/capacitor/capacitor-run.spec.ts +14 -17
  254. package/tests/capacitor/capacitor-workspace.spec.ts +5 -3
  255. package/tests/commands/check.spec.ts +2 -2
  256. package/tests/commands/publish.spec.ts +2 -2
  257. package/tests/commands/typecheck.spec.ts +8 -0
  258. package/tests/electron/electron.spec.ts +12 -10
  259. package/tests/engines/base-engine.spec.ts +37 -0
  260. package/tests/engines/vite-engine.spec.ts +115 -3
  261. package/tests/utils/vite-config.spec.ts +144 -90
  262. package/tests/workers/client-worker.spec.ts +690 -0
  263. package/tests/workers/server-build-worker.spec.ts +3 -3
package/docs/config.md ADDED
@@ -0,0 +1,340 @@
1
+ # Config
2
+
3
+ ## `BuildTarget`
4
+
5
+ Build target type (built with esbuild).
6
+
7
+ ```typescript
8
+ type BuildTarget = "node" | "browser" | "neutral";
9
+ ```
10
+
11
+ | Value | Description |
12
+ |---|---|
13
+ | `"node"` | Node.js only package |
14
+ | `"browser"` | Browser only package |
15
+ | `"neutral"` | Node/browser shared package |
16
+
17
+ ## `SdBuildPackageConfig`
18
+
19
+ Configuration for buildable packages (node/browser/neutral).
20
+
21
+ ```typescript
22
+ interface SdBuildPackageConfig {
23
+ target: BuildTarget;
24
+ publish?: SdPublishConfig;
25
+ copySrc?: string[];
26
+ watch?: SdWatchHookConfig;
27
+ }
28
+ ```
29
+
30
+ | Field | Type | Description |
31
+ |-------|------|-------------|
32
+ | `target` | `BuildTarget` | Build target |
33
+ | `publish` | `SdPublishConfig` | Publish configuration |
34
+ | `copySrc` | `string[]` | Glob patterns for files to copy from `src/` to `dist/` (relative path based on `src/`) |
35
+ | `watch` | `SdWatchHookConfig` | Watch hook configuration (when set, hook runs alongside build engine in watch mode) |
36
+
37
+ ## `SdClientPackageConfig`
38
+
39
+ Configuration for client (Angular/Vite) packages.
40
+
41
+ ```typescript
42
+ interface SdClientPackageConfig {
43
+ target: "client";
44
+ server: string | number;
45
+ env?: Record<string, string>;
46
+ publish?: SdPublishConfig;
47
+ capacitor?: SdCapacitorConfig;
48
+ electron?: SdElectronConfig;
49
+ configs?: Record<string, unknown>;
50
+ exclude?: string[];
51
+ browserSupport?: SdBrowserSupportConfig;
52
+ pwa?: false | SdPwaConfig;
53
+ }
54
+ ```
55
+
56
+ | Field | Type | Description |
57
+ |-------|------|-------------|
58
+ | `target` | `"client"` | Fixed value |
59
+ | `server` | `string \| number` | Server package name to connect to (e.g., `"solid-demo-server"`), or Vite port number (backward compatibility) |
60
+ | `env` | `Record<string, string>` | Environment variables to substitute during build (replaces `process.env` with object) |
61
+ | `publish` | `SdPublishConfig` | Publish configuration |
62
+ | `capacitor` | `SdCapacitorConfig` | Capacitor mobile build configuration |
63
+ | `electron` | `SdElectronConfig` | Electron desktop build configuration |
64
+ | `configs` | `Record<string, unknown>` | Runtime config (written to `dist/.config.json` during build) |
65
+ | `exclude` | `string[]` | Packages to exclude from Vite optimizeDeps and add to Capacitor/Electron `package.json` |
66
+ | `browserSupport` | `SdBrowserSupportConfig` | Browser compatibility settings (browserslist, PostCSS, legacyModule) |
67
+ | `pwa` | `false \| SdPwaConfig` | PWA configuration. `false` to disable. Enabled with defaults when not specified |
68
+
69
+ ## `SdServerPackageConfig`
70
+
71
+ Configuration for server (Fastify) packages.
72
+
73
+ ```typescript
74
+ interface SdServerPackageConfig {
75
+ target: "server";
76
+ env?: Record<string, string>;
77
+ publish?: SdPublishConfig;
78
+ configs?: Record<string, unknown>;
79
+ externals?: string[];
80
+ pm2?: { name?: string; ignoreWatchPaths?: string[] };
81
+ packageManager?: "volta" | "mise";
82
+ }
83
+ ```
84
+
85
+ | Field | Type | Description |
86
+ |-------|------|-------------|
87
+ | `target` | `"server"` | Fixed value |
88
+ | `env` | `Record<string, string>` | Environment variables to substitute during build (replaces `process.env.KEY` with constant) |
89
+ | `publish` | `SdPublishConfig` | Publish configuration |
90
+ | `configs` | `Record<string, unknown>` | Runtime config (written to `dist/.config.json` during build) |
91
+ | `externals` | `string[]` | External modules not to include in esbuild bundle (in addition to automatic `binding.gyp` detection) |
92
+ | `pm2` | `{ name?: string; ignoreWatchPaths?: string[] }` | PM2 configuration (generates `dist/pm2.config.cjs` when specified). `name` defaults to a name generated from `package.json` |
93
+ | `packageManager` | `"volta" \| "mise"` | Package manager to use (affects `mise.toml` or `volta` settings generation) |
94
+
95
+ ## `SdScriptsPackageConfig`
96
+
97
+ Configuration for scripts-only packages (excluded from watch/typecheck unless watch hook is configured).
98
+
99
+ ```typescript
100
+ interface SdScriptsPackageConfig {
101
+ target: "scripts";
102
+ publish?: SdPublishConfig;
103
+ watch?: SdWatchHookConfig;
104
+ }
105
+ ```
106
+
107
+ | Field | Type | Description |
108
+ |-------|------|-------------|
109
+ | `target` | `"scripts"` | Fixed value |
110
+ | `publish` | `SdPublishConfig` | Publish configuration |
111
+ | `watch` | `SdWatchHookConfig` | Watch hook configuration (when set, package is included in watch mode) |
112
+
113
+ ## `SdWatchHookConfig`
114
+
115
+ Watch hook configuration for running commands on file changes.
116
+
117
+ ```typescript
118
+ interface SdWatchHookConfig {
119
+ target: string[];
120
+ cmd: string;
121
+ args?: string[];
122
+ }
123
+ ```
124
+
125
+ | Field | Type | Description |
126
+ |-------|------|-------------|
127
+ | `target` | `string[]` | Glob patterns to watch (relative to package directory) |
128
+ | `cmd` | `string` | Command to execute on change |
129
+ | `args` | `string[]` | Command arguments |
130
+
131
+ ## `SdPackageConfig`
132
+
133
+ Union of all package configuration types. Discriminated by the `target` field.
134
+
135
+ ```typescript
136
+ type SdPackageConfig =
137
+ | SdBuildPackageConfig
138
+ | SdClientPackageConfig
139
+ | SdServerPackageConfig
140
+ | SdScriptsPackageConfig;
141
+ ```
142
+
143
+ | Variant | Discriminant (`target`) |
144
+ |---------|------------------------|
145
+ | `SdBuildPackageConfig` | `"node"`, `"browser"`, `"neutral"` |
146
+ | `SdClientPackageConfig` | `"client"` |
147
+ | `SdServerPackageConfig` | `"server"` |
148
+ | `SdScriptsPackageConfig` | `"scripts"` |
149
+
150
+ ## `SdConfig`
151
+
152
+ The main configuration object for `sd.config.ts`.
153
+
154
+ ```typescript
155
+ interface SdConfig {
156
+ packages: Record<string, SdPackageConfig | undefined>;
157
+ replaceDeps?: Record<string, string>;
158
+ postPublish?: SdPostPublishScriptConfig[];
159
+ }
160
+ ```
161
+
162
+ | Field | Type | Description |
163
+ |-------|------|-------------|
164
+ | `packages` | `Record<string, SdPackageConfig \| undefined>` | Per-package configuration (key: subdirectory name under `packages/`, e.g., `"core-common"`) |
165
+ | `replaceDeps` | `Record<string, string>` | Dependency replacement configuration (replace `node_modules` packages with local sources via symlink). Key is a package glob pattern (e.g., `"@simplysm/*"`), value is a source directory path. Captured values from key's `*` are substituted into value's `*` |
166
+ | `postPublish` | `SdPostPublishScriptConfig[]` | Scripts to execute after deployment completes |
167
+
168
+ ## `SdConfigParams`
169
+
170
+ Parameters passed to the `sd.config.ts` function.
171
+
172
+ ```typescript
173
+ interface SdConfigParams {
174
+ cwd: string;
175
+ dev: boolean;
176
+ options: string[];
177
+ }
178
+ ```
179
+
180
+ | Field | Type | Description |
181
+ |-------|------|-------------|
182
+ | `cwd` | `string` | Current working directory |
183
+ | `dev` | `boolean` | Development mode flag |
184
+ | `options` | `string[]` | Additional options (from CLI's `-o` flag) |
185
+
186
+ ## `SdConfigFn`
187
+
188
+ The type for the default export of `sd.config.ts`.
189
+
190
+ ```typescript
191
+ type SdConfigFn = (params: SdConfigParams) => SdConfig | Promise<SdConfig>;
192
+ ```
193
+
194
+ ## `SdBrowserSupportConfig`
195
+
196
+ Browser support configuration for client packages.
197
+
198
+ ```typescript
199
+ interface SdBrowserSupportConfig {
200
+ browserslist?: string | string[];
201
+ postCss?: { plugins: unknown[] };
202
+ legacyModule?: boolean;
203
+ }
204
+ ```
205
+
206
+ | Field | Type | Description |
207
+ |-------|------|-------------|
208
+ | `browserslist` | `string \| string[]` | Browserslist query (e.g., `"last 2 Chrome versions"` or `["ie 11", "last 2 versions"]`) |
209
+ | `postCss` | `{ plugins: unknown[] }` | PostCSS plugins configuration |
210
+ | `legacyModule` | `boolean` | Legacy module support (disables code splitting + replaces `import.meta`) |
211
+
212
+ ## `SdCapacitorConfig`
213
+
214
+ Capacitor configuration.
215
+
216
+ ```typescript
217
+ interface SdCapacitorConfig {
218
+ appId: string;
219
+ appName: string;
220
+ plugins?: Record<string, Record<string, unknown> | true>;
221
+ icon?: string;
222
+ debug?: boolean;
223
+ platform?: { android?: SdCapacitorAndroidConfig };
224
+ }
225
+ ```
226
+
227
+ | Field | Type | Description |
228
+ |-------|------|-------------|
229
+ | `appId` | `string` | App ID (e.g., `"com.example.app"`) |
230
+ | `appName` | `string` | App display name |
231
+ | `plugins` | `Record<string, Record<string, unknown> \| true>` | Capacitor plugin configuration (key: package name, value: `true` or plugin options) |
232
+ | `icon` | `string` | App icon path (relative to package directory) |
233
+ | `debug` | `boolean` | Debug build flag |
234
+ | `platform` | `{ android?: SdCapacitorAndroidConfig }` | Per-platform configuration |
235
+
236
+ ## `SdCapacitorAndroidConfig`
237
+
238
+ Capacitor Android platform configuration.
239
+
240
+ ```typescript
241
+ interface SdCapacitorAndroidConfig {
242
+ config?: Record<string, string>;
243
+ bundle?: boolean;
244
+ intentFilters?: SdCapacitorIntentFilter[];
245
+ sign?: SdCapacitorSignConfig;
246
+ sdkVersion?: number;
247
+ permissions?: SdCapacitorPermission[];
248
+ }
249
+ ```
250
+
251
+ | Field | Type | Description |
252
+ |-------|------|-------------|
253
+ | `config` | `Record<string, string>` | `AndroidManifest.xml` application tag attributes (e.g., `{ requestLegacyExternalStorage: "true" }`) |
254
+ | `bundle` | `boolean` | AAB bundle build flag (`true` for AAB, `false` for APK) |
255
+ | `intentFilters` | `SdCapacitorIntentFilter[]` | Intent Filter configuration |
256
+ | `sign` | `SdCapacitorSignConfig` | APK/AAB signing configuration |
257
+ | `sdkVersion` | `number` | Android SDK version (minSdk, targetSdk) |
258
+ | `permissions` | `SdCapacitorPermission[]` | Additional permission configuration |
259
+
260
+ ## `SdCapacitorSignConfig`
261
+
262
+ Capacitor Android sign configuration.
263
+
264
+ ```typescript
265
+ interface SdCapacitorSignConfig {
266
+ keystore: string;
267
+ storePassword: string;
268
+ alias: string;
269
+ password: string;
270
+ keystoreType?: string;
271
+ }
272
+ ```
273
+
274
+ | Field | Type | Description |
275
+ |-------|------|-------------|
276
+ | `keystore` | `string` | Keystore file path (relative to package directory) |
277
+ | `storePassword` | `string` | Keystore password |
278
+ | `alias` | `string` | Key alias |
279
+ | `password` | `string` | Key password |
280
+ | `keystoreType` | `string` | Keystore type (default: `"jks"`) |
281
+
282
+ ## `SdCapacitorPermission`
283
+
284
+ Capacitor Android permission configuration.
285
+
286
+ ```typescript
287
+ interface SdCapacitorPermission {
288
+ name: string;
289
+ maxSdkVersion?: number;
290
+ ignore?: string;
291
+ }
292
+ ```
293
+
294
+ | Field | Type | Description |
295
+ |-------|------|-------------|
296
+ | `name` | `string` | Permission name (e.g., `"CAMERA"`, `"WRITE_EXTERNAL_STORAGE"`) |
297
+ | `maxSdkVersion` | `number` | Maximum SDK version |
298
+ | `ignore` | `string` | `tools:ignore` attribute value |
299
+
300
+ ## `SdCapacitorIntentFilter`
301
+
302
+ Capacitor Android Intent Filter configuration.
303
+
304
+ ```typescript
305
+ interface SdCapacitorIntentFilter {
306
+ action?: string;
307
+ category?: string;
308
+ }
309
+ ```
310
+
311
+ | Field | Type | Description |
312
+ |-------|------|-------------|
313
+ | `action` | `string` | Intent action (e.g., `"android.intent.action.VIEW"`) |
314
+ | `category` | `string` | Intent category (e.g., `"android.intent.category.DEFAULT"`) |
315
+
316
+ ## `SdElectronConfig`
317
+
318
+ Electron configuration.
319
+
320
+ ```typescript
321
+ interface SdElectronConfig {
322
+ appId: string;
323
+ portable?: boolean;
324
+ installerIcon?: string;
325
+ reinstallDependencies?: string[];
326
+ postInstallScript?: string;
327
+ nsisOptions?: Record<string, unknown>;
328
+ env?: Record<string, string>;
329
+ }
330
+ ```
331
+
332
+ | Field | Type | Description |
333
+ |-------|------|-------------|
334
+ | `appId` | `string` | Electron app ID (e.g., `"com.example.myapp"`) |
335
+ | `portable` | `boolean` | `true` for portable `.exe`, `false`/unspecified for NSIS installer |
336
+ | `installerIcon` | `string` | Installer icon path (`.ico`, relative to package directory) |
337
+ | `reinstallDependencies` | `string[]` | npm packages to include in Electron (native modules, etc.) |
338
+ | `postInstallScript` | `string` | npm postinstall script |
339
+ | `nsisOptions` | `Record<string, unknown>` | NSIS options (when `portable` is `false`) |
340
+ | `env` | `Record<string, string>` | Environment variables (accessible via `process.env` in `electron-main.ts`) |
@@ -0,0 +1,87 @@
1
+ # Publish Configuration Types
2
+
3
+ ## `SdPublishConfig`
4
+
5
+ Union of all publish configuration types. Discriminated by the `type` field.
6
+
7
+ ```typescript
8
+ type SdPublishConfig = SdNpmPublishConfig | SdLocalDirectoryPublishConfig | SdStoragePublishConfig;
9
+ ```
10
+
11
+ | Variant | Discriminant (`type`) |
12
+ |---------|----------------------|
13
+ | `SdNpmPublishConfig` | `"npm"` |
14
+ | `SdLocalDirectoryPublishConfig` | `"local-directory"` |
15
+ | `SdStoragePublishConfig` | `"ftp"`, `"ftps"`, `"sftp"` |
16
+
17
+ ## `SdNpmPublishConfig`
18
+
19
+ npm registry publish configuration.
20
+
21
+ ```typescript
22
+ interface SdNpmPublishConfig {
23
+ type: "npm";
24
+ }
25
+ ```
26
+
27
+ | Field | Type | Description |
28
+ |-------|------|-------------|
29
+ | `type` | `"npm"` | Publish type discriminator |
30
+
31
+ ## `SdLocalDirectoryPublishConfig`
32
+
33
+ Copy build output to a local directory.
34
+
35
+ ```typescript
36
+ interface SdLocalDirectoryPublishConfig {
37
+ type: "local-directory";
38
+ path: string;
39
+ }
40
+ ```
41
+
42
+ | Field | Type | Description |
43
+ |-------|------|-------------|
44
+ | `type` | `"local-directory"` | Publish type discriminator |
45
+ | `path` | `string` | Deployment target path (supports environment variable substitution: `%VER%`, `%PROJECT%`) |
46
+
47
+ ## `SdStoragePublishConfig`
48
+
49
+ Upload build output to FTP/FTPS/SFTP server.
50
+
51
+ ```typescript
52
+ interface SdStoragePublishConfig {
53
+ type: "ftp" | "ftps" | "sftp";
54
+ host: string;
55
+ port?: number;
56
+ path?: string;
57
+ user?: string;
58
+ password?: string;
59
+ }
60
+ ```
61
+
62
+ | Field | Type | Description |
63
+ |-------|------|-------------|
64
+ | `type` | `"ftp" \| "ftps" \| "sftp"` | Protocol |
65
+ | `host` | `string` | Server hostname |
66
+ | `port` | `number` | Server port |
67
+ | `path` | `string` | Remote path |
68
+ | `user` | `string` | Username |
69
+ | `password` | `string` | Password |
70
+
71
+ ## `SdPostPublishScriptConfig`
72
+
73
+ Script to run after publish completes.
74
+
75
+ ```typescript
76
+ interface SdPostPublishScriptConfig {
77
+ type: "script";
78
+ cmd: string;
79
+ args: string[];
80
+ }
81
+ ```
82
+
83
+ | Field | Type | Description |
84
+ |-------|------|-------------|
85
+ | `type` | `"script"` | Config type discriminator |
86
+ | `cmd` | `string` | Command to execute |
87
+ | `args` | `string[]` | Command arguments (supports environment variable substitution: `%VER%`, `%PROJECT%`) |
@@ -0,0 +1,55 @@
1
+ # PWA Configuration Types
2
+
3
+ ## `SdPwaConfig`
4
+
5
+ PWA configuration.
6
+
7
+ ```typescript
8
+ interface SdPwaConfig {
9
+ manifest?: SdPwaManifestConfig;
10
+ workbox?: SdPwaWorkboxConfig;
11
+ }
12
+ ```
13
+
14
+ | Field | Type | Description |
15
+ |-------|------|-------------|
16
+ | `manifest` | `SdPwaManifestConfig` | PWA manifest options |
17
+ | `workbox` | `SdPwaWorkboxConfig` | Workbox service worker options |
18
+
19
+ ## `SdPwaManifestConfig`
20
+
21
+ PWA manifest configuration (subset of VitePWA manifest options).
22
+
23
+ ```typescript
24
+ 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` | App name |
37
+ | `short_name` | `string` | Short app name |
38
+ | `display` | `"standalone" \| "fullscreen" \| "minimal-ui" \| "browser"` | Display mode |
39
+ | `theme_color` | `string` | Theme color |
40
+ | `background_color` | `string` | Background color |
41
+ | `icons` | `Array<{ src: string; sizes: string; type?: string }>` | App icons |
42
+
43
+ ## `SdPwaWorkboxConfig`
44
+
45
+ PWA workbox configuration.
46
+
47
+ ```typescript
48
+ interface SdPwaWorkboxConfig {
49
+ globPatterns?: string[];
50
+ }
51
+ ```
52
+
53
+ | Field | Type | Description |
54
+ |-------|------|-------------|
55
+ | `globPatterns` | `string[]` | Glob patterns for precaching |
@@ -0,0 +1,47 @@
1
+ # Vitest Plugin
2
+
3
+ ## `angularVitestPlugin`
4
+
5
+ Vite plugin for Angular AOT compilation in Vitest. Compiles `src/` files and `.fixture.` files using Angular's `NgtscProgram`, caching the compiled output in memory and returning it from the `transform` hook.
6
+
7
+ ```typescript
8
+ function angularVitestPlugin(options: AngularVitestPluginOptions): Plugin;
9
+ ```
10
+
11
+ | Parameter | Type | Description |
12
+ |-----------|------|-------------|
13
+ | `options` | `AngularVitestPluginOptions` | Plugin options |
14
+
15
+ **Returns:** A Vite `Plugin` object with `buildStart` and `transform` hooks.
16
+
17
+ **Behavior:**
18
+
19
+ - `buildStart`: Reads `tsconfig.json`, creates an Angular `NgtscProgram`, runs AOT analysis, and emits compiled JavaScript for each source file into an in-memory cache.
20
+ - `transform`: For `.ts` files (excluding `node_modules`), returns the cached compiled output if available.
21
+
22
+ **Usage:**
23
+
24
+ ```typescript
25
+ import { angularVitestPlugin } from "@simplysm/sd-cli/vitest-plugin";
26
+ import { defineConfig } from "vitest/config";
27
+
28
+ export default defineConfig({
29
+ plugins: [angularVitestPlugin({ tsconfig: "./tsconfig.json" })],
30
+ });
31
+ ```
32
+
33
+ ## `AngularVitestPluginOptions`
34
+
35
+ Options for `angularVitestPlugin`.
36
+
37
+ ```typescript
38
+ interface AngularVitestPluginOptions {
39
+ tsconfig: string;
40
+ cwd?: string;
41
+ }
42
+ ```
43
+
44
+ | Field | Type | Description |
45
+ |-------|------|-------------|
46
+ | `tsconfig` | `string` | Angular package's `tsconfig.json` absolute path |
47
+ | `cwd` | `string` | Monorepo workspace root path. When not specified, uses two directories above the `tsconfig` path |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-cli",
3
- "version": "14.0.11",
3
+ "version": "14.0.12",
4
4
  "description": "Simplysm package - CLI tool",
5
5
  "author": "simplysm",
6
6
  "license": "Apache-2.0",
@@ -14,21 +14,23 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
16
16
  "dist",
17
+ "docs",
17
18
  "src",
18
19
  "tests"
19
20
  ],
20
21
  "sideEffects": false,
21
22
  "dependencies": {
22
- "@angular/build": "^21.2.5",
23
- "@angular/compiler-cli": "^21.2.6",
23
+ "@angular/build": "^21.2.6",
24
+ "@angular/compiler-cli": "^21.2.7",
24
25
  "@fastify/http-proxy": "^11.4.3",
25
26
  "@inquirer/prompts": "^8.3.2",
26
27
  "browserslist-to-esbuild": "^2.1.1",
27
28
  "consola": "^3.4.2",
28
- "esbuild": "^0.27.4",
29
+ "esbuild": "^0.27.5",
29
30
  "eslint": "^9.39.4",
30
31
  "glob": "^13.0.6",
31
32
  "jiti": "^2.6.1",
33
+ "mime": "^4.1.0",
32
34
  "postcss": "^8.5.8",
33
35
  "sass": "^1.98.0",
34
36
  "semver": "^7.7.4",
@@ -39,9 +41,9 @@
39
41
  "vite-plugin-pwa": "^1.2.0",
40
42
  "vite-tsconfig-paths": "^6.1.1",
41
43
  "yargs": "^18.0.0",
42
- "@simplysm/core-common": "14.0.11",
43
- "@simplysm/core-node": "14.0.11",
44
- "@simplysm/storage": "14.0.11"
44
+ "@simplysm/core-node": "14.0.12",
45
+ "@simplysm/storage": "14.0.12",
46
+ "@simplysm/core-common": "14.0.12"
45
47
  },
46
48
  "devDependencies": {
47
49
  "@types/semver": "^7.7.1",
@@ -52,7 +52,7 @@ export function createClientTransformStylesheet(
52
52
  return "/* SCSS compilation error */";
53
53
  }
54
54
  }
55
- // .css → readResource가 처리
55
+ // .css → externalStylesheets의 SHA256 ID 매핑으로 처리
56
56
  return null;
57
57
  }
58
58