Open
Description
Context:
Possibility to include docs with information of how to configure VSCode shortcuts
(and possibly other editors) to easier the publishing of sources
and actions
built with javascript
and typescript
.
Additionally, somebody with windows environment could work on a version of the snippet for windows.
The following steps shows how it can be configured:
- Installed on VSCODE the extension:
terminal-command-keys
- Using
cmd+shift+p
look forOpen keyboard shortcuts (JSON)
- Replace your shortcut’s array with the array on the snippet below (or copy its inner items to the current array)
- You will be able to publish your actions and sources (currently focused file) by pressing
cmd+r
Snippet for MAC
[
{
"key": "cmd+r",
"command": "terminalCommandKeys.run",
"args": {
"cmd": "/usr/bin/env cd ${fileWorkspaceFolder} && pd publish ${relativeFile}",
"match": ".*"
},
"when": "resourcePath =~ /actions/ && resourceLangId == javascript"
},
{
"key": "cmd+r",
"command": "terminalCommandKeys.run",
"args": {
"cmd": "/usr/bin/env cd ${fileWorkspaceFolder} && pd dev ${relativeFile}",
"match": ".*"
},
"when": "resourcePath =~ /sources/ && resourceLangId == javascript"
},
{
"key": "cmd+r",
"command": "terminalCommandKeys.run",
"args": {
"cmd": "/usr/bin/env cd ${fileWorkspaceFolder} && npm run build && currentFile=${relativeFile} && compiledFile=${${currentFile//\\/actions\\//\/dist\\/actions\\/}//.ts/.mjs} && while [ ! -f $compiledFile ]; do sleep 1; done && pd publish $compiledFile",
"match": ".*"
},
"when": "resourcePath =~ /actions/ && resourceLangId == typescript"
},
{
"key": "cmd+r",
"command": "terminalCommandKeys.run",
"args": {
"cmd": "/usr/bin/env cd ${fileWorkspaceFolder} && npm run build && currentFile=${relativeFile} && compiledFile=${${currentFile//\\/sources\\//\/dist\\/sources\\/}//.ts/.mjs} && while [ ! -f $compiledFile ]; do sleep 1; done && pd dev $compiledFile",
"match": ".*"
},
"when": "resourcePath =~ /sources/ && resourceLangId == typescript"
},
]