@mono-labs/cli 0.0.85 → 0.0.86

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.
@@ -46,6 +46,7 @@ export function buildCommands(files) {
46
46
 
47
47
  current.action(async (arg, cmd) => {
48
48
  let envDefaults = {};
49
+
49
50
  const optionsDataList = Object.keys(optionsData).map((key) => ({
50
51
  ...optionsData[key],
51
52
  name: key,
@@ -1,6 +1,7 @@
1
1
  import { runForeground } from './runners/runForeground.js';
2
2
  import { runBackground } from './runners/runBackground.js';
3
3
  import { killAllBackground } from './runners/processManager.js';
4
+ import { getHasteConfig } from '../loadFromRoot.js';
4
5
 
5
6
  /**
6
7
  * Orchestrate execution of a single haste command definition.
@@ -10,12 +11,25 @@ import { killAllBackground } from './runners/processManager.js';
10
11
  * Environment selection based on --stage flag and injection of AWS_PROFILE.
11
12
  */
12
13
  export async function runHasteCommand(configObject, options = {}) {
14
+ const { config } = getHasteConfig();
13
15
  console.log('runHasteCommand options:', options);
14
16
  const devConfig = configObject.environments?.dev ?? {};
15
17
  const stageConfig = configObject.environments?.stage ?? {};
16
18
  const awsProfile = process.env.CDK_DEPLOY_PROFILE || 'default';
17
- const envObj = options.stage ? { ...stageConfig } : { ...devConfig };
18
- envObj.AWS_PROFILE = awsProfile;
19
+ const envObjBase = options.stage ? { ...stageConfig } : { ...devConfig };
20
+ envObjBase.AWS_PROFILE = awsProfile;
21
+
22
+ const envKeys = Object.keys(process.env).filter((k) => k.startsWith('MONO_'));
23
+ const envMapList = config.envMap ?? ['FAILURE'];
24
+ let envMapVals = {};
25
+
26
+ envKeys.map((k) => {
27
+ envMapList.map((item) => {
28
+ envMapVals[k.replace('MONO', item)] = process.env[k];
29
+ });
30
+ });
31
+
32
+ const envObj = { ...envObjBase, ...envMapVals };
19
33
 
20
34
  const preactions = configObject.preactions ?? [];
21
35
  const actions = configObject.actions ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",