@simplysm/sd-cli 12.5.23 → 12.5.26

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 (67) hide show
  1. package/dist/entry/SdCliCordova.js +6 -6
  2. package/dist/entry/SdCliCordova.js.map +1 -1
  3. package/dist/entry/SdCliElectron.js +2 -2
  4. package/dist/entry/SdCliElectron.js.map +1 -1
  5. package/dist/entry/SdCliLocalUpdate.js +5 -7
  6. package/dist/entry/SdCliLocalUpdate.js.map +1 -1
  7. package/dist/entry/SdCliProject.js +4 -4
  8. package/dist/entry/SdCliProject.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/pkg-builders/SdMultiBuildRunner.d.ts +3 -10
  13. package/dist/pkg-builders/SdMultiBuildRunner.js +132 -116
  14. package/dist/pkg-builders/SdMultiBuildRunner.js.map +1 -1
  15. package/dist/pkg-builders/client/SdClientBuildRunner.d.ts +6 -5
  16. package/dist/pkg-builders/client/SdClientBuildRunner.js +16 -8
  17. package/dist/pkg-builders/client/SdClientBuildRunner.js.map +1 -1
  18. package/dist/pkg-builders/client/SdNgBundler.js +1 -0
  19. package/dist/pkg-builders/client/SdNgBundler.js.map +1 -1
  20. package/dist/pkg-builders/client/createSdNgPlugin.js +3 -3
  21. package/dist/pkg-builders/client/createSdNgPlugin.js.map +1 -1
  22. package/dist/pkg-builders/lib/SdTsLibBuildRunner.d.ts +6 -1
  23. package/dist/pkg-builders/lib/SdTsLibBuildRunner.js +25 -26
  24. package/dist/pkg-builders/lib/SdTsLibBuildRunner.js.map +1 -1
  25. package/dist/pkg-builders/lib/SdTsLibBuilder.d.ts +2 -3
  26. package/dist/pkg-builders/lib/SdTsLibBuilder.js +7 -11
  27. package/dist/pkg-builders/lib/SdTsLibBuilder.js.map +1 -1
  28. package/dist/pkg-builders/server/SdServerBuildRunner.d.ts +5 -1
  29. package/dist/pkg-builders/server/SdServerBuildRunner.js +32 -29
  30. package/dist/pkg-builders/server/SdServerBuildRunner.js.map +1 -1
  31. package/dist/pkg-builders/server/createSdServerPlugin.js +3 -3
  32. package/dist/pkg-builders/server/createSdServerPlugin.js.map +1 -1
  33. package/dist/ts-builder/SdTsCompiler.js +172 -160
  34. package/dist/ts-builder/SdTsCompiler.js.map +1 -1
  35. package/dist/types/build-runner.type.d.ts +7 -0
  36. package/dist/types/build-runner.type.js +2 -0
  37. package/dist/types/build-runner.type.js.map +1 -0
  38. package/dist/types/workers.type.d.ts +14 -0
  39. package/dist/workers/build-runner-worker.js +49 -0
  40. package/dist/workers/build-runner-worker.js.map +1 -0
  41. package/package.json +10 -10
  42. package/src/entry/SdCliCordova.ts +6 -5
  43. package/src/entry/SdCliElectron.ts +2 -2
  44. package/src/entry/SdCliLocalUpdate.ts +7 -7
  45. package/src/entry/SdCliProject.ts +4 -4
  46. package/src/index.ts +1 -1
  47. package/src/pkg-builders/SdMultiBuildRunner.ts +122 -120
  48. package/src/pkg-builders/client/SdClientBuildRunner.ts +26 -22
  49. package/src/pkg-builders/client/SdNgBundler.ts +1 -0
  50. package/src/pkg-builders/client/createSdNgPlugin.ts +3 -3
  51. package/src/pkg-builders/lib/SdTsLibBuildRunner.ts +39 -26
  52. package/src/pkg-builders/lib/SdTsLibBuilder.ts +12 -13
  53. package/src/pkg-builders/server/SdServerBuildRunner.ts +44 -29
  54. package/src/pkg-builders/server/createSdServerPlugin.ts +3 -3
  55. package/src/ts-builder/SdTsCompiler.ts +220 -216
  56. package/src/types/build-runner.type.ts +8 -0
  57. package/src/types/workers.type.ts +13 -0
  58. package/src/workers/build-runner-worker.ts +56 -0
  59. package/tsconfig.json +1 -1
  60. package/dist/ts-builder/SdTsCompileWorker.d.ts +0 -9
  61. package/dist/ts-builder/SdTsCompileWorker.js +0 -16
  62. package/dist/ts-builder/SdTsCompileWorker.js.map +0 -1
  63. package/dist/workers/compile-worker.js +0 -27
  64. package/dist/workers/compile-worker.js.map +0 -1
  65. package/src/ts-builder/SdTsCompileWorker.ts +0 -21
  66. package/src/workers/compile-worker.ts +0 -31
  67. /package/dist/workers/{compile-worker.d.ts → build-runner-worker.d.ts} +0 -0
