@simplysm/sd-cli 11.0.40 → 11.1.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 (51) hide show
  1. package/dist/build-cluster.d.ts +1 -1
  2. package/dist/build-cluster.js +181 -181
  3. package/dist/build-tools/SdCliCordova.d.ts +21 -21
  4. package/dist/build-tools/SdCliCordova.js +217 -217
  5. package/dist/build-tools/SdCliIndexFileGenerator.d.ts +5 -5
  6. package/dist/build-tools/SdCliIndexFileGenerator.js +50 -50
  7. package/dist/build-tools/SdCliNgRoutesFileGenerator.d.ts +4 -4
  8. package/dist/build-tools/SdCliNgRoutesFileGenerator.js +57 -57
  9. package/dist/build-tools/SdLinter.d.ts +5 -5
  10. package/dist/build-tools/SdLinter.js +54 -54
  11. package/dist/build-tools/SdNgBundler.d.ts +35 -35
  12. package/dist/build-tools/SdNgBundler.js +545 -533
  13. package/dist/build-tools/SdNgBundler.js.map +1 -1
  14. package/dist/build-tools/SdNgBundlerContext.d.ts +16 -16
  15. package/dist/build-tools/SdNgBundlerContext.js +97 -97
  16. package/dist/build-tools/SdTsBundler.d.ts +15 -15
  17. package/dist/build-tools/SdTsBundler.js +87 -87
  18. package/dist/build-tools/SdTsCompiler.d.ts +29 -29
  19. package/dist/build-tools/SdTsCompiler.js +227 -227
  20. package/dist/builders/SdCliClientBuilder.d.ts +18 -18
  21. package/dist/builders/SdCliClientBuilder.js +129 -129
  22. package/dist/builders/SdCliJsLibLinter.d.ts +14 -14
  23. package/dist/builders/SdCliJsLibLinter.js +59 -59
  24. package/dist/builders/SdCliServerBuilder.d.ts +20 -20
  25. package/dist/builders/SdCliServerBuilder.js +215 -215
  26. package/dist/builders/SdCliTsLibBuilder.d.ts +17 -17
  27. package/dist/builders/SdCliTsLibBuilder.js +79 -79
  28. package/dist/commons.d.ts +132 -132
  29. package/dist/commons.js +1 -1
  30. package/dist/entry/SdCliElectron.d.ts +12 -12
  31. package/dist/entry/SdCliElectron.js +99 -99
  32. package/dist/entry/SdCliLocalUpdate.d.ts +12 -12
  33. package/dist/entry/SdCliLocalUpdate.js +90 -90
  34. package/dist/entry/SdCliProject.d.ts +26 -26
  35. package/dist/entry/SdCliProject.js +477 -477
  36. package/dist/index.d.ts +19 -19
  37. package/dist/index.js +19 -19
  38. package/dist/sd-cli.d.ts +2 -2
  39. package/dist/sd-cli.js +210 -210
  40. package/dist/server-worker.d.ts +1 -1
  41. package/dist/server-worker.js +38 -38
  42. package/dist/utils/SdCliBuildResultUtil.d.ts +6 -6
  43. package/dist/utils/SdCliBuildResultUtil.js +37 -37
  44. package/dist/utils/SdMemoryLoadResultCache.d.ts +9 -9
  45. package/dist/utils/SdMemoryLoadResultCache.js +34 -34
  46. package/dist/utils/SdSourceFileCache.d.ts +6 -6
  47. package/dist/utils/SdSourceFileCache.js +14 -14
  48. package/dist/utils/SdSourceFileCache.js.map +1 -1
  49. package/package.json +18 -18
  50. package/src/build-tools/SdNgBundler.ts +21 -12
  51. package/src/utils/SdSourceFileCache.ts +1 -1
