@mono-labs/cli 0.0.201 → 0.0.202

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.
@@ -49,6 +49,10 @@ export function detectWorkspaceAndConfigPath(startDir = process.cwd(), configFil
49
49
  const configPath = path.join(configDir, configFileName);
50
50
  return { cwd, workspaceRoot, isWorkspaceRoot, configDir, configPath };
51
51
  }
52
+ const requiredSystemDefaults = {
53
+ ec2User: 'ec2-user',
54
+ regions: ['us-east-1'],
55
+ };
52
56
  export function loadAppConfig(configType = 'app', startDir = process.cwd()) {
53
57
  const fileName = `mono.${configType}.json`;
54
58
  const meta = detectWorkspaceAndConfigPath(startDir, fileName);
@@ -59,7 +63,18 @@ export function loadAppConfig(configType = 'app', startDir = process.cwd()) {
59
63
  throw new Error(`Could not find ${fileName} at ${meta.configPath} (detected from ${where}).`);
60
64
  }
61
65
  const raw = fs.readFileSync(meta.configPath, 'utf8');
62
- return { config: JSON.parse(raw), meta };
66
+ const config = JSON.parse(raw);
67
+ // Apply requiredSystemDefaults for missing/null/undefined values
68
+ if (typeof config === 'object' && config !== null) {
69
+ for (const key of Object.keys(requiredSystemDefaults)) {
70
+ // @ts-ignore: index signature
71
+ if (config[key] === undefined || config[key] === null) {
72
+ // @ts-ignore: index signature
73
+ config[key] = requiredSystemDefaults[key];
74
+ }
75
+ }
76
+ }
77
+ return { config, meta };
63
78
  }
64
79
  export const loadProjectConfig = loadAppConfig;
65
80
  export { loadMergedEnv } from './merge-env.js';
@@ -25,6 +25,7 @@ type DefaultDeployConfig = {
25
25
  apiSubdomain?: string;
26
26
  defaultKeyPair?: string;
27
27
  regions?: string[];
28
+ ec2User?: string;
28
29
  };
29
30
  type ConfigTypeMap = {
30
31
  app: DefaultAppConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.201",
3
+ "version": "0.0.202",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,7 +47,7 @@
47
47
  "start": "node bin/mono.js",
48
48
  "dev": "node bin/mono.js",
49
49
  "test": "echo \"Error: no test specified\" && exit 1",
50
- "deploy": "npm version patch && npm publish --access public --registry https://registry.npmjs.org/",
50
+ "deploy": "tsc &&npm version patch && npm publish --access public --registry https://registry.npmjs.org/",
51
51
  "release:patch": "npm version patch -m \"chore: release %s\" && npm publish --access public",
52
52
  "release:minor": "npm version minor -m \"chore: release %s\" && npm publish --access public",
53
53
  "release:major": "npm version major -m \"chore: release %s\" && npm publish --access public"