@kubernetesjs/cli 0.3.3 → 0.3.5

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/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # @kubernetesjs/cli
2
2
 
3
3
  <p align="center" width="100%">
4
- <img src="https://github.com/hyperweb-io/interweb-utils/assets/545047/89c743c4-be88-409f-9a77-4b02cd7fe9a4" width="80">
4
+ <img src="https://raw.githubusercontent.com/constructive-io/.github/refs/heads/main/assets/logo.svg" alt="constructive" width="80"><br />
5
5
  <br/>
6
6
  TypeScript CLI for Kubernetes
7
7
  <br />
8
- <a href="https://github.com/hyperweb-io/kubernetesjs/actions/workflows/ci.yml">
9
- <img height="20" src="https://github.com/hyperweb-io/kubernetesjs/actions/workflows/ci.yml/badge.svg"/>
8
+ <a href="https://github.com/constructive-io/kubernetesjs/actions/workflows/ci.yml">
9
+ <img height="20" src="https://github.com/constructive-io/kubernetesjs/actions/workflows/ci.yml/badge.svg"/>
10
10
  </a>
11
- <a href="https://github.com/hyperweb-io/kubernetesjs/blob/main/LICENSE">
11
+ <a href="https://github.com/constructive-io/kubernetesjs/blob/main/LICENSE">
12
12
  <img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
13
13
  </a>
14
14
  </p>
@@ -152,17 +152,16 @@ yarn build:dev
152
152
 
153
153
  Checkout these related projects:
154
154
 
155
- * [`schema-typescript`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-typescript)
155
+ * [`schema-typescript`](https://github.com/constructive-io/dev-utils/tree/main/packages/schema-typescript)
156
156
  Provides robust tools for handling JSON schemas and converting them to TypeScript interfaces with ease and efficiency.
157
- * [`@schema-typescript/cli`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/cli)
157
+ * [`@schema-typescript/cli`](https://github.com/constructive-io/dev-utils/tree/main/packages/cli)
158
158
  CLI is the command line utility for `schema-typescript`.
159
- * [`schema-sdk`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-sdk)
159
+ * [`schema-sdk`](https://github.com/constructive-io/dev-utils/tree/main/packages/schema-sdk)
160
160
  Provides robust tools for handling OpenAPI schemas and converting them to TypeScript clients with ease and efficiency.
161
- * [`starship`](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain.
162
161
 
163
162
  ## Credits
164
163
 
165
- 🛠 Built by [Interweb](https://interweb.co) — if you like our tools, please checkout and contribute [https://interweb.co](https://interweb.co)
164
+ **🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
166
165
 
167
166
  ## Disclaimer
168
167
 
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@kubernetesjs/cli",
3
- "version": "0.3.3",
4
- "author": "Dan Lynch <pyramation@gmail.com>",
3
+ "version": "0.3.5",
4
+ "author": "Constructive <developers@constructive.io>",
5
5
  "description": "KubernetesJS CLI",
6
6
  "keywords": [
7
7
  "kubernetes",
@@ -20,44 +20,45 @@
20
20
  "main": "index.js",
21
21
  "module": "esm/index.js",
22
22
  "types": "index.d.ts",
23
- "homepage": "https://github.com/hyperweb-io/kubernetes",
24
- "license": "SEE LICENSE IN LICENSE",
23
+ "homepage": "https://github.com/constructive-io/kubernetesjs",
24
+ "license": "MIT",
25
25
  "publishConfig": {
26
26
  "access": "public",
27
27
  "directory": "dist"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "https://github.com/hyperweb-io/kubernetes"
31
+ "url": "https://github.com/constructive-io/kubernetesjs"
32
32
  },
33
33
  "bugs": {
34
- "url": "https://github.com/hyperweb-io/kubernetes/issues"
34
+ "url": "https://github.com/constructive-io/kubernetesjs/issues"
35
35
  },
36
36
  "bin": {
37
37
  "k8s": "index.js",
38
38
  "kubernetes": "index.js"
39
39
  },
40
40
  "scripts": {
41
- "copy": "copyfiles -f ../../LICENSE README.md package.json dist",
42
- "clean": "rimraf dist/**",
43
- "prepare": "npm run build",
44
- "build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
45
- "build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
41
+ "clean": "makage clean",
42
+ "prepack": "npm run build",
43
+ "build": "makage build",
44
+ "build:dev": "makage build --dev",
46
45
  "lint": "eslint . --fix",
47
46
  "test": "jest",
48
47
  "test:watch": "jest --watch",
49
48
  "dev": "ts-node src/index.ts"
50
49
  },
51
50
  "devDependencies": {
52
- "@types/js-yaml": "^4.0.9"
51
+ "@types/js-yaml": "^4.0.9",
52
+ "@types/minimist": "^1.2.5",
53
+ "makage": "^0.1.8"
53
54
  },
54
55
  "dependencies": {
55
56
  "chalk": "^4.1.0",
56
57
  "deepmerge": "^4.3.1",
57
58
  "inquirerer": "^2.0.8",
58
59
  "js-yaml": "^4.1.0",
59
- "kubernetesjs": "^0.7.3",
60
+ "kubernetesjs": "^0.7.5",
60
61
  "minimist": "^1.2.8"
61
62
  },
62
- "gitHead": "268ff7d5272ef5abc02b3529829cca6cd7031428"
63
+ "gitHead": "ca9d4e76b6706aecbb0be33ff290767b9987acb2"
63
64
  }
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 });