@webiny/cli-core 0.0.0-unstable.81ae05e56b → 0.0.0-unstable.9609e4e0c9
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 +12 -11
- package/Cli.js.map +1 -1
- package/abstractions/createAbstraction.js +3 -2
- package/abstractions/createAbstraction.js.map +1 -1
- package/abstractions/features/CliCommand.js +2 -4
- package/abstractions/features/CliCommand.js.map +1 -1
- package/abstractions/features/ErrorHandler.js +2 -1
- package/abstractions/features/ErrorHandler.js.map +1 -1
- package/abstractions/features/GlobalCliOption.js +2 -1
- package/abstractions/features/GlobalCliOption.js.map +1 -1
- package/abstractions/features/IsCi.js +2 -1
- package/abstractions/features/IsCi.js.map +1 -1
- package/abstractions/features/index.js +0 -2
- package/abstractions/features/types.js +0 -3
- package/abstractions/index.js +0 -2
- package/abstractions/services/ArgvParserService.js +2 -1
- package/abstractions/services/ArgvParserService.js.map +1 -1
- package/abstractions/services/CliParamsService.js +2 -1
- package/abstractions/services/CliParamsService.js.map +1 -1
- package/abstractions/services/CommandsRegistryService.js +2 -1
- package/abstractions/services/CommandsRegistryService.js.map +1 -1
- package/abstractions/services/DefaultAppsService.d.ts +8 -0
- package/abstractions/services/DefaultAppsService.js +5 -0
- package/abstractions/services/DefaultAppsService.js.map +1 -0
- 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.d.ts +1 -0
- package/abstractions/services/index.js +1 -2
- package/createCliContainer.d.ts +1 -1
- package/createCliContainer.js +87 -118
- package/createCliContainer.js.map +1 -1
- package/decorators/CommandsWithGracefulErrorHandling.js +34 -32
- package/decorators/CommandsWithGracefulErrorHandling.js.map +1 -1
- package/decorators/index.d.ts +0 -1
- package/decorators/index.js +0 -3
- package/exports/cli/command.js +0 -2
- package/exports/cli.js +0 -2
- package/extensions/CliCommand.d.ts +1 -1
- package/extensions/CliCommand.js +15 -18
- package/extensions/CliCommand.js.map +1 -1
- package/extensions/CliCommandDecorator.d.ts +1 -1
- package/extensions/CliCommandDecorator.js +15 -18
- package/extensions/CliCommandDecorator.js.map +1 -1
- package/extensions/index.js +5 -2
- package/extensions/index.js.map +1 -1
- package/features/AboutCommand.js +80 -86
- package/features/AboutCommand.js.map +1 -1
- package/features/BuildCommand/BuildCommand.d.ts +7 -3
- package/features/BuildCommand/BuildCommand.js +68 -37
- 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/index.d.ts +20 -1
- package/features/DeployCommand/index.js +0 -3
- 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.d.ts +1 -1
- package/features/DepsSync/ListAllPackages.js +9 -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.d.ts +1 -1
- package/features/DepsSync/createDependencyTree.js +28 -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/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 +58 -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/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 +105 -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/Wcp/LinkProjectCommand.js +120 -139
- 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/TraceGlobalOption.d.ts +5 -0
- package/features/globalOptions/TraceGlobalOption.js +22 -0
- package/features/globalOptions/TraceGlobalOption.js.map +1 -0
- package/features/globalOptions/index.d.ts +1 -0
- package/features/globalOptions/index.js +1 -2
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js +12 -18
- package/features/gracefulErrorHandlers/MissingFilesInBuildGracefulErrorHandler.js.map +1 -1
- package/features/gracefulErrorHandlers/index.d.ts +0 -2
- package/features/gracefulErrorHandlers/index.js +0 -4
- package/features/index.d.ts +1 -5
- package/features/index.js +1 -7
- 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 +33 -26
- 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/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/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 +123 -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 +75 -87
- package/services/LoggerService/LoggerService.js.map +1 -1
- package/services/LoggerService/index.js +0 -2
- package/services/RunCliRunnerService/RunCliRunnerService.d.ts +1 -1
- 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.d.ts +18 -0
- package/services/UiService/UiService.js +71 -58
- package/services/UiService/UiService.js.map +1 -1
- package/services/UiService/index.js +0 -2
- package/services/index.d.ts +1 -0
- package/services/index.js +1 -2
- package/utils/ManuallyReportedError.js +7 -6
- package/utils/ManuallyReportedError.js.map +1 -1
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js +53 -0
- package/utils/ensureSameWebinyPackageVersions/ensureSameWebinyPackageVersions.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js +12 -0
- package/utils/ensureSameWebinyPackageVersions/getCacheFilePath.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js +16 -0
- package/utils/ensureSameWebinyPackageVersions/hashYarnLock.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/index.d.ts +6 -0
- package/utils/ensureSameWebinyPackageVersions/index.js +6 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js +31 -0
- package/utils/ensureSameWebinyPackageVersions/listWebinyPackageVersions.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js +13 -0
- package/utils/ensureSameWebinyPackageVersions/readClearedYarnLockHash.js.map +1 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.d.ts +1 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.js +24 -0
- package/utils/ensureSameWebinyPackageVersions/writeClearedYarnLockHash.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/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/DeployCommandWithTelemetry.d.ts +0 -11
- package/decorators/DeployCommandWithTelemetry.js +0 -91
- package/decorators/DeployCommandWithTelemetry.js.map +0 -1
- package/decorators/index.js.map +0 -1
- package/exports/cli/command.js.map +0 -1
- package/exports/cli.js.map +0 -1
- package/features/BuildCommand/index.js.map +0 -1
- package/features/DeployCommand/DeployCommand.d.ts +0 -30
- package/features/DeployCommand/DeployCommand.js +0 -168
- package/features/DeployCommand/DeployCommand.js.map +0 -1
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.d.ts +0 -20
- package/features/DeployCommand/deployOutputs/BaseDeployOutput.js +0 -20
- 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 -24
- 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 -61
- 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 -44
- package/features/DeployCommand/deployOutputs/WithDeploymentLogsDeployOutput.js.map +0 -1
- package/features/DeployCommand/index.js.map +0 -1
- package/features/DepsSync/index.js.map +0 -1
- package/features/DestroyCommand/DestroyCommand.d.ts +0 -22
- package/features/DestroyCommand/DestroyCommand.js +0 -78
- package/features/DestroyCommand/DestroyCommand.js.map +0 -1
- package/features/DestroyCommand/index.d.ts +0 -1
- package/features/DestroyCommand/index.js +0 -3
- 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/OutputCommand.d.ts +0 -12
- package/features/OutputCommand.js +0 -79
- package/features/OutputCommand.js.map +0 -1
- package/features/PulumiCommand/PulumiCommand.d.ts +0 -13
- package/features/PulumiCommand/PulumiCommand.js +0 -50
- package/features/PulumiCommand/PulumiCommand.js.map +0 -1
- package/features/PulumiCommand/index.d.ts +0 -1
- package/features/PulumiCommand/index.js +0 -3
- package/features/PulumiCommand/index.js.map +0 -1
- package/features/RefreshCommand/RefreshCommand.d.ts +0 -12
- package/features/RefreshCommand/RefreshCommand.js +0 -45
- package/features/RefreshCommand/RefreshCommand.js.map +0 -1
- package/features/RefreshCommand/index.d.ts +0 -1
- package/features/RefreshCommand/index.js +0 -3
- package/features/RefreshCommand/index.js.map +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 -20
- package/features/WatchCommand/createPrefixer.js.map +0 -1
- package/features/WatchCommand/getRandomColorForString.d.ts +0 -1
- package/features/WatchCommand/getRandomColorForString.js +0 -11
- package/features/WatchCommand/getRandomColorForString.js.map +0 -1
- package/features/WatchCommand/index.d.ts +0 -1
- package/features/WatchCommand/index.js +0 -3
- 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/DdbPutItemConditionalCheckFailedGracefulErrorHandler.d.ts +0 -6
- package/features/gracefulErrorHandlers/DdbPutItemConditionalCheckFailedGracefulErrorHandler.js +0 -26
- 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
- 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,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class ListAllPackages {
|
|
2
|
+
async list(paths) {
|
|
3
|
+
const { listWorkspaces } = await import("@webiny/stdlib/node");
|
|
4
|
+
const results = [];
|
|
5
|
+
for (const p of paths)results.push(...listWorkspaces({
|
|
6
|
+
cwd: p
|
|
7
|
+
}).map((pkg)=>pkg.path));
|
|
8
|
+
return results;
|
|
8
9
|
}
|
|
9
|
-
return results;
|
|
10
|
-
}
|
|
11
10
|
}
|
|
11
|
+
export { ListAllPackages };
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=ListAllPackages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/ListAllPackages.js","sources":["../../../src/features/DepsSync/ListAllPackages.ts"],"sourcesContent":["export class ListAllPackages {\n public async list(paths: string[]): Promise<string[]> {\n // Imported here rather than at the top of the file. The CLI imports every command's code\n // on every run, even `webiny --help`, and `@webiny/stdlib/node` is about 60 modules that only\n // `sync-dependencies` and `verify-dependencies` ever need.\n const { listWorkspaces } = await import(\"@webiny/stdlib/node\");\n\n const results: string[] = [];\n for (const p of paths) {\n results.push(\n ...listWorkspaces({\n cwd: p\n }).map(pkg => {\n return pkg.path;\n })\n );\n }\n return results;\n }\n}\n"],"names":["ListAllPackages","paths","listWorkspaces","results","p","pkg"],"mappings":"AAAO,MAAMA;IACT,MAAa,KAAKC,KAAe,EAAqB;QAIlD,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC;QAExC,MAAMC,UAAoB,EAAE;QAC5B,KAAK,MAAMC,KAAKH,MACZE,QAAQ,IAAI,IACLD,eAAe;YACd,KAAKE;QACT,GAAG,GAAG,CAACC,CAAAA,MACIA,IAAI,IAAI;QAI3B,OAAOF;IACX;AACJ"}
|
|
@@ -2,31 +2,37 @@ import { createImplementation } from "@webiny/di";
|
|
|
2
2
|
import { CliCommandFactory, GetProjectSdkService, UiService } from "../../../abstractions/index.js";
|
|
3
3
|
import { createDependencyTree } from "../createDependencyTree.js";
|
|
4
4
|
import { createReferenceFile } from "../createReferenceFile.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
class SyncDepsCommand {
|
|
6
|
+
constructor(getProjectSdkService, uiService){
|
|
7
|
+
this.getProjectSdkService = getProjectSdkService;
|
|
8
|
+
this.uiService = uiService;
|
|
9
|
+
}
|
|
10
|
+
async execute() {
|
|
11
|
+
const projectSdk = await this.getProjectSdkService.execute();
|
|
12
|
+
return {
|
|
13
|
+
name: "sync-dependencies",
|
|
14
|
+
description: "Sync dependencies for all packages.",
|
|
15
|
+
examples: [
|
|
16
|
+
"$0 sync-dependencies"
|
|
17
|
+
],
|
|
18
|
+
handler: async ()=>{
|
|
19
|
+
const project = projectSdk.getProject();
|
|
20
|
+
const tree = await createDependencyTree(project);
|
|
21
|
+
return createReferenceFile(project, tree, {
|
|
22
|
+
uiService: this.uiService
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const syncDepsCommand = createImplementation({
|
|
29
|
+
abstraction: CliCommandFactory,
|
|
30
|
+
implementation: SyncDepsCommand,
|
|
31
|
+
dependencies: [
|
|
32
|
+
GetProjectSdkService,
|
|
33
|
+
UiService
|
|
34
|
+
]
|
|
30
35
|
});
|
|
36
|
+
export { SyncDepsCommand, syncDepsCommand };
|
|
31
37
|
|
|
32
38
|
//# sourceMappingURL=SyncDepsCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/commands/SyncDepsCommand.js","sources":["../../../../src/features/DepsSync/commands/SyncDepsCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\n\nimport { createDependencyTree } from \"../createDependencyTree.js\";\nimport { createReferenceFile } from \"../createReferenceFile.js\";\n\nexport class SyncDepsCommand implements CliCommandFactory.Interface<unknown> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectSdk = await this.getProjectSdkService.execute();\n\n return {\n name: \"sync-dependencies\",\n description: \"Sync dependencies for all packages.\",\n examples: [\"$0 sync-dependencies\"],\n handler: async () => {\n const project = projectSdk.getProject();\n const tree = await createDependencyTree(project);\n\n return createReferenceFile(project, tree, { uiService: this.uiService });\n }\n };\n }\n}\n\nexport const syncDepsCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: SyncDepsCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"names":["SyncDepsCommand","getProjectSdkService","uiService","projectSdk","project","tree","createDependencyTree","createReferenceFile","syncDepsCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService"],"mappings":";;;;AAMO,MAAMA;IACT,YACYC,oBAAoD,EACpDC,SAA8B,CACxC;aAFUD,oBAAoB,GAApBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;QAE1D,OAAO;YACH,MAAM;YACN,aAAa;YACb,UAAU;gBAAC;aAAuB;YAClC,SAAS;gBACL,MAAMC,UAAUD,WAAW,UAAU;gBACrC,MAAME,OAAO,MAAMC,qBAAqBF;gBAExC,OAAOG,oBAAoBH,SAASC,MAAM;oBAAE,WAAW,IAAI,CAAC,SAAS;gBAAC;YAC1E;QACJ;IACJ;AACJ;AAEO,MAAMG,kBAAkBC,qBAAqB;IAChD,aAAaC;IACb,gBAAgBV;IAChB,cAAc;QAACW;QAAsBC;KAAU;AACnD"}
|
|
@@ -4,78 +4,77 @@ import { loadJsonFileSync } from "load-json-file";
|
|
|
4
4
|
import { getDuplicatesFilePath, getReferencesFilePath } from "../paths.js";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import { createDependencyTree } from "../createDependencyTree.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
7
|
+
class VerifyDepsCommand {
|
|
8
|
+
constructor(getProjectSdkService, uiService){
|
|
9
|
+
this.getProjectSdkService = getProjectSdkService;
|
|
10
|
+
this.uiService = uiService;
|
|
11
|
+
}
|
|
12
|
+
async execute() {
|
|
13
|
+
return {
|
|
14
|
+
name: "verify-dependencies",
|
|
15
|
+
description: "Verify dependencies for all packages.",
|
|
16
|
+
examples: [
|
|
17
|
+
"$0 verify-dependencies"
|
|
18
|
+
],
|
|
19
|
+
handler: async ()=>{
|
|
20
|
+
const ui = this.uiService;
|
|
21
|
+
const projectSdk = await this.getProjectSdkService.execute();
|
|
22
|
+
const project = projectSdk.getProject();
|
|
23
|
+
const referencesFile = getReferencesFilePath(project);
|
|
24
|
+
const duplicatesFile = getDuplicatesFilePath(project);
|
|
25
|
+
const tree = await createDependencyTree(project);
|
|
26
|
+
const references = {
|
|
27
|
+
dependencies: tree.dependencies,
|
|
28
|
+
devDependencies: tree.devDependencies,
|
|
29
|
+
peerDependencies: tree.peerDependencies,
|
|
30
|
+
resolutions: tree.resolutions,
|
|
31
|
+
references: tree.references
|
|
32
|
+
};
|
|
33
|
+
ui.info("Checking references file...");
|
|
34
|
+
if (fs.existsSync(referencesFile)) {
|
|
35
|
+
const json = loadJsonFileSync(referencesFile);
|
|
36
|
+
if (JSON.stringify(references) !== JSON.stringify(json)) {
|
|
37
|
+
for(const type in references){
|
|
38
|
+
const refDependencies = references[type];
|
|
39
|
+
const fileDependencies = json[type];
|
|
40
|
+
for(const dep in refDependencies){
|
|
41
|
+
const refDep = refDependencies[dep];
|
|
42
|
+
const fileDep = fileDependencies[dep];
|
|
43
|
+
if (!fileDep) {
|
|
44
|
+
console.log("Missing dependency:", refDep.name, "in", type);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (JSON.stringify(refDep) !== JSON.stringify(fileDep)) {
|
|
48
|
+
console.log("Mismatch in dependency:", refDep.name, "in", type);
|
|
49
|
+
console.log({
|
|
50
|
+
refDep: JSON.stringify(refDep),
|
|
51
|
+
fileDep: JSON.stringify(fileDep)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw new Error("References are not in sync. Please run `yarn webiny sync-dependencies` command.");
|
|
57
|
+
}
|
|
58
|
+
} else throw new Error("References file does not exist. Please run `yarn webiny sync-dependencies` command.");
|
|
59
|
+
ui.info("Checking duplicates file...");
|
|
60
|
+
if (fs.existsSync(duplicatesFile)) {
|
|
61
|
+
const json = loadJsonFileSync(duplicatesFile);
|
|
62
|
+
if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) throw new Error("Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.");
|
|
63
|
+
else if (Array.isArray(json) && json.length > 0) throw new Error("There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.");
|
|
64
|
+
} else throw new Error("Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.");
|
|
65
|
+
ui.info("✅ All package reference files are in sync.");
|
|
53
66
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} else {
|
|
57
|
-
throw new Error("References file does not exist. Please run `yarn webiny sync-dependencies` command.");
|
|
58
|
-
}
|
|
59
|
-
ui.info("Checking duplicates file...");
|
|
60
|
-
if (fs.existsSync(duplicatesFile)) {
|
|
61
|
-
const json = loadJsonFileSync(duplicatesFile);
|
|
62
|
-
if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) {
|
|
63
|
-
throw new Error("Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.");
|
|
64
|
-
} else if (Array.isArray(json) && json.length > 0) {
|
|
65
|
-
throw new Error("There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.");
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
throw new Error("Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.");
|
|
69
|
-
}
|
|
70
|
-
ui.info("✅ All package reference files are in sync.");
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
74
69
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
const verifyDepsCommand = createImplementation({
|
|
71
|
+
abstraction: CliCommandFactory,
|
|
72
|
+
implementation: VerifyDepsCommand,
|
|
73
|
+
dependencies: [
|
|
74
|
+
GetProjectSdkService,
|
|
75
|
+
UiService
|
|
76
|
+
]
|
|
79
77
|
});
|
|
78
|
+
export { VerifyDepsCommand, verifyDepsCommand };
|
|
80
79
|
|
|
81
80
|
//# sourceMappingURL=VerifyDepsCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/commands/VerifyDepsCommand.js","sources":["../../../../src/features/DepsSync/commands/VerifyDepsCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, GetProjectSdkService, UiService } from \"~/abstractions/index.js\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { getDuplicatesFilePath, getReferencesFilePath } from \"../paths.js\";\nimport fs from \"fs\";\nimport { createDependencyTree } from \"../createDependencyTree.js\";\nimport type { IDependencyCollection } from \"~/features/DepsSync/types.js\";\n\nexport class VerifyDepsCommand implements CliCommandFactory.Interface<unknown> {\n constructor(\n private getProjectSdkService: GetProjectSdkService.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n return {\n name: \"verify-dependencies\",\n description: \"Verify dependencies for all packages.\",\n examples: [\"$0 verify-dependencies\"],\n handler: async () => {\n const ui = this.uiService;\n const projectSdk = await this.getProjectSdkService.execute();\n const project = projectSdk.getProject();\n const referencesFile = getReferencesFilePath(project);\n const duplicatesFile = getDuplicatesFilePath(project);\n\n const tree = await createDependencyTree(project);\n\n const references: IDependencyCollection = {\n dependencies: tree.dependencies,\n devDependencies: tree.devDependencies,\n peerDependencies: tree.peerDependencies,\n resolutions: tree.resolutions,\n references: tree.references\n };\n\n ui.info(\"Checking references file...\");\n\n if (fs.existsSync(referencesFile)) {\n const json = loadJsonFileSync<IDependencyCollection>(referencesFile)!;\n if (JSON.stringify(references) !== JSON.stringify(json)) {\n for (const type in references) {\n const refDependencies = references[type as keyof typeof references];\n const fileDependencies = json[type as keyof typeof json];\n for (const dep in refDependencies) {\n const refDep = refDependencies[dep];\n const fileDep = fileDependencies[dep];\n if (!fileDep) {\n console.log(\"Missing dependency:\", refDep.name, \"in\", type);\n continue;\n }\n if (JSON.stringify(refDep) !== JSON.stringify(fileDep)) {\n console.log(\"Mismatch in dependency:\", refDep.name, \"in\", type);\n console.log({\n refDep: JSON.stringify(refDep),\n fileDep: JSON.stringify(fileDep)\n });\n }\n }\n }\n throw new Error(\n \"References are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n } else {\n throw new Error(\n \"References file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"Checking duplicates file...\");\n\n if (fs.existsSync(duplicatesFile)) {\n const json = loadJsonFileSync(duplicatesFile);\n if (JSON.stringify(tree.duplicates) !== JSON.stringify(json)) {\n throw new Error(\n \"Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command.\"\n );\n } else if (Array.isArray(json) && json.length > 0) {\n throw new Error(\n \"There are still duplicates in the project. Please sort them out and run `yarn webiny sync-dependencies` command to regenerate files.\"\n );\n }\n } else {\n throw new Error(\n \"Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command.\"\n );\n }\n\n ui.info(\"✅ All package reference files are in sync.\");\n }\n };\n }\n}\n\nexport const verifyDepsCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: VerifyDepsCommand,\n dependencies: [GetProjectSdkService, UiService]\n});\n"],"names":["VerifyDepsCommand","getProjectSdkService","uiService","ui","projectSdk","project","referencesFile","getReferencesFilePath","duplicatesFile","getDuplicatesFilePath","tree","createDependencyTree","references","fs","json","loadJsonFileSync","JSON","type","refDependencies","fileDependencies","dep","refDep","fileDep","console","Error","Array","verifyDepsCommand","createImplementation","CliCommandFactory","GetProjectSdkService","UiService"],"mappings":";;;;;;AAQO,MAAMA;IACT,YACYC,oBAAoD,EACpDC,SAA8B,CACxC;aAFUD,oBAAoB,GAApBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,OAAO;YACH,MAAM;YACN,aAAa;YACb,UAAU;gBAAC;aAAyB;YACpC,SAAS;gBACL,MAAMC,KAAK,IAAI,CAAC,SAAS;gBACzB,MAAMC,aAAa,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO;gBAC1D,MAAMC,UAAUD,WAAW,UAAU;gBACrC,MAAME,iBAAiBC,sBAAsBF;gBAC7C,MAAMG,iBAAiBC,sBAAsBJ;gBAE7C,MAAMK,OAAO,MAAMC,qBAAqBN;gBAExC,MAAMO,aAAoC;oBACtC,cAAcF,KAAK,YAAY;oBAC/B,iBAAiBA,KAAK,eAAe;oBACrC,kBAAkBA,KAAK,gBAAgB;oBACvC,aAAaA,KAAK,WAAW;oBAC7B,YAAYA,KAAK,UAAU;gBAC/B;gBAEAP,GAAG,IAAI,CAAC;gBAER,IAAIU,GAAG,UAAU,CAACP,iBAAiB;oBAC/B,MAAMQ,OAAOC,iBAAwCT;oBACrD,IAAIU,KAAK,SAAS,CAACJ,gBAAgBI,KAAK,SAAS,CAACF,OAAO;wBACrD,IAAK,MAAMG,QAAQL,WAAY;4BAC3B,MAAMM,kBAAkBN,UAAU,CAACK,KAAgC;4BACnE,MAAME,mBAAmBL,IAAI,CAACG,KAA0B;4BACxD,IAAK,MAAMG,OAAOF,gBAAiB;gCAC/B,MAAMG,SAASH,eAAe,CAACE,IAAI;gCACnC,MAAME,UAAUH,gBAAgB,CAACC,IAAI;gCACrC,IAAI,CAACE,SAAS;oCACVC,QAAQ,GAAG,CAAC,uBAAuBF,OAAO,IAAI,EAAE,MAAMJ;oCACtD;gCACJ;gCACA,IAAID,KAAK,SAAS,CAACK,YAAYL,KAAK,SAAS,CAACM,UAAU;oCACpDC,QAAQ,GAAG,CAAC,2BAA2BF,OAAO,IAAI,EAAE,MAAMJ;oCAC1DM,QAAQ,GAAG,CAAC;wCACR,QAAQP,KAAK,SAAS,CAACK;wCACvB,SAASL,KAAK,SAAS,CAACM;oCAC5B;gCACJ;4BACJ;wBACJ;wBACA,MAAM,IAAIE,MACN;oBAER;gBACJ,OACI,MAAM,IAAIA,MACN;gBAIRrB,GAAG,IAAI,CAAC;gBAER,IAAIU,GAAG,UAAU,CAACL,iBAAiB;oBAC/B,MAAMM,OAAOC,iBAAiBP;oBAC9B,IAAIQ,KAAK,SAAS,CAACN,KAAK,UAAU,MAAMM,KAAK,SAAS,CAACF,OACnD,MAAM,IAAIU,MACN;yBAED,IAAIC,MAAM,OAAO,CAACX,SAASA,KAAK,MAAM,GAAG,GAC5C,MAAM,IAAIU,MACN;gBAGZ,OACI,MAAM,IAAIA,MACN;gBAIRrB,GAAG,IAAI,CAAC;YACZ;QACJ;IACJ;AACJ;AAEO,MAAMuB,oBAAoBC,qBAAqB;IAClD,aAAaC;IACb,gBAAgB5B;IAChB,cAAc;QAAC6B;QAAsBC;KAAU;AACnD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IDependencyTree } from "./types.js";
|
|
2
2
|
import { IProjectModel } from "@webiny/project";
|
|
3
|
-
export declare const createDependencyTree: (project: IProjectModel) => IDependencyTree
|
|
3
|
+
export declare const createDependencyTree: (project: IProjectModel) => Promise<IDependencyTree>;
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
+
import fs from "fs";
|
|
1
2
|
import { ListAllPackages } from "./ListAllPackages.js";
|
|
2
3
|
import { ListAllPackageJsonFiles } from "./ListAllPackageJsonFiles.js";
|
|
3
4
|
import { BuildDependencyTree } from "./BuildDependencyTree.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
const createDependencyTree = async (project)=>{
|
|
6
|
+
const projectRoot = project.paths.rootFolder;
|
|
7
|
+
const basePath = projectRoot.toString();
|
|
8
|
+
const packagesFolderPath = projectRoot.join("packages").toString();
|
|
9
|
+
const packageJsonFilePath = projectRoot.join("package.json").toString();
|
|
10
|
+
const e2ePackageJsonFilePath = projectRoot.join("e2e/package.json").toString();
|
|
11
|
+
const listAllPackages = new ListAllPackages();
|
|
12
|
+
const listAllPackageJsonFiles = new ListAllPackageJsonFiles();
|
|
13
|
+
const buildDependencyTree = new BuildDependencyTree();
|
|
14
|
+
const allPackages = await listAllPackages.list([
|
|
15
|
+
packagesFolderPath
|
|
16
|
+
]);
|
|
17
|
+
const allPackageJsonFiles = listAllPackageJsonFiles.list({
|
|
18
|
+
targets: allPackages
|
|
19
|
+
});
|
|
20
|
+
return buildDependencyTree.build({
|
|
21
|
+
basePath,
|
|
22
|
+
files: [
|
|
23
|
+
packageJsonFilePath,
|
|
24
|
+
...fs.existsSync(e2ePackageJsonFilePath) ? [
|
|
25
|
+
e2ePackageJsonFilePath
|
|
26
|
+
] : [],
|
|
27
|
+
...allPackageJsonFiles
|
|
28
|
+
],
|
|
29
|
+
ignore: /^@webiny\//
|
|
30
|
+
});
|
|
22
31
|
};
|
|
32
|
+
export { createDependencyTree };
|
|
23
33
|
|
|
24
34
|
//# sourceMappingURL=createDependencyTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/createDependencyTree.js","sources":["../../../src/features/DepsSync/createDependencyTree.ts"],"sourcesContent":["import fs from \"fs\";\nimport type { IDependencyTree } from \"./types.js\";\nimport { ListAllPackages } from \"./ListAllPackages.js\";\nimport { ListAllPackageJsonFiles } from \"./ListAllPackageJsonFiles.js\";\nimport { BuildDependencyTree } from \"./BuildDependencyTree.js\";\nimport { IProjectModel } from \"@webiny/project\";\n\nexport const createDependencyTree = async (project: IProjectModel): Promise<IDependencyTree> => {\n const projectRoot = project.paths.rootFolder;\n const basePath = projectRoot.toString();\n const packagesFolderPath = projectRoot.join(\"packages\").toString();\n const packageJsonFilePath = projectRoot.join(\"package.json\").toString();\n // The e2e tests share deps with the packages (zod, ai), so their versions are checked too.\n const e2ePackageJsonFilePath = projectRoot.join(\"e2e/package.json\").toString();\n\n const listAllPackages = new ListAllPackages();\n const listAllPackageJsonFiles = new ListAllPackageJsonFiles();\n const buildDependencyTree = new BuildDependencyTree();\n\n const allPackages = await listAllPackages.list([packagesFolderPath]);\n\n const allPackageJsonFiles = listAllPackageJsonFiles.list({\n targets: allPackages\n });\n\n return buildDependencyTree.build({\n basePath,\n files: [\n packageJsonFilePath,\n ...(fs.existsSync(e2ePackageJsonFilePath) ? [e2ePackageJsonFilePath] : []),\n ...allPackageJsonFiles\n ],\n ignore: /^@webiny\\//\n });\n};\n"],"names":["createDependencyTree","project","projectRoot","basePath","packagesFolderPath","packageJsonFilePath","e2ePackageJsonFilePath","listAllPackages","ListAllPackages","listAllPackageJsonFiles","ListAllPackageJsonFiles","buildDependencyTree","BuildDependencyTree","allPackages","allPackageJsonFiles","fs"],"mappings":";;;;AAOO,MAAMA,uBAAuB,OAAOC;IACvC,MAAMC,cAAcD,QAAQ,KAAK,CAAC,UAAU;IAC5C,MAAME,WAAWD,YAAY,QAAQ;IACrC,MAAME,qBAAqBF,YAAY,IAAI,CAAC,YAAY,QAAQ;IAChE,MAAMG,sBAAsBH,YAAY,IAAI,CAAC,gBAAgB,QAAQ;IAErE,MAAMI,yBAAyBJ,YAAY,IAAI,CAAC,oBAAoB,QAAQ;IAE5E,MAAMK,kBAAkB,IAAIC;IAC5B,MAAMC,0BAA0B,IAAIC;IACpC,MAAMC,sBAAsB,IAAIC;IAEhC,MAAMC,cAAc,MAAMN,gBAAgB,IAAI,CAAC;QAACH;KAAmB;IAEnE,MAAMU,sBAAsBL,wBAAwB,IAAI,CAAC;QACrD,SAASI;IACb;IAEA,OAAOF,oBAAoB,KAAK,CAAC;QAC7BR;QACA,OAAO;YACHE;eACIU,GAAG,UAAU,CAACT,0BAA0B;gBAACA;aAAuB,GAAG,EAAE;eACtEQ;SACN;QACD,QAAQ;IACZ;AACJ"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { writeJsonFileSync } from "write-json-file";
|
|
2
2
|
import { getDuplicatesFilePath, getReferencesFilePath } from "./paths.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
ui.info(`Creating %s...`, dupesFilePath);
|
|
25
|
-
writeJsonFileSync(dupesFilePath, tree.duplicates, {
|
|
26
|
-
indent: 0
|
|
27
|
-
});
|
|
3
|
+
const createReferenceFile = (project, tree, di)=>{
|
|
4
|
+
const refsFilePath = getReferencesFilePath(project);
|
|
5
|
+
const dupesFilePath = getDuplicatesFilePath(project);
|
|
6
|
+
const { uiService: ui } = di;
|
|
7
|
+
if (0 === tree.references.length) return void ui.info("No references found.");
|
|
8
|
+
const json = {
|
|
9
|
+
dependencies: tree.dependencies,
|
|
10
|
+
devDependencies: tree.devDependencies,
|
|
11
|
+
peerDependencies: tree.peerDependencies,
|
|
12
|
+
resolutions: tree.resolutions,
|
|
13
|
+
references: tree.references
|
|
14
|
+
};
|
|
15
|
+
ui.info("Creating %s...", refsFilePath);
|
|
16
|
+
writeJsonFileSync(refsFilePath, json, {
|
|
17
|
+
indent: 0
|
|
18
|
+
});
|
|
19
|
+
ui.info("Creating %s...", dupesFilePath);
|
|
20
|
+
writeJsonFileSync(dupesFilePath, tree.duplicates, {
|
|
21
|
+
indent: 0
|
|
22
|
+
});
|
|
28
23
|
};
|
|
24
|
+
export { createReferenceFile };
|
|
29
25
|
|
|
30
26
|
//# sourceMappingURL=createReferenceFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/createReferenceFile.js","sources":["../../../src/features/DepsSync/createReferenceFile.ts"],"sourcesContent":["import { writeJsonFileSync } from \"write-json-file\";\nimport { IProjectModel } from \"@webiny/project\";\nimport { UiService } from \"~/abstractions/services/index.js\";\nimport { getDuplicatesFilePath, getReferencesFilePath } from \"./paths.js\";\nimport type { IDependencyCollection, IDependencyTree } from \"./types.js\";\n\nexport interface ICreateReferenceFileDi {\n uiService: UiService.Interface;\n}\n\nexport const createReferenceFile = (\n project: IProjectModel,\n tree: IDependencyTree,\n di: ICreateReferenceFileDi\n): void => {\n const refsFilePath = getReferencesFilePath(project);\n const dupesFilePath = getDuplicatesFilePath(project);\n\n const { uiService: ui } = di;\n if (tree.references.length === 0) {\n ui.info(\"No references found.\");\n return;\n }\n\n const json: IDependencyCollection = {\n dependencies: tree.dependencies,\n devDependencies: tree.devDependencies,\n peerDependencies: tree.peerDependencies,\n resolutions: tree.resolutions,\n references: tree.references\n };\n\n ui.info(`Creating %s...`, refsFilePath);\n writeJsonFileSync(refsFilePath, json, {\n indent: 0\n });\n\n ui.info(`Creating %s...`, dupesFilePath);\n\n writeJsonFileSync(dupesFilePath, tree.duplicates, {\n indent: 0\n });\n};\n"],"names":["createReferenceFile","project","tree","di","refsFilePath","getReferencesFilePath","dupesFilePath","getDuplicatesFilePath","ui","json","writeJsonFileSync"],"mappings":";;AAUO,MAAMA,sBAAsB,CAC/BC,SACAC,MACAC;IAEA,MAAMC,eAAeC,sBAAsBJ;IAC3C,MAAMK,gBAAgBC,sBAAsBN;IAE5C,MAAM,EAAE,WAAWO,EAAE,EAAE,GAAGL;IAC1B,IAAID,AAA2B,MAA3BA,KAAK,UAAU,CAAC,MAAM,EAAQ,YAC9BM,GAAG,IAAI,CAAC;IAIZ,MAAMC,OAA8B;QAChC,cAAcP,KAAK,YAAY;QAC/B,iBAAiBA,KAAK,eAAe;QACrC,kBAAkBA,KAAK,gBAAgB;QACvC,aAAaA,KAAK,WAAW;QAC7B,YAAYA,KAAK,UAAU;IAC/B;IAEAM,GAAG,IAAI,CAAC,kBAAkBJ;IAC1BM,kBAAkBN,cAAcK,MAAM;QAClC,QAAQ;IACZ;IAEAD,GAAG,IAAI,CAAC,kBAAkBF;IAE1BI,kBAAkBJ,eAAeJ,KAAK,UAAU,EAAE;QAC9C,QAAQ;IACZ;AACJ"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
export const getDuplicatesFilePath = project => {
|
|
5
|
-
return project.paths.rootFolder.join("packages/cli/files/duplicates.json").toString();
|
|
6
|
-
};
|
|
1
|
+
const getReferencesFilePath = (project)=>project.paths.rootFolder.join("packages/cli-core/files/references.json").toString();
|
|
2
|
+
const getDuplicatesFilePath = (project)=>project.paths.rootFolder.join("packages/cli-core/files/duplicates.json").toString();
|
|
3
|
+
export { getDuplicatesFilePath, getReferencesFilePath };
|
|
7
4
|
|
|
8
5
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/paths.js","sources":["../../../src/features/DepsSync/paths.ts"],"sourcesContent":["import { IProjectModel } from \"@webiny/project\";\n\nexport const getReferencesFilePath = (project: IProjectModel) => {\n return project.paths.rootFolder.join(\"packages/cli-core/files/references.json\").toString();\n};\n\nexport const getDuplicatesFilePath = (project: IProjectModel) => {\n return project.paths.rootFolder.join(\"packages/cli-core/files/duplicates.json\").toString();\n};\n"],"names":["getReferencesFilePath","project","getDuplicatesFilePath"],"mappings":"AAEO,MAAMA,wBAAwB,CAACC,UAC3BA,QAAQ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,2CAA2C,QAAQ;AAGrF,MAAMC,wBAAwB,CAACD,UAC3BA,QAAQ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,2CAA2C,QAAQ"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var types_PackageType = /*#__PURE__*/ function(PackageType) {
|
|
2
|
+
PackageType["dependencies"] = "dependencies";
|
|
3
|
+
PackageType["devDependencies"] = "devDependencies";
|
|
4
|
+
PackageType["peerDependencies"] = "peerDependencies";
|
|
5
|
+
PackageType["resolutions"] = "resolutions";
|
|
6
|
+
return PackageType;
|
|
7
7
|
}({});
|
|
8
|
+
export { types_PackageType as PackageType };
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DepsSync/types.js","sources":["../../../src/features/DepsSync/types.ts"],"sourcesContent":["import type { PackageJson } from \"type-fest\";\n\nexport enum PackageType {\n dependencies = \"dependencies\",\n devDependencies = \"devDependencies\",\n peerDependencies = \"peerDependencies\",\n resolutions = \"resolutions\"\n}\n\nexport interface IReferenceVersionFile {\n file: string;\n types: PackageType[];\n}\n\nexport interface IReferenceVersion {\n version: string;\n files: IReferenceVersionFile[];\n}\n\nexport interface IReference {\n name: string;\n versions: IReferenceVersion[];\n}\n\nexport interface IDependency {\n name: string;\n version: string;\n files: string[];\n}\n\nexport interface IDependencyTreePushParams {\n file: string;\n json: PackageJson;\n ignore?: RegExp;\n}\n\nexport interface IDependencyCollection {\n dependencies: IDependency[];\n devDependencies: IDependency[];\n peerDependencies: IDependency[];\n resolutions: IDependency[];\n references: IReference[];\n}\n\nexport interface IDependencyTree {\n dependencies: IDependency[];\n devDependencies: IDependency[];\n peerDependencies: IDependency[];\n resolutions: IDependency[];\n references: IReference[];\n duplicates: IReference[];\n\n push(params: IDependencyTreePushParams): void;\n}\n"],"names":["PackageType"],"mappings":"AAEO,IAAKA,oBAAWA,WAAAA,GAAAA,SAAXA,WAAW;;;;;WAAXA"}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { CliCommandFactory, UiService } from "../abstractions/index.js";
|
|
3
|
-
import { disable
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
import { disable, sendEvent } from "@webiny/telemetry/cli.js";
|
|
4
|
+
class DisableTelemetryCommand {
|
|
5
|
+
constructor(uiService){
|
|
6
|
+
this.uiService = uiService;
|
|
7
|
+
}
|
|
8
|
+
execute() {
|
|
9
|
+
const ui = this.uiService;
|
|
10
|
+
return {
|
|
11
|
+
name: "disable-telemetry",
|
|
12
|
+
description: "Disables Webiny telemetry",
|
|
13
|
+
handler: async ()=>{
|
|
14
|
+
disable();
|
|
15
|
+
await sendEvent({
|
|
16
|
+
event: "disable-telemetry",
|
|
17
|
+
properties: {}
|
|
18
|
+
});
|
|
19
|
+
ui.info("Webiny telemetry is now %s! Thank you for helping us in making Webiny better!", "disabled");
|
|
20
|
+
ui.info("For more information, please visit the following link: https://www.webiny.com/telemetry.");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const disableTelemetryCommand = createImplementation({
|
|
26
|
+
abstraction: CliCommandFactory,
|
|
27
|
+
implementation: DisableTelemetryCommand,
|
|
28
|
+
dependencies: [
|
|
29
|
+
UiService
|
|
30
|
+
]
|
|
29
31
|
});
|
|
32
|
+
export { DisableTelemetryCommand, disableTelemetryCommand };
|
|
30
33
|
|
|
31
34
|
//# sourceMappingURL=DisableTelemetryCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/DisableTelemetryCommand.js","sources":["../../src/features/DisableTelemetryCommand.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { CliCommandFactory, UiService } from \"~/abstractions/index.js\";\nimport { disable as disableTelemetry, sendEvent } from \"@webiny/telemetry/cli.js\";\n\nexport class DisableTelemetryCommand implements CliCommandFactory.Interface<void> {\n constructor(private uiService: UiService.Interface) {}\n\n execute() {\n const ui = this.uiService;\n\n return {\n name: \"disable-telemetry\",\n description: \"Disables Webiny telemetry\",\n handler: async () => {\n disableTelemetry();\n await sendEvent({ event: \"disable-telemetry\", properties: {} });\n ui.info(\n `Webiny telemetry is now %s! Thank you for helping us in making Webiny better!`,\n \"disabled\"\n );\n ui.info(\n `For more information, please visit the following link: https://www.webiny.com/telemetry.`\n );\n }\n };\n }\n}\n\nexport const disableTelemetryCommand = createImplementation({\n abstraction: CliCommandFactory,\n implementation: DisableTelemetryCommand,\n dependencies: [UiService]\n});\n"],"names":["DisableTelemetryCommand","uiService","ui","disableTelemetry","sendEvent","disableTelemetryCommand","createImplementation","CliCommandFactory","UiService"],"mappings":";;;AAIO,MAAMA;IACT,YAAoBC,SAA8B,CAAE;aAAhCA,SAAS,GAATA;IAAiC;IAErD,UAAU;QACN,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzB,OAAO;YACH,MAAM;YACN,aAAa;YACb,SAAS;gBACLC;gBACA,MAAMC,UAAU;oBAAE,OAAO;oBAAqB,YAAY,CAAC;gBAAE;gBAC7DF,GAAG,IAAI,CACH,iFACA;gBAEJA,GAAG,IAAI,CACH;YAER;QACJ;IACJ;AACJ;AAEO,MAAMG,0BAA0BC,qBAAqB;IACxD,aAAaC;IACb,gBAAgBP;IAChB,cAAc;QAACQ;KAAU;AAC7B"}
|