-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@rocko1204/rocko-sfdx | ||
===================== | ||
|
||
sfdx cli to build awesome package tool | ||
|
||
[](https://npmjs.org/package/@rocko1204/rocko-sfdx) | ||
[](https://circleci.com/gh/github/rocko-sfdx/tree/master) | ||
[](https://ci.appveyor.com/project/heroku/rocko-sfdx/branch/master) | ||
[](https://greenkeeper.io/) | ||
[](https://snyk.io/test/github/github/rocko-sfdx) | ||
[](https://npmjs.org/package/@rocko1204/rocko-sfdx) | ||
[](https://github.com/github/rocko-sfdx/blob/master/package.json) | ||
|
||
<!-- toc --> | ||
<!-- install --> | ||
<!-- usage --> | ||
<!-- commands --> | ||
<!-- debugging-your-plugin --> | ||
# 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: | ||
```sh-session | ||
$ 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: | ||
```sh-session | ||
$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u [email protected] | ||
``` | ||
|
||
2. Set some breakpoints in your command code | ||
3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view. | ||
4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen. | ||
5. 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. | ||
6. 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). | ||
<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br> | ||
Congrats, you are debugging! |
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,5 @@ | ||
#!/usr/bin/env node | ||
|
||
const oclif = require('@oclif/core'); | ||
|
||
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')); |
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,3 @@ | ||
@echo off | ||
|
||
node "%~dp0\run" %* |
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 @@ | ||
{ | ||
"include": ["./**/*.ts"], | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
"module": "commonjs", | ||
"target": "es2020", | ||
"lib": ["es2020"], | ||
"sourceMap": true, | ||
"declaration": true, | ||
"moduleResolution": "node", | ||
"alwaysStrict": true, | ||
"noUnusedLocals": true | ||
} | ||
} |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "lib", | ||
"rootDir": "src", | ||
"module": "commonjs", | ||
"target": "es2020", | ||
"lib": ["es2020"], | ||
"sourceMap": true, | ||
"declaration": true, | ||
"moduleResolution": "node", | ||
"alwaysStrict": true, | ||
"noUnusedLocals": true | ||
}, | ||
"include": ["./src/**/*.ts"] | ||
} |