@atlashub/smartstack-cli 4.70.0 → 4.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +42 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125110,16 +125110,45 @@ async function getLatestNpmVersion(packageName, prerelease) {
|
|
|
125110
125110
|
async function detectSmartStackProject() {
|
|
125111
125111
|
const cwd = process.cwd();
|
|
125112
125112
|
const configPath = (0, import_path8.join)(cwd, ".smartstack", "config.json");
|
|
125113
|
-
if (
|
|
125114
|
-
|
|
125113
|
+
if (await import_fs_extra7.default.pathExists(configPath)) {
|
|
125114
|
+
try {
|
|
125115
|
+
const config = await import_fs_extra7.default.readJson(configPath);
|
|
125116
|
+
return { isProject: true, config, projectDir: cwd };
|
|
125117
|
+
} catch (error) {
|
|
125118
|
+
logger.warning("Could not read .smartstack/config.json");
|
|
125119
|
+
}
|
|
125115
125120
|
}
|
|
125116
|
-
|
|
125117
|
-
|
|
125118
|
-
|
|
125119
|
-
|
|
125120
|
-
|
|
125121
|
-
|
|
125121
|
+
const srcDir = (0, import_path8.join)(cwd, "src");
|
|
125122
|
+
if (await import_fs_extra7.default.pathExists(srcDir)) {
|
|
125123
|
+
const folders = await import_fs_extra7.default.readdir(srcDir);
|
|
125124
|
+
for (const folder of folders) {
|
|
125125
|
+
const folderPath = (0, import_path8.join)(srcDir, folder);
|
|
125126
|
+
const stat = await import_fs_extra7.default.stat(folderPath);
|
|
125127
|
+
if (!stat.isDirectory()) continue;
|
|
125128
|
+
const csprojFiles = (await import_fs_extra7.default.readdir(folderPath)).filter((f) => f.endsWith(".csproj"));
|
|
125129
|
+
for (const csproj of csprojFiles) {
|
|
125130
|
+
const content = await import_fs_extra7.default.readFile((0, import_path8.join)(folderPath, csproj), "utf-8");
|
|
125131
|
+
const version2 = readPackageVersion(content, "SmartStack");
|
|
125132
|
+
if (version2) {
|
|
125133
|
+
const dotIndex = folder.lastIndexOf(".");
|
|
125134
|
+
const baseNamespace = dotIndex > 0 ? folder.substring(0, dotIndex) : folder;
|
|
125135
|
+
logger.warning("No .smartstack/config.json found \u2014 detected SmartStack project from .csproj files");
|
|
125136
|
+
logger.info(`Tip: Run ${source_default.cyan("ss init --here")} to create the config file.`);
|
|
125137
|
+
return {
|
|
125138
|
+
isProject: true,
|
|
125139
|
+
config: {
|
|
125140
|
+
projectType: "fullstack",
|
|
125141
|
+
dbContext: `${baseNamespace}DbContext`,
|
|
125142
|
+
baseNamespace,
|
|
125143
|
+
smartStackVersion: version2
|
|
125144
|
+
},
|
|
125145
|
+
projectDir: cwd
|
|
125146
|
+
};
|
|
125147
|
+
}
|
|
125148
|
+
}
|
|
125149
|
+
}
|
|
125122
125150
|
}
|
|
125151
|
+
return { isProject: false, projectDir: cwd };
|
|
125123
125152
|
}
|
|
125124
125153
|
function readPackageVersion(csprojContent, packageName) {
|
|
125125
125154
|
const regex2 = new RegExp(
|
|
@@ -125874,10 +125903,12 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125874
125903
|
console.log();
|
|
125875
125904
|
}
|
|
125876
125905
|
if (!dryRun && nugetVersion) {
|
|
125877
|
-
config.smartStackVersion = nugetVersion;
|
|
125878
125906
|
const configPath = (0, import_path8.join)(projectDir, ".smartstack", "config.json");
|
|
125879
|
-
await import_fs_extra7.default.
|
|
125880
|
-
|
|
125907
|
+
if (await import_fs_extra7.default.pathExists(configPath)) {
|
|
125908
|
+
config.smartStackVersion = nugetVersion;
|
|
125909
|
+
await import_fs_extra7.default.writeJson(configPath, config, { spaces: 2 });
|
|
125910
|
+
logger.success(`Updated config version to ${source_default.cyan(nugetVersion)}`);
|
|
125911
|
+
}
|
|
125881
125912
|
console.log();
|
|
125882
125913
|
}
|
|
125883
125914
|
const totalChanged = result.nugetUpgraded + result.requiredPkgAdded + result.otherPkgUpdated + (result.npmUpgraded ? 1 : 0) + (result.npmOtherUpdated ? 1 : 0) + migrationSummary.totalApplied + result.configSynced + result.claudeSettingsSynced + result.dockerSynced + result.testFrontendSynced + result.residualsCleaned + (result.initStateFixed ? 1 : 0) + (result.ralphInitialized ? 1 : 0);
|