@simplysm/sd-cli 12.8.22 → 12.9.1

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 (95) hide show
  1. package/dist/entry/sd-cli-ai-command.js +2 -1
  2. package/dist/entry/sd-cli-ai-command.js.map +1 -1
  3. package/dist/entry/sd-cli-cordova.d.ts +1 -1
  4. package/dist/entry/sd-cli-cordova.js +1 -1
  5. package/dist/entry/sd-cli-cordova.js.map +1 -1
  6. package/dist/entry/sd-cli-electron.d.ts +6 -6
  7. package/dist/entry/sd-cli-electron.js +15 -9
  8. package/dist/entry/sd-cli-electron.js.map +1 -1
  9. package/dist/entry/sd-cli-local-update.d.ts +5 -5
  10. package/dist/entry/sd-cli-local-update.js +8 -12
  11. package/dist/entry/sd-cli-local-update.js.map +1 -1
  12. package/dist/entry/sd-cli-project.d.ts +11 -11
  13. package/dist/entry/sd-cli-project.js +11 -14
  14. package/dist/entry/sd-cli-project.js.map +1 -1
  15. package/dist/entry/utils/loadProjConfAsync.d.ts +5 -0
  16. package/dist/entry/utils/loadProjConfAsync.js +8 -0
  17. package/dist/entry/utils/loadProjConfAsync.js.map +1 -0
  18. package/dist/pkg-builders/client/sd-client.build-runner.js +1 -1
  19. package/dist/pkg-builders/client/sd-client.build-runner.js.map +1 -1
  20. package/dist/pkg-builders/client/sd-ng.bundler-context.d.ts +6 -5
  21. package/dist/pkg-builders/client/sd-ng.bundler-context.js +6 -6
  22. package/dist/pkg-builders/client/sd-ng.bundler-context.js.map +1 -1
  23. package/dist/pkg-builders/client/sd-ng.bundler.d.ts +13 -13
  24. package/dist/pkg-builders/client/sd-ng.bundler.js.map +1 -1
  25. package/dist/pkg-builders/client/sd-ng.plugin-creator.js +4 -88
  26. package/dist/pkg-builders/client/sd-ng.plugin-creator.js.map +1 -1
  27. package/dist/pkg-builders/lib/sd-js-lib.build-runner.js.map +1 -1
  28. package/dist/pkg-builders/lib/sd-ts-lib.build-runner.d.ts +1 -1
  29. package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js.map +1 -1
  30. package/dist/pkg-builders/lib/sd-ts-lib.builder.js.map +1 -1
  31. package/dist/pkg-builders/sd-multi.build-runner.d.ts +4 -0
  32. package/dist/pkg-builders/sd-multi.build-runner.js +33 -25
  33. package/dist/pkg-builders/sd-multi.build-runner.js.map +1 -1
  34. package/dist/pkg-builders/server/sd-server.build-runner.js.map +1 -1
  35. package/dist/pkg-builders/server/sd-server.bundler.d.ts +6 -2
  36. package/dist/pkg-builders/server/sd-server.bundler.js +18 -19
  37. package/dist/pkg-builders/server/sd-server.bundler.js.map +1 -1
  38. package/dist/sd-cli/vitest.config.d.ts +2 -0
  39. package/dist/sd-cli/vitest.config.js +15 -0
  40. package/dist/sd-cli/vitest.config.js.map +1 -0
  41. package/dist/sd-cli.js +7 -36
  42. package/dist/sd-cli.js.map +1 -1
  43. package/dist/ts-compiler/sd-dependency-analyzer.d.ts +8 -0
  44. package/dist/ts-compiler/sd-dependency-analyzer.js +244 -0
  45. package/dist/ts-compiler/sd-dependency-analyzer.js.map +1 -0
  46. package/dist/ts-compiler/sd-dependency-cache.d.ts +27 -0
  47. package/dist/ts-compiler/sd-dependency-cache.js +232 -0
  48. package/dist/ts-compiler/sd-dependency-cache.js.map +1 -0
  49. package/dist/ts-compiler/sd-ts-compiler.d.ts +7 -10
  50. package/dist/ts-compiler/sd-ts-compiler.js +102 -228
  51. package/dist/ts-compiler/sd-ts-compiler.js.map +1 -1
  52. package/dist/types/worker.types.d.ts +19 -0
  53. package/dist/utils/sd-cli-performance-time.d.ts +2 -1
  54. package/dist/utils/sd-cli-performance-time.js +9 -9
  55. package/dist/utils/sd-cli-performance-time.js.map +1 -1
  56. package/dist/workers/style-bundler.worker.d.ts +1 -0
  57. package/dist/workers/style-bundler.worker.js +56 -0
  58. package/dist/workers/style-bundler.worker.js.map +1 -0
  59. package/package.json +10 -10
  60. package/src/entry/sd-cli-ai-command.ts +2 -1
  61. package/src/entry/sd-cli-cordova.ts +5 -5
  62. package/src/entry/sd-cli-electron.ts +54 -23
  63. package/src/entry/sd-cli-local-update.ts +14 -29
  64. package/src/entry/sd-cli-project.ts +24 -41
  65. package/src/entry/utils/loadProjConfAsync.ts +12 -0
  66. package/src/pkg-builders/client/sd-client.build-runner.ts +7 -7
  67. package/src/pkg-builders/client/sd-ng.bundler-context.ts +15 -12
  68. package/src/pkg-builders/client/sd-ng.bundler.ts +16 -16
  69. package/src/pkg-builders/client/sd-ng.plugin-creator.ts +5 -94
  70. package/src/pkg-builders/lib/sd-js-lib.build-runner.ts +6 -6
  71. package/src/pkg-builders/lib/sd-ts-lib.build-runner.ts +7 -7
  72. package/src/pkg-builders/lib/sd-ts-lib.builder.ts +1 -1
  73. package/src/pkg-builders/sd-multi.build-runner.ts +54 -39
  74. package/src/pkg-builders/server/sd-server.build-runner.ts +6 -6
  75. package/src/pkg-builders/server/sd-server.bundler.ts +26 -28
  76. package/src/sd-cli.ts +7 -36
  77. package/src/ts-compiler/sd-dependency-analyzer.ts +312 -0
  78. package/src/ts-compiler/sd-dependency-cache.ts +328 -0
  79. package/src/ts-compiler/sd-ts-compiler.ts +161 -302
  80. package/src/types/worker.types.ts +17 -0
  81. package/src/utils/sd-cli-performance-time.ts +9 -9
  82. package/src/workers/style-bundler.worker.ts +70 -0
  83. package/tests/deps/sd-dependency-analyzer.spec.ts +272 -0
  84. package/tests/deps/sd-dependency-cache.spec.ts +144 -0
  85. package/tsconfig.json +1 -1
  86. package/tsconfig.test.json +8 -0
  87. package/vitest.config.ts +15 -0
  88. package/dist/index.d.ts +0 -34
  89. package/dist/index.js +0 -35
  90. package/dist/index.js.map +0 -1
  91. package/dist/ts-compiler/sd-ts-dependency-analyzer.d.ts +0 -6
  92. package/dist/ts-compiler/sd-ts-dependency-analyzer.js +0 -141
  93. package/dist/ts-compiler/sd-ts-dependency-analyzer.js.map +0 -1
  94. package/src/index.ts +0 -34
  95. package/src/ts-compiler/sd-ts-dependency-analyzer.ts +0 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AAI,CAAC;qCACwB,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ import { createSdWorker, SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
2
+ import { EventEmitter } from "events";
3
+ import { ComponentStylesheetBundler, } from "@angular/build/src/tools/esbuild/angular/component-stylesheets";
4
+ import { transformSupportedBrowsersToTargets } from "@angular/build/src/tools/esbuild/utils";
5
+ import browserslist from "browserslist";
6
+ Error.stackTraceLimit = Infinity;
7
+ EventEmitter.defaultMaxListeners = 0;
8
+ if (process.env["SD_DEBUG"] != null) {
9
+ SdLogger.setConfig({
10
+ console: {
11
+ level: SdLoggerSeverity.debug,
12
+ },
13
+ });
14
+ }
15
+ else {
16
+ SdLogger.setConfig({
17
+ dot: true,
18
+ });
19
+ }
20
+ let stylesheetBundler;
21
+ createSdWorker({
22
+ prepare(rootPath, dev) {
23
+ //-- stylesheetBundler
24
+ stylesheetBundler = new ComponentStylesheetBundler({
25
+ workspaceRoot: rootPath,
26
+ optimization: !dev,
27
+ inlineFonts: true,
28
+ preserveSymlinks: false,
29
+ sourcemap: dev ? "inline" : false,
30
+ outputNames: { bundles: "[name]", media: "media/[name]" },
31
+ includePaths: [],
32
+ // sass:
33
+ externalDependencies: [],
34
+ target: transformSupportedBrowsersToTargets(browserslist(["Chrome > 78"])),
35
+ tailwindConfiguration: undefined,
36
+ postcssConfiguration: {
37
+ plugins: [["css-has-pseudo"]],
38
+ },
39
+ // publicPath:
40
+ cacheOptions: {
41
+ enabled: true,
42
+ path: ".cache/angular",
43
+ basePath: ".cache",
44
+ },
45
+ }, "scss", dev);
46
+ },
47
+ async bundle(data, containingFile, resourceFile = null) {
48
+ return resourceFile != null
49
+ ? await stylesheetBundler.bundleFile(resourceFile)
50
+ : await stylesheetBundler.bundleInline(data, containingFile, "scss");
51
+ },
52
+ invalidate(fileNPathSet) {
53
+ stylesheetBundler.invalidate(fileNPathSet);
54
+ },
55
+ });
56
+ //# sourceMappingURL=style-bundler.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-bundler.worker.js","sourceRoot":"","sources":["../../src/workers/style-bundler.worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAa,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACL,0BAA0B,GAC3B,MAAM,gEAAgE,CAAC;AACxE,OAAO,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AACjC,YAAY,CAAC,mBAAmB,GAAG,CAAC,CAAC;AAErC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC;QACjB,OAAO,EAAE;YACP,KAAK,EAAE,gBAAgB,CAAC,KAAK;SAC9B;KACF,CAAC,CAAC;AACL,CAAC;KACI,CAAC;IACJ,QAAQ,CAAC,SAAS,CAAC;QACjB,GAAG,EAAE,IAAI;KACV,CAAC,CAAC;AACL,CAAC;AAED,IAAI,iBAA6C,CAAC;AAElD,cAAc,CAA0B;IACtC,OAAO,CAAC,QAAgB,EAAE,GAAY;QACpC,sBAAsB;QACtB,iBAAiB,GAAG,IAAI,0BAA0B,CAChD;YACE,aAAa,EAAE,QAAQ;YACvB,YAAY,EAAE,CAAC,GAAG;YAClB,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,KAAK;YACvB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YACjC,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;YACzD,YAAY,EAAE,EAAE;YAChB,QAAQ;YACR,oBAAoB,EAAE,EAAE;YACxB,MAAM,EAAE,mCAAmC,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YAC1E,qBAAqB,EAAE,SAAS;YAChC,oBAAoB,EAAE;gBACpB,OAAO,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC;aAC9B;YACD,cAAc;YACd,YAAY,EAAE;gBACZ,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,gBAAgB;gBACtB,QAAQ,EAAE,QAAQ;aACnB;SACF,EACD,MAAM,EACN,GAAG,CACJ,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,MAAM,CACV,IAAY,EACZ,cAAyB,EACzB,eAAiC,IAAI;QAErC,OAAO,YAAY,IAAI,IAAI;YACzB,CAAC,CAAC,MAAM,iBAAkB,CAAC,UAAU,CAAC,YAAY,CAAC;YACnD,CAAC,CAAC,MAAM,iBAAkB,CAAC,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IACD,UAAU,CAAC,YAA4B;QACrC,iBAAiB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-cli",
3
- "version": "12.8.22",
3
+ "version": "12.9.1",
4
4
  "description": "심플리즘 패키지 - CLI",
5
5
  "author": "김석래",
6
6
  "repository": {
@@ -11,25 +11,23 @@
11
11
  "license": "MIT",
12
12
  "bin": "./bin/sd-cli.js",
13
13
  "type": "module",
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
14
  "dependencies": {
17
15
  "@angular/build": "^19.2.10",
18
16
  "@angular/compiler": "^19.2.9",
19
17
  "@angular/compiler-cli": "^19.2.9",
20
18
  "@anthropic-ai/sdk": "^0.40.1",
21
19
  "@electron/rebuild": "^4.0.1",
22
- "@simplysm/sd-core-common": "12.8.22",
23
- "@simplysm/sd-core-node": "12.8.22",
24
- "@simplysm/sd-service-server": "12.8.22",
25
- "@simplysm/sd-storage": "12.8.22",
26
- "browserslist": "^4.24.4",
20
+ "@simplysm/sd-core-common": "12.9.1",
21
+ "@simplysm/sd-core-node": "12.9.1",
22
+ "@simplysm/sd-service-server": "12.9.1",
23
+ "@simplysm/sd-storage": "12.9.1",
24
+ "browserslist": "^4.24.5",
27
25
  "cordova": "^12.0.0",
28
26
  "css-has-pseudo": "^7.0.2",
29
27
  "electron": "^36.1.0",
30
28
  "electron-builder": "^26.0.14",
31
29
  "esbuild": "^0.25.3",
32
- "eslint": "^9.25.1",
30
+ "eslint": "^9.26.0",
33
31
  "glob": "^11.0.2",
34
32
  "node-stdlib-browser": "^1.3.1",
35
33
  "postcss": "^8.5.3",
@@ -43,6 +41,8 @@
43
41
  "devDependencies": {
44
42
  "@types/eslint": "^9.6.1",
45
43
  "@types/xml2js": "^0.4.14",
46
- "@types/yargs": "^17.0.33"
44
+ "@types/yargs": "^17.0.33",
45
+ "vite-tsconfig-paths": "^5.1.4",
46
+ "vitest": "^3.1.2"
47
47
  }
48
48
  }
@@ -54,7 +54,8 @@ ${diff}`,
54
54
  "\n-------------------------\n\n",
55
55
  );
56
56
 
57
- const messages = message.content[0].text.replaceAll(/"/g, '\\"').matchAll(/```(?:\w*\n)?([\s\S]*?)```/g);
57
+ const messages = message.content[0].text.replaceAll(/"/g, "\\\"")
58
+ .matchAll(/```(?:\w*\n)?([\s\S]*?)```/g);
58
59
  const commitMessage = Array.from(messages)
59
60
  .map(item => item[1].trim())
60
61
  .join("\n\n\n");
@@ -28,7 +28,7 @@ export class SdCliCordova {
28
28
  private _platforms: string[];
29
29
  private _npmConfig: INpmConfig;
30
30
 
31
- constructor(private readonly _opt: { pkgPath: string; config: ISdClientBuilderCordovaConfig }) {
31
+ constructor(private _opt: { pkgPath: string; config: ISdClientBuilderCordovaConfig }) {
32
32
  this._platforms = Object.keys(this._opt.config.platform ?? { browser: {} });
33
33
  this._npmConfig = FsUtils.readJson(path.resolve(this._opt.pkgPath, "package.json"));
34
34
  }
@@ -46,7 +46,7 @@ export class SdCliCordova {
46
46
  }
47
47
  }
48
48
 
49
- public async initializeAsync(): Promise<void> {
49
+ async initializeAsync(): Promise<void> {
50
50
  const cordovaPath = path.resolve(this._opt.pkgPath, this.CORDOVA_DIR_NAME);
51
51
 
52
52
  // 1. Cordova 프로젝트 초기화
@@ -289,7 +289,7 @@ export class SdCliCordova {
289
289
 
290
290
  // CONFIG: 파일 새로 쓰기
291
291
  const configResultContent = XmlConvert.stringify(configXml, {
292
- format: true
292
+ format: true,
293
293
  });
294
294
  FsUtils.writeFile(configFilePath, configResultContent);
295
295
  }
@@ -435,7 +435,7 @@ export class SdCliCordova {
435
435
  configXml.widget.platform.push(androidPlatform);
436
436
  }
437
437
 
438
- public async buildAsync(outPath: string): Promise<void> {
438
+ async buildAsync(outPath: string): Promise<void> {
439
439
  const cordovaPath = path.resolve(this._opt.pkgPath, this.CORDOVA_DIR_NAME);
440
440
 
441
441
  // 빌드 실행 - 병렬 처리로 개선
@@ -526,7 +526,7 @@ export class SdCliCordova {
526
526
  }
527
527
  }
528
528
 
529
- public static async runWebviewOnDeviceAsync(opt: {
529
+ static async runWebviewOnDeviceAsync(opt: {
530
530
  platform: string;
531
531
  pkgName: string;
532
532
  url?: string
@@ -1,23 +1,24 @@
1
1
  import { FsUtils, SdLogger, SdProcess } from "@simplysm/sd-core-node";
2
- import { pathToFileURL } from "url";
3
2
  import path from "path";
4
3
  import electronBuilder from "electron-builder";
5
- import { ISdClientBuilderElectronConfig, ISdProjectConfig } from "../types/config.types";
4
+ import { ISdClientBuilderElectronConfig } from "../types/config.types";
6
5
  import { INpmConfig } from "../types/common-configs.types";
6
+ import { loadProjConfAsync } from "./utils/loadProjConfAsync";
7
7
 
8
8
  export class SdCliElectron {
9
- static async runAsync(opt: { confFileRelPath: string; optNames: string[]; pkgName: string }): Promise<void> {
9
+ static async runAsync(opt: {
10
+ package: string
11
+ config?: string;
12
+ options?: string[];
13
+ }) {
10
14
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliElectron", "runAsync"]);
11
15
 
12
- const pkgPath = path.resolve(process.cwd(), `packages/${opt.pkgName}`);
16
+ const pkgPath = path.resolve(process.cwd(), `packages/${opt.package}`);
13
17
  const electronPath = path.resolve(pkgPath, "dist/electron");
14
18
 
15
19
  logger.log("설정 가져오기...");
16
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(
17
- true,
18
- opt.optNames,
19
- ) as ISdProjectConfig;
20
- const pkgConf = projConf.packages[opt.pkgName];
20
+ const projConf = await loadProjConfAsync(process.cwd(), true, opt);
21
+ const pkgConf = projConf.packages[opt.package];
21
22
  if (pkgConf?.type !== "client" || pkgConf.builder?.electron === undefined) {
22
23
  throw new Error();
23
24
  }
@@ -66,19 +67,20 @@ export class SdCliElectron {
66
67
  await SdProcess.spawnAsync(`npx electron .`, { cwd: electronPath }, true);
67
68
  }
68
69
 
69
- static async buildForDevAsync(opt: { confFileRelPath: string; optNames: string[]; pkgName: string }): Promise<void> {
70
+ static async buildForDevAsync(opt: {
71
+ package: string
72
+ config?: string;
73
+ options?: string[];
74
+ }) {
70
75
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliElectron", "buildForDevAsync"]);
71
76
 
72
- const pkgPath = path.resolve(process.cwd(), `packages/${opt.pkgName}`);
77
+ const pkgPath = path.resolve(process.cwd(), `packages/${opt.package}`);
73
78
  const electronPath = path.resolve(pkgPath, "dist/electron");
74
79
  const electronDistPath = path.resolve(pkgPath, ".electron/dist");
75
80
 
76
81
  logger.log("설정 가져오기...");
77
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(
78
- true,
79
- opt.optNames,
80
- ) as ISdProjectConfig;
81
- const pkgConf = projConf.packages[opt.pkgName];
82
+ const projConf = await loadProjConfAsync(process.cwd(), true, opt);
83
+ const pkgConf = projConf.packages[opt.package];
82
84
  if (pkgConf?.type !== "client" || pkgConf.builder?.electron === undefined) {
83
85
  throw new Error();
84
86
  }
@@ -149,12 +151,25 @@ export class SdCliElectron {
149
151
  });
150
152
 
151
153
  FsUtils.copy(
152
- path.resolve(electronDistPath, `${npmConfig.description} ${pkgConf.builder.electron.portable ? "" : "Setup "}${npmConfig.version}.exe`),
153
- path.resolve(pkgPath, `dist/electron/${npmConfig.description}${pkgConf.builder.electron.portable ? "-portable" : ""}-dev.exe`),
154
+ path.resolve(
155
+ electronDistPath,
156
+ `${npmConfig.description} ${pkgConf.builder.electron.portable
157
+ ? ""
158
+ : "Setup "}${npmConfig.version}.exe`,
159
+ ),
160
+ path.resolve(
161
+ pkgPath,
162
+ `dist/electron/${npmConfig.description}${pkgConf.builder.electron.portable
163
+ ? "-portable"
164
+ : ""}-dev.exe`,
165
+ ),
154
166
  );
155
167
  }
156
168
 
157
- static async buildAsync(opt: { pkgPath: string; config: ISdClientBuilderElectronConfig }): Promise<void> {
169
+ static async buildAsync(opt: {
170
+ pkgPath: string;
171
+ config: ISdClientBuilderElectronConfig
172
+ }) {
158
173
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliElectron", "buildAsync"]);
159
174
 
160
175
  const electronSrcPath = path.resolve(opt.pkgPath, ".electron/src");
@@ -187,7 +202,12 @@ export class SdCliElectron {
187
202
  await SdProcess.spawnAsync(`npm install`, { cwd: electronSrcPath }, true);
188
203
 
189
204
  for (const reinstallPkgName of reinstallPkgNames) {
190
- if (FsUtils.exists(path.resolve(electronSrcPath, "node_modules", reinstallPkgName, "binding.gyp"))) {
205
+ if (FsUtils.exists(path.resolve(
206
+ electronSrcPath,
207
+ "node_modules",
208
+ reinstallPkgName,
209
+ "binding.gyp",
210
+ ))) {
191
211
  logger.log(`electron rebuild (${reinstallPkgName})...`);
192
212
  await SdProcess.spawnAsync(
193
213
  `electron-rebuild -m ./node_modules/${reinstallPkgName}`,
@@ -223,12 +243,23 @@ export class SdCliElectron {
223
243
  });
224
244
 
225
245
  FsUtils.copy(
226
- path.resolve(electronDistPath, `${npmConfig.description} ${opt.config.portable ? "" : "Setup "}${npmConfig.version}.exe`),
227
- path.resolve(opt.pkgPath, `dist/electron/${npmConfig.description}${opt.config.portable ? "-portable" : ""}-latest.exe`),
246
+ path.resolve(
247
+ electronDistPath,
248
+ `${npmConfig.description} ${opt.config.portable ? "" : "Setup "}${npmConfig.version}.exe`,
249
+ ),
250
+ path.resolve(
251
+ opt.pkgPath,
252
+ `dist/electron/${npmConfig.description}${opt.config.portable
253
+ ? "-portable"
254
+ : ""}-latest.exe`,
255
+ ),
228
256
  );
229
257
 
230
258
  FsUtils.copy(
231
- path.resolve(electronDistPath, `${npmConfig.description} ${opt.config.portable ? "" : "Setup "}${npmConfig.version}.exe`),
259
+ path.resolve(
260
+ electronDistPath,
261
+ `${npmConfig.description} ${opt.config.portable ? "" : "Setup "}${npmConfig.version}.exe`,
262
+ ),
232
263
  path.resolve(opt.pkgPath, `dist/electron/updates/${npmConfig.version}.exe`),
233
264
  );
234
265
  }
@@ -1,20 +1,16 @@
1
- import { FsUtils, SdLogger, PathUtils, SdFsWatcher } from "@simplysm/sd-core-node";
1
+ import { FsUtils, PathUtils, SdFsWatcher, SdLogger } from "@simplysm/sd-core-node";
2
2
  import path from "path";
3
- import { pathToFileURL } from "url";
4
- import { ISdProjectConfig } from "../types/config.types";
3
+ import { loadProjConfAsync } from "./utils/loadProjConfAsync";
5
4
 
6
5
  export class SdCliLocalUpdate {
7
- static async runAsync(opt: { confFileRelPath: string; optNames: string[] }): Promise<void> {
6
+ static async runAsync(opt: { config?: string; options?: string[] }): Promise<void> {
8
7
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "runAsync"]);
9
8
 
10
9
  logger.debug("프로젝트 설정 가져오기...");
11
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(
12
- true,
13
- opt.optNames,
14
- ) as ISdProjectConfig;
10
+ const projConf = await loadProjConfAsync(process.cwd(), true, opt);
15
11
  if (!projConf.localUpdates) return;
16
12
 
17
- const updatePathInfos = this.#getUpdatePathInfos(projConf.localUpdates);
13
+ const updatePathInfos = this._getUpdatePathInfos(projConf.localUpdates);
18
14
  logger.debug("로컬 업데이트 구성", updatePathInfos);
19
15
 
20
16
  logger.log("로컬 라이브러리 업데이트 시작...");
@@ -32,24 +28,20 @@ export class SdCliLocalUpdate {
32
28
  logger.info("로컬 라이브러리 업데이트 완료");
33
29
  }
34
30
 
35
- static async watchAsync(opt: { confFileRelPath: string; optNames: string[] }): Promise<void> {
31
+ static async watchAsync(opt: { config?: string; options?: string[] }): Promise<void> {
36
32
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "watchAsync"]);
37
33
 
38
34
  logger.debug("프로젝트 설정 가져오기...");
39
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(
40
- true,
41
- opt.optNames,
42
- ) as ISdProjectConfig;
35
+ const projConf = await loadProjConfAsync(process.cwd(), true, opt);
43
36
  if (!projConf.localUpdates) return;
44
37
 
45
- const updatePathInfos = this.#getUpdatePathInfos(projConf.localUpdates);
46
- logger.debug("로컬 업데이트 구성");
47
-
48
- // const watchPaths = updatePathInfos.mapMany((item) => this.#getWatchPaths(item.source)).distinct();
38
+ const updatePathInfos = this._getUpdatePathInfos(projConf.localUpdates);
39
+ logger.debug("로컬 업데이트 구성", updatePathInfos);
49
40
 
50
41
  const watcher = SdFsWatcher.watch(updatePathInfos.map((item) => item.source));
51
42
  watcher.onChange({ delay: 500 }, (changedInfos) => {
52
- const changedFileInfos = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event));
43
+ const changedFileInfos = changedInfos.filter((item) => ["add", "change", "unlink"].includes(
44
+ item.event));
53
45
  if (changedFileInfos.length === 0) return;
54
46
 
55
47
  logger.log("로컬 라이브러리 변경감지...");
@@ -64,22 +56,19 @@ export class SdCliLocalUpdate {
64
56
  if (changedFileInfo.event === "unlink") {
65
57
  logger.debug(`변경파일감지(삭제): ${targetFilePath}`);
66
58
  FsUtils.remove(targetFilePath);
67
- } else {
59
+ }
60
+ else {
68
61
  logger.debug(`변경파일감지(복사): ${changedFileInfo.path} => ${targetFilePath}`);
69
62
  FsUtils.copy(changedFileInfo.path, targetFilePath);
70
63
  }
71
64
  }
72
65
  }
73
66
 
74
- // const watchFileSet = new Set(updatePathInfos.mapMany((item) => this.#getWatchPaths(item.source)));
75
- //
76
- // watcher.replaceWatchPaths(watchFileSet);
77
-
78
67
  logger.info("로컬 라이브러리 복사 완료");
79
68
  });
80
69
  }
81
70
 
82
- static #getUpdatePathInfos(record: Record<string, string>): IUpdatePathInfo[] {
71
+ private static _getUpdatePathInfos(record: Record<string, string>): IUpdatePathInfo[] {
83
72
  const result: IUpdatePathInfo[] = [];
84
73
  for (const pkgGlobPath of Object.keys(record)) {
85
74
  // "node_modules'에서 로컬업데이트 설정에 맞는 패키지를 "glob"하여 대상 패키지경로 목록 가져오기
@@ -109,10 +98,6 @@ export class SdCliLocalUpdate {
109
98
 
110
99
  return result;
111
100
  }
112
-
113
- /*static #getWatchPaths(sourcePath: string): string[] {
114
- return FsUtil.glob(path.resolve(sourcePath, "**"));
115
- }*/
116
101
  }
117
102
 
118
103
  interface IUpdatePathInfo {
@@ -1,36 +1,31 @@
1
1
  import path from "path";
2
2
  import { FsUtils, PathUtils, SdLogger, SdProcess } from "@simplysm/sd-core-node";
3
- import { pathToFileURL } from "url";
4
3
  import semver from "semver";
5
4
  import { NeverEntryError, StringUtils, Wait, XmlConvert } from "@simplysm/sd-core-common";
6
5
  import { SdStorage } from "@simplysm/sd-storage";
7
6
  import { SdCliLocalUpdate } from "./sd-cli-local-update";
8
7
  import { SdMultiBuildRunner } from "../pkg-builders/sd-multi.build-runner";
9
8
  import { SdCliConvertMessageUtils } from "../utils/sd-cli-convert-message.utils";
10
- import { ISdProjectConfig, TSdPackageConfig } from "../types/config.types";
9
+ import { TSdPackageConfig } from "../types/config.types";
11
10
  import { INpmConfig } from "../types/common-configs.types";
12
11
  import { ISdBuildMessage } from "../types/build.types";
12
+ import { loadProjConfAsync } from "./utils/loadProjConfAsync";
13
13
 
14
14
  export class SdCliProject {
15
15
  static async watchAsync(opt: {
16
- confFileRelPath: string;
17
- optNames: string[];
18
- pkgNames: string[];
19
- inspectNames: string[];
16
+ config?: string;
17
+ options?: string[];
18
+ packages?: string[];
19
+ inspects?: string[];
20
20
  }): Promise<void> {
21
21
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "watchAsync"]);
22
22
 
23
23
  logger.debug("프로젝트 설정 가져오기...");
24
- const projConf = (
25
- await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)
26
- ).default(true, opt.optNames) as ISdProjectConfig;
24
+ const projConf = await loadProjConfAsync(process.cwd(), true, opt);
27
25
 
28
26
  if (projConf.localUpdates) {
29
27
  logger.debug("로컬 라이브러리 업데이트 변경감지 시작...");
30
- await SdCliLocalUpdate.watchAsync({
31
- confFileRelPath: opt.confFileRelPath,
32
- optNames: opt.optNames,
33
- });
28
+ await SdCliLocalUpdate.watchAsync(opt);
34
29
  }
35
30
 
36
31
  logger.debug("프로젝트 package.json 가져오기...");
@@ -45,8 +40,8 @@ export class SdCliProject {
45
40
  .filter((item) => !item.includes("."))
46
41
  .map((item) => PathUtils.norm(item));
47
42
  let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
48
- if (opt.pkgNames.length !== 0) {
49
- pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
43
+ if (opt.packages) {
44
+ pkgPaths = pkgPaths.filter((pkgPath) => opt.packages!.includes(path.basename(pkgPath)));
50
45
  }
51
46
 
52
47
  logger.debug("패키지 존재 확인...");
@@ -76,20 +71,14 @@ export class SdCliProject {
76
71
  }
77
72
 
78
73
  static async buildAsync(opt: {
79
- confFileRelPath: string;
80
- optNames: string[];
81
- pkgNames: string[]
74
+ config?: string;
75
+ options?: string[];
76
+ packages?: string[];
82
77
  }): Promise<void> {
83
78
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "buildAsync"]);
84
79
 
85
80
  logger.debug("프로젝트 설정 가져오기...");
86
- const projConf = (await import(pathToFileURL(path.resolve(
87
- process.cwd(),
88
- opt.confFileRelPath,
89
- )).href)).default(
90
- false,
91
- opt.optNames,
92
- ) as ISdProjectConfig;
81
+ const projConf = await loadProjConfAsync(process.cwd(), false, opt);
93
82
 
94
83
  logger.debug("프로젝트 package.json 가져오기...");
95
84
  const projNpmConf = FsUtils.readJson(path.resolve(process.cwd(), "package.json")) as INpmConfig;
@@ -101,8 +90,8 @@ export class SdCliProject {
101
90
  const allPkgPaths = projNpmConf.workspaces.mapMany((item) => FsUtils.glob(item))
102
91
  .map((item) => PathUtils.norm(item));
103
92
  let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
104
- if (opt.pkgNames.length !== 0) {
105
- pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
93
+ if (opt.packages) {
94
+ pkgPaths = pkgPaths.filter((pkgPath) => opt.packages!.includes(path.basename(pkgPath)));
106
95
  }
107
96
 
108
97
  logger.debug("프로젝트 및 패키지 버전 설정...");
@@ -121,22 +110,16 @@ export class SdCliProject {
121
110
  this.#logging(messages.mapMany(), logger);
122
111
  }
123
112
 
124
- public static async publishAsync(opt: {
125
- noBuild: boolean;
126
- confFileRelPath: string;
127
- optNames: string[];
128
- pkgNames: string[];
113
+ static async publishAsync(opt: {
114
+ config: string;
115
+ options?: string[];
116
+ packages?: string[];
117
+ noBuild?: boolean;
129
118
  }): Promise<void> {
130
119
  const logger = SdLogger.get(["simplysm", "sd-cli", "SdCliProject", "publishAsync"]);
131
120
 
132
121
  logger.debug("프로젝트 설정 가져오기...");
133
- const projConf = (await import(pathToFileURL(path.resolve(
134
- process.cwd(),
135
- opt.confFileRelPath,
136
- )).href)).default(
137
- false,
138
- opt.optNames,
139
- ) as ISdProjectConfig;
122
+ const projConf = await loadProjConfAsync(process.cwd(), false, opt);
140
123
 
141
124
  logger.debug("프로젝트 package.json 가져오기...");
142
125
  const projNpmConf = FsUtils.readJson(path.resolve(process.cwd(), "package.json")) as INpmConfig;
@@ -165,8 +148,8 @@ export class SdCliProject {
165
148
  .filter((item) => !item.includes("."))
166
149
  .map((item) => PathUtils.norm(item));
167
150
  let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
168
- if (opt.pkgNames.length !== 0) {
169
- pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
151
+ if (opt.packages) {
152
+ pkgPaths = pkgPaths.filter((pkgPath) => opt.packages!.includes(path.basename(pkgPath)));
170
153
  }
171
154
 
172
155
  if (!opt.noBuild) {
@@ -0,0 +1,12 @@
1
+ import { pathToFileURL } from "url";
2
+ import path from "path";
3
+ import { ISdProjectConfig } from "../../types/config.types";
4
+
5
+ export async function loadProjConfAsync(rootPath: string, dev: boolean, opt: {
6
+ config?: string;
7
+ options?: string[];
8
+ }) {
9
+ const filePath = path.resolve(rootPath, opt.config ?? "simplysm.js");
10
+ const imported = await import(pathToFileURL(filePath).href);
11
+ return imported.default(dev, opt.options ?? []) as ISdProjectConfig;
12
+ }
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from "events";
2
- import { FsUtils, SdLogger, PathUtils, SdFsWatcher, TNormPath } from "@simplysm/sd-core-node";
2
+ import { FsUtils, PathUtils, SdFsWatcher, SdLogger, TNormPath } from "@simplysm/sd-core-node";
3
3
  import path from "path";
4
4
  import { SdNgBundler } from "./sd-ng.bundler";
5
5
  import { SdCliNgRoutesFileGenerator } from "./sd-cli-ng-routes.file-generator";
@@ -17,7 +17,7 @@ export class SdClientBuildRunner extends EventEmitter {
17
17
  private _cordova?: SdCliCordova;
18
18
  private _watchScopePathSet: Set<TNormPath>;
19
19
 
20
- public constructor(
20
+ constructor(
21
21
  private _projConf: ISdProjectConfig,
22
22
  private _pkgPath: TNormPath,
23
23
  ) {
@@ -36,14 +36,14 @@ export class SdClientBuildRunner extends EventEmitter {
36
36
  );
37
37
  }
38
38
 
39
- public override on(event: "change", listener: () => void): this;
40
- public override on(event: "complete", listener: (result: ISdBuildRunnerResult) => void): this;
41
- public override on(event: string | symbol, listener: (...args: any[]) => void): this {
39
+ override on(event: "change", listener: () => void): this;
40
+ override on(event: "complete", listener: (result: ISdBuildRunnerResult) => void): this;
41
+ override on(event: string | symbol, listener: (...args: any[]) => void): this {
42
42
  super.on(event, listener);
43
43
  return this;
44
44
  }
45
45
 
46
- public async buildAsync(): Promise<ISdBuildRunnerResult> {
46
+ async buildAsync(): Promise<ISdBuildRunnerResult> {
47
47
  this._debug("dist 초기화...");
48
48
  FsUtils.remove(path.resolve(this._pkgPath, "dist"));
49
49
 
@@ -65,7 +65,7 @@ export class SdClientBuildRunner extends EventEmitter {
65
65
  };
66
66
  }
67
67
 
68
- public async watchAsync() {
68
+ async watchAsync() {
69
69
  this.emit("change");
70
70
 
71
71
  this._debug("dist 초기화...");