@simplysm/sd-cli 7.3.4 → 10.0.21

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 (468) hide show
  1. package/.eslintrc.cjs +18 -0
  2. package/dist/SdLinter.d.ts +5 -0
  3. package/dist/SdLinter.js.map +1 -0
  4. package/dist/SdLinter.mjs +37 -0
  5. package/dist/SdTsIncrementalBuilder.d.ts +16 -0
  6. package/dist/SdTsIncrementalBuilder.js.map +1 -0
  7. package/dist/SdTsIncrementalBuilder.mjs +54 -0
  8. package/dist/build-cluster.js.map +1 -0
  9. package/dist/build-cluster.mjs +124 -0
  10. package/dist/builders/SdCliClientBuilder.d.ts +13 -0
  11. package/dist/builders/SdCliClientBuilder.js.map +1 -0
  12. package/dist/builders/SdCliClientBuilder.mjs +167 -0
  13. package/dist/builders/SdCliJsLibLinter.d.ts +14 -0
  14. package/dist/builders/SdCliJsLibLinter.js.map +1 -0
  15. package/dist/builders/SdCliJsLibLinter.mjs +60 -0
  16. package/dist/builders/SdCliServerBuilder.d.ts +14 -0
  17. package/dist/builders/SdCliServerBuilder.js.map +1 -0
  18. package/dist/builders/SdCliServerBuilder.mjs +171 -0
  19. package/dist/builders/SdCliTsLibBuilder.d.ts +13 -0
  20. package/dist/builders/SdCliTsLibBuilder.js.map +1 -0
  21. package/dist/builders/SdCliTsLibBuilder.mjs +75 -0
  22. package/dist/commons.d.ts +20 -110
  23. package/dist/commons.js.map +1 -0
  24. package/dist/commons.mjs +1 -1
  25. package/dist/entry/SdCliProject.d.ts +29 -0
  26. package/dist/entry/SdCliProject.js.map +1 -0
  27. package/dist/entry/SdCliProject.mjs +353 -0
  28. package/dist/sd-cli.js.map +1 -0
  29. package/dist/sd-cli.mjs +119 -0
  30. package/dist/sd-core-common/src/decorators/NotifyPropertyChange.d.ts +20 -0
  31. package/dist/sd-core-common/src/decorators/NotifyPropertyChange.js.map +1 -0
  32. package/dist/sd-core-common/src/decorators/NotifyPropertyChange.mjs +12 -0
  33. package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.d.ts +43 -0
  34. package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.js.map +1 -0
  35. package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.mjs +54 -0
  36. package/dist/sd-core-common/src/decorators/PropertyValidate.d.ts +16 -0
  37. package/dist/sd-core-common/src/decorators/PropertyValidate.js.map +1 -0
  38. package/dist/sd-core-common/src/decorators/PropertyValidate.mjs +26 -0
  39. package/dist/sd-core-common/src/decorators/decorator-return-types.d.ts +14 -0
  40. package/dist/sd-core-common/src/decorators/decorator-return-types.js.map +1 -0
  41. package/dist/sd-core-common/src/decorators/decorator-return-types.mjs +2 -0
  42. package/dist/sd-core-common/src/errors/ArgumentError.d.ts +10 -0
  43. package/dist/sd-core-common/src/errors/ArgumentError.js.map +1 -0
  44. package/dist/sd-core-common/src/errors/ArgumentError.mjs +13 -0
  45. package/dist/sd-core-common/src/errors/NeverEntryError.d.ts +10 -0
  46. package/dist/sd-core-common/src/errors/NeverEntryError.js.map +1 -0
  47. package/dist/sd-core-common/src/errors/NeverEntryError.mjs +13 -0
  48. package/dist/sd-core-common/src/errors/NotImplementError.d.ts +10 -0
  49. package/dist/sd-core-common/src/errors/NotImplementError.js.map +1 -0
  50. package/dist/sd-core-common/src/errors/NotImplementError.mjs +13 -0
  51. package/dist/sd-core-common/src/errors/SdError.d.ts +23 -0
  52. package/dist/sd-core-common/src/errors/SdError.js.map +1 -0
  53. package/dist/sd-core-common/src/errors/SdError.mjs +40 -0
  54. package/dist/sd-core-common/src/errors/TimeoutError.d.ts +11 -0
  55. package/dist/sd-core-common/src/errors/TimeoutError.js.map +1 -0
  56. package/dist/sd-core-common/src/errors/TimeoutError.mjs +16 -0
  57. package/dist/sd-core-common/src/extensions/ArrayExtension.d.ts +147 -0
  58. package/dist/sd-core-common/src/extensions/ArrayExtension.js.map +1 -0
  59. package/dist/sd-core-common/src/extensions/ArrayExtension.mjs +448 -0
  60. package/dist/sd-core-common/src/extensions/MapExtension.d.ts +4 -0
  61. package/dist/sd-core-common/src/extensions/MapExtension.js.map +1 -0
  62. package/dist/sd-core-common/src/extensions/MapExtension.mjs +15 -0
  63. package/dist/sd-core-common/src/extensions/SetExtension.d.ts +3 -0
  64. package/dist/sd-core-common/src/extensions/SetExtension.js.map +1 -0
  65. package/dist/sd-core-common/src/extensions/SetExtension.mjs +10 -0
  66. package/dist/sd-core-common/src/index.d.ts +32 -0
  67. package/dist/sd-core-common/src/index.js.map +1 -0
  68. package/dist/sd-core-common/src/index.mjs +33 -0
  69. package/dist/sd-core-common/src/types/DateOnly.d.ts +135 -0
  70. package/dist/sd-core-common/src/types/DateOnly.js.map +1 -0
  71. package/dist/sd-core-common/src/types/DateOnly.mjs +220 -0
  72. package/dist/sd-core-common/src/types/DateTime.d.ts +42 -0
  73. package/dist/sd-core-common/src/types/DateTime.js.map +1 -0
  74. package/dist/sd-core-common/src/types/DateTime.mjs +156 -0
  75. package/dist/sd-core-common/src/types/DeepPartial.d.ts +3 -0
  76. package/dist/sd-core-common/src/types/DeepPartial.js.map +1 -0
  77. package/dist/sd-core-common/src/types/DeepPartial.mjs +2 -0
  78. package/dist/sd-core-common/src/types/ObjectSet.d.ts +4 -0
  79. package/dist/sd-core-common/src/types/ObjectSet.js.map +1 -0
  80. package/dist/sd-core-common/src/types/ObjectSet.mjs +18 -0
  81. package/dist/sd-core-common/src/types/Time.d.ts +27 -0
  82. package/dist/sd-core-common/src/types/Time.js.map +1 -0
  83. package/dist/sd-core-common/src/types/Time.mjs +108 -0
  84. package/dist/sd-core-common/src/types/Type.d.ts +7 -0
  85. package/dist/sd-core-common/src/types/Type.js.map +1 -0
  86. package/dist/sd-core-common/src/types/Type.mjs +2 -0
  87. package/dist/sd-core-common/src/types/UnwrappedType.d.ts +1 -0
  88. package/dist/sd-core-common/src/types/UnwrappedType.js.map +1 -0
  89. package/dist/sd-core-common/src/types/UnwrappedType.mjs +2 -0
  90. package/dist/sd-core-common/src/types/Uuid.d.ts +8 -0
  91. package/dist/sd-core-common/src/types/Uuid.js.map +1 -0
  92. package/dist/sd-core-common/src/types/Uuid.mjs +26 -0
  93. package/dist/sd-core-common/src/types/WrappedType.d.ts +1 -0
  94. package/dist/sd-core-common/src/types/WrappedType.js.map +1 -0
  95. package/dist/sd-core-common/src/types/WrappedType.mjs +2 -0
  96. package/dist/sd-core-common/src/utils/DateTimeFormatUtil.d.ts +12 -0
  97. package/dist/sd-core-common/src/utils/DateTimeFormatUtil.js.map +1 -0
  98. package/dist/sd-core-common/src/utils/DateTimeFormatUtil.mjs +67 -0
  99. package/dist/sd-core-common/src/utils/FunctionQueue.d.ts +8 -0
  100. package/dist/sd-core-common/src/utils/FunctionQueue.js.map +1 -0
  101. package/dist/sd-core-common/src/utils/FunctionQueue.mjs +46 -0
  102. package/dist/sd-core-common/src/utils/FunctionUtil.d.ts +6 -0
  103. package/dist/sd-core-common/src/utils/FunctionUtil.js.map +1 -0
  104. package/dist/sd-core-common/src/utils/FunctionUtil.mjs +31 -0
  105. package/dist/sd-core-common/src/utils/JsonConvert.d.ts +8 -0
  106. package/dist/sd-core-common/src/utils/JsonConvert.js.map +1 -0
  107. package/dist/sd-core-common/src/utils/JsonConvert.mjs +78 -0
  108. package/dist/sd-core-common/src/utils/MathUtil.d.ts +3 -0
  109. package/dist/sd-core-common/src/utils/MathUtil.js.map +1 -0
  110. package/dist/sd-core-common/src/utils/MathUtil.mjs +6 -0
  111. package/dist/sd-core-common/src/utils/NumberUtil.d.ts +6 -0
  112. package/dist/sd-core-common/src/utils/NumberUtil.js.map +1 -0
  113. package/dist/sd-core-common/src/utils/NumberUtil.mjs +32 -0
  114. package/dist/sd-core-common/src/utils/ObjectUtil.d.ts +80 -0
  115. package/dist/sd-core-common/src/utils/ObjectUtil.js.map +1 -0
  116. package/dist/sd-core-common/src/utils/ObjectUtil.mjs +452 -0
  117. package/dist/sd-core-common/src/utils/SdSyncEventEmitter.d.ts +6 -0
  118. package/dist/sd-core-common/src/utils/SdSyncEventEmitter.js.map +1 -0
  119. package/dist/sd-core-common/src/utils/SdSyncEventEmitter.mjs +27 -0
  120. package/dist/sd-core-common/src/utils/StringUtil.d.ts +8 -0
  121. package/dist/sd-core-common/src/utils/StringUtil.js.map +1 -0
  122. package/dist/sd-core-common/src/utils/StringUtil.mjs +77 -0
  123. package/dist/sd-core-common/src/utils/Wait.d.ts +4 -0
  124. package/dist/sd-core-common/src/utils/Wait.js.map +1 -0
  125. package/dist/sd-core-common/src/utils/Wait.mjs +23 -0
  126. package/dist/sd-core-node/src/index.d.ts +6 -0
  127. package/dist/sd-core-node/src/index.js.map +1 -0
  128. package/dist/sd-core-node/src/index.mjs +7 -0
  129. package/dist/sd-core-node/src/utils/FsUtil.d.ts +44 -0
  130. package/dist/sd-core-node/src/utils/FsUtil.js.map +1 -0
  131. package/dist/sd-core-node/src/utils/FsUtil.mjs +493 -0
  132. package/dist/sd-core-node/src/utils/Logger.d.ts +91 -0
  133. package/dist/sd-core-node/src/utils/Logger.js.map +1 -0
  134. package/dist/sd-core-node/src/utils/Logger.mjs +185 -0
  135. package/dist/sd-core-node/src/utils/PathUtil.d.ts +6 -0
  136. package/dist/sd-core-node/src/utils/PathUtil.js.map +1 -0
  137. package/dist/sd-core-node/src/utils/PathUtil.mjs +24 -0
  138. package/dist/sd-core-node/src/utils/SdFsWatcher.d.ts +15 -0
  139. package/dist/sd-core-node/src/utils/SdFsWatcher.js.map +1 -0
  140. package/dist/sd-core-node/src/utils/SdFsWatcher.mjs +43 -0
  141. package/dist/sd-core-node/src/utils/SdProcess.d.ts +5 -0
  142. package/dist/sd-core-node/src/utils/SdProcess.js.map +1 -0
  143. package/dist/sd-core-node/src/utils/SdProcess.mjs +36 -0
  144. package/dist/sd-orm-common/src/CaseQueryHelper.d.ts +12 -0
  145. package/dist/sd-orm-common/src/CaseQueryHelper.js.map +1 -0
  146. package/dist/sd-orm-common/src/CaseQueryHelper.mjs +19 -0
  147. package/dist/sd-orm-common/src/CaseWhenQueryHelper.d.ts +12 -0
  148. package/dist/sd-orm-common/src/CaseWhenQueryHelper.js.map +1 -0
  149. package/dist/sd-orm-common/src/CaseWhenQueryHelper.mjs +20 -0
  150. package/dist/sd-orm-common/src/DbContext.d.ts +81 -0
  151. package/dist/sd-orm-common/src/DbContext.js.map +1 -0
  152. package/dist/sd-orm-common/src/DbContext.mjs +635 -0
  153. package/dist/sd-orm-common/src/IDbConnection.d.ts +15 -0
  154. package/dist/sd-orm-common/src/IDbConnection.js.map +1 -0
  155. package/dist/sd-orm-common/src/IDbConnection.mjs +2 -0
  156. package/dist/sd-orm-common/src/IDbContextExecutor.d.ts +17 -0
  157. package/dist/sd-orm-common/src/IDbContextExecutor.js.map +1 -0
  158. package/dist/sd-orm-common/src/IDbContextExecutor.mjs +2 -0
  159. package/dist/sd-orm-common/src/IDbMigration.d.ts +4 -0
  160. package/dist/sd-orm-common/src/IDbMigration.js.map +1 -0
  161. package/dist/sd-orm-common/src/IDbMigration.mjs +2 -0
  162. package/dist/sd-orm-common/src/QueryBuilder.d.ts +48 -0
  163. package/dist/sd-orm-common/src/QueryBuilder.js.map +1 -0
  164. package/dist/sd-orm-common/src/QueryBuilder.mjs +1022 -0
  165. package/dist/sd-orm-common/src/QueryHelper.d.ts +75 -0
  166. package/dist/sd-orm-common/src/QueryHelper.js.map +1 -0
  167. package/dist/sd-orm-common/src/QueryHelper.mjs +627 -0
  168. package/dist/sd-orm-common/src/QueryUnit.d.ts +10 -0
  169. package/dist/sd-orm-common/src/QueryUnit.js.map +1 -0
  170. package/dist/sd-orm-common/src/QueryUnit.mjs +16 -0
  171. package/dist/sd-orm-common/src/Queryable.d.ts +105 -0
  172. package/dist/sd-orm-common/src/Queryable.js.map +1 -0
  173. package/dist/sd-orm-common/src/Queryable.mjs +1375 -0
  174. package/dist/sd-orm-common/src/SdOrmDataType.d.ts +21 -0
  175. package/dist/sd-orm-common/src/SdOrmDataType.js.map +1 -0
  176. package/dist/sd-orm-common/src/SdOrmDataType.mjs +2 -0
  177. package/dist/sd-orm-common/src/commons.d.ts +400 -0
  178. package/dist/sd-orm-common/src/commons.js.map +1 -0
  179. package/dist/sd-orm-common/src/commons.mjs +8 -0
  180. package/dist/sd-orm-common/src/decorators.d.ts +29 -0
  181. package/dist/sd-orm-common/src/decorators.js.map +1 -0
  182. package/dist/sd-orm-common/src/decorators.mjs +89 -0
  183. package/dist/sd-orm-common/src/index.d.ts +17 -0
  184. package/dist/sd-orm-common/src/index.js.map +1 -0
  185. package/dist/sd-orm-common/src/index.mjs +18 -0
  186. package/dist/sd-orm-common/src/models/SystemMigration.d.ts +3 -0
  187. package/dist/sd-orm-common/src/models/SystemMigration.js.map +1 -0
  188. package/dist/sd-orm-common/src/models/SystemMigration.mjs +13 -0
  189. package/dist/sd-orm-common/src/utils/DbDefinitionUtil.d.ts +14 -0
  190. package/dist/sd-orm-common/src/utils/DbDefinitionUtil.js.map +1 -0
  191. package/dist/sd-orm-common/src/utils/DbDefinitionUtil.mjs +66 -0
  192. package/dist/sd-orm-common/src/utils/SdOrmUtil.d.ts +8 -0
  193. package/dist/sd-orm-common/src/utils/SdOrmUtil.js.map +1 -0
  194. package/dist/sd-orm-common/src/utils/SdOrmUtil.mjs +248 -0
  195. package/dist/sd-orm-node/src/DbConnectionFactory.d.ts +4 -0
  196. package/dist/sd-orm-node/src/DbConnectionFactory.js.map +1 -0
  197. package/dist/sd-orm-node/src/DbConnectionFactory.mjs +17 -0
  198. package/dist/sd-orm-node/src/NodeDbContextExecutor.d.ts +19 -0
  199. package/dist/sd-orm-node/src/NodeDbContextExecutor.js.map +1 -0
  200. package/dist/sd-orm-node/src/NodeDbContextExecutor.mjs +71 -0
  201. package/dist/sd-orm-node/src/SdOrm.d.ts +10 -0
  202. package/dist/sd-orm-node/src/SdOrm.js.map +1 -0
  203. package/dist/sd-orm-node/src/SdOrm.mjs +25 -0
  204. package/dist/sd-orm-node/src/index.d.ts +4 -0
  205. package/dist/sd-orm-node/src/index.js.map +1 -0
  206. package/dist/sd-orm-node/src/index.mjs +5 -0
  207. package/dist/sd-orm-node-mssql/src/MssqlDbConnection.d.ts +25 -0
  208. package/dist/sd-orm-node-mssql/src/MssqlDbConnection.js.map +1 -0
  209. package/dist/sd-orm-node-mssql/src/MssqlDbConnection.mjs +321 -0
  210. package/dist/sd-orm-node-mssql/src/index.d.ts +2 -0
  211. package/dist/sd-orm-node-mssql/src/index.js.map +1 -0
  212. package/dist/sd-orm-node-mssql/src/index.mjs +3 -0
  213. package/dist/sd-orm-node-mysql/src/MysqlDbConnection.d.ts +22 -0
  214. package/dist/sd-orm-node-mysql/src/MysqlDbConnection.js.map +1 -0
  215. package/dist/sd-orm-node-mysql/src/MysqlDbConnection.mjs +200 -0
  216. package/dist/sd-orm-node-mysql/src/index.d.ts +2 -0
  217. package/dist/sd-orm-node-mysql/src/index.js.map +1 -0
  218. package/dist/sd-orm-node-mysql/src/index.mjs +3 -0
  219. package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.d.ts +22 -0
  220. package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.js.map +1 -0
  221. package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.mjs +172 -0
  222. package/dist/sd-orm-node-sqlite/src/index.d.ts +2 -0
  223. package/dist/sd-orm-node-sqlite/src/index.js.map +1 -0
  224. package/dist/sd-orm-node-sqlite/src/index.mjs +3 -0
  225. package/dist/sd-service-common/src/commons-orm.d.ts +4 -0
  226. package/dist/sd-service-common/src/commons-orm.js.map +1 -0
  227. package/dist/sd-service-common/src/commons-orm.mjs +2 -0
  228. package/dist/sd-service-common/src/commons-smtp.d.ts +29 -0
  229. package/dist/sd-service-common/src/commons-smtp.js.map +1 -0
  230. package/dist/sd-service-common/src/commons-smtp.mjs +2 -0
  231. package/dist/sd-service-common/src/commons.d.ts +57 -0
  232. package/dist/sd-service-common/src/commons.js.map +1 -0
  233. package/dist/sd-service-common/src/commons.mjs +3 -0
  234. package/dist/sd-service-common/src/index.d.ts +3 -0
  235. package/dist/sd-service-common/src/index.js.map +1 -0
  236. package/dist/sd-service-common/src/index.mjs +4 -0
  237. package/dist/sd-service-server/src/ApiServiceError.d.ts +12 -0
  238. package/dist/sd-service-server/src/ApiServiceError.js.map +1 -0
  239. package/dist/sd-service-server/src/ApiServiceError.mjs +15 -0
  240. package/dist/sd-service-server/src/SdServiceServer.d.ts +39 -0
  241. package/dist/sd-service-server/src/SdServiceServer.js.map +1 -0
  242. package/dist/sd-service-server/src/SdServiceServer.mjs +513 -0
  243. package/dist/sd-service-server/src/commons.d.ts +23 -0
  244. package/dist/sd-service-server/src/commons.js.map +1 -0
  245. package/dist/sd-service-server/src/commons.mjs +3 -0
  246. package/dist/sd-service-server/src/index.d.ts +8 -0
  247. package/dist/sd-service-server/src/index.js.map +1 -0
  248. package/dist/sd-service-server/src/index.mjs +9 -0
  249. package/dist/sd-service-server/src/services/SdAutoUpdateService.d.ts +4 -0
  250. package/dist/sd-service-server/src/services/SdAutoUpdateService.js.map +1 -0
  251. package/dist/sd-service-server/src/services/SdAutoUpdateService.mjs +20 -0
  252. package/dist/sd-service-server/src/services/SdCryptoService.d.ts +7 -0
  253. package/dist/sd-service-server/src/services/SdCryptoService.js.map +1 -0
  254. package/dist/sd-service-server/src/services/SdCryptoService.mjs +39 -0
  255. package/dist/sd-service-server/src/services/SdOrmService.d.ts +22 -0
  256. package/dist/sd-service-server/src/services/SdOrmService.js.map +1 -0
  257. package/dist/sd-service-server/src/services/SdOrmService.mjs +115 -0
  258. package/dist/sd-service-server/src/services/SdSmtpClientService.d.ts +6 -0
  259. package/dist/sd-service-server/src/services/SdSmtpClientService.js.map +1 -0
  260. package/dist/sd-service-server/src/services/SdSmtpClientService.mjs +44 -0
  261. package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.d.ts +4 -0
  262. package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.js.map +1 -0
  263. package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.mjs +36 -0
  264. package/dist/server-worker.d.ts +1 -0
  265. package/dist/server-worker.js.map +1 -0
  266. package/dist/server-worker.mjs +36 -0
  267. package/dist/utils/SdCliBuildResultUtil.d.ts +1 -4
  268. package/dist/utils/SdCliBuildResultUtil.js.map +1 -0
  269. package/dist/utils/SdCliBuildResultUtil.mjs +3 -29
  270. package/dist/utils/SdCliConfigUtil.js.map +1 -0
  271. package/dist/utils/SdCliConfigUtil.mjs +1 -1
  272. package/package.json +14 -56
  273. package/src/SdLinter.ts +41 -0
  274. package/src/SdTsIncrementalBuilder.ts +75 -0
  275. package/src/build-cluster.ts +133 -0
  276. package/src/builders/SdCliClientBuilder.ts +189 -0
  277. package/src/builders/SdCliJsLibLinter.ts +72 -0
  278. package/src/builders/SdCliServerBuilder.ts +191 -0
  279. package/src/builders/SdCliTsLibBuilder.ts +96 -0
  280. package/src/commons.ts +21 -112
  281. package/src/entry/SdCliProject.ts +467 -0
  282. package/src/sd-cli.ts +136 -0
  283. package/src/server-worker.ts +45 -0
  284. package/src/utils/SdCliBuildResultUtil.ts +5 -38
  285. package/tsconfig.json +9 -0
  286. package/README.md +0 -105
  287. package/assets/client-files/assets/icons/icon-128x128.png +0 -0
  288. package/assets/client-files/assets/icons/icon-144x144.png +0 -0
  289. package/assets/client-files/assets/icons/icon-152x152.png +0 -0
  290. package/assets/client-files/assets/icons/icon-192x192.png +0 -0
  291. package/assets/client-files/assets/icons/icon-384x384.png +0 -0
  292. package/assets/client-files/assets/icons/icon-512x512.png +0 -0
  293. package/assets/client-files/assets/icons/icon-72x72.png +0 -0
  294. package/assets/client-files/assets/icons/icon-96x96.png +0 -0
  295. package/assets/client-files/favicon.ico +0 -0
  296. package/dist/SdCliBuildResultError.d.ts +0 -5
  297. package/dist/SdCliBuildResultError.mjs +0 -8
  298. package/dist/bin/sd-cli.d.ts +0 -2
  299. package/dist/bin/sd-cli.mjs +0 -410
  300. package/dist/build-tool/SdCliCacheCompilerHost.d.ts +0 -10
  301. package/dist/build-tool/SdCliCacheCompilerHost.mjs +0 -51
  302. package/dist/build-tool/SdCliCordova.d.ts +0 -16
  303. package/dist/build-tool/SdCliCordova.mjs +0 -212
  304. package/dist/build-tool/SdCliElectron.d.ts +0 -9
  305. package/dist/build-tool/SdCliElectron.mjs +0 -72
  306. package/dist/build-tool/SdCliGithubApi.d.ts +0 -13
  307. package/dist/build-tool/SdCliGithubApi.mjs +0 -92
  308. package/dist/build-tool/SdCliIndexFileGenerator.d.ts +0 -13
  309. package/dist/build-tool/SdCliIndexFileGenerator.mjs +0 -62
  310. package/dist/build-tool/SdCliNgCacheCompilerHost.d.ts +0 -12
  311. package/dist/build-tool/SdCliNgCacheCompilerHost.mjs +0 -43
  312. package/dist/build-tool/SdCliPackageLinter.d.ts +0 -8
  313. package/dist/build-tool/SdCliPackageLinter.mjs +0 -62
  314. package/dist/builder/SdCliClientBuilder.d.ts +0 -26
  315. package/dist/builder/SdCliClientBuilder.mjs +0 -769
  316. package/dist/builder/SdCliJsLibBuilder.d.ts +0 -14
  317. package/dist/builder/SdCliJsLibBuilder.mjs +0 -54
  318. package/dist/builder/SdCliServerBuilder.d.ts +0 -28
  319. package/dist/builder/SdCliServerBuilder.mjs +0 -482
  320. package/dist/builder/SdCliTsLibBuilder.d.ts +0 -35
  321. package/dist/builder/SdCliTsLibBuilder.mjs +0 -317
  322. package/dist/entry-points/SdCliFileCrypto.d.ts +0 -7
  323. package/dist/entry-points/SdCliFileCrypto.mjs +0 -72
  324. package/dist/entry-points/SdCliLocalUpdate.d.ts +0 -13
  325. package/dist/entry-points/SdCliLocalUpdate.mjs +0 -100
  326. package/dist/entry-points/SdCliPrepare.d.ts +0 -5
  327. package/dist/entry-points/SdCliPrepare.mjs +0 -86
  328. package/dist/entry-points/SdCliProject.d.ts +0 -34
  329. package/dist/entry-points/SdCliProject.mjs +0 -416
  330. package/dist/entry-points/SdCliProjectGenerator.d.ts +0 -44
  331. package/dist/entry-points/SdCliProjectGenerator.mjs +0 -326
  332. package/dist/entry-points/file/base/fc_package_eslintrc.d.ts +0 -3
  333. package/dist/entry-points/file/base/fc_package_eslintrc.mjs +0 -31
  334. package/dist/entry-points/file/base/fc_package_npmconfig.d.ts +0 -9
  335. package/dist/entry-points/file/base/fc_package_npmconfig.mjs +0 -32
  336. package/dist/entry-points/file/base/fc_package_tsconfig.d.ts +0 -5
  337. package/dist/entry-points/file/base/fc_package_tsconfig.mjs +0 -13
  338. package/dist/entry-points/file/client/fc_package_AppModule.d.ts +0 -1
  339. package/dist/entry-points/file/client/fc_package_AppModule.mjs +0 -37
  340. package/dist/entry-points/file/client/fc_package_AppPage.d.ts +0 -1
  341. package/dist/entry-points/file/client/fc_package_AppPage.mjs +0 -14
  342. package/dist/entry-points/file/client/fc_package_Page.d.ts +0 -4
  343. package/dist/entry-points/file/client/fc_package_Page.mjs +0 -19
  344. package/dist/entry-points/file/client/fc_package_client_main.d.ts +0 -1
  345. package/dist/entry-points/file/client/fc_package_client_main.mjs +0 -19
  346. package/dist/entry-points/file/client/fc_package_index.d.ts +0 -3
  347. package/dist/entry-points/file/client/fc_package_index.mjs +0 -88
  348. package/dist/entry-points/file/client/fc_package_manifest.d.ts +0 -5
  349. package/dist/entry-points/file/client/fc_package_manifest.mjs +0 -54
  350. package/dist/entry-points/file/client/fc_package_polyfills.d.ts +0 -1
  351. package/dist/entry-points/file/client/fc_package_polyfills.mjs +0 -11
  352. package/dist/entry-points/file/client/fc_package_styles.d.ts +0 -1
  353. package/dist/entry-points/file/client/fc_package_styles.mjs +0 -7
  354. package/dist/entry-points/file/db/fc_package_DbContext.d.ts +0 -3
  355. package/dist/entry-points/file/db/fc_package_DbContext.mjs +0 -14
  356. package/dist/entry-points/file/db/fc_package_DbModel.d.ts +0 -4
  357. package/dist/entry-points/file/db/fc_package_DbModel.mjs +0 -12
  358. package/dist/entry-points/file/project/fc_project_editor_config.d.ts +0 -1
  359. package/dist/entry-points/file/project/fc_project_editor_config.mjs +0 -22
  360. package/dist/entry-points/file/project/fc_project_eslintrc.d.ts +0 -1
  361. package/dist/entry-points/file/project/fc_project_eslintrc.mjs +0 -30
  362. package/dist/entry-points/file/project/fc_project_gitattributes.d.ts +0 -1
  363. package/dist/entry-points/file/project/fc_project_gitattributes.mjs +0 -6
  364. package/dist/entry-points/file/project/fc_project_gitignore.d.ts +0 -1
  365. package/dist/entry-points/file/project/fc_project_gitignore.mjs +0 -27
  366. package/dist/entry-points/file/project/fc_project_npmconfig.d.ts +0 -7
  367. package/dist/entry-points/file/project/fc_project_npmconfig.mjs +0 -37
  368. package/dist/entry-points/file/project/fc_project_readme.d.ts +0 -3
  369. package/dist/entry-points/file/project/fc_project_readme.mjs +0 -13
  370. package/dist/entry-points/file/project/fc_project_simplysm.d.ts +0 -1
  371. package/dist/entry-points/file/project/fc_project_simplysm.mjs +0 -2
  372. package/dist/entry-points/file/project/fc_project_tsconfig.d.ts +0 -1
  373. package/dist/entry-points/file/project/fc_project_tsconfig.mjs +0 -25
  374. package/dist/entry-points/file/server/fc_package_server_main.d.ts +0 -5
  375. package/dist/entry-points/file/server/fc_package_server_main.mjs +0 -60
  376. package/dist/index.d.ts +0 -54
  377. package/dist/index.mjs +0 -55
  378. package/dist/ng-tools/SdCliNgModuleGenerator.d.ts +0 -29
  379. package/dist/ng-tools/SdCliNgModuleGenerator.mjs +0 -502
  380. package/dist/ng-tools/babel/SdCliBbFileMetadata.d.ts +0 -25
  381. package/dist/ng-tools/babel/SdCliBbFileMetadata.mjs +0 -539
  382. package/dist/ng-tools/babel/SdCliBbRootMetadata.d.ts +0 -23
  383. package/dist/ng-tools/babel/SdCliBbRootMetadata.mjs +0 -247
  384. package/dist/ng-tools/babel/SdCliBbUtil.d.ts +0 -5
  385. package/dist/ng-tools/babel/SdCliBbUtil.mjs +0 -14
  386. package/dist/ng-tools/babel/TSdCliBbNgMetadata.d.ts +0 -42
  387. package/dist/ng-tools/babel/TSdCliBbNgMetadata.mjs +0 -216
  388. package/dist/ng-tools/babel/TSdCliBbTypeMetadata.d.ts +0 -55
  389. package/dist/ng-tools/babel/TSdCliBbTypeMetadata.mjs +0 -151
  390. package/dist/ng-tools/commons.d.ts +0 -9
  391. package/dist/ng-tools/commons.mjs +0 -2
  392. package/dist/ng-tools/typescript/SdCliTsFileMetadata.d.ts +0 -61
  393. package/dist/ng-tools/typescript/SdCliTsFileMetadata.mjs +0 -325
  394. package/dist/ng-tools/typescript/SdCliTsRootMetadata.d.ts +0 -8
  395. package/dist/ng-tools/typescript/SdCliTsRootMetadata.mjs +0 -28
  396. package/dist/ng-tools/typescript/SdCliTsUtil.d.ts +0 -5
  397. package/dist/ng-tools/typescript/SdCliTsUtil.mjs +0 -28
  398. package/dist/packages/SdCliPackage.d.ts +0 -22
  399. package/dist/packages/SdCliPackage.mjs +0 -206
  400. package/dist/utils/SdCliNpmConfigUtil.d.ts +0 -7
  401. package/dist/utils/SdCliNpmConfigUtil.mjs +0 -15
  402. package/dist/worker/build-worker.mjs +0 -67
  403. package/dist/worker/server-worker.mjs +0 -67
  404. package/docs/client-add-page.md +0 -8
  405. package/docs/client-router.md +0 -85
  406. package/docs/client-sw.md +0 -101
  407. package/docs/conf-orm.md +0 -81
  408. package/docs/conf-usage.md +0 -5
  409. package/docs/lib-local-update.md +0 -50
  410. package/docs/lib-ts-paths.md +0 -25
  411. package/lib/cordova-entry.js +0 -22
  412. package/src/SdCliBuildResultError.ts +0 -9
  413. package/src/bin/sd-cli.ts +0 -493
  414. package/src/build-tool/SdCliCacheCompilerHost.ts +0 -79
  415. package/src/build-tool/SdCliCordova.ts +0 -263
  416. package/src/build-tool/SdCliElectron.ts +0 -85
  417. package/src/build-tool/SdCliGithubApi.ts +0 -111
  418. package/src/build-tool/SdCliIndexFileGenerator.ts +0 -79
  419. package/src/build-tool/SdCliNgCacheCompilerHost.ts +0 -58
  420. package/src/build-tool/SdCliPackageLinter.ts +0 -74
  421. package/src/builder/SdCliClientBuilder.ts +0 -879
  422. package/src/builder/SdCliJsLibBuilder.ts +0 -70
  423. package/src/builder/SdCliServerBuilder.ts +0 -552
  424. package/src/builder/SdCliTsLibBuilder.ts +0 -450
  425. package/src/entry-points/SdCliFileCrypto.ts +0 -87
  426. package/src/entry-points/SdCliLocalUpdate.ts +0 -121
  427. package/src/entry-points/SdCliPrepare.ts +0 -86
  428. package/src/entry-points/SdCliProject.ts +0 -491
  429. package/src/entry-points/SdCliProjectGenerator.ts +0 -402
  430. package/src/entry-points/file/base/fc_package_eslintrc.ts +0 -30
  431. package/src/entry-points/file/base/fc_package_npmconfig.ts +0 -43
  432. package/src/entry-points/file/base/fc_package_tsconfig.ts +0 -12
  433. package/src/entry-points/file/client/fc_package_AppModule.ts +0 -36
  434. package/src/entry-points/file/client/fc_package_AppPage.ts +0 -13
  435. package/src/entry-points/file/client/fc_package_Page.ts +0 -19
  436. package/src/entry-points/file/client/fc_package_client_main.ts +0 -18
  437. package/src/entry-points/file/client/fc_package_index.ts +0 -87
  438. package/src/entry-points/file/client/fc_package_manifest.ts +0 -53
  439. package/src/entry-points/file/client/fc_package_polyfills.ts +0 -10
  440. package/src/entry-points/file/client/fc_package_styles.ts +0 -6
  441. package/src/entry-points/file/db/fc_package_DbContext.ts +0 -14
  442. package/src/entry-points/file/db/fc_package_DbModel.ts +0 -11
  443. package/src/entry-points/file/project/fc_project_editor_config.ts +0 -21
  444. package/src/entry-points/file/project/fc_project_eslintrc.ts +0 -29
  445. package/src/entry-points/file/project/fc_project_gitattributes.ts +0 -5
  446. package/src/entry-points/file/project/fc_project_gitignore.ts +0 -26
  447. package/src/entry-points/file/project/fc_project_npmconfig.ts +0 -36
  448. package/src/entry-points/file/project/fc_project_readme.ts +0 -12
  449. package/src/entry-points/file/project/fc_project_simplysm.ts +0 -1
  450. package/src/entry-points/file/project/fc_project_tsconfig.ts +0 -24
  451. package/src/entry-points/file/server/fc_package_server_main.ts +0 -62
  452. package/src/index.ts +0 -54
  453. package/src/ng-tools/SdCliNgModuleGenerator.ts +0 -672
  454. package/src/ng-tools/babel/SdCliBbFileMetadata.ts +0 -629
  455. package/src/ng-tools/babel/SdCliBbRootMetadata.ts +0 -292
  456. package/src/ng-tools/babel/SdCliBbUtil.ts +0 -15
  457. package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +0 -251
  458. package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +0 -212
  459. package/src/ng-tools/commons.ts +0 -3
  460. package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +0 -384
  461. package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +0 -32
  462. package/src/ng-tools/typescript/SdCliTsUtil.ts +0 -29
  463. package/src/packages/SdCliPackage.ts +0 -259
  464. package/src/utils/SdCliNpmConfigUtil.ts +0 -16
  465. package/src/worker/build-worker.ts +0 -73
  466. package/src/worker/server-worker.ts +0 -72
  467. /package/dist/{worker/build-worker.d.ts → build-cluster.d.ts} +0 -0
  468. /package/dist/{worker/server-worker.d.ts → sd-cli.d.ts} +0 -0
@@ -0,0 +1,133 @@
1
+ import cluster from "node:cluster";
2
+ import { SdCliTsLibBuilder } from "./builders/SdCliTsLibBuilder";
3
+ import { FsUtil, Logger, LoggerSeverity } from "@simplysm/sd-core-node";
4
+ import path from "path";
5
+ import { SdCliJsLibLinter } from "./builders/SdCliJsLibLinter";
6
+ import { EventEmitter } from "events";
7
+ import { ISdCliBuildClusterReqMessage, ISdCliBuildClusterResMessage } from "./commons";
8
+ import { NeverEntryError } from "@simplysm/sd-core-common";
9
+ import { SdCliServerBuilder } from "./builders/SdCliServerBuilder";
10
+ import { SdCliClientBuilder } from "./builders/SdCliClientBuilder";
11
+
12
+ Error.stackTraceLimit = Infinity;
13
+ EventEmitter.defaultMaxListeners = 0;
14
+
15
+ if (Boolean(process.env["SD_DEBUG"])) {
16
+ Logger.setConfig({
17
+ console: {
18
+ level: LoggerSeverity.debug
19
+ }
20
+ });
21
+ }
22
+ else {
23
+ Logger.setConfig({
24
+ dot: true
25
+ });
26
+ }
27
+
28
+ const logger = Logger.get(["simplysm", "sd-cli", "build-cluster"]);
29
+
30
+ if (cluster.isPrimary) {
31
+ logger.debug(`메인 프로세스 ${process.pid} 시작`);
32
+
33
+ cluster.on("exit", (worker, code) => {
34
+ logger.debug(`워커 프로세스 ${worker.process.pid} 종료 (code: ${code})`);
35
+ });
36
+
37
+ cluster.on("message", (worker, message) => {
38
+ sendMessage(message);
39
+ });
40
+
41
+ process.on("message", (message) => {
42
+ cluster.fork({
43
+ "SD_CLUSTER_MESSAGE": JSON.stringify(message)
44
+ });
45
+ });
46
+ process.send!("ready");
47
+ }
48
+ else {
49
+ const message = JSON.parse(process.env["SD_CLUSTER_MESSAGE"]!) as ISdCliBuildClusterReqMessage;
50
+
51
+ if (message.cmd === "watch") {
52
+ // [library] javascript
53
+ if (message.pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
54
+ await new SdCliJsLibLinter(message.pkgPath)
55
+ .on("change", () => {
56
+ sendMessage({ type: "change", req: message });
57
+ })
58
+ .on("complete", (result) => {
59
+ sendMessage({ type: "complete", result, req: message });
60
+ })
61
+ .watchAsync();
62
+ sendMessage({ type: "ready", req: message });
63
+ }
64
+ // [library] typescript
65
+ else if (message.pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
66
+ await new SdCliTsLibBuilder(message.pkgPath)
67
+ .on("change", () => {
68
+ sendMessage({ type: "change", req: message });
69
+ })
70
+ .on("complete", (result) => {
71
+ sendMessage({ type: "complete", result, req: message });
72
+ })
73
+ .watchAsync();
74
+ sendMessage({ type: "ready", req: message });
75
+ }
76
+ // [server]
77
+ else if (message.pkgConf.type === "server") {
78
+ await new SdCliServerBuilder(message.pkgPath, message.pkgConf)
79
+ .on("change", () => {
80
+ sendMessage({ type: "change", req: message });
81
+ })
82
+ .on("complete", (result) => {
83
+ sendMessage({ type: "complete", result, req: message });
84
+ })
85
+ .watchAsync();
86
+ sendMessage({ type: "ready", req: message });
87
+ }
88
+ // [client]
89
+ else if (message.pkgConf.type === "client") {
90
+ await new SdCliClientBuilder(message.pkgPath)
91
+ .on("change", () => {
92
+ sendMessage({ type: "change", req: message });
93
+ })
94
+ .on("complete", (result) => {
95
+ sendMessage({ type: "complete", result, req: message });
96
+ })
97
+ .watchAsync();
98
+ sendMessage({ type: "ready", req: message });
99
+ }
100
+ else {
101
+ throw new NeverEntryError();
102
+ }
103
+ }
104
+ else { // build
105
+ // [library] javascript
106
+ if (message.pkgConf.type === "library" && !FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
107
+ const result = await new SdCliJsLibLinter(message.pkgPath).buildAsync();
108
+ sendMessage({ type: "complete", result, req: message });
109
+ }
110
+ // [library] typescript
111
+ else if (message.pkgConf.type === "library" && FsUtil.exists(path.resolve(message.pkgPath, "tsconfig.json"))) {
112
+ const result = await new SdCliTsLibBuilder(message.pkgPath).buildAsync();
113
+ sendMessage({ type: "complete", result, req: message });
114
+ }
115
+ // [server]
116
+ else if (message.pkgConf.type === "server") {
117
+ const result = await new SdCliServerBuilder(message.pkgPath, message.pkgConf).buildAsync();
118
+ sendMessage({ type: "complete", result, req: message });
119
+ }
120
+ // [server]
121
+ else if (message.pkgConf.type === "client") {
122
+ const result = await new SdCliClientBuilder(message.pkgPath).buildAsync();
123
+ sendMessage({ type: "complete", result, req: message });
124
+ }
125
+ else {
126
+ throw new NeverEntryError();
127
+ }
128
+ }
129
+ }
130
+
131
+ function sendMessage(message: ISdCliBuildClusterResMessage): void {
132
+ process.send!(message);
133
+ }
@@ -0,0 +1,189 @@
1
+ import { EventEmitter } from "events";
2
+ import { FsUtil, Logger, SdFsWatcher } from "@simplysm/sd-core-node";
3
+ import { ISdCliBuilderResult, ISdCliPackageBuildResult } from "../commons";
4
+ import { FunctionQueue, MathUtil } from "@simplysm/sd-core-common";
5
+ import * as vite from "vite";
6
+ import { createLogger } from "vite";
7
+ import vitePluginReact from "@vitejs/plugin-react";
8
+ import vitePluginPaths from "vite-tsconfig-paths";
9
+ import path from "path";
10
+ import { SdTsIncrementalBuilder } from "../SdTsIncrementalBuilder";
11
+ import { SdLinter } from "../SdLinter";
12
+
13
+ export class SdCliClientBuilder extends EventEmitter {
14
+ private readonly _logger = Logger.get(["simplysm", "sd-cli", "SdCliClientBuilder"]);
15
+
16
+ public constructor(private readonly _pkgPath: string) {
17
+ super();
18
+ }
19
+
20
+ public override on(event: "change", listener: () => void): this;
21
+ public override on(event: "complete", listener: (result: ISdCliBuilderResult) => void): this;
22
+ public override on(event: string | symbol, listener: (...args: any[]) => void): this {
23
+ super.on(event, listener);
24
+ return this;
25
+ }
26
+
27
+ public async watchAsync(): Promise<number> {
28
+ this._debug("빌드 준비...");
29
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, false);
30
+
31
+ this.emit("change");
32
+
33
+ this._debug("BUILD...");
34
+ const viteServerPort = MathUtil.getRandomInt(60000, 65535);
35
+ const viteServer = await vite.createServer({
36
+ mode: "development",
37
+ root: path.resolve(this._pkgPath, "src"),
38
+ cacheDir: path.resolve(this._pkgPath, ".cache", "vite"),
39
+ base: "/" + path.basename(this._pkgPath) + "/",
40
+ server: {
41
+ hmr: {
42
+ port: viteServerPort
43
+ }
44
+ },
45
+ customLogger: {
46
+ ...createLogger(),
47
+ info: (msg) => {
48
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
49
+ },
50
+ warn: (msg) => {
51
+ this._logger.warn(`[${path.basename(this._pkgPath)}] ${msg}`);
52
+ },
53
+ error: (msg) => {
54
+ this._logger.error(`[${path.basename(this._pkgPath)}] ${msg}`);
55
+ }
56
+ },
57
+ plugins: [
58
+ vitePluginReact(),
59
+ vitePluginPaths(),
60
+ {
61
+ name: "simplysm",
62
+ configureServer: (server: vite.ViteDevServer) => {
63
+ (server.watcher.options.ignored as string[]).remove("**/node_modules/**");
64
+ }
65
+ }
66
+ ]
67
+ });
68
+ await viteServer.listen(viteServerPort);
69
+
70
+ this._debug("CHECK...");
71
+ const checkResult = await sdTsProgram.buildAsync();
72
+
73
+ this._debug("LINT...");
74
+ const lintResults = await SdLinter.lintAsync(checkResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
75
+
76
+ this._debug("WATCH...");
77
+ const fnQ = new FunctionQueue();
78
+ SdFsWatcher
79
+ .watch([
80
+ ...sdTsProgram.builderProgram!.getSourceFiles().map((item) => item.fileName),
81
+ path.resolve(this._pkgPath, "src/**/*.{ts,tsx}")
82
+ ])
83
+ .onChange({
84
+ delay: 100
85
+ }, () => {
86
+ fnQ.runLast(async () => {
87
+ this.emit("change");
88
+
89
+ this._debug(`CHECK...`);
90
+ const watchCheckResult = await sdTsProgram.buildAsync();
91
+
92
+ this._debug(`LINT...`);
93
+ const watchLintResults = await SdLinter.lintAsync(watchCheckResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
94
+
95
+ this._debug(`빌드 완료`);
96
+ this.emit("complete", {
97
+ port: viteServerPort,
98
+ affectedFilePaths: watchCheckResult.affectedFilePaths,
99
+ buildResults: [...watchCheckResult.results, ...watchLintResults]
100
+ });
101
+ });
102
+ });
103
+
104
+ this._debug(`빌드 완료`);
105
+ this.emit("complete", {
106
+ port: viteServerPort,
107
+ affectedFilePaths: checkResult.affectedFilePaths,
108
+ buildResults: [...checkResult.results, ...lintResults]
109
+ });
110
+
111
+ return viteServerPort;
112
+ }
113
+
114
+ public async buildAsync(): Promise<ISdCliBuilderResult> {
115
+ this._debug("빌드 준비...");
116
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, false);
117
+
118
+ this._debug("dist 초기화...");
119
+ await FsUtil.removeAsync(path.resolve(this._pkgPath, "dist"));
120
+
121
+ this._debug("BUILD...");
122
+ const buildResults: ISdCliPackageBuildResult[] = [];
123
+ try {
124
+ await vite.build({
125
+ mode: "production",
126
+ root: path.resolve(this._pkgPath, "src"),
127
+ cacheDir: path.resolve(this._pkgPath, ".cache", "vite"),
128
+ base: "/" + path.basename(this._pkgPath) + "/",
129
+ build: {
130
+ outDir: path.resolve(this._pkgPath, "dist")
131
+ },
132
+ customLogger: {
133
+ ...createLogger(),
134
+ info: (msg) => {
135
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
136
+ },
137
+ warn: (msg) => {
138
+ this._logger.warn(`[${path.basename(this._pkgPath)}] ${msg}`);
139
+ },
140
+ error: (msg) => {
141
+ this._logger.error(`[${path.basename(this._pkgPath)}] ${msg}`);
142
+ }
143
+ },
144
+ plugins: [
145
+ vitePluginReact(),
146
+ vitePluginPaths()
147
+ ],
148
+ });
149
+ }
150
+ catch (err) {
151
+ if ("errors" in err && err.errors instanceof Array) {
152
+ buildResults.push(...err.errors.map((item) => ({
153
+ filePath: item.location.file,
154
+ line: item.location.line,
155
+ char: item.location.column,
156
+ code: undefined,
157
+ severity: "error" as const,
158
+ message: item.text
159
+ })));
160
+ }
161
+ if ("warnings" in err && err.warnings instanceof Array) {
162
+ buildResults.push(...err.warnings.map((item) => ({
163
+ filePath: item.location.file,
164
+ line: item.location.line,
165
+ char: item.location.column,
166
+ code: undefined,
167
+ severity: "warning" as const,
168
+ message: item.text
169
+ })));
170
+ }
171
+ }
172
+
173
+ this._debug("CHECK...");
174
+ const checkResult = await sdTsProgram.buildAsync();
175
+
176
+ this._debug("LINT...");
177
+ const lintResults = await SdLinter.lintAsync(checkResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
178
+
179
+ this._debug(`빌드 완료`);
180
+ return {
181
+ affectedFilePaths: checkResult.affectedFilePaths,
182
+ buildResults: [...buildResults, ...checkResult.results, ...lintResults]
183
+ };
184
+ }
185
+
186
+ private _debug(msg: string): void {
187
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
188
+ }
189
+ }
@@ -0,0 +1,72 @@
1
+ import { FsUtil, Logger, SdFsWatcher } from "@simplysm/sd-core-node";
2
+ import path from "path";
3
+ import { ISdCliBuilderResult } from "../commons";
4
+ import { EventEmitter } from "events";
5
+ import { SdLinter } from "../SdLinter";
6
+
7
+ export class SdCliJsLibLinter extends EventEmitter {
8
+ private readonly _logger = Logger.get(["simplysm", "sd-cli", "SdCliJsLibLinter"]);
9
+ private readonly _pkgName: string;
10
+
11
+ public constructor(private readonly _pkgPath: string) {
12
+ super();
13
+ this._pkgName = path.basename(_pkgPath);
14
+ }
15
+
16
+ public override on(event: "change", listener: () => void): this;
17
+ public override on(event: "complete", listener: (result: ISdCliBuilderResult) => void): this;
18
+ public override on(event: string | symbol, listener: (...args: any[]) => void): this {
19
+ super.on(event, listener);
20
+ return this;
21
+ }
22
+
23
+ public async buildAsync(): Promise<ISdCliBuilderResult> {
24
+ this._debug("LINT...");
25
+ const srcGlobPath = path.resolve(this._pkgPath, "src/**/*.+(js|cjs|mjs)");
26
+ const srcFilePaths = await FsUtil.globAsync(srcGlobPath);
27
+ const lintResults = await SdLinter.lintAsync(srcFilePaths);
28
+
29
+ this._debug(`LINT 완료`);
30
+ return {
31
+ affectedFilePaths: srcFilePaths,
32
+ buildResults: lintResults
33
+ };
34
+ }
35
+
36
+ public async watchAsync(): Promise<void> {
37
+ this.emit("change");
38
+ this._debug("LINT...");
39
+ const srcGlobPath = path.resolve(this._pkgPath, "src/**/*.+(js|cjs|mjs)");
40
+ const srcFilePaths = await FsUtil.globAsync(srcGlobPath);
41
+ const lintResults = await SdLinter.lintAsync(srcFilePaths);
42
+
43
+ this._debug(`LINT 완료`);
44
+ this.emit("complete", {
45
+ affectedFilePaths: srcFilePaths,
46
+ buildResults: lintResults
47
+ });
48
+
49
+ SdFsWatcher
50
+ .watch([srcGlobPath])
51
+ .onChange({
52
+ delay: 100
53
+ }, async (changeInfos) => {
54
+ const watchFilePaths = changeInfos.filter((item) => FsUtil.exists(item.path)).map((item) => item.path);
55
+ if (watchFilePaths.length < 1) return;
56
+
57
+ this.emit("change");
58
+ this._debug("LINT...");
59
+ const watchLintResults = await SdLinter.lintAsync(watchFilePaths);
60
+
61
+ this._debug(`LINT 완료`);
62
+ this.emit("complete", {
63
+ affectedFilePaths: changeInfos.map((item) => item.path),
64
+ buildResults: watchLintResults
65
+ });
66
+ });
67
+ }
68
+
69
+ private _debug(msg: string): void {
70
+ this._logger.debug(`[${this._pkgName}] ${msg}`);
71
+ }
72
+ }
@@ -0,0 +1,191 @@
1
+ import { EventEmitter } from "events";
2
+ import { FsUtil, Logger } from "@simplysm/sd-core-node";
3
+ import { ISdCliBuilderResult, ISdCliServerPackageConfig } from "../commons";
4
+ import esbuild from "esbuild";
5
+ import path from "path";
6
+ import { SdTsIncrementalBuilder } from "../SdTsIncrementalBuilder";
7
+ import { SdLinter } from "../SdLinter";
8
+
9
+ export class SdCliServerBuilder extends EventEmitter {
10
+ private readonly _logger = Logger.get(["simplysm", "sd-cli", "SdCliServerBuilder"]);
11
+
12
+ public constructor(private readonly _pkgPath: string,
13
+ private readonly _pkgConf: ISdCliServerPackageConfig) {
14
+ super();
15
+ }
16
+
17
+ public override on(event: "change", listener: () => void): this;
18
+ public override on(event: "complete", listener: (result: ISdCliBuilderResult) => void): this;
19
+ public override on(event: string | symbol, listener: (...args: any[]) => void): this {
20
+ super.on(event, listener);
21
+ return this;
22
+ }
23
+
24
+ public async watchAsync(): Promise<void> {
25
+ this._debug("빌드 준비...");
26
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, false);
27
+
28
+ this._debug("dist 초기화...");
29
+ await FsUtil.removeAsync(path.resolve(this._pkgPath, "dist"));
30
+
31
+ this.emit("change");
32
+
33
+ this._debug(`BUILD...`);
34
+ let isFirst = true;
35
+ const ctx = await esbuild.context({
36
+ entryPoints: {
37
+ index: path.resolve(this._pkgPath, "src", "main.ts")
38
+ },
39
+ bundle: true,
40
+ target: "node20",
41
+ mainFields: ["es2021", "es2020", "module", "main"],
42
+ conditions: ["es2021", "es2020", "es2015", "module"],
43
+ tsconfig: path.resolve(this._pkgPath, "tsconfig.json"),
44
+ write: true,
45
+ format: "esm",
46
+ outExtension: { ".js": ".mjs" },
47
+ platform: "node",
48
+ logLevel: "silent",
49
+ outfile: path.resolve(this._pkgPath, "dist", "main.mjs"),
50
+ external: [
51
+ ...this._pkgConf.externals ?? []
52
+ ],
53
+ banner: {
54
+ js: `
55
+ import __path__ from 'path';
56
+ import { fileURLToPath as __fileURLToPath__ } from 'url';
57
+ import { createRequire as __createRequire__ } from 'module';
58
+
59
+ const require = __createRequire__(import.meta.url);
60
+ const __filename = __fileURLToPath__(import.meta.url);
61
+ const __dirname = __path__.dirname(__filename);`.trim()
62
+ },
63
+ plugins: [
64
+ {
65
+ name: "sd-additional",
66
+ setup: ({ onEnd, onStart }) => {
67
+ onStart(() => {
68
+ if (!isFirst) {
69
+ this.emit("change");
70
+ this._debug(`BUILD...`);
71
+ }
72
+ isFirst = false;
73
+ });
74
+
75
+ onEnd(async (result) => {
76
+ try {
77
+ const buildResults = [
78
+ ...result.warnings.map((warn) => ({
79
+ filePath: warn.location?.file !== undefined ? path.resolve(warn.location.file) : undefined,
80
+ line: warn.location?.line,
81
+ char: warn.location?.column,
82
+ code: undefined,
83
+ severity: "warning" as const,
84
+ message: warn.text
85
+ })),
86
+ ...result.errors.map((err) => ({
87
+ filePath: err.location?.file !== undefined ? path.resolve(err.location.file) : undefined,
88
+ line: err.location?.line,
89
+ char: err.location?.column !== undefined ? err.location.column + 1 : undefined,
90
+ code: undefined,
91
+ severity: "error" as const,
92
+ message: err.text
93
+ }))
94
+ ];
95
+
96
+ this._debug("CHECK...");
97
+ const checkResult = await sdTsProgram.buildAsync();
98
+
99
+ this._debug("LINT...");
100
+ const lintResults = await SdLinter.lintAsync(checkResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
101
+
102
+ this._debug(`빌드 완료`);
103
+ this.emit("complete", {
104
+ affectedFilePaths: checkResult.affectedFilePaths,
105
+ buildResults: [...buildResults, ...checkResult.results, ...lintResults]
106
+ });
107
+ }
108
+ catch (err) {
109
+ this._logger.error(err);
110
+ }
111
+ });
112
+ }
113
+ }
114
+ ]
115
+ });
116
+ await ctx.watch();
117
+ }
118
+
119
+ public async buildAsync(): Promise<ISdCliBuilderResult> {
120
+ this._debug("빌드 준비...");
121
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, false);
122
+
123
+ this._debug("dist 초기화...");
124
+ await FsUtil.removeAsync(path.resolve(this._pkgPath, "dist"));
125
+
126
+ this._debug("BUILD...");
127
+ const esbuildResult = await esbuild.build({
128
+ entryPoints: {
129
+ index: path.resolve(this._pkgPath, "src", "main.ts")
130
+ },
131
+ bundle: true,
132
+ target: "node20",
133
+ mainFields: ["es2021", "es2020", "module", "main"],
134
+ conditions: ["es2021", "es2020", "es2015", "module"],
135
+ tsconfig: path.resolve(this._pkgPath, "tsconfig.json"),
136
+ write: true,
137
+ format: "esm",
138
+ outExtension: { ".js": ".mjs" },
139
+ platform: "node",
140
+ logLevel: "silent",
141
+ outfile: path.resolve(this._pkgPath, "dist", "main.mjs"),
142
+ external: [
143
+ ...this._pkgConf.externals ?? []
144
+ ],
145
+ banner: {
146
+ js: `
147
+ import path from 'path';
148
+ import { fileURLToPath } from 'url';
149
+ import { createRequire as topLevelCreateRequire } from 'module';
150
+ const require = topLevelCreateRequire(import.meta.url);
151
+ const __filename = fileURLToPath(import.meta.url);
152
+ const __dirname = path.dirname(__filename);`.trim()
153
+ },
154
+ });
155
+
156
+ const buildResults = [
157
+ ...esbuildResult.warnings.map((warn) => ({
158
+ filePath: warn.location?.file !== undefined ? path.resolve(warn.location.file) : undefined,
159
+ line: warn.location?.line,
160
+ char: warn.location?.column,
161
+ code: undefined,
162
+ severity: "warning" as const,
163
+ message: warn.text
164
+ })),
165
+ ...esbuildResult.errors.map((err) => ({
166
+ filePath: err.location?.file !== undefined ? path.resolve(err.location.file) : undefined,
167
+ line: err.location?.line,
168
+ char: err.location?.column !== undefined ? err.location.column + 1 : undefined,
169
+ code: undefined,
170
+ severity: "warning" as const,
171
+ message: err.text
172
+ }))
173
+ ];
174
+
175
+ this._debug("CHECK...");
176
+ const checkResult = await sdTsProgram.buildAsync();
177
+
178
+ this._debug("LINT...");
179
+ const lintResults = await SdLinter.lintAsync(checkResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
180
+
181
+ this._debug(`빌드 완료`);
182
+ return {
183
+ affectedFilePaths: checkResult.affectedFilePaths,
184
+ buildResults: [...buildResults, ...checkResult.results, ...lintResults]
185
+ };
186
+ }
187
+
188
+ private _debug(msg: string): void {
189
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
190
+ }
191
+ }
@@ -0,0 +1,96 @@
1
+ import { FsUtil, Logger, SdFsWatcher } from "@simplysm/sd-core-node";
2
+ import path from "path";
3
+ import { ISdCliBuilderResult } from "../commons";
4
+ import { EventEmitter } from "events";
5
+ import { FunctionQueue } from "@simplysm/sd-core-common";
6
+ import { SdTsIncrementalBuilder } from "../SdTsIncrementalBuilder";
7
+ import { SdLinter } from "../SdLinter";
8
+
9
+ export class SdCliTsLibBuilder extends EventEmitter {
10
+ private readonly _logger = Logger.get(["simplysm", "sd-cli", "SdCliTsLibBuilder"]);
11
+
12
+ public constructor(private readonly _pkgPath: string) {
13
+ super();
14
+ }
15
+
16
+ public override on(event: "change", listener: () => void): this;
17
+ public override on(event: "complete", listener: (result: ISdCliBuilderResult) => void): this;
18
+ public override on(event: string | symbol, listener: (...args: any[]) => void): this {
19
+ super.on(event, listener);
20
+ return this;
21
+ }
22
+
23
+ public async buildAsync(): Promise<ISdCliBuilderResult> {
24
+ this._debug("빌드 준비...");
25
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, true);
26
+
27
+ this._debug("dist 초기화...");
28
+ await FsUtil.removeAsync(path.resolve(this._pkgPath, "dist"));
29
+
30
+ this._debug("BUILD...");
31
+ const buildResult = await sdTsProgram.buildAsync();
32
+
33
+
34
+ this._debug("LINT...");
35
+ const lintResults = await SdLinter.lintAsync(buildResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
36
+
37
+ this._debug(`빌드 완료`);
38
+ return {
39
+ affectedFilePaths: buildResult.affectedFilePaths,
40
+ buildResults: [...buildResult.results, ...lintResults]
41
+ };
42
+ }
43
+
44
+ public async watchAsync(): Promise<void> {
45
+ this._debug("빌드 준비...");
46
+ const sdTsProgram = await SdTsIncrementalBuilder.createAsync(this._pkgPath, true);
47
+
48
+ this._debug("dist 초기화...");
49
+ await FsUtil.removeAsync(path.resolve(this._pkgPath, "dist"));
50
+
51
+ this.emit("change");
52
+
53
+ this._debug("BUILD...");
54
+ const buildResult = await sdTsProgram.buildAsync();
55
+
56
+ this._debug("LINT...");
57
+ const lintResults = await SdLinter.lintAsync(buildResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
58
+
59
+ this._debug(`빌드 완료`);
60
+ this.emit("complete", {
61
+ affectedFilePaths: buildResult.affectedFilePaths,
62
+ buildResults: [...buildResult.results, ...lintResults]
63
+ });
64
+
65
+ this._debug("WATCH...");
66
+ const fnQ = new FunctionQueue();
67
+ SdFsWatcher
68
+ .watch([
69
+ ...sdTsProgram.builderProgram!.getSourceFiles().map((item) => item.fileName),
70
+ path.resolve(this._pkgPath, "src/**/*.{ts,tsx}")
71
+ ])
72
+ .onChange({
73
+ delay: 100
74
+ }, () => {
75
+ fnQ.runLast(async () => {
76
+ this.emit("change");
77
+
78
+ this._debug(`BUILD...`);
79
+ const watchBuildResult = await sdTsProgram.buildAsync();
80
+
81
+ this._debug(`LINT...`);
82
+ const watchLintResults = await SdLinter.lintAsync(watchBuildResult.affectedFilePaths, sdTsProgram.builderProgram!.getProgram());
83
+
84
+ this._debug(`빌드 완료`);
85
+ this.emit("complete", {
86
+ affectedFilePaths: watchBuildResult.affectedFilePaths,
87
+ buildResults: [...watchBuildResult.results, ...watchLintResults]
88
+ });
89
+ });
90
+ });
91
+ }
92
+
93
+ private _debug(msg: string): void {
94
+ this._logger.debug(`[${path.basename(this._pkgPath)}] ${msg}`);
95
+ }
96
+ }