generated from salesforcecli/plugin-template-sf
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74c79c4
commit 004413b
Showing
9 changed files
with
163 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# summary | ||
|
||
Summary of a command. | ||
|
||
# description | ||
|
||
Description of a command. | ||
|
||
# flags.name.summary | ||
|
||
Description of a flag. | ||
|
||
# examples | ||
|
||
- <%= config.bin %> <%= command.id %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (c) 2023, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import { SfCommand } from '@salesforce/sf-plugins-core'; | ||
import { Messages } from '@salesforce/core'; | ||
import got from 'got'; | ||
|
||
Messages.importMessagesDirectory(__dirname); | ||
const messages = Messages.loadMessages('@salesforce/plugin-marketplace', 'plugins.discover'); | ||
|
||
type NpmInfo = { | ||
name: string; | ||
version: string; | ||
description: string; | ||
homepage: string; | ||
repository: { url: string }; | ||
}; | ||
|
||
type StarInfo = { | ||
downloads: string; | ||
package: string; | ||
}; | ||
|
||
export default class PluginsDiscover extends SfCommand<void> { | ||
public static readonly summary = messages.getMessage('summary'); | ||
public static readonly description = messages.getMessage('description'); | ||
public static readonly examples = messages.getMessages('examples'); | ||
|
||
// eslint-disable-next-line class-methods-use-this | ||
public async run(): Promise<void> { | ||
const packages = [ | ||
'@muenzpraeger/sfdx-plugin', | ||
'sfdx-waw-plugin', | ||
'mo-dx-plugin', | ||
'sfdx-hardis', | ||
'sfdx-affirm', | ||
'expereo-sfdx-plugin', | ||
'heat-sfdx-cli', | ||
'bmsfdx', | ||
'shane-sfdx-plugins', | ||
'sfdx-cmdt-plugin', | ||
'etcopydata', | ||
'sfdx-migration-automatic', | ||
'sfdx-devhub-pool', | ||
'@dx-cli-toolbox/sfdx-toolbox-package-utils', | ||
'@dxatscale/sfpowerscripts', | ||
'soqlx-opener', | ||
'sfdx-git-packager', | ||
'texei-sfdx-plugin', | ||
]; | ||
|
||
const npmData = await Promise.all( | ||
packages.map((pkg) => | ||
Promise.all([ | ||
got<NpmInfo>(`https://registry.npmjs.org/${pkg}/latest`).json<NpmInfo>(), | ||
got<StarInfo>(`https://api.npmjs.org/downloads/point/last-week/${pkg}`).json<StarInfo>(), | ||
]) | ||
) | ||
); | ||
|
||
const combined = npmData | ||
.map((y) => ({ ...y[0], ...y[1] })) | ||
.sort((a, b) => (b.downloads > a.downloads ? 1 : -1)) | ||
.map((y) => ({ ...y, description: `${y.description.match(/(.{1,100})(?:\s|$)/g)?.join('\n')}` })); | ||
|
||
this.table(combined, { | ||
name: { header: 'Package' }, | ||
description: { header: 'Description' }, | ||
homepage: { header: 'Homepage' }, | ||
downloads: { header: 'Weekly Downloads' }, | ||
}); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1383,17 +1383,17 @@ | |
"@types/expect" "^1.20.4" | ||
"@types/node" "*" | ||
|
||
"@typescript-eslint/eslint-plugin@^5.59.11": | ||
version "5.59.11" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz#8d466aa21abea4c3f37129997b198d141f09e76f" | ||
integrity sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg== | ||
"@typescript-eslint/eslint-plugin@^5.61.0": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" | ||
integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== | ||
dependencies: | ||
"@eslint-community/regexpp" "^4.4.0" | ||
"@typescript-eslint/scope-manager" "5.59.11" | ||
"@typescript-eslint/type-utils" "5.59.11" | ||
"@typescript-eslint/utils" "5.59.11" | ||
"@typescript-eslint/scope-manager" "5.62.0" | ||
"@typescript-eslint/type-utils" "5.62.0" | ||
"@typescript-eslint/utils" "5.62.0" | ||
debug "^4.3.4" | ||
grapheme-splitter "^1.0.4" | ||
graphemer "^1.4.0" | ||
ignore "^5.2.0" | ||
natural-compare-lite "^1.4.0" | ||
semver "^7.3.7" | ||
|
@@ -1425,13 +1425,21 @@ | |
"@typescript-eslint/types" "5.61.0" | ||
"@typescript-eslint/visitor-keys" "5.61.0" | ||
|
||
"@typescript-eslint/type-utils@5.59.11": | ||
version "5.59.11" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz#5eb67121808a84cb57d65a15f48f5bdda25f2346" | ||
integrity sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g== | ||
"@typescript-eslint/scope-manager@5.62.0": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" | ||
integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== | ||
dependencies: | ||
"@typescript-eslint/typescript-estree" "5.59.11" | ||
"@typescript-eslint/utils" "5.59.11" | ||
"@typescript-eslint/types" "5.62.0" | ||
"@typescript-eslint/visitor-keys" "5.62.0" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz#286f0389c41681376cdad96b309cedd17d70346a" | ||
integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== | ||
dependencies: | ||
"@typescript-eslint/typescript-estree" "5.62.0" | ||
"@typescript-eslint/utils" "5.62.0" | ||
debug "^4.3.4" | ||
tsutils "^3.21.0" | ||
|
||
|
@@ -1445,6 +1453,11 @@ | |
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.61.0.tgz#e99ff11b5792d791554abab0f0370936d8ca50c0" | ||
integrity sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ== | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" | ||
integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "5.59.11" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz#b2caaa31725e17c33970c1197bcd54e3c5f42b9f" | ||
|
@@ -1471,7 +1484,34 @@ | |
semver "^7.3.7" | ||
tsutils "^3.21.0" | ||
|
||
"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^5.59.11": | ||
"@typescript-eslint/[email protected]": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" | ||
integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== | ||
dependencies: | ||
"@typescript-eslint/types" "5.62.0" | ||
"@typescript-eslint/visitor-keys" "5.62.0" | ||
debug "^4.3.4" | ||
globby "^11.1.0" | ||
is-glob "^4.0.3" | ||
semver "^7.3.7" | ||
tsutils "^3.21.0" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" | ||
integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== | ||
dependencies: | ||
"@eslint-community/eslint-utils" "^4.2.0" | ||
"@types/json-schema" "^7.0.9" | ||
"@types/semver" "^7.3.12" | ||
"@typescript-eslint/scope-manager" "5.62.0" | ||
"@typescript-eslint/types" "5.62.0" | ||
"@typescript-eslint/typescript-estree" "5.62.0" | ||
eslint-scope "^5.1.1" | ||
semver "^7.3.7" | ||
|
||
"@typescript-eslint/utils@^5.59.11": | ||
version "5.59.11" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.11.tgz#9dbff49dc80bfdd9289f9f33548f2e8db3c59ba1" | ||
integrity sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg== | ||
|
@@ -1501,6 +1541,14 @@ | |
"@typescript-eslint/types" "5.61.0" | ||
eslint-visitor-keys "^3.3.0" | ||
|
||
"@typescript-eslint/[email protected]": | ||
version "5.62.0" | ||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" | ||
integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== | ||
dependencies: | ||
"@typescript-eslint/types" "5.62.0" | ||
eslint-visitor-keys "^3.3.0" | ||
|
||
"@ungap/[email protected]": | ||
version "1.1.2" | ||
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" | ||
|
@@ -3611,11 +3659,6 @@ graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, | |
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" | ||
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== | ||
|
||
grapheme-splitter@^1.0.4: | ||
version "1.0.4" | ||
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" | ||
integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== | ||
|
||
graphemer@^1.4.0: | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" | ||
|