create-asaje-go-vue 0.3.3 → 0.3.5

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.
@@ -3109,6 +3109,7 @@ function mergeRailwayServiceVariables(registryEntry, variables) {
3109
3109
  async function resolveRailwayVariablePlan(config) {
3110
3110
  const localEnv = await loadRailwayLocalEnvDefaults(config.projectDir);
3111
3111
  const variablesMode = resolveRailwayVariablesMode(config.projectConfig);
3112
+ const builtInServiceKeys = new Set(["admin", "api", "realtime", "worker"]);
3112
3113
 
3113
3114
  const infra = {
3114
3115
  objectStorage: findRailwayService(
@@ -3256,6 +3257,17 @@ async function resolveRailwayVariablePlan(config) {
3256
3257
  mergeRailwayServiceVariables(serviceRegistry.worker, variables);
3257
3258
  }
3258
3259
 
3260
+ if (variablesMode !== "replace") {
3261
+ for (const spec of config.appServiceSpecs) {
3262
+ if (builtInServiceKeys.has(spec.key)) {
3263
+ continue;
3264
+ }
3265
+
3266
+ const serviceDefaults = await loadServiceEnvDefaults(config.projectDir, spec.directory);
3267
+ mergeRailwayServiceVariables(serviceRegistry[spec.key], serviceDefaults);
3268
+ }
3269
+ }
3270
+
3259
3271
  if (declaredVariables.hasDeclaredVariables) {
3260
3272
  if (Object.keys(declaredVariables.sharedVariables).length > 0) {
3261
3273
  for (const entry of Object.values(serviceRegistry)) {
@@ -3311,9 +3323,9 @@ async function wireRailwayVariables(config) {
3311
3323
 
3312
3324
  async function loadRailwayLocalEnvDefaults(projectDir) {
3313
3325
  const [apiEnv, realtimeEnv, adminEnv] = await Promise.all([
3314
- tryReadEnvFile(path.join(projectDir, "api/.env")),
3315
- tryReadEnvFile(path.join(projectDir, "realtime-gateway/.env")),
3316
- tryReadEnvFile(path.join(projectDir, "admin/.env")),
3326
+ loadServiceEnvDefaults(projectDir, "api"),
3327
+ loadServiceEnvDefaults(projectDir, "realtime-gateway"),
3328
+ loadServiceEnvDefaults(projectDir, "admin"),
3317
3329
  ]);
3318
3330
 
3319
3331
  return {
@@ -3323,6 +3335,18 @@ async function loadRailwayLocalEnvDefaults(projectDir) {
3323
3335
  };
3324
3336
  }
3325
3337
 
3338
+ async function loadServiceEnvDefaults(projectDir, serviceDir) {
3339
+ const [exampleEnv, localEnv] = await Promise.all([
3340
+ tryReadEnvFile(path.join(projectDir, serviceDir, ".env.example")),
3341
+ tryReadEnvFile(path.join(projectDir, serviceDir, ".env")),
3342
+ ]);
3343
+
3344
+ return {
3345
+ ...exampleEnv,
3346
+ ...localEnv,
3347
+ };
3348
+ }
3349
+
3326
3350
  function buildRailwaySharedSecrets(localEnv, existingVariables) {
3327
3351
  const jwtSecret =
3328
3352
  sanitizeSecret(localEnv.api.JWT_SECRET, "change-me") ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-asaje-go-vue",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "CLI to scaffold, configure, and run the Asaje Go + Vue boilerplate",
5
5
  "type": "module",
6
6
  "bin": {