@atlashub/smartstack-cli 2.6.1 → 2.6.2
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/dist/index.js +66 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124620,6 +124620,15 @@ function readPackageVersion(csprojContent, packageName) {
|
|
|
124620
124620
|
const match2 = csprojContent.match(regex2);
|
|
124621
124621
|
return match2 ? match2[1] : null;
|
|
124622
124622
|
}
|
|
124623
|
+
function readAllPackageReferences(csprojContent) {
|
|
124624
|
+
const regex2 = /<PackageReference\s+Include="([^"]+)"\s+Version="([^"]+)"/gi;
|
|
124625
|
+
const packages = [];
|
|
124626
|
+
let match2;
|
|
124627
|
+
while ((match2 = regex2.exec(csprojContent)) !== null) {
|
|
124628
|
+
packages.push({ name: match2[1], currentVersion: match2[2] });
|
|
124629
|
+
}
|
|
124630
|
+
return packages;
|
|
124631
|
+
}
|
|
124623
124632
|
async function findProjectsWithSmartStack(projectDir) {
|
|
124624
124633
|
const srcDir = (0, import_path7.join)(projectDir, "src");
|
|
124625
124634
|
if (!await import_fs_extra6.default.pathExists(srcDir)) {
|
|
@@ -124787,6 +124796,9 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124787
124796
|
nugetUpgraded: 0,
|
|
124788
124797
|
nugetSkipped: 0,
|
|
124789
124798
|
nugetFailed: 0,
|
|
124799
|
+
otherPkgUpdated: 0,
|
|
124800
|
+
otherPkgSkipped: 0,
|
|
124801
|
+
otherPkgFailed: 0,
|
|
124790
124802
|
npmUpgraded: false,
|
|
124791
124803
|
npmSkipped: false
|
|
124792
124804
|
};
|
|
@@ -124859,6 +124871,48 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124859
124871
|
}
|
|
124860
124872
|
}
|
|
124861
124873
|
console.log();
|
|
124874
|
+
logger.info("Checking other NuGet packages...");
|
|
124875
|
+
for (const project of projects) {
|
|
124876
|
+
const content = await import_fs_extra6.default.readFile(project.csprojPath, "utf-8");
|
|
124877
|
+
const allPackages = readAllPackageReferences(content);
|
|
124878
|
+
const otherPackages = allPackages.filter((p) => p.name !== "SmartStack");
|
|
124879
|
+
if (otherPackages.length === 0) continue;
|
|
124880
|
+
const relPath = project.relPath;
|
|
124881
|
+
for (const pkg2 of otherPackages) {
|
|
124882
|
+
try {
|
|
124883
|
+
const output = dryRun ? `[DRY RUN] dotnet add "${project.csprojPath}" package ${pkg2.name}` : (0, import_child_process6.execSync)(
|
|
124884
|
+
`dotnet add "${project.csprojPath}" package ${pkg2.name}`,
|
|
124885
|
+
{ shell: true, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
124886
|
+
);
|
|
124887
|
+
if (dryRun) {
|
|
124888
|
+
logger.info(` [DRY RUN] ${pkg2.name} ${source_default.yellow(pkg2.currentVersion)} \u2192 latest`);
|
|
124889
|
+
result.otherPkgUpdated++;
|
|
124890
|
+
continue;
|
|
124891
|
+
}
|
|
124892
|
+
const newContent = await import_fs_extra6.default.readFile(project.csprojPath, "utf-8");
|
|
124893
|
+
const newVersion = readPackageVersion(newContent, pkg2.name);
|
|
124894
|
+
if (newVersion && newVersion !== pkg2.currentVersion) {
|
|
124895
|
+
logger.success(` ${source_default.green("\u2713")} ${pkg2.name} ${source_default.yellow(pkg2.currentVersion)} \u2192 ${source_default.cyan(newVersion)}`);
|
|
124896
|
+
result.otherPkgUpdated++;
|
|
124897
|
+
} else {
|
|
124898
|
+
result.otherPkgSkipped++;
|
|
124899
|
+
}
|
|
124900
|
+
} catch (error) {
|
|
124901
|
+
result.otherPkgFailed++;
|
|
124902
|
+
logger.error(` ${source_default.red("\u2717")} ${pkg2.name}: ${error instanceof Error ? error.message : error}`);
|
|
124903
|
+
}
|
|
124904
|
+
}
|
|
124905
|
+
}
|
|
124906
|
+
if (result.otherPkgUpdated > 0) {
|
|
124907
|
+
logger.success(`${result.otherPkgUpdated} package(s) updated`);
|
|
124908
|
+
}
|
|
124909
|
+
if (result.otherPkgSkipped > 0) {
|
|
124910
|
+
logger.info(`${result.otherPkgSkipped} package(s) already at latest`);
|
|
124911
|
+
}
|
|
124912
|
+
if (result.otherPkgFailed > 0) {
|
|
124913
|
+
logger.error(`${result.otherPkgFailed} package(s) failed to update`);
|
|
124914
|
+
}
|
|
124915
|
+
console.log();
|
|
124862
124916
|
}
|
|
124863
124917
|
const frontendDir = await findFrontendDirectory(projectDir);
|
|
124864
124918
|
if (!frontendDir) {
|
|
@@ -124917,8 +124971,8 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124917
124971
|
logger.success(`Updated config version to ${source_default.cyan(nugetVersion)}`);
|
|
124918
124972
|
console.log();
|
|
124919
124973
|
}
|
|
124920
|
-
const totalChanged = result.nugetUpgraded + (result.npmUpgraded ? 1 : 0) + migrationSummary.totalApplied;
|
|
124921
|
-
const allUpToDate = totalChanged === 0 && result.nugetFailed === 0;
|
|
124974
|
+
const totalChanged = result.nugetUpgraded + result.otherPkgUpdated + (result.npmUpgraded ? 1 : 0) + migrationSummary.totalApplied;
|
|
124975
|
+
const allUpToDate = totalChanged === 0 && result.nugetFailed === 0 && result.otherPkgFailed === 0;
|
|
124922
124976
|
if (allUpToDate) {
|
|
124923
124977
|
const summary = [
|
|
124924
124978
|
source_default.green.bold("Already up to date!"),
|
|
@@ -124926,7 +124980,7 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124926
124980
|
` NuGet SmartStack: ${source_default.cyan(nugetVersion)}`,
|
|
124927
124981
|
npmVersion ? ` npm @atlashub/smartstack: ${source_default.cyan(npmVersion)}` : "",
|
|
124928
124982
|
"",
|
|
124929
|
-
"
|
|
124983
|
+
"All packages at latest versions."
|
|
124930
124984
|
].filter(Boolean);
|
|
124931
124985
|
logger.box(summary, "success");
|
|
124932
124986
|
} else {
|
|
@@ -124935,13 +124989,19 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
124935
124989
|
""
|
|
124936
124990
|
];
|
|
124937
124991
|
if (result.nugetUpgraded > 0) {
|
|
124938
|
-
lines.push(` ${source_default.green("\u2713")}
|
|
124992
|
+
lines.push(` ${source_default.green("\u2713")} SmartStack: ${result.nugetUpgraded} project(s) \u2192 ${source_default.cyan(nugetVersion)}`);
|
|
124939
124993
|
}
|
|
124940
124994
|
if (result.nugetSkipped > 0) {
|
|
124941
|
-
lines.push(` ${source_default.gray("\u2013")}
|
|
124995
|
+
lines.push(` ${source_default.gray("\u2013")} SmartStack: ${result.nugetSkipped} project(s) already up to date`);
|
|
124942
124996
|
}
|
|
124943
124997
|
if (result.nugetFailed > 0) {
|
|
124944
|
-
lines.push(` ${source_default.red("\u2717")}
|
|
124998
|
+
lines.push(` ${source_default.red("\u2717")} SmartStack: ${result.nugetFailed} project(s) failed`);
|
|
124999
|
+
}
|
|
125000
|
+
if (result.otherPkgUpdated > 0) {
|
|
125001
|
+
lines.push(` ${source_default.green("\u2713")} Other NuGet: ${result.otherPkgUpdated} package(s) updated`);
|
|
125002
|
+
}
|
|
125003
|
+
if (result.otherPkgFailed > 0) {
|
|
125004
|
+
lines.push(` ${source_default.red("\u2717")} Other NuGet: ${result.otherPkgFailed} package(s) failed`);
|
|
124945
125005
|
}
|
|
124946
125006
|
if (result.npmUpgraded) {
|
|
124947
125007
|
lines.push(` ${source_default.green("\u2713")} npm: @atlashub/smartstack \u2192 ${source_default.cyan(npmVersion)}`);
|