@webiny/cli-core 6.4.5-beta.0 → 6.6.0-alpha.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.
Files changed (96) hide show
  1. package/Cli.d.ts +2 -1
  2. package/Cli.js +2 -2
  3. package/Cli.js.map +1 -1
  4. package/abstractions/services/DefaultAppsService.d.ts +8 -0
  5. package/abstractions/services/DefaultAppsService.js +5 -0
  6. package/abstractions/services/DefaultAppsService.js.map +1 -0
  7. package/abstractions/services/index.d.ts +1 -0
  8. package/abstractions/services/index.js +1 -0
  9. package/createCliContainer.d.ts +1 -1
  10. package/createCliContainer.js +6 -13
  11. package/createCliContainer.js.map +1 -1
  12. package/decorators/index.d.ts +0 -1
  13. package/decorators/index.js +0 -1
  14. package/features/BuildCommand/BuildCommand.d.ts +5 -3
  15. package/features/BuildCommand/BuildCommand.js +27 -14
  16. package/features/BuildCommand/BuildCommand.js.map +1 -1
  17. package/features/DeployCommand/index.d.ts +20 -1
  18. package/features/DeployCommand/index.js +0 -1
  19. package/features/DepsSync/ListAllPackages.js +4 -2
  20. package/features/DepsSync/ListAllPackages.js.map +1 -1
  21. package/features/DepsSync/paths.js +2 -2
  22. package/features/DepsSync/paths.js.map +1 -1
  23. package/features/UpgradeCommand/UpgradeCommandHandler.js +4 -7
  24. package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -1
  25. package/features/gracefulErrorHandlers/index.d.ts +0 -2
  26. package/features/gracefulErrorHandlers/index.js +0 -2
  27. package/features/index.d.ts +0 -5
  28. package/features/index.js +0 -5
  29. package/package.json +10 -11
  30. package/services/DefaultAppsService/DefaultAppsService.d.ts +5 -0
  31. package/services/DefaultAppsService/DefaultAppsService.js +15 -0
  32. package/services/DefaultAppsService/DefaultAppsService.js.map +1 -0
  33. package/services/DefaultAppsService/index.d.ts +1 -0
  34. package/services/DefaultAppsService/index.js +1 -0
  35. package/services/RunCliRunnerService/RunCliRunnerService.d.ts +1 -1
  36. package/services/index.d.ts +1 -0
  37. package/services/index.js +1 -0
  38. package/utils/ensureSameWebinyPackageVersions.d.ts +1 -0
  39. package/utils/ensureSameWebinyPackageVersions.js +63 -0
  40. package/utils/ensureSameWebinyPackageVersions.js.map +1 -0
  41. package/utils/suppressPunycodeWarnings.d.ts +4 -0
  42. package/utils/suppressPunycodeWarnings.js +7 -0
  43. package/utils/suppressPunycodeWarnings.js.map +1 -0
  44. package/decorators/DeployCommandWithTelemetry.d.ts +0 -11
  45. package/decorators/DeployCommandWithTelemetry.js +0 -81
  46. package/decorators/DeployCommandWithTelemetry.js.map +0 -1
  47. package/features/DeployCommand/DeployCommand.d.ts +0 -30
  48. package/features/DeployCommand/DeployCommand.js +0 -176
  49. package/features/DeployCommand/DeployCommand.js.map +0 -1
  50. package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +0 -20
  51. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +0 -15
  52. package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +0 -1
  53. package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +0 -5
  54. package/features/DeployCommand/deployOutputs/DeployOutput.js +0 -23
  55. package/features/DeployCommand/deployOutputs/DeployOutput.js.map +0 -1
  56. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +0 -4
  57. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +0 -96
  58. package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +0 -1
  59. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +0 -4
  60. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +0 -31
  61. package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +0 -1
  62. package/features/DestroyCommand/DestroyCommand.d.ts +0 -22
  63. package/features/DestroyCommand/DestroyCommand.js +0 -82
  64. package/features/DestroyCommand/DestroyCommand.js.map +0 -1
  65. package/features/DestroyCommand/index.d.ts +0 -1
  66. package/features/DestroyCommand/index.js +0 -1
  67. package/features/OutputCommand.d.ts +0 -12
  68. package/features/OutputCommand.js +0 -66
  69. package/features/OutputCommand.js.map +0 -1
  70. package/features/PulumiCommand/PulumiCommand.d.ts +0 -13
  71. package/features/PulumiCommand/PulumiCommand.js +0 -57
  72. package/features/PulumiCommand/PulumiCommand.js.map +0 -1
  73. package/features/PulumiCommand/index.d.ts +0 -1
  74. package/features/PulumiCommand/index.js +0 -1
  75. package/features/RefreshCommand/RefreshCommand.d.ts +0 -12
  76. package/features/RefreshCommand/RefreshCommand.js +0 -51
  77. package/features/RefreshCommand/RefreshCommand.js.map +0 -1
  78. package/features/RefreshCommand/index.d.ts +0 -1
  79. package/features/RefreshCommand/index.js +0 -1
  80. package/features/WatchCommand/WatchCommand.d.ts +0 -11
  81. package/features/WatchCommand/WatchCommand.js +0 -143
  82. package/features/WatchCommand/WatchCommand.js.map +0 -1
  83. package/features/WatchCommand/createPrefixer.d.ts +0 -2
  84. package/features/WatchCommand/createPrefixer.js +0 -16
  85. package/features/WatchCommand/createPrefixer.js.map +0 -1
  86. package/features/WatchCommand/getRandomColorForString.d.ts +0 -1
  87. package/features/WatchCommand/getRandomColorForString.js +0 -89
  88. package/features/WatchCommand/getRandomColorForString.js.map +0 -1
  89. package/features/WatchCommand/index.d.ts +0 -1
  90. package/features/WatchCommand/index.js +0 -1
  91. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +0 -6
  92. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +0 -27
  93. package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +0 -1
  94. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +0 -6
  95. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +0 -29
  96. package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/DefaultAppsService/DefaultAppsService.js","sources":["../../../src/services/DefaultAppsService/DefaultAppsService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { DefaultAppsService } from \"~/abstractions/index.js\";\n\nexport class EmptyDefaultAppsService implements DefaultAppsService.Interface {\n async execute(): Promise<string[]> {\n return [];\n }\n}\n\nexport const defaultAppsService = createImplementation({\n abstraction: DefaultAppsService,\n implementation: EmptyDefaultAppsService,\n dependencies: []\n});\n"],"names":["EmptyDefaultAppsService","defaultAppsService","createImplementation","DefaultAppsService"],"mappings":";;AAGO,MAAMA;IACT,MAAM,UAA6B;QAC/B,OAAO,EAAE;IACb;AACJ;AAEO,MAAMC,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1 @@
