Skip to content

Commit

Permalink
Move toolbelt/source:open to plugin-source (#99)
Browse files Browse the repository at this point in the history
* chore: cmd skeleton

* feat: return flexipage app builder url

* chore: type declare fx

* chore: deprecate require

* chore: use previously saved var

* chore: clean types export

* chore: add tests for getTypeDefinitionByFileName

* chore: update command-snapshot.json

* chore: use 'open' lib to open urls + fix frontdoor url

* chore: add command test

* chore: remove dependency on SfdxProject.resolveProjectPathSync

* chore: add NUT test

* chore: fix output message

* chore: return correct type

* chore: better type on json collection

* chore: use sdr to get file metadata type

* chore: stub getTypeDefinitionByFileName

* chore: clean command options and messages

* chore: clean unused vars

* chore: remove unused

* chore: no upgrade sdr

* chore: clean run method

* chore: deprecated check

* chore: remove unused stub

* chore: get frontdoor from AuthInfo

* chore: remove unused

* chore: stub for getOrgFrontDoorUrl

* chore: remove unwanted print

* chore: use getTypeBySuffix from RegistryAccess

* chore: fix suffix extraction

* chore: just stub fs calls

* chore: move restore

* chore: better stub

* chore: use MetadataResolver to resolve file type

* chore: test upgrade + merge

* chore: use checkLightningDomain from sfdx-core

* chore: remove unused

* chore: use checkLightningDomain from sfdx-core

* chore: make stubs compatible + code cleanup

* chore: restore test

* chore: upgrade core

* chore: bump command version

* chore: bump deps

* chore: restore files

* fix: extend from sourceCommand

Co-authored-by: Steve Hetzel <[email protected]>
  • Loading branch information
maggiben and shetzel authored Jul 30, 2021
1 parent 76a4be4 commit 11bb901
Show file tree
Hide file tree
Showing 10 changed files with 477 additions and 30 deletions.
28 changes: 10 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,53 @@ All notable changes to this project will be documented in this file. See [standa

### [1.0.3](https://github.com/salesforcecli/plugin-source/compare/v1.0.2...v1.0.3) (2021-07-28)


### Bug Fixes

* deploy:report now respects the wait flag ([#153](https://github.com/salesforcecli/plugin-source/issues/153)) ([c194f7c](https://github.com/salesforcecli/plugin-source/commit/c194f7c6907074fef8ac2b4e450c511966b83f5f))
- deploy:report now respects the wait flag ([#153](https://github.com/salesforcecli/plugin-source/issues/153)) ([c194f7c](https://github.com/salesforcecli/plugin-source/commit/c194f7c6907074fef8ac2b4e450c511966b83f5f))

### [1.0.2](https://github.com/salesforcecli/plugin-source/compare/v1.0.1...v1.0.2) (2021-07-26)


### Bug Fixes

* throw deploy error when missing required params ([#150](https://github.com/salesforcecli/plugin-source/issues/150)) ([234c596](https://github.com/salesforcecli/plugin-source/commit/234c5968b31dc620dcdb318dccbcc1dcc1e11fde))
- throw deploy error when missing required params ([#150](https://github.com/salesforcecli/plugin-source/issues/150)) ([234c596](https://github.com/salesforcecli/plugin-source/commit/234c5968b31dc620dcdb318dccbcc1dcc1e11fde))

### [1.0.1](https://github.com/salesforcecli/plugin-source/compare/v1.0.0...v1.0.1) (2021-07-26)


### Bug Fixes

* minor package fixes ([#152](https://github.com/salesforcecli/plugin-source/issues/152)) ([5aa593d](https://github.com/salesforcecli/plugin-source/commit/5aa593d2e20297c1b928b828679de9c3ea4809e6))
- minor package fixes ([#152](https://github.com/salesforcecli/plugin-source/issues/152)) ([5aa593d](https://github.com/salesforcecli/plugin-source/commit/5aa593d2e20297c1b928b828679de9c3ea4809e6))

## [1.0.0](https://github.com/salesforcecli/plugin-source/compare/v0.1.22...v1.0.0) (2021-07-22)


### Bug Fixes

* deploy errors are reported properly ([#146](https://github.com/salesforcecli/plugin-source/issues/146)) ([08fbbdd](https://github.com/salesforcecli/plugin-source/commit/08fbbdd2c919b1000fcdb253d9d63babf643ded1))
* retrieve package names output ([#149](https://github.com/salesforcecli/plugin-source/issues/149)) ([7350488](https://github.com/salesforcecli/plugin-source/commit/7350488f2ac7e7d0fa1c0ffef58c7b60d74fb423))
* set sourceApiVersion on the ComponentSet ([#147](https://github.com/salesforcecli/plugin-source/issues/147)) ([46c15ba](https://github.com/salesforcecli/plugin-source/commit/46c15ba5d5f783a09002c81870a155d0691fd162))
- deploy errors are reported properly ([#146](https://github.com/salesforcecli/plugin-source/issues/146)) ([08fbbdd](https://github.com/salesforcecli/plugin-source/commit/08fbbdd2c919b1000fcdb253d9d63babf643ded1))
- retrieve package names output ([#149](https://github.com/salesforcecli/plugin-source/issues/149)) ([7350488](https://github.com/salesforcecli/plugin-source/commit/7350488f2ac7e7d0fa1c0ffef58c7b60d74fb423))
- set sourceApiVersion on the ComponentSet ([#147](https://github.com/salesforcecli/plugin-source/issues/147)) ([46c15ba](https://github.com/salesforcecli/plugin-source/commit/46c15ba5d5f783a09002c81870a155d0691fd162))

### [0.1.22](https://github.com/salesforcecli/plugin-source/compare/v0.1.21...v0.1.22) (2021-06-28)


### Bug Fixes

* display retrieve warnings ([#121](https://github.com/salesforcecli/plugin-source/issues/121)) ([a2330ed](https://github.com/salesforcecli/plugin-source/commit/a2330edb51408a91169608a5d518423dd919231b))
- display retrieve warnings ([#121](https://github.com/salesforcecli/plugin-source/issues/121)) ([a2330ed](https://github.com/salesforcecli/plugin-source/commit/a2330edb51408a91169608a5d518423dd919231b))

### [0.1.21](https://github.com/salesforcecli/plugin-source/compare/v0.1.20...v0.1.21) (2021-06-24)


### Bug Fixes

* postretrieve hook payload is now the file responses ([#120](https://github.com/salesforcecli/plugin-source/issues/120)) ([a505389](https://github.com/salesforcecli/plugin-source/commit/a50538905a9bb02192c9803fec49000baf6a588f))
- postretrieve hook payload is now the file responses ([#120](https://github.com/salesforcecli/plugin-source/issues/120)) ([a505389](https://github.com/salesforcecli/plugin-source/commit/a50538905a9bb02192c9803fec49000baf6a588f))

### [0.1.20](https://github.com/salesforcecli/plugin-source/compare/v0.1.19...v0.1.20) (2021-06-17)


### Bug Fixes

* temporary polling fix ([#114](https://github.com/salesforcecli/plugin-source/issues/114)) ([6c6a3ab](https://github.com/salesforcecli/plugin-source/commit/6c6a3ab6b1a4e36efa974627bc944e37e875c3d6))
- temporary polling fix ([#114](https://github.com/salesforcecli/plugin-source/issues/114)) ([6c6a3ab](https://github.com/salesforcecli/plugin-source/commit/6c6a3ab6b1a4e36efa974627bc944e37e875c3d6))

### [0.1.19](https://github.com/salesforcecli/plugin-source/compare/v0.0.19...v0.1.19) (2021-06-12)


### Features

* add support for async deploys ([#89](https://github.com/salesforcecli/plugin-source/issues/89)) ([e7d7215](https://github.com/salesforcecli/plugin-source/commit/e7d721561542baab8abcf6a8d482e7bb9653176a)), closes [#108](https://github.com/salesforcecli/plugin-source/issues/108) [#84](https://github.com/salesforcecli/plugin-source/issues/84) [#85](https://github.com/salesforcecli/plugin-source/issues/85) [#88](https://github.com/salesforcecli/plugin-source/issues/88) [#80](https://github.com/salesforcecli/plugin-source/issues/80) [#90](https://github.com/salesforcecli/plugin-source/issues/90) [#105](https://github.com/salesforcecli/plugin-source/issues/105) [#106](https://github.com/salesforcecli/plugin-source/issues/106)
- add support for async deploys ([#89](https://github.com/salesforcecli/plugin-source/issues/89)) ([e7d7215](https://github.com/salesforcecli/plugin-source/commit/e7d721561542baab8abcf6a8d482e7bb9653176a)), closes [#108](https://github.com/salesforcecli/plugin-source/issues/108) [#84](https://github.com/salesforcecli/plugin-source/issues/84) [#85](https://github.com/salesforcecli/plugin-source/issues/85) [#88](https://github.com/salesforcecli/plugin-source/issues/88) [#80](https://github.com/salesforcecli/plugin-source/issues/80) [#90](https://github.com/salesforcecli/plugin-source/issues/90) [#105](https://github.com/salesforcecli/plugin-source/issues/105) [#106](https://github.com/salesforcecli/plugin-source/issues/106)

### [0.0.19](https://github.com/salesforcecli/plugin-source/compare/v0.0.18...v0.0.19) (2021-06-10)

Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ sfdx plugins
# Usage

<!-- usage -->

```sh-session
$ npm install -g @salesforce/plugin-source
$ sfdx COMMAND
Expand All @@ -86,16 +87,18 @@ USAGE
$ sfdx COMMAND
...
```

<!-- usagestop -->

# Commands

<!-- commands -->
* [`sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [-p <array> | -x <string> | -m <array>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceconvert--r-directory--d-directory--n-string--p-array---x-string---m-array---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
* [`sfdx force:source:deploy [--soapdeploy] [-w <minutes>] [-q <id> | -x <filepath> | -m <array> | -p <array> | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g] [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
* [`sfdx force:source:deploy:cancel [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploycancel--w-minutes--i-id--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
* [`sfdx force:source:deploy:report [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeployreport--w-minutes--i-id--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
* [`sfdx force:source:retrieve [-p <array> | -x <filepath> | -m <array>] [-w <minutes>] [-n <array>] [-u <string>] [-a <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceretrieve--p-array---x-filepath---m-array--w-minutes--n-array--u-string--a-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

- [`sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [-p <array> | -x <string> | -m <array>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceconvert--r-directory--d-directory--n-string--p-array---x-string---m-array---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
- [`sfdx force:source:deploy [--soapdeploy] [-w <minutes>] [-q <id> | -x <filepath> | -m <array> | -p <array> | -c | -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g] [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploy---soapdeploy--w-minutes--q-id---x-filepath---m-array---p-array---c---l-notestrunrunspecifiedtestsrunlocaltestsrunalltestsinorg---r-array---o---g--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
- [`sfdx force:source:deploy:cancel [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeploycancel--w-minutes--i-id--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
- [`sfdx force:source:deploy:report [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourcedeployreport--w-minutes--i-id--u-string---apiversion-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
- [`sfdx force:source:retrieve [-p <array> | -x <filepath> | -m <array>] [-w <minutes>] [-n <array>] [-u <string>] [-a <string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-forcesourceretrieve--p-array---x-filepath---m-array--w-minutes--n-array--u-string--a-string---verbose---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)

## `sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [-p <array> | -x <string> | -m <array>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`

Expand All @@ -105,7 +108,7 @@ convert source into Metadata API format
convert source into Metadata API format
USAGE
$ sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [-p <array> | -x <string> | -m <array>]
$ sfdx force:source:convert [-r <directory>] [-d <directory>] [-n <string>] [-p <array> | -x <string> | -m <array>]
[--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -148,8 +151,8 @@ deploy source to an org
deploy source to an org
USAGE
$ sfdx force:source:deploy [--soapdeploy] [-w <minutes>] [-q <id> | -x <filepath> | -m <array> | -p <array> | -c | -l
NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g] [-u <string>] [--apiversion
$ sfdx force:source:deploy [--soapdeploy] [-w <minutes>] [-q <id> | -x <filepath> | -m <array> | -p <array> | -c | -l
NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg | -r <array> | -o | -g] [-u <string>] [--apiversion
<string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -223,7 +226,7 @@ cancel a source deployment
cancel a source deployment
USAGE
$ sfdx force:source:deploy:cancel [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
$ sfdx force:source:deploy:cancel [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -261,7 +264,7 @@ check the status of a metadata deployment
check the status of a metadata deployment
USAGE
$ sfdx force:source:deploy:report [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--verbose] [--json]
$ sfdx force:source:deploy:report [-w <minutes>] [-i <id>] [-u <string>] [--apiversion <string>] [--verbose] [--json]
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down Expand Up @@ -306,7 +309,7 @@ retrieve source from an org
retrieve source from an org
USAGE
$ sfdx force:source:retrieve [-p <array> | -x <filepath> | -m <array>] [-w <minutes>] [-n <array>] [-u <string>] [-a
$ sfdx force:source:retrieve [-p <array> | -x <filepath> | -m <array>] [-w <minutes>] [-n <array>] [-u <string>] [-a
<string>] [--verbose] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
OPTIONS
Expand Down
5 changes: 5 additions & 0 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"plugin": "@salesforce/plugin-source",
"flags": ["apiversion", "jobid", "json", "loglevel", "targetusername", "wait", "verbose"]
},
{
"command": "force:source:open",
"plugin": "@salesforce/plugin-source",
"flags": ["apiversion", "json", "loglevel", "sourcefile", "targetusername", "urlonly"]
},
{
"command": "force:source:retrieve",
"plugin": "@salesforce/plugin-source",
Expand Down
17 changes: 17 additions & 0 deletions messages/open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"description": "edit a Lightning Page with Lightning App Builder\nOpens the specified Lightning Page in Lightning App Builder. Lightning Page files have the suffix .flexipage-meta.xml, and are stored in the flexipages directory. If you specify a different type of file, this command opens your org’s home page.",
"examples": [
"$ sfdx force:source:open -f path/to/source",
"$ sfdx force:source:open -r -f path/to/source",
"$ sfdx force:source:open -f path/to/source -u [email protected]"
],
"flags": {
"sourcefile": "(required) file to edit",
"urlonly": "generate a navigation URL; don’t launch the editor"
},
"SourceOpenFileDescription": "file to edit",
"SourceOpenPathDescription": "generate a navigation URL; don’t launch the editor",
"SourceOpenCommandHumanSuccess": "Access org %s as user %s with the following URL: %s",
"SourceOpenCommandTimeoutError": "Timeout error",
"SourceOpenCommandError": "Open failed"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@salesforce/source-deploy-retrieve": "^4.0.1",
"chalk": "^4.1.1",
"cli-ux": "^5.6.3",
"open": "^8.2.1",
"tslib": "^2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 11bb901

Please sign in to comment.