@catladder/cli 1.40.4 → 1.41.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.
Files changed (148) hide show
  1. package/bin/catenv +1 -1
  2. package/bin/catenv-dev +3 -0
  3. package/bin/catladder +1 -1
  4. package/bin/catladder-dev +3 -0
  5. package/dist/apps/cli/commands/general/index.d.ts +1 -1
  6. package/dist/apps/cli/commands/general/portForward.d.ts +1 -1
  7. package/dist/apps/cli/commands/mongodb/index.d.ts +1 -1
  8. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +1 -1
  9. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +2 -1
  10. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -1
  11. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +1 -1
  12. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +1 -1
  13. package/dist/apps/cli/commands/mongodb/utils/index.js +2 -1
  14. package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -1
  15. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +1 -1
  16. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +2 -1
  17. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
  18. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +1 -1
  19. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +1 -1
  20. package/dist/apps/cli/commands/project/commandDeletePods.js +2 -1
  21. package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -1
  22. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +1 -1
  23. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +1 -1
  24. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +1 -1
  25. package/dist/apps/cli/commands/project/commandGetShell.d.ts +1 -1
  26. package/dist/apps/cli/commands/project/commandGetShell.js +2 -1
  27. package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -1
  28. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +1 -1
  29. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -1
  30. package/dist/apps/cli/commands/project/commandInitProject.old.d.ts +1 -1
  31. package/dist/apps/cli/commands/project/commandListPods.d.ts +1 -1
  32. package/dist/apps/cli/commands/project/commandListPods.js +2 -2
  33. package/dist/apps/cli/commands/project/commandListPods.js.map +1 -1
  34. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +1 -1
  35. package/dist/apps/cli/commands/project/commandNamespace.d.ts +1 -1
  36. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +1 -1
  37. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +1 -1
  38. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +1 -1
  39. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +1 -1
  40. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +1 -1
  41. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +1 -1
  42. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +2 -1
  43. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -1
  44. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +1 -1
  45. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +1 -1
  46. package/dist/apps/cli/commands/project/commandPortForward.d.ts +1 -1
  47. package/dist/apps/cli/commands/project/commandPortForward.js +2 -1
  48. package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -1
  49. package/dist/apps/cli/commands/project/commandSetup.d.ts +1 -1
  50. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +1 -1
  51. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -1
  52. package/dist/apps/cli/commands/project/index.d.ts +1 -1
  53. package/dist/apps/cli/commands/project/setup/index.d.ts +1 -1
  54. package/dist/apps/cli/commands/project/setup/setupAccessTokens.d.ts +1 -1
  55. package/dist/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
  56. package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -1
  57. package/dist/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
  58. package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
  59. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -1
  60. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
  61. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +1 -1
  62. package/dist/apps/cli/commands/shared/index.d.ts +1 -1
  63. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +1 -1
  64. package/dist/apps/cli/config/writeConfig.d.ts +2 -2
  65. package/dist/apps/cli/verify/index.d.ts +1 -1
  66. package/dist/apps/cli/verify/migration/fromv2.d.ts +1 -1
  67. package/dist/apps/cli/verify/migration/fromv2.js.map +1 -1
  68. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +3 -3
  69. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -1
  70. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +1 -1
  71. package/dist/bundles/catenv/index.js +15 -0
  72. package/dist/bundles/catenv/xdg-open +1066 -0
  73. package/dist/bundles/cli/clipboard_i686.exe +0 -0
  74. package/dist/bundles/cli/clipboard_x86_64.exe +0 -0
  75. package/dist/bundles/cli/exec-child.js +39 -0
  76. package/dist/bundles/cli/index.js +574 -0
  77. package/dist/bundles/cli/xdg-open +1066 -0
  78. package/dist/bundles/cli/xsel +0 -0
  79. package/dist/catenv.js +2 -3
  80. package/dist/catenv.js.map +1 -1
  81. package/dist/config/getProjectConfig.d.ts +3 -6
  82. package/dist/config/getProjectConfig.js +10 -6
  83. package/dist/config/getProjectConfig.js.map +1 -1
  84. package/dist/config/parseChoice.d.ts +4 -0
  85. package/dist/config/parseChoice.js +9 -0
  86. package/dist/config/parseChoice.js.map +1 -0
  87. package/dist/kubernetes/index.d.ts +3 -0
  88. package/dist/kubernetes/index.js +88 -0
  89. package/dist/kubernetes/index.js.map +1 -0
  90. package/dist/tsconfig.tsbuildinfo +1 -1
  91. package/dist/utils/gitlab.d.ts +1 -1
  92. package/dist/utils/projects/index.d.ts +0 -3
  93. package/dist/utils/projects/index.js +1 -47
  94. package/dist/utils/projects/index.js.map +1 -1
  95. package/package.json +25 -22
  96. package/scripts/bundle +4 -0
  97. package/src/apps/catenv/catenv.ts +1 -1
  98. package/src/apps/cli/commands/general/index.ts +1 -1
  99. package/src/apps/cli/commands/general/portForward.ts +1 -1
  100. package/src/apps/cli/commands/mongodb/index.ts +1 -1
  101. package/src/apps/cli/commands/mongodb/projectMongoDestroyMember.ts +3 -5
  102. package/src/apps/cli/commands/mongodb/projectMongoGetShell.ts +1 -1
  103. package/src/apps/cli/commands/mongodb/projectMongoPortForward.ts +1 -1
  104. package/src/apps/cli/commands/mongodb/utils/index.ts +2 -4
  105. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +1 -1
  106. package/src/apps/cli/commands/project/commandConfigSecrets.ts +2 -1
  107. package/src/apps/cli/commands/project/commandCopyDB.ts +1 -1
  108. package/src/apps/cli/commands/project/commandDeletePods.ts +3 -5
  109. package/src/apps/cli/commands/project/commandDeleteProject.ts +1 -1
  110. package/src/apps/cli/commands/project/commandEnvVars.ts +1 -1
  111. package/src/apps/cli/commands/project/commandGetMyTotalWorktime.ts +1 -1
  112. package/src/apps/cli/commands/project/commandGetShell.ts +3 -5
  113. package/src/apps/cli/commands/project/commandGitlabCi.ts +2 -1
  114. package/src/apps/cli/commands/project/commandInitProject.old.ts +1 -1
  115. package/src/apps/cli/commands/project/commandListPods.ts +2 -2
  116. package/src/apps/cli/commands/project/commandMigrateHelm3.ts +1 -1
  117. package/src/apps/cli/commands/project/commandNamespace.ts +1 -1
  118. package/src/apps/cli/commands/project/commandOpenCostDashboard.ts +1 -1
  119. package/src/apps/cli/commands/project/commandOpenDashboard.ts +1 -1
  120. package/src/apps/cli/commands/project/commandOpenEnv.ts +1 -1
  121. package/src/apps/cli/commands/project/commandOpenGit.ts +1 -1
  122. package/src/apps/cli/commands/project/commandOpenGrafana.ts +1 -1
  123. package/src/apps/cli/commands/project/commandOpenGrafanaPod.ts +3 -5
  124. package/src/apps/cli/commands/project/commandOpenLogs.ts +1 -1
  125. package/src/apps/cli/commands/project/commandPauseProject.ts +1 -1
  126. package/src/apps/cli/commands/project/commandPortForward.ts +3 -5
  127. package/src/apps/cli/commands/project/commandSetup.ts +1 -1
  128. package/src/apps/cli/commands/project/commandTriggerCronjob.ts +3 -2
  129. package/src/apps/cli/commands/project/index.ts +1 -1
  130. package/src/apps/cli/commands/project/setup/index.ts +1 -1
  131. package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +1 -1
  132. package/src/apps/cli/commands/project/setup/setupContext.ts +3 -2
  133. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +3 -2
  134. package/src/apps/cli/commands/project/utils/ensureNamespace.ts +4 -2
  135. package/src/apps/cli/commands/project/utils/showProjectBanner.ts +1 -1
  136. package/src/apps/cli/commands/shared/index.ts +1 -1
  137. package/src/apps/cli/commands/theStuffThatReallyMatters/index.ts +1 -1
  138. package/src/apps/cli/config/writeConfig.ts +2 -2
  139. package/src/apps/cli/verify/index.ts +1 -1
  140. package/src/apps/cli/verify/migration/fromv2.ts +4 -7
  141. package/src/apps/cli/verify/migration/migrateSecrets.ts +4 -3
  142. package/src/apps/cli/verify/migration/oldGitlabCi.ts +1 -1
  143. package/src/catenv.ts +1 -3
  144. package/src/config/getProjectConfig.ts +6 -8
  145. package/src/config/parseChoice.ts +4 -0
  146. package/src/kubernetes/index.ts +27 -0
  147. package/src/utils/gitlab.ts +1 -1
  148. package/src/utils/projects/index.ts +1 -25
