@oclif/core 3.0.0-beta.1 → 3.0.0-beta.3

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 (85) hide show
  1. package/README.md +9 -7
  2. package/lib/command.d.ts +2 -0
  3. package/lib/command.js +4 -4
  4. package/lib/config/config.d.ts +9 -12
  5. package/lib/config/config.js +90 -137
  6. package/lib/config/index.d.ts +2 -1
  7. package/lib/config/index.js +2 -1
  8. package/lib/config/plugin-loader.d.ts +30 -0
  9. package/lib/config/plugin-loader.js +129 -0
  10. package/lib/config/plugin.d.ts +5 -10
  11. package/lib/config/plugin.js +21 -17
  12. package/lib/config/ts-node.d.ts +3 -2
  13. package/lib/config/ts-node.js +83 -36
  14. package/lib/errors/config.js +5 -5
  15. package/lib/errors/errors/cli.d.ts +1 -0
  16. package/lib/errors/errors/cli.js +1 -0
  17. package/lib/errors/handle.d.ts +2 -2
  18. package/lib/errors/handle.js +4 -5
  19. package/lib/errors/index.d.ts +2 -1
  20. package/lib/errors/index.js +9 -2
  21. package/lib/errors/logger.js +3 -3
  22. package/lib/execute.d.ts +49 -0
  23. package/lib/execute.js +62 -0
  24. package/lib/flags.js +6 -4
  25. package/lib/help/index.js +3 -3
  26. package/lib/index.d.ts +9 -7
  27. package/lib/index.js +13 -19
  28. package/lib/interfaces/config.d.ts +26 -26
  29. package/lib/interfaces/parser.d.ts +14 -66
  30. package/lib/interfaces/pjson.d.ts +2 -0
  31. package/lib/interfaces/plugin.d.ts +8 -1
  32. package/lib/interfaces/ts-config.d.ts +9 -0
  33. package/lib/main.d.ts +1 -54
  34. package/lib/main.js +11 -73
  35. package/lib/module-loader.d.ts +1 -2
  36. package/lib/module-loader.js +9 -9
  37. package/lib/parser/errors.js +1 -1
  38. package/lib/parser/parse.js +1 -34
  39. package/lib/performance.d.ts +1 -1
  40. package/lib/performance.js +2 -3
  41. package/lib/screen.js +2 -2
  42. package/lib/settings.d.ts +2 -1
  43. package/lib/settings.js +2 -2
  44. package/lib/{cli-ux → ux}/action/base.js +2 -2
  45. package/lib/{cli-ux → ux}/action/spinner.js +1 -1
  46. package/lib/{cli-ux → ux}/config.d.ts +0 -1
  47. package/lib/{cli-ux → ux}/config.js +6 -10
  48. package/lib/{cli-ux → ux}/exit.d.ts +1 -1
  49. package/lib/{cli-ux → ux}/exit.js +1 -1
  50. package/lib/ux/flush.d.ts +1 -0
  51. package/lib/ux/flush.js +27 -0
  52. package/lib/{cli-ux → ux}/index.d.ts +8 -27
  53. package/lib/{cli-ux → ux}/index.js +21 -80
  54. package/lib/{cli-ux → ux}/prompt.js +2 -2
  55. package/lib/{cli-ux → ux}/styled/json.js +3 -3
  56. package/package.json +24 -19
  57. package/flush.d.ts +0 -3
  58. package/flush.js +0 -1
  59. package/handle.js +0 -1
  60. package/lib/cli-ux/action/pride-spinner.d.ts +0 -4
  61. package/lib/cli-ux/action/pride-spinner.js +0 -30
  62. /package/lib/{cli-ux → ux}/action/base.d.ts +0 -0
  63. /package/lib/{cli-ux → ux}/action/simple.d.ts +0 -0
  64. /package/lib/{cli-ux → ux}/action/simple.js +0 -0
  65. /package/lib/{cli-ux → ux}/action/spinner.d.ts +0 -0
  66. /package/lib/{cli-ux → ux}/action/spinners.d.ts +0 -0
  67. /package/lib/{cli-ux → ux}/action/spinners.js +0 -0
  68. /package/lib/{cli-ux → ux}/list.d.ts +0 -0
  69. /package/lib/{cli-ux → ux}/list.js +0 -0
  70. /package/lib/{cli-ux → ux}/prompt.d.ts +0 -0
  71. /package/lib/{cli-ux → ux}/stream.d.ts +0 -0
  72. /package/lib/{cli-ux → ux}/stream.js +0 -0
  73. /package/lib/{cli-ux → ux}/styled/index.d.ts +0 -0
  74. /package/lib/{cli-ux → ux}/styled/index.js +0 -0
  75. /package/lib/{cli-ux → ux}/styled/json.d.ts +0 -0
  76. /package/lib/{cli-ux → ux}/styled/object.d.ts +0 -0
  77. /package/lib/{cli-ux → ux}/styled/object.js +0 -0
  78. /package/lib/{cli-ux → ux}/styled/progress.d.ts +0 -0
  79. /package/lib/{cli-ux → ux}/styled/progress.js +0 -0
  80. /package/lib/{cli-ux → ux}/styled/table.d.ts +0 -0
  81. /package/lib/{cli-ux → ux}/styled/table.js +0 -0
  82. /package/lib/{cli-ux → ux}/styled/tree.d.ts +0 -0
  83. /package/lib/{cli-ux → ux}/styled/tree.js +0 -0
  84. /package/lib/{cli-ux → ux}/wait.d.ts +0 -0
  85. /package/lib/{cli-ux → ux}/wait.js +0 -0
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const chalk = require("chalk");
4
- const index_1 = require("../../index");
4
+ const index_1 = require("../index");
5
5
  function styledJSON(obj) {
6
6
  const json = JSON.stringify(obj, null, 2);
7
7
  if (!chalk.level) {
8
- index_1.ux.info(json);
8
+ index_1.default.info(json);
9
9
  return;
10
10
  }
11
11
  const cardinal = require('cardinal');
12
12
  const theme = require('cardinal/themes/jq');
13
- index_1.ux.info(cardinal.highlight(json, { json: true, theme }));
13
+ index_1.default.info(cardinal.highlight(json, { json: true, theme }));
14
14
  }
