create-asaje-go-vue 0.3.7 → 0.3.8

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.
@@ -421,6 +421,7 @@ async function runCreate(argv) {
421
421
  console.log(pc.dim("\nScaffolding project from GitHub template..."));
422
422
  await cloneTemplate(answers.template, answers.branch, destinationDir);
423
423
  await cleanupTemplateFiles(destinationDir);
424
+ await ensureScaffoldedSurfaces(destinationDir, answers);
424
425
  await writeProjectConfig(destinationDir, answers);
425
426
  await writeEnvFiles(destinationDir, answers);
426
427
  await writeProjectReadme(destinationDir, answers);
@@ -1180,6 +1181,7 @@ function buildCreateRailwayEnvironments(answers) {
1180
1181
  }
1181
1182
 
1182
1183
  async function writeEnvFiles(destinationDir, answers) {
1184
+ await fs.ensureDir(path.join(destinationDir, "admin"));
1183
1185
  await fs.writeFile(
1184
1186
  path.join(destinationDir, "admin/.env"),
1185
1187
  toEnvContent({
@@ -1248,8 +1250,10 @@ async function writeEnvFiles(destinationDir, answers) {
1248
1250
  RABBITMQ_WORKER_CONSUMER_TAG: `${answers.slug || "asaje-app"}-api-worker`,
1249
1251
  };
1250
1252
 
1253
+ await fs.ensureDir(path.join(destinationDir, "api"));
1251
1254
  await fs.writeFile(path.join(destinationDir, "api/.env"), toEnvContent(apiEnv));
1252
1255
 
1256
+ await fs.ensureDir(path.join(destinationDir, "realtime-gateway"));
1253
1257
  await fs.writeFile(
1254
1258
  path.join(destinationDir, "realtime-gateway/.env"),
1255
1259
  toEnvContent({
@@ -1266,6 +1270,7 @@ async function writeEnvFiles(destinationDir, answers) {
1266
1270
  );
1267
1271
 
1268
1272
  if (answers.includeLanding) {
1273
+ await fs.ensureDir(path.join(destinationDir, "landing"));
1269
1274
  await fs.writeFile(
1270
1275
  path.join(destinationDir, "landing/.env"),
1271
1276
  toEnvContent({
@@ -1276,6 +1281,7 @@ async function writeEnvFiles(destinationDir, answers) {
1276
1281
  }
1277
1282
 
1278
1283
  if (answers.includePwa) {
1284
+ await fs.ensureDir(path.join(destinationDir, "pwa"));
1279
1285
  await fs.writeFile(
1280
1286
  path.join(destinationDir, "pwa/.env"),
1281
1287
  toEnvContent({
@@ -5660,6 +5666,32 @@ async function cleanupTemplateFiles(destinationDir) {
5660
5666
  }
5661
5667
  }
5662
5668
 
5669
+ async function ensureScaffoldedSurfaces(destinationDir, answers) {
5670
+ const requiredDirectories = ["admin", "api", "realtime-gateway"];
5671
+
5672
+ if (answers.includeLanding) {
5673
+ requiredDirectories.push("landing");
5674
+ }
5675
+ if (answers.includePwa) {
5676
+ requiredDirectories.push("pwa");
5677
+ }
5678
+
5679
+ const missing = [];
5680
+ for (const relativeDir of requiredDirectories) {
5681
+ if (!(await fs.pathExists(path.join(destinationDir, relativeDir)))) {
5682
+ missing.push(relativeDir);
5683
+ }
5684
+ }
5685
+
5686
+ if (missing.length > 0) {
5687
+ throw new Error(
5688
+ `Template scaffold is missing expected directories: ${missing.join(", ")}. ` +
5689
+ `This usually means the selected template/branch does not include the requested surfaces. ` +
5690
+ `Try another branch or update the template repository before running create again.`,
5691
+ );
5692
+ }
5693
+ }
5694
+
5663
5695
  async function ensureDestinationIsAvailable(destinationDir) {
5664
5696
  const exists = await fs.pathExists(destinationDir);
5665
5697
  if (!exists) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-asaje-go-vue",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "CLI to scaffold, configure, and run the Asaje Go + Vue boilerplate",
5
5
  "type": "module",
6
6
  "bin": {