@atlashub/smartstack-cli 4.54.0 → 4.55.1
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 +114 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/project/Dockerfile.backend.template +56 -0
- package/templates/project/Dockerfile.frontend.template +63 -0
- package/templates/project/dockerignore.template +13 -0
- package/templates/skills/business-analyse-html/SKILL.md +2 -0
- package/templates/skills/business-analyse-html/steps/step-03-render.md +17 -0
package/dist/index.js
CHANGED
|
@@ -116154,6 +116154,7 @@ var INIT_STEPS = [
|
|
|
116154
116154
|
{ id: "config", name: "Configuration files" },
|
|
116155
116155
|
{ id: "backend", name: "Backend structure" },
|
|
116156
116156
|
{ id: "frontend", name: "Frontend structure" },
|
|
116157
|
+
{ id: "docker", name: "Docker configuration" },
|
|
116157
116158
|
{ id: "git", name: "Git initialization" },
|
|
116158
116159
|
{ id: "ralph", name: "Ralph configuration" }
|
|
116159
116160
|
];
|
|
@@ -117641,6 +117642,51 @@ Thumbs.db
|
|
|
117641
117642
|
}
|
|
117642
117643
|
logger.success("React frontend created at: " + webDir);
|
|
117643
117644
|
}
|
|
117645
|
+
async function createDockerFiles(config, state, dryRun) {
|
|
117646
|
+
const projectDir = config.name;
|
|
117647
|
+
const projectName = config.name;
|
|
117648
|
+
const projectNameLower = projectName.toLowerCase();
|
|
117649
|
+
const backendDockerfile = await loadTemplate("Dockerfile.backend.template", projectName);
|
|
117650
|
+
const backendRelPath = `src/${projectName}.Api/Dockerfile`;
|
|
117651
|
+
if (dryRun) {
|
|
117652
|
+
logger.info(`Would create ${backendRelPath}`);
|
|
117653
|
+
} else {
|
|
117654
|
+
const backendResult = await safeWriteFile(
|
|
117655
|
+
(0, import_path7.join)(projectDir, backendRelPath),
|
|
117656
|
+
backendDockerfile,
|
|
117657
|
+
findKnownHash(state, "docker", backendRelPath)
|
|
117658
|
+
);
|
|
117659
|
+
logSafeWriteResult(backendRelPath, backendResult);
|
|
117660
|
+
recordFile(state, "docker", backendRelPath, backendResult.hash);
|
|
117661
|
+
}
|
|
117662
|
+
const frontendDockerfile = await loadTemplate("Dockerfile.frontend.template", projectName);
|
|
117663
|
+
const frontendRelPath = `web/${projectNameLower}-web/Dockerfile`;
|
|
117664
|
+
if (dryRun) {
|
|
117665
|
+
logger.info(`Would create ${frontendRelPath}`);
|
|
117666
|
+
} else {
|
|
117667
|
+
const frontendResult = await safeWriteFile(
|
|
117668
|
+
(0, import_path7.join)(projectDir, frontendRelPath),
|
|
117669
|
+
frontendDockerfile,
|
|
117670
|
+
findKnownHash(state, "docker", frontendRelPath)
|
|
117671
|
+
);
|
|
117672
|
+
logSafeWriteResult(frontendRelPath, frontendResult);
|
|
117673
|
+
recordFile(state, "docker", frontendRelPath, frontendResult.hash);
|
|
117674
|
+
}
|
|
117675
|
+
const dockerignore = await loadTemplate("dockerignore.template", projectName);
|
|
117676
|
+
const dockerignoreRelPath = ".dockerignore";
|
|
117677
|
+
if (dryRun) {
|
|
117678
|
+
logger.info(`Would create ${dockerignoreRelPath}`);
|
|
117679
|
+
} else {
|
|
117680
|
+
const dockerignoreResult = await safeWriteFile(
|
|
117681
|
+
(0, import_path7.join)(projectDir, dockerignoreRelPath),
|
|
117682
|
+
dockerignore,
|
|
117683
|
+
findKnownHash(state, "docker", dockerignoreRelPath)
|
|
117684
|
+
);
|
|
117685
|
+
logSafeWriteResult(dockerignoreRelPath, dockerignoreResult);
|
|
117686
|
+
recordFile(state, "docker", dockerignoreRelPath, dockerignoreResult.hash);
|
|
117687
|
+
}
|
|
117688
|
+
logger.success("Docker configuration created");
|
|
117689
|
+
}
|
|
117644
117690
|
function checkGitIdentity(cwd) {
|
|
117645
117691
|
const check = (key) => {
|
|
117646
117692
|
try {
|
|
@@ -118032,6 +118078,7 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
118032
118078
|
await executeStep(state, "config", finalProjectDir, dryRun, () => createConfigFiles(config, state, dryRun));
|
|
118033
118079
|
await executeStep(state, "backend", finalProjectDir, dryRun, () => createBackendStructure(config, state, dryRun));
|
|
118034
118080
|
await executeStep(state, "frontend", finalProjectDir, dryRun, () => createFrontendStructure(config, state, dryRun));
|
|
118081
|
+
await executeStep(state, "docker", finalProjectDir, dryRun, () => createDockerFiles(config, state, dryRun));
|
|
118035
118082
|
await executeStep(state, "git", finalProjectDir, dryRun, () => initializeGit(config, dryRun));
|
|
118036
118083
|
await executeStep(state, "ralph", finalProjectDir, dryRun, async () => {
|
|
118037
118084
|
if (!dryRun) {
|
|
@@ -118071,6 +118118,10 @@ var initCommand = new Command("init").description("Initialize a new SmartStack p
|
|
|
118071
118118
|
` 2. Install dependencies: ${source_default.cyan("npm install")}`,
|
|
118072
118119
|
` 3. Start dev server: ${source_default.cyan("npm run dev")}`,
|
|
118073
118120
|
"",
|
|
118121
|
+
source_default.yellow("Docker:"),
|
|
118122
|
+
` Build backend: ${source_default.cyan(`docker build -t smartstack-${projectNameLower}-backend:latest -f src/${finalProjectName}.Api/Dockerfile .`)}`,
|
|
118123
|
+
` Build frontend: ${source_default.cyan(`docker build -t smartstack-${projectNameLower}-frontend:latest web/${projectNameLower}-web/`)}`,
|
|
118124
|
+
"",
|
|
118074
118125
|
source_default.yellow("Ralph (AI Automation):"),
|
|
118075
118126
|
` 1. Check MCP servers: ${source_default.cyan("smartstack check-mcp")}`,
|
|
118076
118127
|
` 2. Verify Ralph setup: ${source_default.cyan("smartstack ralph start")}`,
|
|
@@ -125175,6 +125226,55 @@ async function syncClaudeSettings(projectDir, dryRun) {
|
|
|
125175
125226
|
}
|
|
125176
125227
|
return added;
|
|
125177
125228
|
}
|
|
125229
|
+
async function syncDockerFiles(projectDir, baseNamespace, dryRun) {
|
|
125230
|
+
const projectName = baseNamespace;
|
|
125231
|
+
const projectNameLower = projectName.toLowerCase();
|
|
125232
|
+
let updated = 0;
|
|
125233
|
+
const files = [
|
|
125234
|
+
{
|
|
125235
|
+
template: "Dockerfile.backend.template",
|
|
125236
|
+
dest: (0, import_path8.join)(projectDir, "src", `${projectName}.Api`, "Dockerfile"),
|
|
125237
|
+
label: `src/${projectName}.Api/Dockerfile`
|
|
125238
|
+
},
|
|
125239
|
+
{
|
|
125240
|
+
template: "Dockerfile.frontend.template",
|
|
125241
|
+
dest: (0, import_path8.join)(projectDir, "web", `${projectNameLower}-web`, "Dockerfile"),
|
|
125242
|
+
label: `web/${projectNameLower}-web/Dockerfile`
|
|
125243
|
+
},
|
|
125244
|
+
{
|
|
125245
|
+
template: "dockerignore.template",
|
|
125246
|
+
dest: (0, import_path8.join)(projectDir, ".dockerignore"),
|
|
125247
|
+
label: ".dockerignore"
|
|
125248
|
+
}
|
|
125249
|
+
];
|
|
125250
|
+
for (const file of files) {
|
|
125251
|
+
const templatePath = (0, import_path8.join)(TEMPLATES_DIR3, file.template);
|
|
125252
|
+
if (!await import_fs_extra7.default.pathExists(templatePath)) {
|
|
125253
|
+
logger.debug(`${file.template} not found, skipping`);
|
|
125254
|
+
continue;
|
|
125255
|
+
}
|
|
125256
|
+
let templateContent = await import_fs_extra7.default.readFile(templatePath, "utf-8");
|
|
125257
|
+
templateContent = resolveTemplatePlaceholders(templateContent, projectName);
|
|
125258
|
+
let needsWrite = true;
|
|
125259
|
+
if (await import_fs_extra7.default.pathExists(file.dest)) {
|
|
125260
|
+
const existing = await import_fs_extra7.default.readFile(file.dest, "utf-8");
|
|
125261
|
+
if (existing === templateContent) {
|
|
125262
|
+
needsWrite = false;
|
|
125263
|
+
}
|
|
125264
|
+
}
|
|
125265
|
+
if (needsWrite) {
|
|
125266
|
+
if (dryRun) {
|
|
125267
|
+
logger.warning(`[DRY RUN] Would update ${file.label}`);
|
|
125268
|
+
} else {
|
|
125269
|
+
await import_fs_extra7.default.ensureDir((0, import_path8.dirname)(file.dest));
|
|
125270
|
+
await import_fs_extra7.default.writeFile(file.dest, templateContent, "utf-8");
|
|
125271
|
+
logger.info(` ${source_default.green("+")} ${file.label}`);
|
|
125272
|
+
}
|
|
125273
|
+
updated++;
|
|
125274
|
+
}
|
|
125275
|
+
}
|
|
125276
|
+
return updated;
|
|
125277
|
+
}
|
|
125178
125278
|
var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack packages to the latest version").option("--preview", "Upgrade to latest preview/prerelease version").option("--dry-run", "Show what would be upgraded without actually upgrading").option("--all-packages", "Also upgrade all other NuGet packages (slow, disabled by default)").action(async (options) => {
|
|
125179
125279
|
logger.header("SmartStack Package Upgrade");
|
|
125180
125280
|
const dryRun = options.dryRun || false;
|
|
@@ -125192,6 +125292,7 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125192
125292
|
claudeSettingsSynced: 0,
|
|
125193
125293
|
ralphInitialized: false,
|
|
125194
125294
|
ralphUpToDate: false,
|
|
125295
|
+
dockerSynced: 0,
|
|
125195
125296
|
programCsIssues: []
|
|
125196
125297
|
};
|
|
125197
125298
|
if (dryRun) {
|
|
@@ -125436,6 +125537,15 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125436
125537
|
} catch {
|
|
125437
125538
|
}
|
|
125438
125539
|
console.log();
|
|
125540
|
+
logger.info("Syncing Dockerfiles...");
|
|
125541
|
+
const dockerUpdated = await syncDockerFiles(projectDir, config.baseNamespace, dryRun);
|
|
125542
|
+
result.dockerSynced = dockerUpdated;
|
|
125543
|
+
if (dockerUpdated > 0) {
|
|
125544
|
+
logger.success(`${dockerUpdated} Dockerfile(s) updated`);
|
|
125545
|
+
} else {
|
|
125546
|
+
logger.info(`Dockerfiles ${source_default.green("\u2713")} up to date`);
|
|
125547
|
+
}
|
|
125548
|
+
console.log();
|
|
125439
125549
|
logger.info("Checking Ralph configuration...");
|
|
125440
125550
|
const ralphStatus = await checkRalphInstallation(projectDir);
|
|
125441
125551
|
if (ralphStatus.configExists) {
|
|
@@ -125479,7 +125589,7 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125479
125589
|
logger.success(`Updated config version to ${source_default.cyan(nugetVersion)}`);
|
|
125480
125590
|
console.log();
|
|
125481
125591
|
}
|
|
125482
|
-
const totalChanged = result.nugetUpgraded + result.otherPkgUpdated + (result.npmUpgraded ? 1 : 0) + (result.npmOtherUpdated ? 1 : 0) + migrationSummary.totalApplied + result.configSynced + result.claudeSettingsSynced + (result.ralphInitialized ? 1 : 0);
|
|
125592
|
+
const totalChanged = result.nugetUpgraded + result.otherPkgUpdated + (result.npmUpgraded ? 1 : 0) + (result.npmOtherUpdated ? 1 : 0) + migrationSummary.totalApplied + result.configSynced + result.claudeSettingsSynced + result.dockerSynced + (result.ralphInitialized ? 1 : 0);
|
|
125483
125593
|
const allUpToDate = totalChanged === 0 && result.nugetFailed === 0 && result.otherPkgFailed === 0;
|
|
125484
125594
|
const hasProgramIssues = result.programCsIssues.length > 0;
|
|
125485
125595
|
if (allUpToDate && !hasProgramIssues) {
|
|
@@ -125540,6 +125650,9 @@ var upgradeCommand = new Command("upgrade").description("Upgrade SmartStack pack
|
|
|
125540
125650
|
if (result.claudeSettingsSynced > 0) {
|
|
125541
125651
|
lines.push(` ${source_default.green("\u2713")} Claude: ${result.claudeSettingsSynced} new setting(s) added`);
|
|
125542
125652
|
}
|
|
125653
|
+
if (result.dockerSynced > 0) {
|
|
125654
|
+
lines.push(` ${source_default.green("\u2713")} Docker: ${result.dockerSynced} Dockerfile(s) updated`);
|
|
125655
|
+
}
|
|
125543
125656
|
if (result.ralphInitialized) {
|
|
125544
125657
|
lines.push(` ${source_default.green("\u2713")} Ralph: configuration initialized`);
|
|
125545
125658
|
}
|