@oclif/core 1.0.9 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.1](https://github.com/oclif/core/compare/v1.1.0...v1.1.1) (2022-01-06)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * regenerate yarn.lock ([#340](https://github.com/oclif/core/issues/340)) ([75bf208](https://github.com/oclif/core/commit/75bf20819f2af574004cb7fe698938b51c6f2e44))
11
+
12
+ ## [1.1.0](https://github.com/oclif/core/compare/v1.0.11...v1.1.0) (2022-01-05)
13
+
14
+
15
+ ### Features
16
+
17
+ * add integration tests ([#339](https://github.com/oclif/core/issues/339)) ([2159c0b](https://github.com/oclif/core/commit/2159c0b970a0090f8bf21ff59e63dea1e788b5f9))
18
+
19
+ ### [1.0.11](https://github.com/oclif/core/compare/v1.0.10...v1.0.11) (2021-12-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * update imports in errors/cli.ts ([#325](https://github.com/oclif/core/issues/325)) ([b3d6e9b](https://github.com/oclif/core/commit/b3d6e9bf34928ac59486807576a2ee2643b22464))
25
+
26
+ ### [1.0.10](https://github.com/oclif/core/compare/v1.0.9...v1.0.10) (2021-12-08)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * bump deps ([#317](https://github.com/oclif/core/issues/317)) ([3e656e0](https://github.com/oclif/core/commit/3e656e0b6909bedb879a267bf341cfb992f4d208))
32
+
5
33
  ### [1.0.9](https://github.com/oclif/core/compare/v1.0.8...v1.0.9) (2021-12-08)
6
34
 
7
35
  ### [1.0.8](https://github.com/oclif/core/compare/v1.0.7...v1.0.8) (2021-12-07)
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  @oclif/core
2
- ==============
2
+ ===========
3
3
 
4
4
  base library for oclif CLIs
5
5
 
@@ -9,6 +9,11 @@ base library for oclif CLIs
9
9
  [![License](https://img.shields.io/npm/l/@oclif/core.svg)](https://github.com/oclif/core/blob/main/package.json)
10
10
 
11
11
 
12
+ Migrating
13
+ =====
14
+
15
+ If you're migrating from the old oclif libraries (`@oclif/config`, `@oclif/command`, `@oclif/error`, `@oclif/parser`), see the [migration guide](./MIGRATION.md).
16
+
12
17
  Usage
13
18
  =====
14
19
 
@@ -33,7 +38,7 @@ class LS extends Command {
33
38
  }
34
39
 
35
40
  async run() {
36
- const {flags} = this.parse(LS)
41
+ const {flags} = await this.parse(LS)
37
42
  let files = fs.readdirSync(flags.dir)
38
43
  for (let f of files) {
39
44
  this.log(f)
@@ -17,11 +17,11 @@ export declare class CLIError extends Error implements OclifError {
17
17
  * @return {string} returns a string representing the dispay of the error
18
18
  */
19
19
  render(): string;
20
- get bang(): string;
20
+ get bang(): string | undefined;
21
21
  }
22
22
  export declare namespace CLIError {
23
23
  class Warn extends CLIError {
24
24
  constructor(err: string | Error);
25
- get bang(): string;
25
+ get bang(): string | undefined;
26
26
  }
27
27
  }
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
- // tslint:disable no-implicit-dependencies
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.CLIError = exports.addOclifExitCode = void 0;
4
+ const chalk = require("chalk");
5
+ const indent = require("indent-string");
6
+ const cs = require("clean-stack");
7
+ const wrap = require("wrap-ansi");
8
+ const screen = require("../../screen");
5
9
  const config_1 = require("../config");
6
10
  /**
7
11
  * properties specific to internal oclif error handling
@@ -22,8 +26,7 @@ class CLIError extends Error {
22
26
  this.code = options.code;
23
27
  }
24
28
  get stack() {
25
- const clean = require('clean-stack');
26
- return clean(super.stack, { pretty: true });
29
+ return cs(super.stack, { pretty: true });
27
30
  }
28
31
  /**
29
32
  * @deprecated `render` Errors display should be handled by display function, like pretty-print
@@ -33,23 +36,18 @@ class CLIError extends Error {
33
36
  if (config_1.config.debug) {
34
37
  return this.stack;
35
38
  }
36
- const wrap = require('wrap-ansi');
37
- const indent = require('indent-string');
38
39
  let output = `${this.name}: ${this.message}`;
39
- // eslint-disable-next-line node/no-missing-require
40
- output = wrap(output, require('../screen').errtermwidth - 6, { trim: false, hard: true });
40
+ output = wrap(output, screen.errtermwidth - 6, { trim: false, hard: true });
41
41
  output = indent(output, 3);
42
42
  output = indent(output, 1, { indent: this.bang, includeEmptyLines: true });
43
43
  output = indent(output, 1);
44
44
  return output;
45
45
  }
46
46
  get bang() {
47
- let red = ((s) => s);
48
47
  try {
49
- red = require('chalk').red;
48
+ return chalk.red(process.platform === 'win32' ? '»' : '›');
50
49
  }
51
50
  catch { }
52
- return red(process.platform === 'win32' ? '»' : '›');
53
51
  }
54
52
  }
55
53
  exports.CLIError = CLIError;
@@ -60,12 +58,10 @@ exports.CLIError = CLIError;
60
58
  this.name = 'Warning';
61
59
  }
62
60
  get bang() {
63
- let yellow = ((s) => s);
64
61
  try {
65
- yellow = require('chalk').yellow;
62
+ return chalk.yellow(process.platform === 'win32' ? '»' : '›');
66
63
  }
67
64
  catch { }
68
- return yellow(process.platform === 'win32' ? '»' : '›');
69
65
  }
70
66
  }
71
67
  CLIError.Warn = Warn;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "1.0.9",
4
+ "version": "1.1.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
8
8
  "@oclif/linewrap": "^1.0.0",
9
9
  "chalk": "^4.1.2",
10
10
  "clean-stack": "^3.0.1",
11
- "cli-ux": "^6.0.4",
11
+ "cli-ux": "^6.0.6",
12
12
  "debug": "^4.3.3",
13
13
  "fs-extra": "^9.1.0",
14
14
  "get-package-type": "^0.1.0",
@@ -34,14 +34,13 @@
34
34
  "@types/fs-extra": "^9.0.13",
35
35
  "@types/indent-string": "^4.0.1",
36
36
  "@types/lodash": "^4.14.177",
37
- "@types/lodash.template": "^4.5.0",
38
37
  "@types/mocha": "^8.2.3",
39
38
  "@types/nock": "^11.1.0",
40
39
  "@types/node": "^15.14.9",
41
- "@types/node-notifier": "^8.0.1",
40
+ "@types/node-notifier": "^8.0.2",
42
41
  "@types/proxyquire": "^1.3.28",
43
- "@types/read-pkg": "^5.1.0",
44
42
  "@types/semver": "^7.3.9",
43
+ "@types/shelljs": "^0.8.10",
45
44
  "@types/strip-ansi": "^5.2.1",
46
45
  "@types/wrap-ansi": "^3.0.0",
47
46
  "chai": "^4.3.4",
@@ -56,6 +55,7 @@
56
55
  "mocha": "^8.4.0",
57
56
  "nock": "^13.2.1",
58
57
  "proxyquire": "^2.1.3",
58
+ "shelljs": "^0.8.4",
59
59
  "shx": "^0.3.3",
60
60
  "sinon": "^11.1.2",
61
61
  "ts-node": "^9.1.1",
@@ -98,6 +98,7 @@
98
98
  "posttest": "yarn lint",
99
99
  "prepack": "yarn run build",
100
100
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
101
+ "test:e2e": "mocha \"test/**/*.e2e.ts\" --timeout 600000",
101
102
  "pretest": "yarn build --noEmit && tsc -p test --noEmit"
102
103
  },
103
104
  "types": "lib/index.d.ts"