@catladder/cli 0.0.0-next-5f70052e → 0.0.0-next-32b3a548
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/dist/bundles/catenv/index.js +424 -181
- package/dist/bundles/cli/index.js +437 -187
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/apps/catenv/types.d.ts +0 -1
- package/dist/cli/src/apps/catenv/utils.d.ts +2 -5
- package/dist/cli/src/apps/catenv/utils.js +4 -9
- package/dist/cli/src/apps/catenv/utils.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +1 -3
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +12 -12
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +6 -6
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/pipeline/src/bash/BashExpression.d.ts +0 -5
- package/dist/pipeline/src/bash/BashExpression.js +1 -15
- package/dist/pipeline/src/bash/BashExpression.js.map +1 -1
- package/dist/pipeline/src/bash/bashEscape.d.ts +30 -0
- package/dist/pipeline/src/bash/bashEscape.js +129 -0
- package/dist/pipeline/src/bash/bashEscape.js.map +1 -0
- package/dist/pipeline/src/bash/bashYaml.js +26 -2
- package/dist/pipeline/src/bash/bashYaml.js.map +1 -1
- package/dist/pipeline/src/bash/getInjectVarsScript.js +6 -2
- package/dist/pipeline/src/bash/getInjectVarsScript.js.map +1 -1
- package/dist/pipeline/src/bash/index.d.ts +2 -0
- package/dist/pipeline/src/bash/index.js +19 -0
- package/dist/pipeline/src/bash/index.js.map +1 -0
- package/dist/pipeline/src/build/base/writeDotEnv.js +4 -3
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +3 -3
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +3 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.js +23 -12
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +3 -3
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/pipeline/src/globalScriptFunctions/index.d.ts +6 -2
- package/dist/pipeline/src/globalScriptFunctions/index.js +17 -10
- package/dist/pipeline/src/globalScriptFunctions/index.js.map +1 -1
- package/dist/pipeline/src/index.d.ts +2 -0
- package/dist/pipeline/src/index.js +2 -0
- package/dist/pipeline/src/index.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js +2 -25
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js.map +1 -1
- package/dist/pipeline/src/types/context.d.ts +2 -1
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/utils/gitlab.js +9 -2
- package/dist/pipeline/src/utils/gitlab.js.map +1 -1
- package/dist/pipeline/src/variables/VariableValue.d.ts +3 -0
- package/dist/pipeline/src/variables/VariableValue.js +3 -0
- package/dist/pipeline/src/variables/VariableValue.js.map +1 -0
- package/dist/pipeline/src/variables/VariableValueContainingReferences.d.ts +24 -0
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js +69 -0
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js.map +1 -0
- package/dist/pipeline/src/variables/resolveAllReferences.d.ts +3 -0
- package/dist/pipeline/src/variables/resolveAllReferences.js +25 -0
- package/dist/pipeline/src/variables/resolveAllReferences.js.map +1 -0
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.d.ts +5 -0
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.js +23 -0
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.js.map +1 -0
- package/dist/pipeline/src/variables/resolveReferencesOnce.d.ts +8 -0
- package/dist/pipeline/src/variables/resolveReferencesOnce.js +21 -0
- package/dist/pipeline/src/variables/resolveReferencesOnce.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/catenv/printVariables.ts +2 -2
- package/src/apps/catenv/types.ts +2 -2
- package/src/apps/catenv/utils.ts +8 -12
- package/src/apps/catenv/writeDotEnvFiles.ts +2 -5
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +16 -10
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +5 -3
- package/src/config/getProjectConfig.ts +5 -1
- package/dist/pipeline/src/bash/replaceAsync.d.ts +0 -2
- package/dist/pipeline/src/bash/replaceAsync.js +0 -37
- package/dist/pipeline/src/bash/replaceAsync.js.map +0 -1
- package/dist/pipeline/src/context/resolveReferences.d.ts +0 -3
- package/dist/pipeline/src/context/resolveReferences.js +0 -56
- package/dist/pipeline/src/context/resolveReferences.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveAllReferencesOnce = void 0;
|
|
4
|
+
const VariableValueContainingReferences_1 = require("./VariableValueContainingReferences");
|
|
5
|
+
const resolveReferencesOnce_1 = require("./resolveReferencesOnce");
|
|
6
|
+
const resolveAllReferencesOnce = async (values, getEnvVars) => {
|
|
7
|
+
const allReferences = Object.values(values).flatMap((value) => value === null || value === void 0 ? void 0 : value.parts.filter((part) => part instanceof VariableValueContainingReferences_1.VariableReference));
|
|
8
|
+
const allComponentsUnique = Array.from(new Set(allReferences.map((reference) => reference.componentName)));
|
|
9
|
+
const allEnvVarsInComponents = Object.fromEntries(await Promise.all(allComponentsUnique.map(async (componentName) => [
|
|
10
|
+
componentName,
|
|
11
|
+
await getEnvVars(componentName),
|
|
12
|
+
])));
|
|
13
|
+
return Object.fromEntries(Object.entries(values).map(([key, value]) => [
|
|
14
|
+
key,
|
|
15
|
+
value !== null && value !== undefined
|
|
16
|
+
? (0, resolveReferencesOnce_1.resolveReferencesOnce)(value, ({ componentName, variableName }) => {
|
|
17
|
+
return allEnvVarsInComponents[componentName][variableName];
|
|
18
|
+
})
|
|
19
|
+
: value,
|
|
20
|
+
]));
|
|
21
|
+
};
|
|
22
|
+
exports.resolveAllReferencesOnce = resolveAllReferencesOnce;
|
|
23
|
+
//# sourceMappingURL=resolveAllReferencesOnce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAllReferencesOnce.js","sourceRoot":"","sources":["../../../../../pipeline/src/variables/resolveAllReferencesOnce.ts"],"names":[],"mappings":";;;AAEA,2FAAwE;AACxE,mEAAgE;AAEzD,MAAM,wBAAwB,GAAG,KAAK,EAC3C,MAAyD,EACzD,UAE8D,EAC9D,EAAE;IACF,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CACjD,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,MAAM,CACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,YAAY,qDAAiB,CACrB,CAC3B,CAAC;IAEF,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CACpC,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CACnE,CAAC;IAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,WAAW,CAC/C,MAAM,OAAO,CAAC,GAAG,CACf,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,CAAC;QAC/C,aAAa;QACb,MAAM,UAAU,CAAC,aAAa,CAAC;KAChC,CAEA,CACF,CACF,CAAC;IAEF,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAC3C,GAAG;QACH,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YACnC,CAAC,CAAC,IAAA,6CAAqB,EAAC,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE;gBAC/D,OAAO,sBAAsB,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC;YAC7D,CAAC,CAAC;YACJ,CAAC,CAAC,KAAK;KACV,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,wBAAwB,4BAsCnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VariableValue } from "./VariableValue";
|
|
2
|
+
import { VariableValueContainingReferences } from "./VariableValueContainingReferences";
|
|
3
|
+
type Resolver = (args: {
|
|
4
|
+
componentName: string;
|
|
5
|
+
variableName: string;
|
|
6
|
+
}) => VariableValue | null | undefined;
|
|
7
|
+
export declare const resolveReferencesOnce: (value: VariableValueContainingReferences, resolver: Resolver) => VariableValueContainingReferences;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveReferencesOnce = void 0;
|
|
4
|
+
const VariableValueContainingReferences_1 = require("./VariableValueContainingReferences");
|
|
5
|
+
const resolveReferencesOnce = (value, resolver) => {
|
|
6
|
+
const replacedParts = value.parts.map((part) => {
|
|
7
|
+
if (part instanceof VariableValueContainingReferences_1.VariableReference) {
|
|
8
|
+
const result = resolver({
|
|
9
|
+
componentName: part.componentName,
|
|
10
|
+
variableName: part.variableName,
|
|
11
|
+
});
|
|
12
|
+
return result !== null && result !== void 0 ? result : new VariableValueContainingReferences_1.UnresolvableReference(part);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return part;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return new VariableValueContainingReferences_1.VariableValueContainingReferences(replacedParts);
|
|
19
|
+
};
|
|
20
|
+
exports.resolveReferencesOnce = resolveReferencesOnce;
|
|
21
|
+
//# sourceMappingURL=resolveReferencesOnce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveReferencesOnce.js","sourceRoot":"","sources":["../../../../../pipeline/src/variables/resolveReferencesOnce.ts"],"names":[],"mappings":";;;AACA,2FAI6C;AAMtC,MAAM,qBAAqB,GAAG,CACnC,KAAwC,EACxC,QAAkB,EAClB,EAAE;IACF,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7C,IAAI,IAAI,YAAY,qDAAiB,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,QAAQ,CAAC;gBACtB,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,YAAY,EAAE,IAAI,CAAC,YAAY;aAChC,CAAC,CAAC;YACH,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,yDAAqB,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,qEAAiC,CAAC,aAAa,CAAC,CAAC;AAC9D,CAAC,CAAC;AAjBW,QAAA,qBAAqB,yBAiBhC"}
|