Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML Debugger V2 #917

Open
9 tasks
xCodeMuse opened this issue Jan 10, 2024 · 0 comments · May be fixed by #916
Open
9 tasks

YAML Debugger V2 #917

xCodeMuse opened this issue Jan 10, 2024 · 0 comments · May be fixed by #916
Assignees
Labels
feature new feature P2 Low priority

Comments

@xCodeMuse
Copy link
Contributor

xCodeMuse commented Jan 10, 2024

Currently we have no debugger for v2.

NOTE

SWRC creates the sourcemap for js/ts but javascript files currently can only be debugged from DIST folder, TS and yaml files can be debugged from src folder

The solution

  • Allow debugging for yaml ts/js workflows within the source folder.
  • Allow debugging for js ts plugins in plugin folder
  • Allow debugging for datasources
  • Allow debugging for eventsources

Developer will need to set **GS_TRANSPILE** to _**true**_ in ENV variable
Enabling the transpiling will allow the developer to debug in visual studio

---- For a new project ----
Developer should work by default because .env have GS_TRANSPILE set to true by create cli refer #907

---- For Debugger setup in existing project ----

  • To make sourcemap of ts workflows update gs project template .swcrc file and add a line "sourceMaps": true for debugging typescript files

  • Make an env file and set GS_TRANSPILE=true for enabling transpiling of yaml to js with sourcemap

  • create a file in .vscode folder "launch.json" filename

{
 
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "smartStep": true,
            "stopOnEntry": false,
            "cwd": "${workspaceFolder}/src",
            "program": "index.ts",
            "env": {
                "GS_TRANSPILE": "true"
            },
            "outFiles": [
                "${workspaceFolder}/dist/**/*.js"
            ]
        }
    ]
}
  • "debug.allowBreakpointsEverywhere": true set this in settings.json of .vscode folder
    Change build command

  • Change build command in package.json

"build": swc src -d dist && rsync -a --exclude '*.ts' ./src/ ./dist/ && rsync -a ./config/ ./dist/config && rsync -a ./src/mappings/ ./dist/mappings && rsync -a ./src/plugins/ ./dist/plugins && node ./node_modules/@godspeedsystems/core/dist/core/transpiler.js

-----Debugger setup-----

@xCodeMuse xCodeMuse added the feature new feature label Jan 10, 2024
@xCodeMuse xCodeMuse linked a pull request Jan 10, 2024 that will close this issue
@xCodeMuse xCodeMuse linked a pull request Jan 10, 2024 that will close this issue
@mastersilv3r mastersilv3r changed the title Debugger V2 YAML Debugger V2 Feb 5, 2024
@mastersilv3r mastersilv3r added the P2 Low priority label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature P2 Low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants