sqrtt / prophet Goto Github PK
View Code? Open in Web Editor NEWProphet Debugger (SFCC sandboxes via SDAPI 2.0) extension for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet
License: Other
Prophet Debugger (SFCC sandboxes via SDAPI 2.0) extension for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet
License: Other
If there is a missing cartridge in file explorer but is referenced in the dw.json file, uploader should skip it instead of trying to upload it and break with an exception and terminate the upload process.
Hi, I have a problem letting the debugger stop on breakpoints in our custom /lib folder. Everytime I try to set the breakpoint, the response is "Unable to set breakpoint to non backend file".
The folder structure is like this:
/our_cartridge/
/our_cartridge/cartridge
/our_cartridge/cartridge/controllers
/our_cartridge/cartridge/lib => .js files and subfolders with .js files
/our_cartridge/cartridge/scripts
It does stop on breakpoints in /controllers and /scripts so I'm guessing it doesn't expect a structure like this. How could this be enabled? Or how should we configure the jsconfig.json to make this work?
Kind regards
This is weird, I really don't know how to reproduce this error, but when trying to set a breakpoint in some files I get this error Unable to set breakpoint to non backend file
.
I'll add more information if I find out how to replicate.
Hello,
It looks like after a recent update (probably related to SDAPI v2), the trace log is enabled all the time, even if we set it to false in the configurations.
req -> {"uri":"/threads/reset","method":"POST"}
req -> {"uri":"/threads","method":"GET"}
req: {"uri":"/threads/reset","method":"POST","json":true}
res: undefined
req: {"uri":"/threads","method":"GET","json":true}
res: {"_v":"2.0","script_threads":[{"call_stack":[{"index":0,"location":{"function_name":"show()","line_number":142,"script_path":"/xxx/cartridge/controllers/Search.js"}},{"index":1,"location":{"function_name":"-anonymous-()","line_number":149,"script_path":"/xxx/cartridge/scripts/guard.js"}}],"id":8,"status":"halted"}]}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"successfully disconected\n"}}
successfully disconected
To client: {"seq":0,"type":"response","request_seq":82,"command":"disconnect","success":true}
Regards,
As of today, code completion and type hinting is not working if a tilde is part of the require path.
Example:
// Not working
var guard = require('~/cartridge/scripts/guard');
// Working
var guard = require('app_storefront_core/cartridge/scripts/guard');
Expectation would be that "~" is resolved properly.
When initially start uploading the cartridges, it breaks at deleting the last cartridge zip from remote.
[int_test] Deleting remote zip...
The upload process is restarting and it breaks again and again and again.
Hi!
This is more a question than an issue ( I think)
As a FD I have ISML files associated to HTML:
"files.associations": {
"*.isml": "html"
}
I use this so I could have all perks when writing html like auto-completion, boilerplates, snippets, and so on, but with this enabled the Ctrl + Click for isinclude tags doesn't work (when I disable the association, it works)
Is there any way to get this working while keeping the file association, perhaps via settings?
Thanks!
First installation and I wonder if there is any logic behind separating the configuration files for uploading and debugging.
I understand that while debugging vscode uses the launch.json. Can webdav uploader also use that same configuration?
Also, I see that webdav uploader if cartridges not defined, uploads everything. Since we can auto define all cartridge roots, can't we get changed file's cartridge root and upload by using it?
I would love to contrubite for this if these make sense.
I am using the customer service center customization cartridge.
It is stopping on the breakpoint in Eclipse
As the image shows the variables don't show, another colleague is having the same issue
Also my instance freezes and needs a restart after hitting the breakpoint.
Maybe it's a bug from my last PR @SqrTT ? I don't have my machine with me to test it on master branch, will check it later today.
Hello,
I absolutely love this plugin and have been happily using it for months now, but today all-of-the-sudden the breakpoints don't cause the debugger to stop. It connects fine. And when I use the debugger in Eclipse, Eclipse does stop on the breakpoints.
I uninstalled and reinstalled Prophet Debugger.
I restarted my sandbox.
I looked over all config and it all looks right.
Any idea what might be causing this?
22:08:04, 2018-3-21
From client: initialize({"clientID":"vscode","adapterID":"prophet","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"event":"prophet.getdebugger.config","type":"event","seq":1}
From client: DebuggerConfig({"config":{REMOVED BECAUSE OF SENSITIVE STUFF})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsEvaluateForHovers":false,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":false,"supportsHitConditionalBreakpoints":false,"supportsSetVariable":false,"supportsGotoTargetsRequest":false,"supportsRestartRequest":false,"supportsRestartFrame":false,"supportsExceptionInfoRequest":false,"supportsExceptionOptions":false,"supportsStepBack":false,"supportsValueFormattingOptions":true,"exceptionBreakpointFilters":[]}}
To client: {"seq":0,"type":"response","request_seq":2,"command":"DebuggerConfig","success":true}
From client: launch({"type":"prophet","request":"launch","name":"Dev13","hostname":"dev13-web-mysandbox.demandware.net","username":"bspencer","password":"removed","codeversion":"Test_version","cartridgeroot":"auto","workspaceroot":"/Users/bspencer/demandware","trace":true,"__sessionId":"78652595-36ea-42be-9095-3ea6de266bcd"})
To client: {"seq":0,"type":"response","request_seq":3,"command":"launch","success":true}
To client: {"seq":0,"type":"event","event":"initialized"}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"successfully connected\nconsole can be used to evaluate variables\nwaiting for breakpoint hit...\n"}}
From client: setBreakpoints({"source":{"name":"CartController.js","path":"/Users/bspencer/demandware/code/cartridges/app_myproject_controllers/cartridge/controllers/CartController.js"},"lines":[114],"breakpoints":[{"line":114}],"sourceModified":false})
To client: {"seq":0,"type":"response","request_seq":4,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"verified":true,"line":114,"source":{"name":"1 - CartController.js","path":"/Users/bspencer/demandware/code/cartridges/app_myproject_controllers/cartridge/controllers/CartController.js","sourceReference":0}}]}}
From client: configurationDone(undefined)
To client: {"seq":0,"type":"response","request_seq":5,"command":"configurationDone","success":true}
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":6,"command":"threads","success":true,"body":{"threads":[]}}
To client: {"seq":0,"type":"event","event":"thread","body":{"reason":"started","threadId":68}}
To client: {"seq":0,"type":"event","event":"stopped","body":{"reason":"breakpoint","threadId":68}}
From client: threads(undefined)
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":7,"command":"threads","success":true,"body":{"threads":[]}}
To client: {"seq":0,"type":"response","request_seq":8,"command":"threads","success":true,"body":{"threads":[]}}
To client: {"seq":0,"type":"event","event":"thread","body":{"reason":"started","threadId":84}}
To client: {"seq":0,"type":"event","event":"stopped","body":{"reason":"breakpoint","threadId":84}}
To client: {"seq":0,"type":"event","event":"thread","body":{"reason":"exited","threadId":68}}
From client: threads(undefined)
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":10,"command":"threads","success":true,"body":{"threads":[]}}
To client: {"seq":0,"type":"response","request_seq":9,"command":"threads","success":true,"body":{"threads":[]}}
To client: {"seq":0,"type":"event","event":"thread","body":{"reason":"exited","threadId":84}}
As a developer,
I would like to have a feature added to remove all active remote breakpoints (Clear breakpoints) so that whenever my debugger is stuck, I could clear the breakpoints.
Seems like only variables defined with 'var' can be inspected.
If I refresh logs I get the following error
"command 'extension.prophet.command.refresh.logview' not found"
Would be great to have an option to enable upload without uploading all cartridges at the start.
CPU consumption is very high (at least on MacOS X) and goes back to normal when uploading is disabled. I tracked this down to chokidar which apparently has an issue (paulmillr/chokidar#412) and replaced it with a native solution. It is a bit workaround-like due to API contraints but does the job at much lower CPU load.
When I do a 'Clean Project/Upload All' it does not remove any files that I have deleted from the project. Is there any way that this could be added, or another type of clean operation could be added to allow for removal of the files in a cartridge or all cartridges before uploading again.
This would be especially helpful to avoid issues with a template that is overriding a template with the same name further down the cartridge lookup path. This is not a high priority issue , but when I update code from our master branch on a shared repo and it includes updates from other developers, I wouldn't have to go looking through a diff from their commits to figure out why my sandbox is no longer working as expected.
Thanks for considering.
Debug tooltip becomes disabled when one of thread is finished.
Hey, I was just wondering if you were planning to implement a way to edit the XML Pipelines without using Eclipse ?
Thanks!
It would be nice get some more details on the current upload status, e.g. a percentage.
When uploading big cartridges (e.g. I recently worked with a 50MB one), the upload might take some time, so it would be great to have a possibility to get sure whether the upload is running or hanging.
When you doesn't configure cartridge list in the dw.json file or in settings, you will upload all content from project folder, which is not secure.
Folders like .git or another can have a lot of private information.
We will need to find all cartridges or upload nothing if we can't detect them.
Please provide an example of uploading cartridges/debugging with a multi-root workspace.
About every 1-2 hours I am getting an error stating:
Extension host terminated unexpectedly. Please reload the window to recover.
If I examine the developer tools I am getting:
Code: null
Signal: SIGBART
This has been happening since I started using the built-in uploader. If I disable the upload feature then the issue goes away. I have been using the dw-upload cli tool for the time being, and I have not had an issue with this setup.
All of the other features seem to keep working while the message to reload the window is present, but the uploading stops functioning.
I just installed prophet debugger and each time I hit the breakpoint, I click on step over a couple of times, it would hang the site, then if I terminate the debugger, the sandbox would crash. I had to restart it manually. Our network is really slow today, I hope that is the root cause. We will see another day how this works.
Steps to reproduce :
"configurations": [
{
"type": "prophet",
"request": "launch",
"name": "Attach to sandbox",
"hostname": "xx.demandware.net",
"username": "xxx",
"password": "xxx",
"codeversion": "version1",
"cartridgeroot": "auto",
"workspaceroot": "${workspaceRoot}/cartridges/xx/"
}
]
Hello,
I am not able to upload throught my company proxy. I got this error :
Unable validate connection! Validation error: tunneling socket could not be established, statusCode=504 Error: Error: tunneling socket could not be established, statusCode=504
I can't find anything related to this. Will it be an evolution ? Or is there an alternative solution ?
Regards,
Arthur
With new update debugger not working when cartridge root set to auto, when enable debug it detect root as current cartridge where I set breakpoint, when I change cartridge to path where all cartridges are it works fine.
Issue happens after this update to pathes https://github.com/SqrTT/prophet/pull/20/files
Please, create wiki/section, how people could contribute. I would be interested in api autocomplete feature that possible could be added to this extension and etc. But would be great to know, how people can help to improve and extend current extension.
Hello all,
Thank you for creating this amazing tool! I am experiencing issues with the cartridges uploaded to the incorrect path in Webdav.
Cartridge root path in my local project:
[project_folder]/cartridges
[project_folder]/cartridges/store_controllers
[project_folder]/cartridges/store_core
launch.json in .vscode/launch.json file
{
"version": "0.3.0",
"configurations": [
{
"type": "prophet",
"request": "launch",
"name": "Dev15 Sandbox",
"hostname": "<hostname>",
"username": "<username>",
"password": "<password>",
"codeversion": "version1",
"cartridgeroot": "/Applications/XAMPP/xamppfiles/htdocs/<project_name>/cartridges",
"workspaceroot": "${workspaceRoot}"
}
]
}
As you can see above, the cartridge root path is defined in <project_name>/cartridges. However, when I use the watch file functionality to automatically update changes to webdav, it uploads to the incorrect path.
Current State - Incorrect Cartridge path on webdav:
Cartridges/version1/cartridges/store_controllers
Cartridges/version1/cartridges/store_core
Desired Correct Cartridge Path on webdav:
Cartridges/version1/store_controllers
Cartridges/version1/store_core
Your help will be greatly appreciated!
Thanks
Uploader get stuck in clean:
Start uploading cartridges
Cleanup code version...
mode list
thanks for the cool VC plugin, everything works perfect.
I'm looking for TS support for my code. The code completion works awesome, so everything what is needed for that. Is on place.
Do you know how to setup it?
I'd be very much in favour of creating a single bare-bones dependency for handling code uploads. There is another implementation of this in https://bitbucket.org/demandware/dw-node-code-uploader/src/ea19c425cfcd70f8d530080c09287ca4f8a91098/lib/server.js?at=master&fileviewer=file-view-default and a few more.
The implementation we use here seems to not have any dependencies to vscode which should make this a relatively straight-forward effort.
Thoughts?
Hi,
We noticed your extension in package.json
is using a "initialConfigurations"
contribution in a deprecated way by specifiying a command id.
We wanted to let you know that we plan to delete support for this specific use of "initialConfigurations" soon.
More about this deprecation can be found here and in our release notes.
A good example on how to use the DebugConfigurarationProvider
which is the new way of doing this can be found here
Also note other deprecations which are specified in our release notes (which can be found on our site).
Kind regards,
Isidor from the VSCode team
When you click to see in GIT difference you will get this error:
onDocumentLinks {"textDocument":{"uri":"git:/d%3A/Code/app_storefront_core_ext/cartridge/templates/default/product/pt_productdetails.isml?%7B%22path%22%3A%22d%3A%5C%5CCode%5C%5Cecom-fatface%5C%5Capp_storefront_core_ext%5C%5Ccartridge%5C%5Ctemplates%5C%5Cdefault%5C%5Cproduct%5C%5Cpt_productdetails.isml%22%2C%22ref%22%3A%22~%22%7D"}}
[Error - 10:36:56] Request textDocument/documentLink failed. Message: Request textDocument/documentLink failed with message: Wrong scheme Code: -32603
Hello
After the initial upload I'm getting this in the error log and I wasn't getting it on a previous version.
Error: Error: Method Not Allowed
Trying to re-upload
Connection validated successfully
Current active version is: ACTIVE_VERSION
Upload cartridges on start is disabled via config //
Watching files
As a side note, why aren't they uploading on start, I haven't changed anything in the settings recently. And I cant figure out where that setting is.
Thanks
When I stop the debugger at a breakpoint my debugger errors when I try to open LinkedHashMap but others variables open with no problem.
I use StoreMgr.searchStoresByCoordinates() to get my LinkedHashMap.
Here is the error in console
Error: Internal Server Error
at Request.request [as _callback] (C:\Users\Argon.vscode\extensions\SqrTT.prophet-0.9.9\out\Connection.js:41:35)
at Request.self.callback (C:\Users\Argon.vscode\extensions\SqrTT.prophet-0.9.9\node_modules\request\request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:194:7)
at Request. (C:\Users\Argon.vscode\extensions\SqrTT.prophet-0.9.9\node_modules\request\request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at IncomingMessage. (C:\Users\Argon.vscode\extensions\SqrTT.prophet-0.9.9\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:91:20)
It would be great if there was a JSON file for formatting options for the language syntaxes or a good explanation of where the settings are currently being derived from.
After a look through the code it appears that there is a built in version of beautify being used for this feature and perhaps it is just a matter of knowing where these settings need to be placed. Thanks for taking a look at this!
When I use the uploader included in the prophet package the cartridges array that is specified in my dw.json file is ignored and all the folders in the project directory are uploaded/watched instead.
The settings in the dw.json file work without issue when I use the dwupload package from the terminal.
Screen Shot of the Prophet Uploader output:
// dw.json
{
"hostname": "dw25-web-********.demandware.net", // Modified for Posting
"username": "*********", // Removed for Posting
"password": "*********", // Removed for Posting
"code-version": "VSCode",
"cartridge": [
"app_blogparser",
"app_cssuite_2_0",
"app_ctr",
"app_loyalty",
"app_ordershippingstatus",
"app_returns",
"app_spc",
"app_translation",
"bc_filemonitoring",
"bc_integrationframework",
"bm_adyen",
"bm_catalogreducer",
"bm_instore",
"bm_tools",
"core_commerce",
"core_commerce_richUI",
"core_controllers",
"core_deckers",
"int_3DS",
"int_accertify",
"int_adyen",
"int_affiliatewindow",
"int_bizrate_survey",
"int_buildmanager",
"int_channeladvisor",
"int_CJ",
"int_csvexport",
"int_customerexporttool",
"int_DCD_avatax",
"int_DPDPickup",
"int_googleFeed",
"int_hreflang_sitemap",
"int_powerreviews",
"int_QAS",
"int_simplefeeds",
"int_sitecatalog",
"int_taxclass",
"int_tealium",
"int_translation",
"int_truefit",
"site_hoka_v2",
"site_koolaburra",
"site_sanuk",
"site_services",
"site_teva_us",
"site_teva_sanuk",
"site_ugg_closet",
"site_ugg_us"
]
}
Folder Structure:
Hello,
Thanks and congratulations for the plugin, it's a really great tool :)
I'm having a issue when I have a dw.json like this:
"cartridge": [
"xxxxxxxx/abcd",
"sitegenesis/app_storefront_core",
"sitegenesis/app_storefront_controllers"
]
Every time I change some code from either directory, Prophet tries to do a re-upload everything. Example:
[U 10:33:27] c:\projects\xxxxxxxx\abcd\file.js
Trying to re-upload
Start uploading cartridges
I know this isn't the correct configuration for the paths as indicated in the plugin description, but it's
very useful when we have multiple GIT repositories
I'm using the latest version from the Plugin and VS Code in Windows 10.
Best regards,
Each time I load the extension I get an error. It appears that the file name is being left off when trying to load an SVG resource. When I update the log files using the refresh option I get several more of these errors.
I'm not able to debug ajax calls to my sandbox.
Regular calls work just like expected.
Is there something I'm missing?
It would be great to have some kind of "extensions.prophet.upload.filesExclude" setting.
Example: I have a cartridge that would install Node JS modules inside the cartridge folder. I know it's a bad practice, but it would be nice if I would have a chance to exclude it from my upload. Additionally, I'd like to exclude images etc. so my upload is faster while doing development.
Additionally, it would then also be nice to have a "clean & upload all (ignore excluded files)" vs. "clean & upload" command.
Whenever I am debugging and it is paused on a breakpoint if I save and therefore upload a file (not the best habit, I know) it causes the sandbox to hang and refuse connections necessitating a restart of the sandbox.
I know that in eclipse when you save/upload a file it gets rid of the breakpoints and finishes the thread before uploading the file, maybe that could be a solution.
Hey guys, sorry but I have nowhere to ask this so if someone answers, thank you in advance.
I'm developping a custom payment gateway for DemandWare and I can't figure how to return a JSON response after a calling a Pipeline.
What I'm doing :
On prestashop, I do it this way :
What would be the equivalent to echoing a JSON response in an ISML template ?
Is there a waying to call a script without using a pipeline ?
EDIT:
I am aware of these functions but I'm not sure how to use them in this context..
let r = require('~/cartridge/scripts/util/Response'); r.renderJSON({ Message: 'Hello World!' });
and
let ISML = require('dw/template/ISML'); function sayHello() { ISML.renderTemplate('helloworld', { Message: 'Hello World!' }); }
Thank you if you can help me ;(
When I create a constructor function for instantiating Object instances, the instances appear as [Object, Object] in the debugger, with no option for expanding. I am able to get to the properties of the object from the debugger CLI, but this is not ideal.
function Car(args) {
this.year = args && args.year ? args.year : 1999;
this.make = args && args.make ? args.make : 'No Value';
this.model = args && args.model ? args.model : 'No Value';
}
exports.TestDebugger = function() {
const myCar = new Car({year: 2012, make: 'Honda', model: 'Pilot'});
response.setContentType('application/json');
response.writer.print(JSON.stringify(myCar));
};
exports.TestDebugger.public = true;
If I add a breakpoint to the code after the creation of the car instance all I am able to inspect from the myCar variable is [object, Object]:
Another example with the function on the same scope level:
I am able to access the properties using the CLI but this is less than ideal with more complex Object instances. I would very much like to be able to view these objects in the variables panel along with the other variables.
I am more than willing to help with implementing this functionality if it is something that you would consider?
Thanks for considering, Galen.
Starting...
Using config file "d:\DW\workspace\*****\cartridges\dw.json"
Using directory "d:\DW\workspace\*****\cartridges" as cartridges root
Starting
Connection validated successfully
Warn: Current code version is "version1" while uploading is processed into "undefined"
Current active version is: version1
Start uploading cartridges
"TypeError: cartridges.map is not a function"
Error: TypeError: cartridges.map is not a function
Any ideas what I've done wrong?
thanks in advance
Unable to open '': Invalid file resource (file://d:\dw\workspace\demandware-www-NDA-com\3rd-party\sitegenesis\app_storefront_controllers\cartridge\controllers\abtestevent.js)
While try to open ABTestEvent.js
in D:\DW\workspace\demandware-www-NDA-com\3rd-party\sitegenesis\app_storefront_controllers\cartridge\controllers\ABTestEvent.js
in general I can't open any of the files with cartridges view panel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.