diff --git a/README.md b/README.md index d415333f..ea3bc176 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Because this plugin is not signed, you will get a warning saying that "This plug If you run your CI/CD jobs inside a Docker image, you can add the plugin to your image. Here is an example of a Dockerfile including the SGD plugin: https://github.com/mehdisfdc/sfdx-cli-gitlab -⚠️ The Salesforce CLI plugin is now the only supported way to install SGD. There used to be another way to install it directly through yarn or npm. The legacy `sgd` command is now deprecated and will be decommissioned soon. +⚠️ The Salesforce CLI plugin is now the only supported way to install SGD. There used to be another way to install it directly through yarn or npm. The legacy `sgd` command is now deprecated and decommissioned. ### Prerequisites @@ -393,7 +393,6 @@ console.log(JSON.stringify(work)) ## Built With -- [commander](https://github.com/tj/commander.js/) - The complete solution for node.js command-line interfaces, inspired by Ruby's commander. - [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) - Validate XML, Parse XML to JS/JSON and vise versa, or parse XML to Nimn rapidly without C/C++ based libraries and no callback - [fs-extra](https://github.com/jprichardson/node-fs-extra) - Node.js: extra methods for the fs object like copy(), remove(), mkdirs(). - [ignore](https://github.com/kaelzhang/node-ignore#readme) - is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore spec 2.22.1. diff --git a/__tests__/integration/cli.test.js b/__tests__/integration/cli.test.js deleted file mode 100644 index f731f746..00000000 --- a/__tests__/integration/cli.test.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -const path = require('path') -const cp = require('child_process') -const gc = require('../../src/utils/gitConstants') - -const cli = (args, cwd) => { - return cp.execSync(`node ${path.normalize('./bin/cli')} ${args.join(' ')}`, { - cwd, - encoding: gc.UTF8_ENCODING, - }) -} - -test('cli-help', () => { - const result = cli(['-h'], '.') - expect(result).toBeDefined() -}) diff --git a/bin/cli b/bin/cli deleted file mode 100644 index afb4da59..00000000 --- a/bin/cli +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env node -'use strict' - -const program = require('commander') -const orchestrator = require('../lib/main') -const messages = require('../messages/delta') -const pjson = require('../package.json') -const CliHelper = require('../lib/utils/cliHelper') - -const options = program - .description(messages.command) - .version(pjson.version) - .option('-t, --to [sha]', messages.toFlag, CliHelper.TO_DEFAULT_VALUE) - .option('-f, --from [sha]', messages.fromFlag) - .option( - '-o, --output [dir]', - messages.outputFlag, - CliHelper.OUTPUT_DEFAULT_VALUE - ) - .option( - '-s, --source [dir]', - messages.sourceFlag, - CliHelper.SOURCE_DEFAULT_VALUE - ) - .option('-W, --ignore-whitespace', messages.ignoreWhitespaceFlag) - .option('-i, --ignore [file]', messages.ignoreFlag) - .option('-D, --ignore-destructive [file]', messages.ignoreDestructiveFlag) - .option( - '-a, --api-version [version]', - messages.apiVersionFlag, - pjson.sfdc.latestApiVersion - ) - .option('-r, --repo [dir]', messages.repoFlag, CliHelper.REPO_DEFAULT_VALUE) - .option('-d, --generate-delta', messages.deltaFlag) - .option('-n, --include', messages.includeFlag) - .option('-N, --include-destructive', messages.includeDestructiveFlag) - .parse(process.argv) - .opts() - -options.ignore = - options.ignore === true ? CliHelper.IGNORE_DEFAULT_VALUE : options.ignore - -const output = { - error: null, - output: options.output, - success: true, - warnings: [], -} -;(async () => { - try { - const jobResult = await orchestrator(options) - output.warnings = jobResult?.warnings?.map(warning => warning.message) - } catch (err) { - output.success = false - output.error = err.message - process.exitCode = 1 - } - console.log(JSON.stringify(output, null, 2)) -})() diff --git a/package.json b/package.json index fc98974b..fe1c64c2 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,6 @@ "/oclif.manifest.json" ], "main": "lib/main.js", - "bin": { - "sgd": "./bin/cli" - }, "repository": { "type": "git", "url": "git+https://github.com/scolladon/sfdx-git-delta.git" @@ -34,7 +31,6 @@ "@oclif/errors": "^1.3.5", "@salesforce/command": "^4.1.3", "@salesforce/core": "^2.28.1", - "commander": "^8.2.0", "fast-xml-parser": "^4", "fs-extra": "^10.0.0", "ignore": "^5.1.8", diff --git a/yarn.lock b/yarn.lock index 003936ce..a7ca36cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2199,7 +2199,7 @@ commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^8.2.0, commander@^8.3.0: +commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==