oclif 4.13.11 → 4.13.13

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.
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Command, Interfaces } from '@oclif/core';
3
2
  import { ExecOptions } from 'node:child_process';
4
3
  export type FlaggablePrompt = {
package/lib/generator.js CHANGED
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GeneratorCommand = exports.makeFlags = exports.readPJSON = exports.exec = void 0;
6
+ exports.GeneratorCommand = void 0;
7
+ exports.exec = exec;
8
+ exports.readPJSON = readPJSON;
9
+ exports.makeFlags = makeFlags;
7
10
  const core_1 = require("@oclif/core");
8
11
  const chalk_1 = __importDefault(require("chalk"));
9
12
  const ejs_1 = require("ejs");
@@ -28,7 +31,6 @@ async function exec(command, opts) {
28
31
  p.stderr?.pipe(process.stderr);
29
32
  });
30
33
  }
31
- exports.exec = exec;
32
34
  async function readPJSON(location) {
33
35
  try {
34
36
  const packageJSON = await (0, promises_1.readFile)((0, node_path_1.join)(location, 'package.json'), 'utf8');
@@ -36,7 +38,6 @@ async function readPJSON(location) {
36
38
  }
37
39
  catch { }
38
40
  }
39
- exports.readPJSON = readPJSON;
40
41
  function validateInput(input, validate) {
41
42
  const result = validate(input);
42
43
  if (typeof result === 'string')
@@ -55,7 +56,6 @@ function makeFlags(flaggablePrompts) {
55
56
  }),
56
57
  ]));
57
58
  }
58
- exports.makeFlags = makeFlags;
59
59
  class GeneratorCommand extends core_1.Command {
60
60
  args;
61
61
  flaggablePrompts;
package/lib/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.run = void 0;
4
3
  var core_1 = require("@oclif/core");
5
4
  Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
package/lib/log.js CHANGED
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.log = exports.debug = void 0;
26
+ exports.debug = void 0;
27
+ exports.log = log;
27
28
  const core_1 = require("@oclif/core");
28
29
  const util = __importStar(require("node:util"));
29
30
  const util_1 = require("./util");
@@ -33,4 +34,3 @@ function log(format, ...args) {
33
34
  args = args.map((arg) => (0, util_1.prettifyPaths)(arg));
34
35
  exports.debug.enabled ? (0, exports.debug)(format, ...args) : core_1.ux.stdout(`oclif: ${util.format(format, ...args)}`);
35
36
  }
36
- exports.log = log;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.writeBinScripts = void 0;
26
+ exports.writeBinScripts = writeBinScripts;
27
27
  const node_child_process_1 = require("node:child_process");
28
28
  const fs = __importStar(require("node:fs"));
29
29
  const path = __importStar(require("node:path"));
@@ -111,4 +111,3 @@ fi
111
111
  : exec(`ln -sf ${config.bin} ${alias}`, { cwd: path.join(baseWorkspace, 'bin') })) ?? []),
112
112
  ]);
113
113
  }
114
- exports.writeBinScripts = writeBinScripts;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.build = void 0;
29
+ exports.build = build;
30
30
  const core_1 = require("@oclif/core");
31
31
  const find_yarn_workspace_root_1 = __importDefault(require("find-yarn-workspace-root"));
32
32
  const fs_extra_1 = require("fs-extra");
@@ -118,7 +118,6 @@ async function build(c, options = {}) {
118
118
  (0, log_1.log)(`finished building ${targetsToBuild.length} targets sequentially`);
119
119
  }
120
120
  }
121
- exports.build = build;
122
121
  const isLockFile = (f) => f.endsWith('package-lock.json') ||
123
122
  f.endsWith('yarn.lock') ||
124
123
  f.endsWith('npm-shrinkwrap.json') ||
@@ -23,7 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.buildConfig = exports.gitSha = exports.TARGETS = void 0;
26
+ exports.TARGETS = void 0;
27
+ exports.gitSha = gitSha;
28
+ exports.buildConfig = buildConfig;
27
29
  const core_1 = require("@oclif/core");
28
30
  const node_child_process_1 = require("node:child_process");
29
31
  const promises_1 = require("node:fs/promises");
@@ -39,7 +41,6 @@ async function gitSha(cwd, options = {}) {
39
41
  const { stdout } = await exec(`git ${args.join(' ')}`, { cwd });
40
42
  return stdout.trim();
41
43
  }
