diff --git a/README.md b/README.md index 9ada9e9e..3c86dc34 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Audit messages in a plugin's messages directory to locate unused messages and mi ``` USAGE - $ sf dev audit messages [--json] [-p ] [-m ] [-s ] + $ sf dev audit messages [--json] [--flags-dir ] [-p ] [-m ] [-s ] FLAGS -m, --messages-dir= [default: messages] Directory that contains the plugin's message files. @@ -133,7 +133,8 @@ FLAGS -s, --source-dir= [default: src] Directory that contains the plugin's source code. GLOBAL FLAGS - --json Format output as json. + --flags-dir= Import flag values from a directory. + --json Format output as json. EXAMPLES Audit messages using default directories: @@ -163,14 +164,15 @@ Convert a .json messages file into Markdown. ``` USAGE - $ sf dev convert messages -f [--json] [-p ] + $ sf dev convert messages -f [--json] [--flags-dir ] [-p ] FLAGS -f, --file-name=... (required) Filename to convert. -p, --project-dir= [default: .] Location of the project whose messages are to be converted. GLOBAL FLAGS - --json Format output as json. + --flags-dir= Import flag values from a directory. + --json Format output as json. DESCRIPTION Convert a .json messages file into Markdown. @@ -197,13 +199,14 @@ Convert a script file that contains deprecated sfdx-style commands to use the ne ``` USAGE - $ sf dev convert script -s [--json] + $ sf dev convert script -s [--json] [--flags-dir ] FLAGS -s, --script= (required) Filepath to the script you want to convert. GLOBAL FLAGS - --json Format output as json. + --flags-dir= Import flag values from a directory. + --json Format output as json. DESCRIPTION Convert a script file that contains deprecated sfdx-style commands to use the new sf-style commands instead. @@ -240,7 +243,7 @@ Generate a new sf command. ``` USAGE - $ sf dev generate command -n [--force] [--nuts] [--unit] + $ sf dev generate command -n [--flags-dir ] [--force] [--nuts] [--unit] FLAGS -n, --name= (required) Name of the new command. Use colons to separate the topic and command names. @@ -248,6 +251,9 @@ FLAGS --[no-]nuts Generate a NUT test file for the command. --[no-]unit Generate a unit test file for the command. +GLOBAL FLAGS + --flags-dir= Import flag values from a directory. + DESCRIPTION Generate a new sf command. @@ -277,11 +283,14 @@ Generate a flag for an existing command. ``` USAGE - $ sf dev generate flag [-d] + $ sf dev generate flag [--flags-dir ] [-d] FLAGS -d, --dry-run Print new flag code instead of adding it to the command file. +GLOBAL FLAGS + --flags-dir= Import flag values from a directory. + DESCRIPTION Generate a flag for an existing command. @@ -314,7 +323,10 @@ Generate a new sf plugin. ``` USAGE - $ sf dev generate plugin + $ sf dev generate plugin [--flags-dir ] + +GLOBAL FLAGS + --flags-dir= Import flag values from a directory. DESCRIPTION Generate a new sf plugin. diff --git a/command-snapshot.json b/command-snapshot.json index 1d1c11a1..3fd7ab3d 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -1,74 +1,74 @@ [ { - "command": "dev:audit:messages", - "plugin": "@salesforce/plugin-dev", - "flags": ["json", "messages-dir", "project-dir", "source-dir"], "alias": [], + "command": "dev:audit:messages", + "flagAliases": ["messagesdir", "projectdir", "sourcedir"], "flagChars": ["m", "p", "s"], - "flagAliases": ["messagesdir", "projectdir", "sourcedir"] + "flags": ["flags-dir", "json", "messages-dir", "project-dir", "source-dir"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:configure:repo", - "plugin": "@salesforce/plugin-dev", - "flags": ["bot", "dry-run", "json", "repository"], "alias": [], + "command": "dev:configure:repo", + "flagAliases": ["dryrun"], "flagChars": ["b", "d", "r"], - "flagAliases": ["dryrun"] + "flags": ["bot", "dry-run", "flags-dir", "json", "repository"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:configure:secrets", - "plugin": "@salesforce/plugin-dev", - "flags": ["dry-run", "json", "repository"], "alias": [], + "command": "dev:configure:secrets", + "flagAliases": ["dryrun"], "flagChars": ["d", "r"], - "flagAliases": ["dryrun"] + "flags": ["dry-run", "flags-dir", "json", "repository"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:convert:messages", - "plugin": "@salesforce/plugin-dev", - "flags": ["file-name", "json", "project-dir"], "alias": [], + "command": "dev:convert:messages", + "flagAliases": ["filename", "projectdir"], "flagChars": ["f", "p"], - "flagAliases": ["filename", "projectdir"] + "flags": ["file-name", "flags-dir", "json", "project-dir"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:convert:script", - "plugin": "@salesforce/plugin-dev", - "flags": ["json", "no-prompt", "script"], "alias": [], + "command": "dev:convert:script", + "flagAliases": [], "flagChars": ["s"], - "flagAliases": [] + "flags": ["flags-dir", "json", "no-prompt", "script"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:generate:command", - "plugin": "@salesforce/plugin-dev", - "flags": ["force", "name", "nuts", "unit"], "alias": [], + "command": "dev:generate:command", + "flagAliases": [], "flagChars": ["n"], - "flagAliases": [] + "flags": ["flags-dir", "force", "name", "nuts", "unit"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:generate:flag", - "plugin": "@salesforce/plugin-dev", - "flags": ["dry-run"], "alias": [], + "command": "dev:generate:flag", + "flagAliases": ["dryrun"], "flagChars": ["d"], - "flagAliases": ["dryrun"] + "flags": ["dry-run", "flags-dir"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:generate:library", - "plugin": "@salesforce/plugin-dev", - "flags": [], "alias": [], + "command": "dev:generate:library", + "flagAliases": [], "flagChars": [], - "flagAliases": [] + "flags": ["flags-dir"], + "plugin": "@salesforce/plugin-dev" }, { - "command": "dev:generate:plugin", - "plugin": "@salesforce/plugin-dev", - "flags": [], "alias": ["plugins:generate"], + "command": "dev:generate:plugin", + "flagAliases": [], "flagChars": [], - "flagAliases": [] + "flags": ["flags-dir"], + "plugin": "@salesforce/plugin-dev" } ] diff --git a/package.json b/package.json index 4d190608..313e849f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@octokit/rest": "^19.0.13", "@salesforce/core": "^6.5.1", "@salesforce/kit": "^3.0.15", - "@salesforce/sf-plugins-core": "^7.1.4", + "@salesforce/sf-plugins-core": "^8.0.1", "@salesforce/ts-types": "^2.0.9", "change-case": "^5.4.2", "fast-glob": "^3.3.2", diff --git a/src/commands/dev/convert/messages.ts b/src/commands/dev/convert/messages.ts index fd3c4bc0..86202d64 100644 --- a/src/commands/dev/convert/messages.ts +++ b/src/commands/dev/convert/messages.ts @@ -11,7 +11,7 @@ import path from 'node:path'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.convert.messages'); export type DevConvertMessagesResult = { diff --git a/src/commands/dev/generate/command.ts b/src/commands/dev/generate/command.ts index 968c5109..faacaedb 100644 --- a/src/commands/dev/generate/command.ts +++ b/src/commands/dev/generate/command.ts @@ -5,12 +5,11 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { Messages } from '@salesforce/core'; import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { fileExists, generate } from '../../../util.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.command'); export default class GenerateCommand extends SfCommand { diff --git a/src/commands/dev/generate/plugin.ts b/src/commands/dev/generate/plugin.ts index 490e9026..7869a702 100644 --- a/src/commands/dev/generate/plugin.ts +++ b/src/commands/dev/generate/plugin.ts @@ -5,12 +5,11 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { Messages } from '@salesforce/core'; import { SfCommand } from '@salesforce/sf-plugins-core'; import { generate } from '../../../util.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.plugin'); export default class GeneratePlugin extends SfCommand { diff --git a/yarn.lock b/yarn.lock index afb14d88..8d0ca901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1103,13 +1103,13 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz#d9fae00a2d5cb40f92cfe64b47ad749fbc38f917" integrity sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw== -"@inquirer/confirm@^2.0.15": - version "2.0.15" - resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.15.tgz#b5512ed190efd8c5b96e0969115756b48546ab36" - integrity sha512-hj8Q/z7sQXsF0DSpLQZVDhWYGN6KLM/gNjjqGkpKwBzljbQofGjn0ueHADy4HUY+OqDHmXuwk/bY+tZyIuuB0w== +"@inquirer/confirm@^2.0.15", "@inquirer/confirm@^2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.17.tgz#a45eb1b973c51c993a3c093a0114e960b1cf09a4" + integrity sha512-EqzhGryzmGpy2aJf6LxJVhndxYmFs+m8cxXzf8nejb1DE3sabf6mUgBcp4J0jAUEiAcYzqmkqRr7LPFh/WdnXA== dependencies: - "@inquirer/core" "^5.1.1" - "@inquirer/type" "^1.1.5" + "@inquirer/core" "^6.0.0" + "@inquirer/type" "^1.1.6" chalk "^4.1.2" "@inquirer/core@^5.1.1": @@ -1132,6 +1132,26 @@ strip-ansi "^6.0.1" wrap-ansi "^6.2.0" +"@inquirer/core@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-6.0.0.tgz#d44ccd8ae09a4879a78f09cca35bf1ab894b95f4" + integrity sha512-fKi63Khkisgda3ohnskNf5uZJj+zXOaBvOllHsOkdsXRA/ubQLJQrZchFFi57NKbZzkTunXiBMdvWOv71alonw== + dependencies: + "@inquirer/type" "^1.1.6" + "@types/mute-stream" "^0.0.4" + "@types/node" "^20.10.7" + "@types/wrap-ansi" "^3.0.0" + ansi-escapes "^4.3.2" + chalk "^4.1.2" + cli-spinners "^2.9.2" + cli-width "^4.1.0" + figures "^3.2.0" + mute-stream "^1.0.0" + run-async "^3.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + "@inquirer/input@^1.2.14": version "1.2.14" resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.14.tgz#8951867618bb5cd16dd096e02404eec225a92207" @@ -1141,13 +1161,13 @@ "@inquirer/type" "^1.1.5" chalk "^4.1.2" -"@inquirer/password@^1.1.14": - version "1.1.14" - resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.14.tgz#c1fc139efe84a38986870a1bcf80718050f82bbf" - integrity sha512-vL2BFxfMo8EvuGuZYlryiyAB3XsgtbxOcFs4H9WI9szAS/VZCAwdVqs8rqEeaAf/GV/eZOghIOYxvD91IsRWSg== +"@inquirer/password@^1.1.16": + version "1.1.16" + resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.16.tgz#37ddebbe37c6e76f8ad27d1f726aacdd7c423558" + integrity sha512-aZYZVHLUXZ2gbBot+i+zOJrks1WaiI95lvZCn1sKfcw6MtSSlYC8uDX8sTzQvAsQ8epHoP84UNvAIT0KVGOGqw== dependencies: - "@inquirer/input" "^1.2.14" - "@inquirer/type" "^1.1.5" + "@inquirer/core" "^6.0.0" + "@inquirer/type" "^1.1.6" ansi-escapes "^4.3.2" chalk "^4.1.2" @@ -1162,10 +1182,10 @@ chalk "^4.1.2" figures "^3.2.0" -"@inquirer/type@^1.1.5": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.1.5.tgz#b8c171f755859c8159b10e41e1e3a88f0ca99d7f" - integrity sha512-wmwHvHozpPo4IZkkNtbYenem/0wnfI6hvOcGKmPEa0DwuaH5XUQzFqy6OpEpjEegZMhYIk8HDYITI16BPLtrRA== +"@inquirer/type@^1.1.5", "@inquirer/type@^1.1.6": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-1.2.1.tgz#fbc7ab3a2e5050d0c150642d5e8f5e88faa066b8" + integrity sha512-xwMfkPAxeo8Ji/IxfUSqzRi0/+F2GIqJmpc5/thelgMGsjNZcjDDRBO9TLXT1s/hdx/mK5QbVIvgoLIFgXhTMQ== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -1469,10 +1489,10 @@ read-package-json-fast "^3.0.0" which "^3.0.0" -"@oclif/core@^3.15.1", "@oclif/core@^3.16.0", "@oclif/core@^3.18.1", "@oclif/core@^3.19.2", "@oclif/core@^3.19.3", "@oclif/core@^3.20.0": - version "3.20.0" - resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.20.0.tgz#534458dc6e8c46d8f03906aaadaca079e16a6554" - integrity sha512-8BajhglY8frYGAS1whAukeouFZUN9MgQoLfNXtScPVEAjPlaD2BbSIAYQH2yF2qb/iVvbj/1DwYS3gqicYOq1A== +"@oclif/core@^3.15.1", "@oclif/core@^3.16.0", "@oclif/core@^3.18.1", "@oclif/core@^3.19.2", "@oclif/core@^3.19.3", "@oclif/core@^3.20.0", "@oclif/core@^3.23.0": + version "3.26.0" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.26.0.tgz#959d5e9f13f4ad6a4e98235ad125189df9ee4279" + integrity sha512-TpMdfD4tfA2tVVbd4l0PrP02o5KoUXYmudBbTC7CeguDo/GLoprw4uL8cMsaVA26+cbcy7WYtOEydQiHVtJixA== dependencies: "@types/cli-progress" "^3.11.5" ansi-escapes "^4.3.2" @@ -1490,6 +1510,7 @@ indent-string "^4.0.0" is-wsl "^2.2.0" js-yaml "^3.14.1" + minimatch "^9.0.3" natural-orderby "^2.0.3" object-treeify "^1.1.33" password-prompt "^1.1.3" @@ -1773,10 +1794,10 @@ strip-ansi "6.0.1" ts-retry-promise "^0.8.0" -"@salesforce/core@^6.4.0", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.7", "@salesforce/core@^6.5.0", "@salesforce/core@^6.5.1", "@salesforce/core@^6.7.0": - version "6.7.0" - resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.7.0.tgz#f838f5704aa2f14296fd85691c9bcd8da33dca5d" - integrity sha512-KIyoSdQJVwtReSpXfpFZ4D4BXHFh5xcmvY6UJjzxB3H7CqUtC/20ldal/jCD8JEy/jObfG7GyxZmZYZYF88JCw== +"@salesforce/core@^6.4.0", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.7", "@salesforce/core@^6.5.1", "@salesforce/core@^6.7.0", "@salesforce/core@^6.7.3": + version "6.7.3" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.7.3.tgz#5d8f30c40ac3cebb898c8e845fe9a067bc729268" + integrity sha512-uU+PuZZGXxByhvnXLH1V3eY5P1caw401dIZ/QvhzYxoP/alPLk7dpChnZNJYH5Rw3dc/AhSPw+eg0cvUyjhP1Q== dependencies: "@salesforce/kit" "^3.0.15" "@salesforce/schemas" "^1.6.1" @@ -1879,15 +1900,15 @@ chalk "^4" inquirer "^8.2.5" -"@salesforce/sf-plugins-core@^7.1.4": - version "7.1.4" - resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-7.1.4.tgz#0aca0e243b9880269c3e2712ca14982eb8515f1e" - integrity sha512-aFV4FhUEz/oyn7JzsoutQp7SBs0Ac07m5uWYI+ngYlhJdd/AC/0IpMqd/BOIBmLzAqos+y6bKR6OqBEqQDaxlw== +"@salesforce/sf-plugins-core@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-8.0.1.tgz#f155cddfd7695aab0d8264848b634b2a91cdbf2c" + integrity sha512-R6SqJ1XqSINSWdZruKtC2SKGnLBh7KbFI7+qS0FYlyPU4IlWoa+AZkGwWvlczuSOumqnlhT95rNKwZTS5rJugA== dependencies: - "@inquirer/confirm" "^2.0.15" - "@inquirer/password" "^1.1.14" - "@oclif/core" "^3.18.1" - "@salesforce/core" "^6.5.0" + "@inquirer/confirm" "^2.0.17" + "@inquirer/password" "^1.1.16" + "@oclif/core" "^3.23.0" + "@salesforce/core" "^6.7.3" "@salesforce/kit" "^3.0.15" "@salesforce/ts-types" "^2.0.9" chalk "^5.3.0" @@ -2633,10 +2654,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@^20.9.0": - version "20.10.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.6.tgz#a3ec84c22965802bf763da55b2394424f22bfbb5" - integrity sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw== +"@types/node@*", "@types/node@^20.10.7", "@types/node@^20.9.0": + version "20.11.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f" + integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== dependencies: undici-types "~5.26.4" @@ -2674,12 +2695,7 @@ dependencies: "@types/node" "*" -"@types/semver@^7.5.0": - version "7.5.6" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" - integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== - -"@types/semver@^7.5.8": +"@types/semver@^7.5.0", "@types/semver@^7.5.8": version "7.5.8" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== @@ -3600,7 +3616,7 @@ cli-progress@^3.12.0: dependencies: string-width "^4.2.3" -cli-spinners@^2.5.0, cli-spinners@^2.9.1: +cli-spinners@^2.5.0, cli-spinners@^2.9.1, cli-spinners@^2.9.2: version "2.9.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==