@simplysm/sd-cli 14.0.76 → 14.0.77

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 (185) hide show
  1. package/dist/angular/ngtsc-build-core.js +2 -2
  2. package/dist/angular/ngtsc-build-core.js.map +1 -1
  3. package/dist/angular/vite-angular-plugin.js +2 -2
  4. package/dist/angular/vite-angular-plugin.js.map +1 -1
  5. package/dist/capacitor/capacitor-android.js +2 -2
  6. package/dist/capacitor/capacitor-android.js.map +1 -1
  7. package/dist/capacitor/capacitor-build.js +2 -2
  8. package/dist/capacitor/capacitor-build.js.map +1 -1
  9. package/dist/capacitor/capacitor-icon.js +2 -2
  10. package/dist/capacitor/capacitor-icon.js.map +1 -1
  11. package/dist/capacitor/capacitor-npm-config.js +2 -2
  12. package/dist/capacitor/capacitor-npm-config.js.map +1 -1
  13. package/dist/capacitor/capacitor.d.ts.map +1 -1
  14. package/dist/capacitor/capacitor.js +2 -2
  15. package/dist/capacitor/capacitor.js.map +1 -1
  16. package/dist/commands/check.d.ts.map +1 -1
  17. package/dist/commands/check.js +2 -3
  18. package/dist/commands/check.js.map +1 -1
  19. package/dist/commands/device.js +2 -2
  20. package/dist/commands/device.js.map +1 -1
  21. package/dist/commands/init/init.js +2 -2
  22. package/dist/commands/init/init.js.map +1 -1
  23. package/dist/commands/publish/deployment-phase.d.ts +2 -2
  24. package/dist/commands/publish/deployment-phase.d.ts.map +1 -1
  25. package/dist/commands/publish/deployment-phase.js.map +1 -1
  26. package/dist/commands/publish/git-phase.d.ts +3 -3
  27. package/dist/commands/publish/git-phase.d.ts.map +1 -1
  28. package/dist/commands/publish/git-phase.js.map +1 -1
  29. package/dist/commands/publish/local-publisher.d.ts +2 -2
  30. package/dist/commands/publish/local-publisher.d.ts.map +1 -1
  31. package/dist/commands/publish/local-publisher.js.map +1 -1
  32. package/dist/commands/publish/npm-publisher.d.ts +2 -2
  33. package/dist/commands/publish/npm-publisher.d.ts.map +1 -1
  34. package/dist/commands/publish/npm-publisher.js.map +1 -1
  35. package/dist/commands/publish/post-publish-phase.d.ts +2 -2
  36. package/dist/commands/publish/post-publish-phase.d.ts.map +1 -1
  37. package/dist/commands/publish/post-publish-phase.js.map +1 -1
  38. package/dist/commands/publish/publish-command.js +2 -2
  39. package/dist/commands/publish/publish-command.js.map +1 -1
  40. package/dist/commands/publish/storage-publisher.d.ts +3 -3
  41. package/dist/commands/publish/storage-publisher.d.ts.map +1 -1
  42. package/dist/commands/publish/storage-publisher.js.map +1 -1
  43. package/dist/commands/replace-deps.js +2 -2
  44. package/dist/commands/replace-deps.js.map +1 -1
  45. package/dist/deps/replace-deps/collect-deps.js +2 -2
  46. package/dist/deps/replace-deps/collect-deps.js.map +1 -1
  47. package/dist/deps/replace-deps/replace-deps-resolve.d.ts +2 -2
  48. package/dist/deps/replace-deps/replace-deps-resolve.d.ts.map +1 -1
  49. package/dist/deps/replace-deps/replace-deps-resolve.js.map +1 -1
  50. package/dist/deps/replace-deps/replace-deps.d.ts.map +1 -1
  51. package/dist/deps/replace-deps/replace-deps.js +4 -3
  52. package/dist/deps/replace-deps/replace-deps.js.map +1 -1
  53. package/dist/deps/server-externals/server-production-files.js +2 -2
  54. package/dist/deps/server-externals/server-production-files.js.map +1 -1
  55. package/dist/electron/electron.d.ts.map +1 -1
  56. package/dist/electron/electron.js +2 -2
  57. package/dist/electron/electron.js.map +1 -1
  58. package/dist/engines/BaseEngine.js +2 -2
  59. package/dist/engines/BaseEngine.js.map +1 -1
  60. package/dist/engines/EsbuildClientEngine.js +2 -2
  61. package/dist/engines/EsbuildClientEngine.js.map +1 -1
  62. package/dist/engines/NgtscEngine.js +2 -2
  63. package/dist/engines/NgtscEngine.js.map +1 -1
  64. package/dist/engines/ServerEsbuildEngine.js +2 -2
  65. package/dist/engines/ServerEsbuildEngine.js.map +1 -1
  66. package/dist/engines/TscEngine.js +2 -2
  67. package/dist/engines/TscEngine.js.map +1 -1
  68. package/dist/engines/engine-factory.js +2 -2
  69. package/dist/engines/engine-factory.js.map +1 -1
  70. package/dist/esbuild/esbuild-angular-compiler-plugin.js +2 -2
  71. package/dist/esbuild/esbuild-angular-compiler-plugin.js.map +1 -1
  72. package/dist/esbuild/esbuild-config.js +2 -2
  73. package/dist/esbuild/esbuild-config.js.map +1 -1
  74. package/dist/lint/lint-core.d.ts.map +1 -1
  75. package/dist/lint/lint-core.js +2 -3
  76. package/dist/lint/lint-core.js.map +1 -1
  77. package/dist/lint/lint-with-program.js +2 -2
  78. package/dist/lint/lint-with-program.js.map +1 -1
  79. package/dist/orchestrators/BaseOrchestrator.d.ts.map +1 -1
  80. package/dist/orchestrators/BaseOrchestrator.js +3 -2
  81. package/dist/orchestrators/BaseOrchestrator.js.map +1 -1
  82. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  83. package/dist/orchestrators/BuildOrchestrator.js +2 -2
  84. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  85. package/dist/orchestrators/TypecheckOrchestrator.d.ts.map +1 -1
  86. package/dist/orchestrators/TypecheckOrchestrator.js +2 -2
  87. package/dist/orchestrators/TypecheckOrchestrator.js.map +1 -1
  88. package/dist/runtime/rebuild-manager.d.ts +2 -2
  89. package/dist/runtime/rebuild-manager.d.ts.map +1 -1
  90. package/dist/runtime/rebuild-manager.js +1 -1
  91. package/dist/runtime/rebuild-manager.js.map +1 -1
  92. package/dist/sd-cli-entry.js +2 -2
  93. package/dist/sd-cli-entry.js.map +1 -1
  94. package/dist/sd-cli.js +2 -2
  95. package/dist/sd-cli.js.map +1 -1
  96. package/dist/ts-compiler/SdTsCompiler.d.ts.map +1 -1
  97. package/dist/ts-compiler/SdTsCompiler.js +3 -7
  98. package/dist/ts-compiler/SdTsCompiler.js.map +1 -1
  99. package/dist/typecheck/typecheck-non-package.js +2 -2
  100. package/dist/typecheck/typecheck-non-package.js.map +1 -1
  101. package/dist/utils/output-utils.js +2 -2
  102. package/dist/utils/output-utils.js.map +1 -1
  103. package/dist/utils/package-classify.js +2 -2
  104. package/dist/utils/package-classify.js.map +1 -1
  105. package/dist/utils/package-utils.js +2 -2
  106. package/dist/utils/package-utils.js.map +1 -1
  107. package/dist/utils/sd-config.js +2 -2
  108. package/dist/utils/sd-config.js.map +1 -1
  109. package/dist/utils/tsconfig.js +2 -2
  110. package/dist/utils/tsconfig.js.map +1 -1
  111. package/dist/workers/server-runtime.worker.js +2 -2
  112. package/dist/workers/server-runtime.worker.js.map +1 -1
  113. package/dist/workers/shared-worker-lifecycle.d.ts +1 -1
  114. package/dist/workers/shared-worker-lifecycle.d.ts.map +1 -1
  115. package/dist/workers/shared-worker-lifecycle.js +4 -3
  116. package/dist/workers/shared-worker-lifecycle.js.map +1 -1
  117. package/package.json +4 -4
  118. package/src/angular/ngtsc-build-core.ts +2 -2
  119. package/src/angular/vite-angular-plugin.ts +2 -2
  120. package/src/capacitor/capacitor-android.ts +2 -2
  121. package/src/capacitor/capacitor-build.ts +2 -2
  122. package/src/capacitor/capacitor-icon.ts +2 -2
  123. package/src/capacitor/capacitor-npm-config.ts +2 -2
  124. package/src/capacitor/capacitor.ts +2 -2
  125. package/src/commands/check.ts +2 -3
  126. package/src/commands/device.ts +2 -2
  127. package/src/commands/init/init.ts +2 -2
  128. package/src/commands/publish/deployment-phase.ts +3 -3
  129. package/src/commands/publish/git-phase.ts +3 -3
  130. package/src/commands/publish/local-publisher.ts +2 -2
  131. package/src/commands/publish/npm-publisher.ts +2 -2
  132. package/src/commands/publish/post-publish-phase.ts +2 -2
  133. package/src/commands/publish/publish-command.ts +2 -2
  134. package/src/commands/publish/storage-publisher.ts +3 -3
  135. package/src/commands/replace-deps.ts +2 -2
  136. package/src/deps/replace-deps/collect-deps.ts +2 -2
  137. package/src/deps/replace-deps/replace-deps-resolve.ts +2 -2
  138. package/src/deps/replace-deps/replace-deps.ts +5 -4
  139. package/src/deps/server-externals/server-production-files.ts +2 -2
  140. package/src/electron/electron.ts +2 -2
  141. package/src/engines/BaseEngine.ts +2 -2
  142. package/src/engines/EsbuildClientEngine.ts +2 -2
  143. package/src/engines/NgtscEngine.ts +2 -2
  144. package/src/engines/ServerEsbuildEngine.ts +2 -2
  145. package/src/engines/TscEngine.ts +2 -2
  146. package/src/engines/engine-factory.ts +2 -2
  147. package/src/esbuild/esbuild-angular-compiler-plugin.ts +2 -2
  148. package/src/esbuild/esbuild-config.ts +2 -2
  149. package/src/lint/lint-core.ts +2 -3
  150. package/src/lint/lint-with-program.ts +2 -2
  151. package/src/orchestrators/BaseOrchestrator.ts +3 -2
  152. package/src/orchestrators/BuildOrchestrator.ts +2 -2
  153. package/src/orchestrators/TypecheckOrchestrator.ts +2 -2
  154. package/src/runtime/rebuild-manager.ts +3 -3
  155. package/src/sd-cli-entry.ts +2 -2
  156. package/src/sd-cli.ts +2 -2
  157. package/src/ts-compiler/SdTsCompiler.ts +3 -7
  158. package/src/typecheck/typecheck-non-package.ts +2 -2
  159. package/src/utils/output-utils.ts +2 -2
  160. package/src/utils/package-classify.ts +2 -2
  161. package/src/utils/package-utils.ts +2 -2
  162. package/src/utils/sd-config.ts +2 -2
  163. package/src/utils/tsconfig.ts +2 -2
  164. package/src/workers/server-runtime.worker.ts +2 -2
  165. package/src/workers/shared-worker-lifecycle.ts +4 -3
  166. package/tests/commands/check.spec.ts +2 -2
  167. package/tests/commands/deployment-phase.acc.spec.ts +5 -5
  168. package/tests/commands/git-phase.acc.spec.ts +1 -1
  169. package/tests/commands/post-publish-phase.acc.spec.ts +1 -1
  170. package/tests/commands/typecheck.spec.ts +2 -2
  171. package/tests/deps/replace-deps/replace-deps-resolve.acc.spec.ts +2 -2
  172. package/tests/electron/electron.spec.ts +3 -3
  173. package/tests/orchestrators/build-orchestrator.spec.ts +2 -2
  174. package/tests/utils/lint-with-program.spec.ts +2 -2
  175. package/tests/utils/output-utils.spec.ts +4 -3
  176. package/tests/utils/replace-deps-watch.spec.ts +2 -2
  177. package/tests/utils/worker-utils.spec.ts +3 -2
  178. package/tests/workers/build-change-filter.acc.spec.ts +2 -2
  179. package/tests/workers/build-change-filter.spec.ts +2 -2
  180. package/tests/workers/shared-worker-lifecycle.spec.ts +5 -5
  181. package/dist/runtime/lazy-logger.d.ts +0 -14
  182. package/dist/runtime/lazy-logger.d.ts.map +0 -1
  183. package/dist/runtime/lazy-logger.js +0 -23
  184. package/dist/runtime/lazy-logger.js.map +0 -1
  185. package/src/runtime/lazy-logger.ts +0 -23
@@ -1,8 +1,8 @@
1
1
  import { cpx, fsx, pathx } from "@simplysm/core-node";
2
2
  import { consola, LogLevels } from "consola";
3
- import { createLazyLogger } from "../runtime/lazy-logger";
3
+ import { createLogger } from "@simplysm/core-common";
4
4
 
5
- const _logger = createLazyLogger("sd:cli:capacitor");
5
+ const _logger = createLogger("sd:cli:capacitor");
6
6
 
7
7
  /**
8
8
  * 앱 아이콘 처리 (소스 이미지 → 멀티 해상도 아이콘 + 스플래시)
@@ -3,11 +3,11 @@ import { existsSync } from "node:fs";
3
3
  import { createRequire } from "module";
4
4
  import { consola, LogLevels } from "consola";
5
5
  import { fsx, pathx } from "@simplysm/core-node";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
  import { shellSpawn } from "../utils/shell-spawn";
8
8
  import type { NpmConfig, SdCapacitorConfig } from "../sd-config.types.js";
9
9
 
10
- const logger = createLazyLogger("sd:cli:capacitor:npm-config");
10
+ const logger = createLogger("sd:cli:capacitor:npm-config");
11
11
 
12
12
  /**
13
13
  * .capacitor/package.json을 구성하고 의존성 변경 여부를 반환한다.
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import { cpx, fsx, pathx } from "@simplysm/core-node";
3
3
  import { consola, LogLevels } from "consola";
4
- import { createLazyLogger } from "../runtime/lazy-logger";
4
+ import { createLogger } from "@simplysm/core-common";
5
5
  import type { NpmConfig, SdCapacitorConfig } from "../sd-config.types.js";
6
6
  import { configureAndroid, findAndroidSdk, findJava21 } from "./capacitor-android.js";
7
7
  import { buildAndroid, configureSigningConfig, copyBuildOutput } from "./capacitor-build.js";
@@ -27,7 +27,7 @@ class CapacitorConfigError extends Error {
27
27
  */
28
28
  export class Capacitor {
29
29
  private static readonly _LOCK_FILE_NAME = ".capacitor.lock";
30
- private static readonly _logger = createLazyLogger("sd:cli:capacitor");
30
+ private static readonly _logger = createLogger("sd:cli:capacitor");
31
31
 
32
32
  private readonly _capPath: string;
33
33
  private readonly _platforms: string[];
@@ -1,7 +1,6 @@
1
- import { err as errNs } from "@simplysm/core-common";
1
+ import { err as errNs, createLogger } from "@simplysm/core-common";
2
2
  import { executeTypecheck, type TypecheckResult } from "../orchestrators/TypecheckOrchestrator";
3
3
  import { executeLint, type LintResult } from "../lint/lint-core";
4
- import { consola } from "consola";
5
4
  import { validateTargets, discoverWorkspacePackages } from "../utils/package-utils";
6
5
  import { runLintInWorker } from "../lint/lint-utils";
7
6
 
@@ -29,7 +28,7 @@ interface CheckResult {
29
28
 
30
29
  export async function runCheck(options: CheckOptions): Promise<void> {
31
30
  const { targets, types } = options;
32
- const logger = consola.withTag("sd:cli:check");
31
+ const logger = createLogger("sd:cli:check");
33
32
 
34
33
  logger.debug("체크 시작", { targets, types });
35
34
 
@@ -3,12 +3,12 @@ import http from "node:http";
3
3
  import path from "path";
4
4
  import { pathx } from "@simplysm/core-node";
5
5
  import { SdError } from "@simplysm/core-common";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
  import { loadSdConfig } from "../utils/sd-config";
8
8
  import { Capacitor } from "../capacitor/capacitor";
9
9
  import { Electron } from "../electron/electron";
10
10
 
11
- const logger = createLazyLogger("sd:cli:device");
11
+ const logger = createLogger("sd:cli:device");
12
12
 
13
13
  export interface DeviceOptions {
14
14
  target?: string;
@@ -1,5 +1,5 @@
1
1
  import crypto from "crypto";
2
- import { createLazyLogger } from "../../runtime/lazy-logger";
2
+ import { createLogger } from "@simplysm/core-common";
3
3
  import { generateClient } from "./generators/client";
4
4
  import { generateClientCommon } from "./generators/client-common";
5
5
  import { generateCommon } from "./generators/common";
@@ -10,7 +10,7 @@ import { promptInit } from "./prompts";
10
10
  import type { RenderData } from "./types";
11
11
  import { validateBeforePrompt, validateInput } from "./validate";
12
12
 
13
- const logger = createLazyLogger("sd:cli:init");
13
+ const logger = createLogger("sd:cli:init");
14
14
 
15
15
  export interface InitOptions {
16
16
  cwd: string;
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import type { consola } from "consola";
2
+ import type { ConsolaInstance } from "consola";
3
3
  import type { SdPublishConfig } from "../../sd-config.types";
4
4
  import { publishNpm } from "./npm-publisher";
5
5
  import { publishToStorage } from "./storage-publisher";
@@ -21,7 +21,7 @@ async function publishPackage(
21
21
  publishConfig: SdPublishConfig,
22
22
  version: string,
23
23
  projectPath: string,
24
- logger: ReturnType<typeof consola.withTag>,
24
+ logger: ConsolaInstance,
25
25
  dryRun: boolean,
26
26
  ): Promise<void> {
27
27
  const pkgName = path.basename(pkgPath);
@@ -43,7 +43,7 @@ export async function runDeployment(
43
43
  publishPackages: DeploymentPackage[],
44
44
  version: string,
45
45
  projectPath: string,
46
- logger: ReturnType<typeof consola.withTag>,
46
+ logger: ConsolaInstance,
47
47
  dryRun: boolean,
48
48
  ): Promise<void> {
49
49
  const levels = await computePublishLevels(publishPackages);
@@ -1,4 +1,4 @@
1
- import type { consola } from "consola";
1
+ import type { ConsolaInstance } from "consola";
2
2
  import { cpx } from "@simplysm/core-node";
3
3
 
4
4
  /**
@@ -7,7 +7,7 @@ import { cpx } from "@simplysm/core-node";
7
7
  */
8
8
  export async function ensureCleanWorkingTree(
9
9
  hasGit: boolean,
10
- logger: ReturnType<typeof consola.withTag>,
10
+ logger: ConsolaInstance,
11
11
  ): Promise<void> {
12
12
  if (!hasGit) return;
13
13
 
@@ -57,7 +57,7 @@ export async function commitTagAndPush(
57
57
  hasGit: boolean,
58
58
  version: string,
59
59
  changedFiles: string[],
60
- logger: ReturnType<typeof consola.withTag>,
60
+ logger: ConsolaInstance,
61
61
  dryRun: boolean,
62
62
  ): Promise<void> {
63
63
  if (!hasGit) return;
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import type { consola } from "consola";
2
+ import type { ConsolaInstance } from "consola";
3
3
  import { fsx } from "@simplysm/core-node";
4
4
 
5
5
  /**
@@ -9,7 +9,7 @@ export async function publishToLocal(
9
9
  pkgPath: string,
10
10
  pkgName: string,
11
11
  targetPath: string,
12
- logger: ReturnType<typeof consola.withTag>,
12
+ logger: ConsolaInstance,
13
13
  dryRun: boolean,
14
14
  ): Promise<void> {
15
15
  const distPath = path.resolve(pkgPath, "dist");
@@ -1,5 +1,5 @@
1
1
  import semver from "semver";
2
- import type { consola } from "consola";
2
+ import type { ConsolaInstance } from "consola";
3
3
  import { shellSpawn } from "../../utils/shell-spawn";
4
4
 
5
5
  /**
@@ -9,7 +9,7 @@ export async function publishNpm(
9
9
  pkgPath: string,
10
10
  pkgName: string,
11
11
  version: string,
12
- logger: ReturnType<typeof consola.withTag>,
12
+ logger: ConsolaInstance,
13
13
  dryRun: boolean,
14
14
  ): Promise<void> {
15
15
  const prereleaseInfo = semver.prerelease(version);
@@ -1,4 +1,4 @@
1
- import type { consola } from "consola";
1
+ import type { ConsolaInstance } from "consola";
2
2
  import type { SdPostPublishScriptConfig } from "../../sd-config.types";
3
3
  import { cpx } from "@simplysm/core-node";
4
4
  import { replaceEnvVariables } from "./env-utils";
@@ -11,7 +11,7 @@ export async function runPostPublish(
11
11
  scripts: SdPostPublishScriptConfig[],
12
12
  version: string,
13
13
  projectPath: string,
14
- logger: ReturnType<typeof consola.withTag>,
14
+ logger: ConsolaInstance,
15
15
  dryRun: boolean,
16
16
  ): Promise<void> {
17
17
  if (scripts.length === 0) return;
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { consola } from "consola";
2
+ import { createLogger } from "@simplysm/core-common";
3
3
  import { fsx } from "@simplysm/core-node";
4
4
  import "@simplysm/core-common";
5
5
  import type { SdConfig, SdPublishConfig } from "../../sd-config.types";
@@ -50,7 +50,7 @@ export interface PublishOptions {
50
50
  export async function runPublish(options: PublishOptions): Promise<void> {
51
51
  const { targets, noBuild, dryRun } = options;
52
52
  const cwd = process.cwd();
53
- const logger = consola.withTag("sd:cli:publish");
53
+ const logger = createLogger("sd:cli:publish");
54
54
 
55
55
  if (dryRun) {
56
56
  logger.info("[DRY-RUN] 시뮬레이션 모드 - 실제 배포 없음");
@@ -5,7 +5,7 @@ import ssh2 from "ssh2";
5
5
  import { password as passwordPrompt } from "@inquirer/prompts";
6
6
  import { StorageFactory } from "@simplysm/storage";
7
7
  import { env } from "@simplysm/core-common";
8
- import type { consola } from "consola";
8
+ import type { ConsolaInstance } from "consola";
9
9
  import type { SdPublishConfig, SdStoragePublishConfig } from "../../sd-config.types";
10
10
 
11
11
  const { Client: SshClient, utils } = ssh2;
@@ -17,7 +17,7 @@ export async function publishToStorage(
17
17
  pkgPath: string,
18
18
  pkgName: string,
19
19
  config: SdStoragePublishConfig,
20
- logger: ReturnType<typeof consola.withTag>,
20
+ logger: ConsolaInstance,
21
21
  dryRun: boolean,
22
22
  ): Promise<void> {
23
23
  const distPath = path.resolve(pkgPath, "dist");
@@ -51,7 +51,7 @@ export async function publishToStorage(
51
51
  */
52
52
  export async function ensureSshAuth(
53
53
  publishPackages: Array<{ name: string; config: SdPublishConfig }>,
54
- logger: ReturnType<typeof consola.withTag>,
54
+ logger: ConsolaInstance,
55
55
  ): Promise<void> {
56
56
  // 비밀번호 없는 SFTP 서버 수집 (user@host 기준 중복 제거)
57
57
  const sshTargets = new Map<string, { host: string; port?: number; user: string }>();
@@ -1,8 +1,8 @@
1
- import { createLazyLogger } from "../runtime/lazy-logger";
1
+ import { createLogger } from "@simplysm/core-common";
2
2
  import { loadSdConfig } from "../utils/sd-config";
3
3
  import { setupReplaceDeps } from "../deps/replace-deps/replace-deps";
4
4
 
5
- const logger = createLazyLogger("sd:cli:replace-deps");
5
+ const logger = createLogger("sd:cli:replace-deps");
6
6
 
7
7
  /**
8
8
  * replace-deps 명령어 옵션
@@ -1,10 +1,10 @@
1
1
  import path from "path";
2
2
  import fs from "fs";
3
3
  import { pathx } from "@simplysm/core-node";
4
- import { createLazyLogger } from "../../runtime/lazy-logger";
4
+ import { createLogger } from "@simplysm/core-common";
5
5
  import { discoverWorkspacePackages } from "../../utils/package-utils";
6
6
 
7
- const logger = createLazyLogger("sd:cli:collect-deps");
7
+ const logger = createLogger("sd:cli:collect-deps");
8
8
 
9
9
  export interface DepsResult {
10
10
  workspaceDeps: string[];
@@ -1,7 +1,7 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import { glob } from "glob";
4
- import type { consola } from "consola";
4
+ import type { ConsolaInstance } from "consola";
5
5
  import { pathx } from "@simplysm/core-node";
6
6
 
7
7
  /**
@@ -137,7 +137,7 @@ async function collectSearchRoots(projectRoot: string): Promise<string[]> {
137
137
  export async function resolveAllReplaceDepEntries(
138
138
  projectRoot: string,
139
139
  replaceDeps: Record<string, string>,
140
- logger: ReturnType<typeof consola.withTag>,
140
+ logger: ConsolaInstance,
141
141
  ): Promise<ReplaceDepEntry[]> {
142
142
  const entries: ReplaceDepEntry[] = [];
143
143
  const seenTargetPaths = new Set<string>();
@@ -1,6 +1,7 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { consola } from "consola";
3
+ import { type ConsolaInstance } from "consola";
4
+ import { createLogger } from "@simplysm/core-common";
4
5
  import { fsx, pathx, FsWatcher } from "@simplysm/core-node";
5
6
  import { exec } from "child_process";
6
7
  import { promisify } from "util";
@@ -90,7 +91,7 @@ async function copyWithUnlink(
90
91
  */
91
92
  async function runPostinstall(
92
93
  entry: ReplaceDepEntry,
93
- logger: ReturnType<typeof consola.withTag>,
94
+ logger: ConsolaInstance,
94
95
  ): Promise<void> {
95
96
  const sourcePkgJsonPath = pathx.posix(path.join(entry.resolvedSourcePath, "package.json"));
96
97
  try {
@@ -170,7 +171,7 @@ export async function setupReplaceDeps(
170
171
  projectRoot: string,
171
172
  replaceDeps: Record<string, string>,
172
173
  ): Promise<void> {
173
- const logger = consola.withTag("sd:cli:replace-deps");
174
+ const logger = createLogger("sd:cli:replace-deps");
174
175
 
175
176
  logger.start("replace-deps 설정 중...");
176
177
 
@@ -221,7 +222,7 @@ export async function watchReplaceDeps(
221
222
  replaceDeps: Record<string, string>,
222
223
  options?: { onChanged?: () => void },
223
224
  ): Promise<WatchReplaceDepResult> {
224
- const logger = consola.withTag("sd:cli:replace-deps:watch");
225
+ const logger = createLogger("sd:cli:replace-deps:watch");
225
226
 
226
227
  const entries = await resolveAllReplaceDepEntries(projectRoot, replaceDeps, logger);
227
228
 
@@ -4,10 +4,10 @@ import fs from "fs";
4
4
  import YAML from "yaml";
5
5
  import TOML from "smol-toml";
6
6
  import { cpx } from "@simplysm/core-node";
7
- import { createLazyLogger } from "../../runtime/lazy-logger";
7
+ import { createLogger } from "@simplysm/core-common";
8
8
  import { collectAllDependencyExternals } from "../../esbuild/esbuild-config";
9
9
 
10
- const logger = createLazyLogger("sd:cli:server-production-files");
10
+ const logger = createLogger("sd:cli:server-production-files");
11
11
 
12
12
  /**
13
13
  * 외부 모듈을 두 용도로 분리하여 수집한다.
@@ -4,13 +4,13 @@ import module from "module";
4
4
  import { fsx, pathx } from "@simplysm/core-node";
5
5
  import type { cpx } from "@simplysm/core-node";
6
6
  import { consola, LogLevels } from "consola";
7
- import { createLazyLogger } from "../runtime/lazy-logger";
7
+ import { createLogger } from "@simplysm/core-common";
8
8
  import { shellSpawn } from "../utils/shell-spawn";
9
9
  import type { NpmConfig, SdElectronConfig } from "../sd-config.types.js";
10
10
  import { createEnvBanner } from "../esbuild/esbuild-config.js";
11
11
 
12
12
  export class Electron {
13
- private static readonly _logger = createLazyLogger("sd:cli:electron");
13
+ private static readonly _logger = createLogger("sd:cli:electron");
14
14
 
15
15
  private readonly _electronPath: string;
16
16
  private readonly _srcPath: string;
@@ -3,13 +3,13 @@ import { err as errNs } from "@simplysm/core-common";
3
3
  import type { BuildResult, ResultCollector } from "../runtime/ResultCollector";
4
4
  import { stopEngineWorker } from "../runtime/engine-stop";
5
5
  import { setupWatchEvents } from "../runtime/engine-watch-events";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
  import type { LintWithProgramResult } from "../lint/lint-with-program";
8
8
  import type { RebuildManager } from "../runtime/rebuild-manager";
9
9
  import type { SerializedDiagnostic } from "../typecheck/typecheck-serialization";
10
10
  import type { BuildEngine, BuildOutput, EngineResult, PackageInfo } from "./types";
11
11
 
12
- const logger = createLazyLogger("sd:cli:engine");
12
+ const logger = createLogger("sd:cli:engine");
13
13
 
14
14
  /**
15
15
  * 모든 빌드 워커가 공유하는 공통 빌드 워커 이벤트
@@ -5,11 +5,11 @@ import type * as ClientWorkerModule from "../workers/client.worker";
5
5
  import type { ResultCollector } from "../runtime/ResultCollector";
6
6
  import { stopEngineWorker } from "../runtime/engine-stop";
7
7
  import { setupWatchEvents, type NormalizedBuildInfo } from "../runtime/engine-watch-events";
8
- import { createLazyLogger } from "../runtime/lazy-logger";
8
+ import { createLogger } from "@simplysm/core-common";
9
9
  import type { RebuildManager } from "../runtime/rebuild-manager";
10
10
  import type { BuildEngine, BuildOutput, ClientPackageInfo, EngineResult } from "./types";
11
11
 
12
- const logger = createLazyLogger("sd:cli:engine:esbuild-client");
12
+ const logger = createLogger("sd:cli:engine:esbuild-client");
13
13
 
14
14
  /**
15
15
  * EsbuildClientEngine 옵션
@@ -3,9 +3,9 @@ import type { ResultCollector } from "../runtime/ResultCollector";
3
3
  import type { RebuildManager } from "../runtime/rebuild-manager";
4
4
  import type { BuildOutput, BuildPackageInfo, EngineResult } from "./types";
5
5
  import { BaseEngine, type CommonBuildWorkerModule } from "./BaseEngine";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
 
8
- const logger = createLazyLogger("sd:cli:engine:ngtsc");
8
+ const logger = createLogger("sd:cli:engine:ngtsc");
9
9
 
10
10
  /**
11
11
  * NgtscEngine 옵션
@@ -3,9 +3,9 @@ import type { ResultCollector } from "../runtime/ResultCollector";
3
3
  import type { RebuildManager } from "../runtime/rebuild-manager";
4
4
  import type { BuildOutput, EngineResult, ServerPackageInfo } from "./types";
5
5
  import { BaseEngine, type CommonBuildWorkerModule } from "./BaseEngine";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
 
8
- const logger = createLazyLogger("sd:cli:engine:server");
8
+ const logger = createLogger("sd:cli:engine:server");
9
9
 
10
10
  /**
11
11
  * ServerEsbuildEngine 옵션
@@ -3,9 +3,9 @@ import type { ResultCollector } from "../runtime/ResultCollector";
3
3
  import type { RebuildManager } from "../runtime/rebuild-manager";
4
4
  import type { BuildOutput, BuildPackageInfo, EngineResult } from "./types";
5
5
  import { BaseEngine, type CommonBuildWorkerModule } from "./BaseEngine";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
 
8
- const logger = createLazyLogger("sd:cli:engine:tsc");
8
+ const logger = createLogger("sd:cli:engine:tsc");
9
9
 
10
10
  /**
11
11
  * TscEngine 옵션
@@ -1,5 +1,5 @@
1
1
  import type { ResultCollector } from "../runtime/ResultCollector";
2
- import { createLazyLogger } from "../runtime/lazy-logger";
2
+ import { createLogger } from "@simplysm/core-common";
3
3
  import type { RebuildManager } from "../runtime/rebuild-manager";
4
4
  import { hasAngularCoreDependency } from "../utils/package-utils";
5
5
  import { NgtscEngine } from "./NgtscEngine";
@@ -8,7 +8,7 @@ import { TscEngine } from "./TscEngine";
8
8
  import { EsbuildClientEngine } from "./EsbuildClientEngine";
9
9
  import type { BuildEngine, BuildPackageInfo, ClientPackageInfo, ServerPackageInfo } from "./types";
10
10
 
11
- const logger = createLazyLogger("sd:cli:engine");
11
+ const logger = createLogger("sd:cli:engine");
12
12
 
13
13
 
14
14
  /**
@@ -4,7 +4,7 @@ import os from "os";
4
4
  import ts from "typescript";
5
5
  import type esbuild from "esbuild";
6
6
  import { JavaScriptTransformer, Cache as AngularCache } from "@angular/build/private";
7
- import { createLazyLogger } from "../runtime/lazy-logger";
7
+ import { createLogger } from "@simplysm/core-common";
8
8
  import type { AngularSourceFileCache } from "../angular/angular-compiler";
9
9
  import type {
10
10
  SerializedDiagnostic,
@@ -18,7 +18,7 @@ import { createCachedLoad, type LoadResultCache } from "./load-result-cache";
18
18
  import { collectHmrCandidates, HMR_MODIFIED_FILE_LIMIT } from "../angular/hmr-candidates";
19
19
  import { transformWorkerPatterns } from "./esbuild-worker-plugin";
20
20
 
21
- const logger = createLazyLogger("sd:cli:angular-plugin");
21
+ const logger = createLogger("sd:cli:angular-plugin");
22
22
 
23
23
  //#region Types
24
24
 
@@ -3,10 +3,10 @@ import { readFileSync, existsSync } from "fs";
3
3
  import fs from "fs/promises";
4
4
  import { createRequire } from "module";
5
5
  import type esbuild from "esbuild";
6
- import { createLazyLogger } from "../runtime/lazy-logger";
6
+ import { createLogger } from "@simplysm/core-common";
7
7
  import { addJsExtensionToImports } from "../utils/output-path-rewriter";
8
8
 
9
- const logger = createLazyLogger("sd:cli:esbuild-config");
9
+ const logger = createLogger("sd:cli:esbuild-config");
10
10
 
11
11
  /**
12
12
  * esbuild outputFiles에서 변경된 파일만 디스크에 쓴다.
@@ -2,8 +2,7 @@ import { ESLint } from "eslint";
2
2
  import { createJiti } from "jiti";
3
3
  import path from "path";
4
4
  import { fsx, pathx } from "@simplysm/core-node";
5
- import { env, SdError } from "@simplysm/core-common";
6
- import { consola } from "consola";
5
+ import { env, SdError, createLogger } from "@simplysm/core-common";
7
6
 
8
7
  //#region Types
9
8
 
@@ -120,7 +119,7 @@ export async function loadIgnorePatterns(cwd: string): Promise<string[]> {
120
119
  export async function executeLint(options: LintOptions): Promise<LintResult> {
121
120
  const { targets, fix, timing } = options;
122
121
  const cwd = process.cwd();
123
- const logger = consola.withTag("sd:cli:lint");
122
+ const logger = createLogger("sd:cli:lint");
124
123
 
125
124
  logger.debug("린트 시작", { targets, fix, timing });
126
125
 
@@ -1,9 +1,9 @@
1
1
  import type ts from "typescript";
2
2
  import { ESLint } from "eslint";
3
3
  import { pathx } from "@simplysm/core-node";
4
- import { createLazyLogger } from "../runtime/lazy-logger";
4
+ import { createLogger } from "@simplysm/core-common";
5
5
 
6
- const logger = createLazyLogger("sd:cli:lint-with-program");
6
+ const logger = createLogger("sd:cli:lint-with-program");
7
7
 
8
8
  /**
9
9
  * LintWithProgramRunner.lint()가 반환하는 lint 결과
@@ -1,4 +1,5 @@
1
- import { consola, type ConsolaInstance } from "consola";
1
+ import { type ConsolaInstance } from "consola";
2
+ import { createLogger } from "@simplysm/core-common";
2
3
  import type { SdConfig } from "../sd-config.types";
3
4
  import { loadSdConfig } from "../utils/sd-config";
4
5
  import { getVersion } from "../utils/build-env";
@@ -35,7 +36,7 @@ export abstract class BaseOrchestrator {
35
36
 
36
37
  constructor(logTag: string) {
37
38
  this._cwd = process.cwd();
38
- this._logger = consola.withTag(logTag);
39
+ this._logger = createLogger(logTag);
39
40
  }
40
41
 
41
42
  async initialize(params: {
@@ -1,5 +1,5 @@
1
1
  import { fsx, pathx } from "@simplysm/core-node";
2
- import { consola } from "consola";
2
+ import { createLogger } from "@simplysm/core-common";
3
3
  import type {
4
4
  SdConfig,
5
5
  SdBuildPackageConfig,
@@ -119,7 +119,7 @@ async function cleanDistFolders(cwd: string, packageNames: string[]): Promise<vo
119
119
  export class BuildOrchestrator implements OrchestratorLifecycle<boolean> {
120
120
  private readonly _cwd: string;
121
121
  private readonly _options: BuildOrchestratorOptions;
122
- private readonly _logger = consola.withTag("sd:cli:build");
122
+ private readonly _logger = createLogger("sd:cli:build");
123
123
 
124
124
  private _sdConfig: SdConfig | undefined;
125
125
  private _classified: ClassifiedPackages | undefined;
@@ -1,7 +1,7 @@
1
1
  import ts from "typescript";
2
2
  import { err as errNs } from "@simplysm/core-common";
3
3
  import { pathx } from "@simplysm/core-node";
4
- import { consola } from "consola";
4
+ import { createLogger } from "@simplysm/core-common";
5
5
  import { deserializeDiagnostic } from "../typecheck/typecheck-serialization";
6
6
  import { createTypecheckEngine } from "../engines/engine-factory";
7
7
  import { typecheckNonPackageFiles } from "../typecheck/typecheck-non-package";
@@ -80,7 +80,7 @@ function extractTargetPackageNames(targets: string[]): Set<string> {
80
80
  export class TypecheckOrchestrator implements OrchestratorLifecycle<TypecheckResult> {
81
81
  private readonly _cwd: string;
82
82
  private readonly _options: TypecheckOptions;
83
- private readonly _logger = consola.withTag("sd:cli:typecheck");
83
+ private readonly _logger = createLogger("sd:cli:typecheck");
84
84
 
85
85
  // initialize()에서 설정되는 내부 상태
86
86
  private readonly _typecheckTasks: Array<{ name: string; dir: string; config: any; env: TypecheckEnv }> =
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from "node:events";
2
- import { consola } from "consola";
2
+ import { type ConsolaInstance } from "consola";
3
3
 
4
4
  interface RebuildManagerEvents {
5
5
  batchComplete: [completedKeys: string[]];
@@ -11,9 +11,9 @@ export class RebuildManager extends EventEmitter<RebuildManagerEvents> {
11
11
  string,
12
12
  { title: string; promise: Promise<void>; resolver: () => void }
13
13
  >();
14
- private readonly _logger: ReturnType<typeof consola.withTag>;
14
+ private readonly _logger: ConsolaInstance;
15
15
 
16
- constructor(logger: ReturnType<typeof consola.withTag>) {
16
+ constructor(logger: ConsolaInstance) {
17
17
  super();
18
18
  this._logger = logger;
19
19
  }
@@ -17,9 +17,9 @@ import fs from "fs";
17
17
  import { fileURLToPath } from "url";
18
18
  import { EventEmitter } from "node:events";
19
19
  import { setupConsola } from "@simplysm/core-node";
20
- import { createLazyLogger } from "./runtime/lazy-logger";
20
+ import { createLogger } from "@simplysm/core-common";
21
21
 
22
- const logger = createLazyLogger("sd:cli:entry");
22
+ const logger = createLogger("sd:cli:entry");
23
23
 
24
24
  Error.stackTraceLimit = Infinity;
25
25
  EventEmitter.defaultMaxListeners = 100;
package/src/sd-cli.ts CHANGED
@@ -11,12 +11,12 @@ import { cpx, setupConsola } from "@simplysm/core-node";
11
11
  import os from "os";
12
12
  import path from "path";
13
13
  import { fileURLToPath } from "url";
14
- import { createLazyLogger } from "./runtime/lazy-logger";
14
+ import { createLogger } from "@simplysm/core-common";
15
15
 
16
16
  const __filename = fileURLToPath(import.meta.url);
17
17
  const __dirname = path.dirname(__filename);
18
18
  const isDev = path.extname(__filename) === ".ts";
19
- const logger = createLazyLogger("sd:cli");
19
+ const logger = createLogger("sd:cli");
20
20
 
21
21
  if (isDev) {
22
22
  // 개발 모드 (.ts): affinity 적용 후 직접 실행
@@ -1,8 +1,8 @@
1
1
  import path from "path";
2
2
  import { createHash } from "crypto";
3
3
  import ts from "typescript";
4
- import { consola, type ConsolaInstance } from "consola";
5
- import { SdError } from "@simplysm/core-common";
4
+ import { type ConsolaInstance } from "consola";
5
+ import { SdError, createLogger } from "@simplysm/core-common";
6
6
  import { pathx } from "@simplysm/core-node";
7
7
  import type { ISdTsCompilerOptions, ISdTsCompilerEmitOptions } from "./sd-ts-compiler-options";
8
8
  import type { ISdTsCompilerResult } from "./sd-ts-compiler-result";
@@ -82,11 +82,7 @@ export class SdTsCompiler {
82
82
  // ── 크래시 디버깅용 컨텍스트 (compileAsync 내 단계/파일 진입 시 갱신) ──
83
83
  private _crashContext?: { stage: string; file?: string };
84
84
 
85
- // ── Logger ──
86
- // NOTE: 모듈 레벨이 아닌 인스턴스 레벨에서 생성해야 한다.
87
- // consola.withTag는 호출 시점의 consola.level/reporters를 스냅샷 복사하므로,
88
- // setupConsola 이전(모듈 import 시점)에 만들면 debug 레벨이 반영되지 않는다.
89
- private readonly _logger: ConsolaInstance = consola.withTag("sd:cli:SdTsCompiler");
85
+ private readonly _logger: ConsolaInstance = createLogger("sd:cli:SdTsCompiler");
90
86
 
91
87
  constructor(options: ISdTsCompilerOptions) {
92
88
  this._options = options;