@@ -1,91 +1,91 @@
1
- import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core-node";
2
- import path from "path";
3
- import { pathToFileURL } from "url";
4
- export class SdCliLocalUpdate {
5
- static async runAsync(opt) {
6
- const logger = Logger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "runAsync"]);
7
- logger.debug("프로젝트 설정 가져오기...");
8
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(true, opt.optNames);
9
- if (!projConf.localUpdates)
10
- return;
11
- const updatePathInfos = await this._getUpdatePathInfosAsync(projConf.localUpdates);
12
- logger.debug("로컬 업데이트 구성", updatePathInfos);
13
- logger.log("로컬 라이브러리 업데이트 시작...");
14
- for (const updatePathInfo of updatePathInfos) {
15
- if (!FsUtil.exists(updatePathInfo.source)) {
16
- logger.warn(`소스경로를 찾을 수 없어 무시됩니다(${updatePathInfo.source})`);
17
- return;
18
- }
19
- // 소스경로에서 대상경로로 파일 복사
20
- await FsUtil.copyAsync(updatePathInfo.source, updatePathInfo.target, (src) => {
21
- return !src.includes("node_modules") && !src.endsWith("package.json");
22
- });
23
- }
24
- logger.info("로컬 라이브러리 업데이트 완료");
25
- }
26
- static async watchAsync(opt) {
27
- const logger = Logger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "watchAsync"]);
28
- logger.debug("프로젝트 설정 가져오기...");
29
- const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(true, opt.optNames);
30
- if (!projConf.localUpdates)
31
- return;
32
- const updatePathInfos = await this._getUpdatePathInfosAsync(projConf.localUpdates);
33
- logger.debug("로컬 업데이트 구성");
34
- const watchPaths = (await updatePathInfos.mapManyAsync(async (item) => await this._getWatchPathsAsync(item.source))).distinct();
35
- const watcher = SdFsWatcher.watch(watchPaths);
36
- watcher.onChange({ delay: 1000 }, async (changedInfos) => {
37
- const changeFilePaths = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event)).map((item) => item.path);
38
- if (changeFilePaths.length === 0)
39
- return;
40
- logger.log("로컬 라이브러리 변경감지...");
41
- for (const changedFilePath of changeFilePaths) {
42
- if (!FsUtil.exists(changedFilePath))
43
- continue;
44
- for (const updatePathInfo of updatePathInfos) {
45
- if (!PathUtil.isChildPath(changedFilePath, updatePathInfo.source))
46
- continue;
47
- const sourceRelPath = path.relative(updatePathInfo.source, changedFilePath);
48
- // if (sourceRelPath.includes("node_modules")) continue;
49
- // if (sourceRelPath.includes("package.json")) continue;
50
- const targetFilePath = path.resolve(updatePathInfo.target, sourceRelPath);
51
- logger.debug(`변경파일감지(복사): ${changedFilePath} => ${targetFilePath}`);
52
- await FsUtil.copyAsync(changedFilePath, targetFilePath);
53
- }
54
- }
55
- const watchWatchPaths = (await updatePathInfos.mapManyAsync(async (item) => await this._getWatchPathsAsync(item.source))).distinct();
56
- watcher.add(watchWatchPaths);
57
- logger.info("로컬 라이브러리 복사 완료");
58
- });
59
- }
60
- static async _getUpdatePathInfosAsync(record) {
61
- const result = [];
62
- for (const pkgGlobPath of Object.keys(record)) {
63
- // "node_modules'에서 로컬업데이트 설정에 맞는 패키지를 "glob"하여 대상 패키지경로 목록 가져오기
64
- const targetPaths = [
65
- ...await FsUtil.globAsync(path.resolve(process.cwd(), "node_modules", pkgGlobPath)),
66
- ...await FsUtil.globAsync(path.resolve(process.cwd(), "packages", "*", "node_modules", pkgGlobPath))
67
- ];
68
- result.push(...targetPaths
69
- .map((targetPath) => {
70
- // 대상의 명칭 추출
71
- const regexpText = pkgGlobPath.replace(/[\\/.*]/g, (item) => (item === "/" ? "[\\\\\\/]"
72
- : item === "." ? "\\."
73
- : item === "*" ? "(.*)"
74
- : item));
75
- const targetNameMatch = new RegExp(regexpText).exec(targetPath);
76
- if (!targetNameMatch || typeof targetNameMatch[1] === "undefined")
77
- return undefined;
78
- const targetName = targetNameMatch[1];
79
- // 가져올 소스 경로 추출
80
- const sourcePath = path.resolve(record[pkgGlobPath].replace(/\*/g, targetName));
81
- return { source: sourcePath, target: targetPath };
82
- })
83
- .filterExists());
84
- }
85
- return result;
86
- }
87
- static async _getWatchPathsAsync(sourcePath) {
88
- return await FsUtil.globAsync(path.resolve(sourcePath, "**"));
89
- }
90
- }
1
+ import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core-node";
2
+ import path from "path";
3
+ import { pathToFileURL } from "url";
4
+ export class SdCliLocalUpdate {
5
+ static async runAsync(opt) {
6
+ const logger = Logger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "runAsync"]);
7
+ logger.debug("프로젝트 설정 가져오기...");
8
+ const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(true, opt.optNames);
9
+ if (!projConf.localUpdates)
10
+ return;
11
+ const updatePathInfos = await this._getUpdatePathInfosAsync(projConf.localUpdates);
12
+ logger.debug("로컬 업데이트 구성", updatePathInfos);
13
+ logger.log("로컬 라이브러리 업데이트 시작...");
14
+ for (const updatePathInfo of updatePathInfos) {
15
+ if (!FsUtil.exists(updatePathInfo.source)) {
16
+ logger.warn(`소스경로를 찾을 수 없어 무시됩니다(${updatePathInfo.source})`);
17
+ return;
18
+ }
19
+ // 소스경로에서 대상경로로 파일 복사
20
+ await FsUtil.copyAsync(updatePathInfo.source, updatePathInfo.target, (src) => {
21
+ return !src.includes("node_modules") && !src.endsWith("package.json");
22
+ });
23
+ }
24
+ logger.info("로컬 라이브러리 업데이트 완료");
25
+ }
26
+ static async watchAsync(opt) {
27
+ const logger = Logger.get(["simplysm", "sd-cli", "SdCliLocalUpdate", "watchAsync"]);
28
+ logger.debug("프로젝트 설정 가져오기...");
29
+ const projConf = (await import(pathToFileURL(path.resolve(process.cwd(), opt.confFileRelPath)).href)).default(true, opt.optNames);
30
+ if (!projConf.localUpdates)
31
+ return;
32
+ const updatePathInfos = await this._getUpdatePathInfosAsync(projConf.localUpdates);
33
+ logger.debug("로컬 업데이트 구성");
34
+ const watchPaths = (await updatePathInfos.mapManyAsync(async (item) => await this._getWatchPathsAsync(item.source))).distinct();
35
+ const watcher = SdFsWatcher.watch(watchPaths);
36
+ watcher.onChange({ delay: 1000 }, async (changedInfos) => {
37
+ const changeFilePaths = changedInfos.filter((item) => ["add", "change", "unlink"].includes(item.event)).map((item) => item.path);
38
+ if (changeFilePaths.length === 0)
39
+ return;
40
+ logger.log("로컬 라이브러리 변경감지...");
41
+ for (const changedFilePath of changeFilePaths) {
42
+ if (!FsUtil.exists(changedFilePath))
43
+ continue;
44
+ for (const updatePathInfo of updatePathInfos) {
45
+ if (!PathUtil.isChildPath(changedFilePath, updatePathInfo.source))
46
+ continue;
47
+ const sourceRelPath = path.relative(updatePathInfo.source, changedFilePath);
48
+ // if (sourceRelPath.includes("node_modules")) continue;
49
+ // if (sourceRelPath.includes("package.json")) continue;
50
+ const targetFilePath = path.resolve(updatePathInfo.target, sourceRelPath);
51
+ logger.debug(`변경파일감지(복사): ${changedFilePath} => ${targetFilePath}`);
52
+ await FsUtil.copyAsync(changedFilePath, targetFilePath);
53
+ }
54
+ }
55
+ const watchWatchPaths = (await updatePathInfos.mapManyAsync(async (item) => await this._getWatchPathsAsync(item.source))).distinct();
56
+ watcher.add(watchWatchPaths);
57
+ logger.info("로컬 라이브러리 복사 완료");
58
+ });
59
+ }
60
+ static async _getUpdatePathInfosAsync(record) {
61
+ const result = [];
62
+ for (const pkgGlobPath of Object.keys(record)) {
63
+ // "node_modules'에서 로컬업데이트 설정에 맞는 패키지를 "glob"하여 대상 패키지경로 목록 가져오기
64
+ const targetPaths = [
65
+ ...await FsUtil.globAsync(path.resolve(process.cwd(), "node_modules", pkgGlobPath)),
66
+ ...await FsUtil.globAsync(path.resolve(process.cwd(), "packages", "*", "node_modules", pkgGlobPath))
67
+ ];
68
+ result.push(...targetPaths
69
+ .map((targetPath) => {
70
+ // 대상의 명칭 추출
71
+ const regexpText = pkgGlobPath.replace(/[\\/.*]/g, (item) => (item === "/" ? "[\\\\\\/]"
72
+ : item === "." ? "\\."
73
+ : item === "*" ? "(.*)"
74
+ : item));
75
+ const targetNameMatch = new RegExp(regexpText).exec(targetPath);
76
+ if (!targetNameMatch || typeof targetNameMatch[1] === "undefined")
77
+ return undefined;
78
+ const targetName = targetNameMatch[1];
79
+ // 가져올 소스 경로 추출
80
+ const sourcePath = path.resolve(record[pkgGlobPath].replace(/\*/g, targetName));
81
+ return { source: sourcePath, target: targetPath };
82
+ })
83
+ .filterExists());
84
+ }
85
+ return result;
86
+ }
87
+ static async _getWatchPathsAsync(sourcePath) {
88
+ return await FsUtil.globAsync(path.resolve(sourcePath, "**"));
89
+ }
90
+ }
91
91
  //# sourceMappingURL=SdCliLocalUpdate.js.map