42
- exports.gitSha = gitSha;
43
44
  async function Tmp(config) {
44
45
  const tmp = path.join(config.root, 'tmp');
45
46
  await (0, promises_1.mkdir)(tmp, { recursive: true });
@@ -91,4 +92,3 @@ async function buildConfig(root, options = {}) {
91
92
  xz: options?.xz ?? updateConfig?.s3?.xz ?? true,
92
93
  };
93
94
  }
94
- exports.buildConfig = buildConfig;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.fetchNodeBinary = void 0;
29
+ exports.fetchNodeBinary = fetchNodeBinary;
30
30
  const async_retry_1 = __importDefault(require("async-retry"));
31
31
  const fs_extra_1 = require("fs-extra");
32
32
  const node_child_process_1 = require("node:child_process");
@@ -98,5 +98,4 @@ async function fetchNodeBinary({ arch, nodeVersion, output, platform, tmp }) {
98
98
  await (0, fs_extra_1.copy)(path.join(cache, getFilename(platform)), output);
99
99
  return output;
100
100
  }
101
- exports.fetchNodeBinary = fetchNodeBinary;
102
101
  const getFilename = (platform) => (platform === 'win32' ? 'node.exe' : 'node');
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debVersion = exports.debArch = exports.templateShortKey = exports.channelAWSDir = exports.commitAWSDir = void 0;
3
+ exports.commitAWSDir = commitAWSDir;
4
+ exports.channelAWSDir = channelAWSDir;
5
+ exports.templateShortKey = templateShortKey;
6
+ exports.debArch = debArch;
7
+ exports.debVersion = debVersion;
4
8
  const ejs_1 = require("ejs");
5
9
  const node_path_1 = require("node:path");
