@mono-labs/cli 0.0.199 → 0.0.201

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.199",
3
+ "version": "0.0.201",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -82,6 +82,12 @@ type DefaultDeployConfig = {
82
82
  apiSubdomain?: string;
83
83
  defaultKeyPair?: string;
84
84
  regions?: string[];
85
+ ec2User?: string;
86
+ };
87
+
88
+ const requiredSystemDefaults = {
89
+ ec2User: 'ec2-user',
90
+ regions: ['us-east-1'],
85
91
  };
86
92
 
87
93
  type ConfigTypeMap = {
@@ -114,7 +120,20 @@ export function loadAppConfig<TCustom = unknown, TType extends string = 'app'>(
114
120
  }
115
121
 
116
122
  const raw = fs.readFileSync(meta.configPath, 'utf8');
117
- return { config: JSON.parse(raw) as ResolveConfig<TType, TCustom>, meta };
123
+ const config = JSON.parse(raw) as ResolveConfig<TType, TCustom>;
124
+
125
+ // Apply requiredSystemDefaults for missing/null/undefined values
126
+ if (typeof config === 'object' && config !== null) {
127
+ for (const key of Object.keys(requiredSystemDefaults)) {
128
+ // @ts-ignore: index signature
129
+ if (config[key] === undefined || config[key] === null) {
130
+ // @ts-ignore: index signature
131
+ config[key] = requiredSystemDefaults[key];
132
+ }
133
+ }
134
+ }
135
+
136
+ return { config, meta };
118
137
  }
119
138
 
120
139
  export const loadProjectConfig = loadAppConfig;