@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 +1 -1
- package/src/project/index.ts +20 -1
package/package.json
CHANGED
package/src/project/index.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|