@webiny/cli-core 0.0.0-unstable.6844005670 → 0.0.0-unstable.7be00a75a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cli.js +12 -11
- package/Cli.js.map +1 -1
- package/abstractions/createAbstraction.js +3 -2
- package/abstractions/createAbstraction.js.map +1 -1
- package/abstractions/features/CliCommand.d.ts +3 -0
- package/abstractions/features/CliCommand.js +2 -1
- package/abstractions/features/CliCommand.js.map +1 -1
- package/abstractions/features/ErrorHandler.js +2 -1
- package/abstractions/features/ErrorHandler.js.map +1 -1
- package/abstractions/features/GlobalCliOption.js +2 -1
- package/abstractions/features/GlobalCliOption.js.map +1 -1
- package/abstractions/features/IsCi.js +2 -1
- package/abstractions/features/IsCi.js.map +1 -1
- package/abstractions/features/index.js +0 -2
- package/abstractions/features/types.js +0 -3
- package/abstractions/index.js +0 -2
- package/abstractions/services/ArgvParserService.js +2 -1
- package/abstractions/services/ArgvParserService.js.map +1 -1
- package/abstractions/services/CliParamsService.js +2 -1
- package/abstractions/services/CliParamsService.js.map +1 -1
- package/abstractions/services/CommandsRegistryService.js +2 -1
- package/abstractions/services/CommandsRegistryService.js.map +1 -1
- package/abstractions/services/GetArgvService.js +2 -1
- package/abstractions/services/GetArgvService.js.map +1 -1
- package/abstractions/services/GetCliRunnerService.js +2 -1
- package/abstractions/services/GetCliRunnerService.js.map +1 -1
- package/abstractions/services/GetIsCiService.js +2 -1
- package/abstractions/services/GetIsCiService.js.map +1 -1
- package/abstractions/services/GetProjectSdkService.js +2 -1
- package/abstractions/services/GetProjectSdkService.js.map +1 -1
- package/abstractions/services/GlobalOptionsRegistryService.js +2 -1
- package/abstractions/services/GlobalOptionsRegistryService.js.map +1 -1
- package/abstractions/services/LoggerService.js +2 -1
- package/abstractions/services/LoggerService.js.map +1 -1
- package/abstractions/services/RunCliRunnerService.js +2 -1
- package/abstractions/services/RunCliRunnerService.js.map +1 -1
- package/abstractions/services/StdioService.js +2 -1
- package/abstractions/services/StdioService.js.map +1 -1
- package/abstractions/services/UiService.js +2 -1
- package/abstractions/services/UiService.js.map +1 -1
- package/abstractions/services/index.js +0 -2
- package/createCliContainer.js +89 -118
- package/createCliContainer.js.map +1 -1
- package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
- package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
- package/decorators/DeployCommandWithTelemetry.js +72 -82
- package/decorators/DeployCommandWithTelemetry.js.map +1 -1
- package/decorators/index.js +0 -2
- package/exports/cli/command.js +0 -2
- package/exports/cli.d.ts +2 -0
- package/exports/cli.js +2 -0
- package/extensions/CliCommand.d.ts +3 -7
- package/extensions/CliCommand.js +15 -18
- package/extensions/CliCommand.js.map +1 -1
- package/extensions/CliCommandDecorator.d.ts +3 -7
- package/extensions/CliCommandDecorator.js +15 -18
- package/extensions/CliCommandDecorator.js.map +1 -1
- package/extensions/index.d.ts +2 -6
- package/extensions/index.js +5 -2
- package/extensions/index.js.map +1 -1
- package/features/AboutCommand.js +80 -86
- package/features/AboutCommand.js.map +1 -1
- package/features/BuildCommand/BuildCommand.js +46 -36
- package/features/BuildCommand/BuildCommand.js.map +1 -1
- package/features/BuildCommand/buildRunners/BaseBuildRunner.js +10 -13
- package/features/BuildCommand/buildRunners/BaseBuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/BuildRunner.js +18 -21
- package/features/BuildCommand/buildRunners/BuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js +20 -19
- package/features/BuildCommand/buildRunners/MultipleBuildsRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/SingleBuildRunner.js +15 -14
- package/features/BuildCommand/buildRunners/SingleBuildRunner.js.map +1 -1
- package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js +3 -4
- package/features/BuildCommand/buildRunners/ZeroBuildsRunner.js.map +1 -1
- package/features/BuildCommand/index.js +0 -2
- package/features/ConfigCommand.js +55 -56
- package/features/ConfigCommand.js.map +1 -1
- package/features/DeployCommand/DeployCommand.d.ts +1 -1
- package/features/DeployCommand/DeployCommand.js +164 -156
- package/features/DeployCommand/DeployCommand.js.map +1 -1
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +12 -17
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/DeployOutput.js +16 -17
- package/features/DeployCommand/deployOutputs/DeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js +89 -54
- package/features/DeployCommand/deployOutputs/NoDeploymentLogsDeployOutput.js.map +1 -1
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js +24 -37
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +1 -1
- package/features/DeployCommand/index.js +0 -2
- package/features/DepsSync/BuildDependencyTree.js +16 -21
- package/features/DepsSync/BuildDependencyTree.js.map +1 -1
- package/features/DepsSync/DependencyTree.js +108 -119
- package/features/DepsSync/DependencyTree.js.map +1 -1
- package/features/DepsSync/ListAllPackageJsonFiles.js +19 -14
- package/features/DepsSync/ListAllPackageJsonFiles.js.map +1 -1
- package/features/DepsSync/ListAllPackages.js +7 -9
- package/features/DepsSync/ListAllPackages.js.map +1 -1
- package/features/DepsSync/commands/SyncDepsCommand.js +30 -24
- package/features/DepsSync/commands/SyncDepsCommand.js.map +1 -1
- package/features/DepsSync/commands/VerifyDepsCommand.js +69 -70
- package/features/DepsSync/commands/VerifyDepsCommand.js.map +1 -1
- package/features/DepsSync/createDependencyTree.js +25 -18
- package/features/DepsSync/createDependencyTree.js.map +1 -1
- package/features/DepsSync/createReferenceFile.js +21 -25
- package/features/DepsSync/createReferenceFile.js.map +1 -1
- package/features/DepsSync/index.js +0 -2
- package/features/DepsSync/paths.js +3 -6
- package/features/DepsSync/paths.js.map +1 -1
- package/features/DepsSync/types.js +7 -6
- package/features/DepsSync/types.js.map +1 -1
- package/features/DestroyCommand/DestroyCommand.js +71 -67
- package/features/DestroyCommand/DestroyCommand.js.map +1 -1
- package/features/DestroyCommand/index.js +0 -2
- package/features/DisableTelemetryCommand.js +28 -25
- package/features/DisableTelemetryCommand.js.map +1 -1
- package/features/EnableTelemetryCommand.js +28 -25
- package/features/EnableTelemetryCommand.js.map +1 -1
- package/features/ExtensionCommand/ExtensionCommand.js +60 -63
- package/features/ExtensionCommand/ExtensionCommand.js.map +1 -1
- package/features/ExtensionCommand/index.js +0 -2
- package/features/InfoCommand/InfoCommand.js +54 -56
- package/features/InfoCommand/InfoCommand.js.map +1 -1
- package/features/InfoCommand/PrintInfoForEnv.js +31 -47
- package/features/InfoCommand/PrintInfoForEnv.js.map +1 -1
- package/features/InfoCommand/index.js +0 -2
- package/features/IsCi/IsCi.js +14 -11
- package/features/IsCi/IsCi.js.map +1 -1
- package/features/IsCi/index.js +1 -3
- package/features/OpenCommand.js +48 -47
- package/features/OpenCommand.js.map +1 -1
- package/features/OutputCommand.js +56 -69
- package/features/OutputCommand.js.map +1 -1
- package/features/PulumiCommand/PulumiCommand.js +48 -41
- package/features/PulumiCommand/PulumiCommand.js.map +1 -1
- package/features/PulumiCommand/index.js +0 -2
- package/features/RefreshCommand/RefreshCommand.js +42 -36
- package/features/RefreshCommand/RefreshCommand.js.map +1 -1
- package/features/RefreshCommand/index.js +0 -2
- package/features/UpgradeCommand/UpgradeCommand.d.ts +29 -0
- package/features/UpgradeCommand/UpgradeCommand.js +123 -0
- package/features/UpgradeCommand/UpgradeCommand.js.map +1 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.d.ts +11 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.js +102 -0
- package/features/UpgradeCommand/UpgradeCommandHandler.js.map +1 -0
- package/features/UpgradeCommand/abstraction.d.ts +23 -0
- package/features/UpgradeCommand/abstraction.js +5 -0
- package/features/UpgradeCommand/abstraction.js.map +1 -0
- package/features/UpgradeCommand/feature.d.ts +4 -0
- package/features/UpgradeCommand/feature.js +13 -0
- package/features/UpgradeCommand/feature.js.map +1 -0
- package/features/UpgradeCommand/index.d.ts +2 -0
- package/features/UpgradeCommand/index.js +2 -0
- package/features/WatchCommand/WatchCommand.js +131 -131
- package/features/WatchCommand/WatchCommand.js.map +1 -1
- package/features/WatchCommand/createPrefixer.js +11 -15
- package/features/WatchCommand/createPrefixer.js.map +1 -1
- package/features/WatchCommand/getRandomColorForString.js +86 -8
- package/features/WatchCommand/getRandomColorForString.js.map +1 -1
- package/features/WatchCommand/index.js +0 -2
- package/features/Wcp/LinkProjectCommand.js +119 -138
- package/features/Wcp/LinkProjectCommand.js.map +1 -1
- package/features/Wcp/LoginCommand.js +104 -118
- package/features/Wcp/LoginCommand.js.map +1 -1
- package/features/Wcp/LogoutCommand.js +29 -23
- package/features/Wcp/LogoutCommand.js.map +1 -1
- package/features/Wcp/WhoAmICommand.js +33 -29
- package/features/Wcp/WhoAmICommand.js.map +1 -1
- package/features/common/index.js +0 -2
- package/features/common/options.js +41 -50
- package/features/common/options.js.map +1 -1
- package/features/globalOptions/LogLevelGlobalOption.js +25 -16
- package/features/globalOptions/LogLevelGlobalOption.js.map +1 -1
- package/features/globalOptions/ShowLogsGlobalOption.js +16 -15
- package/features/globalOptions/ShowLogsGlobalOption.js.map +1 -1
- package/features/globalOptions/StackTraceGlobalOption.js +16 -15
- package/features/globalOptions/StackTraceGlobalOption.js.map +1 -1
- package/features/globalOptions/index.js +0 -2
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +17 -16
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js +19 -19
- package/features/gracefulErrorHandlers/PendingOperationsGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/index.js +0 -2
- package/features/index.d.ts +1 -0
- package/features/index.js +1 -2
- package/features/utils/index.js +0 -2
- package/features/utils/measureDuration.js +7 -8
- package/features/utils/measureDuration.js.map +1 -1
- package/index.js +0 -2
- package/package.json +29 -24
- package/services/ArgvParserService/ArgvParserService.js +27 -33
- package/services/ArgvParserService/ArgvParserService.js.map +1 -1
- package/services/ArgvParserService/index.js +0 -2
- package/services/CliParamsService/CliParamsService.js +18 -15
- package/services/CliParamsService/CliParamsService.js.map +1 -1
- package/services/CliParamsService/index.js +0 -2
- package/services/CommandsRegistryService/CommandsRegistryService.js +19 -13
- package/services/CommandsRegistryService/CommandsRegistryService.js.map +1 -1
- package/services/CommandsRegistryService/index.js +0 -2
- package/services/GetArgvService/GetArgvService.js +14 -11
- package/services/GetArgvService/GetArgvService.js.map +1 -1
- package/services/GetArgvService/index.js +0 -2
- package/services/GetCliRunnerService/GetCliRunnerService.js +119 -148
- package/services/GetCliRunnerService/GetCliRunnerService.js.map +1 -1
- package/services/GetCliRunnerService/index.js +0 -2
- package/services/GetIsCiService/GetIsCiService.js +9 -8
- package/services/GetIsCiService/GetIsCiService.js.map +1 -1
- package/services/GetIsCiService/index.js +1 -3
- package/services/GetProjectSdkService/GetProjectSdkService.js +25 -24
- package/services/GetProjectSdkService/GetProjectSdkService.js.map +1 -1
- package/services/GetProjectSdkService/index.js +0 -2
- package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js +19 -13
- package/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js.map +1 -1
- package/services/GlobalOptionsRegistryService/index.js +0 -2
- package/services/LoggerService/LoggerService.js +76 -88
- package/services/LoggerService/LoggerService.js.map +1 -1
- package/services/LoggerService/index.js +0 -2
- package/services/RunCliRunnerService/RunCliRunnerService.js +15 -13
- package/services/RunCliRunnerService/RunCliRunnerService.js.map +1 -1
- package/services/RunCliRunnerService/index.js +0 -2
- package/services/StdioService/StdioService.js +15 -14
- package/services/StdioService/StdioService.js.map +1 -1
- package/services/StdioService/index.js +0 -2
- package/services/UiService/UiService.js +55 -58
- package/services/UiService/UiService.js.map +1 -1
- package/services/UiService/index.js +0 -2
- package/services/index.js +0 -2
- package/utils/ManuallyReportedError.js +7 -6
- package/utils/ManuallyReportedError.js.map +1 -1
- package/abstractions/features/index.js.map +0 -1
- package/abstractions/features/types.js.map +0 -1
- package/abstractions/index.js.map +0 -1
- package/abstractions/services/index.js.map +0 -1
- package/decorators/index.js.map +0 -1
- package/exports/cli/command.js.map +0 -1
- package/exports/cli/index.d.ts +0 -2
- package/exports/cli/index.js +0 -4
- package/exports/cli/index.js.map +0 -1
- package/features/BuildCommand/index.js.map +0 -1
- package/features/DeployCommand/index.js.map +0 -1
- package/features/DepsSync/index.js.map +0 -1
- package/features/DestroyCommand/index.js.map +0 -1
- package/features/ExtensionCommand/index.js.map +0 -1
- package/features/InfoCommand/index.js.map +0 -1
- package/features/IsCi/index.js.map +0 -1
- package/features/PulumiCommand/index.js.map +0 -1
- package/features/RefreshCommand/index.js.map +0 -1
- package/features/WatchCommand/index.js.map +0 -1
- package/features/common/index.js.map +0 -1
- package/features/globalOptions/index.js.map +0 -1
- package/features/gracefulErrorHandlers/index.js.map +0 -1
- package/features/index.js.map +0 -1
- package/features/utils/index.js.map +0 -1
- package/index.js.map +0 -1
- package/services/ArgvParserService/index.js.map +0 -1
- package/services/CliParamsService/index.js.map +0 -1
- package/services/CommandsRegistryService/index.js.map +0 -1
- package/services/GetArgvService/index.js.map +0 -1
- package/services/GetCliRunnerService/index.js.map +0 -1
- package/services/GetIsCiService/index.js.map +0 -1
- package/services/GetProjectSdkService/index.js.map +0 -1
- package/services/GlobalOptionsRegistryService/index.js.map +0 -1
- package/services/LoggerService/index.js.map +0 -1
- package/services/RunCliRunnerService/index.js.map +0 -1
- package/services/StdioService/index.js.map +0 -1
- package/services/UiService/index.js.map +0 -1
- package/services/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.js","sources":["../../../src/services/GlobalOptionsRegistryService/GlobalOptionsRegistryService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GlobalCliOption, GlobalOptionsRegistryService } from \"~/abstractions/index.js\";\n\nexport class DefaultGlobalOptionsRegistryService implements GlobalOptionsRegistryService.Interface {\n constructor(private globalOptions: GlobalCliOption.Interface[]) {}\n\n execute() {\n return this.globalOptions;\n }\n}\n\nexport const globalOptionsRegistryService = createImplementation({\n abstraction: GlobalOptionsRegistryService,\n implementation: DefaultGlobalOptionsRegistryService,\n dependencies: [[GlobalCliOption, { multiple: true }]]\n});\n"],"names":["DefaultGlobalOptionsRegistryService","globalOptions","globalOptionsRegistryService","createImplementation","GlobalOptionsRegistryService","GlobalCliOption"],"mappings":";;AAGO,MAAMA;IACT,YAAoBC,aAA0C,CAAE;aAA5CA,aAAa,GAAbA;IAA6C;IAEjE,UAAU;QACN,OAAO,IAAI,CAAC,aAAa;IAC7B;AACJ;AAEO,MAAMC,+BAA+BC,qBAAqB;IAC7D,aAAaC;IACb,gBAAgBJ;IAChB,cAAc;QAAC;YAACK;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACzD"}
|
|
@@ -1,100 +1,88 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { GetArgvService, LoggerService } from "../../abstractions/index.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import findUp from "find-up";
|
|
3
|
+
import node_path from "node:path";
|
|
4
|
+
import { findUpSync } from "find-up";
|
|
6
5
|
import { pino } from "pino";
|
|
7
|
-
import
|
|
6
|
+
import pino_pretty from "pino-pretty";
|
|
7
|
+
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
8
8
|
const DEFAULT_LOG_LEVEL = "info";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
trace(message, ...optionalParams) {
|
|
15
|
-
const logger = this.getLogger();
|
|
16
|
-
logger.trace(message, ...optionalParams);
|
|
17
|
-
}
|
|
18
|
-
fatal(message, ...optionalParams) {
|
|
19
|
-
const logger = this.getLogger();
|
|
20
|
-
logger.fatal(message, ...optionalParams);
|
|
21
|
-
}
|
|
22
|
-
debug(message, ...optionalParams) {
|
|
23
|
-
const logger = this.getLogger();
|
|
24
|
-
logger.debug(message, ...optionalParams);
|
|
25
|
-
}
|
|
26
|
-
info(message, ...optionalParams) {
|
|
27
|
-
const logger = this.getLogger();
|
|
28
|
-
logger.info(message, ...optionalParams);
|
|
29
|
-
}
|
|
30
|
-
warn(message, ...optionalParams) {
|
|
31
|
-
const logger = this.getLogger();
|
|
32
|
-
logger.warn(message, ...optionalParams);
|
|
33
|
-
}
|
|
34
|
-
error(message, ...optionalParams) {
|
|
35
|
-
const logger = this.getLogger();
|
|
36
|
-
logger.error(message, ...optionalParams);
|
|
37
|
-
}
|
|
38
|
-
log(message, ...optionalParams) {
|
|
39
|
-
const logger = this.getLogger();
|
|
40
|
-
logger.info(message, ...optionalParams);
|
|
41
|
-
}
|
|
42
|
-
getLogger() {
|
|
43
|
-
if (this.pinoLogger) {
|
|
44
|
-
return this.pinoLogger;
|
|
9
|
+
class DefaultLoggerService {
|
|
10
|
+
constructor(getArgvService){
|
|
11
|
+
this.getArgvService = getArgvService;
|
|
12
|
+
this.pinoLogger = null;
|
|
45
13
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
level
|
|
50
|
-
}, logStream);
|
|
51
|
-
return this.pinoLogger;
|
|
52
|
-
}
|
|
53
|
-
getLogStream() {
|
|
54
|
-
const argv = this.getArgvService.execute();
|
|
55
|
-
if (argv.showLogs) {
|
|
56
|
-
return pinoPretty({
|
|
57
|
-
ignore: "pid,hostname"
|
|
58
|
-
});
|
|
14
|
+
trace(message, ...optionalParams) {
|
|
15
|
+
const logger = this.getLogger();
|
|
16
|
+
logger.trace(message, ...optionalParams);
|
|
59
17
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// TODO: implement a better way to get project root path.
|
|
64
|
-
const webinyConfigPath = findUp.sync("webiny.config.tsx");
|
|
65
|
-
if (!webinyConfigPath) {
|
|
66
|
-
// Should not happen, but just in case.
|
|
67
|
-
throw new Error("Could not find project root path.");
|
|
18
|
+
fatal(message, ...optionalParams) {
|
|
19
|
+
const logger = this.getLogger();
|
|
20
|
+
logger.fatal(message, ...optionalParams);
|
|
68
21
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
22
|
+
debug(message, ...optionalParams) {
|
|
23
|
+
const logger = this.getLogger();
|
|
24
|
+
logger.debug(message, ...optionalParams);
|
|
25
|
+
}
|
|
26
|
+
info(message, ...optionalParams) {
|
|
27
|
+
const logger = this.getLogger();
|
|
28
|
+
logger.info(message, ...optionalParams);
|
|
29
|
+
}
|
|
30
|
+
warn(message, ...optionalParams) {
|
|
31
|
+
const logger = this.getLogger();
|
|
32
|
+
logger.warn(message, ...optionalParams);
|
|
33
|
+
}
|
|
34
|
+
error(message, ...optionalParams) {
|
|
35
|
+
const logger = this.getLogger();
|
|
36
|
+
logger.error(message, ...optionalParams);
|
|
37
|
+
}
|
|
38
|
+
log(message, ...optionalParams) {
|
|
39
|
+
const logger = this.getLogger();
|
|
40
|
+
logger.info(message, ...optionalParams);
|
|
41
|
+
}
|
|
42
|
+
getLogger() {
|
|
43
|
+
if (this.pinoLogger) return this.pinoLogger;
|
|
44
|
+
const logStream = this.getLogStream();
|
|
45
|
+
const level = this.getLogLevel();
|
|
46
|
+
this.pinoLogger = pino({
|
|
47
|
+
level
|
|
48
|
+
}, logStream);
|
|
49
|
+
return this.pinoLogger;
|
|
50
|
+
}
|
|
51
|
+
getLogStream() {
|
|
52
|
+
const argv = this.getArgvService.execute();
|
|
53
|
+
if (argv.showLogs) return pino_pretty({
|
|
54
|
+
ignore: "pid,hostname"
|
|
55
|
+
});
|
|
56
|
+
const webinyConfigPath = findUpSync("webiny.config.tsx");
|
|
57
|
+
if (!webinyConfigPath) throw new Error("Could not find project root path.");
|
|
58
|
+
const projectRootPath = node_path.dirname(webinyConfigPath);
|
|
59
|
+
const logsFolderPath = node_path.join(projectRootPath, ".webiny", "logs");
|
|
60
|
+
const logsFileName = this.getLogFileName();
|
|
61
|
+
if (!__rspack_external_node_fs_5ea92f0c.existsSync(logsFolderPath)) __rspack_external_node_fs_5ea92f0c.mkdirSync(logsFolderPath, {
|
|
62
|
+
recursive: true
|
|
63
|
+
});
|
|
64
|
+
const logFilePath = node_path.join(logsFolderPath, logsFileName);
|
|
65
|
+
return __rspack_external_node_fs_5ea92f0c.createWriteStream(logFilePath, {
|
|
66
|
+
flags: "a"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
getLogFileName() {
|
|
70
|
+
const now = new Date();
|
|
71
|
+
const dateStr = now.toISOString().split("T")[0];
|
|
72
|
+
return `logs-${dateStr}.log`;
|
|
73
|
+
}
|
|
74
|
+
getLogLevel() {
|
|
75
|
+
const argv = this.getArgvService.execute();
|
|
76
|
+
return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;
|
|
76
77
|
}
|
|
77
|
-
const logFilePath = path.join(logsFolderPath, logsFileName);
|
|
78
|
-
|
|
79
|
-
// Ensure the file exists or can be appended to
|
|
80
|
-
return fs.createWriteStream(logFilePath, {
|
|
81
|
-
flags: "a"
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
getLogFileName() {
|
|
85
|
-
const now = new Date();
|
|
86
|
-
const dateStr = now.toISOString().split("T")[0];
|
|
87
|
-
return `logs-${dateStr}.log`;
|
|
88
|
-
}
|
|
89
|
-
getLogLevel() {
|
|
90
|
-
const argv = this.getArgvService.execute();
|
|
91
|
-
return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;
|
|
92
|
-
}
|
|
93
78
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
const loggerService = createImplementation({
|
|
80
|
+
abstraction: LoggerService,
|
|
81
|
+
implementation: DefaultLoggerService,
|
|
82
|
+
dependencies: [
|
|
83
|
+
GetArgvService
|
|
84
|
+
]
|
|
98
85
|
});
|
|
86
|
+
export { DefaultLoggerService, loggerService };
|
|
99
87
|
|
|
100
88
|
//# sourceMappingURL=LoggerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"services/LoggerService/LoggerService.js","sources":["../../../src/services/LoggerService/LoggerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetArgvService, LoggerService } from \"~/abstractions/index.js\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { findUpSync } from \"find-up\";\nimport { pino, type Logger } from \"pino\";\nimport pinoPretty from \"pino-pretty\";\n\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport class DefaultLoggerService implements LoggerService.Interface {\n private pinoLogger: Logger | null = null;\n\n constructor(private readonly getArgvService: GetArgvService.Interface) {}\n\n trace(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.trace(message, ...optionalParams);\n }\n\n fatal(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.fatal(message, ...optionalParams);\n }\n\n debug(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.debug(message, ...optionalParams);\n }\n\n info(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n warn(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.warn(message, ...optionalParams);\n }\n\n error(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.error(message, ...optionalParams);\n }\n\n log(message?: any, ...optionalParams: any[]) {\n const logger = this.getLogger();\n logger.info(message, ...optionalParams);\n }\n\n private getLogger() {\n if (this.pinoLogger) {\n return this.pinoLogger;\n }\n\n const logStream = this.getLogStream();\n const level = this.getLogLevel();\n\n this.pinoLogger = pino({ level }, logStream);\n\n return this.pinoLogger;\n }\n\n private getLogStream() {\n const argv = this.getArgvService.execute();\n if (argv.showLogs) {\n return pinoPretty({\n ignore: \"pid,hostname\"\n });\n }\n\n // Wanted to use `GetProjectSdkService` to get project root path, but\n // to get that, had to call async method, which is not allowed in constructor.\n // TODO: implement a better way to get project root path.\n const webinyConfigPath = findUpSync(\"webiny.config.tsx\");\n if (!webinyConfigPath) {\n // Should not happen, but just in case.\n throw new Error(\"Could not find project root path.\");\n }\n\n const projectRootPath = path.dirname(webinyConfigPath!);\n\n const logsFolderPath = path.join(projectRootPath, \".webiny\", \"logs\");\n const logsFileName = this.getLogFileName();\n\n if (!fs.existsSync(logsFolderPath)) {\n fs.mkdirSync(logsFolderPath, { recursive: true });\n }\n\n const logFilePath = path.join(logsFolderPath, logsFileName);\n\n // Ensure the file exists or can be appended to\n return fs.createWriteStream(logFilePath, { flags: \"a\" });\n }\n\n private getLogFileName() {\n const now = new Date();\n const dateStr = now.toISOString().split(\"T\")[0];\n return `logs-${dateStr}.log`;\n }\n\n private getLogLevel() {\n const argv = this.getArgvService.execute();\n return process.env.WEBINY_CLI_LOG_LEVEL || argv.logLevel || DEFAULT_LOG_LEVEL;\n }\n}\n\nexport const loggerService = createImplementation({\n abstraction: LoggerService,\n implementation: DefaultLoggerService,\n dependencies: [GetArgvService]\n});\n"],"names":["DEFAULT_LOG_LEVEL","DefaultLoggerService","getArgvService","message","optionalParams","logger","logStream","level","pino","argv","pinoPretty","webinyConfigPath","findUpSync","Error","projectRootPath","path","logsFolderPath","logsFileName","fs","logFilePath","now","Date","dateStr","process","loggerService","createImplementation","LoggerService","GetArgvService"],"mappings":";;;;;;;AAQA,MAAMA,oBAAoB;AAEnB,MAAMC;IAGT,YAA6BC,cAAwC,CAAE;aAA1CA,cAAc,GAAdA;aAFrB,UAAU,GAAkB;IAEoC;IAExE,MAAMC,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,KAAKD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC1C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEA,KAAKD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC1C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEA,MAAMD,OAAa,EAAE,GAAGC,cAAqB,EAAE;QAC3C,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,KAAK,CAACF,YAAYC;IAC7B;IAEA,IAAID,OAAa,EAAE,GAAGC,cAAqB,EAAE;QACzC,MAAMC,SAAS,IAAI,CAAC,SAAS;QAC7BA,OAAO,IAAI,CAACF,YAAYC;IAC5B;IAEQ,YAAY;QAChB,IAAI,IAAI,CAAC,UAAU,EACf,OAAO,IAAI,CAAC,UAAU;QAG1B,MAAME,YAAY,IAAI,CAAC,YAAY;QACnC,MAAMC,QAAQ,IAAI,CAAC,WAAW;QAE9B,IAAI,CAAC,UAAU,GAAGC,KAAK;YAAED;QAAM,GAAGD;QAElC,OAAO,IAAI,CAAC,UAAU;IAC1B;IAEQ,eAAe;QACnB,MAAMG,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO;QACxC,IAAIA,KAAK,QAAQ,EACb,OAAOC,YAAW;YACd,QAAQ;QACZ;QAMJ,MAAMC,mBAAmBC,WAAW;QACpC,IAAI,CAACD,kBAED,MAAM,IAAIE,MAAM;QAGpB,MAAMC,kBAAkBC,UAAAA,OAAY,CAACJ;QAErC,MAAMK,iBAAiBD,UAAAA,IAAS,CAACD,iBAAiB,WAAW;QAC7D,MAAMG,eAAe,IAAI,CAAC,cAAc;QAExC,IAAI,CAACC,mCAAAA,UAAa,CAACF,iBACfE,mCAAAA,SAAY,CAACF,gBAAgB;YAAE,WAAW;QAAK;QAGnD,MAAMG,cAAcJ,UAAAA,IAAS,CAACC,gBAAgBC;QAG9C,OAAOC,mCAAAA,iBAAoB,CAACC,aAAa;YAAE,OAAO;QAAI;IAC1D;IAEQ,iBAAiB;QACrB,MAAMC,MAAM,IAAIC;QAChB,MAAMC,UAAUF,IAAI,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;QAC/C,OAAO,CAAC,KAAK,EAAEE,QAAQ,IAAI,CAAC;IAChC;IAEQ,cAAc;QAClB,MAAMb,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO;QACxC,OAAOc,QAAQ,GAAG,CAAC,oBAAoB,IAAId,KAAK,QAAQ,IAAIT;IAChE;AACJ;AAEO,MAAMwB,gBAAgBC,qBAAqB;IAC9C,aAAaC;IACb,gBAAgBzB;IAChB,cAAc;QAAC0B;KAAe;AAClC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { GetCliRunnerService, RunCliRunnerService } from "../../abstractions/index.js";
|
|
3
3
|
import { hideBin } from "yargs/helpers";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
4
|
+
class DefaultRunCliRunnerService {
|
|
5
|
+
constructor(getCliRunnerService){
|
|
6
|
+
this.getCliRunnerService = getCliRunnerService;
|
|
7
|
+
}
|
|
8
|
+
async execute() {
|
|
9
|
+
const cliRunner = await this.getCliRunnerService.execute();
|
|
10
|
+
return cliRunner.parseAsync(hideBin(process.argv));
|
|
11
|
+
}
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const runCliRunnerService = createImplementation({
|
|
14
|
+
abstraction: RunCliRunnerService,
|
|
15
|
+
implementation: DefaultRunCliRunnerService,
|
|
16
|
+
dependencies: [
|
|
17
|
+
GetCliRunnerService
|
|
18
|
+
]
|
|
18
19
|
});
|
|
20
|
+
export { DefaultRunCliRunnerService, runCliRunnerService };
|
|
19
21
|
|
|
20
22
|
//# sourceMappingURL=RunCliRunnerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"services/RunCliRunnerService/RunCliRunnerService.js","sources":["../../../src/services/RunCliRunnerService/RunCliRunnerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetCliRunnerService, RunCliRunnerService } from \"~/abstractions/index.js\";\nimport { hideBin } from \"yargs/helpers\";\nimport { Argv } from \"yargs\";\n\nexport class DefaultRunCliRunnerService implements RunCliRunnerService.Interface {\n constructor(private readonly getCliRunnerService: GetCliRunnerService.Interface) {}\n\n async execute() {\n const cliRunner = (await this.getCliRunnerService.execute()) as Argv;\n // Use process.argv directly since it's the actual argv being used\n return cliRunner.parseAsync(hideBin(process.argv));\n }\n}\n\nexport const runCliRunnerService = createImplementation({\n abstraction: RunCliRunnerService,\n implementation: DefaultRunCliRunnerService,\n dependencies: [GetCliRunnerService]\n});\n"],"names":["DefaultRunCliRunnerService","getCliRunnerService","cliRunner","hideBin","process","runCliRunnerService","createImplementation","RunCliRunnerService","GetCliRunnerService"],"mappings":";;;AAKO,MAAMA;IACT,YAA6BC,mBAAkD,CAAE;aAApDA,mBAAmB,GAAnBA;IAAqD;IAElF,MAAM,UAAU;QACZ,MAAMC,YAAa,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QAEzD,OAAOA,UAAU,UAAU,CAACC,QAAQC,QAAQ,IAAI;IACpD;AACJ;AAEO,MAAMC,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAoB;AACvC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { StdioService } from "../../abstractions/index.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
class DefaultStdioService {
|
|
4
|
+
getStdout() {
|
|
5
|
+
return process.stdout;
|
|
6
|
+
}
|
|
7
|
+
getStderr() {
|
|
8
|
+
return process.stderr;
|
|
9
|
+
}
|
|
10
|
+
getStdin() {
|
|
11
|
+
return process.stdin;
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const stdioService = createImplementation({
|
|
15
|
+
abstraction: StdioService,
|
|
16
|
+
implementation: DefaultStdioService,
|
|
17
|
+
dependencies: []
|
|
18
18
|
});
|
|
19
|
+
export { DefaultStdioService, stdioService };
|
|
19
20
|
|
|
20
21
|
//# sourceMappingURL=StdioService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"services/StdioService/StdioService.js","sources":["../../../src/services/StdioService/StdioService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { StdioService } from \"~/abstractions/index.js\";\n\nexport class DefaultStdioService implements StdioService.Interface {\n getStdout() {\n return process.stdout;\n }\n\n getStderr() {\n return process.stderr;\n }\n\n getStdin() {\n return process.stdin;\n }\n}\n\nexport const stdioService = createImplementation({\n abstraction: StdioService,\n implementation: DefaultStdioService,\n dependencies: []\n});\n"],"names":["DefaultStdioService","process","stdioService","createImplementation","StdioService"],"mappings":";;AAGO,MAAMA;IACT,YAAY;QACR,OAAOC,QAAQ,MAAM;IACzB;IAEA,YAAY;QACR,OAAOA,QAAQ,MAAM;IACzB;IAEA,WAAW;QACP,OAAOA,QAAQ,KAAK;IACxB;AACJ;AAEO,MAAMC,eAAeC,qBAAqB;IAC7C,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,70 +1,67 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import util from "util";
|
|
4
|
-
import {
|
|
4
|
+
import { IsCi, StdioService, UiService } from "../../abstractions/index.js";
|
|
5
5
|
const NEW_LINE = "\n";
|
|
6
6
|
const PIPE_SYMBOL = "┃";
|
|
7
7
|
const LOG_COLORS = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
info: chalk.blueBright,
|
|
9
|
+
error: chalk.red,
|
|
10
|
+
warning: chalk.yellow,
|
|
11
|
+
success: chalk.green,
|
|
12
|
+
debug: chalk.gray
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
14
|
+
class DefaultUiService {
|
|
15
|
+
constructor(stdio, isCi){
|
|
16
|
+
this.stdio = stdio;
|
|
17
|
+
this.isCi = isCi;
|
|
18
|
+
}
|
|
19
|
+
raw(text) {
|
|
20
|
+
this.stdio.getStdout().write(text);
|
|
21
|
+
}
|
|
22
|
+
text(text) {
|
|
23
|
+
this.stdio.getStdout().write(text);
|
|
24
|
+
this.stdio.getStdout().write(NEW_LINE);
|
|
25
|
+
}
|
|
26
|
+
textBold(text) {
|
|
27
|
+
this.text(chalk.bold(text));
|
|
28
|
+
}
|
|
29
|
+
emptyLine() {
|
|
30
|
+
this.stdio.getStdout().write(chalk.gray("∙") + NEW_LINE);
|
|
31
|
+
}
|
|
32
|
+
success(text, ...args) {
|
|
33
|
+
this.typedColorizedText("success", text, ...args);
|
|
34
|
+
}
|
|
35
|
+
info(text, ...args) {
|
|
36
|
+
this.typedColorizedText("info", text, ...args);
|
|
37
|
+
}
|
|
38
|
+
warning(text, ...args) {
|
|
39
|
+
this.typedColorizedText("warning", text, ...args);
|
|
40
|
+
}
|
|
41
|
+
error(text, ...args) {
|
|
42
|
+
this.typedColorizedText("error", text, ...args);
|
|
43
|
+
}
|
|
44
|
+
debug(text, ...args) {
|
|
45
|
+
this.typedColorizedText("debug", text, ...args);
|
|
46
|
+
}
|
|
47
|
+
typedColorizedText(type, text, ...args) {
|
|
48
|
+
if (this.isCi.execute()) {
|
|
49
|
+
const prefix = `${type}: `;
|
|
50
|
+
return this.text(prefix + util.format(text, ...args));
|
|
51
|
+
}
|
|
52
|
+
const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;
|
|
53
|
+
const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, (match)=>LOG_COLORS[type](match));
|
|
54
|
+
return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));
|
|
54
55
|
}
|
|
55
|
-
const prefix = `${LOG_COLORS[type](PIPE_SYMBOL)} `;
|
|
56
|
-
|
|
57
|
-
// Replace all placeholders (match with `/%[a-zA-Z]/g` regex) with colorized values.
|
|
58
|
-
const textWithColorizedPlaceholders = text.replace(/%[a-zA-Z]/g, match => {
|
|
59
|
-
return LOG_COLORS[type](match);
|
|
60
|
-
});
|
|
61
|
-
return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));
|
|
62
|
-
}
|
|
63
56
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
const uiService = createImplementation({
|
|
58
|
+
abstraction: UiService,
|
|
59
|
+
implementation: DefaultUiService,
|
|
60
|
+
dependencies: [
|
|
61
|
+
StdioService,
|
|
62
|
+
IsCi
|
|
63
|
+
]
|
|
68
64
|
});
|
|
65
|
+
export { DefaultUiService, uiService };
|
|
69
66
|
|
|
70
67
|
//# sourceMappingURL=UiService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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 prefix = `${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 return this.text(prefix + util.format(textWithColorizedPlaceholders, ...args));\n }\n}\n\nexport const uiService = createImplementation({\n abstraction: UiService,\n implementation: DefaultUiService,\n dependencies: [StdioService, IsCi]\n});\n"],"names":["NEW_LINE","PIPE_SYMBOL","LOG_COLORS","chalk","DefaultUiService","stdio","isCi","text","args","type","prefix","util","textWithColorizedPlaceholders","match","uiService","createImplementation","UiService","StdioService","IsCi"],"mappings":";;;;AAKA,MAAMA,WAAW;AACjB,MAAMC,cAAc;AAEpB,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,CAACP;IACjC;IAEA,SAASO,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,OAAOH;IACnD;IAGA,QAAQO,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,MAAME,SAAS,GAAGR,UAAU,CAACO,KAAK,CAACR,aAAa,CAAC,CAAC;QAGlD,MAAMW,gCAAgCL,KAAK,OAAO,CAAC,cAAcM,CAAAA,QACtDX,UAAU,CAACO,KAAK,CAACI;QAG5B,OAAO,IAAI,CAAC,IAAI,CAACH,SAASC,KAAK,MAAM,CAACC,kCAAkCJ;IAC5E;AACJ;AAEO,MAAMM,YAAYC,qBAAqB;IAC1C,aAAaC;IACb,gBAAgBZ;IAChB,cAAc;QAACa;QAAcC;KAAK;AACtC"}
|
package/services/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
class ManuallyReportedError extends Error {
|
|
2
|
+
static from(cause) {
|
|
3
|
+
return new ManuallyReportedError(cause.message, {
|
|
4
|
+
cause
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
7
|
}
|
|
8
|
+
export { ManuallyReportedError };
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=ManuallyReportedError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/ManuallyReportedError.js","sources":["../../src/utils/ManuallyReportedError.ts"],"sourcesContent":["export class ManuallyReportedError extends Error {\n static from(cause: Error): ManuallyReportedError {\n return new ManuallyReportedError(cause.message, { cause });\n }\n}\n"],"names":["ManuallyReportedError","Error","cause"],"mappings":"AAAO,MAAMA,8BAA8BC;IACvC,OAAO,KAAKC,KAAY,EAAyB;QAC7C,OAAO,IAAIF,sBAAsBE,MAAM,OAAO,EAAE;YAAEA;QAAM;IAC5D;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CliCommandFactory","ErrorHandler","GlobalCliOption","IsCi"],"sources":["index.ts"],"sourcesContent":["export { CliCommandFactory } from \"./CliCommand.js\";\nexport { ErrorHandler } from \"./ErrorHandler.js\";\nexport { GlobalCliOption } from \"./GlobalCliOption.js\";\nexport { IsCi } from \"./IsCi.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,eAAe;AACxB,SAASC,IAAI","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { AppName } from \"@webiny/project\";\n\nexport interface IBaseAppParams {\n _: string[]; // TODO: implement this in a better way (handler method probably should have this in its context/meta data)\n app: AppName;\n env: string;\n variant?: string;\n region?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./features/index.js\";\nexport * from \"./services/index.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ArgvParserService.js\";\nexport * from \"./CliParamsService.js\";\nexport * from \"./CommandsRegistryService.js\";\nexport * from \"./GetArgvService.js\";\nexport * from \"./GetCliRunnerService.js\";\nexport * from \"./GetIsCiService.js\";\nexport * from \"./GlobalOptionsRegistryService.js\";\nexport * from \"./GetProjectSdkService.js\";\nexport * from \"./LoggerService.js\";\nexport * from \"./RunCliRunnerService.js\";\nexport * from \"./StdioService.js\";\nexport * from \"./UiService.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
package/decorators/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CommandsWithGracefulErrorHandling.js\";\nexport * from \"./DeployCommandWithTelemetry.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CliCommandFactory"],"sources":["command.ts"],"sourcesContent":["export { CliCommandFactory } from \"~/abstractions/features/CliCommand.js\";\n"],"mappings":"AAAA,SAASA,iBAAiB","ignoreList":[]}
|
package/exports/cli/index.d.ts
DELETED
package/exports/cli/index.js
DELETED
package/exports/cli/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["LoggerService","Logger","UiService","Ui"],"sources":["index.ts"],"sourcesContent":["export { LoggerService as Logger } from \"~/abstractions/services/LoggerService.js\";\nexport { UiService as Ui } from \"~/abstractions/services/UiService.js\";\n"],"mappings":"AAAA,SAASA,aAAa,IAAIC,MAAM;AAChC,SAASC,SAAS,IAAIC,EAAE","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./BuildCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DeployCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./commands/SyncDepsCommand.js\";\nexport * from \"./commands/VerifyDepsCommand.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DestroyCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ExtensionCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./InfoCommand.js\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isCi","DefaultIsCi"],"sources":["index.ts"],"sourcesContent":["export { isCi, DefaultIsCi } from \"./IsCi.js\";\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,WAAW","ignoreList":[]}
|