@@ -1,5 +1,5 @@
1
1
  import memoizee from "memoizee";
2
- import { CommandInstance } from "vorpal";
2
+ import type { CommandInstance } from "vorpal";
3
3
  export declare const hasGitlabToken: () => Promise<boolean>;
4
4
  export declare const setupGitlabToken: (vorpal: CommandInstance) => Promise<void>;
5
5
  export declare const getGitlabToken: (vorpal: CommandInstance) => Promise<string>;
@@ -3,6 +3,3 @@ export declare const getRootGitlabCiFile: () => Promise<string>;
3
3
  export declare const readRootGitlabCiFile: () => Promise<any[]>;
4
4
  export declare const hasGitlabCiFile: () => Promise<boolean>;
5
5
  export declare const getProjectNamespace: (envComponent: string) => Promise<string>;
6
- export declare const getProjectPods: (envComponent: string) => Promise<import("@kubernetes/client-node").V1Pod[]>;
7
- export declare const getProjectPvcs: (envComponent: string) => Promise<import("@kubernetes/client-node").V1PersistentVolumeClaim[]>;
8
- export declare const getProjectPodNames: (envComponent: string) => Promise<string[]>;
@@ -36,10 +36,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  exports.__esModule = true;
39
- exports.getProjectPodNames = exports.getProjectPvcs = exports.getProjectPods = exports.getProjectNamespace = exports.hasGitlabCiFile = exports.readRootGitlabCiFile = exports.getRootGitlabCiFile = exports.getGitRoot = void 0;
39
+ exports.getProjectNamespace = exports.hasGitlabCiFile = exports.readRootGitlabCiFile = exports.getRootGitlabCiFile = exports.getGitRoot = void 0;
40
40
  var path_1 = require("path");
