@kubernetesjs/cli 0.3.3 → 0.3.4

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/commands/apply.js CHANGED
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const chalk_1 = __importDefault(require("chalk"));
40
+ const fs = __importStar(require("fs"));
40
41
  const kubernetesjs_1 = require("kubernetesjs");
41
42
  const config_1 = require("../config");
42
- const fs = __importStar(require("fs"));
43
43
  async function promptYamlFilePath(prompter, argv) {
44
44
  const question = {
45
45
  type: 'text',
@@ -1,5 +1,6 @@
1
1
  import { CLIOptions, Inquirerer } from 'inquirerer';
2
2
  import { ParsedArgs } from 'minimist';
3
+ import type { CommandHandler } from '../types';
3
4
  /**
4
5
  * Handle the --config flag by parsing the YAML file and executing the appropriate command
5
6
  * @param argv Command line arguments
@@ -7,5 +8,5 @@ import { ParsedArgs } from 'minimist';
7
8
  * @param options CLI options
8
9
  * @param commandMap Map of available commands
9
10
  */
10
- declare const _default: (argv: Partial<ParsedArgs>, prompter: Inquirerer, options: CLIOptions, commandMap: Record<string, Function>) => Promise<boolean>;
11
+ declare const _default: (argv: Partial<ParsedArgs>, prompter: Inquirerer, options: CLIOptions, commandMap: Record<string, CommandHandler>) => Promise<boolean>;
11
12
  export default _default;
@@ -37,9 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const chalk_1 = __importDefault(require("chalk"));
40
+ const fs = __importStar(require("fs"));
40
41
  const kubernetesjs_1 = require("kubernetesjs");
41
42
  const config_1 = require("../config");
42
- const fs = __importStar(require("fs"));
43
43
  async function promptResourceType(prompter, argv) {
44
44
  const resourceTypes = [
45
45
  'pod',
package/commands/exec.js CHANGED
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const chalk_1 = __importDefault(require("chalk"));
7
+ const child_process_1 = require("child_process");
7
8
  const kubernetesjs_1 = require("kubernetesjs");
8
9
  const config_1 = require("../config");
9
- const child_process_1 = require("child_process");
10
10
  async function promptPodName(prompter, argv, namespace, client) {
11
11
  try {
12
12
  const pods = await client.listCoreV1NamespacedPod({
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const chalk_1 = __importDefault(require("chalk"));
7
+ const child_process_1 = require("child_process");
7
8
  const kubernetesjs_1 = require("kubernetesjs");
8
9
  const config_1 = require("../config");
9
- const child_process_1 = require("child_process");
10
10
  async function promptServiceName(prompter, argv, namespace, client) {
11
11
  try {
12
12
  const services = await client.listCoreV1NamespacedService({
package/commands.js CHANGED
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.commands = void 0;
7
- const package_1 = require("./package");
8
- const utils_1 = require("./utils");
7
+ const apply_1 = __importDefault(require("./commands/apply"));
8
+ const cluster_info_1 = __importDefault(require("./commands/cluster-info"));
9
+ const config_1 = __importDefault(require("./commands/config"));
10
+ const delete_1 = __importDefault(require("./commands/delete"));
9
11
  // Commands
10
12
  const deploy_1 = __importDefault(require("./commands/deploy"));
11
- const get_1 = __importDefault(require("./commands/get"));
12
13
  const describe_1 = __importDefault(require("./commands/describe"));
13
- const logs_1 = __importDefault(require("./commands/logs"));
14
- const apply_1 = __importDefault(require("./commands/apply"));
15
- const delete_1 = __importDefault(require("./commands/delete"));
16
14
  const exec_1 = __importDefault(require("./commands/exec"));
15
+ const get_1 = __importDefault(require("./commands/get"));
16
+ const logs_1 = __importDefault(require("./commands/logs"));
17
17
  const port_forward_1 = __importDefault(require("./commands/port-forward"));
18
- const cluster_info_1 = __importDefault(require("./commands/cluster-info"));
19
- const config_1 = __importDefault(require("./commands/config"));
18
+ const package_1 = require("./package");
19
+ const utils_1 = require("./utils");
20
20
  const commandMap = {
21
21
  deploy: deploy_1.default,
22
22
  get: get_1.default,
package/config.js CHANGED
@@ -38,9 +38,9 @@ exports.inferResourceType = inferResourceType;
38
38
  exports.getCurrentNamespace = getCurrentNamespace;
39
39
  exports.setCurrentNamespace = setCurrentNamespace;
40
40
  const fs_1 = require("fs");
41
+ const yaml = __importStar(require("js-yaml"));
41
42
  const os_1 = require("os");
42
43
  const path_1 = require("path");
43
- const yaml = __importStar(require("js-yaml"));
44
44
  const KUBECONFIG_PATH = (0, path_1.join)((0, os_1.homedir)(), '.kubeconfig');
45
45
  const DEFAULT_NAMESPACE = 'default';
46
46
  /**
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import * as fs from 'fs';
2
3
  import { KubernetesClient } from 'kubernetesjs';
3
4
  import { readYamlFile } from '../config';
4
- import * as fs from 'fs';
5
5
  async function promptYamlFilePath(prompter, argv) {
6
6
  const question = {
7
7
  type: 'text',
@@ -1,6 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import * as fs from 'fs';
3
- import { readYamlFile, inferResourceType } from '../config';
3
+ import { inferResourceType, readYamlFile } from '../config';
4
4
  /**
5
5
  * Handle the --config flag by parsing the YAML file and executing the appropriate command
6
6
  * @param argv Command line arguments
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import * as fs from 'fs';
2
3
  import { KubernetesClient } from 'kubernetesjs';
3
4
  import { getCurrentNamespace, readYamlFile } from '../config';
4
- import * as fs from 'fs';
5
5
  async function promptResourceType(prompter, argv) {
6
6
  const resourceTypes = [
7
7
  'pod',
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import { spawn } from 'child_process';
2
3
  import { KubernetesClient } from 'kubernetesjs';
3
4
  import { getCurrentNamespace } from '../config';
4
- import { spawn } from 'child_process';
5
5
  async function promptPodName(prompter, argv, namespace, client) {
6
6
  try {
7
7
  const pods = await client.listCoreV1NamespacedPod({
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
+ import { spawn } from 'child_process';
2
3
  import { KubernetesClient } from 'kubernetesjs';
3
4
  import { getCurrentNamespace } from '../config';
4
- import { spawn } from 'child_process';
5
5
  async function promptServiceName(prompter, argv, namespace, client) {
6
6
  try {
7
7
  const services = await client.listCoreV1NamespacedService({
package/esm/commands.js CHANGED
@@ -1,16 +1,16 @@
1
- import { readAndParsePackageJson } from './package';
2
- import { extractFirst, usageText } from './utils';
1
+ import apply from './commands/apply';
2
+ import clusterInfo from './commands/cluster-info';
3
+ import config from './commands/config';
4
+ import deleteCmd from './commands/delete';
3
5
  // Commands
4
6
  import deploy from './commands/deploy';
5
- import get from './commands/get';
6
7
  import describe from './commands/describe';
7
- import logs from './commands/logs';
8
- import apply from './commands/apply';
9
- import deleteCmd from './commands/delete';
10
8
  import exec from './commands/exec';
9
+ import get from './commands/get';
10
+ import logs from './commands/logs';
11
11
  import portForward from './commands/port-forward';
12
- import clusterInfo from './commands/cluster-info';
13
- import config from './commands/config';
12
+ import { readAndParsePackageJson } from './package';
13
+ import { extractFirst, usageText } from './utils';
14
14
  const commandMap = {
15
15
  deploy,
16
16
  get,
package/esm/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from 'fs';
2
+ import * as yaml from 'js-yaml';
2
3
  import { homedir } from 'os';
3
4
  import { join } from 'path';
4
- import * as yaml from 'js-yaml';
5
5
  const KUBECONFIG_PATH = join(homedir(), '.kubeconfig');
6
6
  const DEFAULT_NAMESPACE = 'default';
7
7
  /**
package/esm/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubernetesjs/cli",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "author": "Dan Lynch <pyramation@gmail.com>",
5
5
  "description": "KubernetesJS CLI",
6
6
  "keywords": [
@@ -56,8 +56,8 @@
56
56
  "deepmerge": "^4.3.1",
57
57
  "inquirerer": "^2.0.8",
58
58
  "js-yaml": "^4.1.0",
59
- "kubernetesjs": "^0.7.3",
59
+ "kubernetesjs": "^0.7.4",
60
60
  "minimist": "^1.2.8"
61
61
  },
62
- "gitHead": "268ff7d5272ef5abc02b3529829cca6cd7031428"
62
+ "gitHead": "c10664b145a63bb4cda0896246a3613c7867379b"
63
63
  }
package/types.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { CLIOptions, Inquirerer } from 'inquirerer';
2
+ import type { ParsedArgs } from 'minimist';
3
+ export type CommandHandler = (argv: Partial<ParsedArgs>, prompter: Inquirerer, options: CLIOptions) => Promise<unknown> | unknown;
package/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });