@catladder/cli 3.32.0 → 3.33.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/dist/bundles/catenv/index.js +3 -3
- package/dist/bundles/cli/index.js +1 -1
- package/dist/cli/src/apps/catenv/catenv.d.ts +4 -1
- package/dist/cli/src/apps/catenv/catenv.js +5 -1
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/catenv/verboseBanner.d.ts +1 -0
- package/dist/cli/src/apps/catenv/verboseBanner.js +30 -0
- package/dist/cli/src/apps/catenv/verboseBanner.js.map +1 -0
- package/dist/cli/src/catenv.js +5 -2
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +7 -2
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +4 -4
- package/dist/pipeline/src/context/getEnvironmentVariables.js +8 -8
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +5 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/catenv/catenv.ts +8 -2
- package/src/apps/catenv/verboseBanner.ts +33 -0
- package/src/catenv.ts +6 -2
package/package.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { getProjectConfig } from "../../config/getProjectConfig";
|
|
2
2
|
import { printVariables } from "./printVariables";
|
|
3
3
|
import type { Choice } from "./types";
|
|
4
|
+
import { printVerboseBanner } from "./verboseBanner";
|
|
4
5
|
import { writeDotEnvFiles } from "./writeDotEnvFiles";
|
|
5
6
|
import { writeDTsFiles } from "./writeEnvDTs";
|
|
6
7
|
import {
|
|
7
|
-
FileWriter,
|
|
8
8
|
createCatenvContext,
|
|
9
9
|
generatePipelineFiles,
|
|
10
10
|
} from "@catladder/pipeline";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type Options = {
|
|
13
|
+
verbose?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export default async (choice?: Choice, options?: Options) => {
|
|
13
16
|
const config = await getProjectConfig();
|
|
14
17
|
if (!config) {
|
|
15
18
|
return;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
const context = createCatenvContext(config);
|
|
22
|
+
if (options?.verbose) {
|
|
23
|
+
printVerboseBanner();
|
|
24
|
+
}
|
|
19
25
|
|
|
20
26
|
await Promise.all([
|
|
21
27
|
generatePipelineFiles(context, config.pipelineType ?? "gitlab"),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEnvironment,
|
|
3
|
+
getProjectConfig,
|
|
4
|
+
} from "../../config/getProjectConfig";
|
|
5
|
+
|
|
6
|
+
export const printVerboseBanner = async () => {
|
|
7
|
+
const config = await getProjectConfig();
|
|
8
|
+
if (!config) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const allCompontsWithPorts = await Promise.all(
|
|
13
|
+
Object.keys(config.components).map(async (componentName) => {
|
|
14
|
+
const environment = await getEnvironment("local", componentName);
|
|
15
|
+
const port = environment.envVars.PORT;
|
|
16
|
+
if (!port) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return `${componentName}: http://localhost:${port}`;
|
|
20
|
+
}),
|
|
21
|
+
).then((lines) => lines.filter(Boolean));
|
|
22
|
+
|
|
23
|
+
const lines = [
|
|
24
|
+
"catenv",
|
|
25
|
+
"-------",
|
|
26
|
+
"running on:",
|
|
27
|
+
"",
|
|
28
|
+
...allCompontsWithPorts,
|
|
29
|
+
];
|
|
30
|
+
for (const line of lines) {
|
|
31
|
+
console.log(line);
|
|
32
|
+
}
|
|
33
|
+
};
|
package/src/catenv.ts
CHANGED
|
@@ -9,12 +9,16 @@ if (args.some((arg) => helpFlags.includes(arg))) {
|
|
|
9
9
|
const docLink =
|
|
10
10
|
"https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";
|
|
11
11
|
console.log(
|
|
12
|
-
`\nUsage: catenv [env|env:component]\n\nEnv variable and catenv documentation:\n${docLink}`,
|
|
12
|
+
`\nUsage: catenv [env|env:component] [-v|--verbose]\n\nEnv variable and catenv documentation:\n${docLink}`,
|
|
13
13
|
);
|
|
14
14
|
process.exit(0);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const verbose = args.some((arg) => arg === "-v" || arg === "--verbose");
|
|
18
|
+
// choise arg is deprecated and will be removed in the future
|
|
19
|
+
const choiceArg = args.find((arg) => arg !== "-v" && arg !== "--verbose");
|
|
20
|
+
|
|
21
|
+
catenv(choiceArg ? parseChoice(choiceArg) : null, { verbose }).then(() => {
|
|
18
22
|
// we have to exit manually, because we have some file watches
|
|
19
23
|
process.exit();
|
|
20
24
|
});
|