1
+ export * from "./DefaultAppsService.js";
@@ -0,0 +1 @@
1
+ export * from "./DefaultAppsService.js";
@@ -4,8 +4,8 @@ export declare class DefaultRunCliRunnerService implements RunCliRunnerService.I
4
4
  constructor(getCliRunnerService: GetCliRunnerService.Interface);
5
5
  execute(): Promise<{
6
6
  [x: string]: unknown;
7
- _: (string | number)[];
8
7
  $0: string;
8
+ _: (string | number)[];
9
9
  }>;
10
10
  }
11
11
  export declare const runCliRunnerService: import("@webiny/di").Implementation<typeof DefaultRunCliRunnerService>;
@@ -1,4 +1,5 @@
1
1
  export * from "./ArgvParserService/index.js";
2
+ export * from "./DefaultAppsService/index.js";
2
3
  export * from "./CliParamsService/index.js";
3
4
  export * from "./CommandsRegistryService/index.js";
4
5
  export * from "./GetArgvService/index.js";
package/services/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./ArgvParserService/index.js";
2
+ export * from "./DefaultAppsService/index.js";
2
3
  export * from "./CliParamsService/index.js";
3
4
  export * from "./CommandsRegistryService/index.js";
4
5
  export * from "./GetArgvService/index.js";
@@ -0,0 +1 @@
1
+ export declare const ensureSameWebinyPackageVersions: () => void;
@@ -0,0 +1,63 @@
1
+ import { execaSync } from "execa";
2
+ import chalk from "chalk";
3
+ const DEBUG_FLAG = "--debug";
4
+ const usingDebugFlag = process.argv.includes(DEBUG_FLAG);
5
+ const SKIP_WEBINY_VERSIONS_CHECK_FLAG = "--no-package-versions-check";
6
+ const skippingWebinyVersionsCheck = process.argv.includes(SKIP_WEBINY_VERSIONS_CHECK_FLAG);
7
+ const listWebinyPackageVersions = ()=>{
8
+ const { stdout } = execaSync("yarn", [
9
+ "info",
10
+ "@webiny/*",
11
+ "--name-only",
12
+ "--all",
13
+ "--json"
14
+ ], {
15
+ encoding: "utf8"
16
+ });
17
+ const lines = stdout.trim().split("\n").map((line)=>JSON.parse(line));
18
+ const versionMap = new Map();
19
+ for (const entry of lines){
20
+ const match = entry.match(/^(@webiny\/[^@]+)@npm:(.+)$/);
21
+ if (!match) continue;
22
+ const [, pkg, version] = match;
23
+ if (!versionMap.has(pkg)) versionMap.set(pkg, new Set());
24
+ versionMap.get(pkg).add(version);
25
+ }
26
+ return versionMap;
27
+ };
28
+ const ensureSameWebinyPackageVersions = ()=>{
29
+ if (skippingWebinyVersionsCheck) return;
30
+ let webinyVersions;
31
+ try {
32
+ webinyVersions = listWebinyPackageVersions();
33
+ } catch (e) {
34
+ const message = [
35
+ "Failed to inspect Webiny package versions."
36
+ ];
37
+ if (!usingDebugFlag) message.push(`For more information, try running with ${chalk.yellow(DEBUG_FLAG)}.`);
38
+ message.push("Learn more: https://webiny.link/webiny-package-versions-check");
39
+ console.warn(chalk.yellow(message.join(" ")));
40
+ if (usingDebugFlag) console.warn(e);
41
+ console.log();
42
+ return;
43
+ }
44
+ const mismatchedPackages = [];
45
+ for (const [pkg, versions] of webinyVersions.entries())if (versions.size > 1) mismatchedPackages.push([
46
+ pkg,
47
+ versions
48
+ ]);
49
+ if (mismatchedPackages.length > 0) {
50
+ const message = [
51
+ "The following Webiny packages have mismatched versions:",
52
+ "",
53
+ ...mismatchedPackages.map(([pkg, versions])=>`‣ ${pkg}: ${Array.from(versions).join(", ")}`),
54
+ "",
55
+ `Please ensure all Webiny packages are using the same version. If you think this is a mistake, you can also skip this check by appending the ${chalk.red(SKIP_WEBINY_VERSIONS_CHECK_FLAG)} flag. Learn more: https://webiny.link/webiny-package-versions-check`
56
+ ];
57
+ console.error(chalk.red(message.join("\n")));
58
+ process.exit(1);
59
+ }
60
+ };
61
+ export { ensureSameWebinyPackageVersions };
62
+
63
+ //# sourceMappingURL=ensureSameWebinyPackageVersions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/ensureSameWebinyPackageVersions.js","sources":["../../src/utils/ensureSameWebinyPackageVersions.ts"],"sourcesContent":["import { execaSync } from \"execa\";\nimport chalk from \"chalk\";\n\nconst DEBUG_FLAG = \"--debug\";\nconst usingDebugFlag = process.argv.includes(DEBUG_FLAG);\n\nconst SKIP_WEBINY_VERSIONS_CHECK_FLAG = \"--no-package-versions-check\";\nconst skippingWebinyVersionsCheck = process.argv.includes(SKIP_WEBINY_VERSIONS_CHECK_FLAG);\n\nconst listWebinyPackageVersions = (): Map<string, Set<string>> => {\n const { stdout } = execaSync(\"yarn\", [\"info\", \"@webiny/*\", \"--name-only\", \"--all\", \"--json\"], {\n encoding: \"utf8\"\n });\n\n // Each line is a JSON string, so parse them individually.\n const lines = stdout\n .trim()\n .split(\"\\n\")\n .map(line => JSON.parse(line) as string);\n\n const versionMap = new Map<string, Set<string>>();\n\n for (const entry of lines) {\n // An example entry: \"@webiny/cli@npm:5.42.3\".\n const match = entry.match(/^(@webiny\\/[^@]+)@npm:(.+)$/);\n if (!match) {\n continue;\n }\n\n const [, pkg, version] = match;\n if (!versionMap.has(pkg)) {\n versionMap.set(pkg, new Set());\n }\n\n versionMap.get(pkg)!.add(version);\n }\n\n return versionMap;\n};\n\nexport const ensureSameWebinyPackageVersions = (): void => {\n // Just in case, we want to allow users to skip the check.\n if (skippingWebinyVersionsCheck) {\n return;\n }\n\n let webinyVersions: Map<string, Set<string>>;\n try {\n webinyVersions = listWebinyPackageVersions();\n } catch (e) {\n const message = [\"Failed to inspect Webiny package versions.\"];\n\n if (!usingDebugFlag) {\n message.push(`For more information, try running with ${chalk.yellow(DEBUG_FLAG)}.`);\n }\n\n message.push(\"Learn more: https://webiny.link/webiny-package-versions-check\");\n\n console.warn(chalk.yellow(message.join(\" \")));\n if (usingDebugFlag) {\n console.warn(e);\n }\n\n console.log();\n return;\n }\n\n const mismatchedPackages: Array<[string, Set<string>]> = [];\n for (const [pkg, versions] of webinyVersions.entries()) {\n if (versions.size > 1) {\n mismatchedPackages.push([pkg, versions]);\n }\n }\n\n if (mismatchedPackages.length > 0) {\n const message = [\n \"The following Webiny packages have mismatched versions:\",\n \"\",\n ...mismatchedPackages.map(([pkg, versions]) => {\n return `‣ ${pkg}: ${Array.from(versions).join(\", \")}`;\n }),\n \"\",\n `Please ensure all Webiny packages are using the same version. If you think this is a mistake, you can also skip this check by appending the ${chalk.red(\n SKIP_WEBINY_VERSIONS_CHECK_FLAG\n )} flag. Learn more: https://webiny.link/webiny-package-versions-check`\n ];\n\n console.error(chalk.red(message.join(\"\\n\")));\n process.exit(1);\n }\n};\n"],"names":["DEBUG_FLAG","usingDebugFlag","process","SKIP_WEBINY_VERSIONS_CHECK_FLAG","skippingWebinyVersionsCheck","listWebinyPackageVersions","stdout","execaSync","lines","line","JSON","versionMap","Map","entry","match","pkg","version","Set","ensureSameWebinyPackageVersions","webinyVersions","e","message","chalk","console","mismatchedPackages","versions","Array"],"mappings":";;AAGA,MAAMA,aAAa;AACnB,MAAMC,iBAAiBC,QAAQ,IAAI,CAAC,QAAQ,CAACF;AAE7C,MAAMG,kCAAkC;AACxC,MAAMC,8BAA8BF,QAAQ,IAAI,CAAC,QAAQ,CAACC;AAE1D,MAAME,4BAA4B;IAC9B,MAAM,EAAEC,MAAM,EAAE,GAAGC,UAAU,QAAQ;QAAC;QAAQ;QAAa;QAAe;QAAS;KAAS,EAAE;QAC1F,UAAU;IAC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,MAAM,GAAG,CACpJnB,iCACF,oEAAoE,CAAC;SAC1E;QAEDoB,QAAQ,KAAK,CAACD,MAAM,GAAG,CAACD,QAAQ,IAAI,CAAC;QACrCnB,QAAQ,IAAI,CAAC;IACjB;AACJ"}
@@ -0,0 +1,4 @@
1
+ declare const originalConsoleError: {
2
+ (...data: any[]): void;
3
+ (message?: any, ...optionalParams: any[]): void;
4
+ };
@@ -0,0 +1,7 @@
1
+ const originalConsoleError = console.error;
2
+ console.error = (message, ...args)=>{
3
+ if ("string" == typeof message && message.includes("punycode")) return;
4
+ originalConsoleError.call(console, message, ...args);
5
+ };
6
+
7
+ //# sourceMappingURL=suppressPunycodeWarnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/suppressPunycodeWarnings.js","sources":["../../src/utils/suppressPunycodeWarnings.ts"],"sourcesContent":["// Suppress the `punycode` deprecation warning emitted by transitive deps.\n// This is a known upstream issue we can't fix, so we filter it out.\nconst originalConsoleError = console.error;\nconsole.error = (message: unknown, ...args: unknown[]) => {\n if (typeof message === \"string\" && message.includes(\"punycode\")) {\n return;\n }\n originalConsoleError.call(console, message, ...args);\n};\n"],"names":["originalConsoleError","console","message","args"],"mappings":"AAEA,MAAMA,uBAAuBC,QAAQ,KAAK;AAC1CA,QAAQ,KAAK,GAAG,CAACC,SAAkB,GAAGC;IAClC,IAAI,AAAmB,YAAnB,OAAOD,WAAwBA,QAAQ,QAAQ,CAAC,aAChD;IAEJF,qBAAqB,IAAI,CAACC,SAASC,YAAYC;AACnD"}
@@ -1,11 +0,0 @@
1
- import { CliCommandFactory, GetProjectSdkService } from "../abstractions/index.js";
2
- export declare class DeployCommandWithTelemetry<TParams> implements CliCommandFactory.Interface<TParams> {
3
- private getProjectSdkService;
4
- private decoratee;
5
- constructor(getProjectSdkService: GetProjectSdkService.Interface, decoratee: CliCommandFactory.Interface<TParams>);
6
- execute(): Promise<import("../abstractions/features/CliCommand").ICliCommandDefinition<TParams>>;
7
- private sendEvent;
8
- }
9
- export declare const deployCommandWithTelemetry: typeof DeployCommandWithTelemetry & {
10
- __abstraction: import("@webiny/di").Abstraction<import("../abstractions/features/CliCommand").ICliCommand<any>>;
11
- };
@@ -1,81 +0,0 @@
1
- import { isEnabled, sendEvent } from "@webiny/telemetry/cli.js";
2
- import { CliCommandFactory, GetProjectSdkService } from "../abstractions/index.js";
3
- import { GracefulError } from "@webiny/project";
4
- const isDeployCommand = (command)=>"deploy" === command.name;
5
- class DeployCommandWithTelemetry {
6
- constructor(getProjectSdkService, decoratee){
7
- this.getProjectSdkService = getProjectSdkService;
8
- this.decoratee = decoratee;
9
- }
10
- async execute() {
11
- const command = await this.decoratee.execute();
12
- if (!isDeployCommand(command)) return command;
13
- if (!isEnabled()) return command;
14
- const projectSdk = await this.getProjectSdkService.execute();
15
- const projectSdkTelemetryEnabled = await projectSdk.isTelemetryEnabled();
16
- if (!projectSdkTelemetryEnabled) return command;
17
- const deployCommand = command;
18
- const originalCommandHandler = deployCommand.handler;
19
- deployCommand.handler = async (params)=>{
20
- if ("app" in params) {
21
- const telemetryProperties = {
22
- app: params.app || "unknown",
23
- env: params.env || "unknown",
24
- variant: params.variant || "unknown",
25
- region: params.region || "unknown",
26
- commandParams: JSON.stringify(params)
27
- };
28
- try {
29
- await this.sendEvent("cli-pulumi-command-deploy-start", telemetryProperties);
30
- const result = await originalCommandHandler(params);
31
- await this.sendEvent("cli-pulumi-command-deploy-end", telemetryProperties);
32
- return result;
33
- } catch (e) {
34
- const event = e instanceof GracefulError ? "cli-pulumi-command-deploy-error-graceful" : "cli-pulumi-command-deploy-error";
35
- await this.sendEvent(event, {
36
- ...telemetryProperties,
37
- errorMessage: e.message,
38
- errorStack: e.stack
39
- });
40
- throw e;
41
- }
42
- }
43
- const telemetryProperties = {
44
- env: params.env || "unknown",
45
- variant: params.variant || "unknown",
46
- region: params.region || "unknown",
47
- commandParams: JSON.stringify(params)
48
- };
49
- try {
50
- await this.sendEvent("cli-project-deploy-start", telemetryProperties);
51
- const result = await originalCommandHandler(params);
52
- await this.sendEvent("cli-project-deploy-end", telemetryProperties);
53
- return result;
54
- } catch (e) {
55
- const event = e instanceof GracefulError ? "cli-project-deploy-error-graceful" : "cli-project-deploy-error";
56
- await this.sendEvent(event, {
57
- ...telemetryProperties,
58
- errorMessage: e.message,
59
- errorStack: e.stack
60
- });
61
- throw e;
62
- }
63
- };
64
- return command;
65
- }
66
- sendEvent(event, properties = {}) {
67
- return sendEvent({
68
- event,
69
- properties
70
- });
71
- }
72
- }
73
- const deployCommandWithTelemetry = CliCommandFactory.createDecorator({
74
- decorator: DeployCommandWithTelemetry,
75
- dependencies: [
76
- GetProjectSdkService
77
- ]
78
- });
79
- export { DeployCommandWithTelemetry, deployCommandWithTelemetry };
80
-
81
- //# sourceMappingURL=DeployCommandWithTelemetry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorators/DeployCommandWithTelemetry.js","sources":["../../src/decorators/DeployCommandWithTelemetry.ts"],"sourcesContent":["import {\n isEnabled as globalIsTelemetryEnabled,\n sendEvent as telemetrySendEvent\n} from \"@webiny/telemetry/cli.js\";\nimport { CliCommandFactory, GetProjectSdkService } from \"~/abstractions/index.js\";\nimport { IDeployCommandParams } from \"~/features/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst isDeployCommand = (\n command: CliCommandFactory.CommandDefinition<any>\n): command is CliCommandFactory.CommandDefinition<IDeployCommandParams> => {\n return command.name === \"deploy\";\n};\n\nexport class DeployCommandWithTelemetry<TParams> implements CliCommandFactory.Interface<TParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private decoratee: CliCommandFactory.Interface<TParams>\n ) {}\n\n async execute() {\n const command = await this.decoratee.execute();\n\n if (!isDeployCommand(command)) {\n // If the command is not a `deploy` command, we do not need to wrap it with telemetry.\n return command;\n }\n\n if (!globalIsTelemetryEnabled()) {\n return command;\n }\n\n // Check if telemetry is disabled via an extension.\n const projectSdk = await this.getProjectSdkService.execute();\n const projectSdkTelemetryEnabled = await projectSdk.isTelemetryEnabled();\n if (!projectSdkTelemetryEnabled) {\n return command;\n }\n\n // Getting a different type without type assertion. :|\n const deployCommand = command as CliCommandFactory.CommandDefinition<IDeployCommandParams>;\n const originalCommandHandler = deployCommand.handler;\n\n deployCommand.handler = async (params: IDeployCommandParams) => {\n if (\"app\" in params) {\n const telemetryProperties = {\n app: params.app || \"unknown\",\n env: params.env || \"unknown\",\n variant: params.variant || \"unknown\",\n region: params.region || \"unknown\",\n commandParams: JSON.stringify(params)\n };\n\n try {\n await this.sendEvent(\"cli-pulumi-command-deploy-start\", telemetryProperties);\n\n const result = await originalCommandHandler(params);\n\n await this.sendEvent(\"cli-pulumi-command-deploy-end\", telemetryProperties);\n\n return result;\n } catch (e) {\n const event =\n e instanceof GracefulError\n ? \"cli-pulumi-command-deploy-error-graceful\"\n : \"cli-pulumi-command-deploy-error\";\n\n await this.sendEvent(event, {\n ...telemetryProperties,\n errorMessage: e.message,\n errorStack: e.stack\n });\n\n throw e;\n }\n }\n\n const telemetryProperties = {\n env: params.env || \"unknown\",\n variant: params.variant || \"unknown\",\n region: params.region || \"unknown\",\n commandParams: JSON.stringify(params)\n };\n\n try {\n await this.sendEvent(\"cli-project-deploy-start\", telemetryProperties);\n const result = await originalCommandHandler(params);\n await this.sendEvent(\"cli-project-deploy-end\", telemetryProperties);\n return result;\n } catch (e) {\n const event =\n e instanceof GracefulError\n ? \"cli-project-deploy-error-graceful\"\n : \"cli-project-deploy-error\";\n\n await this.sendEvent(event, {\n ...telemetryProperties,\n errorMessage: e.message,\n errorStack: e.stack\n });\n\n throw e;\n }\n };\n\n return command;\n }\n\n private sendEvent(event: string, properties: Record<string, any> = {}) {\n return telemetrySendEvent({\n event,\n properties\n });\n }\n}\n\nexport const deployCommandWithTelemetry = CliCommandFactory.createDecorator({\n decorator: DeployCommandWithTelemetry,\n dependencies: [GetProjectSdkService]\n});\n"],"names":["isDeployCommand","command","DeployCommandWithTelemetry","getProjectSdkService","decoratee","globalIsTelemetryEnabled","projectSdk","projectSdkTelemetryEnabled","deployCommand","originalCommandHandler","params","telemetryProperties","JSON","result","e","event","GracefulError","properties","telemetrySendEvent","deployCommandWithTelemetry","CliCommandFactory","GetProjectSdkService"],"mappings":";;;AAQA,MAAMA,kBAAkB,CACpBC,UAEOA,AAAiB,aAAjBA,QAAQ,IAAI;AAGhB,MAAMC;IACT,YACYC,oBAAoD,EACpDC,SAA+C,CACzD;aAFUD,oBAAoB,GAApBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMH,UAAU,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QAE5C,IAAI,CAACD,gBAAgBC,UAEjB,OAAOA;QAGX,IAAI,CAACI,aACD,OAAOJ;QAIX,MAAMK,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAC1D,MAAMC,6BAA6B,MAAMD,WAAW,kBAAkB;QACtE,IAAI,CAACC,4BACD,OAAON;QAIX,MAAMO,gBAAgBP;QACtB,MAAMQ,yBAAyBD,cAAc,OAAO;QAEpDA,cAAc,OAAO,GAAG,OAAOE;YAC3B,IAAI,SAASA,QAAQ;gBACjB,MAAMC,sBAAsB;oBACxB,KAAKD,OAAO,GAAG,IAAI;oBACnB,KAAKA,OAAO,GAAG,IAAI;oBACnB,SAASA,OAAO,OAAO,IAAI;oBAC3B,QAAQA,OAAO,MAAM,IAAI;oBACzB,eAAeE,KAAK,SAAS,CAACF;gBAClC;gBAEA,IAAI;oBACA,MAAM,IAAI,CAAC,SAAS,CAAC,mCAAmCC;oBAExD,MAAME,SAAS,MAAMJ,uBAAuBC;oBAE5C,MAAM,IAAI,CAAC,SAAS,CAAC,iCAAiCC;oBAEtD,OAAOE;gBACX,EAAE,OAAOC,GAAG;oBACR,MAAMC,QACFD,aAAaE,gBACP,6CACA;oBAEV,MAAM,IAAI,CAAC,SAAS,CAACD,OAAO;wBACxB,GAAGJ,mBAAmB;wBACtB,cAAcG,EAAE,OAAO;wBACvB,YAAYA,EAAE,KAAK;oBACvB;oBAEA,MAAMA;gBACV;YACJ;YAEA,MAAMH,sBAAsB;gBACxB,KAAKD,OAAO,GAAG,IAAI;gBACnB,SAASA,OAAO,OAAO,IAAI;gBAC3B,QAAQA,OAAO,MAAM,IAAI;gBACzB,eAAeE,KAAK,SAAS,CAACF;YAClC;YAEA,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,4BAA4BC;gBACjD,MAAME,SAAS,MAAMJ,uBAAuBC;gBAC5C,MAAM,IAAI,CAAC,SAAS,CAAC,0BAA0BC;gBAC/C,OAAOE;YACX,EAAE,OAAOC,GAAG;gBACR,MAAMC,QACFD,aAAaE,gBACP,sCACA;gBAEV,MAAM,IAAI,CAAC,SAAS,CAACD,OAAO;oBACxB,GAAGJ,mBAAmB;oBACtB,cAAcG,EAAE,OAAO;oBACvB,YAAYA,EAAE,KAAK;gBACvB;gBAEA,MAAMA;YACV;QACJ;QAEA,OAAOb;IACX;IAEQ,UAAUc,KAAa,EAAEE,aAAkC,CAAC,CAAC,EAAE;QACnE,OAAOC,UAAmB;YACtBH;YACAE;QACJ;IACJ;AACJ;AAEO,MAAME,6BAA6BC,kBAAkB,eAAe,CAAC;IACxE,WAAWlB;IACX,cAAc;QAACmB;KAAqB;AACxC"}
@@ -1,30 +0,0 @@
1
- import { AppName } from "@webiny/project";
2
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
3
- export interface IDeployCommandParams {
4
- apps?: AppName[];
5
- variant?: string;
6
- region?: string;
7
- env: string;
8
- showDeploymentLogs?: boolean;
9
- build?: boolean;
10
- preview?: boolean;
11
- allowLocalStateFiles?: boolean;
12
- }
13
- export interface IDeploySingleAppParams {
14
- app: AppName;
15
- variant?: string;
16
- region?: string;
17
- env: string;
18
- showDeploymentLogs?: boolean;
19
- build?: boolean;
20
- preview?: boolean;
21
- }
22
- export declare class DeployCommand implements CliCommandFactory.Interface<IDeployCommandParams> {
23
- private getProjectSdkService;
24
- private uiService;
25
- private stdioService;
26
- constructor(getProjectSdkService: GetProjectSdkService.Interface, uiService: UiService.Interface, stdioService: StdioService.Interface);
27
- execute(): Promise<CliCommandFactory.CommandDefinition<IDeployCommandParams>>;
28
- private deployApp;
29
- }
30
- export declare const deployCommand: import("@webiny/di").Implementation<typeof DeployCommand>;
@@ -1,176 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { setTimeout as promises_setTimeout } from "node:timers/promises";
3
- import open_0 from "open";
4
- import ora from "ora";
5
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
6
- import { BuildRunner } from "../BuildCommand/buildRunners/BuildRunner.js";
7
- import { createBaseAppOptions } from "../common/index.js";
8
- import { DeployOutput } from "./deployOutputs/DeployOutput.js";
9
- import { PrintInfoForEnv } from "../InfoCommand/PrintInfoForEnv.js";
10
- const sleep = (ms = 1500)=>promises_setTimeout(ms);
11
- class DeployCommand {
12
- constructor(getProjectSdkService, uiService, stdioService){
13
- this.getProjectSdkService = getProjectSdkService;
14
- this.uiService = uiService;
15
- this.stdioService = stdioService;
16
- }
17
- async execute() {
18
- const projectSdk = await this.getProjectSdkService.execute();
19
- const ui = this.uiService;
20
- return {
21
- name: "deploy",
22
- description: "Deploys specified app or all apps in the project",
23
- examples: [
24
- "$0 deploy api --env dev",
25
- "$0 deploy core api --env dev",
26
- "$0 deploy admin --env prod",
27
- "$0 deploy --env prod",
28
- "$0 deploy"
29
- ],
30
- params: [
31
- {
32
- name: "apps",
33
- description: "Name of the app(s) to deploy (core, admin, or api). You can specify multiple apps.",
34
- type: "string",
35
- array: true
36
- }
37
- ],
38
- options: [
39
- ...createBaseAppOptions(projectSdk),
40
- {
41
- name: "build",
42
- description: "Build packages before deploying",
43
- type: "boolean",
44
- default: true
45
- },
46
- {
47
- name: "preview",
48
- description: "Preview the deploy instead of actually performing it",
49
- type: "boolean",
50
- default: false
51
- },
52
- {
53
- name: "show-deployment-logs",
54
- description: "Print deployment logs (automatically enabled in CI environments)",
55
- type: "boolean",
56
- default: false
57
- },
58
- {
59
- name: "allow-local-state-files",
60
- description: "Allow using local Pulumi state files with production environment deployment (not recommended).",
61
- type: "boolean"
62
- }
63
- ],
64
- handler: async (params)=>{
65
- if (params.apps && params.apps.length > 0) for (const appName of params.apps){
66
- const appParams = {
67
- ...params,
68
- app: appName
69
- };
70
- const app = await projectSdk.getApp(appName);
71
- ui.info("Deploying %s app...", app.getDisplayName());
72
- await this.deployApp(appParams);
73
- ui.emptyLine();
74
- }
75
- else {
76
- ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);
77
- ui.emptyLine();
78
- const isCi = projectSdk.isCi();
79
- const coreStack = await projectSdk.getAppStackOutput("core");
80
- const isFirstDeployment = !isCi && !coreStack?.deploymentId;
81
- if (isFirstDeployment) {
82
- ui.info("Looks like this is your first time deploying the project.");
83
- ui.info("Note that the initial deployment can take up to %s, so please be patient.", "10 minutes");
84
- await sleep();
85
- }
86
- isFirstDeployment && ui.emptyLine();
87
- ui.info("Deploying %s app...", "Core");
88
- await this.deployApp({
89
- ...params,
90
- app: "core"
91
- });
92
- ui.emptyLine();
93
- ui.info("Deploying %s app...", "API");
94
- await this.deployApp({
95
- ...params,
96
- app: "api"
97
- });
98
- ui.emptyLine();
99
- ui.info("Deploying %s app...", "Admin");
100
- await this.deployApp({
101
- ...params,
102
- app: "admin"
103
- });
104
- if (isFirstDeployment) ui.success("Congratulations! You've just deployed a brand new project!");
105
- else ui.success("Project deployed.");
106
- const printInfoForEnv = new PrintInfoForEnv({
107
- getProjectSdkService: this.getProjectSdkService,
108
- uiService: this.uiService
109
- });
110
- ui.emptyLine();
111
- ui.textBold("Project Details");
112
- await printInfoForEnv.execute(params);
113
- const adminAppOutput = await projectSdk.getAppStackOutput("admin");
114
- if (isFirstDeployment && adminAppOutput) {
115
- ui.emptyLine();
116
- ui.info("The final step is to open the %s app in your browser and complete the installation wizard.", "Admin");
117
- const spinner = ora("Opening Admin in your browser...").start();
118
- try {
119
- await sleep(7000);
120
- open_0(adminAppOutput.appUrl);
121
- spinner.succeed("Successfully opened Admin app in your browser.");
122
- } catch {
123
- spinner.fail("Failed to open Admin in your browser.");
124
- await sleep(1000);
125
- ui.emptyLine();
126
- ui.warning("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.", "Admin", adminAppOutput.appUrl);
127
- }
128
- }
129
- }
130
- }
131
- };
132
- }
133
- async deployApp(params) {
134
- const projectSdk = await this.getProjectSdkService.execute();
135
- const ui = this.uiService;
136
- const stdio = this.stdioService;
137
- if (false !== params.build) {
138
- const packagesBuilder = await projectSdk.buildApp(params);
139
- const buildRunner = new BuildRunner({
140
- stdio,
141
- ui,
142
- packagesBuilder
143
- });
144
- if (!buildRunner.isEmpty()) {
145
- await buildRunner.run();
146
- ui.emptyLine();
147
- }
148
- }
149
- const showDeploymentLogs = Boolean(projectSdk.isCi() || params.preview || params.showDeploymentLogs);
150
- return await projectSdk.deployApp({
151
- ...params,
152
- output: (pulumiProcess)=>{
153
- const deployOutput = new DeployOutput({
154
- stdio,
155
- ui,
156
- showDeploymentLogs,
157
- deployProcess: pulumiProcess,
158
- deployParams: params
159
- });
160
- return deployOutput.output();
161
- }
162
- });
163
- }
164
- }
165
- const deployCommand = createImplementation({
166
- abstraction: CliCommandFactory,
167
- implementation: DeployCommand,
168
- dependencies: [
169
- GetProjectSdkService,
170
- UiService,
171
- StdioService
172
- ]
173
- });
174
- export { DeployCommand, deployCommand };
175
-
176
- //# sourceMappingURL=DeployCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/DeployCommand/DeployCommand.js","sources":["../../../src/features/DeployCommand/DeployCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { AppName } from \"@webiny/project\";\nimport { setTimeout } from \"node:timers/promises\";\nimport open from \"open\";\nimport ora from \"ora\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { BuildRunner } from \"~/features/BuildCommand/buildRunners/BuildRunner.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport { DeployOutput } from \"./deployOutputs/DeployOutput.js\";\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 ui.info(`You're using Webiny v${projectSdk.getProjectVersion()}`);\n ui.emptyLine();\n\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"],"names":["sleep","ms","setTimeout","DeployCommand","getProjectSdkService","uiService","stdioService","projectSdk","ui","createBaseAppOptions","params","appName","appParams","app","isCi","coreStack","isFirstDeployment","printInfoForEnv","PrintInfoForEnv","adminAppOutput","spinner","ora","open","stdio","packagesBuilder","buildRunner","BuildRunner","showDeploymentLogs","Boolean","pulumiProcess","deployOutput","DeployOutput","deployCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService","StdioService"],"mappings":";;;;;;;;;AAuCA,MAAMA,QAAQ,CAACC,KAAa,IAAI,GAAKC,oBAAWD;AAEzC,MAAME;IACT,YACYC,oBAAoD,EACpDC,SAA8B,EAC9BC,YAAoC,CAC9C;aAHUF,oBAAoB,GA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AAoB,CAAC,OAAO;QAE1D,MAAMC,KAAK,IAAI,CAAC,SAAS;QACzB,MAAMe,QAAQ,IAAI,CAAC,YAAY;QAE/B,IAAIb,AAAiB,UAAjBA,OAAO,KAAK,EAAY;YACxB,MAAMc,kBAAkB,MAAMjB,WAAW,QAAQ,CAACG;YAElD,MAAMe,cAAc,IAAIC,YAAY;gBAChCH;gBACAf;gBACAgB;YACJ;YAEA,IAAI,CAACC,YAAY,OAAO,IAAI;gBACxB,MAAMA,YAAY,GAAG;gBACrBjB,GAAG,SAAS;YAChB;QACJ;QAGA,MAAMmB,qBAAqBC,QACvBrB,WAAW,IAAI,MAAMG,OAAO,OAAO,IAAIA,OAAO,kBAAkB;QAGpE,OAAO,MAAMH,WAAW,SAAS,CAAC;YAC9B,GAAGG,MAAM;YACT,QAAQmB,CAAAA;gBACJ,MAAMC,eAAe,IAAIC,aAAa;oBAClCR;oBACAf;oBACAmB;oBACA,eAAeE;oBACf,cAAcnB;gBAClB;gBAEA,OAAOoB,aAAa,MAAM;YAC9B;QACJ;IACJ;AACJ;AAEO,MAAME,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgB/B;IAChB,cAAc;QAACgC;QAAsBC;QAAWC;KAAa;AACjE"}
@@ -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,15 +0,0 @@
1
- class BaseDeployOutput {
2
- constructor({ deployProcess, stdio, ui, showDeploymentLogs, deployParams }){
3
- this.deployProcess = deployProcess;
4
- this.stdio = stdio;
5
- this.ui = ui;
6
- this.showDeploymentLogs = showDeploymentLogs;
7
- this.deployParams = deployParams;
8
- }
9
- async output() {
10
- throw new Error("Not implemented.");
11
- }
12
- }
13
- export { BaseDeployOutput };
14
-
15
- //# sourceMappingURL=BaseDeployOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/DeployCommand/deployOutputs/BaseDeployOutput.js","sources":["../../../../src/features/DeployCommand/deployOutputs/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"],"names":["BaseDeployOutput","deployProcess","stdio","ui","showDeploymentLogs","deployParams","Error"],"mappings":"AAcO,MAAMA;IAOT,YAAmB,EACfC,aAAa,EACbC,KAAK,EACLC,EAAE,EACFC,kBAAkB,EAClBC,YAAY,EACU,CAAE;QACxB,IAAI,CAAC,aAAa,GAAGJ;QACrB,IAAI,CAAC,KAAK,GAAGC;QACb,IAAI,CAAC,EAAE,GAAGC;QACV,IAAI,CAAC,kBAAkB,GAAGC;QAC1B,IAAI,CAAC,YAAY,GAAGC;IACxB;IAEA,MAAa,SAAwB;QACjC,MAAM,IAAIC,MAAM;IACpB;AACJ"}
@@ -1,5 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- export declare class DeployOutput extends BaseDeployOutput {
3
- output(): Promise<void>;
4
- private getOutputClass;
5
- }
@@ -1,23 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- import { NoDeploymentLogsDeployOutput } from "./NoDeploymentLogsDeployOutput.js";
3
- import { WithDeploymentLogsDeployOutput } from "./WithDeploymentLogsDeployOutput.js";
4
- 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) return WithDeploymentLogsDeployOutput;
18
- return NoDeploymentLogsDeployOutput;
19
- }
20
- }
21
- export { DeployOutput };
22
-
23
- //# sourceMappingURL=DeployOutput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/DeployCommand/deployOutputs/DeployOutput.js","sources":["../../../../src/features/DeployCommand/deployOutputs/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"],"names":["DeployOutput","BaseDeployOutput","OutputClass","output","WithDeploymentLogsDeployOutput","NoDeploymentLogsDeployOutput"],"mappings":";;;AAIO,MAAMA,qBAAqBC;IAC9B,MAAsB,SAAS;QAC3B,MAAMC,cAAc,IAAI,CAAC,cAAc;QAEvC,MAAMC,SAAS,IAAID,YAAY;YAC3B,eAAe,IAAI,CAAC,aAAa;YACjC,OAAO,IAAI,CAAC,KAAK;YACjB,IAAI,IAAI,CAAC,EAAE;YACX,oBAAoB,IAAI,CAAC,kBAAkB;YAC3C,cAAc,IAAI,CAAC,YAAY;QACnC;QAEA,OAAOC,OAAO,MAAM;IACxB;IAEQ,iBAAiB;QACrB,IAAI,IAAI,CAAC,kBAAkB,EACvB,OAAOC;QAGX,OAAOC;IACX;AACJ"}
@@ -1,4 +0,0 @@
1
- import { BaseDeployOutput } from "./BaseDeployOutput.js";
2
- export declare class NoDeploymentLogsDeployOutput extends BaseDeployOutput {
3
- output(): Promise<void>;
4
- }