@oclif/core 1.0.2 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.0.3](https://github.com/oclif/core/compare/v1.0.2...v1.0.3) (2021-11-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * remove module lodash.template in favor of lodash ([#286](https://github.com/oclif/core/issues/286)) ([caaff0b](https://github.com/oclif/core/commit/caaff0b4918ab2e01bc01cad2c0d8158c2fcc1c5))
11
+
5
12
  ### [1.0.2](https://github.com/oclif/core/compare/v1.0.1...v1.0.2) (2021-10-13)
6
13
 
7
14
 
package/README.md CHANGED
@@ -4,8 +4,64 @@
4
4
  base library for oclif CLIs
5
5
 
6
6
  [![Version](https://img.shields.io/npm/v/@oclif/core.svg)](https://npmjs.org/package/@oclif/core)
7
- [![CircleCI](https://circleci.com/gh/oclif/core/tree/master.svg?style=svg)](https://circleci.com/gh/oclif/core/tree/master)
7
+ [![CircleCI](https://circleci.com/gh/oclif/core/tree/main.svg?style=svg)](https://circleci.com/gh/oclif/core/tree/main)
8
8
  [![Downloads/week](https://img.shields.io/npm/dw/@oclif/core.svg)](https://npmjs.org/package/@oclif/core)
9
- [![License](https://img.shields.io/npm/l/@oclif/core.svg)](https://github.com/oclif/core/blob/master/package.json)
9
+ [![License](https://img.shields.io/npm/l/@oclif/core.svg)](https://github.com/oclif/core/blob/main/package.json)
10
10
 
11
- Docs coming soon...
11
+
12
+ Usage
13
+ =====
14
+
15
+ Without the generator, you can create a simple CLI like this:
16
+
17
+ **TypeScript**
18
+ ```js
19
+ #!/usr/bin/env ts-node
20
+
21
+ import * as fs from 'fs'
22
+ import {Command, flags} from '@oclif/core'
23
+
24
+ class LS extends Command {
25
+ static flags = {
26
+ version: flags.version(),
27
+ help: flags.help(),
28
+ // run with --dir= or -d=
29
+ dir: flags.string({
30
+ char: 'd',
31
+ default: process.cwd(),
32
+ }),
33
+ }
34
+
35
+ async run() {
36
+ const {flags} = this.parse(LS)
37
+ let files = fs.readdirSync(flags.dir)
38
+ for (let f of files) {
39
+ this.log(f)
40
+ }
41
+ }
42
+ }
43
+
44
+ LS.run()
45
+ .catch(require('@oclif/errors/handle'))
46
+ ```
47
+
48
+ Then run either of these with:
49
+
50
+ ```sh-session
51
+ $ ./myscript
52
+ ...files in current dir...
53
+ $ ./myscript --dir foobar
54
+ ...files in ./foobar...
55
+ $ ./myscript --version
56
+ myscript/0.0.0 darwin-x64 node-v9.5.0
57
+ $ ./myscript --help
58
+ USAGE
59
+ $ @oclif/core
60
+
61
+ OPTIONS
62
+ -d, --dir=dir [default: /Users/jdickey/src/github.com/oclif/core]
63
+ --help show CLI help
64
+ --version show CLI version
65
+ ```
66
+
67
+ See the [generator](https://github.com/oclif/oclif) for all the options you can pass to the command.
package/lib/help/util.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.standardizeIDFromArgv = exports.toConfiguredId = exports.toStandardizedId = exports.template = exports.loadHelpClass = void 0;
4
- const lodashTemplate = require("lodash.template");
4
+ const _ = require("lodash");
5
5
  const _1 = require(".");
6
6
  const module_loader_1 = require("../module-loader");
7
7
  function extractClass(exported) {
@@ -24,7 +24,7 @@ async function loadHelpClass(config) {
24
24
  exports.loadHelpClass = loadHelpClass;
25
25
  function template(context) {
26
26
  function render(t) {
27
- return lodashTemplate(t)(context);
27
+ return _.template(t)(context);
28
28
  }
29
29
  return render;
30
30
  }
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": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "author": "Jeff Dickey @jdxcode",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -15,7 +15,7 @@
15
15
  "globby": "^11.0.1",
16
16
  "indent-string": "^4.0.0",
17
17
  "is-wsl": "^2.1.1",
18
- "lodash.template": "^4.4.0",
18
+ "lodash": "^4.17.21",
19
19
  "semver": "^7.3.2",
20
20
  "string-width": "^4.2.0",
21
21
  "strip-ansi": "^6.0.0",
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@commitlint/config-conventional": "^12.1.1",
28
- "@oclif/plugin-help": "^3.2.0",
29
- "@oclif/plugin-legacy": "^1.1.3",
30
- "@oclif/plugin-plugins": "^1.7.7",
31
- "@oclif/test": "^1.2.2",
28
+ "@oclif/plugin-help": "^5.1.2",
29
+ "@oclif/plugin-legacy": "^1.2.0",
30
+ "@oclif/plugin-plugins": "^1.10.1",
31
+ "@oclif/test": "^1.2.8",
32
32
  "@types/chai": "^4.1.7",
33
33
  "@types/chai-as-promised": "^7.1.3",
34
34
  "@types/clean-stack": "^2.1.1",
@@ -54,7 +54,6 @@
54
54
  "fancy-test": "^1.4.3",
55
55
  "globby": "^11.0.1",
56
56
  "husky": "6",
57
- "lodash": "^4.17.11",
58
57
  "mocha": "^8.1.3",
59
58
  "nock": "^13.0.0",
60
59
  "proxyquire": "^2.1.0",