@webiny/cli-core 6.3.0 → 6.4.0-beta.0
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.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.js +2 -4
- 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/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.js +0 -2
- package/createCliContainer.js +87 -113
- package/createCliContainer.js.map +1 -1
- package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
- package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
- package/decorators/DeployCommandWithTelemetry.js +72 -82
- package/decorators/DeployCommandWithTelemetry.js.map +1 -1
- package/decorators/index.js +0 -2
- package/exports/cli/command.js +0 -2
- package/exports/cli.js +0 -2
- package/extensions/CliCommand.js +15 -18
- package/extensions/CliCommand.js.map +1 -1
- package/extensions/CliCommandDecorator.js +15 -18
- package/extensions/CliCommandDecorator.js.map +1 -1
- package/extensions/index.js +5 -2
- package/extensions/index.js.map +1 -1
- package/features/AboutCommand.js +80 -86
- package/features/AboutCommand.js.map +1 -1
- package/features/BuildCommand/BuildCommand.js +46 -36
- 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/DeployCommand.js +162 -156
- package/features/DeployCommand/DeployCommand.js.map +1 -1
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +12 -17
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/DeployOutput.js +16 -17
- package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +89 -54
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +24 -37
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -1
- package/features/DeployCommand/index.js +0 -2
- package/features/DepsSync/BuildDependencyTree.js +16 -21
- package/features/DepsSync/BuildDependencyTree.js.map +1 -1
- package/features/DepsSync/DependencyTree.js +108 -126
- 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.js +7 -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 +69 -70
- package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
- package/features/DepsSync/createDependencyTree.js +25 -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/DestroyCommand/DestroyCommand.js +71 -67
- package/features/DestroyCommand/DestroyCommand.js.map +1 -1
- package/features/DestroyCommand/index.js +0 -2
- 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/InfoCommand/InfoCommand.js +54 -56
- package/features/InfoCommand/InfoCommand.js.map +1 -1
- package/features/InfoCommand/PrintInfoForEnv.js +31 -47
- package/features/InfoCommand/PrintInfoForEnv.js.map +1 -1
- package/features/InfoCommand/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/OpenCommand.js +48 -47
- package/features/OpenCommand.js.map +1 -1
- package/features/OutputCommand.js +56 -69
- package/features/OutputCommand.js.map +1 -1
- package/features/PulumiCommand/PulumiCommand.js +48 -41
- package/features/PulumiCommand/PulumiCommand.js.map +1 -1
- package/features/PulumiCommand/index.js +0 -2
- package/features/RefreshCommand/RefreshCommand.js +42 -36
- package/features/RefreshCommand/RefreshCommand.js.map +1 -1
- package/features/RefreshCommand/index.js +0 -2
- package/features/UpgradeCommand/UpgradeCommand.js +112 -101
- package/features/UpgradeCommand/UpgradeCommand.js.map +1 -1
- package/features/UpgradeCommand/UpgradeCommandHandler.js +90 -101
- package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -1
- package/features/UpgradeCommand/abstraction.js +2 -1
- package/features/UpgradeCommand/abstraction.js.map +1 -1
- package/features/UpgradeCommand/feature.js +7 -6
- package/features/UpgradeCommand/feature.js.map +1 -1
- package/features/UpgradeCommand/index.js +0 -2
- package/features/WatchCommand/WatchCommand.js +131 -131
- package/features/WatchCommand/WatchCommand.js.map +1 -1
- package/features/WatchCommand/createPrefixer.js +11 -15
- package/features/WatchCommand/createPrefixer.js.map +1 -1
- package/features/WatchCommand/getRandomColorForString.js +86 -8
- package/features/WatchCommand/getRandomColorForString.js.map +1 -1
- package/features/WatchCommand/index.js +0 -2
- package/features/Wcp/LinkProjectCommand.js +119 -138
- 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/index.js +0 -2
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +17 -16
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +19 -19
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/index.js +0 -2
- package/features/index.js +0 -2
- 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/package.json +10 -10
- 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/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 +119 -155
- 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 +75 -87
- package/services/LoggerService/LoggerService.js.map +1 -1
- package/services/LoggerService/index.js +0 -2
- 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.js +55 -58
- package/services/UiService/UiService.js.map +1 -1
- package/services/UiService/index.js +0 -2
- package/services/index.js +0 -2
- package/utils/ManuallyReportedError.js +7 -6
- package/utils/ManuallyReportedError.js.map +1 -1
- 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/index.js.map +0 -1
- package/exports/cli/command.js.map +0 -1
- package/exports/cli.js.map +0 -1
- package/features/BuildCommand/index.js.map +0 -1
- package/features/DeployCommand/index.js.map +0 -1
- package/features/DepsSync/index.js.map +0 -1
- package/features/DestroyCommand/index.js.map +0 -1
- package/features/ExtensionCommand/index.js.map +0 -1
- package/features/InfoCommand/index.js.map +0 -1
- package/features/IsCi/index.js.map +0 -1
- package/features/PulumiCommand/index.js.map +0 -1
- package/features/RefreshCommand/index.js.map +0 -1
- package/features/UpgradeCommand/index.js.map +0 -1
- 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/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 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/commands/VerifyDepsCommand.js","sources":["../../../../src/features/DepsSync/commands/VerifyDepsCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { getDuplicatesFilePath, getReferencesFilePath } from \"../paths.js\";\nimport fs from \"fs\";\nimport { createDependencyTree } from \"../createDependencyTree.js\";\nimport type { IDependencyCollection } from \"~/features/DepsSync/types.js\";\n\nexport class VerifyDepsCommand implements CliCommandFactory.Interface<unknown> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n return {\n name: \"verify-dependencies\",\n description: \"Verify dependencies for all packages.\",\n examples: [\"$0 verify-dependencies\"],\n handler: async () => {\n const ui = this.uiService;\n const projectSdk = await this.getProjectSdkService.execute();\n const project = projectSdk.getProject();\n const referencesFile = getReferencesFilePath(project);\n const duplicatesFile = getDuplicatesFilePath(project);\n\n const tree = createDependencyTree(project);\n\n const references: IDependencyCollection = {\n dependencies: tree.dependencies,\n devDependencies: tree.devDependencies,\n peerDependencies: tree.peerDependencies,\n resolutions: tree.resolutions,\n references: tree.references\n };\n\n ui.info(\"Checking references file...\");\n\n if (fs.existsSync(referencesFile)) {\n const json = loadJsonFileSync<IDependencyCollection>(referencesFile)!;\n if (JSON.stringify(references) !== JSON.stringify(json)) {\n for (const type in references) {\n const refDependencies = references[type as keyof typeof references];\n const fileDependencies = json[type as keyof typeof json];\n for (const dep in refDependencies) {\n const refDep = refDependencies[dep];\n const fileDep = fileDependencies[dep];\n if (!fileDep) {\n console.log(\"Missing dependency:\", refDep.name, \"in\", type);\n continue;\n }\n if (JSON.stringify(refDep) !== JSON.stringify(fileDep)) {\n console.log(\"Mismatch in dependency:\", refDep.name, \"in\", type);\n console.log({\n refDep: JSON.stringify(refDep),\n fileDep: JSON.stringify(fileDep)\n });\n }\n }\n }\n throw new Error(\n \"References are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n } else {\n throw new Error(\n \"References file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"Checking duplicates file...\");\n\n if (fs.existsSync(duplicatesFile)) {\n const json = loadJsonFileSync(duplicatesFile);\n if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) {\n throw new Error(\n \"Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n } else if (Array.isArray(json) && json.length > 0) {\n throw new Error(\n \"There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.\"\n );\n }\n } else {\n throw new Error(\n \"Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"✅ All package reference files are in sync.\");\n }\n };\n }\n}\n\nexport const verifyDepsCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: VerifyDepsCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"names":["VerifyDepsCommand","getProjectSdkService","uiService","ui","projectSdk","project","referencesFile","getReferencesFilePath","duplicatesFile","getDuplicatesFilePath","tree","createDependencyTree","references","fs","json","loadJsonFileSync","JSON","type","refDependencies","fileDependencies","dep","refDep","fileDep","console","Error","Array","verifyDepsCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService"],"mappings":";;;;;;AAQO,MAAMA;IACT,YACYC,oBAAoD,EACpDC,SAA8B,CACxC;aAFUD,oBAAoB,GAApBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,OAAO;YACH,MAAM;YACN,aAAa;YACb,UAAU;gBAAC;aAAyB;YACpC,SAAS;gBACL,MAAMC,KAAK,IAAI,CAAC,SAAS;gBACzB,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;gBAC1D,MAAMC,UAAUD,WAAW,UAAU;gBACrC,MAAME,iBAAiBC,sBAAsBF;gBAC7C,MAAMG,iBAAiBC,sBAAsBJ;gBAE7C,MAAMK,OAAOC,qBAAqBN;gBAElC,MAAMO,aAAoC;oBACtC,cAAcF,KAAK,YAAY;oBAC/B,iBAAiBA,KAAK,eAAe;oBACrC,kBAAkBA,KAAK,gBAAgB;oBACvC,aAAaA,KAAK,WAAW;oBAC7B,YAAYA,KAAK,UAAU;gBAC/B;gBAEAP,GAAG,IAAI,CAAC;gBAER,IAAIU,GAAG,UAAU,CAACP,iBAAiB;oBAC/B,MAAMQ,OAAOC,iBAAwCT;oBACrD,IAAIU,KAAK,SAAS,CAACJ,gBAAgBI,KAAK,SAAS,CAACF,OAAO;wBACrD,IAAK,MAAMG,QAAQL,WAAY;4BAC3B,MAAMM,kBAAkBN,UAAU,CAACK,KAAgC;4BACnE,MAAME,mBAAmBL,IAAI,CAACG,KAA0B;4BACxD,IAAK,MAAMG,OAAOF,gBAAiB;gCAC/B,MAAMG,SAASH,eAAe,CAACE,IAAI;gCACnC,MAAME,UAAUH,gBAAgB,CAACC,IAAI;gCACrC,IAAI,CAACE,SAAS;oCACVC,QAAQ,GAAG,CAAC,uBAAuBF,OAAO,IAAI,EAAE,MAAMJ;oCACtD;gCACJ;gCACA,IAAID,KAAK,SAAS,CAACK,YAAYL,KAAK,SAAS,CAACM,UAAU;oCACpDC,QAAQ,GAAG,CAAC,2BAA2BF,OAAO,IAAI,EAAE,MAAMJ;oCAC1DM,QAAQ,GAAG,CAAC;wCACR,QAAQP,KAAK,SAAS,CAACK;wCACvB,SAASL,KAAK,SAAS,CAACM;oCAC5B;gCACJ;4BACJ;wBACJ;wBACA,MAAM,IAAIE,MACN;oBAER;gBACJ,OACI,MAAM,IAAIA,MACN;gBAIRrB,GAAG,IAAI,CAAC;gBAER,IAAIU,GAAG,UAAU,CAACL,iBAAiB;oBAC/B,MAAMM,OAAOC,iBAAiBP;oBAC9B,IAAIQ,KAAK,SAAS,CAACN,KAAK,UAAU,MAAMM,KAAK,SAAS,CAACF,OACnD,MAAM,IAAIU,MACN;oBAED,IAAIC,MAAM,OAAO,CAACX,SAASA,KAAK,MAAM,GAAG,GAC5C,MAAM,IAAIU,MACN;gBAGZ,OACI,MAAM,IAAIA,MACN;gBAIRrB,GAAG,IAAI,CAAC;YACZ;QACJ;IACJ;AACJ;AAEO,MAAMuB,oBAAoBC,qBAAqB;IAClD,aAAaC;IACb,gBAAgB5B;IAChB,cAAc;QAAC6B;QAAsBC;KAAU;AACnD"}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { ListAllPackages } from "./ListAllPackages.js";
|
|
2
2
|
import { ListAllPackageJsonFiles } from "./ListAllPackageJsonFiles.js";
|
|
3
3
|
import { BuildDependencyTree } from "./BuildDependencyTree.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
const createDependencyTree = (project)=>{
|
|
5
|
+
const projectRoot = project.paths.rootFolder;
|
|
6
|
+
const basePath = projectRoot.toString();
|
|
7
|
+
const packagesFolderPath = projectRoot.join("packages").toString();
|
|
8
|
+
const cypressFolderPath = projectRoot.join("cypress").toString();
|
|
9
|
+
const packageJsonFilePath = projectRoot.join("package.json").toString();
|
|
10
|
+
const listAllPackages = new ListAllPackages();
|
|
11
|
+
const listAllPackageJsonFiles = new ListAllPackageJsonFiles();
|
|
12
|
+
const buildDependencyTree = new BuildDependencyTree();
|
|
13
|
+
const allPackages = listAllPackages.list([
|
|
14
|
+
packagesFolderPath,
|
|
15
|
+
cypressFolderPath
|
|
16
|
+
]);
|
|
17
|
+
const allPackageJsonFiles = listAllPackageJsonFiles.list({
|
|
18
|
+
targets: allPackages
|
|
19
|
+
});
|
|
20
|
+
return buildDependencyTree.build({
|
|
21
|
+
basePath,
|
|
22
|
+
files: [
|
|
23
|
+
packageJsonFilePath,
|
|
24
|
+
...allPackageJsonFiles
|
|
25
|
+
],
|
|
26
|
+
ignore: /^@webiny\//
|
|
27
|
+
});
|
|
22
28
|
};
|
|
29
|
+
export { createDependencyTree };
|
|
23
30
|
|
|
24
31
|
//# sourceMappingURL=createDependencyTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/createDependencyTree.js","sources":["../../../src/features/DepsSync/createDependencyTree.ts"],"sourcesContent":["import type { IDependencyTree } from \"./types.js\";\nimport { ListAllPackages } from \"./ListAllPackages.js\";\nimport { ListAllPackageJsonFiles } from \"./ListAllPackageJsonFiles.js\";\nimport { BuildDependencyTree } from \"./BuildDependencyTree.js\";\nimport { IProjectModel } from \"@webiny/project\";\n\nexport const createDependencyTree = (project: IProjectModel): IDependencyTree => {\n const projectRoot = project.paths.rootFolder;\n const basePath = projectRoot.toString();\n const packagesFolderPath = projectRoot.join(\"packages\").toString();\n const cypressFolderPath = projectRoot.join(\"cypress\").toString();\n const packageJsonFilePath = projectRoot.join(\"package.json\").toString();\n\n const listAllPackages = new ListAllPackages();\n const listAllPackageJsonFiles = new ListAllPackageJsonFiles();\n const buildDependencyTree = new BuildDependencyTree();\n\n const allPackages = listAllPackages.list([packagesFolderPath, cypressFolderPath]);\n\n const allPackageJsonFiles = listAllPackageJsonFiles.list({\n targets: allPackages\n });\n\n return buildDependencyTree.build({\n basePath,\n files: [packageJsonFilePath, ...allPackageJsonFiles],\n ignore: /^@webiny\\//\n });\n};\n"],"names":["createDependencyTree","project","projectRoot","basePath","packagesFolderPath","cypressFolderPath","packageJsonFilePath","listAllPackages","ListAllPackages","listAllPackageJsonFiles","ListAllPackageJsonFiles","buildDependencyTree","BuildDependencyTree","allPackages","allPackageJsonFiles"],"mappings":";;;AAMO,MAAMA,uBAAuB,CAACC;IACjC,MAAMC,cAAcD,QAAQ,KAAK,CAAC,UAAU;IAC5C,MAAME,WAAWD,YAAY,QAAQ;IACrC,MAAME,qBAAqBF,YAAY,IAAI,CAAC,YAAY,QAAQ;IAChE,MAAMG,oBAAoBH,YAAY,IAAI,CAAC,WAAW,QAAQ;IAC9D,MAAMI,sBAAsBJ,YAAY,IAAI,CAAC,gBAAgB,QAAQ;IAErE,MAAMK,kBAAkB,IAAIC;IAC5B,MAAMC,0BAA0B,IAAIC;IACpC,MAAMC,sBAAsB,IAAIC;IAEhC,MAAMC,cAAcN,gBAAgB,IAAI,CAAC;QAACH;QAAoBC;KAAkB;IAEhF,MAAMS,sBAAsBL,wBAAwB,IAAI,CAAC;QACrD,SAASI;IACb;IAEA,OAAOF,oBAAoB,KAAK,CAAC;QAC7BR;QACA,OAAO;YAACG;eAAwBQ;SAAoB;QACpD,QAAQ;IACZ;AACJ"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { writeJsonFileSync } from "write-json-file";
|
|
2
2
|
import { getDuplicatesFilePath, getReferencesFilePath } from "./paths.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
ui.info(`Creating %s...`, dupesFilePath);
|
|
25
|
-
writeJsonFileSync(dupesFilePath, tree.duplicates, {
|
|
26
|
-
indent: 0
|
|
27
|
-
});
|
|
3
|
+
const createReferenceFile = (project, tree, di)=>{
|
|
4
|
+
const refsFilePath = getReferencesFilePath(project);
|
|
5
|
+
const dupesFilePath = getDuplicatesFilePath(project);
|
|
6
|
+
const { uiService: ui } = di;
|
|
7
|
+
if (0 === tree.references.length) return void ui.info("No references found.");
|
|
8
|
+
const json = {
|
|
9
|
+
dependencies: tree.dependencies,
|
|
10
|
+
devDependencies: tree.devDependencies,
|
|
11
|
+
peerDependencies: tree.peerDependencies,
|
|
12
|
+
resolutions: tree.resolutions,
|
|
13
|
+
references: tree.references
|
|
14
|
+
};
|
|
15
|
+
ui.info("Creating %s...", refsFilePath);
|
|
16
|
+
writeJsonFileSync(refsFilePath, json, {
|
|
17
|
+
indent: 0
|
|
18
|
+
});
|
|
19
|
+
ui.info("Creating %s...", dupesFilePath);
|
|
20
|
+
writeJsonFileSync(dupesFilePath, tree.duplicates, {
|
|
21
|
+
indent: 0
|
|
22
|
+
});
|
|
28
23
|
};
|
|
24
|
+
export { createReferenceFile };
|
|
29
25
|
|
|
30
26
|
//# sourceMappingURL=createReferenceFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/createReferenceFile.js","sources":["../../../src/features/DepsSync/createReferenceFile.ts"],"sourcesContent":["import { writeJsonFileSync } from \"write-json-file\";\nimport { IProjectModel } from \"@webiny/project\";\nimport { UiService } from \"~/abstractions/services/index.js\";\nimport { getDuplicatesFilePath, getReferencesFilePath } from \"./paths.js\";\nimport type { IDependencyCollection, IDependencyTree } from \"./types.js\";\n\nexport interface ICreateReferenceFileDi {\n uiService: UiService.Interface;\n}\n\nexport const createReferenceFile = (\n project: IProjectModel,\n tree: IDependencyTree,\n di: ICreateReferenceFileDi\n): void => {\n const refsFilePath = getReferencesFilePath(project);\n const dupesFilePath = getDuplicatesFilePath(project);\n\n const { uiService: ui } = di;\n if (tree.references.length === 0) {\n ui.info(\"No references found.\");\n return;\n }\n\n const json: IDependencyCollection = {\n dependencies: tree.dependencies,\n devDependencies: tree.devDependencies,\n peerDependencies: tree.peerDependencies,\n resolutions: tree.resolutions,\n references: tree.references\n };\n\n ui.info(`Creating %s...`, refsFilePath);\n writeJsonFileSync(refsFilePath, json, {\n indent: 0\n });\n\n ui.info(`Creating %s...`, dupesFilePath);\n\n writeJsonFileSync(dupesFilePath, tree.duplicates, {\n indent: 0\n });\n};\n"],"names":["createReferenceFile","project","tree","di","refsFilePath","getReferencesFilePath","dupesFilePath","getDuplicatesFilePath","ui","json","writeJsonFileSync"],"mappings":";;AAUO,MAAMA,sBAAsB,CAC/BC,SACAC,MACAC;IAEA,MAAMC,eAAeC,sBAAsBJ;IAC3C,MAAMK,gBAAgBC,sBAAsBN;IAE5C,MAAM,EAAE,WAAWO,EAAE,EAAE,GAAGL;IAC1B,IAAID,AAA2B,MAA3BA,KAAK,UAAU,CAAC,MAAM,EAAQ,YAC9BM,GAAG,IAAI,CAAC;IAIZ,MAAMC,OAA8B;QAChC,cAAcP,KAAK,YAAY;QAC/B,iBAAiBA,KAAK,eAAe;QACrC,kBAAkBA,KAAK,gBAAgB;QACvC,aAAaA,KAAK,WAAW;QAC7B,YAAYA,KAAK,UAAU;IAC/B;IAEAM,GAAG,IAAI,CAAC,kBAAkBJ;IAC1BM,kBAAkBN,cAAcK,MAAM;QAClC,QAAQ;IACZ;IAEAD,GAAG,IAAI,CAAC,kBAAkBF;IAE1BI,kBAAkBJ,eAAeJ,KAAK,UAAU,EAAE;QAC9C,QAAQ;IACZ;AACJ"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
export const getDuplicatesFilePath = project => {
|
|
5
|
-
return project.paths.rootFolder.join("packages/cli/files/duplicates.json").toString();
|
|
6
|
-
};
|
|
1
|
+
const getReferencesFilePath = (project)=>project.paths.rootFolder.join("packages/cli/files/references.json").toString();
|
|
2
|
+
const getDuplicatesFilePath = (project)=>project.paths.rootFolder.join("packages/cli/files/duplicates.json").toString();
|
|
3
|
+
export { getDuplicatesFilePath, getReferencesFilePath };
|
|
7
4
|
|
|
8
5
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/paths.js","sources":["../../../src/features/DepsSync/paths.ts"],"sourcesContent":["import { IProjectModel } from \"@webiny/project\";\n\nexport const getReferencesFilePath = (project: IProjectModel) => {\n return project.paths.rootFolder.join(\"packages/cli/files/references.json\").toString();\n};\n\nexport const getDuplicatesFilePath = (project: IProjectModel) => {\n return project.paths.rootFolder.join(\"packages/cli/files/duplicates.json\").toString();\n};\n"],"names":["getReferencesFilePath","project","getDuplicatesFilePath"],"mappings":"AAEO,MAAMA,wBAAwB,CAACC,UAC3BA,QAAQ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,sCAAsC,QAAQ;AAGhF,MAAMC,wBAAwB,CAACD,UAC3BA,QAAQ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,sCAAsC,QAAQ"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var types_PackageType = /*#__PURE__*/ function(PackageType) {
|
|
2
|
+
PackageType["dependencies"] = "dependencies";
|
|
3
|
+
PackageType["devDependencies"] = "devDependencies";
|
|
4
|
+
PackageType["peerDependencies"] = "peerDependencies";
|
|
5
|
+
PackageType["resolutions"] = "resolutions";
|
|
6
|
+
return PackageType;
|
|
7
7
|
}({});
|
|
8
|
+
export { types_PackageType as PackageType };
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/types.js","sources":["../../../src/features/DepsSync/types.ts"],"sourcesContent":["import type { PackageJson } from \"type-fest\";\n\nexport enum PackageType {\n dependencies = \"dependencies\",\n devDependencies = \"devDependencies\",\n peerDependencies = \"peerDependencies\",\n resolutions = \"resolutions\"\n}\n\nexport interface IReferenceVersionFile {\n file: string;\n types: PackageType[];\n}\n\nexport interface IReferenceVersion {\n version: string;\n files: IReferenceVersionFile[];\n}\n\nexport interface IReference {\n name: string;\n versions: IReferenceVersion[];\n}\n\nexport interface IDependency {\n name: string;\n version: string;\n files: string[];\n}\n\nexport interface IDependencyTreePushParams {\n file: string;\n json: PackageJson;\n ignore?: RegExp;\n}\n\nexport interface IDependencyCollection {\n dependencies: IDependency[];\n devDependencies: IDependency[];\n peerDependencies: IDependency[];\n resolutions: IDependency[];\n references: IReference[];\n}\n\nexport interface IDependencyTree {\n dependencies: IDependency[];\n devDependencies: IDependency[];\n peerDependencies: IDependency[];\n resolutions: IDependency[];\n references: IReference[];\n duplicates: IReference[];\n\n push(params: IDependencyTreePushParams): void;\n}\n"],"names":["PackageType"],"mappings":"AAEO,IAAKA,oBAAWA,WAAAA,GAAAA,SAAXA,WAAW;;;;;WAAXA"}
|
|
@@ -3,76 +3,80 @@ import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from
|
|
|
3
3
|
import { measureDuration } from "../utils/index.js";
|
|
4
4
|
import { createBaseAppOptions } from "../common/index.js";
|
|
5
5
|
import { PulumiError } from "@webiny/pulumi-sdk";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
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: [
|
|
18
|
+
"$0 destroy api --env dev",
|
|
19
|
+
"$0 destroy admin --env prod",
|
|
20
|
+
"$0 destroy --env prod",
|
|
21
|
+
"$0 destroy"
|
|
22
|
+
],
|
|
23
|
+
params: [
|
|
24
|
+
{
|
|
25
|
+
name: "app",
|
|
26
|
+
description: "Name of the app (core, admin, or api)",
|
|
27
|
+
type: "string"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
options: createBaseAppOptions(projectSdk),
|
|
31
|
+
handler: async (params)=>{
|
|
32
|
+
if ("app" in params) return this.destroyApp(params);
|
|
33
|
+
await this.destroyApp({
|
|
34
|
+
...params,
|
|
35
|
+
app: "admin"
|
|
36
|
+
});
|
|
37
|
+
await this.destroyApp({
|
|
38
|
+
...params,
|
|
39
|
+
app: "api"
|
|
40
|
+
});
|
|
41
|
+
await this.destroyApp({
|
|
42
|
+
...params,
|
|
43
|
+
app: "core"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
async destroyApp(params) {
|
|
49
|
+
const projectSdk = await this.getProjectSdkService.execute();
|
|
50
|
+
const ui = this.uiService;
|
|
51
|
+
const stdio = this.stdioService;
|
|
52
|
+
const { pulumiProcess } = await projectSdk.destroyApp(params);
|
|
53
|
+
const getDestroyDuration = measureDuration();
|
|
54
|
+
try {
|
|
55
|
+
ui.info("Destroying %s app...", params.app);
|
|
56
|
+
ui.emptyLine();
|
|
57
|
+
pulumiProcess.stdout.pipe(stdio.getStdout());
|
|
58
|
+
pulumiProcess.stderr.pipe(stdio.getStderr());
|
|
59
|
+
await pulumiProcess;
|
|
60
|
+
ui.success(`Destroyed in ${getDestroyDuration()}.`);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
if (e instanceof PulumiError) ui.error("Destroy failed, please check the details above.");
|
|
63
|
+
else {
|
|
64
|
+
ui.text(e.message);
|
|
65
|
+
ui.error("Destroy failed, please check the details above.");
|
|
66
|
+
}
|
|
67
|
+
throw e;
|
|
27
68
|
}
|
|
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
69
|
}
|
|
70
|
-
}
|
|
71
70
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
const destroyCommand = createImplementation({
|
|
72
|
+
abstraction: CliCommandFactory,
|
|
73
|
+
implementation: DestroyCommand,
|
|
74
|
+
dependencies: [
|
|
75
|
+
GetProjectSdkService,
|
|
76
|
+
UiService,
|
|
77
|
+
StdioService
|
|
78
|
+
]
|
|
76
79
|
});
|
|
80
|
+
export { DestroyCommand, destroyCommand };
|
|
77
81
|
|
|
78
82
|
//# sourceMappingURL=DestroyCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DestroyCommand/DestroyCommand.js","sources":["../../../src/features/DestroyCommand/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"],"names":["DestroyCommand","getProjectSdkService","uiService","stdioService","projectSdk","createBaseAppOptions","params","ui","stdio","pulumiProcess","getDestroyDuration","measureDuration","e","PulumiError","destroyCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService","StdioService"],"mappings":";;;;;AA0BO,MAAMA;IACT,YACYC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,CAC9C;aAHUF,oBAAoB,GAApBA;aACAC,SAAS,GAATA;aACAC,YAAY,GAAZA;IACT;IAEH,MAAM,UAA+E;QACjF,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAE1D,OAAO;YACH,MAAM;YACN,aAAa;YACb,UAAU;gBACN;gBACA;gBACA;gBACA;aACH;YACD,QAAQ;gBACJ;oBACI,MAAM;oBACN,aAAa;oBACb,MAAM;gBACV;aACH;YACD,SAASC,qBAAqBD;YAC9B,SAAS,OAAOE;gBACZ,IAAI,SAASA,QACT,OAAO,IAAI,CAAC,UAAU,CAACA;gBAI3B,MAAM,IAAI,CAAC,UAAU,CAAC;oBAAE,GAAGA,MAAM;oBAAE,KAAK;gBAAQ;gBAChD,MAAM,IAAI,CAAC,UAAU,CAAC;oBAAE,GAAGA,MAAM;oBAAE,KAAK;gBAAM;gBAC9C,MAAM,IAAI,CAAC,UAAU,CAAC;oBAAE,GAAGA,MAAM;oBAAE,KAAK;gBAAO;YACnD;QACJ;IACJ;IAEA,MAAc,WAAWA,MAA6B,EAAE;QACpD,MAAMF,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAC1D,MAAMG,KAAK,IAAI,CAAC,SAAS;QACzB,MAAMC,QAAQ,IAAI,CAAC,YAAY;QAE/B,MAAM,EAAEC,aAAa,EAAE,GAAG,MAAML,WAAW,UAAU,CAACE;QAEtD,MAAMI,qBAAqBC;QAE3B,IAAI;YACAJ,GAAG,IAAI,CAAC,wBAAwBD,OAAO,GAAG;YAE1CC,GAAG,SAAS;YAEZE,cAAc,MAAM,CAAE,IAAI,CAACD,MAAM,SAAS;YAC1CC,cAAc,MAAM,CAAE,IAAI,CAACD,MAAM,SAAS;YAC1C,MAAMC;YAENF,GAAG,OAAO,CAAC,CAAC,aAAa,EAAEG,qBAAqB,CAAC,CAAC;QACtD,EAAE,OAAOE,GAAG;YAER,IAAIA,aAAaC,aACbN,GAAG,KAAK,CAAC;iBACN;gBACHA,GAAG,IAAI,CAACK,EAAE,OAAO;gBACjBL,GAAG,KAAK,CAAC;YACb;YAEA,MAAMK;QACV;IACJ;AACJ;AAEO,MAAME,iBAAiBC,qBAAqB;IAC/C,aAAaC;IACb,gBAAgBhB;IAChB,cAAc;QAACiB;QAAsBC;QAAWC;KAAa;AACjE"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { CliCommandFactory, UiService } from "../abstractions/index.js";
|
|
3
|
-
import { disable
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
import { disable, sendEvent } from "@webiny/telemetry/cli.js";
|
|
4
|
+
class DisableTelemetryCommand {
|
|
5
|
+
constructor(uiService){
|
|
6
|
+
this.uiService = uiService;
|
|
7
|
+
}
|
|
8
|
+
execute() {
|
|
9
|
+
const ui = this.uiService;
|
|
10
|
+
return {
|
|
11
|
+
name: "disable-telemetry",
|
|
12
|
+
description: "Disables Webiny telemetry",
|
|
13
|
+
handler: async ()=>{
|
|
14
|
+
disable();
|
|
15
|
+
await sendEvent({
|
|
16
|
+
event: "disable-telemetry",
|
|
17
|
+
properties: {}
|
|
18
|
+
});
|
|
19
|
+
ui.info("Webiny telemetry is now %s! Thank you for helping us in making Webiny better!", "disabled");
|
|
20
|
+
ui.info("For more information, please visit the following link: https://www.webiny.com/telemetry.");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const disableTelemetryCommand = createImplementation({
|
|
26
|
+
abstraction: CliCommandFactory,
|
|
27
|
+
implementation: DisableTelemetryCommand,
|
|
28
|
+
dependencies: [
|
|
29
|
+
UiService
|
|
30
|
+
]
|
|
29
31
|
});
|
|
32
|
+
export { DisableTelemetryCommand, disableTelemetryCommand };
|
|
30
33
|
|
|
31
34
|
//# sourceMappingURL=DisableTelemetryCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DisableTelemetryCommand.js","sources":["../../src/features/DisableTelemetryCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, UiService } from \"~/abstractions/index.js\";\nimport { disable as disableTelemetry, sendEvent } from \"@webiny/telemetry/cli.js\";\n\nexport class DisableTelemetryCommand implements CliCommandFactory.Interface<void> {\n constructor(private uiService: UiService.Interface) {}\n\n execute() {\n const ui = this.uiService;\n\n return {\n name: \"disable-telemetry\",\n description: \"Disables Webiny telemetry\",\n handler: async () => {\n disableTelemetry();\n await sendEvent({ event: \"disable-telemetry\", properties: {} });\n ui.info(\n `Webiny telemetry is now %s! Thank you for helping us in making Webiny better!`,\n \"disabled\"\n );\n ui.info(\n `For more information, please visit the following link: https://www.webiny.com/telemetry.`\n );\n }\n };\n }\n}\n\nexport const disableTelemetryCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DisableTelemetryCommand,\n dependencies: [UiService]\n});\n"],"names":["DisableTelemetryCommand","uiService","ui","disableTelemetry","sendEvent","disableTelemetryCommand","createImplementation","CliCommandFactory","UiService"],"mappings":";;;AAIO,MAAMA;IACT,YAAoBC,SAA8B,CAAE;aAAhCA,SAAS,GAATA;IAAiC;IAErD,UAAU;QACN,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzB,OAAO;YACH,MAAM;YACN,aAAa;YACb,SAAS;gBACLC;gBACA,MAAMC,UAAU;oBAAE,OAAO;oBAAqB,YAAY,CAAC;gBAAE;gBAC7DF,GAAG,IAAI,CACH,iFACA;gBAEJA,GAAG,IAAI,CACH;YAER;QACJ;IACJ;AACJ;AAEO,MAAMG,0BAA0BC,qBAAqB;IACxD,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAU;AAC7B"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { CliCommandFactory, UiService } from "../abstractions/index.js";
|
|
3
|
-
import { enable
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
import { enable, sendEvent } from "@webiny/telemetry/cli.js";
|
|
4
|
+
class EnableTelemetryCommand {
|
|
5
|
+
constructor(uiService){
|
|
6
|
+
this.uiService = uiService;
|
|
7
|
+
}
|
|
8
|
+
execute() {
|
|
9
|
+
const ui = this.uiService;
|
|
10
|
+
return {
|
|
11
|
+
name: "enable-telemetry",
|
|
12
|
+
description: "Enables Webiny telemetry",
|
|
13
|
+
handler: async ()=>{
|
|
14
|
+
enable();
|
|
15
|
+
await sendEvent({
|
|
16
|
+
event: "enable-telemetry",
|
|
17
|
+
properties: {}
|
|
18
|
+
});
|
|
19
|
+
ui.info("Webiny telemetry is now %s! Thank you for helping us in making Webiny better!", "enabled");
|
|
20
|
+
ui.info("For more information, please visit the following link: https://www.webiny.com/telemetry.");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const enableTelemetryCommand = createImplementation({
|
|
26
|
+
abstraction: CliCommandFactory,
|
|
27
|
+
implementation: EnableTelemetryCommand,
|
|
28
|
+
dependencies: [
|
|
29
|
+
UiService
|
|
30
|
+
]
|
|
29
31
|
});
|
|
32
|
+
export { EnableTelemetryCommand, enableTelemetryCommand };
|
|
30
33
|
|
|
31
34
|
//# sourceMappingURL=EnableTelemetryCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/EnableTelemetryCommand.js","sources":["../../src/features/EnableTelemetryCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, UiService } from \"~/abstractions/index.js\";\nimport { enable as enableTelemetry, sendEvent } from \"@webiny/telemetry/cli.js\";\n\nexport class EnableTelemetryCommand implements CliCommandFactory.Interface<void> {\n constructor(private uiService: UiService.Interface) {}\n\n execute() {\n const ui = this.uiService;\n\n return {\n name: \"enable-telemetry\",\n description: \"Enables Webiny telemetry\",\n handler: async () => {\n enableTelemetry();\n await sendEvent({ event: \"enable-telemetry\", properties: {} });\n ui.info(\n `Webiny telemetry is now %s! Thank you for helping us in making Webiny better!`,\n \"enabled\"\n );\n ui.info(\n `For more information, please visit the following link: https://www.webiny.com/telemetry.`\n );\n }\n };\n }\n}\n\nexport const enableTelemetryCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: EnableTelemetryCommand,\n dependencies: [UiService]\n});\n"],"names":["EnableTelemetryCommand","uiService","ui","enableTelemetry","sendEvent","enableTelemetryCommand","createImplementation","CliCommandFactory","UiService"],"mappings":";;;AAIO,MAAMA;IACT,YAAoBC,SAA8B,CAAE;aAAhCA,SAAS,GAATA;IAAiC;IAErD,UAAU;QACN,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzB,OAAO;YACH,MAAM;YACN,aAAa;YACb,SAAS;gBACLC;gBACA,MAAMC,UAAU;oBAAE,OAAO;oBAAoB,YAAY,CAAC;gBAAE;gBAC5DF,GAAG,IAAI,CACH,iFACA;gBAEJA,GAAG,IAAI,CACH;YAER;QACJ;IACJ;AACJ;AAEO,MAAMG,yBAAyBC,qBAAqB;IACvD,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAU;AAC7B"}
|