@@ -7,20 +7,28 @@ import { ISdLibPackageConfig, ISdProjectConfig } from "../../types/sd-configs.ty
7
7
  import { ISdBuildMessage, ISdBuildRunnerResult } from "../../types/build.type";
8
8
 
9
9
  export class SdTsLibBuildRunner extends EventEmitter {
10
- readonly #logger = Logger.get(["simplysm", "sd-cli", "SdCliTsLibBuilder"]);
10
+ private _logger = Logger.get(["simplysm", "sd-cli", "SdCliTsLibBuilder"]);
11
11
 
12
- readonly #projConf: ISdProjectConfig;
13
- readonly #pkgPath: string;
14
- readonly #pkgConf: ISdLibPackageConfig;
12
+ private _projConf: ISdProjectConfig;
13
+ private _pkgPath: string;
14
+ private _pkgConf: ISdLibPackageConfig;
15
+ private _watchScopePathSet: Set<TNormPath>;
15
16
 
16
- #builder?: SdTsLibBuilder;
17
+ private _builder?: SdTsLibBuilder;
17
18
 
18
19
  public constructor(projConf: ISdProjectConfig, pkgPath: string) {
19
20
  super();
20
- this.#projConf = projConf;
21
- this.#pkgPath = pkgPath;
21
+ this._projConf = projConf;
22
+ this._pkgPath = pkgPath;
22
23
 
23
- this.#pkgConf = projConf.packages[path.basename(pkgPath)] as ISdLibPackageConfig;
24
+ this._pkgConf = projConf.packages[path.basename(pkgPath)] as ISdLibPackageConfig;
25
+
26
+ const localUpdatePaths = Object.keys(this._projConf.localUpdates ?? {}).mapMany((key) =>
27
+ FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
28
+ );
29
+ this._watchScopePathSet = new Set(
30
+ [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
31
+ );
24
32
  }
25
33
 
26
34
  public override on(event: "change", listener: () => void): this;
@@ -32,11 +40,11 @@ export class SdTsLibBuildRunner extends EventEmitter {
32
40
 
33
41
  public async buildAsync(): Promise<ISdBuildRunnerResult> {
34
42
  this._debug("dist 초기화...");
35
- FsUtil.remove(path.resolve(this.#pkgPath, "dist"));
43
+ FsUtil.remove(path.resolve(this._pkgPath, "dist"));
36
44
 
37
- if (!this.#pkgConf.noGenIndex) {
45
+ if (!this._pkgConf.noGenIndex) {
38
46
  this._debug("GEN index.ts...");
39
- SdCliIndexFileGenerator.run(this.#pkgPath, this.#pkgConf.polyfills);
47
+ SdCliIndexFileGenerator.run(this._pkgPath, this._pkgConf.polyfills);
40
48
  }
41
49
 
42
50
  const result = await this._runAsync(false, new Set<TNormPath>());
@@ -51,11 +59,11 @@ export class SdTsLibBuildRunner extends EventEmitter {
51
59
  this.emit("change");
52
60
 
53
61
  this._debug("dist 초기화...");
54
- FsUtil.remove(path.resolve(this.#pkgPath, "dist"));
62
+ FsUtil.remove(path.resolve(this._pkgPath, "dist"));
55
63
 
56
- if (!this.#pkgConf.noGenIndex) {
64
+ if (!this._pkgConf.noGenIndex) {
57
65
  this._debug("WATCH GEN index.ts...");
58
- SdCliIndexFileGenerator.watch(this.#pkgPath, this.#pkgConf.polyfills);
66
+ SdCliIndexFileGenerator.watch(this._pkgPath, this._pkgConf.polyfills);
59
67
  }
60
68
 
61
69
  const result = await this._runAsync(true, new Set<TNormPath>());
@@ -67,10 +75,14 @@ export class SdTsLibBuildRunner extends EventEmitter {
67
75
  this.emit("complete", res);
68
76
 
69
77
  this._debug("WATCH...");
70
- const watcher = SdFsWatcher.watch(Array.from(result.watchFileSet)).onChange({ delay: 100 }, async (changeInfos) => {
78
+ let lastWatchFileSet = result.watchFileSet;
79
+ SdFsWatcher.watch(Array.from(this._watchScopePathSet)).onChange({ delay: 100 }, async (changeInfos) => {
80
+ const currentChangeInfos = changeInfos.filter((item) => lastWatchFileSet.has(item.path));
81
+ if (currentChangeInfos.length < 1) return;
82
+
71
83
  this.emit("change");
72
84
 
73
- const changeFileSet = new Set(changeInfos.map((item) => PathUtil.norm(item.path)));
85
+ const changeFileSet = new Set(currentChangeInfos.map((item) => PathUtil.norm(item.path)));
74
86
 
75
87
  const watchResult = await this._runAsync(true, changeFileSet);
76
88
  const watchRes: ISdBuildRunnerResult = {
@@ -81,7 +93,7 @@ export class SdTsLibBuildRunner extends EventEmitter {
81
93
 
82
94
  this.emit("complete", watchRes);
83
95
 
84
- watcher.replaceWatchPaths(watchResult.watchFileSet);
96
+ lastWatchFileSet = watchResult.watchFileSet;
85
97
  });
86
98
  }
87
99
 
@@ -94,22 +106,23 @@ export class SdTsLibBuildRunner extends EventEmitter {
94
106
  buildMessages: ISdBuildMessage[];
95
107
  emitFileSet: Set<TNormPath>;
96
108
  }> {
97
- const localUpdatePaths = Object.keys(this.#projConf.localUpdates ?? {})
98
- .mapMany((key) => FsUtil.glob(path.resolve(this.#pkgPath, "../../node_modules", key)))
109
+ const localUpdatePaths = Object.keys(this._projConf.localUpdates ?? {})
110
+ .mapMany((key) => FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)))
99
111
  .map((item) => PathUtil.norm(item));
100
112
 
101
113
  this._debug(`BUILD...`);
102
- this.#builder ??= await SdTsLibBuilder.new(PathUtil.norm(this.#pkgPath), dev, [
103
- PathUtil.norm(this.#pkgPath, "../"),
104
- ...localUpdatePaths,
105
- ]);
106
- const buildResult = await this.#builder.buildAsync(modifiedFileSet);
114
+ this._builder ??= new SdTsLibBuilder(
115
+ PathUtil.norm(this._pkgPath),
116
+ dev,
117
+ [PathUtil.norm(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
118
+ );
119
+ const buildResult = await this._builder.buildAsync(modifiedFileSet);
107
120
 
108
121
  this._debug(`빌드 완료`);
109
122
  const watchFileSet = new Set(
110
123
  Array.from(buildResult.watchFileSet).filter(
111
124
  (item) =>
112
- PathUtil.isChildPath(item, path.resolve(this.#pkgPath, "../")) ||
125
+ PathUtil.isChildPath(item, path.resolve(this._pkgPath, "../")) ||
113
126
  localUpdatePaths.some((lu) => PathUtil.isChildPath(item, lu)),
114
127
  ),
115
128
  );
@@ -123,6 +136,6 @@ export class SdTsLibBuildRunner extends EventEmitter {
123
136
  }
124
137
 
125
138
  private _debug(msg: string): void {
126
- this.#logger.debug(`[${path.basename(this.#pkgPath)}] ${msg}`);
139
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
127
140
  }
128
141
  }
@@ -2,34 +2,33 @@ import path from "path";
2
2
  import { SdCliConvertMessageUtil } from "../../utils/SdCliConvertMessageUtil";
3
3
  import { FsUtil, PathUtil, TNormPath } from "@simplysm/sd-core-node";
4
4
  import { ISdBuildMessage } from "../../types/build.type";
5
- import { SdTsCompileWorker } from "../../ts-builder/SdTsCompileWorker";
5
+ import { SdTsCompiler } from "../../ts-builder/SdTsCompiler";
6
6
 
7
7
  export class SdTsLibBuilder {
8
- static async new(pkgPath: TNormPath, dev: boolean, watchScopePaths: TNormPath[]) {
9
- const tsCompiler = await SdTsCompileWorker.new({
10
- pkgPath,
8
+ private _tsCompiler: SdTsCompiler;
9
+
10
+ constructor(
11
+ private _pkgPath: TNormPath,
12
+ dev: boolean,
13
+ watchScopePaths: TNormPath[],
14
+ ) {
15
+ this._tsCompiler = new SdTsCompiler({
16
+ pkgPath: this._pkgPath,
11
17
  additionalOptions: { declaration: true },
12
18
  isDevMode: dev,
13
- globalStyleFilePath: PathUtil.norm(pkgPath, "src/styles.scss"),
19
+ globalStyleFilePath: PathUtil.norm(this._pkgPath, "src/styles.scss"),
14
20
  isForBundle: false,
15
21
  watchScopePaths: watchScopePaths,
16
22
  });
17
-
18
- return new SdTsLibBuilder(tsCompiler, pkgPath);
19
23
  }
20
24
 
21
- private constructor(
22
- private _compiler: SdTsCompileWorker,
23
- private _pkgPath: string,
24
- ) {}
25
-
26
25
  public async buildAsync(modifiedFileSet: Set<TNormPath>): Promise<{
27
26
  watchFileSet: Set<TNormPath>;
28
27
  affectedFileSet: Set<TNormPath>;
29
28
  results: ISdBuildMessage[];
30
29
  emitFileSet: Set<TNormPath>;
31
30
  }> {
32
- const tsCompileResult = await this._compiler.compileAsync(modifiedFileSet);
31
+ const tsCompileResult = await this._tsCompiler.compileAsync(modifiedFileSet);
33
32
 
34
33
  const emitFileSet = new Set<TNormPath>();
35
34
  for (const emitFile of tsCompileResult.emitFileSet) {
@@ -8,17 +8,25 @@ import { ISdBuildMessage, ISdBuildRunnerResult } from "../../types/build.type";
8
8
  import { INpmConfig, ITsConfig } from "../../types/common-configs.type";
9
9
 
10
10
  export class SdServerBuildRunner extends EventEmitter {
11
- #logger = Logger.get(["simplysm", "sd-cli", "SdCliServerBuildRunner"]);
12
- #pkgConf: ISdServerPackageConfig;
13
- #serverBundler?: SdServerBundler;
14
- #extModules?: { name: string; exists: boolean }[];
11
+ private _logger = Logger.get(["simplysm", "sd-cli", "SdCliServerBuildRunner"]);
12
+ private _pkgConf: ISdServerPackageConfig;
13
+ private _serverBundler?: SdServerBundler;
14
+ private _extModules?: { name: string; exists: boolean }[];
15
+ private _watchScopePathSet: Set<TNormPath>;
15
16
 
16
17
  public constructor(
17
18
  private readonly _projConf: ISdProjectConfig,
18
19
  private readonly _pkgPath: TNormPath,
19
20
  ) {
20
21
  super();
21
- this.#pkgConf = this._projConf.packages[path.basename(_pkgPath)] as ISdServerPackageConfig;
22
+ this._pkgConf = this._projConf.packages[path.basename(_pkgPath)] as ISdServerPackageConfig;
23
+
24
+ const localUpdatePaths = Object.keys(this._projConf.localUpdates ?? {}).mapMany((key) =>
25
+ FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
26
+ );
27
+ this._watchScopePathSet = new Set(
28
+ [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
29
+ );
22
30
  }
23
31
 
24
32
  public override on(event: "change", listener: () => void): this;
@@ -36,7 +44,7 @@ export class SdServerBuildRunner extends EventEmitter {
36
44
 
37
45
  this._debug("GEN .config...");
38
46
  const confDistPath = path.resolve(this._pkgPath, "dist/.config.json");
39
- FsUtil.writeFile(confDistPath, JSON.stringify(this.#pkgConf.configs ?? {}, undefined, 2));
47
+ FsUtil.writeFile(confDistPath, JSON.stringify(this._pkgConf.configs ?? {}, undefined, 2));
40
48
 
41
49
  const result = await this._runAsync(true);
42
50
  const res: ISdBuildRunnerResult = {
@@ -47,10 +55,17 @@ export class SdServerBuildRunner extends EventEmitter {
47
55
  this.emit("complete", res);
48
56
 
49
57
  this._debug("WATCH...");
50
- const watcher = SdFsWatcher.watch(Array.from(result.watchFileSet)).onChange({ delay: 100 }, async (changeInfos) => {
58
+ let lastWatchFileSet = result.watchFileSet;
59
+ SdFsWatcher.watch(Array.from(this._watchScopePathSet)).onChange({ delay: 100 }, async (changeInfos) => {
60
+ const currentChangeInfos = changeInfos.filter((item) => lastWatchFileSet.has(item.path));
61
+ if (currentChangeInfos.length < 1) return;
62
+
51
63
  this.emit("change");
52
64
 
53
- const watchResult = await this._runAsync(true, new Set(changeInfos.map((item) => PathUtil.norm(item.path))));
65
+ const watchResult = await this._runAsync(
66
+ true,
67
+ new Set(currentChangeInfos.map((item) => PathUtil.norm(item.path))),
68
+ );
54
69
  const watchRes: ISdBuildRunnerResult = {
55
70
  affectedFilePathSet: watchResult.affectedFileSet,
56
71
  buildMessages: watchResult.buildMessages,
@@ -59,7 +74,7 @@ export class SdServerBuildRunner extends EventEmitter {
59
74
 
60
75
  this.emit("complete", watchRes);
61
76
 
62
- watcher.replaceWatchPaths(watchResult.watchFileSet);
77
+ lastWatchFileSet = watchResult.watchFileSet;
63
78
  });
64
79
  }
65
80
 
@@ -72,7 +87,7 @@ export class SdServerBuildRunner extends EventEmitter {
72
87
 
73
88
  this._debug("GEN .config.json...");
74
89
  const confDistPath = path.resolve(this._pkgPath, "dist/.config.json");
75
- FsUtil.writeJson(confDistPath, this.#pkgConf.configs ?? {}, { space: 2 });
90
+ FsUtil.writeJson(confDistPath, this._pkgConf.configs ?? {}, { space: 2 });
76
91
 
77
92
  this._debug("GEN package.json...");
78
93
  {
@@ -87,7 +102,7 @@ export class SdServerBuildRunner extends EventEmitter {
87
102
  delete distNpmConfig.devDependencies;
88
103
  delete distNpmConfig.peerDependencies;
89
104
 
90
- if (this.#pkgConf.pm2 && !this.#pkgConf.pm2.noStartScript) {
105
+ if (this._pkgConf.pm2 && !this._pkgConf.pm2.noStartScript) {
91
106
  distNpmConfig.scripts = { start: "pm2 start pm2.json" };
92
107
  }
93
108
 
@@ -123,18 +138,18 @@ Options = UnsafeLegacyRenegotiation`.trim(),
123
138
  );
124
139
  }
125
140
 
126
- if (this.#pkgConf.pm2) {
141
+ if (this._pkgConf.pm2) {
127
142
  this._debug("GEN pm2.json...");
128
143
 
129
144
  FsUtil.writeJson(
130
145
  path.resolve(this._pkgPath, "dist/pm2.json"),
131
146
  {
132
- name: this.#pkgConf.pm2.name ?? npmConfig.name.replace(/@/g, "").replace(/\//g, "-"),
147
+ name: this._pkgConf.pm2.name ?? npmConfig.name.replace(/@/g, "").replace(/\//g, "-"),
133
148
  script: "main.js",
134
149
  watch: true,
135
150
  watch_delay: 2000,
136
- ignore_watch: ["node_modules", "www", ...(this.#pkgConf.pm2.ignoreWatchPaths ?? [])],
137
- ...(this.#pkgConf.pm2.noInterpreter
151
+ ignore_watch: ["node_modules", "www", ...(this._pkgConf.pm2.ignoreWatchPaths ?? [])],
152
+ ...(this._pkgConf.pm2.noInterpreter
138
153
  ? {}
139
154
  : {
140
155
  interpreter: "node@" + process.versions.node,
@@ -144,7 +159,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
144
159
  NODE_ENV: "production",
145
160
  TZ: "Asia/Seoul",
146
161
  SD_VERSION: npmConfig.version,
147
- ...this.#pkgConf.env,
162
+ ...this._pkgConf.env,
148
163
  },
149
164
  arrayProcess: "concat",
150
165
  useDelTargetNull: true,
@@ -155,11 +170,11 @@ Options = UnsafeLegacyRenegotiation`.trim(),
155
170
  );
156
171
  }
157
172
 
158
- if (this.#pkgConf.iis) {
173
+ if (this._pkgConf.iis) {
159
174
  this._debug("GEN web.config...");
160
175
 
161
176
  const iisDistPath = path.resolve(this._pkgPath, "dist/web.config");
162
- const serverExeFilePath = this.#pkgConf.iis.nodeExeFilePath ?? "C:\\Program Files\\nodejs\\node.exe";
177
+ const serverExeFilePath = this._pkgConf.iis.nodeExeFilePath ?? "C:\\Program Files\\nodejs\\node.exe";
163
178
  FsUtil.writeFile(
164
179
  iisDistPath,
165
180
  `
@@ -168,8 +183,8 @@ Options = UnsafeLegacyRenegotiation`.trim(),
168
183
  <add key="NODE_ENV" value="production" />
169
184
  <add key="TZ" value="Asia/Seoul" />
170
185
  <add key="SD_VERSION" value="${npmConfig.version}" />
171
- ${Object.keys(this.#pkgConf.env ?? {})
172
- .map((key) => `<add key="${key}" value="${this.#pkgConf.env![key]}"/>`)
186
+ ${Object.keys(this._pkgConf.env ?? {})
187
+ .map((key) => `<add key="${key}" value="${this._pkgConf.env![key]}"/>`)
173
188
  .join("\n ")}
174
189
  </appSettings>
175
190
  <system.webServer>
@@ -218,21 +233,21 @@ Options = UnsafeLegacyRenegotiation`.trim(),
218
233
 
219
234
  this._debug(`BUILD 준비...`);
220
235
  const tsConfig = FsUtil.readJson(path.resolve(this._pkgPath, "tsconfig.json")) as ITsConfig;
221
- this.#extModules = this.#extModules ?? (await this._getExternalModulesAsync());
222
- this.#serverBundler =
223
- this.#serverBundler ??
236
+ this._extModules = this._extModules ?? (await this._getExternalModulesAsync());
237
+ this._serverBundler =
238
+ this._serverBundler ??
224
239
  new SdServerBundler({
225
240
  dev,
226
241
  pkgPath: this._pkgPath,
227
242
  entryPoints: tsConfig.files
228
243
  ? tsConfig.files.map((item) => path.resolve(this._pkgPath, item))
229
244
  : [path.resolve(this._pkgPath, "src/main.ts")],
230
- external: this.#extModules.map((item) => item.name),
245
+ external: this._extModules.map((item) => item.name),
231
246
  watchScopePaths: [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
232
247
  });
233
248
 
234
249
  this._debug(`BUILD...`);
235
- const bundleResult = await this.#serverBundler.bundleAsync(modifiedFileSet);
250
+ const bundleResult = await this._serverBundler.bundleAsync(modifiedFileSet);
236
251
 
237
252
  //-- filePaths
238
253
  const watchFileSet = new Set(
@@ -304,7 +319,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
304
319
  });
305
320
  }
306
321
 
307
- if (this.#pkgConf.externals?.includes(moduleName)) {
322
+ if (this._pkgConf.externals?.includes(moduleName)) {
308
323
  results.push({
309
324
  name: moduleName,
310
325
  exists: true,
@@ -338,7 +353,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
338
353
  });
339
354
  }
340
355
 
341
- if (this.#pkgConf.externals?.includes(optModuleName)) {
356
+ if (this._pkgConf.externals?.includes(optModuleName)) {
342
357
  results.push({
343
358
  name: optModuleName,
344
359
  exists: true,
@@ -351,7 +366,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
351
366
 
352
367
  await fn(this._pkgPath);
353
368
 
354
- for (const external of this.#pkgConf.externals ?? []) {
369
+ for (const external of this._pkgConf.externals ?? []) {
355
370
  if (!results.some((item) => item.name === external)) {
356
371
  results.push({
357
372
  name: external,
@@ -364,6 +379,6 @@ Options = UnsafeLegacyRenegotiation`.trim(),
364
379
  }
365
380
 
366
381
  private _debug(msg: string): void {
367
- this.#logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
382
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
368
383
  }
369
384
  }
@@ -2,8 +2,8 @@ import esbuild from "esbuild";
2
2
  import { SdCliConvertMessageUtil } from "../../utils/SdCliConvertMessageUtil";
3
3
  import { ISdCliServerPluginResultCache } from "../../types/build-plugin.type";
4
4
  import { PathUtil, TNormPath } from "@simplysm/sd-core-node";
5
- import { SdTsCompileWorker } from "../../ts-builder/SdTsCompileWorker";
6
5
  import { ISdTsCompilerResult } from "../../types/ts-compiler.type";
6
+ import { SdTsCompiler } from "../../ts-builder/SdTsCompiler";
7
7
 
8
8
  export function createSdServerPlugin(conf: {
9
9
  pkgPath: TNormPath;
@@ -14,8 +14,8 @@ export function createSdServerPlugin(conf: {
14
14
  }): esbuild.Plugin {
15
15
  return {
16
16
  name: "sd-server-compile",
17
- setup: async (build: esbuild.PluginBuild) => {
18
- const tsCompiler = await SdTsCompileWorker.new({
17
+ setup: (build: esbuild.PluginBuild) => {
18
+ const tsCompiler = new SdTsCompiler({
19
19
  pkgPath: conf.pkgPath,
20
20
  additionalOptions: { declaration: false },
21
21
  isDevMode: conf.dev,