npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sfdt

v0.0.4

Published

Salesforce devops tools

Downloads

42

Readme

NPM npm (tag)

sfdt

salesforce package utils - for working with unlocked packages

install

  sfdx plugins:install sfdt

Setup

  yarn build

  yarn prepack

  sfdx plugins link

Examples

  sfdx sfdt:up:info -v devhub -n sf-core -m 1.1.0.1 -b

  sfdx sfdt:release:report -v devhub -u sandbox1 --releaseplan ./examples/releasePlan.json

  sfdx sfdt:scratchorg:create -v devhub --email --numberofdays 1 --orgalias test1 -c ./examples/project-scratch-def.json --adminemail [email protected] --json

  sfdx sfdt:project:info -v devhub -u sandbox1

  sfdx sfdt:up:version:latest -v devhub -n sf-sales -s
$ npm install -g sfdt
$ sfdx COMMAND
running command...
$ sfdx (--version)
sfdt/0.0.3 linux-x64 node-v16.19.0
$ sfdx --help [COMMAND]
USAGE
  $ sfdx COMMAND
...

sfdx sfdt:project:info [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Allows you to check / fetch info about the packages in a project and what version info is in the target org

USAGE
  $ sfdx sfdt:project:info [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -u, --targetusername=<value>                                                      username or alias for the target
                                                                                    org; overrides default target org
  -v, --targetdevhubusername=<value>                                                username or alias for the dev hub
                                                                                    org; overrides default dev hub org
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Allows you to check / fetch info about the packages in a project and what version info is in the target org

EXAMPLES
  sfdt:project:info --targetdevhubusername [email protected] --targetusername QA1

See code: src/commands/sfdt/project/info.ts

sfdx sfdt:release:report [-r <string>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Generate some report info from a releasePlan.json definition. If you supply targetusername, the report checks if the release packages are installed in the target org

USAGE
  $ sfdx sfdt:release:report [-r <string>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -r, --releaseplan=<value>                                                         The location of a valid
                                                                                    releasePlan.json (see example for
                                                                                    format). It not supplied, it looks
                                                                                    for it in the running directory
  -u, --targetusername=<value>                                                      username or alias for the target
                                                                                    org; overrides default target org
  -v, --targetdevhubusername=<value>                                                username or alias for the dev hub
                                                                                    org; overrides default dev hub org
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Generate some report info from a releasePlan.json definition. If you supply targetusername, the report checks if the
  release packages are installed in the target org

EXAMPLES
  sfdt:release:report --targetdevhubusername PROD --targetusername QA1

  sfdt:release:report --targetdevhubusername PROD --releaseplan ../releasePlan.json

See code: src/commands/sfdt/release/report.ts

sfdx sfdt:scratchorg:create [-e] [-x <string>] [-d <number>] [-a <string>] [-c <string>] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Create new scratch org, assigning admin email and issuing login and email with developer credentials

USAGE
  $ sfdx sfdt:scratchorg:create [-e] [-x <string>] [-d <number>] [-a <string>] [-c <string>] [-v <string>] [-u <string>]
    [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -a, --orgalias=<value>                                                            Usful if running locally - the org
                                                                                    alias
  -c, --configpath=<value>                                                          Scratch Org Definition file Path -
                                                                                    defaults to ./config/scratch-org-con
                                                                                    fig/project-scratch-def.json
  -d, --numberofdays=<value>                                                        number of days to keep the org
                                                                                    (defaults to 5)
  -e, --email                                                                       Issue an Email with new org info to
                                                                                    the adminemail user
  -u, --targetusername=<value>                                                      username or alias for the target
                                                                                    org; overrides default target org
  -v, --targetdevhubusername=<value>                                                username or alias for the dev hub
                                                                                    org; overrides default dev hub org
  -x, --adminemail=<value>                                                          Email address to set as admin -
                                                                                    otherwise derived from the devHub
                                                                                    user email
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Create new scratch org, assigning admin email and issuing login and email with developer credentials

EXAMPLES
  sfdt:scratchorg:create --targetdevhubusername [email protected]

  sfdt:scratchorg:create --targetdevhubusername [email protected] --email --numberofdays 1 --orgalias so1 --configpath=./config/project-scratch-def.json

  sfdt:scratchorg:create --targetdevhubusername [email protected] --email --adminemail [email protected] --numberofdays 1 --orgalias so1 --configpath=./config/project-scratch-def.json

See code: src/commands/sfdt/scratchorg/create.ts

sfdx sfdt:up:info [-n <string>] [-m <string>] [-b] [-o] [-i <string>] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Get the unlocked package info but id, version or the list of beta versions

USAGE
  $ sfdx sfdt:up:info [-n <string>] [-m <string>] [-b] [-o] [-i <string>] [-v <string>] [--apiversion <string>]
    [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -b, --allbetas                                                                    based on symantic versioing, when
                                                                                    supplied all beta versions will be
                                                                                    returned for the supplied version -
                                                                                    e.g. 1.1.0.1,1.1.0.2,1.1.0.2
  -i, --versionid=<value>                                                           package version id 04t....
  -m, --versionnumber=<value>                                                       pacakge version number e.g. 1.1.1.1
  -n, --name=<value>                                                                name of the package
  -o, --orgdeps                                                                     show the dev hub dependency versions
  -v, --targetdevhubusername=<value>                                                username or alias for the dev hub
                                                                                    org; overrides default dev hub org
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Get the unlocked package info but id, version or the list of beta versions

EXAMPLES
  sfdt:up:info --name my-core-pkg --targetdevhubusername [email protected] --versionnumber 1.28.0.1

  sfdt:up:info --name my-core-pkg --targetdevhubusername [email protected] -m 1.28.0.1 -o

  sfdt:up:info --name my-core-pkg --targetdevhubusername [email protected] --versionId 04txxxxxxxxxxx

  sfdt:up:info --name my-core-pkg --targetdevhubusername [email protected] -m 1.28.0.1 -b

See code: src/commands/sfdt/up/info.ts

sfdx sfdt:up:installed [-e -n <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Table view of installed packages in an org. Can be filtered by supplied name

USAGE
  $ sfdx sfdt:up:installed [-e -n <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --exactmatch                                                                  exactly match the mame supplied
  -n, --name=<value>                                                                name (or partial name) to filter
                                                                                    resulsts by
  -u, --targetusername=<value>                                                      username or alias for the target
                                                                                    org; overrides default target org
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Table view of installed packages in an org. Can be filtered by supplied name

EXAMPLES
  sfdt:up:installed --targetusername [email protected]

  sfdt:up:installed --name sf-core --targetusername [email protected]

  sfdt:up:installed --name sf-core --exactmatch --targetusername [email protected]

See code: src/commands/sfdt/up/installed.ts

sfdx sfdt:up:version:latest -n <string> [-r] [-s] [-v <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

Get the latest unlocked package version info

USAGE
  $ sfdx sfdt:up:version:latest -n <string> [-r] [-s] [-v <string>] [--apiversion <string>] [--json] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -n, --name=<value>                                                                (required) Name of the package
  -r, --released                                                                    Filter and show Promoted/Relased
                                                                                    packaged only
  -s, --showversions                                                                Verbosly shows the package versions
                                                                                    in order retrieved
  -v, --targetdevhubusername=<value>                                                username or alias for the dev hub
                                                                                    org; overrides default dev hub org
  --apiversion=<value>                                                              override the api version used for
                                                                                    api requests made by this command
  --json                                                                            format output as json
  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

DESCRIPTION
  Get the latest unlocked package version info

EXAMPLES
  sfdt:up:version:latest --name sf-core --targetdevhubusername [email protected]

  sfdt:up:version:latest --name sf-core --targetdevhubusername [email protected]

  sfdt:up:version:latest --name sf-core --targetdevhubusername [email protected] --showversions

See code: src/commands/sfdt/up/version/latest.ts

Debugging your plugin

We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the .vscode directory of this plugin is a launch.json config file, which allows you to attach a debugger to the node process when running your commands.

To debug the hello:org command:

  1. Start the inspector

If you linked your plugin to the sfdx cli, call your command with the dev-suspend switch:

$ sfdx hello:org -u [email protected] --dev-suspend

Alternatively, to call your command using the bin/run script, set the NODE_OPTIONS environment variable to --inspect-brk when starting the debugger:

$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u [email protected]
  1. Set some breakpoints in your command code
  2. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
  3. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
  4. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
  5. Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). Congrats, you are debugging!