@oclif/core 4.0.0-beta.6 → 4.0.0-beta.8

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.
@@ -43,13 +43,11 @@ async function readTSConfig(root, tsconfigName = 'tsconfig.json') {
43
43
  catch { }
44
44
  }
45
45
  if (!typescript) {
46
- (0, warn_1.warn)('Could not find typescript. Please ensure that typescript is a devDependency. Falling back to compiled source.');
46
+ (0, warn_1.memoizedWarn)('Could not find typescript. Please ensure that typescript is a devDependency. Falling back to compiled source.');
47
47
  return;
48
48
  }
49
49
  const read = async (path) => {
50
- const localRoot = await upUntil(path, async (p) =>
51
- // eslint-disable-next-line unicorn/no-await-expression-member
52
- (await (0, promises_1.readdir)(p)).includes('package.json'));
50
+ const localRoot = await upUntil(path, async (p) => (await (0, promises_1.readdir)(p)).includes('package.json'));
53
51
  if (!localRoot)
54
52
  return;
55
53
  try {
@@ -1,6 +1,6 @@
1
1
  type Options = {
2
- pretty?: boolean;
3
- theme?: Record<string, string>;
2
+ pretty?: boolean | undefined;
3
+ theme?: Record<string, string> | undefined;
4
4
  };
5
5
  export declare function tokenize(json?: unknown, options?: Options): {
6
6
  type: string;
package/lib/ux/index.d.ts CHANGED
@@ -5,7 +5,13 @@ import Simple from './action/simple';
5
5
  import Spinner from './action/spinner';
6
6
  import colorizeJson from './colorize-json';
7
7
  import { colorize } from './theme';
8
- export declare const methods: {
8
+ export { error } from '../errors/error';
9
+ export { exit } from '../errors/exit';
10
+ export { warn } from '../errors/warn';
11
+ export { default as colorizeJson } from './colorize-json';
12
+ export { colorize } from './theme';
13
+ export { stderr, stdout } from './write';
14
+ export declare const ux: {
9
15
  action: Simple | Spinner;
10
16
  /**
11
17
  * Add color to text.
@@ -61,4 +67,3 @@ export declare const methods: {
61
67
  */
62
68
  warn: typeof warn;
63
69
  };
64
- export default methods;
package/lib/ux/index.js CHANGED
@@ -3,7 +3,7 @@ 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.methods = void 0;
6
+ exports.ux = exports.stdout = exports.stderr = exports.colorize = exports.colorizeJson = exports.warn = exports.exit = exports.error = void 0;
7
7
  const error_1 = require("../errors/error");
8
8
  const exit_1 = require("../errors/exit");
9
9
  const warn_1 = require("../errors/warn");
@@ -12,12 +12,25 @@ const spinner_1 = __importDefault(require("./action/spinner"));
12
12
  const colorize_json_1 = __importDefault(require("./colorize-json"));
13
13
  const theme_1 = require("./theme");
14
14
  const write_1 = require("./write");
15
+ var error_2 = require("../errors/error");
16
+ Object.defineProperty(exports, "error", { enumerable: true, get: function () { return error_2.error; } });
17
+ var exit_2 = require("../errors/exit");
18
+ Object.defineProperty(exports, "exit", { enumerable: true, get: function () { return exit_2.exit; } });
19
+ var warn_2 = require("../errors/warn");
20
+ Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return warn_2.warn; } });
21
+ var colorize_json_2 = require("./colorize-json");
22
+ Object.defineProperty(exports, "colorizeJson", { enumerable: true, get: function () { return __importDefault(colorize_json_2).default; } });
23
+ var theme_2 = require("./theme");
24
+ Object.defineProperty(exports, "colorize", { enumerable: true, get: function () { return theme_2.colorize; } });
25
+ var write_2 = require("./write");
26
+ Object.defineProperty(exports, "stderr", { enumerable: true, get: function () { return write_2.stderr; } });
27
+ Object.defineProperty(exports, "stdout", { enumerable: true, get: function () { return write_2.stdout; } });
15
28
  const ACTION_TYPE = (Boolean(process.stderr.isTTY) &&
16
29
  !process.env.CI &&
17
30
  !['dumb', 'emacs-color'].includes(process.env.TERM) &&
18
31
  'spinner') ||
19
32
  'simple';
20
- exports.methods = {
33
+ exports.ux = {
21
34
  action: ACTION_TYPE === 'spinner' ? new spinner_1.default() : new simple_1.default(),
22
35
  /**
23
36
  * Add color to text.
@@ -73,4 +86,3 @@ exports.methods = {
73
86
  */
74
87
  warn: warn_1.warn,
75
88
  };
76
- exports.default = exports.methods;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "4.0.0-beta.6",
4
+ "version": "4.0.0-beta.8",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -66,10 +66,7 @@
66
66
  "node": ">=18.0.0"
67
67
  },
68
68
  "files": [
69
- "/lib",
70
- "/flush.js",
71
- "/flush.d.ts",
72
- "/handle.js"
69
+ "/lib"
73
70
  ],
74
71
  "homepage": "https://github.com/oclif/core",
75
72
  "keywords": [
@@ -82,7 +79,26 @@
82
79
  "argv"
83
80
  ],
84
81
  "license": "MIT",
85
- "main": "./lib/index.js",
82
+ "exports": {
83
+ ".": "./lib/index.js",
84
+ "./args": "./lib/args.js",
85
+ "./command": "./lib/command.js",
86
+ "./config": "./lib/config/index.js",
87
+ "./errors": "./lib/errors/index.js",
88
+ "./execute": "./lib/execute.js",
89
+ "./flags": "./lib/flags.js",
90
+ "./flush": "./lib/flush.js",
91
+ "./handle": "./lib/errors/handle.js",
92
+ "./help": "./lib/help/index.js",
93
+ "./hooks": "./lib/interfaces/hooks.js",
94
+ "./interfaces": "./lib/interfaces/index.js",
95
+ "./logger": "./lib/logger.js",
96
+ "./performance": "./lib/performance.js",
97
+ "./run": "./lib/main.js",
98
+ "./settings": "./lib/settings.js",
99
+ "./util/ids": "./lib/util/ids.js",
100
+ "./ux": "./lib/ux/index.js"
101
+ },
86
102
  "repository": "oclif/core",
87
103
  "oclif": {
88
104
  "bin": "oclif",
package/flush.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare const flush: () => Promise<void>
2
-
3
- export = flush
package/flush.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./lib/cli-ux/flush').flush
package/handle.js DELETED
@@ -1 +0,0 @@
1
- module.exports = async error => require('./lib/errors/handle').handle(error)