6
10
  function commitAWSDir(version, sha, s3Config) {
@@ -9,14 +13,12 @@ function commitAWSDir(version, sha, s3Config) {
9
13
  s3SubDir = `${s3SubDir}/`;
10
14
  return (0, node_path_1.join)(s3SubDir, 'versions', version, sha);
11
15
  }
12
- exports.commitAWSDir = commitAWSDir;
13
16
  function channelAWSDir(channel, s3Config) {
14
17
  let s3SubDir = s3Config.folder || '';
15
18
  if (s3SubDir !== '' && s3SubDir.slice(-1) !== '/')
16
19
  s3SubDir = `${s3SubDir}/`;
17
20
  return (0, node_path_1.join)(s3SubDir, 'channels', channel);
18
21
  }
19
- exports.channelAWSDir = channelAWSDir;
20
22
  // TODO: refactor this key name lookup helper to oclif/core
21
23
  function templateShortKey(type, options) {
22
24
  if (!options)
@@ -34,7 +36,6 @@ function templateShortKey(type, options) {
34
36
  };
35
37
  return (0, ejs_1.render)(templates[type], { ...options });
36
38
  }
37
- exports.templateShortKey = templateShortKey;
38
39
  function debArch(arch) {
39
40
  if (arch === 'x64')
40
41
  return 'amd64';
@@ -46,9 +47,7 @@ function debArch(arch) {
46
47
  return 'arm64';
47
48
  throw new Error(`invalid arch: ${arch}`);
48
49
  }
49
- exports.debArch = debArch;
50
50
  function debVersion(buildConfig) {
51
51
  return `${buildConfig.config.version.split('-')[0]}.${buildConfig.gitSha}-1`;
52
52
  // see debian_revision: https://www.debian.org/doc/debian-policy/ch-controlfields.html
53
53
  }
54
- exports.debVersion = debVersion;
package/lib/util.js CHANGED
@@ -23,7 +23,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.validateBin = exports.isEmpty = exports.checkFor7Zip = exports.hash = exports.prettifyPaths = exports.sortVersionsObjectByKeysDesc = exports.sortBy = exports.uniq = exports.compact = exports.uniqBy = exports.castArray = void 0;
26
+ exports.hash = exports.prettifyPaths = exports.sortVersionsObjectByKeysDesc = void 0;
27
+ exports.castArray = castArray;
28
+ exports.uniqBy = uniqBy;
29
+ exports.compact = compact;
30
+ exports.uniq = uniq;
31
+ exports.sortBy = sortBy;
32
+ exports.checkFor7Zip = checkFor7Zip;
33
+ exports.isEmpty = isEmpty;
34
+ exports.validateBin = validateBin;
27
35
  const core_1 = require("@oclif/core");
28
36
  const node_child_process_1 = require("node:child_process");
29
37
  const crypto = __importStar(require("node:crypto"));
@@ -37,23 +45,19 @@ function castArray(input) {
37
45
  return [];
38
46
  return Array.isArray(input) ? input : [input];
39
47
  }
40
- exports.castArray = castArray;
41
48
  function uniqBy(arr, fn) {
42
49
  return arr.filter((a, i) => {
43
50
  const aVal = fn(a);
44
51
  return !arr.some((b, j) => j > i && fn(b) === aVal);
45
52
  });
46
53
  }
47
- exports.uniqBy = uniqBy;
48
54
  function compact(a) {
49
55
  // eslint-disable-next-line unicorn/prefer-native-coercion-functions
50
56
  return a.filter((a) => Boolean(a));
51
57
  }
52
- exports.compact = compact;
53
58
  function uniq(arr) {
54
59
  return [...new Set(arr)];
55
60
  }
56
- exports.uniq = uniq;
57
61
  function compare(a, b) {
58
62
  a = a === undefined ? 0 : a;
59
63
  b = b === undefined ? 0 : b;
@@ -74,7 +78,6 @@ function compare(a, b) {
74
78
  function sortBy(arr, fn) {
75
79
  return arr.sort((a, b) => compare(fn(a), fn(b)));
76
80
  }
77
- exports.sortBy = sortBy;
78
81
  const sortVersionsObjectByKeysDesc = (input) => {
79
82
  const keys = Reflect.ownKeys(input).sort((a, b) => {
80
83
  const splitA = a.split('.').map((part) => Number.parseInt(part, 10));
@@ -131,12 +134,9 @@ async function checkFor7Zip() {
131
134
  throw error;
132
135
  }
133
136
  }
134
- exports.checkFor7Zip = checkFor7Zip;
135
137
  function isEmpty(obj) {
136
138
  return Object.keys(obj).length === 0;
137
139
  }
138
- exports.isEmpty = isEmpty;
139
140
  function validateBin(bin) {
140
141
  return /^[\w-]+$/.test(bin);
141
142
  }
142
- exports.validateBin = validateBin;
@@ -3,6 +3,6 @@ export declare const appendToIndex: (input: {
3
3
  filename: string;
4
4
  maxAge: string;
5
5
  originalUrl: string;
6
- s3Config: BuildConfig['s3Config'];
6
+ s3Config: BuildConfig["s3Config"];
7
7
  version: string;
8
8
  }) => Promise<void>;
@@ -1080,5 +1080,5 @@
1080
1080
  ]
1081
1081
  }
1082
1082
  },
1083
- "version": "4.13.11"
1083
+ "version": "4.13.13"
1084
1084
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oclif",
3
3
  "description": "oclif: create your own CLI",
4
- "version": "4.13.11",
4
+ "version": "4.13.13",
5
5
  "author": "Salesforce",
6
6
  "bin": {
7
7
  "oclif": "bin/run.js"
@@ -9,10 +9,10 @@
9
9
  "bugs": "https://github.com/oclif/oclif/issues",
10
10
  "dependencies": {
11
11
  "@aws-sdk/client-cloudfront": "^3.592.0",
12
- "@aws-sdk/client-s3": "^3.600.0",
12
+ "@aws-sdk/client-s3": "^3.606.0",
13
13
  "@inquirer/confirm": "^3.1.11",
14
14
  "@inquirer/input": "^2.1.9",
15
- "@inquirer/select": "^2.3.5",
15
+ "@inquirer/select": "^2.3.10",
16
16
  "@oclif/core": "^4",
17
17
  "@oclif/plugin-help": "^6.2.2",
18
18
  "@oclif/plugin-not-found": "^3.2.3",
@@ -44,7 +44,7 @@
44
44
  "@types/debug": "^4.1.12",
45
45
  "@types/ejs": "^3.1.5",
46
46
  "@types/fs-extra": "^9.0",
47
- "@types/lodash": "^4.17.5",
47
+ "@types/lodash": "^4.17.6",
48
48
  "@types/mocha": "^10.0.7",
49
49
  "@types/node": "^18",
50
50
  "@types/semver": "^7.5.8",
@@ -55,7 +55,7 @@
55
55
  "commitlint": "^19",
56
56
  "eslint": "^8.57.0",
57
57
  "eslint-config-oclif": "^5.2.0",
58
- "eslint-config-oclif-typescript": "^3.1.7",
58
+ "eslint-config-oclif-typescript": "^3.1.8",
59
59
  "eslint-config-prettier": "^9.0.0",
60
60
  "eslint-plugin-perfectionist": "^2.11.0",
61
61
  "husky": "^9",