@simplysm/sd-cli 12.7.5 → 12.7.6

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 (162) hide show
  1. package/dist/entry/{SdAiCommand.d.ts → sd-cli-ai-command.d.ts} +1 -1
  2. package/dist/entry/{SdAiCommand.js → sd-cli-ai-command.js} +5 -5
  3. package/dist/entry/sd-cli-ai-command.js.map +1 -0
  4. package/dist/entry/{SdCliCordova.d.ts → sd-cli-cordova.d.ts} +1 -1
  5. package/dist/entry/{SdCliCordova.js → sd-cli-cordova.js} +33 -33
  6. package/dist/entry/sd-cli-cordova.js.map +1 -0
  7. package/dist/entry/{SdCliElectron.d.ts → sd-cli-electron.d.ts} +1 -1
  8. package/dist/entry/{SdCliElectron.js → sd-cli-electron.js} +18 -18
  9. package/dist/entry/sd-cli-electron.js.map +1 -0
  10. package/dist/entry/{SdCliLocalUpdate.js → sd-cli-local-update.js} +12 -12
  11. package/dist/entry/sd-cli-local-update.js.map +1 -0
  12. package/dist/entry/{SdCliProject.js → sd-cli-project.js} +36 -36
  13. package/dist/entry/sd-cli-project.js.map +1 -0
  14. package/dist/index.d.ts +30 -30
  15. package/dist/index.js +30 -30
  16. package/dist/index.js.map +1 -1
  17. package/dist/pkg-builders/client/{SdCliNgRoutesFileGenerator.js → sd-cli-ng-routes.file-generator.js} +12 -12
  18. package/dist/pkg-builders/client/sd-cli-ng-routes.file-generator.js.map +1 -0
  19. package/dist/pkg-builders/client/{SdClientBuildRunner.d.ts → sd-client.build-runner.d.ts} +2 -2
  20. package/dist/pkg-builders/client/{SdClientBuildRunner.js → sd-client.build-runner.js} +34 -27
  21. package/dist/pkg-builders/client/sd-client.build-runner.js.map +1 -0
  22. package/dist/pkg-builders/client/{SdNgBundlerContext.js → sd-ng.bundler-context.js} +5 -5
  23. package/dist/pkg-builders/client/sd-ng.bundler-context.js.map +1 -0
  24. package/dist/pkg-builders/client/{SdNgBundler.d.ts → sd-ng.bundler.d.ts} +2 -2
  25. package/dist/pkg-builders/client/{SdNgBundler.js → sd-ng.bundler.js} +55 -37
  26. package/dist/pkg-builders/client/sd-ng.bundler.js.map +1 -0
  27. package/dist/pkg-builders/client/{createSdNgPlugin.d.ts → sd-ng.plugin-creator.d.ts} +1 -1
  28. package/dist/pkg-builders/client/{createSdNgPlugin.js → sd-ng.plugin-creator.js} +17 -17
  29. package/dist/pkg-builders/client/sd-ng.plugin-creator.js.map +1 -0
  30. package/dist/pkg-builders/lib/{SdCliIndexFileGenerator.js → sd-cli-index.file-generator.js} +8 -8
  31. package/dist/pkg-builders/lib/sd-cli-index.file-generator.js.map +1 -0
  32. package/dist/pkg-builders/lib/{SdJsLibBuildRunner.d.ts → sd-js-lib.build-runner.d.ts} +2 -2
  33. package/dist/pkg-builders/lib/{SdJsLibBuildRunner.js → sd-js-lib.build-runner.js} +17 -17
  34. package/dist/pkg-builders/lib/sd-js-lib.build-runner.js.map +1 -0
  35. package/dist/pkg-builders/lib/{SdTsLibBuildRunner.d.ts → sd-ts-lib.build-runner.d.ts} +2 -2
  36. package/dist/pkg-builders/lib/{SdTsLibBuildRunner.js → sd-ts-lib.build-runner.js} +17 -17
  37. package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js.map +1 -0
  38. package/dist/pkg-builders/lib/{SdTsLibBuilder.d.ts → sd-ts-lib.builder.d.ts} +1 -1
  39. package/dist/pkg-builders/lib/{SdTsLibBuilder.js → sd-ts-lib.builder.js} +11 -11
  40. package/dist/pkg-builders/lib/sd-ts-lib.builder.js.map +1 -0
  41. package/dist/pkg-builders/{SdMultiBuildRunner.d.ts → sd-multi.build-runner.d.ts} +2 -2
  42. package/dist/pkg-builders/{SdMultiBuildRunner.js → sd-multi.build-runner.js} +13 -13
  43. package/dist/pkg-builders/sd-multi.build-runner.js.map +1 -0
  44. package/dist/pkg-builders/server/{SdServerBuildRunner.d.ts → sd-server.build-runner.d.ts} +2 -2
  45. package/dist/pkg-builders/server/{SdServerBuildRunner.js → sd-server.build-runner.js} +35 -35
  46. package/dist/pkg-builders/server/sd-server.build-runner.js.map +1 -0
  47. package/dist/pkg-builders/server/{SdServerBundler.d.ts → sd-server.bundler.d.ts} +1 -1
  48. package/dist/pkg-builders/server/{SdServerBundler.js → sd-server.bundler.js} +15 -15
  49. package/dist/pkg-builders/server/sd-server.bundler.js.map +1 -0
  50. package/dist/pkg-builders/server/{createSdServerPlugin.d.ts → sd-server.plugin-creator.d.ts} +1 -1
  51. package/dist/pkg-builders/server/{createSdServerPlugin.js → sd-server.plugin-creator.js} +10 -10
  52. package/dist/pkg-builders/server/sd-server.plugin-creator.js.map +1 -0
  53. package/dist/sd-cli.js +10 -10
  54. package/dist/sd-cli.js.map +1 -1
  55. package/dist/{ts-builder/SdTsCompiler.d.ts → ts-compiler/sd-ts-compiler.d.ts} +1 -1
  56. package/dist/{ts-builder/SdTsCompiler.js → ts-compiler/sd-ts-compiler.js} +60 -60
  57. package/dist/ts-compiler/sd-ts-compiler.js.map +1 -0
  58. package/dist/types/{build-plugin.type.js → build-plugin.types.js} +1 -1
  59. package/dist/types/build-plugin.types.js.map +1 -0
  60. package/dist/types/{build-runner.type.d.ts → build-runner.types.d.ts} +1 -1
  61. package/dist/types/build-runner.types.js +3 -0
  62. package/dist/types/build-runner.types.js.map +1 -0
  63. package/dist/types/{build.type.js → build.types.js} +1 -1
  64. package/dist/types/build.types.js.map +1 -0
  65. package/dist/types/common-configs.types.js +2 -0
  66. package/dist/types/common-configs.types.js.map +1 -0
  67. package/dist/types/config.types.js +2 -0
  68. package/dist/types/config.types.js.map +1 -0
  69. package/dist/types/{ts-compiler.type.d.ts → ts-compiler.types.d.ts} +1 -1
  70. package/dist/types/{ts-compiler.type.js → ts-compiler.types.js} +2 -2
  71. package/dist/types/ts-compiler.types.js.map +1 -0
  72. package/dist/types/{workers.type.d.ts → worker.types.d.ts} +2 -2
  73. package/dist/types/worker.types.js +3 -0
  74. package/dist/types/worker.types.js.map +1 -0
  75. package/dist/utils/{SdCliConvertMessageUtil.d.ts → sd-cli-convert-message.utils.d.ts} +2 -2
  76. package/dist/utils/{SdCliConvertMessageUtil.js → sd-cli-convert-message.utils.js} +7 -7
  77. package/dist/utils/sd-cli-convert-message.utils.js.map +1 -0
  78. package/dist/utils/{SdCliPerformanceTime.js → sd-cli-performance-time.js} +1 -1
  79. package/dist/utils/sd-cli-performance-time.js.map +1 -0
  80. package/dist/workers/{build-runner-worker.js → build-runner.worker.js} +13 -13
  81. package/dist/workers/build-runner.worker.js.map +1 -0
  82. package/dist/workers/{server-worker.js → server.worker.js} +6 -6
  83. package/dist/workers/server.worker.js.map +1 -0
  84. package/package.json +5 -5
  85. package/src/entry/{SdAiCommand.ts → sd-cli-ai-command.ts} +4 -4
  86. package/src/entry/{SdCliCordova.ts → sd-cli-cordova.ts} +32 -32
  87. package/src/entry/{SdCliElectron.ts → sd-cli-electron.ts} +17 -17
  88. package/src/entry/{SdCliLocalUpdate.ts → sd-cli-local-update.ts} +11 -11
  89. package/src/entry/{SdCliProject.ts → sd-cli-project.ts} +36 -36
  90. package/src/index.ts +30 -30
  91. package/src/pkg-builders/client/{SdCliNgRoutesFileGenerator.ts → sd-cli-ng-routes.file-generator.ts} +11 -11
  92. package/src/pkg-builders/client/{SdClientBuildRunner.ts → sd-client.build-runner.ts} +52 -45
  93. package/src/pkg-builders/client/{SdNgBundlerContext.ts → sd-ng.bundler-context.ts} +4 -4
  94. package/src/pkg-builders/client/{SdNgBundler.ts → sd-ng.bundler.ts} +94 -61
  95. package/src/pkg-builders/client/{createSdNgPlugin.ts → sd-ng.plugin-creator.ts} +16 -16
  96. package/src/pkg-builders/lib/{SdCliIndexFileGenerator.ts → sd-cli-index.file-generator.ts} +7 -7
  97. package/src/pkg-builders/lib/{SdJsLibBuildRunner.ts → sd-js-lib.build-runner.ts} +16 -16
  98. package/src/pkg-builders/lib/{SdTsLibBuildRunner.ts → sd-ts-lib.build-runner.ts} +17 -17
  99. package/src/pkg-builders/lib/{SdTsLibBuilder.ts → sd-ts-lib.builder.ts} +10 -10
  100. package/src/pkg-builders/{SdMultiBuildRunner.ts → sd-multi.build-runner.ts} +12 -12
  101. package/src/pkg-builders/server/{SdServerBuildRunner.ts → sd-server.build-runner.ts} +34 -34
  102. package/src/pkg-builders/server/{SdServerBundler.ts → sd-server.bundler.ts} +14 -14
  103. package/src/pkg-builders/server/{createSdServerPlugin.ts → sd-server.plugin-creator.ts} +9 -9
  104. package/src/sd-cli.ts +10 -10
  105. package/src/{ts-builder/SdTsCompiler.ts → ts-compiler/sd-ts-compiler.ts} +60 -60
  106. package/src/types/{build-runner.type.ts → build-runner.types.ts} +1 -1
  107. package/src/types/{ts-compiler.type.ts → ts-compiler.types.ts} +1 -1
  108. package/src/types/{workers.type.ts → worker.types.ts} +2 -2
  109. package/src/utils/{SdCliConvertMessageUtil.ts → sd-cli-convert-message.utils.ts} +6 -6
  110. package/src/workers/{build-runner-worker.ts → build-runner.worker.ts} +12 -12
  111. package/src/workers/{server-worker.ts → server.worker.ts} +5 -5
  112. package/dist/entry/SdAiCommand.js.map +0 -1
  113. package/dist/entry/SdCliCordova.js.map +0 -1
  114. package/dist/entry/SdCliElectron.js.map +0 -1
  115. package/dist/entry/SdCliLocalUpdate.js.map +0 -1
  116. package/dist/entry/SdCliProject.js.map +0 -1
  117. package/dist/pkg-builders/SdMultiBuildRunner.js.map +0 -1
  118. package/dist/pkg-builders/client/SdCliNgRoutesFileGenerator.js.map +0 -1
  119. package/dist/pkg-builders/client/SdClientBuildRunner.js.map +0 -1
  120. package/dist/pkg-builders/client/SdNgBundler.js.map +0 -1
  121. package/dist/pkg-builders/client/SdNgBundlerContext.js.map +0 -1
  122. package/dist/pkg-builders/client/createSdNgPlugin.js.map +0 -1
  123. package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js.map +0 -1
  124. package/dist/pkg-builders/lib/SdJsLibBuildRunner.js.map +0 -1
  125. package/dist/pkg-builders/lib/SdTsLibBuildRunner.js.map +0 -1
  126. package/dist/pkg-builders/lib/SdTsLibBuilder.js.map +0 -1
  127. package/dist/pkg-builders/server/SdServerBuildRunner.js.map +0 -1
  128. package/dist/pkg-builders/server/SdServerBundler.js.map +0 -1
  129. package/dist/pkg-builders/server/createSdServerPlugin.js.map +0 -1
  130. package/dist/ts-builder/SdTsCompiler.js.map +0 -1
  131. package/dist/types/build-plugin.type.js.map +0 -1
  132. package/dist/types/build-runner.type.js +0 -3
  133. package/dist/types/build-runner.type.js.map +0 -1
  134. package/dist/types/build.type.js.map +0 -1
  135. package/dist/types/common-configs.type.js +0 -2
  136. package/dist/types/common-configs.type.js.map +0 -1
  137. package/dist/types/sd-configs.type.js +0 -2
  138. package/dist/types/sd-configs.type.js.map +0 -1
  139. package/dist/types/ts-compiler.type.js.map +0 -1
  140. package/dist/types/workers.type.js +0 -3
  141. package/dist/types/workers.type.js.map +0 -1
  142. package/dist/utils/SdCliConvertMessageUtil.js.map +0 -1
  143. package/dist/utils/SdCliPerformanceTime.js.map +0 -1
  144. package/dist/workers/build-runner-worker.js.map +0 -1
  145. package/dist/workers/server-worker.js.map +0 -1
  146. /package/dist/entry/{SdCliLocalUpdate.d.ts → sd-cli-local-update.d.ts} +0 -0
  147. /package/dist/entry/{SdCliProject.d.ts → sd-cli-project.d.ts} +0 -0
  148. /package/dist/pkg-builders/client/{SdCliNgRoutesFileGenerator.d.ts → sd-cli-ng-routes.file-generator.d.ts} +0 -0
  149. /package/dist/pkg-builders/client/{SdNgBundlerContext.d.ts → sd-ng.bundler-context.d.ts} +0 -0
  150. /package/dist/pkg-builders/lib/{SdCliIndexFileGenerator.d.ts → sd-cli-index.file-generator.d.ts} +0 -0
  151. /package/dist/types/{build-plugin.type.d.ts → build-plugin.types.d.ts} +0 -0
  152. /package/dist/types/{build.type.d.ts → build.types.d.ts} +0 -0
  153. /package/dist/types/{common-configs.type.d.ts → common-configs.types.d.ts} +0 -0
  154. /package/dist/types/{sd-configs.type.d.ts → config.types.d.ts} +0 -0
  155. /package/dist/utils/{SdCliPerformanceTime.d.ts → sd-cli-performance-time.d.ts} +0 -0
  156. /package/dist/workers/{build-runner-worker.d.ts → build-runner.worker.d.ts} +0 -0
  157. /package/dist/workers/{server-worker.d.ts → server.worker.d.ts} +0 -0
  158. /package/src/types/{build-plugin.type.ts → build-plugin.types.ts} +0 -0
  159. /package/src/types/{build.type.ts → build.types.ts} +0 -0
  160. /package/src/types/{common-configs.type.ts → common-configs.types.ts} +0 -0
  161. /package/src/types/{sd-configs.type.ts → config.types.ts} +0 -0
  162. /package/src/utils/{SdCliPerformanceTime.ts → sd-cli-performance-time.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import path from "path";
2
- import { SdCliConvertMessageUtil } from "../../utils/SdCliConvertMessageUtil";
3
- import { FsUtil, PathUtil, type TNormPath } from "@simplysm/sd-core-node";
4
- import { type ISdBuildMessage } from "../../types/build.type";
5
- import { SdTsCompiler } from "../../ts-builder/SdTsCompiler";
2
+ import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
3
+ import { FsUtils, PathUtils, type TNormPath } from "@simplysm/sd-core-node";
4
+ import { type ISdBuildMessage } from "../../types/build.types";
5
+ import { SdTsCompiler } from "../../ts-compiler/sd-ts-compiler";
6
6
 
7
7
  export class SdTsLibBuilder {
8
8
  private _tsCompiler: SdTsCompiler;
@@ -16,7 +16,7 @@ export class SdTsLibBuilder {
16
16
  pkgPath: this._pkgPath,
17
17
  additionalOptions: { declaration: true },
18
18
  isDevMode: dev,
19
- globalStyleFilePath: PathUtil.norm(this._pkgPath, "src/styles.scss"),
19
+ globalStyleFilePath: PathUtils.norm(this._pkgPath, "src/styles.scss"),
20
20
  isForBundle: false,
21
21
  watchScopePaths: watchScopePaths,
22
22
  });
@@ -36,7 +36,7 @@ export class SdTsLibBuilder {
36
36
  if (emitFileInfos) {
37
37
  for (const emitFileInfo of emitFileInfos) {
38
38
  if (emitFileInfo.outAbsPath != null) {
39
- FsUtil.writeFile(emitFileInfo.outAbsPath, emitFileInfo.text);
39
+ FsUtils.writeFile(emitFileInfo.outAbsPath, emitFileInfo.text);
40
40
  emitFileSet.add(emitFileInfo.outAbsPath);
41
41
  }
42
42
  }
@@ -45,9 +45,9 @@ export class SdTsLibBuilder {
45
45
  const globalStylesheetBundlingResult = tsCompileResult.stylesheetBundlingResultMap.get(emitFile);
46
46
  if (globalStylesheetBundlingResult) {
47
47
  for (const outputFile of globalStylesheetBundlingResult.outputFiles ?? []) {
48
- const distPath = PathUtil.norm(this._pkgPath, "dist", path.relative(this._pkgPath, outputFile.path));
49
- if (PathUtil.isChildPath(distPath, path.resolve(this._pkgPath, "dist"))) {
50
- FsUtil.writeFile(distPath, outputFile.text);
48
+ const distPath = PathUtils.norm(this._pkgPath, "dist", path.relative(this._pkgPath, outputFile.path));
49
+ if (PathUtils.isChildPath(distPath, path.resolve(this._pkgPath, "dist"))) {
50
+ FsUtils.writeFile(distPath, outputFile.text);
51
51
  emitFileSet.add(distPath);
52
52
  }
53
53
  }
@@ -55,7 +55,7 @@ export class SdTsLibBuilder {
55
55
  }
56
56
 
57
57
  const styleResults = Array.from(tsCompileResult.stylesheetBundlingResultMap.values()).mapMany((item) =>
58
- SdCliConvertMessageUtil.convertToBuildMessagesFromEsbuild(item, this._pkgPath),
58
+ SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(item, this._pkgPath),
59
59
  );
60
60
 
61
61
  return {
@@ -1,14 +1,14 @@
1
- import { FsUtil, Logger, PathUtil, SdWorker, type TNormPath } from "@simplysm/sd-core-node";
1
+ import { FsUtils, SdLogger, PathUtils, SdWorker, type TNormPath } from "@simplysm/sd-core-node";
2
2
  import path from "path";
3
3
  import { EventEmitter } from "events";
4
- import { type ISdServerPackageConfig } from "../types/sd-configs.type";
5
- import { type ISdBuildMessage, type ISdBuildRunnerResult } from "../types/build.type";
6
- import { type TSdBuildRunnerWorkerType, type TServerWorkerType } from "../types/workers.type";
7
- import { type INpmConfig } from "../types/common-configs.type";
8
- import { type ISdBuildRunnerWorkerRequest } from "../types/build-runner.type";
4
+ import { type ISdServerPackageConfig } from "../types/config.types";
5
+ import { type ISdBuildMessage, type ISdBuildRunnerResult } from "../types/build.types";
6
+ import { type TSdBuildRunnerWorkerType, type TServerWorkerType } from "../types/worker.types";
7
+ import { type INpmConfig } from "../types/common-configs.types";
8
+ import { type ISdBuildRunnerWorkerRequest } from "../types/build-runner.types";
9
9
 
10
10
  export class SdMultiBuildRunner extends EventEmitter {
11
- #logger = Logger.get(["simplysm", "sd-cli", "SdMultiBuildRunner"]);
11
+ #logger = SdLogger.get(["simplysm", "sd-cli", "SdMultiBuildRunner"]);
12
12
 
13
13
  #busyCount = 0;
14
14
 
@@ -43,7 +43,7 @@ export class SdMultiBuildRunner extends EventEmitter {
43
43
  async runAsync(req: ISdBuildRunnerWorkerRequest & { cmd: "watch" }): Promise<void>;
44
44
  async runAsync(req: ISdBuildRunnerWorkerRequest & { cmd: "build" }): Promise<ISdBuildMessage[]>;
45
45
  async runAsync(req: ISdBuildRunnerWorkerRequest): Promise<ISdBuildMessage[] | void> {
46
- const worker = new SdWorker<TSdBuildRunnerWorkerType>(import.meta.resolve("../workers/build-runner-worker"))
46
+ const worker = new SdWorker<TSdBuildRunnerWorkerType>(import.meta.resolve("../workers/build-runner.worker"))
47
47
  .on("change", () => {
48
48
  if (this.#busyCount === 0) {
49
49
  this.emit("change");
@@ -80,7 +80,7 @@ export class SdMultiBuildRunner extends EventEmitter {
80
80
  #onComplete(req: ISdBuildRunnerWorkerRequest, result: ISdBuildRunnerResult) {
81
81
  this.#resultCache.delete(req.pkgPath);
82
82
  for (const affectedFilePath of result.affectedFilePathSet) {
83
- if (PathUtil.isChildPath(affectedFilePath, req.pkgPath)) {
83
+ if (PathUtils.isChildPath(affectedFilePath, req.pkgPath)) {
84
84
  this.#resultCache.delete(affectedFilePath);
85
85
  }
86
86
  }
@@ -215,16 +215,16 @@ export class SdMultiBuildRunner extends EventEmitter {
215
215
  worker: SdWorker<TServerWorkerType>;
216
216
  port: number;
217
217
  }> {
218
- const logger = Logger.get(["simplysm", "sd-cli", "SdMultiBuildRunner", "#restartServerAsync"]);
218
+ const logger = SdLogger.get(["simplysm", "sd-cli", "SdMultiBuildRunner", "#restartServerAsync"]);
219
219
 
220
220
  if (prevWorker) {
221
221
  await prevWorker.killAsync();
222
222
  }
223
223
 
224
224
  const npmConf =
225
- "path" in pkgInfo ? (FsUtil.readJson(path.resolve(pkgInfo.path, "package.json")) as INpmConfig) : undefined;
225
+ "path" in pkgInfo ? (FsUtils.readJson(path.resolve(pkgInfo.path, "package.json")) as INpmConfig) : undefined;
226
226
 
227
- const worker = new SdWorker<TServerWorkerType>(import.meta.resolve("../workers/server-worker"), {
227
+ const worker = new SdWorker<TServerWorkerType>(import.meta.resolve("../workers/server.worker"), {
228
228
  env: {
229
229
  NODE_ENV: "development",
230
230
  TZ: "Asia/Seoul",
@@ -1,14 +1,14 @@
1
1
  import { EventEmitter } from "events";
2
- import { FsUtil, Logger, PathUtil, SdFsWatcher, type TNormPath } from "@simplysm/sd-core-node";
2
+ import { FsUtils, SdLogger, PathUtils, SdFsWatcher, type TNormPath } from "@simplysm/sd-core-node";
3
3
  import path from "path";
4
- import { StringUtil } from "@simplysm/sd-core-common";
5
- import { SdServerBundler } from "./SdServerBundler";
6
- import { type ISdProjectConfig, type ISdServerPackageConfig } from "../../types/sd-configs.type";
7
- import { type ISdBuildMessage, type ISdBuildRunnerResult } from "../../types/build.type";
8
- import { type INpmConfig, type ITsConfig } from "../../types/common-configs.type";
4
+ import { StringUtils } from "@simplysm/sd-core-common";
5
+ import { SdServerBundler } from "./sd-server.bundler";
6
+ import { type ISdProjectConfig, type ISdServerPackageConfig } from "../../types/config.types";
7
+ import { type ISdBuildMessage, type ISdBuildRunnerResult } from "../../types/build.types";
8
+ import { type INpmConfig, type ITsConfig } from "../../types/common-configs.types";
9
9
 
10
10
  export class SdServerBuildRunner extends EventEmitter {
11
- private _logger = Logger.get(["simplysm", "sd-cli", "SdCliServerBuildRunner"]);
11
+ private _logger = SdLogger.get(["simplysm", "sd-cli", "SdCliServerBuildRunner"]);
12
12
  private _pkgConf: ISdServerPackageConfig;
13
13
  private _serverBundler?: SdServerBundler;
14
14
  private _extModules?: { name: string; exists: boolean }[];
@@ -22,10 +22,10 @@ export class SdServerBuildRunner extends EventEmitter {
22
22
  this._pkgConf = this._projConf.packages[path.basename(_pkgPath)] as ISdServerPackageConfig;
23
23
 
24
24
  const localUpdatePaths = Object.keys(this._projConf.localUpdates ?? {}).mapMany((key) =>
25
- FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
25
+ FsUtils.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
26
26
  );
27
27
  this._watchScopePathSet = new Set(
28
- [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
28
+ [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtils.norm(item)),
29
29
  );
30
30
  }
31
31
 
@@ -40,11 +40,11 @@ export class SdServerBuildRunner extends EventEmitter {
40
40
  this.emit("change");
41
41
 
42
42
  this._debug("dist 초기화...");
43
- FsUtil.remove(path.resolve(this._pkgPath, "dist"));
43
+ FsUtils.remove(path.resolve(this._pkgPath, "dist"));
44
44
 
45
45
  this._debug("GEN .config...");
46
46
  const confDistPath = path.resolve(this._pkgPath, "dist/.config.json");
47
- FsUtil.writeFile(confDistPath, JSON.stringify(this._pkgConf.configs ?? {}, undefined, 2));
47
+ FsUtils.writeFile(confDistPath, JSON.stringify(this._pkgConf.configs ?? {}, undefined, 2));
48
48
 
49
49
  const result = await this._runAsync(true);
50
50
  const res: ISdBuildRunnerResult = {
@@ -64,7 +64,7 @@ export class SdServerBuildRunner extends EventEmitter {
64
64
 
65
65
  const watchResult = await this._runAsync(
66
66
  true,
67
- new Set(currentChangeInfos.map((item) => PathUtil.norm(item.path))),
67
+ new Set(currentChangeInfos.map((item) => PathUtils.norm(item.path))),
68
68
  );
69
69
  const watchRes: ISdBuildRunnerResult = {
70
70
  affectedFilePathSet: watchResult.affectedFileSet,
@@ -79,16 +79,16 @@ export class SdServerBuildRunner extends EventEmitter {
79
79
  }
80
80
 
81
81
  public async buildAsync(): Promise<ISdBuildRunnerResult> {
82
- const projNpmConfig = FsUtil.readJson(path.resolve(process.cwd(), "package.json")) as INpmConfig;
83
- const npmConfig = FsUtil.readJson(path.resolve(this._pkgPath, "package.json")) as INpmConfig;
82
+ const projNpmConfig = FsUtils.readJson(path.resolve(process.cwd(), "package.json")) as INpmConfig;
83
+ const npmConfig = FsUtils.readJson(path.resolve(this._pkgPath, "package.json")) as INpmConfig;
84
84
  const extModules = await this._getExternalModulesAsync();
85
85
 
86
86
  this._debug("dist 초기화...");
87
- FsUtil.remove(path.resolve(this._pkgPath, "dist"));
87
+ FsUtils.remove(path.resolve(this._pkgPath, "dist"));
88
88
 
89
89
  this._debug("GEN .config.json...");
90
90
  const confDistPath = path.resolve(this._pkgPath, "dist/.config.json");
91
- FsUtil.writeJson(confDistPath, this._pkgConf.configs ?? {}, { space: 2 });
91
+ FsUtils.writeJson(confDistPath, this._pkgConf.configs ?? {}, { space: 2 });
92
92
 
93
93
  this._debug("GEN package.json...");
94
94
  {
@@ -113,17 +113,17 @@ export class SdServerBuildRunner extends EventEmitter {
113
113
 
114
114
  distNpmConfig.volta = projNpmConfig.volta;
115
115
 
116
- FsUtil.writeJson(path.resolve(this._pkgPath, "dist/package.json"), distNpmConfig, { space: 2 });
116
+ FsUtils.writeJson(path.resolve(this._pkgPath, "dist/package.json"), distNpmConfig, { space: 2 });
117
117
  }
118
118
 
119
119
  this._debug("GEN .yarnrc.yml...");
120
120
  {
121
- FsUtil.writeFile(path.resolve(this._pkgPath, "dist/.yarnrc.yml"), "nodeLinker: node-modules");
121
+ FsUtils.writeFile(path.resolve(this._pkgPath, "dist/.yarnrc.yml"), "nodeLinker: node-modules");
122
122
  }
123
123
 
124
124
  this._debug("GEN openssl.cnf...");
125
125
  {
126
- FsUtil.writeFile(
126
+ FsUtils.writeFile(
127
127
  path.resolve(this._pkgPath, "dist/openssl.cnf"),
128
128
  `
129
129
  nodejs_conf = openssl_init
@@ -187,7 +187,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
187
187
  .replaceAll("\n ", "\n")
188
188
  .trim();
189
189
 
190
- FsUtil.writeFile(path.resolve(this._pkgPath, "dist/pm2.config.cjs"), str);
190
+ FsUtils.writeFile(path.resolve(this._pkgPath, "dist/pm2.config.cjs"), str);
191
191
  }
192
192
 
193
193
  if (this._pkgConf.iis) {
@@ -195,7 +195,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
195
195
 
196
196
  const iisDistPath = path.resolve(this._pkgPath, "dist/web.config");
197
197
  const serverExeFilePath = this._pkgConf.iis.nodeExeFilePath ?? "C:\\Program Files\\nodejs\\node.exe";
198
- FsUtil.writeFile(
198
+ FsUtils.writeFile(
199
199
  iisDistPath,
200
200
  `
201
201
  <configuration>
@@ -248,11 +248,11 @@ Options = UnsafeLegacyRenegotiation`.trim(),
248
248
  emitFileSet: Set<TNormPath>;
249
249
  }> {
250
250
  const localUpdatePaths = Object.keys(this._projConf.localUpdates ?? {}).mapMany((key) =>
251
- FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
251
+ FsUtils.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
252
252
  );
253
253
 
254
254
  this._debug(`BUILD 준비...`);
255
- const tsConfig = FsUtil.readJson(path.resolve(this._pkgPath, "tsconfig.json")) as ITsConfig;
255
+ const tsConfig = FsUtils.readJson(path.resolve(this._pkgPath, "tsconfig.json")) as ITsConfig;
256
256
  this._extModules = this._extModules ?? (await this._getExternalModulesAsync());
257
257
  this._serverBundler =
258
258
  this._serverBundler ??
@@ -263,10 +263,10 @@ Options = UnsafeLegacyRenegotiation`.trim(),
263
263
  ? tsConfig.files.map((item) => path.resolve(this._pkgPath, item))
264
264
  : [
265
265
  path.resolve(this._pkgPath, "src/main.ts"),
266
- ...FsUtil.glob(path.resolve(this._pkgPath, "src/workers/*.ts")),
266
+ ...FsUtils.glob(path.resolve(this._pkgPath, "src/workers/*.ts")),
267
267
  ],
268
268
  external: this._extModules.map((item) => item.name),
269
- watchScopePaths: [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
269
+ watchScopePaths: [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtils.norm(item)),
270
270
  });
271
271
 
272
272
  this._debug(`BUILD...`);
@@ -276,8 +276,8 @@ Options = UnsafeLegacyRenegotiation`.trim(),
276
276
  const watchFileSet = new Set(
277
277
  Array.from(bundleResult.watchFileSet).filter(
278
278
  (item) =>
279
- PathUtil.isChildPath(item, path.resolve(this._pkgPath, "../")) ||
280
- localUpdatePaths.some((lu) => PathUtil.isChildPath(item, lu)),
279
+ PathUtils.isChildPath(item, path.resolve(this._pkgPath, "../")) ||
280
+ localUpdatePaths.some((lu) => PathUtils.isChildPath(item, lu)),
281
281
  ),
282
282
  );
283
283
 
@@ -305,7 +305,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
305
305
  const npmConfigMap = new Map<string, INpmConfig>();
306
306
 
307
307
  const fn = async (currPath: string): Promise<void> => {
308
- const npmConfig = npmConfigMap.getOrCreate(currPath, FsUtil.readJson(path.resolve(currPath, "package.json")));
308
+ const npmConfig = npmConfigMap.getOrCreate(currPath, FsUtils.readJson(path.resolve(currPath, "package.json")));
309
309
 
310
310
  const deps = {
311
311
  defaults: [
@@ -326,16 +326,16 @@ Options = UnsafeLegacyRenegotiation`.trim(),
326
326
  if (loadedModuleNames.includes(moduleName)) continue;
327
327
  loadedModuleNames.push(moduleName);
328
328
 
329
- const modulePath = FsUtil.findAllParentChildPaths(
329
+ const modulePath = FsUtils.findAllParentChildPaths(
330
330
  "node_modules/" + moduleName,
331
331
  currPath,
332
332
  path.resolve(this._pkgPath, "../../"),
333
333
  ).first();
334
- if (StringUtil.isNullOrEmpty(modulePath)) {
334
+ if (StringUtils.isNullOrEmpty(modulePath)) {
335
335
  continue;
336
336
  }
337
337
 
338
- if (FsUtil.glob(path.resolve(modulePath, "binding.gyp")).length > 0) {
338
+ if (FsUtils.glob(path.resolve(modulePath, "binding.gyp")).length > 0) {
339
339
  results.push({
340
340
  name: moduleName,
341
341
  exists: true,
@@ -356,12 +356,12 @@ Options = UnsafeLegacyRenegotiation`.trim(),
356
356
  if (loadedModuleNames.includes(optModuleName)) continue;
357
357
  loadedModuleNames.push(optModuleName);
358
358
 
359
- const optModulePath = FsUtil.findAllParentChildPaths(
359
+ const optModulePath = FsUtils.findAllParentChildPaths(
360
360
  "node_modules/" + optModuleName,
361
361
  currPath,
362
362
  path.resolve(this._pkgPath, "../../"),
363
363
  ).first();
364
- if (StringUtil.isNullOrEmpty(optModulePath)) {
364
+ if (StringUtils.isNullOrEmpty(optModulePath)) {
365
365
  results.push({
366
366
  name: optModuleName,
367
367
  exists: false,
@@ -369,7 +369,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
369
369
  continue;
370
370
  }
371
371
 
372
- if (FsUtil.glob(path.resolve(optModulePath, "binding.gyp")).length > 0) {
372
+ if (FsUtils.glob(path.resolve(optModulePath, "binding.gyp")).length > 0) {
373
373
  results.push({
374
374
  name: optModuleName,
375
375
  exists: true,
@@ -1,16 +1,16 @@
1
1
  import esbuild from "esbuild";
2
2
  import path from "path";
3
- import { FsUtil, Logger, PathUtil, type TNormPath } from "@simplysm/sd-core-node";
4
- import { SdCliConvertMessageUtil } from "../../utils/SdCliConvertMessageUtil";
5
- import { type ISdCliServerPluginResultCache } from "../../types/build-plugin.type";
6
- import { type ISdBuildMessage } from "../../types/build.type";
7
- import { createSdServerPlugin } from "./createSdServerPlugin";
3
+ import { FsUtils, SdLogger, PathUtils, type TNormPath } from "@simplysm/sd-core-node";
4
+ import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
5
+ import { type ISdCliServerPluginResultCache } from "../../types/build-plugin.types";
6
+ import { type ISdBuildMessage } from "../../types/build.types";
7
+ import { createSdServerPlugin } from "./sd-server.plugin-creator";
8
8
  import { type BuildOutputFile, BuildOutputFileType } from "@angular/build/src/tools/esbuild/bundler-context";
9
9
  import { convertOutputFile } from "@angular/build/src/tools/esbuild/utils";
10
10
  import { resolveAssets } from "@angular/build/src/utils/resolve-assets";
11
11
 
12
12
  export class SdServerBundler {
13
- readonly #logger = Logger.get(["simplysm", "sd-cli", "SdServerBundler"]);
13
+ readonly #logger = SdLogger.get(["simplysm", "sd-cli", "SdServerBundler"]);
14
14
 
15
15
  #context?: esbuild.BuildContext;
16
16
 
@@ -122,10 +122,10 @@ const __dirname = __path__.dirname(__filename);`.trim(),
122
122
  result.outputFiles?.map((file) => convertOutputFile(file, BuildOutputFileType.Root)) ?? [];
123
123
 
124
124
  for (const outputFile of outputFiles) {
125
- const distFilePath = PathUtil.norm(this._opt.pkgPath, outputFile.path);
125
+ const distFilePath = PathUtils.norm(this._opt.pkgPath, outputFile.path);
126
126
  const prev = this.#outputCache.get(distFilePath);
127
127
  if (prev !== Buffer.from(outputFile.contents).toString("base64")) {
128
- FsUtil.writeFile(distFilePath, outputFile.contents);
128
+ FsUtils.writeFile(distFilePath, outputFile.contents);
129
129
  this.#outputCache.set(distFilePath, Buffer.from(outputFile.contents).toString("base64"));
130
130
  emitFileSet.add(distFilePath);
131
131
  }
@@ -141,12 +141,12 @@ const __dirname = __path__.dirname(__filename);`.trim(),
141
141
  );
142
142
 
143
143
  for (const assetFile of assetFiles) {
144
- const prev = this.#outputCache.get(PathUtil.norm(assetFile.source));
145
- const curr = FsUtil.lstat(assetFile.source).mtime.getTime();
144
+ const prev = this.#outputCache.get(PathUtils.norm(assetFile.source));
145
+ const curr = FsUtils.lstat(assetFile.source).mtime.getTime();
146
146
  if (prev !== curr) {
147
- FsUtil.copy(assetFile.source, path.resolve(this._opt.pkgPath, "dist", assetFile.destination));
148
- this.#outputCache.set(PathUtil.norm(assetFile.source), curr);
149
- emitFileSet.add(PathUtil.norm(assetFile.destination));
147
+ FsUtils.copy(assetFile.source, path.resolve(this._opt.pkgPath, "dist", assetFile.destination));
148
+ this.#outputCache.set(PathUtils.norm(assetFile.source), curr);
149
+ emitFileSet.add(PathUtils.norm(assetFile.destination));
150
150
  }
151
151
  }
152
152
  }
@@ -162,7 +162,7 @@ const __dirname = __path__.dirname(__filename);`.trim(),
162
162
  return {
163
163
  watchFileSet: this.#resultCache.watchFileSet!,
164
164
  affectedFileSet: this.#resultCache.affectedFileSet!,
165
- results: SdCliConvertMessageUtil.convertToBuildMessagesFromEsbuild(result, this._opt.pkgPath),
165
+ results: SdCliConvertMessageUtils.convertToBuildMessagesFromEsbuild(result, this._opt.pkgPath),
166
166
  emitFileSet: emitFileSet,
167
167
  };
168
168
  }
@@ -1,9 +1,9 @@
1
1
  import esbuild from "esbuild";
2
- import { SdCliConvertMessageUtil } from "../../utils/SdCliConvertMessageUtil";
3
- import { type ISdCliServerPluginResultCache } from "../../types/build-plugin.type";
4
- import { PathUtil, type TNormPath } from "@simplysm/sd-core-node";
5
- import { type ISdTsCompilerResult } from "../../types/ts-compiler.type";
6
- import { SdTsCompiler } from "../../ts-builder/SdTsCompiler";
2
+ import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
3
+ import { type ISdCliServerPluginResultCache } from "../../types/build-plugin.types";
4
+ import { PathUtils, type TNormPath } from "@simplysm/sd-core-node";
5
+ import { type ISdTsCompilerResult } from "../../types/ts-compiler.types";
6
+ import { SdTsCompiler } from "../../ts-compiler/sd-ts-compiler";
7
7
 
8
8
  export function createSdServerPlugin(conf: {
9
9
  pkgPath: TNormPath;
@@ -32,11 +32,11 @@ export function createSdServerPlugin(conf: {
32
32
  conf.result.affectedFileSet = tsCompileResult.affectedFileSet;
33
33
 
34
34
  //-- return err/warn
35
- return SdCliConvertMessageUtil.convertToEsbuildFromBuildMessages(tsCompileResult.messages, conf.pkgPath);
35
+ return SdCliConvertMessageUtils.convertToEsbuildFromBuildMessages(tsCompileResult.messages, conf.pkgPath);
36
36
  });
37
37
 
38
38
  build.onLoad({ filter: /\.ts$/ }, (args) => {
39
- const emittedJsFile = tsCompileResult.emittedFilesCacheMap.get(PathUtil.norm(args.path))?.last();
39
+ const emittedJsFile = tsCompileResult.emittedFilesCacheMap.get(PathUtils.norm(args.path))?.last();
40
40
  if (!emittedJsFile) {
41
41
  return {
42
42
  errors: [
@@ -52,7 +52,7 @@ export function createSdServerPlugin(conf: {
52
52
  });
53
53
 
54
54
  build.onLoad({ filter: /\.[cm]?js$/ }, (args) => {
55
- conf.result.watchFileSet!.add(PathUtil.norm(args.path));
55
+ conf.result.watchFileSet!.add(PathUtils.norm(args.path));
56
56
  return null;
57
57
  });
58
58
 
@@ -67,7 +67,7 @@ export function createSdServerPlugin(conf: {
67
67
  ),
68
68
  },
69
69
  (args) => {
70
- conf.result.watchFileSet!.add(PathUtil.norm(args.path));
70
+ conf.result.watchFileSet!.add(PathUtils.norm(args.path));
71
71
  return null;
72
72
  },
73
73
  );
package/src/sd-cli.ts CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  import yargs from "yargs";
4
4
  import { hideBin } from "yargs/helpers";
5
- import { SdCliProject } from "./entry/SdCliProject";
6
- import { Logger, LoggerSeverity } from "@simplysm/sd-core-node";
5
+ import { SdCliProject } from "./entry/sd-cli-project";
6
+ import { SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
7
7
  import { EventEmitter } from "events";
8
- import { SdCliElectron } from "./entry/SdCliElectron";
9
- import { SdCliLocalUpdate } from "./entry/SdCliLocalUpdate";
10
- import { SdCliCordova } from "./entry/SdCliCordova";
11
- import { SdAiCommand } from "./entry/SdAiCommand";
8
+ import { SdCliElectron } from "./entry/sd-cli-electron";
9
+ import { SdCliLocalUpdate } from "./entry/sd-cli-local-update";
10
+ import { SdCliCordova } from "./entry/sd-cli-cordova";
11
+ import { SdCliAiCommand } from "./entry/sd-cli-ai-command";
12
12
 
13
13
  Error.stackTraceLimit = Infinity;
14
14
  EventEmitter.defaultMaxListeners = 0;
@@ -183,14 +183,14 @@ const argv = (await yargs(hideBin(process.argv))
183
183
 
184
184
  if (Boolean(argv.debug)) {
185
185
  process.env["SD_DEBUG"] = "true";
186
- Logger.setConfig({
186
+ SdLogger.setConfig({
187
187
  console: {
188
- level: LoggerSeverity.debug,
188
+ level: SdLoggerSeverity.debug,
189
189
  },
190
190
  });
191
191
  }
192
192
  else {
193
- Logger.setConfig({
193
+ SdLogger.setConfig({
194
194
  dot: true,
195
195
  });
196
196
  }
@@ -246,7 +246,7 @@ else if (argv._[0] === "run-cordova") {
246
246
  });
247
247
  }
248
248
  else if (argv._[0] === "commit") {
249
- await SdAiCommand.commitAsync();
249
+ await SdCliAiCommand.commitAsync();
250
250
  }
251
251
  else {
252
252
  throw new Error(`명령어가 잘못 되었습니다.\n\t${argv._[0]}\n`);