41
41
  var getProjectConfig_1 = require("../../config/getProjectConfig");
42
- var k8sApi_1 = require("../../k8sApi");
43
42
  var files_1 = require("../files");
44
43
  var child_process_promise_1 = require("child-process-promise");
45
44
  var getGitRoot = function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -101,49 +100,4 @@ var getProjectNamespace = function (envComponent) { return __awaiter(void 0, voi
101
100
  });
102
101
  }); };
103
102
  exports.getProjectNamespace = getProjectNamespace;
104
- var getProjectPods = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
105
- var namespace, k8sApi, res, componentName;
106
- return __generator(this, function (_a) {
107
- switch (_a.label) {
108
- case 0: return [4 /*yield*/, (0, exports.getProjectNamespace)(envComponent)];
109
- case 1:
110
- namespace = _a.sent();
111
- k8sApi = (0, k8sApi_1.getk8sApi)();
112
- return [4 /*yield*/, k8sApi.listNamespacedPod(namespace)];
113
- case 2:
114
- res = _a.sent();
115
- componentName = (0, getProjectConfig_1.parseChoice)(envComponent).componentName;
116
- return [2 /*return*/, res.body.items.filter(function (item) { var _a, _b; return componentName ? (_b = (_a = item.metadata) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.includes(componentName + "-") : true; })];
117
- }
118
- });
119
- }); };
120
- exports.getProjectPods = getProjectPods;
121
- var getProjectPvcs = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
122
- var namespace, k8sApi, res;
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0: return [4 /*yield*/, (0, exports.getProjectNamespace)(envComponent)];
126
- case 1:
127
- namespace = _a.sent();
128
- k8sApi = (0, k8sApi_1.getk8sApi)();
129
- return [4 /*yield*/, k8sApi.listNamespacedPersistentVolumeClaim(namespace)];
130
- case 2:
131
- res = _a.sent();
132
- return [2 /*return*/, res.body.items];
133
- }
134
- });
135
- }); };
136
- exports.getProjectPvcs = getProjectPvcs;
137
- var getProjectPodNames = function (envComponent) { return __awaiter(void 0, void 0, void 0, function () {
138
- var pods;
139
- return __generator(this, function (_a) {
140
- switch (_a.label) {
141
- case 0: return [4 /*yield*/, (0, exports.getProjectPods)(envComponent)];
142
- case 1:
143
- pods = _a.sent();
144
- return [2 /*return*/, pods.map(function (n) { return n.metadata.name; })];
145
- }
146
- });
147
- }); };
148
- exports.getProjectPodNames = getProjectPodNames;
149
103
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,kEAA8E;AAC9E,uCAAyC;AACzC,kCAA2C;AAC3C,+DAA6C;AAEtC,IAAM,UAAU,GAAG;;;oBAChB,qBAAM,IAAA,4BAAI,EAAC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"",
9
9
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
10
10
  "test": "yarn run lint",
