@webiny/cli-core 0.0.0-unstable.dbdf5d6258 → 0.0.0-unstable.e1999482d0
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/Cli.d.ts +2 -1
- package/Cli.js +12 -11
- package/Cli.js.map +1 -1
- package/abstractions/createAbstraction.js +3 -2
- package/abstractions/createAbstraction.js.map +1 -1
- package/abstractions/features/CliCommand.d.ts +4 -0
- package/abstractions/features/CliCommand.js +2 -1
- package/abstractions/features/CliCommand.js.map +1 -1
- package/abstractions/features/ErrorHandler.js +2 -1
- package/abstractions/features/ErrorHandler.js.map +1 -1
- package/abstractions/features/GlobalCliOption.js +2 -1
- package/abstractions/features/GlobalCliOption.js.map +1 -1
- package/abstractions/features/IsCi.js +2 -1
- package/abstractions/features/IsCi.js.map +1 -1
- package/abstractions/features/index.js +0 -2
- package/abstractions/features/types.js +0 -3
- package/abstractions/index.js +0 -2
- package/abstractions/services/ArgvParserService.js +2 -1
- package/abstractions/services/ArgvParserService.js.map +1 -1
- package/abstractions/services/CliParamsService.js +2 -1
- package/abstractions/services/CliParamsService.js.map +1 -1
- package/abstractions/services/CommandsRegistryService.js +2 -1
- package/abstractions/services/CommandsRegistryService.js.map +1 -1
- package/abstractions/services/DefaultAppsService.d.ts +8 -0
- package/abstractions/services/DefaultAppsService.js +5 -0
- package/abstractions/services/DefaultAppsService.js.map +1 -0
- package/abstractions/services/GetArgvService.js +2 -1
- package/abstractions/services/GetArgvService.js.map +1 -1
- package/abstractions/services/GetCliRunnerService.js +2 -1
- package/abstractions/services/GetCliRunnerService.js.map +1 -1
- package/abstractions/services/GetIsCiService.js +2 -1
- package/abstractions/services/GetIsCiService.js.map +1 -1
- package/abstractions/services/GetProjectSdkService.js +2 -1
- package/abstractions/services/GetProjectSdkService.js.map +1 -1
- package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
- package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
- package/abstractions/services/LoggerService.js +2 -1
- package/abstractions/services/LoggerService.js.map +1 -1
- package/abstractions/services/RunCliRunnerService.js +2 -1
- package/abstractions/services/RunCliRunnerService.js.map +1 -1
- package/abstractions/services/StdioService.js +2 -1
- package/abstractions/services/StdioService.js.map +1 -1
- package/abstractions/services/UiService.js +2 -1
- package/abstractions/services/UiService.js.map +1 -1
- package/abstractions/services/index.d.ts +1 -0
- package/abstractions/services/index.js +1 -2
- package/createCliContainer.d.ts +1 -1
- package/createCliContainer.js +86 -119
- package/createCliContainer.js.map +1 -1
- package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
- package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
- package/decorators/index.d.ts +0 -1
- package/decorators/index.js +0 -3
- package/exports/cli/command.js +0 -2
- package/exports/cli.d.ts +2 -0
- package/exports/cli.js +2 -0
- package/exports/extensions.d.ts +1 -0
- package/exports/extensions.js +1 -0
- package/extensions/CliCommand.d.ts +3 -7
- package/extensions/CliCommand.js +16 -18
- package/extensions/CliCommand.js.map +1 -1
- package/extensions/CliCommandDecorator.d.ts +3 -7
- package/extensions/CliCommandDecorator.js +16 -18
- package/extensions/CliCommandDecorator.js.map +1 -1
- package/extensions/index.d.ts +2 -6
- package/extensions/index.js +5 -2
- package/extensions/index.js.map +1 -1
- package/features/AboutCommand.js +75 -86
- package/features/AboutCommand.js.map +1 -1
- package/features/BuildCommand/BuildCommand.d.ts +7 -3
- package/features/BuildCommand/BuildCommand.js +68 -37
- package/features/BuildCommand/BuildCommand.js.map +1 -1
- package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
- package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
- package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
- package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
- package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
- package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
- package/features/BuildCommand/index.js +0 -2
- package/features/ConfigCommand.js +55 -56
- package/features/ConfigCommand.js.map +1 -1
- package/features/DeployCommand/index.d.ts +20 -1
- package/features/DeployCommand/index.js +0 -3
- package/features/DepsSync/BuildDependencyTree.js +16 -21
- package/features/DepsSync/BuildDependencyTree.js.map +1 -1
- package/features/DepsSync/DependencyTree.js +108 -119
- package/features/DepsSync/DependencyTree.js.map +1 -1
- package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
- package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
- package/features/DepsSync/ListAllPackages.d.ts +1 -1
- package/features/DepsSync/ListAllPackages.js +9 -9
- package/features/DepsSync/ListAllPackages.js.map +1 -1
- package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
- package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
- package/features/DepsSync/commands/VerifyDepsCommand.js +106 -70
- package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
- package/features/DepsSync/createDependencyTree.d.ts +1 -1
- package/features/DepsSync/createDependencyTree.js +28 -18
- package/features/DepsSync/createDependencyTree.js.map +1 -1
- package/features/DepsSync/createReferenceFile.js +21 -25
- package/features/DepsSync/createReferenceFile.js.map +1 -1
- package/features/DepsSync/index.js +0 -2
- package/features/DepsSync/paths.js +3 -6
- package/features/DepsSync/paths.js.map +1 -1
- package/features/DepsSync/types.js +7 -6
- package/features/DepsSync/types.js.map +1 -1
- package/features/DisableTelemetryCommand.js +28 -25
- package/features/DisableTelemetryCommand.js.map +1 -1
- package/features/EnableTelemetryCommand.js +28 -25
- package/features/EnableTelemetryCommand.js.map +1 -1
- package/features/ExtensionCommand/ExtensionCommand.js +60 -63
- package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
- package/features/ExtensionCommand/index.js +0 -2
- package/features/IsCi/IsCi.js +14 -11
- package/features/IsCi/IsCi.js.map +1 -1
- package/features/IsCi/index.js +1 -3
- package/features/UpgradeCommand/UpgradeCommand.d.ts +29 -0
- package/features/UpgradeCommand/UpgradeCommand.js +123 -0
- package/features/UpgradeCommand/UpgradeCommand.js.map +1 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.d.ts +11 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.js +105 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -0
- package/features/UpgradeCommand/abstraction.d.ts +23 -0
- package/features/UpgradeCommand/abstraction.js +5 -0
- package/features/UpgradeCommand/abstraction.js.map +1 -0
- package/features/UpgradeCommand/feature.d.ts +4 -0
- package/features/UpgradeCommand/feature.js +13 -0
- package/features/UpgradeCommand/feature.js.map +1 -0
- package/features/UpgradeCommand/index.d.ts +2 -0
- package/features/UpgradeCommand/index.js +2 -0
- package/features/Wcp/LinkProjectCommand.js +120 -139
- package/features/Wcp/LinkProjectCommand.js.map +1 -1
- package/features/Wcp/LoginCommand.js +104 -118
- package/features/Wcp/LoginCommand.js.map +1 -1
- package/features/Wcp/LogoutCommand.js +29 -23
- package/features/Wcp/LogoutCommand.js.map +1 -1
- package/features/Wcp/WhoAmICommand.js +33 -29
- package/features/Wcp/WhoAmICommand.js.map +1 -1
- package/features/common/index.js +0 -2
- package/features/common/options.js +41 -50
- package/features/common/options.js.map +1 -1
- package/features/globalOptions/LogLevelGlobalOption.js +25 -16
- package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
- package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
- package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
- package/features/globalOptions/StackTraceGlobalOption.js +16 -15
- package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
- package/features/globalOptions/TraceGlobalOption.d.ts +5 -0
- package/features/globalOptions/TraceGlobalOption.js +22 -0
- package/features/globalOptions/TraceGlobalOption.js.map +1 -0
- package/features/globalOptions/index.d.ts +1 -0
- package/features/globalOptions/index.js +1 -2
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/index.d.ts +0 -2
- package/features/gracefulErrorHandlers/index.js +0 -4
- package/features/index.d.ts +1 -7
- package/features/index.js +1 -9
- package/features/utils/index.js +0 -2
- package/features/utils/measureDuration.js +7 -8
- package/features/utils/measureDuration.js.map +1 -1
- package/index.js +0 -2
- package/namespaces/cli.d.ts +5 -0
- package/namespaces/cli.js +7 -0
- package/namespaces/cli.js.map +1 -0
- package/package.json +37 -30
- package/services/ArgvParserService/ArgvParserService.js +27 -33
- package/services/ArgvParserService/ArgvParserService.js.map +1 -1
- package/services/ArgvParserService/index.js +0 -2
- package/services/CliParamsService/CliParamsService.js +18 -15
- package/services/CliParamsService/CliParamsService.js.map +1 -1
- package/services/CliParamsService/index.js +0 -2
- package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
- package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
- package/services/CommandsRegistryService/index.js +0 -2
- package/services/DefaultAppsService/DefaultAppsService.d.ts +5 -0
- package/services/DefaultAppsService/DefaultAppsService.js +15 -0
- package/services/DefaultAppsService/DefaultAppsService.js.map +1 -0
- package/services/DefaultAppsService/index.d.ts +1 -0
- package/services/DefaultAppsService/index.js +1 -0
- package/services/GetArgvService/GetArgvService.js +14 -11
- package/services/GetArgvService/GetArgvService.js.map +1 -1
- package/services/GetArgvService/index.js +0 -2
- package/services/GetCliRunnerService/GetCliRunnerService.js +123 -148
- package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
- package/services/GetCliRunnerService/index.js +0 -2
- package/services/GetIsCiService/GetIsCiService.js +9 -8
- package/services/GetIsCiService/GetIsCiService.js.map +1 -1
- package/services/GetIsCiService/index.js +1 -3
- package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
- package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
- package/services/GetProjectSdkService/index.js +0 -2
- package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
- package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
- package/services/GlobalOptionsRegistryService/index.js +0 -2
- package/services/LoggerService/LoggerService.js +76 -88
- package/services/LoggerService/LoggerService.js.map +1 -1
- package/services/LoggerService/index.js +0 -2
- package/services/RunCliRunnerService/RunCliRunnerService.d.ts +1 -1
- package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
- package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
- package/services/RunCliRunnerService/index.js +0 -2
- package/services/StdioService/StdioService.js +15 -14
- package/services/StdioService/StdioService.js.map +1 -1
- package/services/StdioService/index.js +0 -2
- package/services/UiService/UiService.d.ts +18 -0
- package/services/UiService/UiService.js +71 -58
- package/services/UiService/UiService.js.map +1 -1
- package/services/UiService/index.js +0 -2
- package/services/index.d.ts +1 -0
- package/services/index.js +1 -2
- package/utils/ManuallyReportedError.js +7 -6
- package/utils/ManuallyReportedError.js.map +1 -1
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js +53 -0
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js +12 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js +16 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/index.d.ts +6 -0
- package/utils/ensureSameWebinyPackageVersions/index.js +6 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js +31 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js +13 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.js +24 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.js.map +1 -0
- package/utils/suppressPunycodeWarnings.d.ts +4 -0
- package/utils/suppressPunycodeWarnings.js +7 -0
- package/utils/suppressPunycodeWarnings.js.map +1 -0
- package/abstractions/features/index.js.map +0 -1
- package/abstractions/features/types.js.map +0 -1
- package/abstractions/index.js.map +0 -1
- package/abstractions/services/index.js.map +0 -1
- package/decorators/DeployCommandWithTelemetry.d.ts +0 -11
- package/decorators/DeployCommandWithTelemetry.js +0 -91
- package/decorators/DeployCommandWithTelemetry.js.map +0 -1
- package/decorators/index.js.map +0 -1
- package/exports/cli/command.js.map +0 -1
- package/exports/cli/index.d.ts +0 -2
- package/exports/cli/index.js +0 -4
- package/exports/cli/index.js.map +0 -1
- package/features/BuildCommand/index.js.map +0 -1
- package/features/DeployCommand/DeployCommand.d.ts +0 -30
- package/features/DeployCommand/DeployCommand.js +0 -168
- package/features/DeployCommand/DeployCommand.js.map +0 -1
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +0 -20
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +0 -20
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +0 -5
- package/features/DeployCommand/deployOutputs/DeployOutput.js +0 -24
- package/features/DeployCommand/deployOutputs/DeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +0 -4
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +0 -61
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +0 -4
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +0 -44
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +0 -1
- package/features/DeployCommand/index.js.map +0 -1
- package/features/DepsSync/index.js.map +0 -1
- package/features/DestroyCommand/DestroyCommand.d.ts +0 -22
- package/features/DestroyCommand/DestroyCommand.js +0 -78
- package/features/DestroyCommand/DestroyCommand.js.map +0 -1
- package/features/DestroyCommand/index.d.ts +0 -1
- package/features/DestroyCommand/index.js +0 -3
- package/features/DestroyCommand/index.js.map +0 -1
- package/features/ExtensionCommand/index.js.map +0 -1
- package/features/InfoCommand/InfoCommand.d.ts +0 -10
- package/features/InfoCommand/InfoCommand.js +0 -64
- package/features/InfoCommand/InfoCommand.js.map +0 -1
- package/features/InfoCommand/PrintInfoForEnv.d.ts +0 -14
- package/features/InfoCommand/PrintInfoForEnv.js +0 -53
- package/features/InfoCommand/PrintInfoForEnv.js.map +0 -1
- package/features/InfoCommand/index.d.ts +0 -1
- package/features/InfoCommand/index.js +0 -3
- package/features/InfoCommand/index.js.map +0 -1
- package/features/IsCi/index.js.map +0 -1
- package/features/OpenCommand.d.ts +0 -10
- package/features/OpenCommand.js +0 -54
- package/features/OpenCommand.js.map +0 -1
- package/features/OutputCommand.d.ts +0 -12
- package/features/OutputCommand.js +0 -79
- package/features/OutputCommand.js.map +0 -1
- package/features/PulumiCommand/PulumiCommand.d.ts +0 -13
- package/features/PulumiCommand/PulumiCommand.js +0 -50
- package/features/PulumiCommand/PulumiCommand.js.map +0 -1
- package/features/PulumiCommand/index.d.ts +0 -1
- package/features/PulumiCommand/index.js +0 -3
- package/features/PulumiCommand/index.js.map +0 -1
- package/features/RefreshCommand/RefreshCommand.d.ts +0 -12
- package/features/RefreshCommand/RefreshCommand.js +0 -45
- package/features/RefreshCommand/RefreshCommand.js.map +0 -1
- package/features/RefreshCommand/index.d.ts +0 -1
- package/features/RefreshCommand/index.js +0 -3
- package/features/RefreshCommand/index.js.map +0 -1
- package/features/WatchCommand/WatchCommand.d.ts +0 -11
- package/features/WatchCommand/WatchCommand.js +0 -143
- package/features/WatchCommand/WatchCommand.js.map +0 -1
- package/features/WatchCommand/createPrefixer.d.ts +0 -2
- package/features/WatchCommand/createPrefixer.js +0 -20
- package/features/WatchCommand/createPrefixer.js.map +0 -1
- package/features/WatchCommand/getRandomColorForString.d.ts +0 -1
- package/features/WatchCommand/getRandomColorForString.js +0 -11
- package/features/WatchCommand/getRandomColorForString.js.map +0 -1
- package/features/WatchCommand/index.d.ts +0 -1
- package/features/WatchCommand/index.js +0 -3
- package/features/WatchCommand/index.js.map +0 -1
- package/features/common/index.js.map +0 -1
- package/features/globalOptions/index.js.map +0 -1
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +0 -6
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +0 -26
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +0 -1
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +0 -6
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +0 -29
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +0 -1
- package/features/gracefulErrorHandlers/index.js.map +0 -1
- package/features/index.js.map +0 -1
- package/features/utils/index.js.map +0 -1
- package/index.js.map +0 -1
- package/services/ArgvParserService/index.js.map +0 -1
- package/services/CliParamsService/index.js.map +0 -1
- package/services/CommandsRegistryService/index.js.map +0 -1
- package/services/GetArgvService/index.js.map +0 -1
- package/services/GetCliRunnerService/index.js.map +0 -1
- package/services/GetIsCiService/index.js.map +0 -1
- package/services/GetProjectSdkService/index.js.map +0 -1
- package/services/GlobalOptionsRegistryService/index.js.map +0 -1
- package/services/LoggerService/index.js.map +0 -1
- package/services/RunCliRunnerService/index.js.map +0 -1
- package/services/StdioService/index.js.map +0 -1
- package/services/UiService/index.js.map +0 -1
- package/services/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","StdioService","UiService","DeployOutput","BuildRunner","createBaseAppOptions","setTimeout","ora","open","PrintInfoForEnv","sleep","ms","DeployCommand","constructor","getProjectSdkService","uiService","stdioService","execute","projectSdk","ui","name","description","examples","params","type","array","options","default","handler","apps","length","appName","appParams","app","getApp","info","getDisplayName","deployApp","emptyLine","isCi","coreStack","getAppStackOutput","isFirstDeployment","deploymentId","success","printInfoForEnv","textBold","adminAppOutput","spinner","start","appUrl","succeed","fail","warning","stdio","build","packagesBuilder","buildApp","buildRunner","isEmpty","run","showDeploymentLogs","Boolean","preview","output","pulumiProcess","deployOutput","deployProcess","deployParams","deployCommand","abstraction","implementation","dependencies"],"sources":["DeployCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { DeployOutput } from \"./deployOutputs/DeployOutput.js\";\nimport { AppName } from \"@webiny/project\";\nimport { BuildRunner } from \"~/features/BuildCommand/buildRunners/BuildRunner.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { setTimeout } from \"node:timers/promises\";\nimport ora from \"ora\";\nimport open from \"open\";\n\n// TODO: convert to a real service.\nimport { PrintInfoForEnv } from \"~/features/InfoCommand/PrintInfoForEnv.js\";\n\nexport interface IDeployCommandParams {\n apps?: AppName[];\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n allowLocalStateFiles?: boolean;\n}\n\nexport interface IDeploySingleAppParams {\n app: AppName;\n variant?: string;\n region?: string;\n env: string;\n showDeploymentLogs?: boolean;\n build?: boolean;\n preview?: boolean;\n}\n\nconst sleep = (ms: number = 1500) => setTimeout(ms);\n\nexport class DeployCommand implements CliCommandFactory.Interface<IDeployCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface,\n private stdioService: StdioService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IDeployCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n const ui = this.uiService;\n\n return {\n name: \"deploy\",\n description: \"Deploys specified app or all apps in the project\",\n examples: [\n \"$0 deploy api --env dev\",\n \"$0 deploy core api --env dev\",\n \"$0 deploy admin --env prod\",\n \"$0 deploy --env prod\",\n \"$0 deploy\"\n ],\n params: [\n {\n name: \"apps\",\n description:\n \"Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.\",\n type: \"string\",\n array: true\n }\n ],\n options: [\n ...createBaseAppOptions(projectSdk),\n {\n name: \"build\",\n description: \"Build packages before deploying\",\n type: \"boolean\",\n default: true\n },\n {\n name: \"preview\",\n description: \"Preview the deploy instead of actually performing it\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"show-deployment-logs\",\n description: \"Print deployment logs (automatically enabled in CI environments)\",\n type: \"boolean\",\n default: false\n },\n {\n name: \"allow-local-state-files\",\n description:\n \"Allow using local Pulumi state files with production environment deployment (not recommended).\",\n type: \"boolean\"\n }\n ],\n handler: async (params: IDeployCommandParams) => {\n if (params.apps && params.apps.length > 0) {\n // Deploy specified apps\n for (const appName of params.apps) {\n const appParams: IDeploySingleAppParams = {\n ...params,\n app: appName\n };\n\n const app = await projectSdk.getApp(appName);\n ui.info(\"Deploying %s app...\", app.getDisplayName());\n await this.deployApp(appParams);\n ui.emptyLine();\n }\n } else {\n const isCi = projectSdk.isCi();\n const coreStack = await projectSdk.getAppStackOutput(\"core\");\n\n const isFirstDeployment = !isCi && !coreStack?.deploymentId;\n if (isFirstDeployment) {\n ui.info(`Looks like this is your first time deploying the project.`);\n ui.info(\n `Note that the initial deployment can take up to %s, so please be patient.`,\n \"10 minutes\"\n );\n await sleep();\n }\n\n // 3. Start deploying apps one-by-one.\n isFirstDeployment && ui.emptyLine();\n\n // Deploy all apps in the project.\n ui.info(\"Deploying %s app...\", \"Core\");\n await this.deployApp({ ...params, app: \"core\" });\n ui.emptyLine();\n\n ui.info(\"Deploying %s app...\", \"API\");\n await this.deployApp({ ...params, app: \"api\" });\n ui.emptyLine();\n ui.info(\"Deploying %s app...\", \"Admin\");\n await this.deployApp({ ...params, app: \"admin\" });\n\n if (isFirstDeployment) {\n ui.success(`Congratulations! You've just deployed a brand new project!`);\n } else {\n ui.success(`Project deployed.`);\n }\n\n const printInfoForEnv = new PrintInfoForEnv({\n getProjectSdkService: this.getProjectSdkService,\n uiService: this.uiService\n });\n\n ui.emptyLine();\n ui.textBold(\"Project Details\");\n await printInfoForEnv.execute(params);\n\n const adminAppOutput = await projectSdk.getAppStackOutput(\"admin\");\n\n if (isFirstDeployment && adminAppOutput) {\n ui.emptyLine();\n ui.info(\n \"The final step is to open the %s app in your browser and complete the installation wizard.\",\n \"Admin\"\n );\n\n const spinner = ora(`Opening Admin in your browser...`).start();\n\n try {\n await sleep(7000);\n open(adminAppOutput.appUrl as string);\n spinner.succeed(`Successfully opened Admin app in your browser.`);\n } catch {\n spinner.fail(`Failed to open Admin in your browser.`);\n\n await sleep(1000);\n ui.emptyLine();\n ui.warning(\n `Failed to open %s app in your browser. To finish the setup and start using the project, please visit %s and complete the installation wizard.`,\n \"Admin\",\n adminAppOutput.appUrl\n );\n }\n }\n }\n }\n };\n }\n\n private async deployApp(params: IDeploySingleAppParams) {\n const projectSdk = await this.getProjectSdkService.execute();\n\n const ui = this.uiService;\n const stdio = this.stdioService;\n\n if (params.build !== false) {\n const packagesBuilder = await projectSdk.buildApp(params);\n\n const buildRunner = new BuildRunner({\n stdio,\n ui,\n packagesBuilder\n });\n\n if (!buildRunner.isEmpty()) {\n await buildRunner.run();\n ui.emptyLine();\n }\n }\n\n // We always show deployment logs when doing previews.\n const showDeploymentLogs = Boolean(\n projectSdk.isCi() || params.preview || params.showDeploymentLogs\n );\n\n return await projectSdk.deployApp({\n ...params,\n output: pulumiProcess => {\n const deployOutput = new DeployOutput({\n stdio,\n ui,\n showDeploymentLogs,\n deployProcess: pulumiProcess,\n deployParams: params\n });\n\n return deployOutput.output();\n }\n });\n }\n}\n\nexport const deployCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DeployCommand,\n dependencies: [GetProjectSdkService, UiService, StdioService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,iBAAiB,EACjBC,oBAAoB,EACpBC,YAAY,EACZC,SAAS;AAEb,SAASC,YAAY;AAErB,SAASC,WAAW;AACpB,SAASC,oBAAoB;AAC7B,SAASC,UAAU,QAAQ,sBAAsB;AACjD,OAAOC,GAAG,MAAM,KAAK;AACrB,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA,SAASC,eAAe;AAuBxB,MAAMC,KAAK,GAAGA,CAACC,EAAU,GAAG,IAAI,KAAKL,UAAU,CAACK,EAAE,CAAC;AAEnD,OAAO,MAAMC,aAAa,CAA8D;EACpFC,WAAWA,CACCC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,EAC9C;IAAA,KAHUF,oBAAoD,GAApDA,oBAAoD;IAAA,KACpDC,SAA8B,GAA9BA,SAA8B;IAAA,KAC9BC,YAAoC,GAApCA,YAAoC;EAC7C;EAEH,MAAMC,OAAOA,CAAA,EAAuE;IAChF,MAAMC,UAAU,GAAG,MAAM,IAAI,CAACJ,oBAAoB,CAACG,OAAO,CAAC,CAAC;IAC5D,MAAME,EAAE,GAAG,IAAI,CAACJ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AE;MACxB,MAAMC,eAAe,GAAG,MAAMtC,UAAU,CAACuC,QAAQ,CAAClC,MAAM,CAAC;MAEzD,MAAMmC,WAAW,GAAG,IAAItD,WAAW,CAAC;QAChCkD,KAAK;QACLnC,EAAE;QACFqC;MACJ,CAAC,CAAC;MAEF,IAAI,CAACE,WAAW,CAACC,OAAO,CAAC,CAAC,EAAE;QACxB,MAAMD,WAAW,CAACE,GAAG,CAAC,CAAC;QACvBzC,EAAE,CAACmB,SAAS,CAAC,CAAC;MAClB;IACJ;;IAEA;IACA,MAAMuB,kBAAkB,GAAGC,OAAO,CAC9B5C,UAAU,CAACqB,IAAI,CAAC,CAAC,IAAIhB,MAAM,CAACwC,OAAO,IAAIxC,MAAM,CAACsC,kBAClD,CAAC;IAED,OAAO,MAAM3C,UAAU,CAACmB,SAAS,CAAC;MAC9B,GAAGd,MAAM;MACTyC,MAAM,EAAEC,aAAa,IAAI;QACrB,MAAMC,YAAY,GAAG,IAAI/D,YAAY,CAAC;UAClCmD,KAAK;UACLnC,EAAE;UACF0C,kBAAkB;UAClBM,aAAa,EAAEF,aAAa;UAC5BG,YAAY,EAAE7C;QAClB,CAAC,CAAC;QAEF,OAAO2C,YAAY,CAACF,MAAM,CAAC,CAAC;MAChC;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMK,aAAa,GAAGvE,oBAAoB,CAAC;EAC9CwE,WAAW,EAAEvE,iBAAiB;EAC9BwE,cAAc,EAAE3D,aAAa;EAC7B4D,YAAY,EAAE,CAACxE,oBAAoB,EAAEE,SAAS,EAAED,YAAY;AAChE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { UiService, StdioService } from "../../../abstractions/index.js";
|
|
2
|
-
import { IDeploySingleAppParams } from "../DeployCommand.js";
|
|
3
|
-
import { ExecaChildProcess } from "execa";
|
|
4
|
-
export type IDeployProcess = ExecaChildProcess<string>;
|
|
5
|
-
export interface IBaseDeployOutputParams {
|
|
6
|
-
deployProcess: IDeployProcess;
|
|
7
|
-
stdio: StdioService.Interface;
|
|
8
|
-
ui: UiService.Interface;
|
|
9
|
-
showDeploymentLogs: boolean;
|
|
10
|
-
deployParams: IDeploySingleAppParams;
|
|
11
|
-
}
|
|
12
|
-
export declare class BaseDeployOutput {
|
|
13
|
-
readonly deployProcess: IDeployProcess;
|
|
14
|
-
readonly stdio: StdioService.Interface;
|
|
15
|
-
readonly ui: UiService.Interface;
|
|
16
|
-
readonly showDeploymentLogs: boolean;
|
|
17
|
-
readonly deployParams: IDeploySingleAppParams;
|
|
18
|
-
constructor({ deployProcess, stdio, ui, showDeploymentLogs, deployParams }: IBaseDeployOutputParams);
|
|
19
|
-
output(): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export class BaseDeployOutput {
|
|
2
|
-
constructor({
|
|
3
|
-
deployProcess,
|
|
4
|
-
stdio,
|
|
5
|
-
ui,
|
|
6
|
-
showDeploymentLogs,
|
|
7
|
-
deployParams
|
|
8
|
-
}) {
|
|
9
|
-
this.deployProcess = deployProcess;
|
|
10
|
-
this.stdio = stdio;
|
|
11
|
-
this.ui = ui;
|
|
12
|
-
this.showDeploymentLogs = showDeploymentLogs;
|
|
13
|
-
this.deployParams = deployParams;
|
|
14
|
-
}
|
|
15
|
-
async output() {
|
|
16
|
-
throw new Error("Not implemented.");
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=BaseDeployOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseDeployOutput","constructor","deployProcess","stdio","ui","showDeploymentLogs","deployParams","output","Error"],"sources":["BaseDeployOutput.ts"],"sourcesContent":["import { UiService, StdioService } from \"~/abstractions/index.js\";\nimport { IDeploySingleAppParams } from \"../DeployCommand.js\";\nimport { ExecaChildProcess } from \"execa\";\n\nexport type IDeployProcess = ExecaChildProcess<string>;\n\nexport interface IBaseDeployOutputParams {\n deployProcess: IDeployProcess;\n stdio: StdioService.Interface;\n ui: UiService.Interface;\n showDeploymentLogs: boolean;\n deployParams: IDeploySingleAppParams;\n}\n\nexport class BaseDeployOutput {\n public readonly deployProcess: IDeployProcess;\n public readonly stdio: StdioService.Interface;\n public readonly ui: UiService.Interface;\n public readonly showDeploymentLogs: boolean;\n public readonly deployParams: IDeploySingleAppParams;\n\n public constructor({\n deployProcess,\n stdio,\n ui,\n showDeploymentLogs,\n deployParams\n }: IBaseDeployOutputParams) {\n this.deployProcess = deployProcess;\n this.stdio = stdio;\n this.ui = ui;\n this.showDeploymentLogs = showDeploymentLogs;\n this.deployParams = deployParams;\n }\n\n public async output(): Promise<void> {\n throw new Error(\"Not implemented.\");\n }\n}\n"],"mappings":"AAcA,OAAO,MAAMA,gBAAgB,CAAC;EAOnBC,WAAWA,CAAC;IACfC,aAAa;IACbC,KAAK;IACLC,EAAE;IACFC,kBAAkB;IAClBC;EACqB,CAAC,EAAE;IACxB,IAAI,CAACJ,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,kBAAkB,GAAGA,kBAAkB;IAC5C,IAAI,CAACC,YAAY,GAAGA,YAAY;EACpC;EAEA,MAAaC,MAAMA,CAAA,EAAkB;IACjC,MAAM,IAAIC,KAAK,CAAC,kBAAkB,CAAC;EACvC;AACJ","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseDeployOutput } from "./BaseDeployOutput.js";
|
|
2
|
-
import { NoDeploymentLogsDeployOutput } from "./NoDeploymentLogsDeployOutput.js";
|
|
3
|
-
import { WithDeploymentLogsDeployOutput } from "./WithDeploymentLogsDeployOutput.js";
|
|
4
|
-
export class DeployOutput extends BaseDeployOutput {
|
|
5
|
-
async output() {
|
|
6
|
-
const OutputClass = this.getOutputClass();
|
|
7
|
-
const output = new OutputClass({
|
|
8
|
-
deployProcess: this.deployProcess,
|
|
9
|
-
stdio: this.stdio,
|
|
10
|
-
ui: this.ui,
|
|
11
|
-
showDeploymentLogs: this.showDeploymentLogs,
|
|
12
|
-
deployParams: this.deployParams
|
|
13
|
-
});
|
|
14
|
-
return output.output();
|
|
15
|
-
}
|
|
16
|
-
getOutputClass() {
|
|
17
|
-
if (this.showDeploymentLogs) {
|
|
18
|
-
return WithDeploymentLogsDeployOutput;
|
|
19
|
-
}
|
|
20
|
-
return NoDeploymentLogsDeployOutput;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=DeployOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseDeployOutput","NoDeploymentLogsDeployOutput","WithDeploymentLogsDeployOutput","DeployOutput","output","OutputClass","getOutputClass","deployProcess","stdio","ui","showDeploymentLogs","deployParams"],"sources":["DeployOutput.ts"],"sourcesContent":["import { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { NoDeploymentLogsDeployOutput } from \"./NoDeploymentLogsDeployOutput.js\";\nimport { WithDeploymentLogsDeployOutput } from \"./WithDeploymentLogsDeployOutput.js\";\n\nexport class DeployOutput extends BaseDeployOutput {\n public override async output() {\n const OutputClass = this.getOutputClass();\n\n const output = new OutputClass({\n deployProcess: this.deployProcess,\n stdio: this.stdio,\n ui: this.ui,\n showDeploymentLogs: this.showDeploymentLogs,\n deployParams: this.deployParams\n });\n\n return output.output();\n }\n\n private getOutputClass() {\n if (this.showDeploymentLogs) {\n return WithDeploymentLogsDeployOutput;\n }\n\n return NoDeploymentLogsDeployOutput;\n }\n}\n"],"mappings":"AAAA,SAASA,gBAAgB;AACzB,SAASC,4BAA4B;AACrC,SAASC,8BAA8B;AAEvC,OAAO,MAAMC,YAAY,SAASH,gBAAgB,CAAC;EAC/C,MAAsBI,MAAMA,CAAA,EAAG;IAC3B,MAAMC,WAAW,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;IAEzC,MAAMF,MAAM,GAAG,IAAIC,WAAW,CAAC;MAC3BE,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,EAAE,EAAE,IAAI,CAACA,EAAE;MACXC,kBAAkB,EAAE,IAAI,CAACA,kBAAkB;MAC3CC,YAAY,EAAE,IAAI,CAACA;IACvB,CAAC,CAAC;IAEF,OAAOP,MAAM,CAACA,MAAM,CAAC,CAAC;EAC1B;EAEQE,cAAcA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACI,kBAAkB,EAAE;MACzB,OAAOR,8BAA8B;IACzC;IAEA,OAAOD,4BAA4B;EACvC;AACJ","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { measureDuration } from "../../utils/index.js";
|
|
2
|
-
import { BaseDeployOutput } from "./BaseDeployOutput.js";
|
|
3
|
-
import ora from "ora";
|
|
4
|
-
const SPINNER_MESSAGES = [[60, "Still deploying..."], [120, "Still deploying, please wait..."], [180, "Some resources take some time to become ready, please wait..."], [270, "Still deploying, please don't interrupt..."], [360, "Still deploying, please be patient..."], [450, "Still deploying, please don't interrupt..."], [540, "Still deploying, please be patient..."], [600, "Deploying for 10 minutes now, probably a couple more to go..."], [720, "Still deploying, shouldn't be much longer now..."], [840, "Looks like it's taking a bit longer than usual, please wait..."], [900, "Deploying for 15 minutes now, hopefully it's almost done..."], [1200, "Deploying for 20 minutes now, hopefully it's almost done..."]];
|
|
5
|
-
export class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
|
|
6
|
-
async output() {
|
|
7
|
-
const deployProcess = this.deployProcess;
|
|
8
|
-
const ui = this.ui;
|
|
9
|
-
const params = this.deployParams;
|
|
10
|
-
const isPreview = !!params.preview;
|
|
11
|
-
const getDeploymentDuration = measureDuration();
|
|
12
|
-
const spinner = ora(isPreview ? "Previewing deployment..." : "Deploying...");
|
|
13
|
-
|
|
14
|
-
// When showing spinner, we want to show a few messages to the user.
|
|
15
|
-
// The deployment process can take in some cases 10-15 minutes, so we want to
|
|
16
|
-
// give the user some feedback.
|
|
17
|
-
const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {
|
|
18
|
-
return setTimeout(() => {
|
|
19
|
-
spinner.text = message;
|
|
20
|
-
}, seconds * 1000);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Every second, let's add a dot to the end of the message.
|
|
24
|
-
// Once we reach three dots, we start over.
|
|
25
|
-
const threeDotsInterval = setInterval(() => {
|
|
26
|
-
const spinnerText = spinner.text;
|
|
27
|
-
if (spinnerText.endsWith("...")) {
|
|
28
|
-
spinner.text = spinnerText.substring(0, spinnerText.length - 3);
|
|
29
|
-
} else {
|
|
30
|
-
spinner.text = spinnerText + ".";
|
|
31
|
-
}
|
|
32
|
-
}, 1000);
|
|
33
|
-
try {
|
|
34
|
-
spinner.start();
|
|
35
|
-
await deployProcess;
|
|
36
|
-
if (isPreview) {
|
|
37
|
-
spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);
|
|
38
|
-
} else {
|
|
39
|
-
spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);
|
|
40
|
-
}
|
|
41
|
-
} catch (e) {
|
|
42
|
-
if (isPreview) {
|
|
43
|
-
spinner.fail("Preview failed.");
|
|
44
|
-
ui.emptyLine();
|
|
45
|
-
ui.text(e.message);
|
|
46
|
-
ui.error("Preview failed, please check the details above.");
|
|
47
|
-
} else {
|
|
48
|
-
spinner.fail("Deployment failed.");
|
|
49
|
-
ui.emptyLine();
|
|
50
|
-
ui.text(e.message);
|
|
51
|
-
ui.error("Deployment failed, please check the details above.");
|
|
52
|
-
}
|
|
53
|
-
throw e;
|
|
54
|
-
} finally {
|
|
55
|
-
spinnerMessagesTimeouts.forEach(clearTimeout);
|
|
56
|
-
clearInterval(threeDotsInterval);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=NoDeploymentLogsDeployOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["measureDuration","BaseDeployOutput","ora","SPINNER_MESSAGES","NoDeploymentLogsDeployOutput","output","deployProcess","ui","params","deployParams","isPreview","preview","getDeploymentDuration","spinner","spinnerMessagesTimeouts","map","seconds","message","setTimeout","text","threeDotsInterval","setInterval","spinnerText","endsWith","substring","length","start","succeed","e","fail","emptyLine","error","forEach","clearTimeout","clearInterval"],"sources":["NoDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport ora from \"ora\";\n\nconst SPINNER_MESSAGES: [number, string][] = [\n [60, \"Still deploying...\"],\n [120, \"Still deploying, please wait...\"],\n [180, \"Some resources take some time to become ready, please wait...\"],\n\n [270, \"Still deploying, please don't interrupt...\"],\n [360, \"Still deploying, please be patient...\"],\n [450, \"Still deploying, please don't interrupt...\"],\n [540, \"Still deploying, please be patient...\"],\n\n [600, \"Deploying for 10 minutes now, probably a couple more to go...\"],\n [720, \"Still deploying, shouldn't be much longer now...\"],\n\n [840, \"Looks like it's taking a bit longer than usual, please wait...\"],\n [900, \"Deploying for 15 minutes now, hopefully it's almost done...\"],\n\n [1200, \"Deploying for 20 minutes now, hopefully it's almost done...\"]\n];\n\nexport class NoDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n const spinner = ora(isPreview ? \"Previewing deployment...\" : \"Deploying...\");\n\n // When showing spinner, we want to show a few messages to the user.\n // The deployment process can take in some cases 10-15 minutes, so we want to\n // give the user some feedback.\n const spinnerMessagesTimeouts = SPINNER_MESSAGES.map(([seconds, message]) => {\n return setTimeout(() => {\n spinner.text = message;\n }, seconds * 1000);\n });\n\n // Every second, let's add a dot to the end of the message.\n // Once we reach three dots, we start over.\n const threeDotsInterval = setInterval(() => {\n const spinnerText = spinner.text;\n if (spinnerText.endsWith(\"...\")) {\n spinner.text = spinnerText.substring(0, spinnerText.length - 3);\n } else {\n spinner.text = spinnerText + \".\";\n }\n }, 1000);\n\n try {\n spinner.start();\n await deployProcess;\n\n if (isPreview) {\n spinner.succeed(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n spinner.succeed(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n if (isPreview) {\n spinner.fail(\"Preview failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n spinner.fail(\"Deployment failed.\");\n ui.emptyLine();\n ui.text(e.message);\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n } finally {\n spinnerMessagesTimeouts.forEach(clearTimeout);\n clearInterval(threeDotsInterval);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,OAAOC,GAAG,MAAM,KAAK;AAErB,MAAMC,gBAAoC,GAAG,CACzC,CAAC,EAAE,EAAE,oBAAoB,CAAC,EAC1B,CAAC,GAAG,EAAE,iCAAiC,CAAC,EACxC,CAAC,GAAG,EAAE,+DAA+D,CAAC,EAEtE,CAAC,GAAG,EAAE,4CAA4C,CAAC,EACnD,CAAC,GAAG,EAAE,uCAAuC,CAAC,EAC9C,CAAC,GAAG,EAAE,4CAA4C,CAAC,EACnD,CAAC,GAAG,EAAE,uCAAuC,CAAC,EAE9C,CAAC,GAAG,EAAE,+DAA+D,CAAC,EACtE,CAAC,GAAG,EAAE,kDAAkD,CAAC,EAEzD,CAAC,GAAG,EAAE,gEAAgE,CAAC,EACvE,CAAC,GAAG,EAAE,6DAA6D,CAAC,EAEpE,CAAC,IAAI,EAAE,6DAA6D,CAAC,CACxE;AAED,OAAO,MAAMC,4BAA4B,SAASH,gBAAgB,CAAC;EAC/D,MAAsBI,MAAMA,CAAA,EAAG;IAC3B,MA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SAAS,EAAE;QACXG,OAAO,CAACgB,IAAI,CAAC,iBAAiB,CAAC;QAC/BtB,EAAE,CAACuB,SAAS,CAAC,CAAC;QACdvB,EAAE,CAACY,IAAI,CAACS,CAAC,CAACX,OAAO,CAAC;QAClBV,EAAE,CAACwB,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHlB,OAAO,CAACgB,IAAI,CAAC,oBAAoB,CAAC;QAClCtB,EAAE,CAACuB,SAAS,CAAC,CAAC;QACdvB,EAAE,CAACY,IAAI,CAACS,CAAC,CAACX,OAAO,CAAC;QAClBV,EAAE,CAACwB,KAAK,CAAC,oDAAoD,CAAC;MAClE;MAEA,MAAMH,CAAC;IACX,CAAC,SAAS;MACNd,uBAAuB,CAACkB,OAAO,CAACC,YAAY,CAAC;MAC7CC,aAAa,CAACd,iBAAiB,CAAC;IACpC;EACJ;AACJ","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { measureDuration } from "../../utils/index.js";
|
|
2
|
-
import { BaseDeployOutput } from "./BaseDeployOutput.js";
|
|
3
|
-
import { PulumiError } from "@webiny/pulumi-sdk";
|
|
4
|
-
export class WithDeploymentLogsDeployOutput extends BaseDeployOutput {
|
|
5
|
-
async output() {
|
|
6
|
-
const deployProcess = this.deployProcess;
|
|
7
|
-
const ui = this.ui;
|
|
8
|
-
const stdio = this.stdio;
|
|
9
|
-
const params = this.deployParams;
|
|
10
|
-
const isPreview = !!params.preview;
|
|
11
|
-
const getDeploymentDuration = measureDuration();
|
|
12
|
-
try {
|
|
13
|
-
if (isPreview) {
|
|
14
|
-
ui.info(`Previewing deployment for %s app...`, params.app);
|
|
15
|
-
} else {
|
|
16
|
-
ui.info(`Deploying %s app...`, params.app);
|
|
17
|
-
}
|
|
18
|
-
ui.emptyLine();
|
|
19
|
-
this.deployProcess.stdout.pipe(stdio.getStdout());
|
|
20
|
-
this.deployProcess.stderr.pipe(stdio.getStderr());
|
|
21
|
-
await deployProcess;
|
|
22
|
-
if (isPreview) {
|
|
23
|
-
ui.success(`Preview completed in ${getDeploymentDuration()}.`);
|
|
24
|
-
} else {
|
|
25
|
-
ui.success(`Deployed in ${getDeploymentDuration()}.`);
|
|
26
|
-
}
|
|
27
|
-
} catch (e) {
|
|
28
|
-
// If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.
|
|
29
|
-
if (e instanceof PulumiError) {
|
|
30
|
-
// Do nothing.
|
|
31
|
-
} else {
|
|
32
|
-
ui.text(e.message);
|
|
33
|
-
}
|
|
34
|
-
if (isPreview) {
|
|
35
|
-
ui.error("Preview failed, please check the details above.");
|
|
36
|
-
} else {
|
|
37
|
-
ui.error("Deployment failed, please check the details above.");
|
|
38
|
-
}
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=WithDeploymentLogsDeployOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["measureDuration","BaseDeployOutput","PulumiError","WithDeploymentLogsDeployOutput","output","deployProcess","ui","stdio","params","deployParams","isPreview","preview","getDeploymentDuration","info","app","emptyLine","stdout","pipe","getStdout","stderr","getStderr","success","e","text","message","error"],"sources":["WithDeploymentLogsDeployOutput.ts"],"sourcesContent":["import { measureDuration } from \"~/features/utils/index.js\";\nimport { BaseDeployOutput } from \"./BaseDeployOutput.js\";\nimport { PulumiError } from \"@webiny/pulumi-sdk\";\n\nexport class WithDeploymentLogsDeployOutput extends BaseDeployOutput {\n public override async output() {\n const deployProcess = this.deployProcess;\n const ui = this.ui;\n const stdio = this.stdio;\n const params = this.deployParams;\n\n const isPreview = !!params.preview;\n\n const getDeploymentDuration = measureDuration();\n\n try {\n if (isPreview) {\n ui.info(`Previewing deployment for %s app...`, params.app);\n } else {\n ui.info(`Deploying %s app...`, params.app);\n }\n\n ui.emptyLine();\n\n this.deployProcess.stdout!.pipe(stdio.getStdout());\n this.deployProcess.stderr!.pipe(stdio.getStderr());\n await deployProcess;\n\n if (isPreview) {\n ui.success(`Preview completed in ${getDeploymentDuration()}.`);\n } else {\n ui.success(`Deployed in ${getDeploymentDuration()}.`);\n }\n } catch (e) {\n // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.\n if (e instanceof PulumiError) {\n // Do nothing.\n } else {\n ui.text(e.message);\n }\n\n if (isPreview) {\n ui.error(\"Preview failed, please check the details above.\");\n } else {\n ui.error(\"Deployment failed, please check the details above.\");\n }\n\n throw e;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,OAAO,MAAMC,8BAA8B,SAASF,gBAAgB,CAAC;EACjE,MAAsBG,MAAMA,CAAA,EAAG;IAC3B,MAAMC,aAAa,GAAG,IAAI,CAACA,aAAa;IACxC,MAAMC,EAAE,GAAG,IAAI,CAACA,EAAE;IAClB,MAAMC,KAAK,GAAG,IAAI,CAACA,KAAK;IACxB,MAAMC,MAAM,GAAG,IAAI,CAACC,YAAY;IAEhC,MAAMC,SAAS,GAAG,CAAC,CAACF,MAAM,CAACG,OAAO;IAElC,MAAMC,qBAAqB,GAAGZ,eAAe,CAAC,CAAC;IAE/C,IAAI;MACA,IAAIU,SAAS,EAAE;QACXJ,EAAE,CAACO,IAAI,CAAC,qCAAqC,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9D,CAAC,MAAM;QACHR,EAAE,CAACO,IAAI,CAAC,qBAAqB,EAAEL,MAAM,CAACM,GAAG,CAAC;MAC9C;MAEAR,EAAE,CAACS,SAAS,CAAC,CAAC;MAEd,IAAI,CAACV,aAAa,CAACW,MAAM,CAAEC,IAAI,CAACV,KAAK,CAACW,SAAS,CAAC,CAAC,CAAC;MAClD,IAAI,CAACb,aAAa,CAACc,MAAM,CAAEF,IAAI,CAACV,KAAK,CAACa,SAAS,CAAC,CAAC,CAAC;MAClD,MAAMf,aAAa;MAEnB,IAAIK,SAAS,EAAE;QACXJ,EAAE,CAACe,OAAO,CAAC,wBAAwBT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MAClE,CAAC,MAAM;QACHN,EAAE,CAACe,OAAO,CAAC,eAAeT,qBAAqB,CAAC,CAAC,GAAG,CAAC;MACzD;IACJ,CAAC,CAAC,OAAOU,CAAC,EAAE;MACR;MACA,IAAIA,CAAC,YAAYpB,WAAW,EAAE;QAC1B;MAAA,CACH,MAAM;QACHI,EAAE,CAACiB,IAAI,CAACD,CAAC,CAACE,OAAO,CAAC;MACtB;MAEA,IAAId,SAAS,EAAE;QACXJ,EAAE,CAACmB,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHnB,EAAE,CAACmB,KAAK,CAAC,oDAAoD,CAAC;MAClE;MAEA,MAAMH,CAAC;IACX;EACJ;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DeployCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./commands/SyncDepsCommand.js\";\nexport * from \"./commands/VerifyDepsCommand.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
|
|
2
|
-
import { AppName } from "@webiny/project";
|
|
3
|
-
export interface IDestroyNoAppParams {
|
|
4
|
-
variant?: string;
|
|
5
|
-
region?: string;
|
|
6
|
-
env: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IDestroyWithAppParams extends IDestroyNoAppParams {
|
|
9
|
-
app: AppName;
|
|
10
|
-
build?: boolean;
|
|
11
|
-
preview?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export type IDestroyCommandParams = IDestroyNoAppParams | IDestroyWithAppParams;
|
|
14
|
-
export declare class DestroyCommand implements CliCommandFactory.Interface<IDestroyCommandParams> {
|
|
15
|
-
private getProjectSdkService;
|
|
16
|
-
private uiService;
|
|
17
|
-
private stdioService;
|
|
18
|
-
constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface, stdioService: StdioService.Interface);
|
|
19
|
-
execute(): Promise<CliCommandFactory.CommandDefinition<IDestroyCommandParams>>;
|
|
20
|
-
private destroyApp;
|
|
21
|
-
}
|
|
22
|
-
export declare const destroyCommand: import("@webiny/di").Implementation<typeof DestroyCommand>;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { createImplementation } from "@webiny/di";
|
|
2
|
-
import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
|
|
3
|
-
import { measureDuration } from "../utils/index.js";
|
|
4
|
-
import { createBaseAppOptions } from "../common/index.js";
|
|
5
|
-
import { PulumiError } from "@webiny/pulumi-sdk";
|
|
6
|
-
export class DestroyCommand {
|
|
7
|
-
constructor(getProjectSdkService, uiService, stdioService) {
|
|
8
|
-
this.getProjectSdkService = getProjectSdkService;
|
|
9
|
-
this.uiService = uiService;
|
|
10
|
-
this.stdioService = stdioService;
|
|
11
|
-
}
|
|
12
|
-
async execute() {
|
|
13
|
-
const projectSdk = await this.getProjectSdkService.execute();
|
|
14
|
-
return {
|
|
15
|
-
name: "destroy",
|
|
16
|
-
description: "Destroys specified app or all apps in the project",
|
|
17
|
-
examples: ["$0 destroy api --env dev", "$0 destroy admin --env prod", "$0 destroy --env prod", "$0 destroy"],
|
|
18
|
-
params: [{
|
|
19
|
-
name: "app",
|
|
20
|
-
description: "Name of the app (core, admin, or api)",
|
|
21
|
-
type: "string"
|
|
22
|
-
}],
|
|
23
|
-
options: createBaseAppOptions(projectSdk),
|
|
24
|
-
handler: async params => {
|
|
25
|
-
if ("app" in params) {
|
|
26
|
-
return this.destroyApp(params);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Destroy all apps in the project.
|
|
30
|
-
await this.destroyApp({
|
|
31
|
-
...params,
|
|
32
|
-
app: "admin"
|
|
33
|
-
});
|
|
34
|
-
await this.destroyApp({
|
|
35
|
-
...params,
|
|
36
|
-
app: "api"
|
|
37
|
-
});
|
|
38
|
-
await this.destroyApp({
|
|
39
|
-
...params,
|
|
40
|
-
app: "core"
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
async destroyApp(params) {
|
|
46
|
-
const projectSdk = await this.getProjectSdkService.execute();
|
|
47
|
-
const ui = this.uiService;
|
|
48
|
-
const stdio = this.stdioService;
|
|
49
|
-
const {
|
|
50
|
-
pulumiProcess
|
|
51
|
-
} = await projectSdk.destroyApp(params);
|
|
52
|
-
const getDestroyDuration = measureDuration();
|
|
53
|
-
try {
|
|
54
|
-
ui.info(`Destroying %s app...`, params.app);
|
|
55
|
-
ui.emptyLine();
|
|
56
|
-
pulumiProcess.stdout.pipe(stdio.getStdout());
|
|
57
|
-
pulumiProcess.stderr.pipe(stdio.getStderr());
|
|
58
|
-
await pulumiProcess;
|
|
59
|
-
ui.success(`Destroyed in ${getDestroyDuration()}.`);
|
|
60
|
-
} catch (e) {
|
|
61
|
-
// If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.
|
|
62
|
-
if (e instanceof PulumiError) {
|
|
63
|
-
ui.error("Destroy failed, please check the details above.");
|
|
64
|
-
} else {
|
|
65
|
-
ui.text(e.message);
|
|
66
|
-
ui.error("Destroy failed, please check the details above.");
|
|
67
|
-
}
|
|
68
|
-
throw e;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export const destroyCommand = createImplementation({
|
|
73
|
-
abstraction: CliCommandFactory,
|
|
74
|
-
implementation: DestroyCommand,
|
|
75
|
-
dependencies: [GetProjectSdkService, UiService, StdioService]
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=DestroyCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","StdioService","UiService","measureDuration","createBaseAppOptions","PulumiError","DestroyCommand","constructor","getProjectSdkService","uiService","stdioService","execute","projectSdk","name","description","examples","params","type","options","handler","destroyApp","app","ui","stdio","pulumiProcess","getDestroyDuration","info","emptyLine","stdout","pipe","getStdout","stderr","getStderr","success","e","error","text","message","destroyCommand","abstraction","implementation","dependencies"],"sources":["DestroyCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { measureDuration } from \"~/features/utils/index.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { PulumiError } from \"@webiny/pulumi-sdk\";\nimport { AppName } from \"@webiny/project\";\n\nexport interface IDestroyNoAppParams {\n variant?: string;\n region?: string;\n env: string;\n}\n\nexport interface IDestroyWithAppParams extends IDestroyNoAppParams {\n app: AppName;\n build?: boolean;\n preview?: boolean;\n}\n\nexport type IDestroyCommandParams = IDestroyNoAppParams | IDestroyWithAppParams;\n\nexport class DestroyCommand implements CliCommandFactory.Interface<IDestroyCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface,\n private stdioService: StdioService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IDestroyCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"destroy\",\n description: \"Destroys specified app or all apps in the project\",\n examples: [\n \"$0 destroy api --env dev\",\n \"$0 destroy admin --env prod\",\n \"$0 destroy --env prod\",\n \"$0 destroy\"\n ],\n params: [\n {\n name: \"app\",\n description: \"Name of the app (core, admin, or api)\",\n type: \"string\"\n }\n ],\n options: createBaseAppOptions(projectSdk),\n handler: async (params: IDestroyCommandParams) => {\n if (\"app\" in params) {\n return this.destroyApp(params);\n }\n\n // Destroy all apps in the project.\n await this.destroyApp({ ...params, app: \"admin\" });\n await this.destroyApp({ ...params, app: \"api\" });\n await this.destroyApp({ ...params, app: \"core\" });\n }\n };\n }\n\n private async destroyApp(params: IDestroyWithAppParams) {\n const projectSdk = await this.getProjectSdkService.execute();\n const ui = this.uiService;\n const stdio = this.stdioService;\n\n const { pulumiProcess } = await projectSdk.destroyApp(params);\n\n const getDestroyDuration = measureDuration();\n\n try {\n ui.info(`Destroying %s app...`, params.app);\n\n ui.emptyLine();\n\n pulumiProcess.stdout!.pipe(stdio.getStdout());\n pulumiProcess.stderr!.pipe(stdio.getStderr());\n await pulumiProcess;\n\n ui.success(`Destroyed in ${getDestroyDuration()}.`);\n } catch (e) {\n // If Pulumi error, we don't need to show the error message, as it will be shown by Pulumi.\n if (e instanceof PulumiError) {\n ui.error(\"Destroy failed, please check the details above.\");\n } else {\n ui.text(e.message);\n ui.error(\"Destroy failed, please check the details above.\");\n }\n\n throw e;\n }\n }\n}\n\nexport const destroyCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DestroyCommand,\n dependencies: [GetProjectSdkService, UiService, StdioService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,iBAAiB,EACjBC,oBAAoB,EACpBC,YAAY,EACZC,SAAS;AAEb,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,WAAW,QAAQ,oBAAoB;AAiBhD,OAAO,MAAMC,cAAc,CAA+D;EACtFC,WAAWA,CACCC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,EAC9C;IAAA,KAHUF,oBAAoD,GAApDA,oBAAoD;IAAA,KACpDC,SAA8B,GAA9BA,SAA8B;IAAA,KAC9BC,YAAoC,GAApCA,YAAoC;EAC7C;EAEH,MAAMC,OAAOA,CAAA,EAAwE;IACjF,MAAMC,UAAU,GAAG,MAAM,IAAI,CAACJ,oBAAoB,CAACG,OAAO,CAAC,CAAC;IAE5D,OAAO;MACHE,IAAI,EAAE,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CAACO,SAAS,CAAC,CAAC,CAAC;MAC7CN,aAAa,CAACO,MAAM,CAAEF,IAAI,CAACN,KAAK,CAACS,SAAS,CAAC,CAAC,CAAC;MAC7C,MAAMR,aAAa;MAEnBF,EAAE,CAACW,OAAO,CAAC,gBAAgBR,kBAAkB,CAAC,CAAC,GAAG,CAAC;IACvD,CAAC,CAAC,OAAOS,CAAC,EAAE;MACR;MACA,IAAIA,CAAC,YAAY7B,WAAW,EAAE;QAC1BiB,EAAE,CAACa,KAAK,CAAC,iDAAiD,CAAC;MAC/D,CAAC,MAAM;QACHb,EAAE,CAACc,IAAI,CAACF,CAAC,CAACG,OAAO,CAAC;QAClBf,EAAE,CAACa,KAAK,CAAC,iDAAiD,CAAC;MAC/D;MAEA,MAAMD,CAAC;IACX;EACJ;AACJ;AAEA,OAAO,MAAMI,cAAc,GAAGxC,oBAAoB,CAAC;EAC/CyC,WAAW,EAAExC,iBAAiB;EAC9ByC,cAAc,EAAElC,cAAc;EAC9BmC,YAAY,EAAE,CAACzC,oBAAoB,EAAEE,SAAS,EAAED,YAAY;AAChE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DestroyCommand.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DestroyCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ExtensionCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CliCommandFactory, GetProjectSdkService, UiService } from "../../abstractions/index.js";
|
|
2
|
-
import { IBaseAppParams } from "../../abstractions/features/types.js";
|
|
3
|
-
export type IInfoCommandParams = Omit<IBaseAppParams, "app">;
|
|
4
|
-
export declare class InfoCommand implements CliCommandFactory.Interface<IInfoCommandParams> {
|
|
5
|
-
private getProjectSdkService;
|
|
6
|
-
private uiService;
|
|
7
|
-
constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface);
|
|
8
|
-
execute(): Promise<CliCommandFactory.CommandDefinition<IInfoCommandParams>>;
|
|
9
|
-
}
|
|
10
|
-
export declare const infoCommand: import("@webiny/di").Implementation<typeof InfoCommand>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { createImplementation } from "@webiny/di";
|
|
2
|
-
import { CliCommandFactory, GetProjectSdkService, UiService } from "../../abstractions/index.js";
|
|
3
|
-
import { PrintInfoForEnv } from "./PrintInfoForEnv.js";
|
|
4
|
-
import { createBaseAppOptions } from "../common/index.js";
|
|
5
|
-
export class InfoCommand {
|
|
6
|
-
constructor(getProjectSdkService, uiService) {
|
|
7
|
-
this.getProjectSdkService = getProjectSdkService;
|
|
8
|
-
this.uiService = uiService;
|
|
9
|
-
}
|
|
10
|
-
async execute() {
|
|
11
|
-
const projectSdk = await this.getProjectSdkService.execute();
|
|
12
|
-
return {
|
|
13
|
-
name: "info",
|
|
14
|
-
description: "Lists relevant URLs for your Webiny project",
|
|
15
|
-
options: createBaseAppOptions(projectSdk),
|
|
16
|
-
handler: async params => {
|
|
17
|
-
const ui = this.uiService;
|
|
18
|
-
const printInfoForEnv = new PrintInfoForEnv({
|
|
19
|
-
getProjectSdkService: this.getProjectSdkService,
|
|
20
|
-
uiService: this.uiService
|
|
21
|
-
});
|
|
22
|
-
if (params.env) {
|
|
23
|
-
await printInfoForEnv.execute({
|
|
24
|
-
env: params.env,
|
|
25
|
-
variant: params.variant
|
|
26
|
-
});
|
|
27
|
-
ui.emptyLine();
|
|
28
|
-
} else {
|
|
29
|
-
const existingEnvs = await projectSdk.listDeployedEnvironments();
|
|
30
|
-
if (existingEnvs.length === 0) {
|
|
31
|
-
ui.info("It seems that no environments have been deployed yet. Please deploy the project first.");
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (existingEnvs.length === 1) {
|
|
35
|
-
ui.info("There is one deployed environment.");
|
|
36
|
-
ui.info("Here is the information for the environment.");
|
|
37
|
-
} else {
|
|
38
|
-
ui.info("There's a total of %d deployed environments.", existingEnvs.length);
|
|
39
|
-
ui.info("Here is the information for each environment.");
|
|
40
|
-
console.log();
|
|
41
|
-
}
|
|
42
|
-
for (const {
|
|
43
|
-
env,
|
|
44
|
-
variant
|
|
45
|
-
} of existingEnvs) {
|
|
46
|
-
await printInfoForEnv.execute({
|
|
47
|
-
env,
|
|
48
|
-
variant
|
|
49
|
-
});
|
|
50
|
-
ui.emptyLine();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
ui.info("If some of the information is missing for a particular environment, make sure that the project has been fully deployed into that environment. You can do that by running the %s command.", "yarn webiny deploy --env {ENVIRONMENT_NAME}");
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export const infoCommand = createImplementation({
|
|
59
|
-
abstraction: CliCommandFactory,
|
|
60
|
-
implementation: InfoCommand,
|
|
61
|
-
dependencies: [GetProjectSdkService, UiService]
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=InfoCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","CliCommandFactory","GetProjectSdkService","UiService","PrintInfoForEnv","createBaseAppOptions","InfoCommand","constructor","getProjectSdkService","uiService","execute","projectSdk","name","description","options","handler","params","ui","printInfoForEnv","env","variant","emptyLine","existingEnvs","listDeployedEnvironments","length","info","console","log","infoCommand","abstraction","implementation","dependencies"],"sources":["InfoCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport { IBaseAppParams } from \"~/abstractions/features/types.js\";\nimport { PrintInfoForEnv } from \"./PrintInfoForEnv.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\n\nexport type IInfoCommandParams = Omit<IBaseAppParams, \"app\">;\n\nexport class InfoCommand implements CliCommandFactory.Interface<IInfoCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IInfoCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"info\",\n description: \"Lists relevant URLs for your Webiny project\",\n options: createBaseAppOptions(projectSdk),\n handler: async params => {\n const ui = this.uiService;\n\n const printInfoForEnv = new PrintInfoForEnv({\n getProjectSdkService: this.getProjectSdkService,\n uiService: this.uiService\n });\n\n if (params.env) {\n await printInfoForEnv.execute({ env: params.env, variant: params.variant });\n ui.emptyLine();\n } else {\n const existingEnvs = await projectSdk.listDeployedEnvironments();\n\n if (existingEnvs.length === 0) {\n ui.info(\n \"It seems that no environments have been deployed yet. Please deploy the project first.\"\n );\n return;\n }\n\n if (existingEnvs.length === 1) {\n ui.info(\"There is one deployed environment.\");\n ui.info(\"Here is the information for the environment.\");\n } else {\n ui.info(\n \"There's a total of %d deployed environments.\",\n existingEnvs.length\n );\n ui.info(\"Here is the information for each environment.\");\n console.log();\n }\n\n for (const { env, variant } of existingEnvs) {\n await printInfoForEnv.execute({ env, variant });\n ui.emptyLine();\n }\n }\n\n ui.info(\n \"If some of the information is missing for a particular environment, make sure that the project has been fully deployed into that environment. You can do that by running the %s command.\",\n \"yarn webiny deploy --env {ENVIRONMENT_NAME}\"\n );\n }\n };\n }\n}\n\nexport const infoCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: InfoCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,EAAEC,oBAAoB,EAAEC,SAAS;AAE3D,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAI7B,OAAO,MAAMC,WAAW,CAA4D;EAChFC,WAAWA,CACCC,oBAAoD,EACpDC,SAA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,CAAC;UACjB;UAEA,KAAK,MAAM;YAAER,GAAG;YAAEC;UAAQ,CAAC,IAAIE,YAAY,EAAE;YACzC,MAAMJ,eAAe,CAACR,OAAO,CAAC;cAAES,GAAG;cAAEC;YAAQ,CAAC,CAAC;YAC/CH,EAAE,CAACI,SAAS,CAAC,CAAC;UAClB;QACJ;QAEAJ,EAAE,CAACQ,IAAI,CACH,0LAA0L,EAC1L,6CACJ,CAAC;MACL;IACJ,CAAC;EACL;AACJ;AAEA,OAAO,MAAMG,WAAW,GAAG5B,oBAAoB,CAAC;EAC5C6B,WAAW,EAAE5B,iBAAiB;EAC9B6B,cAAc,EAAExB,WAAW;EAC3ByB,YAAY,EAAE,CAAC7B,oBAAoB,EAAEC,SAAS;AAClD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { GetProjectSdkService, UiService } from "../../abstractions/index.js";
|
|
2
|
-
export interface IPrintInfoForEnvParams {
|
|
3
|
-
env: string;
|
|
4
|
-
variant?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface IPrintInfoForEnvDi {
|
|
7
|
-
getProjectSdkService: GetProjectSdkService.Interface;
|
|
8
|
-
uiService: UiService.Interface;
|
|
9
|
-
}
|
|
10
|
-
export declare class PrintInfoForEnv {
|
|
11
|
-
private di;
|
|
12
|
-
constructor(di: IPrintInfoForEnvDi);
|
|
13
|
-
execute(params: IPrintInfoForEnvParams): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
export class PrintInfoForEnv {
|
|
3
|
-
constructor(di) {
|
|
4
|
-
this.di = di;
|
|
5
|
-
}
|
|
6
|
-
async execute(params) {
|
|
7
|
-
if (typeof params !== "object" || !params.env) {
|
|
8
|
-
throw new Error("Please provide an object with `env` and `variant` properties.");
|
|
9
|
-
}
|
|
10
|
-
const {
|
|
11
|
-
getProjectSdkService,
|
|
12
|
-
uiService
|
|
13
|
-
} = this.di;
|
|
14
|
-
const projectSdk = await getProjectSdkService.execute();
|
|
15
|
-
const ui = uiService;
|
|
16
|
-
const {
|
|
17
|
-
env,
|
|
18
|
-
variant
|
|
19
|
-
} = params;
|
|
20
|
-
const projectId = await projectSdk.getProjectId();
|
|
21
|
-
const resourcePrefix = await projectSdk.getPulumiResourceNamePrefix();
|
|
22
|
-
const api = await projectSdk.getAppStackOutput("api");
|
|
23
|
-
const admin = await projectSdk.getAppStackOutput("admin");
|
|
24
|
-
const outputs = [api, admin];
|
|
25
|
-
const stacksDeployedCount = outputs.filter(Boolean).length;
|
|
26
|
-
if (stacksDeployedCount === 0) {
|
|
27
|
-
const variantMessage = variant ? ` and variant ${variant}` : "";
|
|
28
|
-
ui.info([`It seems none of the stacks were deployed, so no info could be provided.`, `Please check if the provided environment %s is correct.`].join(" "), `${env}${variantMessage}`);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const output = [];
|
|
32
|
-
|
|
33
|
-
// Project info.
|
|
34
|
-
output.push(`‣ Project ID: ${projectId ? chalk.blue(projectId) : "-"}`, `‣ Resource prefix: ${chalk.blue(resourcePrefix)}`);
|
|
35
|
-
|
|
36
|
-
// API.
|
|
37
|
-
if (api) {
|
|
38
|
-
output.push(`‣ Environment name: ${chalk.blue(env)}`, `‣ Environment variant name: ${variant ? chalk.blue(variant) : "-"}`, `‣ AWS region: ${api?.region}`, `‣ Main GraphQL API: ${api.apiUrl + "/graphql"}`, `‣ Headless CMS GraphQL API:`, ` · Manage API: ${api.apiUrl + "/cms/manage"}`, ` · Read API: ${api.apiUrl + "/cms/read"}`, ` · Preview API: ${api.apiUrl + "/cms/preview"}`);
|
|
39
|
-
} else {
|
|
40
|
-
output.push(`‣ Environment name: -`, `‣ Environment variant name: -`, `‣ AWS region: -`, `‣ Main GraphQL API: -`, `‣ Headless CMS GraphQL API:`, ` · Manage API: -`, ` · Read API: -`, ` · Preview API: -`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Admin.
|
|
44
|
-
if (admin && admin.appUrl) {
|
|
45
|
-
output.push(`‣ Admin app: ${admin.appUrl}`);
|
|
46
|
-
} else {
|
|
47
|
-
output.push(`‣ Admin app: -`);
|
|
48
|
-
}
|
|
49
|
-
ui.text(output.join("\n"));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=PrintInfoForEnv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["chalk","PrintInfoForEnv","constructor","di","execute","params","env","Error","getProjectSdkService","uiService","projectSdk","ui","variant","projectId","getProjectId","resourcePrefix","getPulumiResourceNamePrefix","api","getAppStackOutput","admin","outputs","stacksDeployedCount","filter","Boolean","length","variantMessage","info","join","output","push","blue","region","apiUrl","appUrl","text"],"sources":["PrintInfoForEnv.ts"],"sourcesContent":["import { GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport chalk from \"chalk\";\n\nexport interface IPrintInfoForEnvParams {\n env: string;\n variant?: string;\n}\n\nexport interface IPrintInfoForEnvDi {\n getProjectSdkService: GetProjectSdkService.Interface;\n uiService: UiService.Interface;\n}\n\nexport class PrintInfoForEnv {\n constructor(private di: IPrintInfoForEnvDi) {}\n\n async execute(params: IPrintInfoForEnvParams) {\n if (typeof params !== \"object\" || !params.env) {\n throw new Error(\"Please provide an object with `env` and `variant` properties.\");\n }\n\n const { getProjectSdkService, uiService } = this.di;\n\n const projectSdk = await getProjectSdkService.execute();\n const ui = uiService;\n\n const { env, variant } = params;\n\n const projectId = await projectSdk.getProjectId();\n const resourcePrefix = await projectSdk.getPulumiResourceNamePrefix();\n\n const api = await projectSdk.getAppStackOutput(\"api\");\n\n const admin = await projectSdk.getAppStackOutput(\"admin\");\n\n const outputs = [api, admin];\n\n const stacksDeployedCount = outputs.filter(Boolean).length;\n\n if (stacksDeployedCount === 0) {\n const variantMessage = variant ? ` and variant ${variant}` : \"\";\n ui.info(\n [\n `It seems none of the stacks were deployed, so no info could be provided.`,\n `Please check if the provided environment %s is correct.`\n ].join(\" \"),\n `${env}${variantMessage}`\n );\n return;\n }\n\n const output = [];\n\n // Project info.\n output.push(\n `‣ Project ID: ${projectId ? chalk.blue(projectId) : \"-\"}`,\n `‣ Resource prefix: ${chalk.blue(resourcePrefix)}`\n );\n\n // API.\n if (api) {\n output.push(\n `‣ Environment name: ${chalk.blue(env)}`,\n `‣ Environment variant name: ${variant ? chalk.blue(variant) : \"-\"}`,\n `‣ AWS region: ${api?.region}`,\n `‣ Main GraphQL API: ${api.apiUrl + \"/graphql\"}`,\n `‣ Headless CMS GraphQL API:`,\n ` · Manage API: ${api.apiUrl + \"/cms/manage\"}`,\n ` · Read API: ${api.apiUrl + \"/cms/read\"}`,\n ` · Preview API: ${api.apiUrl + \"/cms/preview\"}`\n );\n } else {\n output.push(\n `‣ Environment name: -`,\n `‣ Environment variant name: -`,\n `‣ AWS region: -`,\n `‣ Main GraphQL API: -`,\n `‣ Headless CMS GraphQL API:`,\n ` · Manage API: -`,\n ` · Read API: -`,\n ` · Preview API: -`\n );\n }\n\n // Admin.\n if (admin && admin.appUrl) {\n output.push(`‣ Admin app: ${admin.appUrl}`);\n } else {\n output.push(`‣ Admin app: -`);\n }\n\n ui.text(output.join(\"\\n\"));\n }\n}\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAYzB,OAAO,MAAMC,eAAe,CAAC;EACzBC,WAAWA,CAASC,EAAsB,EAAE;IAAA,KAAxBA,EAAsB,GAAtBA,EAAsB;EAAG;EAE7C,MAAMC,OAAOA,CAACC,MAA8B,EAAE;IAC1C,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAACA,MAAM,CAACC,GAAG,EAAE;MAC3C,MAAM,IAAIC,KAAK,CAAC,+DAA+D,CAAC;IACpF;IAEA,MAAM;MAAEC,oBAAoB;MAAEC;IAAU,CAAC,GAAG,IAAI,CAACN,EAAE;IAEnD,MAAMO,UAAU,GAAG,MAAMF,oBAAoB,CAAC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,EAAEc,MAAM,EAAE,EAC9B,uBAAuBd,GAAG,CAACe,MAAM,GAAG,UAAU,EAAE,EAChD,6BAA6B,EAC7B,oBAAoBf,GAAG,CAACe,MAAM,GAAG,aAAa,EAAE,EAChD,kBAAkBf,GAAG,CAACe,MAAM,GAAG,WAAW,EAAE,EAC5C,qBAAqBf,GAAG,CAACe,MAAM,GAAG,cAAc,EACpD,CAAC;IACL,CAAC,MAAM;MACHJ,MAAM,CAACC,IAAI,CACP,uBAAuB,EACvB,+BAA+B,EAC/B,iBAAiB,EACjB,uBAAuB,EACvB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,qBACJ,CAAC;IACL;;IAEA;IACA,IAAIV,KAAK,IAAIA,KAAK,CAACc,MAAM,EAAE;MACvBL,MAAM,CAACC,IAAI,CAAC,gBAAgBV,KAAK,CAACc,MAAM,EAAE,CAAC;IAC/C,CAAC,MAAM;MACHL,MAAM,CAACC,IAAI,CAAC,gBAAgB,CAAC;IACjC;IAEAlB,EAAE,CAACuB,IAAI,CAACN,MAAM,CAACD,IAAI,CAAC,IAAI,CAAC,CAAC;EAC9B;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./InfoCommand.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./InfoCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isCi","DefaultIsCi"],"sources":["index.ts"],"sourcesContent":["export { isCi, DefaultIsCi } from \"./IsCi.js\";\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,WAAW","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CliCommandFactory, GetProjectSdkService, UiService } from "../abstractions/index.js";
|
|
2
|
-
import { IBaseAppParams } from "../abstractions/features/types.js";
|
|
3
|
-
export type IOpenCommandParams = Omit<IBaseAppParams, "app">;
|
|
4
|
-
export declare class OpenCommand implements CliCommandFactory.Interface<IOpenCommandParams> {
|
|
5
|
-
private getProjectSdkService;
|
|
6
|
-
private uiService;
|
|
7
|
-
constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface);
|
|
8
|
-
execute(): Promise<CliCommandFactory.CommandDefinition<IOpenCommandParams>>;
|
|
9
|
-
}
|
|
10
|
-
export declare const openCommand: import("@webiny/di").Implementation<typeof OpenCommand>;
|