Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
feat: added repositoryPrefix to allow customizing code URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jun 20, 2018
1 parent af7c1f5 commit bce2fe4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 85 deletions.
22 changes: 11 additions & 11 deletions package.json
Expand Up @@ -9,10 +9,10 @@
"bugs": "https://github.com/oclif/dev-cli/issues",
"dependencies": {
"@oclif/command": "^1.4.33",
"@oclif/config": "^1.6.27",
"@oclif/config": "^1.6.33",
"@oclif/errors": "^1.1.2",
"@oclif/plugin-help": "^2.0.5",
"cli-ux": "^4.6.2",
"cli-ux": "^4.7.2",
"debug": "^3.1.0",
"fs-extra": "^6.0.1",
"lodash": "^4.17.10",
Expand All @@ -22,26 +22,26 @@
"tslib": "^1.9.2"
},
"devDependencies": {
"@oclif/plugin-legacy": "^1.0.15",
"@oclif/test": "^1.0.9",
"@oclif/plugin-legacy": "^1.0.16",
"@oclif/test": "^1.1.0",
"@oclif/tslint": "^1.1.2",
"@types/chai": "^4.1.3",
"@types/chai": "^4.1.4",
"@types/execa": "^0.9.0",
"@types/fs-extra": "^5.0.3",
"@types/globby": "^6.1.0",
"@types/lodash": "^4.14.109",
"@types/lodash": "^4.14.110",
"@types/lodash.template": "^4.4.3",
"@types/mocha": "^5.2.1",
"@types/node": "^10.3.2",
"@types/mocha": "^5.2.2",
"@types/node": "^10.3.4",
"@types/supports-color": "^5.3.0",
"@types/write-json-file": "^2.2.1",
"aws-sdk": "^2.255.1",
"aws-sdk": "^2.259.1",
"chai": "^4.1.2",
"globby": "^8.0.1",
"mocha": "^5.2.0",
"ts-node": "^6.1.0",
"ts-node": "^6.1.1",
"tslint": "^5.10.0",
"typescript": "^2.9.1"
"typescript": "^2.9.2"
},
"engines": {
"node": ">=8.0.0"
Expand Down
5 changes: 4 additions & 1 deletion src/commands/readme.ts
Expand Up @@ -24,6 +24,8 @@ The readme must have any of the following tags inside of it for it to be replace
<!-- usage -->
# Commands
<!-- commands -->
Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
`
static flags = {
multi: flags.boolean({description: 'create a different markdown page for each topic'})
Expand Down Expand Up @@ -167,7 +169,8 @@ USAGE
label = commandPath
version = process.env.OCLIF_NEXT_VERSION || version
}
return `_See code: [${label}](${repo}/blob/v${version}/${commandPath})_`
const template = plugin.pjson.oclif.repositoryPrefix || '<%- repo %>/blob/v<%- version %>/<%- commandPath %>'
return `_See code: [${label}](${_.template(template)({repo, version, commandPath, config, c})})_`
}

private repo(plugin: Config.IPlugin): string | undefined {
Expand Down
129 changes: 56 additions & 73 deletions yarn.lock
Expand Up @@ -18,7 +18,7 @@
reflect-metadata "^0.1.12"
tslib "^1.8.1"

"@heroku-cli/color@^1.1.3", "@heroku-cli/color@^1.1.5":
"@heroku-cli/color@^1.1.5":
version "1.1.5"
resolved "https://registry.yarnpkg.com/@heroku-cli/color/-/color-1.1.5.tgz#d98781513f8daebb21aaaf54c9e8d497db3efcfb"
dependencies:
Expand All @@ -27,13 +27,13 @@
strip-ansi "^4.0.0"
supports-color "^5.4.0"

"@heroku-cli/command@^8.0.7":
version "8.1.22"
resolved "https://registry.yarnpkg.com/@heroku-cli/command/-/command-8.1.22.tgz#0141caddcf4e202d33c5837d83657d39c424922c"
"@heroku-cli/command@^8.1.20":
version "8.1.26"
resolved "https://registry.yarnpkg.com/@heroku-cli/command/-/command-8.1.26.tgz#9a40d29ae11e6e6c239e0c67c9e89f0c54beb391"
dependencies:
"@heroku-cli/color" "^1.1.5"
"@oclif/errors" "^1.1.2"
cli-ux "^4.4.0"
cli-ux "^4.7.1"
debug "^3.1.0"
fs-extra "^6.0.1"
heroku-client "^3.0.6"
Expand All @@ -52,7 +52,7 @@
version "1.1.0"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.0.tgz#50c1e2260ac0ed9439a181de3725a0168d59c48a"

"@oclif/command@^1.4.20", "@oclif/command@^1.4.30":
"@oclif/command@^1.4.30":
version "1.4.32"
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.32.tgz#1cb2eb9637340a1ac69da35e407316688f736647"
dependencies:
Expand All @@ -70,9 +70,9 @@
debug "^3.1.0"
semver "^5.5.0"

"@oclif/config@^1.6.27":
version "1.6.27"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.27.tgz#d3de1cff71301784c8e4ee3903d3f7db21a18c3f"
"@oclif/config@^1.6.33":
version "1.6.33"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.33.tgz#61906143b30751d96dd29991c20c214bf4d9e4ff"
dependencies:
debug "^3.1.0"
tslib "^1.9.2"
Expand Down Expand Up @@ -117,13 +117,13 @@
widest-line "^2.0.0"
wrap-ansi "^3.0.1"

"@oclif/plugin-legacy@^1.0.15":
version "1.0.15"
resolved "https://registry.yarnpkg.com/@oclif/plugin-legacy/-/plugin-legacy-1.0.15.tgz#739f218b9eae3423a9b544efae28726ea78d254b"
"@oclif/plugin-legacy@^1.0.16":
version "1.0.16"
resolved "https://registry.yarnpkg.com/@oclif/plugin-legacy/-/plugin-legacy-1.0.16.tgz#3ab066820457d7768af775ddb6b896c22ad72737"
dependencies:
"@heroku-cli/color" "^1.1.3"
"@heroku-cli/command" "^8.0.7"
"@oclif/command" "^1.4.20"
"@heroku-cli/color" "^1.1.5"
"@heroku-cli/command" "^8.1.20"
"@oclif/command" "^1.4.30"
ansi-escapes "^3.1.0"
debug "^3.1.0"
semver "^5.5.0"
Expand All @@ -132,21 +132,21 @@
version "1.0.2"
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.2.tgz#c9d7c84b0ea60ecec8dd7a9b22c012ba9967aed8"

"@oclif/test@^1.0.9":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.0.9.tgz#302955b80159be78bc7b698aec4b0d2164d06b76"
"@oclif/test@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.1.0.tgz#63eea93f3b20ff534831b1a281d217eb02073a9c"
dependencies:
fancy-test "^1.1.4"
fancy-test "^1.2.0"

"@oclif/tslint@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-1.1.2.tgz#23503ebb56c25556242e23e9df8706efc0b1fafb"
dependencies:
tslint-xo "^0.8.0"

"@types/chai@^4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.3.tgz#b8a74352977a23b604c01aa784f5b793443fb7dc"
"@types/chai@^4.1.4":
version "4.1.4"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.4.tgz#5ca073b330d90b4066d6ce18f60d57f2084ce8ca"

"@types/events@*":
version "1.2.0"
Expand Down Expand Up @@ -188,31 +188,31 @@
version "4.14.109"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.109.tgz#b1c4442239730bf35cabaf493c772b18c045886d"

"@types/lodash@^4.14.110":
version "4.14.110"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.110.tgz#fb07498f84152947f30ea09d89207ca07123461e"

"@types/minimatch@*":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"

"@types/mocha@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.0.tgz#b3c8e69f038835db1a7fdc0b3d879fc50506e29e"

"@types/mocha@^5.2.1":
version "5.2.1"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.1.tgz#465450aaf5cec6f7d35523748c6cc89a5e222dc5"
"@types/mocha@^5.2.2":
version "5.2.2"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.2.tgz#202d2b8fe1364c5b617b439b26a54f0e75eac0a7"

"@types/nock@^9.1.3":
version "9.1.3"
resolved "https://registry.yarnpkg.com/@types/nock/-/nock-9.1.3.tgz#1d445679375b9e25afd449dc56585f81729454e8"
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^10.3.0":
"@types/node@*":
version "10.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.0.tgz#078516315a84d56216b5d4fed8f75d59d3b16cac"

"@types/node@^10.3.2":
version "10.3.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.2.tgz#3840ec6c12556fdda6e0e6d036df853101d732a4"
"@types/node@^10.3.3", "@types/node@^10.3.4":
version "10.3.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.4.tgz#c74e8aec19e555df44609b8057311052a2c84d9e"

"@types/sinon@^5.0.1":
version "5.0.1"
Expand Down Expand Up @@ -300,9 +300,9 @@ atob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a"

aws-sdk@^2.255.1:
version "2.255.1"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.255.1.tgz#d780515e37121784880db310c43b18ebc16e98cb"
aws-sdk@^2.259.1:
version "2.259.1"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.259.1.tgz#df4814b65d5654f250d097951aa84e27a472b5aa"
dependencies:
buffer "4.9.1"
events "1.1.1"
Expand Down Expand Up @@ -481,31 +481,9 @@ clean-stack@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31"

cli-ux@^4.4.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.6.0.tgz#b3c6c4525c66ae0b6c0003db119609cd65c0a9ab"
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^1.0.2"
ansi-styles "^3.2.1"
cardinal "^2.1.1"
chalk "^2.4.1"
clean-stack "^1.3.0"
extract-stack "^1.0.0"
fs-extra "^6.0.1"
hyperlinker "^1.0.0"
indent-string "^3.2.0"
is-wsl "^1.1.0"
lodash "^4.17.10"
password-prompt "^1.0.6"
semver "^5.5.0"
strip-ansi "^4.0.0"
supports-color "^5.4.0"
supports-hyperlinks "^1.0.1"

cli-ux@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.6.2.tgz#77a4eeb93ffb40c697e4f1d60975804134ba7a5a"
cli-ux@^4.7.1, cli-ux@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.7.2.tgz#51661802fb0ad07d56c3029046d2abb6bd6dd61b"
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^1.0.2"
Expand Down Expand Up @@ -725,17 +703,18 @@ extract-stack@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/extract-stack/-/extract-stack-1.0.0.tgz#b97acaf9441eea2332529624b732fc5a1c8165fa"

fancy-test@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.1.4.tgz#1bcc7b7a526218a85ed1ff0d2e95afc4b69fab23"
fancy-test@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.2.0.tgz#c5f6f81725ea42b9caec9bb18731449cfab526f3"
dependencies:
"@types/chai" "^4.1.3"
"@types/chai" "^4.1.4"
"@types/lodash" "^4.14.109"
"@types/mocha" "^5.2.0"
"@types/mocha" "^5.2.2"
"@types/nock" "^9.1.3"
"@types/node" "^10.3.0"
"@types/node" "^10.3.3"
"@types/sinon" "^5.0.1"
lodash "^4.17.10"
mock-stdin "^0.3.1"
stdout-stderr "^0.1.9"

fast-glob@^2.0.2:
Expand Down Expand Up @@ -1268,6 +1247,10 @@ mocha@^5.2.0:
mkdirp "0.5.1"
supports-color "5.4.0"

mock-stdin@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/mock-stdin/-/mock-stdin-0.3.1.tgz#c657d9642d90786435c64ca5e99bbd4d09bd7dd3"

ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down Expand Up @@ -1800,9 +1783,9 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2"
safe-regex "^1.1.0"

ts-node@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-6.1.0.tgz#a2c37a11fdb58e60eca887a1269b025cf4d2f8b8"
ts-node@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-6.1.1.tgz#19607140acb06150441fcdb61be11f73f7b6657e"
dependencies:
arrify "^1.0.0"
diff "^3.1.0"
Expand Down Expand Up @@ -1889,9 +1872,9 @@ type-detect@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"

typescript@^2.9.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.1.tgz#fdb19d2c67a15d11995fd15640e373e09ab09961"
typescript@^2.9.2:
version "2.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"

union-value@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit bce2fe4

Please sign in to comment.