@simplysm/sd-cli 7.0.249 → 7.0.267

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 (138) hide show
  1. package/README.md +95 -0
  2. package/assets/client-files/assets/icons/icon-128x128.png +0 -0
  3. package/assets/client-files/assets/icons/icon-144x144.png +0 -0
  4. package/assets/client-files/assets/icons/icon-152x152.png +0 -0
  5. package/assets/client-files/assets/icons/icon-192x192.png +0 -0
  6. package/assets/client-files/assets/icons/icon-384x384.png +0 -0
  7. package/assets/client-files/assets/icons/icon-512x512.png +0 -0
  8. package/assets/client-files/assets/icons/icon-72x72.png +0 -0
  9. package/assets/client-files/assets/icons/icon-96x96.png +0 -0
  10. package/assets/client-files/favicon.ico +0 -0
  11. package/dist/bin/sd-cli.mjs +212 -15
  12. package/dist/build-tool/SdCliCordova.mjs +3 -3
  13. package/dist/build-tool/SdCliElectron.mjs +3 -2
  14. package/dist/build-tool/SdCliIndexFileGenerator.mjs +2 -3
  15. package/dist/builder/SdCliClientBuilder.d.ts +2 -0
  16. package/dist/builder/SdCliClientBuilder.mjs +57 -20
  17. package/dist/builder/SdCliServerBuilder.d.ts +2 -0
  18. package/dist/builder/SdCliServerBuilder.mjs +27 -13
  19. package/dist/builder/SdCliTsLibBuilder.mjs +18 -12
  20. package/dist/commons.d.ts +6 -1
  21. package/dist/entry-points/SdCliPrepare.mjs +34 -34
  22. package/dist/entry-points/SdCliProjectGenerator.d.ts +44 -0
  23. package/dist/entry-points/SdCliProjectGenerator.mjs +320 -0
  24. package/dist/entry-points/SdCliWorkspace.d.ts +6 -6
  25. package/dist/entry-points/SdCliWorkspace.mjs +61 -107
  26. package/dist/entry-points/file/base/fc_package_eslintrc.d.ts +3 -0
  27. package/dist/entry-points/file/base/fc_package_eslintrc.mjs +31 -0
  28. package/dist/entry-points/file/base/fc_package_npmconfig.d.ts +9 -0
  29. package/dist/entry-points/file/base/fc_package_npmconfig.mjs +32 -0
  30. package/dist/entry-points/file/base/fc_package_tsconfig.d.ts +5 -0
  31. package/dist/entry-points/file/base/fc_package_tsconfig.mjs +13 -0
  32. package/dist/entry-points/file/client/fc_package_AppModule.d.ts +1 -0
  33. package/dist/entry-points/file/client/fc_package_AppModule.mjs +37 -0
  34. package/dist/entry-points/file/client/fc_package_AppPage.d.ts +1 -0
  35. package/dist/entry-points/file/client/fc_package_AppPage.mjs +14 -0
  36. package/dist/entry-points/file/client/fc_package_Page.d.ts +4 -0
  37. package/dist/entry-points/file/client/fc_package_Page.mjs +19 -0
  38. package/dist/entry-points/file/client/fc_package_client_main.d.ts +1 -0
  39. package/dist/entry-points/file/client/fc_package_client_main.mjs +19 -0
  40. package/dist/entry-points/file/client/fc_package_index.d.ts +3 -0
  41. package/dist/entry-points/file/client/fc_package_index.mjs +88 -0
  42. package/dist/entry-points/file/client/fc_package_manifest.d.ts +5 -0
  43. package/dist/entry-points/file/client/fc_package_manifest.mjs +54 -0
  44. package/dist/entry-points/file/client/fc_package_polyfills.d.ts +1 -0
  45. package/dist/entry-points/file/client/fc_package_polyfills.mjs +11 -0
  46. package/dist/entry-points/file/client/fc_package_styles.d.ts +1 -0
  47. package/dist/entry-points/file/client/fc_package_styles.mjs +7 -0
  48. package/dist/entry-points/file/db/fc_package_DbContext.d.ts +3 -0
  49. package/dist/entry-points/file/db/fc_package_DbContext.mjs +14 -0
  50. package/dist/entry-points/file/db/fc_package_DbModel.d.ts +4 -0
  51. package/dist/entry-points/file/db/fc_package_DbModel.mjs +12 -0
  52. package/dist/entry-points/file/project/fc_project_editor_config.d.ts +1 -0
  53. package/dist/entry-points/file/project/fc_project_editor_config.mjs +22 -0
  54. package/dist/entry-points/file/project/fc_project_eslintrc.d.ts +1 -0
  55. package/dist/entry-points/file/project/fc_project_eslintrc.mjs +30 -0
  56. package/dist/entry-points/file/project/fc_project_gitattributes.d.ts +1 -0
  57. package/dist/entry-points/file/project/fc_project_gitattributes.mjs +6 -0
  58. package/dist/entry-points/file/project/fc_project_gitignore.d.ts +1 -0
  59. package/dist/entry-points/file/project/fc_project_gitignore.mjs +17 -0
  60. package/dist/entry-points/file/project/fc_project_npmconfig.d.ts +7 -0
  61. package/dist/entry-points/file/project/fc_project_npmconfig.mjs +35 -0
  62. package/dist/entry-points/file/project/fc_project_readme.d.ts +3 -0
  63. package/dist/entry-points/file/project/fc_project_readme.mjs +13 -0
  64. package/dist/entry-points/file/project/fc_project_simplysm.d.ts +1 -0
  65. package/dist/entry-points/file/project/fc_project_simplysm.mjs +2 -0
  66. package/dist/entry-points/file/project/fc_project_tsconfig.d.ts +1 -0
  67. package/dist/entry-points/file/project/fc_project_tsconfig.mjs +25 -0
  68. package/dist/entry-points/file/server/fc_package_server_main.d.ts +4 -0
  69. package/dist/entry-points/file/server/fc_package_server_main.mjs +60 -0
  70. package/dist/index.d.ts +23 -0
  71. package/dist/index.mjs +24 -1
  72. package/dist/ng-tools/SdCliNgModuleGenerator.mjs +35 -36
  73. package/dist/packages/SdCliPackage.d.ts +1 -0
  74. package/dist/packages/SdCliPackage.mjs +69 -63
  75. package/dist/utils/SdCliBuildResultUtil.mjs +2 -2
  76. package/docs/client-add-page.md +8 -0
  77. package/docs/client-router.md +85 -0
  78. package/docs/client-sw.md +101 -0
  79. package/docs/conf-orm.md +81 -0
  80. package/docs/conf-usage.md +5 -0
  81. package/docs/lib-local-update.md +50 -0
  82. package/docs/lib-ts-paths.md +25 -0
  83. package/package.json +10 -8
  84. package/src/SdCliBuildResultError.ts +9 -9
  85. package/src/bin/sd-cli.ts +244 -15
  86. package/src/build-tool/SdCliCacheCompilerHost.ts +77 -77
  87. package/src/build-tool/SdCliCordova.ts +2 -2
  88. package/src/build-tool/SdCliElectron.ts +2 -1
  89. package/src/build-tool/SdCliGithubApi.ts +110 -110
  90. package/src/build-tool/SdCliIndexFileGenerator.ts +79 -80
  91. package/src/build-tool/SdCliNgCacheCompilerHost.ts +58 -58
  92. package/src/build-tool/SdCliPackageLinter.ts +74 -74
  93. package/src/builder/SdCliClientBuilder.ts +73 -22
  94. package/src/builder/SdCliJsLibBuilder.ts +70 -70
  95. package/src/builder/SdCliServerBuilder.ts +34 -14
  96. package/src/builder/SdCliTsLibBuilder.ts +450 -445
  97. package/src/commons.ts +6 -1
  98. package/src/entry-points/SdCliFileCrypto.ts +87 -87
  99. package/src/entry-points/SdCliPrepare.ts +55 -55
  100. package/src/entry-points/SdCliProjectGenerator.ts +395 -0
  101. package/src/entry-points/SdCliWorkspace.ts +74 -122
  102. package/src/entry-points/file/base/fc_package_eslintrc.ts +30 -0
  103. package/src/entry-points/file/base/fc_package_npmconfig.ts +43 -0
  104. package/src/entry-points/file/base/fc_package_tsconfig.ts +12 -0
  105. package/src/entry-points/file/client/fc_package_AppModule.ts +36 -0
  106. package/src/entry-points/file/client/fc_package_AppPage.ts +13 -0
  107. package/src/entry-points/file/client/fc_package_Page.ts +19 -0
  108. package/src/entry-points/file/client/fc_package_client_main.ts +18 -0
  109. package/src/entry-points/file/client/fc_package_index.ts +87 -0
  110. package/src/entry-points/file/client/fc_package_manifest.ts +53 -0
  111. package/src/entry-points/file/client/fc_package_polyfills.ts +10 -0
  112. package/src/entry-points/file/client/fc_package_styles.ts +6 -0
  113. package/src/entry-points/file/db/fc_package_DbContext.ts +14 -0
  114. package/src/entry-points/file/db/fc_package_DbModel.ts +11 -0
  115. package/src/entry-points/file/project/fc_project_editor_config.ts +21 -0
  116. package/src/entry-points/file/project/fc_project_eslintrc.ts +29 -0
  117. package/src/entry-points/file/project/fc_project_gitattributes.ts +5 -0
  118. package/src/entry-points/file/project/fc_project_gitignore.ts +16 -0
  119. package/src/entry-points/file/project/fc_project_npmconfig.ts +34 -0
  120. package/src/entry-points/file/project/fc_project_readme.ts +12 -0
  121. package/src/entry-points/file/project/fc_project_simplysm.ts +1 -0
  122. package/src/entry-points/file/project/fc_project_tsconfig.ts +24 -0
  123. package/src/entry-points/file/server/fc_package_server_main.ts +62 -0
  124. package/src/index.ts +55 -32
  125. package/src/ng-tools/SdCliNgModuleGenerator.ts +639 -640
  126. package/src/ng-tools/babel/SdCliBbFileMetadata.ts +568 -568
  127. package/src/ng-tools/babel/SdCliBbRootMetadata.ts +239 -239
  128. package/src/ng-tools/babel/SdCliBbUtil.ts +15 -15
  129. package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +234 -234
  130. package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +177 -177
  131. package/src/ng-tools/commons.ts +3 -3
  132. package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +384 -384
  133. package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +32 -32
  134. package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -29
  135. package/src/packages/SdCliPackage.ts +76 -59
  136. package/src/utils/SdCliBuildResultUtil.ts +76 -76
  137. package/src/utils/SdCliConfigUtil.ts +94 -94
  138. package/src/utils/SdCliNpmConfigUtil.ts +16 -16
@@ -24,6 +24,8 @@ export class SdCliServerBuilder extends EventEmitter {
24
24
  private readonly _parsedTsconfig: ts.ParsedCommandLine;
25
25
  private readonly _npmConfigMap = new Map<string, INpmConfig>();
26
26
 
27
+ private readonly _cacheBasePath = path.resolve(this._rootPath, ".cache");
28
+
27
29
  public constructor(private readonly _rootPath: string,
28
30
  private readonly _config: ISdCliServerPackageConfig,
29
31
  private readonly _workspaceRootPath: string) {
@@ -41,10 +43,38 @@ export class SdCliServerBuilder extends EventEmitter {
41
43
  return super.on(event, listener);
42
44
  }
43
45
 
46
+ private async _checkCacheAsync(watch: boolean): Promise<void> {
47
+ const workspacePkgLockContent = await FsUtil.readFileAsync(path.resolve(this._workspaceRootPath, "package-lock.json"));
48
+
49
+ // const cachePath = path.resolve(cacheBasePath, pkgVersion);
50
+
51
+ const versionHash = createHash("sha1")
52
+ .update(workspacePkgLockContent)
53
+ .update(JSON.stringify(this._parsedTsconfig.options))
54
+ .update(JSON.stringify(this._config))
55
+ .update(watch.toString())
56
+ .digest("hex");
57
+ if (
58
+ !FsUtil.exists(path.resolve(this._cacheBasePath, "version")) // 버전파일이 없거나
59
+ || (
60
+ FsUtil.exists(path.resolve(this._cacheBasePath, "version")) &&
61
+ await FsUtil.readFileAsync(path.resolve(this._cacheBasePath, "version")) !== versionHash
62
+ ) // 버전이 현재 버전과 다르면
63
+ ) {
64
+ // 캐시 삭제
65
+ await FsUtil.removeAsync(path.resolve(this._cacheBasePath));
66
+ }
67
+ // 버전쓰기
68
+ await FsUtil.writeFileAsync(path.resolve(this._cacheBasePath, "version"), versionHash);
69
+ }
70
+
44
71
  public async watchAsync(): Promise<void> {
45
72
  // DIST 비우기
46
73
  await FsUtil.removeAsync(this._parsedTsconfig.options.outDir!);
47
74
 
75
+ // 캐시체크
76
+ await this._checkCacheAsync(true);
77
+
48
78
  // 빌드 준비
49
79
  const extModules = this._getExternalModules();
50
80
  const webpackConfig = this._getWebpackConfig(true, extModules);
@@ -233,11 +263,6 @@ export class SdCliServerBuilder extends EventEmitter {
233
263
  const pkgKey = npmConfig.name.split("/").last()!;
234
264
  // const pkgVersion = npmConfig.version;
235
265
 
236
- const workspacePkgLockContent = FsUtil.readFile(path.resolve(this._workspaceRootPath, "package-lock.json"));
237
-
238
- const cacheBasePath = path.resolve(this._rootPath, ".cache");
239
- // const cachePath = path.resolve(cacheBasePath, pkgVersion);
240
-
241
266
  let prevProgressMessage = "";
242
267
  return {
243
268
  mode: watch ? "development" : "production",
@@ -291,14 +316,9 @@ export class SdCliServerBuilder extends EventEmitter {
291
316
  cache: {
292
317
  type: "filesystem",
293
318
  profile: watch ? undefined : false,
294
- cacheDirectory: path.resolve(cacheBasePath, "server-webpack"),
319
+ cacheDirectory: this._cacheBasePath,
295
320
  maxMemoryGenerations: 1,
296
- name: createHash("sha1")
297
- .update(workspacePkgLockContent)
298
- .update(JSON.stringify(this._parsedTsconfig.options))
299
- .update(JSON.stringify(this._config))
300
- .update(watch.toString())
301
- .digest("hex")
321
+ name: "webpack"
302
322
  },
303
323
  snapshot: {
304
324
  immutablePaths: internalModuleCachePaths,
@@ -474,7 +494,7 @@ export class SdCliServerBuilder extends EventEmitter {
474
494
  continue;
475
495
  }
476
496
 
477
- if (FsUtil.exists(path.resolve(modulePath, "binding.gyp"))) {
497
+ if (FsUtil.glob(path.resolve(modulePath, "**/binding.gyp")).length > 0) {
478
498
  results.push({ name: moduleName, exists: true });
479
499
  }
480
500
 
@@ -495,7 +515,7 @@ export class SdCliServerBuilder extends EventEmitter {
495
515
  continue;
496
516
  }
497
517
 
498
- if (FsUtil.exists(path.resolve(optModulePath, "binding.gyp"))) {
518
+ if (FsUtil.glob(path.resolve(optModulePath, "**/binding.gyp")).length > 0) {
499
519
  results.push({ name: optModuleName, exists: true });
500
520
  }
501
521