11
- "build": "yarn tsc",
11
+ "build": "yarn build:compile && yarn build:bundle",
12
+ "build:bundle": "./scripts/bundle",
13
+ "build:compile": "yarn tsc",
12
14
  "build:watch": "yarn tsc -w"
13
15
  },
14
16
  "bin": {
@@ -16,34 +18,19 @@
16
18
  "catladder": "./bin/catladder"
17
19
  },
18
20
  "dependencies": {
19
- "@catladder/pipeline": "1.40.4",
20
- "@kubernetes/client-node": "^0.16.2",
21
- "child-process-promise": "^2.2.1",
22
- "clipboardy": "^2.0.0",
23
- "command-exists-promise": "^2.0.2",
24
- "common-tags": "^1.8.0",
25
- "dayjs": "^1.10.4",
26
- "fs-extra": "^7.0.1",
27
- "gitlab": "^4.4.1",
28
- "js-yaml": "^4.1.0",
29
- "lodash": "^4.17.21",
30
- "memoizee": "^0.4.14",
31
- "node-fetch": "^2.3.0",
32
- "open": "^8.4.0",
33
- "prettier": "^2.5.1",
34
- "tmp-promise": "^2.0.2",
35
- "update-notifier": "^2.5.0",
36
- "vorpal": "^1.12.0"
21
+ "ts-node": "^10.9.1"
37
22
  },
38
23
  "engines": {
39
24
  "node": ">=12.0.0"
40
25
  },
41
26
  "devDependencies": {
27
+ "@catladder/pipeline": "1.41.0",
28
+ "@kubernetes/client-node": "^0.16.2",
42
29
  "@tsconfig/node14": "^1.0.1",
43
30
  "@types/common-tags": "^1.8.0",
44
31
  "@types/fs-extra": "^5.0.4",
45
32
  "@types/js-yaml": "^4.0.5",
46
- "@types/lodash": "^4.14.119",
33
+ "@types/lodash": "^4.14.185",
47
34
  "@types/memoizee": "^0.4.2",
48
35
  "@types/node-fetch": "^2.1.4",
49
36
  "@types/request": "^2.48.1",
@@ -52,8 +39,24 @@
52
39
  "@types/vorpal": "^1.12.0",
53
40
  "@types/websocket": "^0.0.40",
54
41
  "@types/yargs": "^13.0.0",
42
+ "child-process-promise": "^2.2.1",
43
+ "clipboardy": "^2.0.0",
44
+ "command-exists-promise": "^2.0.2",
45
+ "common-tags": "^1.8.0",
46
+ "dayjs": "^1.10.4",
55
47
  "eslint": "^8.7.0",
56
- "typescript": "^4.5.4"
48
+ "fs-extra": "^7.0.1",
49
+ "gitlab": "^4.4.1",
50
+ "js-yaml": "^4.1.0",
51
+ "lodash": "^4.17.21",
52
+ "memoizee": "^0.4.14",
53
+ "node-fetch": "^2.3.0",
54
+ "open": "^8.4.0",
55
+ "prettier": "^2.5.1",
56
+ "tmp-promise": "^2.0.2",
57
+ "typescript": "^4.5.4",
58
+ "update-notifier": "^6.0.2",
59
+ "vorpal": "^1.12.0"
57
60
  },
