@webiny/cli-core 6.4.11 → 6.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cli.d.ts +2 -1
- package/Cli.js +2 -2
- package/Cli.js.map +1 -1
- package/abstractions/services/DefaultAppsService.d.ts +8 -0
- package/abstractions/services/DefaultAppsService.js +5 -0
- package/abstractions/services/DefaultAppsService.js.map +1 -0
- package/abstractions/services/index.d.ts +1 -0
- package/abstractions/services/index.js +1 -0
- package/createCliContainer.d.ts +1 -1
- package/createCliContainer.js +6 -13
- package/createCliContainer.js.map +1 -1
- package/decorators/index.d.ts +0 -1
- package/decorators/index.js +0 -1
- package/features/BuildCommand/BuildCommand.d.ts +5 -3
- package/features/BuildCommand/BuildCommand.js +27 -14
- package/features/BuildCommand/BuildCommand.js.map +1 -1
- package/features/DeployCommand/index.d.ts +20 -1
- package/features/DeployCommand/index.js +0 -1
- package/features/DepsSync/ListAllPackages.js +4 -2
- package/features/DepsSync/ListAllPackages.js.map +1 -1
- package/features/DepsSync/paths.js +2 -2
- package/features/DepsSync/paths.js.map +1 -1
- package/features/UpgradeCommand/UpgradeCommandHandler.js +3 -3
- package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/index.d.ts +0 -2
- package/features/gracefulErrorHandlers/index.js +0 -2
- package/features/index.d.ts +0 -5
- package/features/index.js +0 -5
- package/package.json +18 -16
- package/services/DefaultAppsService/DefaultAppsService.d.ts +5 -0
- package/services/DefaultAppsService/DefaultAppsService.js +15 -0
- package/services/DefaultAppsService/DefaultAppsService.js.map +1 -0
- package/services/DefaultAppsService/index.d.ts +1 -0
- package/services/DefaultAppsService/index.js +1 -0
- package/services/RunCliRunnerService/RunCliRunnerService.d.ts +1 -1
- package/services/UiService/UiService.d.ts +18 -0
- package/services/UiService/UiService.js +18 -2
- package/services/UiService/UiService.js.map +1 -1
- package/services/index.d.ts +1 -0
- package/services/index.js +1 -0
- package/utils/ensureSameWebinyPackageVersions.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions.js +63 -0
- package/utils/ensureSameWebinyPackageVersions.js.map +1 -0
- package/utils/suppressPunycodeWarnings.d.ts +4 -0
- package/utils/suppressPunycodeWarnings.js +7 -0
- package/utils/suppressPunycodeWarnings.js.map +1 -0
- package/decorators/DeployCommandWithTelemetry.d.ts +0 -11
- package/decorators/DeployCommandWithTelemetry.js +0 -81
- package/decorators/DeployCommandWithTelemetry.js.map +0 -1
- package/features/DeployCommand/DeployCommand.d.ts +0 -30
- package/features/DeployCommand/DeployCommand.js +0 -176
- package/features/DeployCommand/DeployCommand.js.map +0 -1
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +0 -20
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +0 -15
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/DeployOutput.d.ts +0 -5
- package/features/DeployCommand/deployOutputs/DeployOutput.js +0 -23
- package/features/DeployCommand/deployOutputs/DeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.d.ts +0 -4
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +0 -96
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +0 -1
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.d.ts +0 -4
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +0 -31
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +0 -1
- package/features/DestroyCommand/DestroyCommand.d.ts +0 -22
- package/features/DestroyCommand/DestroyCommand.js +0 -82
- package/features/DestroyCommand/DestroyCommand.js.map +0 -1
- package/features/DestroyCommand/index.d.ts +0 -1
- package/features/DestroyCommand/index.js +0 -1
- package/features/OutputCommand.d.ts +0 -12
- package/features/OutputCommand.js +0 -66
- package/features/OutputCommand.js.map +0 -1
- package/features/PulumiCommand/PulumiCommand.d.ts +0 -13
- package/features/PulumiCommand/PulumiCommand.js +0 -57
- package/features/PulumiCommand/PulumiCommand.js.map +0 -1
- package/features/PulumiCommand/index.d.ts +0 -1
- package/features/PulumiCommand/index.js +0 -1
- package/features/RefreshCommand/RefreshCommand.d.ts +0 -12
- package/features/RefreshCommand/RefreshCommand.js +0 -51
- package/features/RefreshCommand/RefreshCommand.js.map +0 -1
- package/features/RefreshCommand/index.d.ts +0 -1
- package/features/RefreshCommand/index.js +0 -1
- package/features/WatchCommand/WatchCommand.d.ts +0 -11
- package/features/WatchCommand/WatchCommand.js +0 -143
- package/features/WatchCommand/WatchCommand.js.map +0 -1
- package/features/WatchCommand/createPrefixer.d.ts +0 -2
- package/features/WatchCommand/createPrefixer.js +0 -16
- package/features/WatchCommand/createPrefixer.js.map +0 -1
- package/features/WatchCommand/getRandomColorForString.d.ts +0 -1
- package/features/WatchCommand/getRandomColorForString.js +0 -89
- package/features/WatchCommand/getRandomColorForString.js.map +0 -1
- package/features/WatchCommand/index.d.ts +0 -1
- package/features/WatchCommand/index.js +0 -1
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +0 -6
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +0 -27
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +0 -1
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.d.ts +0 -6
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +0 -29
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +0 -1
|
@@ -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>;
|
|
@@ -13,5 +13,23 @@ export declare class DefaultUiService implements UiService.Interface {
|
|
|
13
13
|
error(text: string, ...args: any[]): void;
|
|
14
14
|
debug(text: string, ...args: any[]): void;
|
|
15
15
|
private typedColorizedText;
|
|
16
|
+
/**
|
|
17
|
+
* Prefixes every line of `message` with the gutter, wrapping the text to the terminal width
|
|
18
|
+
* first.
|
|
19
|
+
*
|
|
20
|
+
* The wrap has to happen here rather than being left to the terminal. Writing the whole message
|
|
21
|
+
* as one long line means the terminal wraps it at column 0, with no knowledge of the gutter -
|
|
22
|
+
* so continuation lines start underneath the pipe instead of underneath the text, and a wrapped
|
|
23
|
+
* sentence reads as though it belongs to a different paragraph.
|
|
24
|
+
*/
|
|
25
|
+
private applyGutter;
|
|
26
|
+
/**
|
|
27
|
+
* Width available for the text itself, or `null` when there is nothing to wrap to.
|
|
28
|
+
*
|
|
29
|
+
* `columns` is undefined whenever stdout is not a TTY - piped to a file, or read by another
|
|
30
|
+
* process. Wrapping to a guessed width there would bake line breaks into output that something
|
|
31
|
+
* else is going to reflow anyway, so the message is left as a single line.
|
|
32
|
+
*/
|
|
33
|
+
private getTextWidth;
|
|
16
34
|
}
|
|
17
35
|
export declare const uiService: import("@webiny/di").Implementation<typeof DefaultUiService>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import util from "util";
|
|
4
|
+
import wrap_ansi from "wrap-ansi";
|
|
4
5
|
import { IsCi, StdioService, UiService } from "../../abstractions/index.js";
|
|
5
6
|
const NEW_LINE = "\n";
|
|
6
7
|
const PIPE_SYMBOL = "┃";
|
|
8
|
+
const GUTTER_WIDTH = 2;
|
|
9
|
+
const MIN_TEXT_WIDTH = 20;
|
|
7
10
|
const LOG_COLORS = {
|
|
8
11
|
info: chalk.blueBright,
|
|
9
12
|
error: chalk.red,
|
|
@@ -49,9 +52,22 @@ class DefaultUiService {
|
|
|
49
52
|
const prefix = `${type}: `;
|
|
50
53
|
return this.text(prefix + util.format(text, ...args));
|
|
51
54
|
}
|
|
52
|
-
const
|
|
55
|
+
const gutter = `${LOG_COLORS[type](PIPE_SYMBOL)} `;
|
|
53
56
|
const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, (match)=>LOG_COLORS[type](match));
|
|
54
|
-
|
|
57
|
+
const message = util.format(textWithColorizedPlaceholders, ...args);
|
|
58
|
+
return this.text(this.applyGutter(message, gutter));
|
|
59
|
+
}
|
|
60
|
+
applyGutter(message, gutter) {
|
|
61
|
+
const textWidth = this.getTextWidth();
|
|
62
|
+
const wrapped = textWidth ? wrap_ansi(message, textWidth, {
|
|
63
|
+
hard: true
|
|
64
|
+
}) : message;
|
|
65
|
+
return wrapped.split(NEW_LINE).map((line)=>gutter + line).join(NEW_LINE);
|
|
66
|
+
}
|
|
67
|
+
getTextWidth() {
|
|
68
|
+
const columns = this.stdio.getStdout().columns;
|
|
69
|
+
if (!columns) return null;
|
|
70
|
+
return Math.max(columns - GUTTER_WIDTH, MIN_TEXT_WIDTH);
|
|
55
71
|
}
|
|
56
72
|
}
|
|
57
73
|
const uiService = createImplementation({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services/UiService/UiService.js","sources":["../../../src/services/UiService/UiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport chalk from \"chalk\";\nimport util from \"util\";\nimport { UiService, StdioService, IsCi } from \"~/abstractions/index.js\";\n\nconst NEW_LINE = \"\\n\";\nconst PIPE_SYMBOL = \"┃\";\n\nconst LOG_COLORS = {\n info: chalk.blueBright,\n error: chalk.red,\n warning: chalk.yellow,\n success: chalk.green,\n debug: chalk.gray\n} as const;\n\nexport class DefaultUiService implements UiService.Interface {\n constructor(\n private readonly stdio: StdioService.Interface,\n private readonly isCi: IsCi.Interface\n ) {}\n\n raw(text: string) {\n this.stdio.getStdout().write(text);\n }\n\n text(text: string) {\n this.stdio.getStdout().write(text);\n this.stdio.getStdout().write(NEW_LINE);\n }\n\n textBold(text: string) {\n this.text(chalk.bold(text));\n }\n\n emptyLine() {\n this.stdio.getStdout().write(chalk.gray(\"∙\") + NEW_LINE);\n }\n\n // The following methods are used to print texts with a specific type prefix.\n success(text: string, ...args: any[]) {\n this.typedColorizedText(\"success\", text, ...args);\n }\n\n info(text: string, ...args: any[]) {\n this.typedColorizedText(\"info\", text, ...args);\n }\n\n warning(text: string, ...args: any[]) {\n this.typedColorizedText(\"warning\", text, ...args);\n }\n\n error(text: string, ...args: any[]) {\n this.typedColorizedText(\"error\", text, ...args);\n }\n\n debug(text: string, ...args: any[]) {\n this.typedColorizedText(\"debug\", text, ...args);\n }\n\n private typedColorizedText(type: keyof typeof LOG_COLORS, text: string, ...args: any[]) {\n // Use plain text format in CI environments.\n if (this.isCi.execute()) {\n const prefix = `${type}: `;\n return this.text(prefix + util.format(text, ...args));\n }\n\n const
|
|
1
|
+
{"version":3,"file":"services/UiService/UiService.js","sources":["../../../src/services/UiService/UiService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport chalk from \"chalk\";\nimport util from \"util\";\nimport wrapAnsi from \"wrap-ansi\";\nimport { UiService, StdioService, IsCi } from \"~/abstractions/index.js\";\n\nconst NEW_LINE = \"\\n\";\nconst PIPE_SYMBOL = \"┃\";\n\n// Visible width of the `┃ ` gutter that prefixes every line of a typed message. Hardcoded rather\n// than measured because the pipe is a single-column glyph and the colour codes around it occupy no\n// columns at all.\nconst GUTTER_WIDTH = 2;\n\n// A floor for very narrow terminals, so the wrap width can never go to zero or negative.\nconst MIN_TEXT_WIDTH = 20;\n\nconst LOG_COLORS = {\n info: chalk.blueBright,\n error: chalk.red,\n warning: chalk.yellow,\n success: chalk.green,\n debug: chalk.gray\n} as const;\n\nexport class DefaultUiService implements UiService.Interface {\n constructor(\n private readonly stdio: StdioService.Interface,\n private readonly isCi: IsCi.Interface\n ) {}\n\n raw(text: string) {\n this.stdio.getStdout().write(text);\n }\n\n text(text: string) {\n this.stdio.getStdout().write(text);\n this.stdio.getStdout().write(NEW_LINE);\n }\n\n textBold(text: string) {\n this.text(chalk.bold(text));\n }\n\n emptyLine() {\n this.stdio.getStdout().write(chalk.gray(\"∙\") + NEW_LINE);\n }\n\n // The following methods are used to print texts with a specific type prefix.\n success(text: string, ...args: any[]) {\n this.typedColorizedText(\"success\", text, ...args);\n }\n\n info(text: string, ...args: any[]) {\n this.typedColorizedText(\"info\", text, ...args);\n }\n\n warning(text: string, ...args: any[]) {\n this.typedColorizedText(\"warning\", text, ...args);\n }\n\n error(text: string, ...args: any[]) {\n this.typedColorizedText(\"error\", text, ...args);\n }\n\n debug(text: string, ...args: any[]) {\n this.typedColorizedText(\"debug\", text, ...args);\n }\n\n private typedColorizedText(type: keyof typeof LOG_COLORS, text: string, ...args: any[]) {\n // Use plain text format in CI environments.\n if (this.isCi.execute()) {\n const prefix = `${type}: `;\n return this.text(prefix + util.format(text, ...args));\n }\n\n const gutter = `${LOG_COLORS[type](PIPE_SYMBOL)} `;\n\n // Replace all placeholders (match with `/%[a-zA-Z]/g` regex) with colorized values.\n const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, match => {\n return LOG_COLORS[type](match);\n });\n\n const message = util.format(textWithColorizedPlaceholders, ...args);\n\n return this.text(this.applyGutter(message, gutter));\n }\n\n /**\n * Prefixes every line of `message` with the gutter, wrapping the text to the terminal width\n * first.\n *\n * The wrap has to happen here rather than being left to the terminal. Writing the whole message\n * as one long line means the terminal wraps it at column 0, with no knowledge of the gutter -\n * so continuation lines start underneath the pipe instead of underneath the text, and a wrapped\n * sentence reads as though it belongs to a different paragraph.\n */\n private applyGutter(message: string, gutter: string) {\n const textWidth = this.getTextWidth();\n\n // `hard` also breaks words longer than a whole line - a long file path, or a URL. Letting\n // those overflow would hand them straight back to the terminal's own wrapping, which is\n // the column-0 behaviour this method exists to avoid.\n const wrapped = textWidth ? wrapAnsi(message, textWidth, { hard: true }) : message;\n\n return wrapped\n .split(NEW_LINE)\n .map(line => gutter + line)\n .join(NEW_LINE);\n }\n\n /**\n * Width available for the text itself, or `null` when there is nothing to wrap to.\n *\n * `columns` is undefined whenever stdout is not a TTY - piped to a file, or read by another\n * process. Wrapping to a guessed width there would bake line breaks into output that something\n * else is going to reflow anyway, so the message is left as a single line.\n */\n private getTextWidth() {\n const columns = this.stdio.getStdout().columns;\n if (!columns) {\n return null;\n }\n\n return Math.max(columns - GUTTER_WIDTH, MIN_TEXT_WIDTH);\n }\n}\n\nexport const uiService = createImplementation({\n abstraction: UiService,\n implementation: DefaultUiService,\n dependencies: [StdioService, IsCi]\n});\n"],"names":["NEW_LINE","PIPE_SYMBOL","GUTTER_WIDTH","MIN_TEXT_WIDTH","LOG_COLORS","chalk","DefaultUiService","stdio","isCi","text","args","type","prefix","util","gutter","textWithColorizedPlaceholders","match","message","textWidth","wrapped","wrapAnsi","line","columns","Math","uiService","createImplementation","UiService","StdioService","IsCi"],"mappings":";;;;;AAMA,MAAMA,WAAW;AACjB,MAAMC,cAAc;AAKpB,MAAMC,eAAe;AAGrB,MAAMC,iBAAiB;AAEvB,MAAMC,aAAa;IACf,MAAMC,MAAM,UAAU;IACtB,OAAOA,MAAM,GAAG;IAChB,SAASA,MAAM,MAAM;IACrB,SAASA,MAAM,KAAK;IACpB,OAAOA,MAAM,IAAI;AACrB;AAEO,MAAMC;IACT,YACqBC,KAA6B,EAC7BC,IAAoB,CACvC;aAFmBD,KAAK,GAALA;aACAC,IAAI,GAAJA;IAClB;IAEH,IAAIC,IAAY,EAAE;QACd,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACA;IACjC;IAEA,KAAKA,IAAY,EAAE;QACf,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACA;QAC7B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACT;IACjC;IAEA,SAASS,IAAY,EAAE;QACnB,IAAI,CAAC,IAAI,CAACJ,MAAM,IAAI,CAACI;IACzB;IAEA,YAAY;QACR,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAACJ,MAAM,IAAI,CAAC,OAAOL;IACnD;IAGA,QAAQS,IAAY,EAAE,GAAGC,IAAW,EAAE;QAClC,IAAI,CAAC,kBAAkB,CAAC,WAAWD,SAASC;IAChD;IAEA,KAAKD,IAAY,EAAE,GAAGC,IAAW,EAAE;QAC/B,IAAI,CAAC,kBAAkB,CAAC,QAAQD,SAASC;IAC7C;IAEA,QAAQD,IAAY,EAAE,GAAGC,IAAW,EAAE;QAClC,IAAI,CAAC,kBAAkB,CAAC,WAAWD,SAASC;IAChD;IAEA,MAAMD,IAAY,EAAE,GAAGC,IAAW,EAAE;QAChC,IAAI,CAAC,kBAAkB,CAAC,SAASD,SAASC;IAC9C;IAEA,MAAMD,IAAY,EAAE,GAAGC,IAAW,EAAE;QAChC,IAAI,CAAC,kBAAkB,CAAC,SAASD,SAASC;IAC9C;IAEQ,mBAAmBC,IAA6B,EAAEF,IAAY,EAAE,GAAGC,IAAW,EAAE;QAEpF,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI;YACrB,MAAME,SAAS,GAAGD,KAAK,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,IAAI,CAACC,SAASC,KAAK,MAAM,CAACJ,SAASC;QACnD;QAEA,MAAMI,SAAS,GAAGV,UAAU,CAACO,KAAK,CAACV,aAAa,CAAC,CAAC;QAGlD,MAAMc,gCAAgCN,KAAK,OAAO,CAAC,cAAcO,CAAAA,QACtDZ,UAAU,CAACO,KAAK,CAACK;QAG5B,MAAMC,UAAUJ,KAAK,MAAM,CAACE,kCAAkCL;QAE9D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAACO,SAASH;IAC/C;IAWQ,YAAYG,OAAe,EAAEH,MAAc,EAAE;QACjD,MAAMI,YAAY,IAAI,CAAC,YAAY;QAKnC,MAAMC,UAAUD,YAAYE,UAASH,SAASC,WAAW;YAAE,MAAM;QAAK,KAAKD;QAE3E,OAAOE,QACF,KAAK,CAACnB,UACN,GAAG,CAACqB,CAAAA,OAAQP,SAASO,MACrB,IAAI,CAACrB;IACd;IASQ,eAAe;QACnB,MAAMsB,UAAU,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO;QAC9C,IAAI,CAACA,SACD,OAAO;QAGX,OAAOC,KAAK,GAAG,CAACD,UAAUpB,cAAcC;IAC5C;AACJ;AAEO,MAAMqB,YAAYC,qBAAqB;IAC1C,aAAaC;IACb,gBAAgBpB;IAChB,cAAc;QAACqB;QAAcC;KAAK;AACtC"}
|
package/services/index.d.ts
CHANGED
package/services/index.js
CHANGED
|
@@ -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;IACd;IAGA,MAAMC,QAAQF,OACT,IAAI,GACJ,KAAK,CAAC,MACN,GAAG,CAACG,CAAAA,OAAQC,KAAK,KAAK,CAACD;IAE5B,MAAME,aAAa,IAAIC;IAEvB,KAAK,MAAMC,SAASL,MAAO;QAEvB,MAAMM,QAAQD,MAAM,KAAK,CAAC;QAC1B,IAAI,CAACC,OACD;QAGJ,MAAM,GAAGC,KAAKC,QAAQ,GAAGF;QACzB,IAAI,CAACH,WAAW,GAAG,CAACI,MAChBJ,WAAW,GAAG,CAACI,KAAK,IAAIE;QAG5BN,WAAW,GAAG,CAACI,KAAM,GAAG,CAACC;IAC7B;IAEA,OAAOL;AACX;AAEO,MAAMO,kCAAkC;IAE3C,IAAId,6BACA;IAGJ,IAAIe;IACJ,IAAI;QACAA,iBAAiBd;IACrB,EAAE,OAAOe,GAAG;QACR,MAAMC,UAAU;YAAC;SAA6C;QAE9D,IAAI,CAACpB,gBACDoB,QAAQ,IAAI,CAAC,CAAC,uCAAuC,EAAEC,MAAM,MAAM,CAACtB,YAAY,CAAC,CAAC;QAGtFqB,QAAQ,IAAI,CAAC;QAEbE,QAAQ,IAAI,CAACD,MAAM,MAAM,CAACD,QAAQ,IAAI,CAAC;QACvC,IAAIpB,gBACAsB,QAAQ,IAAI,CAACH;QAGjBG,QAAQ,GAAG;QACX;IACJ;IAEA,MAAMC,qBAAmD,EAAE;IAC3D,KAAK,MAAM,CAACT,KAAKU,SAAS,IAAIN,eAAe,OAAO,GAChD,IAAIM,SAAS,IAAI,GAAG,GAChBD,mBAAmB,IAAI,CAAC;QAACT;QAAKU;KAAS;IAI/C,IAAID,mBAAmB,MAAM,GAAG,GAAG;QAC/B,MAAMH,UAAU;YACZ;YACA;eACGG,mBAAmB,GAAG,CAAC,CAAC,CAACT,KAAKU,SAAS,GAC/B,CAAC,EAAE,EAAEV,IAAI,EAAE,EAAEW,MAAM,IAAI,CAACD,UAAU,IAAI,CAAC,OAAO;YAEzD;YACA,CAAC,4IAA4I,EAAEH,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,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":"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"}
|
|
@@ -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"}
|