15
15
  exports.default = styledJSON;
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": "3.0.0-beta.1",
4
+ "version": "3.0.0-beta.3",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -14,7 +14,6 @@
14
14
  "cli-progress": "^3.12.0",
15
15
  "debug": "^4.3.4",
16
16
  "ejs": "^3.1.8",
17
- "fs-extra": "^9.1.0",
18
17
  "get-package-type": "^0.1.0",
19
18
  "globby": "^11.1.0",
20
19
  "hyperlinker": "^1.0.0",
@@ -24,7 +23,6 @@
24
23
  "natural-orderby": "^2.0.3",
25
24
  "object-treeify": "^1.1.33",
26
25
  "password-prompt": "^1.1.2",
27
- "semver": "^7.5.3",
28
26
  "slice-ansi": "^4.0.0",
29
27
  "string-width": "^4.2.3",
30
28
  "strip-ansi": "^6.0.1",
@@ -39,15 +37,15 @@
39
37
  "devDependencies": {
40
38
  "@commitlint/config-conventional": "^12.1.4",
41
39
  "@oclif/plugin-help": "^5.2.8",
42
- "@oclif/plugin-plugins": "^2.4.7",
43
- "@oclif/test": "^2.3.15",
40
+ "@oclif/plugin-plugins": "^3.3.0",
41
+ "@oclif/test": "^2.4.7",
44
42
  "@types/ansi-styles": "^3.2.1",
45
43
  "@types/benchmark": "^2.1.2",
46
44
  "@types/chai": "^4.3.4",
47
45
  "@types/chai-as-promised": "^7.1.5",
48
46
  "@types/clean-stack": "^2.1.1",
49
47
  "@types/ejs": "^3.1.2",
50
- "@types/fs-extra": "^9.0.13",
48
+ "@types/glob": "^8.1.0",
51
49
  "@types/indent-string": "^4.0.1",
52
50
  "@types/js-yaml": "^3.12.7",
53
51
  "@types/mocha": "^8.2.3",
@@ -55,8 +53,7 @@
55
53
  "@types/node": "^16",
56
54
  "@types/node-notifier": "^8.0.2",
57
55
  "@types/proxyquire": "^1.3.28",
58
- "@types/semver": "^7.5.0",
59
- "@types/shelljs": "^0.8.11",
56
+ "@types/shelljs": "^0.8.12",
60
57
  "@types/slice-ansi": "^4.0.0",
61
58
  "@types/strip-ansi": "^5.2.1",
62
59
  "@types/supports-color": "^8.1.1",
@@ -66,13 +63,14 @@
66
63
  "chai": "^4.3.7",
67
64
  "chai-as-promised": "^7.1.1",
68
65
  "commitlint": "^12.1.4",
66
+ "cross-env": "^7.0.3",
69
67
  "eslint": "^7.32.0",
70
68
  "eslint-config-oclif": "^4.0.0",
71
69
  "eslint-config-oclif-typescript": "^1.0.3",
72
70
  "fancy-test": "^2.0.16",
73
71
  "globby": "^11.1.0",
74
72
  "husky": "6",
75
- "mocha": "^8.4.0",
73
+ "mocha": "^10.2.0",
76
74
  "nock": "^13.3.0",
77
75
  "proxyquire": "^2.1.3",
78
76
  "shelljs": "^0.8.5",
@@ -82,20 +80,26 @@
82
80
  "typescript": "^4.9.5"
83
81
  },