58
- "version": "1.40.4"
61
+ "version": "1.41.0"
59
62
  }
package/scripts/bundle ADDED
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ ncc build dist/catenv.js -o dist/bundles/catenv -e 'ts-node' -m
3
+
4
+ ncc build dist/cli.js -o dist/bundles/cli -e 'ts-node' -m
@@ -1,4 +1,4 @@
1
- import { Config, ComponentConfig } from "@catladder/pipeline";
1
+ import type { Config, ComponentConfig } from "@catladder/pipeline";
2
2
  import { getEnvVars, getProjectConfig } from "../../config/getProjectConfig";
3
3
  import { getGitRoot } from "../../utils/projects";
4
4
  import { join } from "path";
@@ -1,5 +1,5 @@
1
1
  import memoizee from "memoizee";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import { getk8sApi } from "../../../../k8sApi";
4
4
  import { getCurrentContext } from "../../../../utils/cluster";
5
5
  import { logError } from "../../../../utils/log";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { logError } from "../../../../utils/log";
3
3
 
4
4
  import { startPortForward } from "../../../../utils/portForward";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import projectMongoDestroyMember from "./projectMongoDestroyMember";
3
3
  import projectMongoGetShell from "./projectMongoGetShell";
4
4
  import projectMongoPortForward from "./projectMongoPortForward";
@@ -1,10 +1,8 @@
1
1
  import { exec } from "child-process-promise";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
+ import { getProjectPvcs } from "../../../../kubernetes";
3
4
  import { logError } from "../../../../utils/log";
4
- import {
5
- getProjectNamespace,
6
- getProjectPvcs,
7
- } from "../../../../utils/projects";
5
+ import { getProjectNamespace } from "../../../../utils/projects";
8
6
  import { envAndComponents } from "../project/utils/autocompletions";
9
7
  import ensureCluster from "../project/utils/ensureCluster";
10
8
  import { getMongoDbPodsWithReplInfo } from "./utils";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { logError } from "../../../../utils/log";
3
3
  import { getProjectNamespace } from "../../../../utils/projects";
4
4
  import { envAndComponents } from "../project/utils/autocompletions";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { getEnvVars, parseChoice } from "../../../../config/getProjectConfig";
3
3
  import { logError } from "../../../../utils/log";
4
4
  import { startPortForward } from "../../../../utils/portForward";
@@ -1,8 +1,6 @@
1
1
  import { exec, spawn } from "child-process-promise";
2
- import {
3
- getProjectNamespace,
4
- getProjectPodNames,
5
- } from "../../../../../utils/projects";
2
+ import { getProjectPodNames } from "../../../../../kubernetes";
3
+ import { getProjectNamespace } from "../../../../../utils/projects";
6
4
 
7
5
  const filterMongoDbs = (podNames: string[]) =>
8
6
  podNames.filter(
@@ -2,7 +2,7 @@ import { isOfDeployType } from "@catladder/pipeline";
2
2
  import { spawn } from "child-process-promise";
3
3
  import { writeFile } from "fs-extra";
4
4
  import { withFile } from "tmp-promise";
5
- import Vorpal from "vorpal";
5
+ import type Vorpal from "vorpal";
6
6
  import {
7
7
  getEnvVars,
8
8
  getGitlabVar,
@@ -2,7 +2,8 @@
2
2
  import { getSecretVarName } from "@catladder/pipeline";
3
3
  import { stripIndents } from "common-tags";
4
4
  import { difference } from "lodash";
5
- import Vorpal, { CommandInstance } from "vorpal";
5
+ import type { CommandInstance } from "vorpal";
6
+ import type Vorpal from "vorpal";
6
7
  import {
7
8
  getAllComponentsWithAllEnvsHierarchical,
8
9
  getEnvironment,
@@ -1,5 +1,5 @@
1
1
  import { spawn } from "child-process-promise";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import {
4
4
  getEnvVars,
5
5
  getProjectConfig,
@@ -1,11 +1,9 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { getk8sApi } from "../../../../k8sApi";
3
+ import { getProjectPodNames } from "../../../../kubernetes";
3
4
 
4
5
  import { logError } from "../../../../utils/log";
5
- import {
6
- getProjectNamespace,
7
- getProjectPodNames,
8
- } from "../../../../utils/projects";
6
+ import { getProjectNamespace } from "../../../../utils/projects";
9
7
  import { envAndComponents } from "./utils/autocompletions";
10
8
  import ensureCluster from "./utils/ensureCluster";
11
9
 
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { exec } from "child-process-promise";
3
3
  import { getProjectNamespace } from "../../../../utils/projects";
4
4
  import { envAndComponents } from "./utils/autocompletions";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { getEnvVars, parseChoice } from "../../../../config/getProjectConfig";
3
3
  import { envAndComponents } from "./utils/autocompletions";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { spawn } from "child-process-promise";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
 
4
4
  export default async (vorpal: Vorpal) =>
5
5
  vorpal
@@ -1,9 +1,7 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
+ import { getProjectPodNames } from "../../../../kubernetes";
2
3
  import { logError } from "../../../../utils/log";
3
- import {
4
- getProjectNamespace,
5
- getProjectPodNames,
6
- } from "../../../../utils/projects";
4
+ import { getProjectNamespace } from "../../../../utils/projects";
7
5
  import { getShell } from "../../../../utils/shell";
8
6
 
9
7
  import { envAndComponents } from "./utils/autocompletions";
@@ -1,7 +1,8 @@
1
1
  import { exec } from "child-process-promise";
2
2
  import { last } from "lodash";
3
3
  import open from "open";
4
- import Vorpal, { CommandInstance } from "vorpal";
4
+ import type { CommandInstance } from "vorpal";
5
+ import type Vorpal from "vorpal";
5
6
  import {
6
7
  doGitlabRequest,
7
8
  getGitlabToken,
@@ -2,7 +2,7 @@ import { readFile, writeFile } from "fs-extra";
2
2
  import { dump } from "js-yaml";
3
3
  import { mapKeys, snakeCase, toUpper } from "lodash";
4
4
  import path from "path";
5
- import Vorpal from "vorpal";
5
+ import type Vorpal from "vorpal";
6
6
  import { hasGitlabCiFile } from "../../../../utils/projects";
7
7
 
8
8
  const transformVar = (key: string) => toUpper(snakeCase(key));
@@ -1,7 +1,7 @@
1
1
  import { dump } from "js-yaml";
2
2
  import { pick } from "lodash";
3
- import Vorpal from "vorpal";
4
- import { getProjectPods } from "../../../../utils/projects";
3
+ import type Vorpal from "vorpal";
4
+ import { getProjectPods } from "../../../../kubernetes";
5
5
  import { envAndComponents } from "./utils/autocompletions";
6
6
  import ensureCluster from "./utils/ensureCluster";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { exec } from "child-process-promise";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import {
4
4
  getEnvironment,
5
5
  parseChoice,
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { getProjectNamespace } from "../../../../utils/projects";
3
3
  import { envAndComponents } from "./utils/autocompletions";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import open from "open";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import {
4
4
  GRAFANA_PROXY_LOCAL_PORT,
5
5
  GRAFANA_PROXY_TARGET_PORT,
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import {
3
3
  getPipelineContextByChoice,
4
4
  parseChoice,
@@ -1,5 +1,5 @@
1
1
  import open from "open";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import {
4
4
  getEnvironment,
5
5
  parseChoice,
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { exec } from "child-process-promise";
3
3
 
4
4
  export default async (vorpal: Vorpal) =>
@@ -1,6 +1,6 @@
1
1
  import open from "open";
2
2
  import { startPortForward } from "../../../../utils/portForward";
3
- import Vorpal from "vorpal";
3
+ import type Vorpal from "vorpal";
4
4
  import {
5
5
  GRAFANA_PROXY_LOCAL_PORT,
6
6
  GRAFANA_PROXY_TARGET_PORT,
@@ -1,15 +1,13 @@
1
1
  import open from "open";
2
- import Vorpal from "vorpal";
2
+ import type Vorpal from "vorpal";
3
3
  import {
4
4
  GRAFANA_PROXY_LOCAL_PORT,
5
5
  GRAFANA_PROXY_TARGET_PORT,
6
6
  } from "../../../../config/constants";
7
+ import { getProjectPodNames } from "../../../../kubernetes";
7
8
  import { logError } from "../../../../utils/log";
8
9
  import { startPortForward } from "../../../../utils/portForward";
9
- import {
10
- getProjectNamespace,
11
- getProjectPodNames,
12
- } from "../../../../utils/projects";
10
+ import { getProjectNamespace } from "../../../../utils/projects";
13
11
  import { envAndComponents } from "./utils/autocompletions";
14
12
  import ensureCluster from "./utils/ensureCluster";
15
13
 
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import {
3
3
  getPipelineContextByChoice,
4
4
  parseChoice,
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { exec } from "child-process-promise";
3
3
  import { getProjectNamespace } from "../../../../utils/projects";
4
4
  import { envAndComponents } from "./utils/autocompletions";
@@ -1,10 +1,8 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
+ import { getProjectPodNames } from "../../../../kubernetes";
2
3
  import { logError } from "../../../../utils/log";
3
4
  import { startPortForward } from "../../../../utils/portForward";
4
- import {
5
- getProjectNamespace,
6
- getProjectPodNames,
7
- } from "../../../../utils/projects";
5
+ import { getProjectNamespace } from "../../../../utils/projects";
8
6
  import { envAndComponents } from "./utils/autocompletions";
9
7
  import ensureCluster from "./utils/ensureCluster";
10
8
 
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { setupProject } from "./setup";
3
3
 
4
4
  export default async (vorpal: Vorpal) =>
@@ -1,6 +1,7 @@
1
- import { V1Job, V1ObjectMeta } from "@kubernetes/client-node";
1
+ import type { V1ObjectMeta } from "@kubernetes/client-node";
2
+ import { V1Job } from "@kubernetes/client-node";
2
3
 
3
- import Vorpal from "vorpal";
4
+ import type Vorpal from "vorpal";
4
5
  import { getk8sApiBatch, getk8sApiBatchBeta } from "../../../../k8sApi";
5
6
  import { logError } from "../../../../utils/log";
6
7
  import { namespaceAutoCompletion } from "../general/namespaceAutoCompletion";
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import commandCloudSqlProxy from "./commandCloudSqlProxy";
3
3
  import commandConfigSecrets from "./commandConfigSecrets";
4
4
  import commandCopyDB from "./commandCopyDB";
@@ -1,4 +1,4 @@
1
- import { CommandInstance } from "vorpal";
1
+ import type { CommandInstance } from "vorpal";
2
2
  import { getAllPipelineContexts } from "../../../../../config/getProjectConfig";
3
3
  import { projectConfigSecrets } from "../commandConfigSecrets";
4
4
  import { setupAccessTokens } from "./setupAccessTokens";
@@ -1,5 +1,5 @@
1
1
  import open from "open";
2
- import { CommandInstance } from "vorpal";
2
+ import type { CommandInstance } from "vorpal";
3
3
  import { doGitlabRequest, getProjectInfo } from "../../../../../utils/gitlab";
4
4
 
5
5
  export const setupAccessTokens = async (instance: CommandInstance) => {
@@ -1,5 +1,6 @@
1
- import { Context, isOfDeployType } from "@catladder/pipeline";
2
- import { CommandInstance } from "vorpal";
1
+ import type { Context} from "@catladder/pipeline";
2
+ import { isOfDeployType } from "@catladder/pipeline";
3
+ import type { CommandInstance } from "vorpal";
3
4
  import { setupKubernetes } from "./setupKubernetes";
4
5
 
5
6
  export const setupContext = async (
@@ -1,9 +1,10 @@
1
+ import type {
2
+ Context} from "@catladder/pipeline";
1
3
  import {
2
- Context,
3
4
  getFullKubernetesClusterName,
4
5
  isOfDeployType,
5
6
  } from "@catladder/pipeline";
6
- import { CommandInstance } from "vorpal";
7
+ import type { CommandInstance } from "vorpal";
7
8
  import { exec } from "child-process-promise";
8
9
  import { connectToCluster } from "../../../../../utils/cluster";
9
10
  import { upsertAllVariables } from "../../../../../utils/gitlab";
@@ -1,5 +1,7 @@
1
- import { Context, getKubernetesNamespace } from "@catladder/pipeline";
2
- import { V1Namespace, V1ObjectMeta } from "@kubernetes/client-node";
1
+ import type { Context} from "@catladder/pipeline";
2
+ import { getKubernetesNamespace } from "@catladder/pipeline";
3
+ import type { V1ObjectMeta } from "@kubernetes/client-node";
4
+ import { V1Namespace } from "@kubernetes/client-node";
3
5
  import { getk8sApi } from "../../../../../k8sApi";
4
6
 
5
7
  export default async function (context: Context) {
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import { getProjectConfig } from "../../../../../config/getProjectConfig";
3
3
 
4
4
  export const showProjectBanner = async (vorpal: Vorpal) => {
@@ -1,4 +1,4 @@
1
- import { DeployConfigKubernetesCluster } from "@catladder/pipeline";
1
+ import type { DeployConfigKubernetesCluster } from "@catladder/pipeline";
2
2
  import open from "open";
3
3
 
4
4
  export const openGoogleCloudLogs = async (
@@ -1,6 +1,6 @@
1
1
  import { spawn } from "child-process-promise";
2
2
  import fetch from "node-fetch";
3
- import Vorpal from "vorpal";
3
+ import type Vorpal from "vorpal";
4
4
 
5
5
  export default async (vorpal: Vorpal) => {
6
6
  vorpal.command("dadjoke", "something for jonas.").action(async function () {
@@ -1,9 +1,9 @@
1
- import { Config } from "@catladder/pipeline";
1
+ import type { Config } from "@catladder/pipeline";
2
2
  import { spawn, exec } from "child-process-promise";
3
3
  import { writeFile } from "fs-extra";
4
4
  import { dump } from "js-yaml";
5
5
  import { format } from "prettier";
6
- import { CommandInstance } from "vorpal";
6
+ import type { CommandInstance } from "vorpal";
7
7
  import { getGitRoot } from "../../../utils/projects";
8
8
 
9
9
  export const writeConfig = async (
@@ -1,4 +1,4 @@
1
- import Vorpal from "vorpal";
1
+ import type Vorpal from "vorpal";
2
2
  import {
3
3
  getGitlabCi,
4
4
  getProjectConfig,
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  BuildConfig,
3
3
  ComponentConfig,
4
4
  Config,
@@ -14,7 +14,7 @@ import {
14
14
  } from "fs-extra";
15
15
  import { isEmpty } from "lodash";
16
16
  import { join } from "path";
17
- import Vorpal from "vorpal";
17
+ import type Vorpal from "vorpal";
18
18
  import {
19
19
  getGitlabCi,
20
20
  getGitlabCiFilePath,
@@ -24,11 +24,8 @@ import { syncBitwarden } from "../../../../utils/passwordstore";
24
24
  import { getGitRoot } from "../../../../utils/projects";
25
25
  import { writeConfig } from "../../config/writeConfig";
26
26
  import { migrateSecrets } from "./migrateSecrets";
27
- import {
28
- detectBuildConfig,
29
- isOldInclude,
30
- OldGitlabCiFile,
31
- } from "./oldGitlabCi";
27
+ import type { OldGitlabCiFile } from "./oldGitlabCi";
28
+ import { detectBuildConfig, isOldInclude } from "./oldGitlabCi";
32
29
  export const LEGACY_ENVS = [
33
30
  "dev-local",
34
31
  "dev",