@catladder/cli 1.110.2 → 1.111.0

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
@@ -24,7 +24,7 @@
24
24
  "node": ">=12.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@catladder/pipeline": "1.110.2",
27
+ "@catladder/pipeline": "1.111.0",
28
28
  "@kubernetes/client-node": "^0.16.2",
29
29
  "@tsconfig/node14": "^1.0.1",
30
30
  "@types/common-tags": "^1.8.0",
@@ -57,5 +57,5 @@
57
57
  "typescript": "^4.5.4",
58
58
  "vorpal": "^1.12.0"
59
59
  },
60
- "version": "1.110.2"
60
+ "version": "1.111.0"
61
61
  }
@@ -13,15 +13,22 @@ const getAllVariablesToPrint = async (config: Config, choice?: Choice) => {
13
13
  choice
14
14
  );
15
15
 
16
- let variables: Record<string, string> = {};
17
16
  if (currentComponent) {
18
- variables = await getEnvVarsResolved(null, env, currentComponent);
17
+ // don't print vars if dotenv is enabled
18
+ if (config.components[currentComponent].dotEnv) {
19
+ return {};
20
+ }
21
+ return await getEnvVarsResolved(null, env, currentComponent);
19
22
  } else {
20
23
  // when in a monorep and not in a subapp, merge all env vars.
21
24
  // this is not 100% correct, but better than not exporting any vars at all
22
25
  // so we also add prefixed variants
23
- variables = await Object.keys(config.components).reduce(
26
+ return await Object.keys(config.components).reduce(
24
27
  async (acc, componentName) => {
28
+ // don't print vars if dotenv is enabled
29
+ if (config.components[componentName].dotEnv) {
30
+ return await acc;
31
+ }
25
32
  const subappvars = await getEnvVarsResolved(null, env, componentName);
26
33
  delete subappvars["_ALL_ENV_VAR_KEYS"];
27
34
  return {
@@ -36,11 +43,9 @@ const getAllVariablesToPrint = async (config: Config, choice?: Choice) => {
36
43
  ),
37
44
  };
38
45
  },
39
- {}
46
+ Promise.resolve({} as Record<string, string>)
40
47
  );
41
48
  }
42
-
43
- return variables;
44
49
  };
45
50
 
46
51
  export const printVariables = async (config: Config, choice?: Choice) => {
@@ -17,8 +17,6 @@ export const writeDotEnvFiles = async (config: Config, choice?: Choice) => {
17
17
  choice
18
18
  );
19
19
 
20
- // whether to print .dotenv is currentl configure on the "local" part of the env
21
-
22
20
  const componentsWithEnabledDotEnvWrite = Object.entries(config.components)
23
21
  .filter(([, component]) => component?.dotEnv)
24
22
  .map(([componentName]) => componentName);
@@ -19,14 +19,14 @@ export const writeDTsFiles = async (config: Config, choice?: Choice) => {
19
19
  .filter(([, component]) => component?.envDTs)
20
20
  .map(([componentName]) => componentName);
21
21
 
22
- const componentsToActuallyWriteDotEnvNow = currentComponent
22
+ const componentsToActuallyWriteEnvDts = currentComponent
23
23
  ? componentsWithEnabledEnvDTsWrite.includes(currentComponent)
24
24
  ? [currentComponent]
25
25
  : []
26
26
  : componentsWithEnabledEnvDTsWrite;
27
27
  const gitRoot = await getGitRoot();
28
28
 
29
- for (const componentName of componentsToActuallyWriteDotEnvNow) {
29
+ for (const componentName of componentsToActuallyWriteEnvDts) {
30
30
  const envNames = await getEnvsForDTs(env, componentName);
31
31
  const envDTsContent = createEnvDTsContent(envNames);
32
32
 
@@ -125,7 +125,7 @@ export const getGitlabVar = async (
125
125
  const resolveSecrets = async (
126
126
  vorpal: CommandInstance | null,
127
127
  varSets: EnvironmentEnvVars[]
128
- ) => {
128
+ ): Promise<Record<string, string>> => {
129
129
  const allVariablesInGitlab = await getAllVariables(vorpal);
130
130
 
131
131
  return Object.fromEntries(