84
82
  "engines": {
85
- "node": ">=14.0.0"
83
+ "node": ">=16.0.0"
86
84
  },
87
85
  "files": [
88
- "/lib",
89
- "/flush.js",
90
- "/flush.d.ts",
91
- "/handle.js"
86
+ "/lib"
92
87
  ],
93
88
  "homepage": "https://github.com/oclif/core",
94
89
  "keywords": [
95
90
  "oclif"
96
91
  ],
97
92
  "license": "MIT",
98
- "main": "lib/index.js",
93
+ "exports": {
94
+ ".": "./lib/index.js",
95
+ "./execute": "./lib/execute.js",
96
+ "./flush": "./lib/ux/flush.js",
97
+ "./handle": "./lib/errors/handle.js",
98
+ "./interfaces": "./lib/interfaces/index.js",
99
+ "./run": "./lib/main.js",
100
+ "./settings": "./lib/settings.js",
101
+ "./ux": "./lib/ux/index.js"
102
+ },
99
103
  "repository": "oclif/core",
100
104
  "oclif": {
101
105
  "bin": "oclif",
@@ -110,14 +114,15 @@
110
114
  "scripts": {
111
115
  "build": "shx rm -rf lib && tsc",
112
116
  "commitlint": "commitlint",
117
+ "compile": "tsc",
113
118
  "lint": "eslint . --ext .ts --config .eslintrc",
114
119
  "posttest": "yarn lint",
115
- "compile": "tsc",
116
120
  "prepack": "yarn run build",
117
- "test": "mocha --forbid-only \"test/**/*.test.ts\"",
118
- "test:e2e": "mocha --forbid-only \"test/**/*.e2e.ts\" --timeout 1200000",
119
121
  "pretest": "yarn build --noEmit && tsc -p test --noEmit --skipLibCheck",
120
- "test:perf": "ts-node test/perf/parser.perf.ts"
122
+ "test:e2e": "mocha --forbid-only \"test/**/*.e2e.ts\" --parallel --timeout 1200000",
123
+ "test:esm-cjs": "cross-env DEBUG=e2e:* ts-node test/integration/esm-cjs.ts",
124
+ "test:perf": "ts-node test/perf/parser.perf.ts",
125
+ "test": "mocha --forbid-only \"test/**/*.test.ts\""
121
126
  },
122
127
  "types": "lib/index.d.ts"
123
128
  }
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').flush
package/handle.js DELETED
@@ -1 +0,0 @@
1
- module.exports = error => require('./lib/errors/handle').handle(error)
@@ -1,4 +0,0 @@
1
- import SpinnerAction from './spinner';
2
- export default class PrideSpinnerAction extends SpinnerAction {
3
- protected _frame(): string;
4
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const chalk = require("chalk");
4
- const supportsColor = require("supports-color");
5
- const spinner_1 = require("./spinner");
6
- function color(s, frameIndex) {
7
- const prideColors = [
8
- chalk.keyword('pink'),
9
- chalk.red,
10
- chalk.keyword('orange'),
11
- chalk.yellow,
12
- chalk.green,
13
- chalk.cyan,
14
- chalk.blue,
15
- chalk.magenta,
16
- ];
17
- if (!supportsColor)
18
- return s;
19
- const has256 = supportsColor.stdout ? supportsColor.stdout.has256 : (process.env.TERM || '').includes('256');
20
- const prideColor = prideColors[frameIndex] || prideColors[0];
21
- return has256 ? prideColor(s) : chalk.magenta(s);
22
- }
23
- class PrideSpinnerAction extends spinner_1.default {
24
- _frame() {
25
- const frame = this.frames[this.frameIndex];
26
- this.frameIndex = ++this.frameIndex % this.frames.length;
27
- return color(frame, this.frameIndex);
28
- }
29
- }
30
- exports.default = PrideSpinnerAction;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes