Skip to content

Commit 8bdc66a

Browse files
author
Craigory V Coppola
authored
fix(core): sync command should list package names (#41)
fixes #39
1 parent 5f2d5c9 commit 8bdc66a

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

packages/core/src/generators/nuget-reference/generator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default async function (
3030
options.version,
3131
configuredPkgVersion,
3232
options.allowVersionMismatch,
33+
options.packageName,
3334
);
3435
config.nugetPackages[options.packageName] = resolvedVersion;
3536
if (

packages/core/src/generators/sync/generator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default async function (host: Tree) {
3939
version,
4040
configuredVersion,
4141
false,
42+
pkg,
4243
);
4344
// console.log('Resolved:', resolved)
4445
config.nugetPackages[pkg] = resolved;

packages/core/src/generators/sync/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"id": "Sync",
55
"title": "",
66
"type": "object",
7+
"description": "Syncs package versions across the workspace with nx-dotnet config.",
78
"properties": {}
89
}

packages/core/src/generators/utils/resolve-version-mismatch.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export async function resolveVersionMismatch(
66
desired: string | undefined,
77
configured: string | undefined,
88
allowVersionMismatch: boolean,
9+
packageName: string | undefined,
910
): Promise<string> {
1011
if (configured) {
1112
if (configured !== desired) {
@@ -28,8 +29,9 @@ export async function resolveVersionMismatch(
2829
short: 'Allow mismatch',
2930
},
3031
],
31-
message:
32-
'There appears to be a mismatch between your current package preferences and the requested version. Which version would you like to use?',
32+
message: `There appears to be a mismatch between your current package preferences and the requested version ${
33+
packageName ? 'for ' + packageName : ''
34+
}. Which version would you like to use?`,
3335
},
3436
]);
3537
return resolution;
@@ -40,7 +42,9 @@ export async function resolveVersionMismatch(
4042
const { choice } = await prompt([
4143
{
4244
name: 'choice',
43-
message: `You have not yet set a version for this package. Which version would you like to install?`,
45+
message: `You have not yet set a version for ${
46+
packageName ? packageName : 'this package'
47+
}. Which version would you like to install?`,
4448
},
4549
]);
4650
return choice;

0 commit comments

Comments
 (0)