@webiny/cli-core 6.4.5 → 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
@@ -1,143 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { CliCommandFactory, GetProjectSdkService, StdioService, UiService } from "../../abstractions/index.js";
3
- import { createBaseAppOptions } from "../common/index.js";
4
- import chalk from "chalk";
5
- import { getRandomColorForString } from "./getRandomColorForString.js";
6
- import { createPrefixer } from "./createPrefixer.js";
7
- const BASE_OPTIONS_GROUP = "Base Options:";
8
- const LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP = "Local AWS Lambda Development Options:";
9
- class WatchCommand {
10
- constructor(getProjectSdkService, stdioService, uiService){
11
- this.getProjectSdkService = getProjectSdkService;
12
- this.stdioService = stdioService;
13
- this.uiService = uiService;
14
- }
15
- async execute() {
16
- const projectSdk = await this.getProjectSdkService.execute();
17
- const stdio = this.stdioService;
18
- const ui = this.uiService;
19
- return {
20
- name: "watch",
21
- description: "Watches code changes for a specific app or package.",
22
- examples: [
23
- "watch api --env dev",
24
- "watch admin --env prod",
25
- "watch -p my-package1,my-package2",
26
- "watch api --env dev -p my-package1,my-package2"
27
- ],
28
- params: [
29
- {
30
- name: "app",
31
- description: "Name of the app (core, admin, or api)",
32
- type: "string"
33
- }
34
- ],
35
- options: [
36
- ...createBaseAppOptions(projectSdk, {
37
- env: {
38
- group: BASE_OPTIONS_GROUP
39
- },
40
- variant: {
41
- group: BASE_OPTIONS_GROUP
42
- },
43
- region: {
44
- group: BASE_OPTIONS_GROUP
45
- }
46
- }),
47
- {
48
- name: "package",
49
- alias: "p",
50
- description: "One or more packages that will be watched for code changes",
51
- type: "string",
52
- group: BASE_OPTIONS_GROUP
53
- },
54
- {
55
- name: "function",
56
- alias: "f",
57
- description: "Specify one or more AWS Lambda functions to watch (comma-separated)",
58
- type: "string",
59
- group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP
60
- },
61
- {
62
- name: "increase-timeout",
63
- default: 120,
64
- description: "Increase AWS Lambda function timeout (passed as number of seconds)",
65
- type: "number",
66
- group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP
67
- },
68
- {
69
- name: "increase-handshake-timeout",
70
- default: 5,
71
- description: "Increase timeout for the initial handshake between a single AWS Lambda invocation and local code execution (passed as number of seconds)",
72
- type: "number",
73
- group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP
74
- },
75
- {
76
- name: "inspect",
77
- alias: "i",
78
- description: "[EXPERIMENTAL] Enable Node debugger",
79
- type: "string",
80
- group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP
81
- },
82
- {
83
- name: "allow-production",
84
- default: false,
85
- description: "Enables running the watch command against environments marked as production environments (not recommended).",
86
- type: "number"
87
- },
88
- {
89
- name: "deployment-checks",
90
- default: true,
91
- description: "Enable or disable deployment checks. For example, if you are trying to watch the API app, but the 'api' app is not deployed yet, you will get a warning and the process will stop.",
92
- type: "boolean"
93
- }
94
- ],
95
- handler: async (params)=>{
96
- const { packagesWatcher } = await projectSdk.watch(params);
97
- const watchProcesses = packagesWatcher.prepare();
98
- if (1 === watchProcesses.length) {
99
- watchProcesses.setForkOptions({
100
- stdio: "inherit",
101
- env: process.env
102
- });
103
- const [firstProcess] = watchProcesses.getProcesses();
104
- ui.info("Watching %s package...", firstProcess.pkg.name);
105
- await firstProcess.run();
106
- return;
107
- }
108
- if (watchProcesses.length > 1) {
109
- ui.info("Watching %s packages...", watchProcesses.length);
110
- stdio.getStdout().setMaxListeners(20);
111
- stdio.getStderr().setMaxListeners(20);
112
- watchProcesses.forEach((watchProcess)=>{
113
- const { pkg } = watchProcess;
114
- const pkgPrefix = chalk.hex(getRandomColorForString(pkg.name))(pkg.name);
115
- watchProcess.pipeStdout((stdout)=>{
116
- const prefixedStdout = createPrefixer(pkgPrefix);
117
- stdout.pipe(prefixedStdout).pipe(stdio.getStdout());
118
- });
119
- watchProcess.pipeStderr((stderr)=>{
120
- const prefixedStderr = createPrefixer(pkgPrefix);
121
- stderr.pipe(prefixedStderr).pipe(stdio.getStderr());
122
- });
123
- });
124
- await Promise.all(watchProcesses.run());
125
- return;
126
- }
127
- ui.warning('No watch processes were started. Please ensure that you have specified valid "app" or "package" parameters.');
128
- }
129
- };
130
- }
131
- }
132
- const watchCommand = createImplementation({
133
- abstraction: CliCommandFactory,
134
- implementation: WatchCommand,
135
- dependencies: [
136
- GetProjectSdkService,
137
- StdioService,
138
- UiService
139
- ]
140
- });
141
- export { WatchCommand, watchCommand };
142
-
143
- //# sourceMappingURL=WatchCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/WatchCommand/WatchCommand.js","sources":["../../../src/features/WatchCommand/WatchCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n CliCommandFactory,\n GetProjectSdkService,\n StdioService,\n UiService\n} from \"~/abstractions/index.js\";\nimport { IBaseAppParams } from \"~/abstractions/features/types.js\";\nimport { createBaseAppOptions } from \"~/features/common/index.js\";\nimport chalk from \"chalk\";\nimport { getRandomColorForString } from \"./getRandomColorForString.js\";\nimport { createPrefixer } from \"./createPrefixer.js\";\n\nexport type IWatchCommandParams = IBaseAppParams;\n\nconst BASE_OPTIONS_GROUP = \"Base Options:\";\nconst LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP = \"Local AWS Lambda Development Options:\";\n\nexport class WatchCommand implements CliCommandFactory.Interface<IWatchCommandParams> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private stdioService: StdioService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute(): Promise<CliCommandFactory.CommandDefinition<IWatchCommandParams>> {\n const projectSdk = await this.getProjectSdkService.execute();\n const stdio = this.stdioService;\n const ui = this.uiService;\n\n return {\n name: \"watch\",\n description: \"Watches code changes for a specific app or package.\",\n examples: [\n \"watch api --env dev\",\n \"watch admin --env prod\",\n \"watch -p my-package1,my-package2\",\n \"watch api --env dev -p my-package1,my-package2\"\n ],\n params: [\n {\n name: \"app\",\n description: \"Name of the app (core, admin, or api)\",\n type: \"string\"\n }\n ],\n options: [\n ...createBaseAppOptions(projectSdk, {\n env: { group: BASE_OPTIONS_GROUP },\n variant: { group: BASE_OPTIONS_GROUP },\n region: { group: BASE_OPTIONS_GROUP }\n }),\n {\n name: \"package\",\n alias: \"p\",\n description: `One or more packages that will be watched for code changes`,\n type: \"string\",\n group: BASE_OPTIONS_GROUP\n },\n {\n name: \"function\",\n alias: \"f\",\n description:\n \"Specify one or more AWS Lambda functions to watch (comma-separated)\",\n type: \"string\",\n group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP\n },\n {\n name: \"increase-timeout\",\n default: 120,\n description:\n \"Increase AWS Lambda function timeout (passed as number of seconds)\",\n type: \"number\",\n group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP\n },\n {\n name: \"increase-handshake-timeout\",\n default: 5,\n description:\n \"Increase timeout for the initial handshake between a single AWS Lambda invocation and local code execution (passed as number of seconds)\",\n type: \"number\",\n group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP\n },\n {\n name: \"inspect\",\n alias: \"i\",\n description: \"[EXPERIMENTAL] Enable Node debugger\",\n type: \"string\",\n group: LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP\n },\n {\n name: \"allow-production\",\n default: false,\n description:\n \"Enables running the watch command against environments marked as production environments (not recommended).\",\n type: \"number\"\n },\n {\n name: \"deployment-checks\",\n default: true,\n description: `Enable or disable deployment checks. For example, if you are trying to watch the API app, but the 'api' app is not deployed yet, you will get a warning and the process will stop.`,\n type: \"boolean\"\n }\n ],\n handler: async (params: IWatchCommandParams) => {\n const { packagesWatcher } = await projectSdk.watch(params);\n\n // TODO: Revisit this.\n // if (webinyConfigWatcher) {\n // webinyConfigWatcher\n // .onError(err => {\n // ui.error(\n // `There is an error in your %s file: ${err.message}`,\n // \"webiny.config.tsx\"\n // );\n // })\n // .onSuccess(() => {\n // ui.success(`%s compiled successfully!`, \"webiny.config.tsx\");\n // })\n // .run();\n // }\n\n // TODO: Extract this logic into WatchRunners, same thing we have with BuildRunners.\n const watchProcesses = packagesWatcher.prepare();\n if (watchProcesses.length === 1) {\n watchProcesses.setForkOptions({\n stdio: \"inherit\",\n env: process.env\n });\n\n const [firstProcess] = watchProcesses.getProcesses();\n ui.info(`Watching %s package...`, firstProcess.pkg.name);\n\n await firstProcess.run();\n return;\n }\n\n if (watchProcesses.length > 1) {\n ui.info(`Watching %s packages...`, watchProcesses.length);\n\n stdio.getStdout().setMaxListeners(20);\n stdio.getStderr().setMaxListeners(20);\n\n watchProcesses.forEach(watchProcess => {\n const { pkg } = watchProcess;\n const pkgPrefix = chalk.hex(getRandomColorForString(pkg.name))(pkg.name);\n\n watchProcess.pipeStdout(stdout => {\n const prefixedStdout = createPrefixer(pkgPrefix);\n stdout.pipe(prefixedStdout).pipe(stdio.getStdout());\n });\n\n watchProcess.pipeStderr(stderr => {\n const prefixedStderr = createPrefixer(pkgPrefix);\n stderr.pipe(prefixedStderr).pipe(stdio.getStderr());\n });\n });\n\n await Promise.all(watchProcesses.run());\n return;\n }\n\n ui.warning(\n `No watch processes were started. Please ensure that you have specified valid \"app\" or \"package\" parameters.`\n );\n }\n };\n }\n}\n\nexport const watchCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: WatchCommand,\n dependencies: [GetProjectSdkService, StdioService, UiService]\n});\n"],"names":["BASE_OPTIONS_GROUP","LOCAL_AWS_LAMBDA_DEVELOPMENT_GROUP","WatchCommand","getProjectSdkService","stdioService","uiService","projectSdk","stdio","ui","createBaseAppOptions","params","packagesWatcher","watchProcesses","process","firstProcess","watchProcess","pkg","pkgPrefix","chalk","getRandomColorForString","stdout","prefixedStdout","createPrefixer","stderr","prefixedStderr","Promise","watchCommand","createImplementation","CliCommandFactory","GetProjectSdkService","StdioService","UiService"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import { Transform } from "node:stream";
2
- export declare function createPrefixer(prefix: string): Transform;
@@ -1,16 +0,0 @@
1
- import { Transform } from "node:stream";
2
- function createPrefixer(prefix) {
3
- return new Transform({
4
- readableObjectMode: true,
5
- writableObjectMode: true,
6
- transform (chunk, encoding, callback) {
7
- const str = chunk.toString();
8
- const lines = str.split(/\r?\n/);
9
- for(let i = 0; i < lines.length; i++)if ("" !== lines[i].trim()) this.push(`${prefix}: ${lines[i]}\n`);
10
- callback();
11
- }
12
- });
13
- }
14
- export { createPrefixer };
15
-
16
- //# sourceMappingURL=createPrefixer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/WatchCommand/createPrefixer.js","sources":["../../../src/features/WatchCommand/createPrefixer.ts"],"sourcesContent":["import { Transform } from \"node:stream\";\n\nexport function createPrefixer(prefix: string) {\n // This returns a Transform stream that prefixes each line\n return new Transform({\n readableObjectMode: true,\n writableObjectMode: true,\n transform(chunk, encoding, callback) {\n const str = chunk.toString();\n const lines = str.split(/\\r?\\n/);\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim() !== \"\") {\n this.push(`${prefix}: ${lines[i]}\\n`);\n }\n }\n callback();\n }\n });\n}\n"],"names":["createPrefixer","prefix","Transform","chunk","encoding","callback","str","lines","i"],"mappings":";AAEO,SAASA,eAAeC,MAAc;IAEzC,OAAO,IAAIC,UAAU;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,WAAUC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ;YAC/B,MAAMC,MAAMH,MAAM,QAAQ;YAC1B,MAAMI,QAAQD,IAAI,KAAK,CAAC;YACxB,IAAK,IAAIE,IAAI,GAAGA,IAAID,MAAM,MAAM,EAAEC,IAC9B,IAAID,AAAoB,OAApBA,KAAK,CAACC,EAAE,CAAC,IAAI,IACb,IAAI,CAAC,IAAI,CAAC,GAAGP,OAAO,EAAE,EAAEM,KAAK,CAACC,EAAE,CAAC,EAAE,CAAC;YAG5CH;QACJ;IACJ;AACJ"}
@@ -1 +0,0 @@
1
- export declare const getRandomColorForString: (value: string) => string;
@@ -1,89 +0,0 @@
1
- const colors = [
2
- "#0000CC",
3
- "#0000FF",
4
- "#0033CC",
5
- "#0033FF",
6
- "#0066CC",
7
- "#0066FF",
8
- "#0099CC",
9
- "#0099FF",
10
- "#00CC00",
11
- "#00CC33",
12
- "#00CC66",
13
- "#00CC99",
14
- "#00CCCC",
15
- "#00CCFF",
16
- "#3300CC",
17
- "#3300FF",
18
- "#3333CC",
19
- "#3333FF",
20
- "#3366CC",
21
- "#3366FF",
22
- "#3399CC",
23
- "#3399FF",
24
- "#33CC00",
25
- "#33CC33",
26
- "#33CC66",
27
- "#33CC99",
28
- "#33CCCC",
29
- "#33CCFF",
30
- "#6600CC",
31
- "#6600FF",
32
- "#6633CC",
33
- "#6633FF",
34
- "#66CC00",
35
- "#66CC33",
36
- "#9900CC",
37
- "#9900FF",
38
- "#9933CC",
39
- "#9933FF",
40
- "#99CC00",
41
- "#99CC33",
42
- "#CC0000",
43
- "#CC0033",
44
- "#CC0066",
45
- "#CC0099",
46
- "#CC00CC",
47
- "#CC00FF",
48
- "#CC3300",
49
- "#CC3333",
50
- "#CC3366",
51
- "#CC3399",
52
- "#CC33CC",
53
- "#CC33FF",
54
- "#CC6600",
55
- "#CC6633",
56
- "#CC9900",
57
- "#CC9933",
58
- "#CCCC00",
59
- "#CCCC33",
60
- "#FF0000",
61
- "#FF0033",
62
- "#FF0066",
63
- "#FF0099",
64
- "#FF00CC",
65
- "#FF00FF",
66
- "#FF3300",
67
- "#FF3333",
68
- "#FF3366",
69
- "#FF3399",
70
- "#FF33CC",
71
- "#FF33FF",
72
- "#FF6600",
73
- "#FF6633",
74
- "#FF9900",
75
- "#FF9933",
76
- "#FFCC00",
77
- "#FFCC33"
78
- ];
79
- const getRandomColorForString = (value)=>{
80
- let hash = 0;
81
- for(let i = 0; i < value.length; i++){
82
- hash = (hash << 5) - hash + value.charCodeAt(i);
83
- hash |= 0;
84
- }
85
- return colors[Math.abs(hash) % colors.length];
86
- };
87
- export { getRandomColorForString };
88
-
89
- //# sourceMappingURL=getRandomColorForString.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/WatchCommand/getRandomColorForString.js","sources":["../../../src/features/WatchCommand/getRandomColorForString.ts"],"sourcesContent":["const colors = [\n \"#0000CC\",\n \"#0000FF\",\n \"#0033CC\",\n \"#0033FF\",\n \"#0066CC\",\n \"#0066FF\",\n \"#0099CC\",\n \"#0099FF\",\n \"#00CC00\",\n \"#00CC33\",\n \"#00CC66\",\n \"#00CC99\",\n \"#00CCCC\",\n \"#00CCFF\",\n \"#3300CC\",\n \"#3300FF\",\n \"#3333CC\",\n \"#3333FF\",\n \"#3366CC\",\n \"#3366FF\",\n \"#3399CC\",\n \"#3399FF\",\n \"#33CC00\",\n \"#33CC33\",\n \"#33CC66\",\n \"#33CC99\",\n \"#33CCCC\",\n \"#33CCFF\",\n \"#6600CC\",\n \"#6600FF\",\n \"#6633CC\",\n \"#6633FF\",\n \"#66CC00\",\n \"#66CC33\",\n \"#9900CC\",\n \"#9900FF\",\n \"#9933CC\",\n \"#9933FF\",\n \"#99CC00\",\n \"#99CC33\",\n \"#CC0000\",\n \"#CC0033\",\n \"#CC0066\",\n \"#CC0099\",\n \"#CC00CC\",\n \"#CC00FF\",\n \"#CC3300\",\n \"#CC3333\",\n \"#CC3366\",\n \"#CC3399\",\n \"#CC33CC\",\n \"#CC33FF\",\n \"#CC6600\",\n \"#CC6633\",\n \"#CC9900\",\n \"#CC9933\",\n \"#CCCC00\",\n \"#CCCC33\",\n \"#FF0000\",\n \"#FF0033\",\n \"#FF0066\",\n \"#FF0099\",\n \"#FF00CC\",\n \"#FF00FF\",\n \"#FF3300\",\n \"#FF3333\",\n \"#FF3366\",\n \"#FF3399\",\n \"#FF33CC\",\n \"#FF33FF\",\n \"#FF6600\",\n \"#FF6633\",\n \"#FF9900\",\n \"#FF9933\",\n \"#FFCC00\",\n \"#FFCC33\"\n];\n\nexport const getRandomColorForString = (value: string) => {\n let hash = 0;\n\n for (let i = 0; i < value.length; i++) {\n hash = (hash << 5) - hash + value.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length];\n};\n"],"names":["colors","getRandomColorForString","value","hash","i","Math"],"mappings":"AAAA,MAAMA,SAAS;IACX;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAEM,MAAMC,0BAA0B,CAACC;IACpC,IAAIC,OAAO;IAEX,IAAK,IAAIC,IAAI,GAAGA,IAAIF,MAAM,MAAM,EAAEE,IAAK;QACnCD,OAAQA,AAAAA,CAAAA,QAAQ,KAAKA,OAAOD,MAAM,UAAU,CAACE;QAC7CD,QAAQ;IACZ;IAEA,OAAOH,MAAM,CAACK,KAAK,GAAG,CAACF,QAAQH,OAAO,MAAM,CAAC;AACjD"}
@@ -1 +0,0 @@
1
- export * from "./WatchCommand.js";
@@ -1 +0,0 @@
1
- export * from "./WatchCommand.js";
@@ -1,6 +0,0 @@
1
- import { ErrorHandler } from "../../abstractions/index.js";
2
- import { IBaseAppParams } from "../../abstractions/features/types.js";
3
- export declare class DdbPutItemConditionalCheckFailedGracefulErrorHandler implements ErrorHandler.Interface<IBaseAppParams> {
4
- execute({ error }: ErrorHandler.Params<IBaseAppParams>): void;
5
- }
6
- export declare const ddbPutItemConditionalCheckFailedGracefulErrorHandler: import("@webiny/di").Implementation<typeof DdbPutItemConditionalCheckFailedGracefulErrorHandler>;
@@ -1,27 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { ErrorHandler } from "../../abstractions/index.js";
3
- import { GracefulError } from "@webiny/project";
4
- const MATCH_STRING = "ConditionalCheckFailedException: The conditional request failed";
5
- const LEARN_MORE_URL = "https://webiny.link/deployment-ddb-conditional-check-failed";
6
- class DdbPutItemConditionalCheckFailedGracefulErrorHandler {
7
- execute({ error }) {
8
- if (!error.message) return;
9
- if (!error.message.includes(MATCH_STRING)) return;
10
- const message = [
11
- "Looks like the deployment failed because Pulumi tried to insert a",
12
- "record into a DynamoDB table, but the record already exists. The",
13
- "easiest way to resolve this is to delete the record from the",
14
- "table and try again.",
15
- `Learn more: ${LEARN_MORE_URL}`
16
- ].join(" ");
17
- throw GracefulError.from(error, message);
18
- }
19
- }
20
- const ddbPutItemConditionalCheckFailedGracefulErrorHandler = createImplementation({
21
- abstraction: ErrorHandler,
22
- implementation: DdbPutItemConditionalCheckFailedGracefulErrorHandler,
23
- dependencies: []
24
- });
25
- export { DdbPutItemConditionalCheckFailedGracefulErrorHandler, ddbPutItemConditionalCheckFailedGracefulErrorHandler };
26
-
27
- //# sourceMappingURL=DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js","sources":["../../../src/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { ErrorHandler } from \"~/abstractions/index.js\";\nimport { IBaseAppParams } from \"~/abstractions/features/types.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst MATCH_STRING = \"ConditionalCheckFailedException: The conditional request failed\";\nconst LEARN_MORE_URL = \"https://webiny.link/deployment-ddb-conditional-check-failed\";\n\nexport class DdbPutItemConditionalCheckFailedGracefulErrorHandler implements ErrorHandler.Interface<IBaseAppParams> {\n execute({ error }: ErrorHandler.Params<IBaseAppParams>) {\n if (!error.message) {\n return;\n }\n\n if (!error.message.includes(MATCH_STRING)) {\n return;\n }\n\n const message = [\n `Looks like the deployment failed because Pulumi tried to insert a`,\n `record into a DynamoDB table, but the record already exists. The`,\n `easiest way to resolve this is to delete the record from the`,\n `table and try again.`,\n `Learn more: ${LEARN_MORE_URL}`\n ].join(\" \");\n\n throw GracefulError.from(error, message);\n }\n}\n\nexport const ddbPutItemConditionalCheckFailedGracefulErrorHandler = createImplementation({\n abstraction: ErrorHandler,\n implementation: DdbPutItemConditionalCheckFailedGracefulErrorHandler,\n dependencies: []\n});\n"],"names":["MATCH_STRING","LEARN_MORE_URL","DdbPutItemConditionalCheckFailedGracefulErrorHandler","error","message","GracefulError","ddbPutItemConditionalCheckFailedGracefulErrorHandler","createImplementation","ErrorHandler"],"mappings":";;;AAKA,MAAMA,eAAe;AACrB,MAAMC,iBAAiB;AAEhB,MAAMC;IACT,QAAQ,EAAEC,KAAK,EAAuC,EAAE;QACpD,IAAI,CAACA,MAAM,OAAO,EACd;QAGJ,IAAI,CAACA,MAAM,OAAO,CAAC,QAAQ,CAACH,eACxB;QAGJ,MAAMI,UAAU;YACZ;YACA;YACA;YACA;YACA,CAAC,YAAY,EAAEH,gBAAgB;SAClC,CAAC,IAAI,CAAC;QAEP,MAAMI,cAAc,IAAI,CAACF,OAAOC;IACpC;AACJ;AAEO,MAAME,uDAAuDC,qBAAqB;IACrF,aAAaC;IACb,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
@@ -1,6 +0,0 @@
1
- import { ErrorHandler } from "../../abstractions/index.js";
2
- import { IBaseAppParams } from "../../abstractions/features/types.js";
3
- export declare class PendingOperationsGracefulErrorHandler implements ErrorHandler.Interface<IBaseAppParams> {
4
- execute({ error, params }: ErrorHandler.Params<IBaseAppParams>): void;
5
- }
6
- export declare const pendingOperationsGracefulErrorHandler: import("@webiny/di").Implementation<typeof PendingOperationsGracefulErrorHandler>;
@@ -1,29 +0,0 @@
1
- import { createImplementation } from "@webiny/di";
2
- import { ErrorHandler } from "../../abstractions/index.js";
3
- import { GracefulError } from "@webiny/project";
4
- const MATCH_STRING = "the stack is currently locked";
5
- const LEARN_MORE_URL = "https://webiny.link/locked-stacks";
6
- class PendingOperationsGracefulErrorHandler {
7
- execute({ error, params }) {
8
- if (!error.message) return;
9
- if (!error.message.includes(MATCH_STRING)) return;
10
- const appName = params.app ? params.app : "{APP_NAME}";
11
- const message = [
12
- "The Pulumi error you've just experienced can occur",
13
- "if one of the previous deployments has been interrupted or another deployment",
14
- "is already in progress. For development purposes, the quickest way to get",
15
- "past this issue is to run the following command: %s.",
16
- `Learn more: ${LEARN_MORE_URL}`
17
- ].join(" ");
18
- const cmd = `yarn webiny pulumi ${appName} --env ${params.env} -- cancel`;
19
- throw GracefulError.from(error, message, cmd);
20
- }
21
- }
22
- const pendingOperationsGracefulErrorHandler = createImplementation({
23
- abstraction: ErrorHandler,
24
- implementation: PendingOperationsGracefulErrorHandler,
25
- dependencies: []
26
- });
27
- export { PendingOperationsGracefulErrorHandler, pendingOperationsGracefulErrorHandler };
28
-
29
- //# sourceMappingURL=PendingOperationsGracefulErrorHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js","sources":["../../../src/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { ErrorHandler } from \"~/abstractions/index.js\";\nimport { IBaseAppParams } from \"~/abstractions/features/types.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst MATCH_STRING = \"the stack is currently locked\";\nconst LEARN_MORE_URL = \"https://webiny.link/locked-stacks\";\n\nexport class PendingOperationsGracefulErrorHandler implements ErrorHandler.Interface<IBaseAppParams> {\n execute({ error, params }: ErrorHandler.Params<IBaseAppParams>) {\n if (!error.message) {\n return;\n }\n\n if (!error.message.includes(MATCH_STRING)) {\n return;\n }\n\n const appName = params.app ? params.app : \"{APP_NAME}\";\n\n const message = [\n `The Pulumi error you've just experienced can occur`,\n `if one of the previous deployments has been interrupted or another deployment`,\n `is already in progress. For development purposes, the quickest way to get`,\n `past this issue is to run the following command: %s.`,\n `Learn more: ${LEARN_MORE_URL}`\n ].join(\" \");\n\n const cmd = `yarn webiny pulumi ${appName} --env ${params.env} -- cancel`;\n throw GracefulError.from(error, message, cmd);\n }\n}\n\nexport const pendingOperationsGracefulErrorHandler = createImplementation({\n abstraction: ErrorHandler,\n implementation: PendingOperationsGracefulErrorHandler,\n dependencies: []\n});\n"],"names":["MATCH_STRING","LEARN_MORE_URL","PendingOperationsGracefulErrorHandler","error","params","appName","message","cmd","GracefulError","pendingOperationsGracefulErrorHandler","createImplementation","ErrorHandler"],"mappings":";;;AAKA,MAAMA,eAAe;AACrB,MAAMC,iBAAiB;AAEhB,MAAMC;IACT,QAAQ,EAAEC,KAAK,EAAEC,MAAM,EAAuC,EAAE;QAC5D,IAAI,CAACD,MAAM,OAAO,EACd;QAGJ,IAAI,CAACA,MAAM,OAAO,CAAC,QAAQ,CAACH,eACxB;QAGJ,MAAMK,UAAUD,OAAO,GAAG,GAAGA,OAAO,GAAG,GAAG;QAE1C,MAAME,UAAU;YACZ;YACA;YACA;YACA;YACA,CAAC,YAAY,EAAEL,gBAAgB;SAClC,CAAC,IAAI,CAAC;QAEP,MAAMM,MAAM,CAAC,mBAAmB,EAAEF,QAAQ,OAAO,EAAED,OAAO,GAAG,CAAC,UAAU,CAAC;QACzE,MAAMI,cAAc,IAAI,CAACL,OAAOG,SAASC;IAC7C;AACJ;AAEO,MAAME,wCAAwCC,qBAAqB;IACtE,aAAaC;IACb,gBAAgBT;IAChB,cAAc,EAAE;AACpB"}