@@ -1,26 +1,26 @@
1
- export declare class SdCliProject {
2
- static watchAsync(opt: {
3
- confFileRelPath: string;
4
- optNames: string[];
5
- pkgNames: string[];
6
- }): Promise<void>;
7
- static buildAsync(opt: {
8
- confFileRelPath: string;
9
- optNames: string[];
10
- pkgNames: string[];
11
- }): Promise<void>;
12
- static publishAsync(opt: {
13
- noBuild: boolean;
14
- confFileRelPath: string;
15
- optNames: string[];
16
- pkgNames: string[];
17
- }): Promise<void>;
18
- private static _publishPkgAsync;
19
- private static _waitSecMessageAsync;
20
- private static _upgradeVersionAsync;
21
- private static _logging;
22
- private static _prepareClusterAsync;
23
- private static _runCommandAsync;
24
- private static _closeCluster;
25
- private static _restartServerAsync;
26
- }
1
+ export declare class SdCliProject {
2
+ static watchAsync(opt: {
3
+ confFileRelPath: string;
4
+ optNames: string[];
5
+ pkgNames: string[];
6
+ }): Promise<void>;
7
+ static buildAsync(opt: {
8
+ confFileRelPath: string;
9
+ optNames: string[];
10
+ pkgNames: string[];
11
+ }): Promise<void>;
12
+ static publishAsync(opt: {
13
+ noBuild: boolean;
14
+ confFileRelPath: string;
15
+ optNames: string[];
16
+ pkgNames: string[];
17
+ }): Promise<void>;
18
+ private static _publishPkgAsync;
19
+ private static _waitSecMessageAsync;
20
+ private static _upgradeVersionAsync;
21
+ private static _logging;
22
+ private static _prepareClusterAsync;
23
+ private static _runCommandAsync;
24
+ private static _closeCluster;
25
+ private static _restartServerAsync;
26
+ }