Skip to content

Commit

Permalink
fix: remove module lodash.template in favor of lodash (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale authored Nov 8, 2021
1 parent d48b0b1 commit caaff0b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 15 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"globby": "^11.0.1",
"indent-string": "^4.0.0",
"is-wsl": "^2.1.1",
"lodash.template": "^4.4.0",
"lodash": "^4.17.21",
"semver": "^7.3.2",
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
Expand All @@ -25,10 +25,10 @@
},
"devDependencies": {
"@commitlint/config-conventional": "^12.1.1",
"@oclif/plugin-help": "^3.2.0",
"@oclif/plugin-legacy": "^1.1.3",
"@oclif/plugin-plugins": "^1.7.7",
"@oclif/test": "^1.2.2",
"@oclif/plugin-help": "^5.1.2",
"@oclif/plugin-legacy": "^1.2.0",
"@oclif/plugin-plugins": "^1.10.1",
"@oclif/test": "^1.2.8",
"@types/chai": "^4.1.7",
"@types/chai-as-promised": "^7.1.3",
"@types/clean-stack": "^2.1.1",
Expand All @@ -54,7 +54,6 @@
"fancy-test": "^1.4.3",
"globby": "^11.0.1",
"husky": "6",
"lodash": "^4.17.11",
"mocha": "^8.1.3",
"nock": "^13.0.0",
"proxyquire": "^2.1.0",
Expand Down
5 changes: 2 additions & 3 deletions src/help/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import lodashTemplate = require('lodash.template')

import * as _ from 'lodash'
import {Config as IConfig, HelpOptions} from '../interfaces'
import {Help, HelpBase} from '.'
import ModuleLoader from '../module-loader'
Expand Down Expand Up @@ -30,7 +29,7 @@ export async function loadHelpClass(config: IConfig): Promise<HelpBaseDerived> {

export function template(context: any): (t: string) => string {
function render(t: string): string {
return lodashTemplate(t)(context)
return _.template(t)(context)
}

return render
Expand Down
2 changes: 1 addition & 1 deletion test/command/main-esm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TOPICS
plugins list installed plugins
COMMANDS
help display help for oclif
help Display help for oclif.
plugins list installed plugins
`))
Expand Down
2 changes: 1 addition & 1 deletion test/command/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TOPICS
plugins list installed plugins
COMMANDS
help display help for oclif
help Display help for oclif.
plugins list installed plugins
`))
Expand Down
38 changes: 34 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,29 @@
is-wsl "^2.1.1"
tslib "^2.0.0"

"@oclif/core@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.0.2.tgz#f8f4eb12ff5adceb0a7ed262e9f5d46bbef1bf4f"
integrity sha512-5Qd4D+OkhCPLNML8S/LEu78CPbnd4hfsF+/7fzAnyUD4U3P+F+/Lnx/b/AnaXw6U8CPjSNO+sod0C+QpqTN13A==
dependencies:
"@oclif/linewrap" "^1.0.0"
chalk "^4.1.0"
clean-stack "^3.0.0"
cli-ux "^5.1.0"
debug "^4.1.1"
fs-extra "^9.0.1"
get-package-type "^0.1.0"
globby "^11.0.1"
indent-string "^4.0.0"
is-wsl "^2.1.1"
lodash.template "^4.4.0"
semver "^7.3.2"
string-width "^4.2.0"
strip-ansi "^6.0.0"
tslib "^2.0.0"
widest-line "^3.1.0"
wrap-ansi "^7.0.0"

"@oclif/errors@^1.2.1", "@oclif/errors@^1.2.2", "@oclif/errors@^1.3.3":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.3.5.tgz#a1e9694dbeccab10fe2fe15acb7113991bed636c"
Expand All @@ -506,7 +529,7 @@
chalk "^2.4.2"
tslib "^1.9.3"

"@oclif/plugin-help@^3", "@oclif/plugin-help@^3.2.0":
"@oclif/plugin-help@^3":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-3.2.2.tgz#063ee08cee556573a5198fbdfdaa32796deba0ed"
integrity sha512-SPZ8U8PBYK0n4srFjCLedk0jWU4QlxgEYLCXIBShJgOwPhTTQknkUlsEwaMIevvCU4iCQZhfMX+D8Pz5GZjFgA==
Expand All @@ -522,7 +545,14 @@
widest-line "^3.1.0"
wrap-ansi "^4.0.0"

"@oclif/plugin-legacy@^1.1.3":
"@oclif/plugin-help@^5.1.2":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-5.1.2.tgz#109744f001fa1b4c55aa9d76a5490ba18f468fed"
integrity sha512-zxI+zJb2KdTjhnSEIY2wGl+hc++sVb0VH6UeBtxsZPRCQREwv0GjVt7sjwd93ODG1KYOsPGIyfsVLZbldTBvLA==
dependencies:
"@oclif/core" "^1.0.2"

"@oclif/plugin-legacy@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@oclif/plugin-legacy/-/plugin-legacy-1.2.0.tgz#67ef471b5ad0e39b7821112c8b622754e9b78cb9"
integrity sha512-rxKDIqDgEvEvSEyXZS5kyzZb+yd/hAYwTzKHKjFrmTIrUok/kRC5xMtg1uvIGk7Xt9hWmsqaNhIrvSqvEYYk/w==
Expand All @@ -535,7 +565,7 @@
semver "^7.3.2"
tslib "^2.0.0"

"@oclif/plugin-plugins@^1.7.7":
"@oclif/plugin-plugins@^1.10.1":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@oclif/plugin-plugins/-/plugin-plugins-1.10.1.tgz#13666d7c2f591a77f7a16334feee59f9eb216eb1"
integrity sha512-JDUA3NtOa4OlH8ofUBXQMTFlpEkSmeE9BxoQTD6+BeUvMgqFuZThENucRvCD00sywhCmDngmIYN59gKcXpGJeQ==
Expand All @@ -559,7 +589,7 @@
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493"
integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw==

"@oclif/test@^1.2.2":
"@oclif/test@^1.2.8":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.2.8.tgz#a5b2ebd747832217d9af65ac30b58780c4c17c5e"
integrity sha512-HCh0qPge1JCqTEw4s2ScnicEZd4Ro4/0VvdjpsfCiX6fuDV53fRZ2uqLTgxKGHrVoqOZnVrRZHyhFyEsFGs+zQ==
Expand Down

0 comments on commit caaff0b

Please sign in to comment.