@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.
- package/.eslintrc.cjs +18 -0
- package/dist/SdLinter.d.ts +5 -0
- package/dist/SdLinter.js.map +1 -0
- package/dist/SdLinter.mjs +37 -0
- package/dist/SdTsIncrementalBuilder.d.ts +16 -0
- package/dist/SdTsIncrementalBuilder.js.map +1 -0
- package/dist/SdTsIncrementalBuilder.mjs +54 -0
- package/dist/build-cluster.js.map +1 -0
- package/dist/build-cluster.mjs +124 -0
- package/dist/builders/SdCliClientBuilder.d.ts +13 -0
- package/dist/builders/SdCliClientBuilder.js.map +1 -0
- package/dist/builders/SdCliClientBuilder.mjs +167 -0
- package/dist/builders/SdCliJsLibLinter.d.ts +14 -0
- package/dist/builders/SdCliJsLibLinter.js.map +1 -0
- package/dist/builders/SdCliJsLibLinter.mjs +60 -0
- package/dist/builders/SdCliServerBuilder.d.ts +14 -0
- package/dist/builders/SdCliServerBuilder.js.map +1 -0
- package/dist/builders/SdCliServerBuilder.mjs +171 -0
- package/dist/builders/SdCliTsLibBuilder.d.ts +13 -0
- package/dist/builders/SdCliTsLibBuilder.js.map +1 -0
- package/dist/builders/SdCliTsLibBuilder.mjs +75 -0
- package/dist/commons.d.ts +20 -110
- package/dist/commons.js.map +1 -0
- package/dist/commons.mjs +1 -1
- package/dist/entry/SdCliProject.d.ts +29 -0
- package/dist/entry/SdCliProject.js.map +1 -0
- package/dist/entry/SdCliProject.mjs +353 -0
- package/dist/sd-cli.js.map +1 -0
- package/dist/sd-cli.mjs +119 -0
- package/dist/sd-core-common/src/decorators/NotifyPropertyChange.d.ts +20 -0
- package/dist/sd-core-common/src/decorators/NotifyPropertyChange.js.map +1 -0
- package/dist/sd-core-common/src/decorators/NotifyPropertyChange.mjs +12 -0
- package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.d.ts +43 -0
- package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.js.map +1 -0
- package/dist/sd-core-common/src/decorators/PropertyGetSetDecoratorBase.mjs +54 -0
- package/dist/sd-core-common/src/decorators/PropertyValidate.d.ts +16 -0
- package/dist/sd-core-common/src/decorators/PropertyValidate.js.map +1 -0
- package/dist/sd-core-common/src/decorators/PropertyValidate.mjs +26 -0
- package/dist/sd-core-common/src/decorators/decorator-return-types.d.ts +14 -0
- package/dist/sd-core-common/src/decorators/decorator-return-types.js.map +1 -0
- package/dist/sd-core-common/src/decorators/decorator-return-types.mjs +2 -0
- package/dist/sd-core-common/src/errors/ArgumentError.d.ts +10 -0
- package/dist/sd-core-common/src/errors/ArgumentError.js.map +1 -0
- package/dist/sd-core-common/src/errors/ArgumentError.mjs +13 -0
- package/dist/sd-core-common/src/errors/NeverEntryError.d.ts +10 -0
- package/dist/sd-core-common/src/errors/NeverEntryError.js.map +1 -0
- package/dist/sd-core-common/src/errors/NeverEntryError.mjs +13 -0
- package/dist/sd-core-common/src/errors/NotImplementError.d.ts +10 -0
- package/dist/sd-core-common/src/errors/NotImplementError.js.map +1 -0
- package/dist/sd-core-common/src/errors/NotImplementError.mjs +13 -0
- package/dist/sd-core-common/src/errors/SdError.d.ts +23 -0
- package/dist/sd-core-common/src/errors/SdError.js.map +1 -0
- package/dist/sd-core-common/src/errors/SdError.mjs +40 -0
- package/dist/sd-core-common/src/errors/TimeoutError.d.ts +11 -0
- package/dist/sd-core-common/src/errors/TimeoutError.js.map +1 -0
- package/dist/sd-core-common/src/errors/TimeoutError.mjs +16 -0
- package/dist/sd-core-common/src/extensions/ArrayExtension.d.ts +147 -0
- package/dist/sd-core-common/src/extensions/ArrayExtension.js.map +1 -0
- package/dist/sd-core-common/src/extensions/ArrayExtension.mjs +448 -0
- package/dist/sd-core-common/src/extensions/MapExtension.d.ts +4 -0
- package/dist/sd-core-common/src/extensions/MapExtension.js.map +1 -0
- package/dist/sd-core-common/src/extensions/MapExtension.mjs +15 -0
- package/dist/sd-core-common/src/extensions/SetExtension.d.ts +3 -0
- package/dist/sd-core-common/src/extensions/SetExtension.js.map +1 -0
- package/dist/sd-core-common/src/extensions/SetExtension.mjs +10 -0
- package/dist/sd-core-common/src/index.d.ts +32 -0
- package/dist/sd-core-common/src/index.js.map +1 -0
- package/dist/sd-core-common/src/index.mjs +33 -0
- package/dist/sd-core-common/src/types/DateOnly.d.ts +135 -0
- package/dist/sd-core-common/src/types/DateOnly.js.map +1 -0
- package/dist/sd-core-common/src/types/DateOnly.mjs +220 -0
- package/dist/sd-core-common/src/types/DateTime.d.ts +42 -0
- package/dist/sd-core-common/src/types/DateTime.js.map +1 -0
- package/dist/sd-core-common/src/types/DateTime.mjs +156 -0
- package/dist/sd-core-common/src/types/DeepPartial.d.ts +3 -0
- package/dist/sd-core-common/src/types/DeepPartial.js.map +1 -0
- package/dist/sd-core-common/src/types/DeepPartial.mjs +2 -0
- package/dist/sd-core-common/src/types/ObjectSet.d.ts +4 -0
- package/dist/sd-core-common/src/types/ObjectSet.js.map +1 -0
- package/dist/sd-core-common/src/types/ObjectSet.mjs +18 -0
- package/dist/sd-core-common/src/types/Time.d.ts +27 -0
- package/dist/sd-core-common/src/types/Time.js.map +1 -0
- package/dist/sd-core-common/src/types/Time.mjs +108 -0
- package/dist/sd-core-common/src/types/Type.d.ts +7 -0
- package/dist/sd-core-common/src/types/Type.js.map +1 -0
- package/dist/sd-core-common/src/types/Type.mjs +2 -0
- package/dist/sd-core-common/src/types/UnwrappedType.d.ts +1 -0
- package/dist/sd-core-common/src/types/UnwrappedType.js.map +1 -0
- package/dist/sd-core-common/src/types/UnwrappedType.mjs +2 -0
- package/dist/sd-core-common/src/types/Uuid.d.ts +8 -0
- package/dist/sd-core-common/src/types/Uuid.js.map +1 -0
- package/dist/sd-core-common/src/types/Uuid.mjs +26 -0
- package/dist/sd-core-common/src/types/WrappedType.d.ts +1 -0
- package/dist/sd-core-common/src/types/WrappedType.js.map +1 -0
- package/dist/sd-core-common/src/types/WrappedType.mjs +2 -0
- package/dist/sd-core-common/src/utils/DateTimeFormatUtil.d.ts +12 -0
- package/dist/sd-core-common/src/utils/DateTimeFormatUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/DateTimeFormatUtil.mjs +67 -0
- package/dist/sd-core-common/src/utils/FunctionQueue.d.ts +8 -0
- package/dist/sd-core-common/src/utils/FunctionQueue.js.map +1 -0
- package/dist/sd-core-common/src/utils/FunctionQueue.mjs +46 -0
- package/dist/sd-core-common/src/utils/FunctionUtil.d.ts +6 -0
- package/dist/sd-core-common/src/utils/FunctionUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/FunctionUtil.mjs +31 -0
- package/dist/sd-core-common/src/utils/JsonConvert.d.ts +8 -0
- package/dist/sd-core-common/src/utils/JsonConvert.js.map +1 -0
- package/dist/sd-core-common/src/utils/JsonConvert.mjs +78 -0
- package/dist/sd-core-common/src/utils/MathUtil.d.ts +3 -0
- package/dist/sd-core-common/src/utils/MathUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/MathUtil.mjs +6 -0
- package/dist/sd-core-common/src/utils/NumberUtil.d.ts +6 -0
- package/dist/sd-core-common/src/utils/NumberUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/NumberUtil.mjs +32 -0
- package/dist/sd-core-common/src/utils/ObjectUtil.d.ts +80 -0
- package/dist/sd-core-common/src/utils/ObjectUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/ObjectUtil.mjs +452 -0
- package/dist/sd-core-common/src/utils/SdSyncEventEmitter.d.ts +6 -0
- package/dist/sd-core-common/src/utils/SdSyncEventEmitter.js.map +1 -0
- package/dist/sd-core-common/src/utils/SdSyncEventEmitter.mjs +27 -0
- package/dist/sd-core-common/src/utils/StringUtil.d.ts +8 -0
- package/dist/sd-core-common/src/utils/StringUtil.js.map +1 -0
- package/dist/sd-core-common/src/utils/StringUtil.mjs +77 -0
- package/dist/sd-core-common/src/utils/Wait.d.ts +4 -0
- package/dist/sd-core-common/src/utils/Wait.js.map +1 -0
- package/dist/sd-core-common/src/utils/Wait.mjs +23 -0
- package/dist/sd-core-node/src/index.d.ts +6 -0
- package/dist/sd-core-node/src/index.js.map +1 -0
- package/dist/sd-core-node/src/index.mjs +7 -0
- package/dist/sd-core-node/src/utils/FsUtil.d.ts +44 -0
- package/dist/sd-core-node/src/utils/FsUtil.js.map +1 -0
- package/dist/sd-core-node/src/utils/FsUtil.mjs +493 -0
- package/dist/sd-core-node/src/utils/Logger.d.ts +91 -0
- package/dist/sd-core-node/src/utils/Logger.js.map +1 -0
- package/dist/sd-core-node/src/utils/Logger.mjs +185 -0
- package/dist/sd-core-node/src/utils/PathUtil.d.ts +6 -0
- package/dist/sd-core-node/src/utils/PathUtil.js.map +1 -0
- package/dist/sd-core-node/src/utils/PathUtil.mjs +24 -0
- package/dist/sd-core-node/src/utils/SdFsWatcher.d.ts +15 -0
- package/dist/sd-core-node/src/utils/SdFsWatcher.js.map +1 -0
- package/dist/sd-core-node/src/utils/SdFsWatcher.mjs +43 -0
- package/dist/sd-core-node/src/utils/SdProcess.d.ts +5 -0
- package/dist/sd-core-node/src/utils/SdProcess.js.map +1 -0
- package/dist/sd-core-node/src/utils/SdProcess.mjs +36 -0
- package/dist/sd-orm-common/src/CaseQueryHelper.d.ts +12 -0
- package/dist/sd-orm-common/src/CaseQueryHelper.js.map +1 -0
- package/dist/sd-orm-common/src/CaseQueryHelper.mjs +19 -0
- package/dist/sd-orm-common/src/CaseWhenQueryHelper.d.ts +12 -0
- package/dist/sd-orm-common/src/CaseWhenQueryHelper.js.map +1 -0
- package/dist/sd-orm-common/src/CaseWhenQueryHelper.mjs +20 -0
- package/dist/sd-orm-common/src/DbContext.d.ts +81 -0
- package/dist/sd-orm-common/src/DbContext.js.map +1 -0
- package/dist/sd-orm-common/src/DbContext.mjs +635 -0
- package/dist/sd-orm-common/src/IDbConnection.d.ts +15 -0
- package/dist/sd-orm-common/src/IDbConnection.js.map +1 -0
- package/dist/sd-orm-common/src/IDbConnection.mjs +2 -0
- package/dist/sd-orm-common/src/IDbContextExecutor.d.ts +17 -0
- package/dist/sd-orm-common/src/IDbContextExecutor.js.map +1 -0
- package/dist/sd-orm-common/src/IDbContextExecutor.mjs +2 -0
- package/dist/sd-orm-common/src/IDbMigration.d.ts +4 -0
- package/dist/sd-orm-common/src/IDbMigration.js.map +1 -0
- package/dist/sd-orm-common/src/IDbMigration.mjs +2 -0
- package/dist/sd-orm-common/src/QueryBuilder.d.ts +48 -0
- package/dist/sd-orm-common/src/QueryBuilder.js.map +1 -0
- package/dist/sd-orm-common/src/QueryBuilder.mjs +1022 -0
- package/dist/sd-orm-common/src/QueryHelper.d.ts +75 -0
- package/dist/sd-orm-common/src/QueryHelper.js.map +1 -0
- package/dist/sd-orm-common/src/QueryHelper.mjs +627 -0
- package/dist/sd-orm-common/src/QueryUnit.d.ts +10 -0
- package/dist/sd-orm-common/src/QueryUnit.js.map +1 -0
- package/dist/sd-orm-common/src/QueryUnit.mjs +16 -0
- package/dist/sd-orm-common/src/Queryable.d.ts +105 -0
- package/dist/sd-orm-common/src/Queryable.js.map +1 -0
- package/dist/sd-orm-common/src/Queryable.mjs +1375 -0
- package/dist/sd-orm-common/src/SdOrmDataType.d.ts +21 -0
- package/dist/sd-orm-common/src/SdOrmDataType.js.map +1 -0
- package/dist/sd-orm-common/src/SdOrmDataType.mjs +2 -0
- package/dist/sd-orm-common/src/commons.d.ts +400 -0
- package/dist/sd-orm-common/src/commons.js.map +1 -0
- package/dist/sd-orm-common/src/commons.mjs +8 -0
- package/dist/sd-orm-common/src/decorators.d.ts +29 -0
- package/dist/sd-orm-common/src/decorators.js.map +1 -0
- package/dist/sd-orm-common/src/decorators.mjs +89 -0
- package/dist/sd-orm-common/src/index.d.ts +17 -0
- package/dist/sd-orm-common/src/index.js.map +1 -0
- package/dist/sd-orm-common/src/index.mjs +18 -0
- package/dist/sd-orm-common/src/models/SystemMigration.d.ts +3 -0
- package/dist/sd-orm-common/src/models/SystemMigration.js.map +1 -0
- package/dist/sd-orm-common/src/models/SystemMigration.mjs +13 -0
- package/dist/sd-orm-common/src/utils/DbDefinitionUtil.d.ts +14 -0
- package/dist/sd-orm-common/src/utils/DbDefinitionUtil.js.map +1 -0
- package/dist/sd-orm-common/src/utils/DbDefinitionUtil.mjs +66 -0
- package/dist/sd-orm-common/src/utils/SdOrmUtil.d.ts +8 -0
- package/dist/sd-orm-common/src/utils/SdOrmUtil.js.map +1 -0
- package/dist/sd-orm-common/src/utils/SdOrmUtil.mjs +248 -0
- package/dist/sd-orm-node/src/DbConnectionFactory.d.ts +4 -0
- package/dist/sd-orm-node/src/DbConnectionFactory.js.map +1 -0
- package/dist/sd-orm-node/src/DbConnectionFactory.mjs +17 -0
- package/dist/sd-orm-node/src/NodeDbContextExecutor.d.ts +19 -0
- package/dist/sd-orm-node/src/NodeDbContextExecutor.js.map +1 -0
- package/dist/sd-orm-node/src/NodeDbContextExecutor.mjs +71 -0
- package/dist/sd-orm-node/src/SdOrm.d.ts +10 -0
- package/dist/sd-orm-node/src/SdOrm.js.map +1 -0
- package/dist/sd-orm-node/src/SdOrm.mjs +25 -0
- package/dist/sd-orm-node/src/index.d.ts +4 -0
- package/dist/sd-orm-node/src/index.js.map +1 -0
- package/dist/sd-orm-node/src/index.mjs +5 -0
- package/dist/sd-orm-node-mssql/src/MssqlDbConnection.d.ts +25 -0
- package/dist/sd-orm-node-mssql/src/MssqlDbConnection.js.map +1 -0
- package/dist/sd-orm-node-mssql/src/MssqlDbConnection.mjs +321 -0
- package/dist/sd-orm-node-mssql/src/index.d.ts +2 -0
- package/dist/sd-orm-node-mssql/src/index.js.map +1 -0
- package/dist/sd-orm-node-mssql/src/index.mjs +3 -0
- package/dist/sd-orm-node-mysql/src/MysqlDbConnection.d.ts +22 -0
- package/dist/sd-orm-node-mysql/src/MysqlDbConnection.js.map +1 -0
- package/dist/sd-orm-node-mysql/src/MysqlDbConnection.mjs +200 -0
- package/dist/sd-orm-node-mysql/src/index.d.ts +2 -0
- package/dist/sd-orm-node-mysql/src/index.js.map +1 -0
- package/dist/sd-orm-node-mysql/src/index.mjs +3 -0
- package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.d.ts +22 -0
- package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.js.map +1 -0
- package/dist/sd-orm-node-sqlite/src/SqliteDbConnection.mjs +172 -0
- package/dist/sd-orm-node-sqlite/src/index.d.ts +2 -0
- package/dist/sd-orm-node-sqlite/src/index.js.map +1 -0
- package/dist/sd-orm-node-sqlite/src/index.mjs +3 -0
- package/dist/sd-service-common/src/commons-orm.d.ts +4 -0
- package/dist/sd-service-common/src/commons-orm.js.map +1 -0
- package/dist/sd-service-common/src/commons-orm.mjs +2 -0
- package/dist/sd-service-common/src/commons-smtp.d.ts +29 -0
- package/dist/sd-service-common/src/commons-smtp.js.map +1 -0
- package/dist/sd-service-common/src/commons-smtp.mjs +2 -0
- package/dist/sd-service-common/src/commons.d.ts +57 -0
- package/dist/sd-service-common/src/commons.js.map +1 -0
- package/dist/sd-service-common/src/commons.mjs +3 -0
- package/dist/sd-service-common/src/index.d.ts +3 -0
- package/dist/sd-service-common/src/index.js.map +1 -0
- package/dist/sd-service-common/src/index.mjs +4 -0
- package/dist/sd-service-server/src/ApiServiceError.d.ts +12 -0
- package/dist/sd-service-server/src/ApiServiceError.js.map +1 -0
- package/dist/sd-service-server/src/ApiServiceError.mjs +15 -0
- package/dist/sd-service-server/src/SdServiceServer.d.ts +39 -0
- package/dist/sd-service-server/src/SdServiceServer.js.map +1 -0
- package/dist/sd-service-server/src/SdServiceServer.mjs +513 -0
- package/dist/sd-service-server/src/commons.d.ts +23 -0
- package/dist/sd-service-server/src/commons.js.map +1 -0
- package/dist/sd-service-server/src/commons.mjs +3 -0
- package/dist/sd-service-server/src/index.d.ts +8 -0
- package/dist/sd-service-server/src/index.js.map +1 -0
- package/dist/sd-service-server/src/index.mjs +9 -0
- package/dist/sd-service-server/src/services/SdAutoUpdateService.d.ts +4 -0
- package/dist/sd-service-server/src/services/SdAutoUpdateService.js.map +1 -0
- package/dist/sd-service-server/src/services/SdAutoUpdateService.mjs +20 -0
- package/dist/sd-service-server/src/services/SdCryptoService.d.ts +7 -0
- package/dist/sd-service-server/src/services/SdCryptoService.js.map +1 -0
- package/dist/sd-service-server/src/services/SdCryptoService.mjs +39 -0
- package/dist/sd-service-server/src/services/SdOrmService.d.ts +22 -0
- package/dist/sd-service-server/src/services/SdOrmService.js.map +1 -0
- package/dist/sd-service-server/src/services/SdOrmService.mjs +115 -0
- package/dist/sd-service-server/src/services/SdSmtpClientService.d.ts +6 -0
- package/dist/sd-service-server/src/services/SdSmtpClientService.js.map +1 -0
- package/dist/sd-service-server/src/services/SdSmtpClientService.mjs +44 -0
- package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.d.ts +4 -0
- package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.js.map +1 -0
- package/dist/sd-service-server/src/utils/SdServiceServerConfigUtil.mjs +36 -0
- package/dist/server-worker.d.ts +1 -0
- package/dist/server-worker.js.map +1 -0
- package/dist/server-worker.mjs +36 -0
- package/dist/utils/SdCliBuildResultUtil.d.ts +1 -4
- package/dist/utils/SdCliBuildResultUtil.js.map +1 -0
- package/dist/utils/SdCliBuildResultUtil.mjs +3 -29
- package/dist/utils/SdCliConfigUtil.js.map +1 -0
- package/dist/utils/SdCliConfigUtil.mjs +1 -1
- package/package.json +14 -56
- package/src/SdLinter.ts +41 -0
- package/src/SdTsIncrementalBuilder.ts +75 -0
- package/src/build-cluster.ts +133 -0
- package/src/builders/SdCliClientBuilder.ts +189 -0
- package/src/builders/SdCliJsLibLinter.ts +72 -0
- package/src/builders/SdCliServerBuilder.ts +191 -0
- package/src/builders/SdCliTsLibBuilder.ts +96 -0
- package/src/commons.ts +21 -112
- package/src/entry/SdCliProject.ts +467 -0
- package/src/sd-cli.ts +136 -0
- package/src/server-worker.ts +45 -0
- package/src/utils/SdCliBuildResultUtil.ts +5 -38
- package/tsconfig.json +9 -0
- package/README.md +0 -105
- package/assets/client-files/assets/icons/icon-128x128.png +0 -0
- package/assets/client-files/assets/icons/icon-144x144.png +0 -0
- package/assets/client-files/assets/icons/icon-152x152.png +0 -0
- package/assets/client-files/assets/icons/icon-192x192.png +0 -0
- package/assets/client-files/assets/icons/icon-384x384.png +0 -0
- package/assets/client-files/assets/icons/icon-512x512.png +0 -0
- package/assets/client-files/assets/icons/icon-72x72.png +0 -0
- package/assets/client-files/assets/icons/icon-96x96.png +0 -0
- package/assets/client-files/favicon.ico +0 -0
- package/dist/SdCliBuildResultError.d.ts +0 -5
- package/dist/SdCliBuildResultError.mjs +0 -8
- package/dist/bin/sd-cli.d.ts +0 -2
- package/dist/bin/sd-cli.mjs +0 -410
- package/dist/build-tool/SdCliCacheCompilerHost.d.ts +0 -10
- package/dist/build-tool/SdCliCacheCompilerHost.mjs +0 -51
- package/dist/build-tool/SdCliCordova.d.ts +0 -16
- package/dist/build-tool/SdCliCordova.mjs +0 -212
- package/dist/build-tool/SdCliElectron.d.ts +0 -9
- package/dist/build-tool/SdCliElectron.mjs +0 -72
- package/dist/build-tool/SdCliGithubApi.d.ts +0 -13
- package/dist/build-tool/SdCliGithubApi.mjs +0 -92
- package/dist/build-tool/SdCliIndexFileGenerator.d.ts +0 -13
- package/dist/build-tool/SdCliIndexFileGenerator.mjs +0 -62
- package/dist/build-tool/SdCliNgCacheCompilerHost.d.ts +0 -12
- package/dist/build-tool/SdCliNgCacheCompilerHost.mjs +0 -43
- package/dist/build-tool/SdCliPackageLinter.d.ts +0 -8
- package/dist/build-tool/SdCliPackageLinter.mjs +0 -62
- package/dist/builder/SdCliClientBuilder.d.ts +0 -26
- package/dist/builder/SdCliClientBuilder.mjs +0 -769
- package/dist/builder/SdCliJsLibBuilder.d.ts +0 -14
- package/dist/builder/SdCliJsLibBuilder.mjs +0 -54
- package/dist/builder/SdCliServerBuilder.d.ts +0 -28
- package/dist/builder/SdCliServerBuilder.mjs +0 -482
- package/dist/builder/SdCliTsLibBuilder.d.ts +0 -35
- package/dist/builder/SdCliTsLibBuilder.mjs +0 -317
- package/dist/entry-points/SdCliFileCrypto.d.ts +0 -7
- package/dist/entry-points/SdCliFileCrypto.mjs +0 -72
- package/dist/entry-points/SdCliLocalUpdate.d.ts +0 -13
- package/dist/entry-points/SdCliLocalUpdate.mjs +0 -100
- package/dist/entry-points/SdCliPrepare.d.ts +0 -5
- package/dist/entry-points/SdCliPrepare.mjs +0 -86
- package/dist/entry-points/SdCliProject.d.ts +0 -34
- package/dist/entry-points/SdCliProject.mjs +0 -416
- package/dist/entry-points/SdCliProjectGenerator.d.ts +0 -44
- package/dist/entry-points/SdCliProjectGenerator.mjs +0 -326
- package/dist/entry-points/file/base/fc_package_eslintrc.d.ts +0 -3
- package/dist/entry-points/file/base/fc_package_eslintrc.mjs +0 -31
- package/dist/entry-points/file/base/fc_package_npmconfig.d.ts +0 -9
- package/dist/entry-points/file/base/fc_package_npmconfig.mjs +0 -32
- package/dist/entry-points/file/base/fc_package_tsconfig.d.ts +0 -5
- package/dist/entry-points/file/base/fc_package_tsconfig.mjs +0 -13
- package/dist/entry-points/file/client/fc_package_AppModule.d.ts +0 -1
- package/dist/entry-points/file/client/fc_package_AppModule.mjs +0 -37
- package/dist/entry-points/file/client/fc_package_AppPage.d.ts +0 -1
- package/dist/entry-points/file/client/fc_package_AppPage.mjs +0 -14
- package/dist/entry-points/file/client/fc_package_Page.d.ts +0 -4
- package/dist/entry-points/file/client/fc_package_Page.mjs +0 -19
- package/dist/entry-points/file/client/fc_package_client_main.d.ts +0 -1
- package/dist/entry-points/file/client/fc_package_client_main.mjs +0 -19
- package/dist/entry-points/file/client/fc_package_index.d.ts +0 -3
- package/dist/entry-points/file/client/fc_package_index.mjs +0 -88
- package/dist/entry-points/file/client/fc_package_manifest.d.ts +0 -5
- package/dist/entry-points/file/client/fc_package_manifest.mjs +0 -54
- package/dist/entry-points/file/client/fc_package_polyfills.d.ts +0 -1
- package/dist/entry-points/file/client/fc_package_polyfills.mjs +0 -11
- package/dist/entry-points/file/client/fc_package_styles.d.ts +0 -1
- package/dist/entry-points/file/client/fc_package_styles.mjs +0 -7
- package/dist/entry-points/file/db/fc_package_DbContext.d.ts +0 -3
- package/dist/entry-points/file/db/fc_package_DbContext.mjs +0 -14
- package/dist/entry-points/file/db/fc_package_DbModel.d.ts +0 -4
- package/dist/entry-points/file/db/fc_package_DbModel.mjs +0 -12
- package/dist/entry-points/file/project/fc_project_editor_config.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_editor_config.mjs +0 -22
- package/dist/entry-points/file/project/fc_project_eslintrc.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_eslintrc.mjs +0 -30
- package/dist/entry-points/file/project/fc_project_gitattributes.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_gitattributes.mjs +0 -6
- package/dist/entry-points/file/project/fc_project_gitignore.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_gitignore.mjs +0 -27
- package/dist/entry-points/file/project/fc_project_npmconfig.d.ts +0 -7
- package/dist/entry-points/file/project/fc_project_npmconfig.mjs +0 -37
- package/dist/entry-points/file/project/fc_project_readme.d.ts +0 -3
- package/dist/entry-points/file/project/fc_project_readme.mjs +0 -13
- package/dist/entry-points/file/project/fc_project_simplysm.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_simplysm.mjs +0 -2
- package/dist/entry-points/file/project/fc_project_tsconfig.d.ts +0 -1
- package/dist/entry-points/file/project/fc_project_tsconfig.mjs +0 -25
- package/dist/entry-points/file/server/fc_package_server_main.d.ts +0 -5
- package/dist/entry-points/file/server/fc_package_server_main.mjs +0 -60
- package/dist/index.d.ts +0 -54
- package/dist/index.mjs +0 -55
- package/dist/ng-tools/SdCliNgModuleGenerator.d.ts +0 -29
- package/dist/ng-tools/SdCliNgModuleGenerator.mjs +0 -502
- package/dist/ng-tools/babel/SdCliBbFileMetadata.d.ts +0 -25
- package/dist/ng-tools/babel/SdCliBbFileMetadata.mjs +0 -539
- package/dist/ng-tools/babel/SdCliBbRootMetadata.d.ts +0 -23
- package/dist/ng-tools/babel/SdCliBbRootMetadata.mjs +0 -247
- package/dist/ng-tools/babel/SdCliBbUtil.d.ts +0 -5
- package/dist/ng-tools/babel/SdCliBbUtil.mjs +0 -14
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.d.ts +0 -42
- package/dist/ng-tools/babel/TSdCliBbNgMetadata.mjs +0 -216
- package/dist/ng-tools/babel/TSdCliBbTypeMetadata.d.ts +0 -55
- package/dist/ng-tools/babel/TSdCliBbTypeMetadata.mjs +0 -151
- package/dist/ng-tools/commons.d.ts +0 -9
- package/dist/ng-tools/commons.mjs +0 -2
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.d.ts +0 -61
- package/dist/ng-tools/typescript/SdCliTsFileMetadata.mjs +0 -325
- package/dist/ng-tools/typescript/SdCliTsRootMetadata.d.ts +0 -8
- package/dist/ng-tools/typescript/SdCliTsRootMetadata.mjs +0 -28
- package/dist/ng-tools/typescript/SdCliTsUtil.d.ts +0 -5
- package/dist/ng-tools/typescript/SdCliTsUtil.mjs +0 -28
- package/dist/packages/SdCliPackage.d.ts +0 -22
- package/dist/packages/SdCliPackage.mjs +0 -206
- package/dist/utils/SdCliNpmConfigUtil.d.ts +0 -7
- package/dist/utils/SdCliNpmConfigUtil.mjs +0 -15
- package/dist/worker/build-worker.mjs +0 -67
- package/dist/worker/server-worker.mjs +0 -67
- package/docs/client-add-page.md +0 -8
- package/docs/client-router.md +0 -85
- package/docs/client-sw.md +0 -101
- package/docs/conf-orm.md +0 -81
- package/docs/conf-usage.md +0 -5
- package/docs/lib-local-update.md +0 -50
- package/docs/lib-ts-paths.md +0 -25
- package/lib/cordova-entry.js +0 -22
- package/src/SdCliBuildResultError.ts +0 -9
- package/src/bin/sd-cli.ts +0 -493
- package/src/build-tool/SdCliCacheCompilerHost.ts +0 -79
- package/src/build-tool/SdCliCordova.ts +0 -263
- package/src/build-tool/SdCliElectron.ts +0 -85
- package/src/build-tool/SdCliGithubApi.ts +0 -111
- package/src/build-tool/SdCliIndexFileGenerator.ts +0 -79
- package/src/build-tool/SdCliNgCacheCompilerHost.ts +0 -58
- package/src/build-tool/SdCliPackageLinter.ts +0 -74
- package/src/builder/SdCliClientBuilder.ts +0 -879
- package/src/builder/SdCliJsLibBuilder.ts +0 -70
- package/src/builder/SdCliServerBuilder.ts +0 -552
- package/src/builder/SdCliTsLibBuilder.ts +0 -450
- package/src/entry-points/SdCliFileCrypto.ts +0 -87
- package/src/entry-points/SdCliLocalUpdate.ts +0 -121
- package/src/entry-points/SdCliPrepare.ts +0 -86
- package/src/entry-points/SdCliProject.ts +0 -491
- package/src/entry-points/SdCliProjectGenerator.ts +0 -402
- package/src/entry-points/file/base/fc_package_eslintrc.ts +0 -30
- package/src/entry-points/file/base/fc_package_npmconfig.ts +0 -43
- package/src/entry-points/file/base/fc_package_tsconfig.ts +0 -12
- package/src/entry-points/file/client/fc_package_AppModule.ts +0 -36
- package/src/entry-points/file/client/fc_package_AppPage.ts +0 -13
- package/src/entry-points/file/client/fc_package_Page.ts +0 -19
- package/src/entry-points/file/client/fc_package_client_main.ts +0 -18
- package/src/entry-points/file/client/fc_package_index.ts +0 -87
- package/src/entry-points/file/client/fc_package_manifest.ts +0 -53
- package/src/entry-points/file/client/fc_package_polyfills.ts +0 -10
- package/src/entry-points/file/client/fc_package_styles.ts +0 -6
- package/src/entry-points/file/db/fc_package_DbContext.ts +0 -14
- package/src/entry-points/file/db/fc_package_DbModel.ts +0 -11
- package/src/entry-points/file/project/fc_project_editor_config.ts +0 -21
- package/src/entry-points/file/project/fc_project_eslintrc.ts +0 -29
- package/src/entry-points/file/project/fc_project_gitattributes.ts +0 -5
- package/src/entry-points/file/project/fc_project_gitignore.ts +0 -26
- package/src/entry-points/file/project/fc_project_npmconfig.ts +0 -36
- package/src/entry-points/file/project/fc_project_readme.ts +0 -12
- package/src/entry-points/file/project/fc_project_simplysm.ts +0 -1
- package/src/entry-points/file/project/fc_project_tsconfig.ts +0 -24
- package/src/entry-points/file/server/fc_package_server_main.ts +0 -62
- package/src/index.ts +0 -54
- package/src/ng-tools/SdCliNgModuleGenerator.ts +0 -672
- package/src/ng-tools/babel/SdCliBbFileMetadata.ts +0 -629
- package/src/ng-tools/babel/SdCliBbRootMetadata.ts +0 -292
- package/src/ng-tools/babel/SdCliBbUtil.ts +0 -15
- package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +0 -251
- package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +0 -212
- package/src/ng-tools/commons.ts +0 -3
- package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +0 -384
- package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +0 -32
- package/src/ng-tools/typescript/SdCliTsUtil.ts +0 -29
- package/src/packages/SdCliPackage.ts +0 -259
- package/src/utils/SdCliNpmConfigUtil.ts +0 -16
- package/src/worker/build-worker.ts +0 -73
- package/src/worker/server-worker.ts +0 -72
- /package/dist/{worker/build-worker.d.ts → build-cluster.d.ts} +0 -0
- /package/dist/{worker/server-worker.d.ts → sd-cli.d.ts} +0 -0
package/src/commons.ts
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
export interface INpmConfig {
|
|
2
2
|
name: string;
|
|
3
3
|
version: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
author?: string;
|
|
6
|
-
license?: string;
|
|
7
|
-
repository?: {
|
|
8
|
-
type: string;
|
|
9
|
-
url: string;
|
|
10
|
-
directory?: string;
|
|
11
|
-
};
|
|
12
|
-
type?: "module";
|
|
13
4
|
workspaces?: string[];
|
|
14
|
-
main?: string;
|
|
15
|
-
types?: string;
|
|
16
|
-
exports?: Record<string, {
|
|
17
|
-
types?: string;
|
|
18
|
-
}>;
|
|
19
|
-
scripts?: Record<string, string>;
|
|
20
5
|
|
|
21
6
|
dependencies?: Record<string, string>;
|
|
22
7
|
optionalDependencies?: Record<string, string>;
|
|
@@ -25,17 +10,22 @@ export interface INpmConfig {
|
|
|
25
10
|
peerDependenciesMeta?: Record<string, { optional?: boolean }>;
|
|
26
11
|
}
|
|
27
12
|
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
export interface ISdCliBuildClusterReqMessage {
|
|
14
|
+
cmd: "watch" | "build";
|
|
15
|
+
pkgPath: string;
|
|
16
|
+
pkgConf: TSdCliPackageConfig
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ISdCliBuildClusterResMessage {
|
|
20
|
+
req: ISdCliBuildClusterReqMessage;
|
|
21
|
+
type: "change" | "complete" | "ready";
|
|
22
|
+
result?: ISdCliBuilderResult;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ISdCliBuilderResult {
|
|
26
|
+
port?: number;
|
|
27
|
+
affectedFilePaths: string[];
|
|
28
|
+
buildResults: ISdCliPackageBuildResult[];
|
|
39
29
|
}
|
|
40
30
|
|
|
41
31
|
export interface ISdCliPackageBuildResult {
|
|
@@ -43,110 +33,29 @@ export interface ISdCliPackageBuildResult {
|
|
|
43
33
|
line: number | undefined;
|
|
44
34
|
char: number | undefined;
|
|
45
35
|
code: string | undefined;
|
|
46
|
-
severity: "error" | "warning";
|
|
36
|
+
severity: "error" | "warning" | "suggestion" | "message";
|
|
47
37
|
message: string;
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
export interface ISdCliConfig {
|
|
51
41
|
packages: Record<string, TSdCliPackageConfig | undefined>;
|
|
52
|
-
localUpdates?: Record<string, string>;
|
|
53
42
|
}
|
|
54
43
|
|
|
55
44
|
export type TSdCliPackageConfig = ISdCliLibPackageConfig | ISdCliServerPackageConfig | ISdCliClientPackageConfig;
|
|
56
45
|
|
|
57
46
|
export interface ISdCliLibPackageConfig {
|
|
58
47
|
type: "library";
|
|
59
|
-
angular?: boolean;
|
|
60
|
-
autoIndex?: {
|
|
61
|
-
polyfills?: string[];
|
|
62
|
-
};
|
|
63
48
|
publish?: "npm";
|
|
64
49
|
}
|
|
65
50
|
|
|
66
51
|
export interface ISdCliServerPackageConfig {
|
|
67
52
|
type: "server";
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
pm2?: {
|
|
71
|
-
fileName?: string;
|
|
72
|
-
noInterpreter?: boolean;
|
|
73
|
-
noStartScript?: boolean;
|
|
74
|
-
config: Record<string, any>;
|
|
75
|
-
} | boolean;
|
|
76
|
-
iis?: boolean | { serverExeFilePath?: string };
|
|
77
|
-
externalNodeModules?: string[];
|
|
78
|
-
publish?: TSdCliPublishConfig;
|
|
53
|
+
externals?: string[];
|
|
54
|
+
publish?: any;
|
|
79
55
|
}
|
|
80
56
|
|
|
81
57
|
export interface ISdCliClientPackageConfig {
|
|
82
58
|
type: "client";
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
cordova?: ISdCliClientBuilderCordovaConfig;
|
|
86
|
-
electron?: ISdCliClientBuilderElectronConfig;
|
|
87
|
-
};
|
|
88
|
-
server: string | { port: number };
|
|
89
|
-
env?: Record<string, string>;
|
|
90
|
-
configs?: Record<string, any>;
|
|
91
|
-
publish?: TSdCliPublishConfig;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export type TSdCliPublishConfig =
|
|
95
|
-
ISdCliFtpPublishConfig
|
|
96
|
-
| ISdCliLocalDirectoryPublishConfig
|
|
97
|
-
| ISdCliGithubPublishConfig;
|
|
98
|
-
|
|
99
|
-
export interface ISdCliFtpPublishConfig {
|
|
100
|
-
type: "ftp" | "ftps" | "sftp";
|
|
101
|
-
host: string;
|
|
102
|
-
port?: number;
|
|
103
|
-
path: string;
|
|
104
|
-
user: string;
|
|
105
|
-
pass: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ISdCliLocalDirectoryPublishConfig {
|
|
109
|
-
type: "local-directory";
|
|
110
|
-
path: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface ISdCliGithubPublishConfig {
|
|
114
|
-
type: "github";
|
|
115
|
-
apiKey: string;
|
|
116
|
-
files: { from: string; to: string }[];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface ISdCliClientBuilderWebConfig {
|
|
120
|
-
env?: Record<string, string>;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface ISdCliClientBuilderCordovaConfig {
|
|
124
|
-
env?: Record<string, string>;
|
|
125
|
-
appId: string;
|
|
126
|
-
appName: string;
|
|
127
|
-
plugins?: string[];
|
|
128
|
-
icon?: string;
|
|
129
|
-
debug?: boolean;
|
|
130
|
-
target?: {
|
|
131
|
-
browser?: {};
|
|
132
|
-
android?: {
|
|
133
|
-
bundle?: boolean;
|
|
134
|
-
sign?: {
|
|
135
|
-
keystore: string;
|
|
136
|
-
storePassword: string;
|
|
137
|
-
alias: string;
|
|
138
|
-
password: string;
|
|
139
|
-
keystoreType: string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface ISdCliClientBuilderElectronConfig {
|
|
146
|
-
env?: Record<string, string>;
|
|
147
|
-
externalNodeModules?: string[];
|
|
148
|
-
appId: string;
|
|
149
|
-
icon?: string;
|
|
150
|
-
installerIcon?: string;
|
|
151
|
-
postinstall?: string;
|
|
59
|
+
server?: string;
|
|
60
|
+
publish?: any;
|
|
152
61
|
}
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { FsUtil, Logger, SdProcess } from "@simplysm/sd-core-node";
|
|
3
|
+
import { SdCliConfigUtil } from "../utils/SdCliConfigUtil";
|
|
4
|
+
import {
|
|
5
|
+
INpmConfig,
|
|
6
|
+
ISdCliBuildClusterReqMessage,
|
|
7
|
+
ISdCliBuildClusterResMessage,
|
|
8
|
+
ISdCliPackageBuildResult,
|
|
9
|
+
TSdCliPackageConfig
|
|
10
|
+
} from "../commons";
|
|
11
|
+
import cp from "child_process";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
import { SdCliBuildResultUtil } from "../utils/SdCliBuildResultUtil";
|
|
14
|
+
import semver from "semver";
|
|
15
|
+
import { NotImplementError, Wait } from "@simplysm/sd-core-common";
|
|
16
|
+
|
|
17
|
+
export class SdCliProject {
|
|
18
|
+
public static async watchAsync(opt: {
|
|
19
|
+
rootPath: string;
|
|
20
|
+
confFileRelPath: string;
|
|
21
|
+
optNames: string[];
|
|
22
|
+
pkgNames: string[];
|
|
23
|
+
}): Promise<void> {
|
|
24
|
+
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "watchAsync"]);
|
|
25
|
+
|
|
26
|
+
logger.debug("프로젝트 설정 가져오기...");
|
|
27
|
+
const projConf = await SdCliConfigUtil.loadConfigAsync(path.resolve(opt.rootPath, opt.confFileRelPath), false, opt.optNames);
|
|
28
|
+
|
|
29
|
+
logger.debug("프로젝트 package.json 가져오기...");
|
|
30
|
+
const projNpmConf = FsUtil.readJson(path.resolve(opt.rootPath, "package.json"));
|
|
31
|
+
|
|
32
|
+
logger.debug("패키지 목록 구성...");
|
|
33
|
+
const allPkgPaths = await projNpmConf.workspaces?.mapManyAsync(async (item) => await FsUtil.globAsync(item));
|
|
34
|
+
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
35
|
+
if (opt.pkgNames.length !== 0) {
|
|
36
|
+
pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
logger.debug("빌드 프로세스 준비...");
|
|
40
|
+
const cluster = await this._prepareClusterAsync();
|
|
41
|
+
|
|
42
|
+
logger.debug("빌드 프로세스 이벤트 준비...");
|
|
43
|
+
const resultCache = new Map<string, ISdCliPackageBuildResult[]>();
|
|
44
|
+
let busyCount = 0;
|
|
45
|
+
const serverInfoMap = new Map<string, {
|
|
46
|
+
// server
|
|
47
|
+
pkgPath?: string; // persist
|
|
48
|
+
worker?: cp.ChildProcess; // persist
|
|
49
|
+
port?: number;
|
|
50
|
+
hasChanges: boolean;
|
|
51
|
+
|
|
52
|
+
//client
|
|
53
|
+
pathProxy: Record<string, number | undefined>; // persist
|
|
54
|
+
changeFilePaths: string[];
|
|
55
|
+
}>();
|
|
56
|
+
cluster.on("message", (message: ISdCliBuildClusterResMessage) => {
|
|
57
|
+
if (message.type === "change") {
|
|
58
|
+
if (busyCount === 0) {
|
|
59
|
+
logger.log("빌드를 시작합니다...");
|
|
60
|
+
}
|
|
61
|
+
busyCount++;
|
|
62
|
+
}
|
|
63
|
+
else if (message.type === "complete") {
|
|
64
|
+
for (const affectedFilePath of message.result!.affectedFilePaths) {
|
|
65
|
+
resultCache.delete(affectedFilePath);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
for (const buildResult of message.result!.buildResults) {
|
|
69
|
+
const cacheItem = resultCache.getOrCreate(buildResult.filePath ?? "none", []);
|
|
70
|
+
cacheItem.push(buildResult);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (message.req.pkgConf.type === "server") {
|
|
74
|
+
const pkgName = path.basename(message.req.pkgPath);
|
|
75
|
+
const serverInfo = serverInfoMap.getOrCreate(pkgName, {
|
|
76
|
+
hasChanges: false,
|
|
77
|
+
pathProxy: {},
|
|
78
|
+
changeFilePaths: []
|
|
79
|
+
});
|
|
80
|
+
serverInfo.pkgPath = message.req.pkgPath;
|
|
81
|
+
serverInfo.hasChanges = true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (message.req.pkgConf.type === "client" && message.req.pkgConf.server !== undefined) {
|
|
85
|
+
const pkgName = path.basename(message.req.pkgPath);
|
|
86
|
+
const serverInfo = serverInfoMap.getOrCreate(message.req.pkgConf.server, {
|
|
87
|
+
hasChanges: false,
|
|
88
|
+
pathProxy: {},
|
|
89
|
+
changeFilePaths: []
|
|
90
|
+
});
|
|
91
|
+
serverInfo.pathProxy[pkgName] = message.result!.port;
|
|
92
|
+
serverInfo.changeFilePaths.push(...message.result!.affectedFilePaths);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setTimeout(async () => {
|
|
96
|
+
busyCount--;
|
|
97
|
+
if (busyCount === 0) {
|
|
98
|
+
for (const serverPkgName of serverInfoMap.keys()) {
|
|
99
|
+
const serverInfo = serverInfoMap.get(serverPkgName)!;
|
|
100
|
+
if (serverInfo.pkgPath !== undefined && serverInfo.hasChanges) {
|
|
101
|
+
logger.debug("서버 재시작...");
|
|
102
|
+
try {
|
|
103
|
+
const restartServerResult = await this._restartServerAsync(serverInfo.pkgPath, serverInfo.worker);
|
|
104
|
+
serverInfo.worker = restartServerResult.worker;
|
|
105
|
+
serverInfo.port = restartServerResult.port;
|
|
106
|
+
serverInfo.hasChanges = false;
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
logger.error(err);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (serverInfo.worker) {
|
|
114
|
+
logger.debug("클라이언트 설정...");
|
|
115
|
+
serverInfo.worker.send({
|
|
116
|
+
type: "setPathProxy",
|
|
117
|
+
pathProxy: serverInfo.pathProxy
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const clientPaths: string[] = [];
|
|
123
|
+
for (const serverInfo of serverInfoMap.values()) {
|
|
124
|
+
for (const proxyPath of Object.keys(serverInfo.pathProxy)) {
|
|
125
|
+
clientPaths.push(`http://localhost:${serverInfo.port}/${proxyPath}/`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (clientPaths.length > 0) {
|
|
129
|
+
logger.info("클라이언트 개발 서버 접속 주소\n" + clientPaths.join("\n"));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const buildResults = Array.from(resultCache.values()).mapMany();
|
|
133
|
+
this._logging(buildResults, logger);
|
|
134
|
+
}
|
|
135
|
+
}, 300);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
logger.debug("빌드 프로세스 명령 전송...");
|
|
140
|
+
busyCount++;
|
|
141
|
+
logger.log("빌드를 시작합니다...");
|
|
142
|
+
|
|
143
|
+
await pkgPaths.parallelAsync(async (pkgPath) => {
|
|
144
|
+
await this._runCommandAsync(cluster, "watch", pkgPath, projConf.packages[path.basename(pkgPath)]!);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
busyCount--;
|
|
148
|
+
if (busyCount === 0) {
|
|
149
|
+
const buildResults = Array.from(resultCache.values()).mapMany();
|
|
150
|
+
this._logging(buildResults, logger);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public static async buildAsync(opt: {
|
|
155
|
+
rootPath: string;
|
|
156
|
+
confFileRelPath: string;
|
|
157
|
+
optNames: string[];
|
|
158
|
+
pkgNames: string[];
|
|
159
|
+
}): Promise<void> {
|
|
160
|
+
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "buildAsync"]);
|
|
161
|
+
|
|
162
|
+
logger.debug("프로젝트 설정 가져오기...");
|
|
163
|
+
const projConf = await SdCliConfigUtil.loadConfigAsync(path.resolve(opt.rootPath, opt.confFileRelPath), false, opt.optNames);
|
|
164
|
+
|
|
165
|
+
logger.debug("프로젝트 package.json 가져오기...");
|
|
166
|
+
const projNpmConf = FsUtil.readJson(path.resolve(opt.rootPath, "package.json"));
|
|
167
|
+
|
|
168
|
+
logger.debug("패키지 목록 구성...");
|
|
169
|
+
const allPkgPaths = await projNpmConf.workspaces?.mapManyAsync(async (item) => await FsUtil.globAsync(item));
|
|
170
|
+
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
171
|
+
if (opt.pkgNames.length !== 0) {
|
|
172
|
+
pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
logger.debug("프로젝트 및 패키지 버전 설정...");
|
|
176
|
+
await this._upgradeVersionAsync(opt.rootPath, projNpmConf, allPkgPaths);
|
|
177
|
+
|
|
178
|
+
logger.debug("빌드 프로세스 준비...");
|
|
179
|
+
const cluster = await this._prepareClusterAsync();
|
|
180
|
+
|
|
181
|
+
logger.debug("빌드 프로세스 명령 전달...");
|
|
182
|
+
const results = (
|
|
183
|
+
await pkgPaths.parallelAsync(async (pkgPath) => {
|
|
184
|
+
return await this._runCommandAsync(cluster, "build", pkgPath, projConf.packages[path.basename(pkgPath)]!);
|
|
185
|
+
})
|
|
186
|
+
).mapMany();
|
|
187
|
+
|
|
188
|
+
logger.debug("빌드 프로세스 닫기...");
|
|
189
|
+
this._closeCluster(cluster);
|
|
190
|
+
|
|
191
|
+
this._logging(results, logger);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
public static async publishAsync(opt: {
|
|
195
|
+
rootPath: string;
|
|
196
|
+
noBuild: boolean;
|
|
197
|
+
confFileRelPath: string;
|
|
198
|
+
optNames: string[];
|
|
199
|
+
pkgNames: string[]
|
|
200
|
+
}): Promise<void> {
|
|
201
|
+
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "publishAsync"]);
|
|
202
|
+
|
|
203
|
+
logger.debug("프로젝트 설정 가져오기...");
|
|
204
|
+
const projConf = await SdCliConfigUtil.loadConfigAsync(path.resolve(opt.rootPath, opt.confFileRelPath), false, opt.optNames);
|
|
205
|
+
|
|
206
|
+
logger.debug("프로젝트 package.json 가져오기...");
|
|
207
|
+
const projNpmConf = FsUtil.readJson(path.resolve(opt.rootPath, "package.json"));
|
|
208
|
+
|
|
209
|
+
if (opt.noBuild) {
|
|
210
|
+
logger.warn("빌드하지 않고, 배포하는것은 상당히 위험합니다.");
|
|
211
|
+
await this._waitSecMessageAsync("프로세스를 중지하려면, 'CTRL+C'를 누르세요.", 5);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// GIT 사용중일 경우, 커밋되지 않은 수정사항이 있는지 확인
|
|
215
|
+
if (FsUtil.exists(path.resolve(process.cwd(), ".git"))) {
|
|
216
|
+
logger.debug("GIT 커밋여부 확인...");
|
|
217
|
+
const gitStatusResult = await SdProcess.spawnAsync("git status");
|
|
218
|
+
if (gitStatusResult.includes("Changes") || gitStatusResult.includes("Untracked")) {
|
|
219
|
+
throw new Error("커밋되지 않은 정보가 있습니다.\n" + gitStatusResult);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
logger.debug("패키지 목록 구성...");
|
|
224
|
+
const allPkgPaths = await projNpmConf.workspaces?.mapManyAsync(async (item) => await FsUtil.globAsync(item));
|
|
225
|
+
let pkgPaths = allPkgPaths.filter((pkgPath) => path.basename(pkgPath) in projConf.packages);
|
|
226
|
+
if (opt.pkgNames.length !== 0) {
|
|
227
|
+
pkgPaths = pkgPaths.filter((pkgPath) => opt.pkgNames.includes(path.basename(pkgPath)));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
logger.debug("프로젝트 및 패키지 버전 설정...");
|
|
231
|
+
await this._upgradeVersionAsync(opt.rootPath, projNpmConf, allPkgPaths);
|
|
232
|
+
|
|
233
|
+
// 빌드
|
|
234
|
+
if (!opt.noBuild) {
|
|
235
|
+
logger.debug("빌드 프로세스 준비...");
|
|
236
|
+
const cluster = await this._prepareClusterAsync();
|
|
237
|
+
|
|
238
|
+
logger.debug("빌드 프로세스 명령 전달...");
|
|
239
|
+
const results = (
|
|
240
|
+
await pkgPaths.parallelAsync(async (pkgPath) => {
|
|
241
|
+
return await this._runCommandAsync(cluster, "build", pkgPath, projConf.packages[path.basename(pkgPath)]!);
|
|
242
|
+
})
|
|
243
|
+
).mapMany();
|
|
244
|
+
|
|
245
|
+
logger.debug("빌드 프로세스 닫기...");
|
|
246
|
+
this._closeCluster(cluster);
|
|
247
|
+
|
|
248
|
+
this._logging(results, logger);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// GIT 사용중일경우, 새 버전 커밋 및 TAG 생성
|
|
252
|
+
if (FsUtil.exists(path.resolve(process.cwd(), ".git"))) {
|
|
253
|
+
logger.debug("새 버전 커밋 및 TAG 생성...");
|
|
254
|
+
await SdProcess.spawnAsync("git add .");
|
|
255
|
+
await SdProcess.spawnAsync(`git commit -m "v${projNpmConf.version}"`);
|
|
256
|
+
await SdProcess.spawnAsync(`git tag -a "v${projNpmConf.version}" -m "v${projNpmConf.version}"`);
|
|
257
|
+
|
|
258
|
+
logger.debug("새 버전 푸쉬...");
|
|
259
|
+
await SdProcess.spawnAsync("git push");
|
|
260
|
+
await SdProcess.spawnAsync("git push --tags");
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
logger.debug("배포 시작...");
|
|
264
|
+
await pkgPaths.parallelAsync(async (pkgPath) => {
|
|
265
|
+
const pkgName = path.basename(pkgPath);
|
|
266
|
+
const pkgConf = projConf.packages[pkgName];
|
|
267
|
+
if (pkgConf?.publish == null) return;
|
|
268
|
+
|
|
269
|
+
logger.debug(`[${pkgName}] 배포 시작...`);
|
|
270
|
+
await this._publishPkgAsync(pkgPath, pkgConf.publish);
|
|
271
|
+
logger.debug(`[${pkgName}] 배포 완료`);
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
logger.info(`모든 배포가 완료되었습니다. (v${projNpmConf.version})`);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
private static async _publishPkgAsync(pkgPath: string, pkgPubConf: TSdCliPackageConfig["publish"]): Promise<void> {
|
|
278
|
+
if (pkgPubConf === "npm") {
|
|
279
|
+
await SdProcess.spawnAsync("yarn npm publish --access public", { cwd: pkgPath });
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
throw new NotImplementError();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
private static async _waitSecMessageAsync(msg: string, sec: number): Promise<void> {
|
|
287
|
+
for (let i = sec; i > 0; i--) {
|
|
288
|
+
if (i !== sec) {
|
|
289
|
+
process.stdout.cursorTo(0);
|
|
290
|
+
}
|
|
291
|
+
process.stdout.write(`${msg} ${i}`);
|
|
292
|
+
await Wait.time(1000);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
process.stdout.cursorTo(0);
|
|
296
|
+
process.stdout.clearLine(0);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
private static async _upgradeVersionAsync(projPath: string, projNpmConf: INpmConfig, allPkgPaths: string[]): Promise<void> {
|
|
300
|
+
// 작업공간 package.json 버전 설정
|
|
301
|
+
const newVersion = semver.inc(projNpmConf.version, "patch")!;
|
|
302
|
+
projNpmConf.version = newVersion;
|
|
303
|
+
|
|
304
|
+
const pkgNames = await allPkgPaths.mapAsync(async (pkgPath) => {
|
|
305
|
+
const pkgNpmConf = await FsUtil.readJsonAsync(path.resolve(pkgPath, "package.json"));
|
|
306
|
+
return pkgNpmConf.name;
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const updateDepVersion = (deps: Record<string, string> | undefined): void => {
|
|
310
|
+
if (!deps) return;
|
|
311
|
+
for (const depName of Object.keys(deps)) {
|
|
312
|
+
if (pkgNames.includes(depName)) {
|
|
313
|
+
deps[depName] = newVersion;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
updateDepVersion(projNpmConf.dependencies);
|
|
318
|
+
updateDepVersion(projNpmConf.optionalDependencies);
|
|
319
|
+
updateDepVersion(projNpmConf.devDependencies);
|
|
320
|
+
updateDepVersion(projNpmConf.peerDependencies);
|
|
321
|
+
|
|
322
|
+
const projNpmConfFilePath = path.resolve(projPath, "package.json");
|
|
323
|
+
await FsUtil.writeJsonAsync(projNpmConfFilePath, projNpmConf, { space: 2 });
|
|
324
|
+
|
|
325
|
+
// 각 패키지 package.json 버전 설정
|
|
326
|
+
await allPkgPaths.parallelAsync(async (pkgPath) => {
|
|
327
|
+
const pkgNpmConfFilePath = path.resolve(pkgPath, "package.json");
|
|
328
|
+
const pkgNpmConf = await FsUtil.readJsonAsync(pkgNpmConfFilePath);
|
|
329
|
+
pkgNpmConf.version = newVersion;
|
|
330
|
+
|
|
331
|
+
updateDepVersion(pkgNpmConf.dependencies);
|
|
332
|
+
updateDepVersion(pkgNpmConf.optionalDependencies);
|
|
333
|
+
updateDepVersion(pkgNpmConf.devDependencies);
|
|
334
|
+
updateDepVersion(pkgNpmConf.peerDependencies);
|
|
335
|
+
|
|
336
|
+
await FsUtil.writeJsonAsync(pkgNpmConfFilePath, pkgNpmConf, { space: 2 });
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
private static _logging(buildResults: ISdCliPackageBuildResult[], logger: Logger): void {
|
|
341
|
+
const messages = buildResults.filter((item) => item.severity === "message");
|
|
342
|
+
const suggestions = buildResults.filter((item) => item.severity === "suggestion");
|
|
343
|
+
const warnings = buildResults.filter((item) => item.severity === "warning");
|
|
344
|
+
const errors = buildResults.filter((item) => item.severity === "error");
|
|
345
|
+
|
|
346
|
+
if (messages.length > 0) {
|
|
347
|
+
logger.log("\n" + messages.map((item) => SdCliBuildResultUtil.getMessage(item)).join("\n"));
|
|
348
|
+
}
|
|
349
|
+
if (suggestions.length > 0) {
|
|
350
|
+
logger.info("\n" + suggestions.map((item) => SdCliBuildResultUtil.getMessage(item)).join("\n"));
|
|
351
|
+
}
|
|
352
|
+
if (warnings.length > 0) {
|
|
353
|
+
logger.warn("\n" + warnings.map((item) => SdCliBuildResultUtil.getMessage(item)).join("\n"));
|
|
354
|
+
}
|
|
355
|
+
if (errors.length > 0) {
|
|
356
|
+
logger.error("\n" + errors.map((item) => SdCliBuildResultUtil.getMessage(item)).join("\n"));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
logger.info("모든 빌드가 완료되었습니다.");
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
private static async _prepareClusterAsync(): Promise<cp.ChildProcess> {
|
|
363
|
+
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "_runBuildClusterAsync"]);
|
|
364
|
+
|
|
365
|
+
return await new Promise<cp.ChildProcess>(async (resolve, reject) => {
|
|
366
|
+
const cluster = cp.fork(
|
|
367
|
+
fileURLToPath(await import.meta.resolve!("../build-cluster")),
|
|
368
|
+
[],
|
|
369
|
+
{
|
|
370
|
+
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
371
|
+
env: process.env
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
cluster.stdout!.pipe(process.stdout);
|
|
376
|
+
cluster.stderr!.pipe(process.stderr);
|
|
377
|
+
|
|
378
|
+
cluster.on("exit", (code) => {
|
|
379
|
+
if (code != null && code !== 0) {
|
|
380
|
+
const err = new Error(`오류와 함께 닫힘 (${code})`);
|
|
381
|
+
logger.error(err);
|
|
382
|
+
reject(err);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
cluster.on("error", (err) => {
|
|
388
|
+
logger.error(err);
|
|
389
|
+
reject(err);
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
cluster.on("message", (message) => {
|
|
393
|
+
if (message === "ready") {
|
|
394
|
+
logger.debug("빌드 클러스터 프로세스가 준비되었습니다.");
|
|
395
|
+
resolve(cluster);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
private static async _runCommandAsync(cluster: cp.ChildProcess, cmd: "watch", pkgPath: string, pkgConf: TSdCliPackageConfig): Promise<void>;
|
|
402
|
+
private static async _runCommandAsync(cluster: cp.ChildProcess, cmd: "build", pkgPath: string, pkgConf: TSdCliPackageConfig): Promise<ISdCliPackageBuildResult[]>;
|
|
403
|
+
private static async _runCommandAsync(cluster: cp.ChildProcess, cmd: "watch" | "build", pkgPath: string, pkgConf: TSdCliPackageConfig): Promise<ISdCliPackageBuildResult[] | void> {
|
|
404
|
+
return await new Promise<ISdCliPackageBuildResult[] | void>((resolve) => {
|
|
405
|
+
const cb = (message: ISdCliBuildClusterResMessage): void => {
|
|
406
|
+
if (cmd === "watch" && message.type === "ready" && message.req.cmd === cmd && message.req.pkgPath === pkgPath) {
|
|
407
|
+
cluster.off("message", cb);
|
|
408
|
+
resolve();
|
|
409
|
+
}
|
|
410
|
+
else if (cmd === "build" && message.type === "complete" && message.req.cmd === cmd && message.req.pkgPath === pkgPath) {
|
|
411
|
+
cluster.off("message", cb);
|
|
412
|
+
resolve(message.result?.buildResults);
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
cluster.on("message", cb);
|
|
416
|
+
|
|
417
|
+
cluster.send({ cmd, pkgPath, pkgConf } as ISdCliBuildClusterReqMessage);
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
private static _closeCluster(cluster: cp.ChildProcess): void {
|
|
422
|
+
cluster.kill("SIGKILL");
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
private static async _restartServerAsync(pkgPath: string, prevServerProcess?: cp.ChildProcess): Promise<{ worker: cp.ChildProcess, port: number }> {
|
|
426
|
+
const logger = Logger.get(["simplysm", "sd-cli", "SdCliProject", "_restartServerAsync"]);
|
|
427
|
+
|
|
428
|
+
if (prevServerProcess) {
|
|
429
|
+
prevServerProcess.kill("SIGKILL");
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return await new Promise<{ worker: cp.ChildProcess, port: number }>(async (resolve, reject) => {
|
|
433
|
+
const worker = cp.fork(
|
|
434
|
+
fileURLToPath(await import.meta.resolve!("../server-worker")),
|
|
435
|
+
[pkgPath],
|
|
436
|
+
{
|
|
437
|
+
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
438
|
+
env: process.env
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
worker.stdout!.pipe(process.stdout);
|
|
443
|
+
worker.stderr!.pipe(process.stderr);
|
|
444
|
+
|
|
445
|
+
worker.on("exit", (code) => {
|
|
446
|
+
if (code != null && code !== 0) {
|
|
447
|
+
const err = new Error(`오류와 함께 닫힘 (${code})`);
|
|
448
|
+
logger.error(err);
|
|
449
|
+
reject(err);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
worker.on("error", (err) => {
|
|
455
|
+
logger.error(err);
|
|
456
|
+
reject(err);
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
worker.on("message", (message: any) => {
|
|
460
|
+
if ("port" in message) {
|
|
461
|
+
logger.debug("서버가 시작되었습니다.");
|
|
462
|
+
resolve({ worker, port: message.port });
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|