Giter Site home page Giter Site logo

sqrtt / prophet Goto Github PK

View Code? Open in Web Editor NEW
143.0 22.0 59.0 2.22 MB

Prophet Debugger (SFCC sandboxes via SDAPI 2.0) extension for VS Code

Home Page: https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet

License: Other

TypeScript 71.08% JavaScript 28.92%
demandware debugger extention commercecloud sfcc syntax-highlighting isml

prophet's Introduction

Work your Demandware/Salesforce Cloud code

A VS Code extension to work with Demandware/Salesforce Cloud code on Sandbox that support the Script Debugger API (SDAPI) 2.0

Supported features

  • Upload cartridges and watch changes
  • Syntax highlight for isml and ds files
  • Validate isml files (based on htmlhint plugin, configurable by .htmlhintrc)
  • Advanced support of ISML syntax
    • hover information
    • autocomplete tags
    • auto formatting
    • find Symbols
    • highlighting selected tags
    • rename tag (via F2)
  • Setting breakpoints
  • Stepping
  • Change variables values in running threads
  • Locals scope variables via the VARIABLES panel
  • View variables on hover
  • Variable watches
  • Console/evaluate code
  • Open files trough Storefront Toolkit
  • Quick open isinclude templates and custom tags via Ctrl+Click (as links)
  • Cartridges overview in explorer
  • Server logs viewer with syntax highlight
  • Multi-root Workspaces (allows to work with different repo in same time).
  • Override template and JS file in another cartridge (via context menu).
  • enhanced autocompletion and goto for Resource.msg/msgf (js files and isml)
  • autocompletion and goto for URLUtils.url/http/https/abs (js files and isml)
  • Added autocompletion for server.append/prepend/replace
  • autocompletion for require('dw/')
  • autocompletion and goto for require('~/...') & require('*/...') (correct resolving based on cartridge path)
  • autocompletion and goto for res.render & isinclude & isdecorate & ismodule (template="" attribute) (correct resolving based on cartridge path)
  • quick find controllers (via Ctrl-F7)
  • Download SOAP WebService API from Server. This feature is similar to Eclipse/UXStudio feature to download & generate SOAP web-service documentation.
  • Import/export properties from/to CSV (useful for translation)

WARNING: Some users had reported that debugger completely halts sandbox. Currently, this issue is not fixed and no known steps to reproduce. If you have some info about it please share. So please, before debugger usage make sure that you have availability to restart sandbox for the case if extension halts yours.

Getting Started

To use this extension, you must first open the folder containing the cartridges you want to work on or one of subfolders contain folder cartridges.

Using the debugger

When your launch config is set up, you can debug your project! Pick a launch config from the dropdown on the Debug pane in Code. Press the play button or F5 to start.

Configuration

The extension operates in one mode - it launch an adapter that connects to sandbox. Just like when using the other debugger, you configure with a .vscode/launch.json file in the root directory of your project. You can create this file manually, or Code will create one for you if you try to run your project, and it doesn't exist yet.

Launch

Example launch.json configs with "request": "launch". You must not specify hostname and other credentials. Since they will be loaded from corresponding dw.json or dw.js file.

{
    "version": "0.1.0",
    "configurations": [
      {
          "type": "prophet",
          "request": "launch",
          "name": "Attach to Sandbox"
      }
    ]
}

Other optional launch config fields

  • trace: When true, the adapter logs its own diagnostic info to console. This is often useful info to include when filing an issue on GitHub.

Using the uploader

Example of file:

{
    "hostname": "example.demandware.net",
    "username": "user",
    "password": "password",
    "cartridge": ["cartridgeA", "cartridgeB"],// optional
    "cartridgePath": "cartridgeA:cartridgeB",// optional
    "code-version": "version2"
}

The second step: enabling the uploader in workspace preferences. Open preferences, switch to workspace preferences and set value to true for "extension.prophet.upload.enabled". Detailed log information is written in output channel Prophet Uploader. (Note: once you change dw.json or dw.js you should run 'Clean Project/Upload all' from command menu to apply it).

You can temporarily disable watching or force upload cartridges (i.e. clean project) via commands.

  • Prophet: Enable Upload
  • Prophet: Disable Upload
  • Prophet: Clean Project/Upload all

(press F1 and select command)

Note: the extension relies on the .project files to detect cartridge so it must not be added to files.exclude

Other configuration

  • extension.prophet.cartridges.path - List of cartridges separated by colon. Allows quick open - don't ask a user to choose the file. Automatically open file that match first cartridge in list.
  • extension.prophet.ismlServer.activateOn - allow activate isml server for non standatd (isml) files, ex. html
  • extension.prophet.clean.on.start - allows to enable/disable code upload on editor startup (enabled by default)
  • extension.prophet.ignore.list - list of regexp for files/folders should be excludes from zipping during clean (not from watching)
  • extension.prophet.htmlhint.enabled - enable/disable linting of isml files
  • extension.prophet.sandbox.filesystem.enabled - Enable Sandbox File System Workspace

Improve experience

Experience can be improved by using follow jsconfig.json in the folder with cartridges. It allows resolve absolute paths in scripts correctly, (except it starts with ~ or *).

Note: client side JS files must have their own jsconfig.json files and each workspace should have it's own configuration.

Code assistance can be improved even more by adding d.ts definition for the project. Definitions for Commerce Cloud objects can be downloaded from repo

{
    "compilerOptions": {
        "noLib": true,
        "target": "es5",
        "baseUrl": "./",
        "paths": {
            "*" : ["./*", "modules/*", "../types/*"]
        }
    },
    "typeAcquisition": {
        "enable": false
    },
    "include": [
        "../types/*.d.ts",
        "../types/**/*.d.ts",
        "./cartridge1/**/*.js",
        "./cartridge2/**/*.js",
        "./cartridgeN/**/*.js"
    ]
}
  • Replace cartridge1...cartridgeN for your real cartriges
  • Replace ../types/ to path where you are unpacked type definitions

To help VSCode determine the type of variable/argument JSDoc can be used. For instance:

// local variable

/**
/ @type {dw.catalog.Product}
/*
var product = someMethod();

// arguments types

/**
/ @param {dw.util.Iterator<dw.catalog.Product>} products
/ @param {dw.order.Basket} basket
/ @returns {Array<dw.catalog.Product>}
/*
function doSomething(product, basket) {
...
}

Enable Cartridges/Logs View

To see the Cartridges or Logs view, open the command palette and run Prophet: Focus on Catrdiges View or Prophet: Focus on Logs View.

Download SOAP WebService API from Server

This feature works similarly to the UXStudio feature. One can download the SOAP API files from server & generate documentation for it.

Steps:

  1. Navigate to the WSDL file in vscode file explorer.
  2. Right click file to open context menu.
  3. From context menu, select "Download SOAP Web Service API...".
  4. An input-box will prompt asking location of the directory where documentation should be downloaded.
  5. Enter an appropriate folder location & hit Enter
  6. Documentation will be generated under entered folder.
  7. Use log channel SOAP WebService Docs(Prophet) to check the status/progress for this operation.

Note:

UXStudio & this feature both internally uses javadoc to generate the relevant documentation. So, make sure javadoc is accessible from your shell/terminal/cmd.exe.

If javadoc is not added to your OS path, vscode will still download the compiled java files from server to local file-system but while generating the documentation it will show an error message. So, one can always manually run the javadoc to generate the documentation.

Reporting a bug

To report a bug simply create a new GitHub Issue and describe your problem or suggestion. All kinds of feedback are welcome regarding extention including but not limited to:

  • When Prophet doesn't work as expected
  • When you simply want a new option or feature

Before reporting a bug, please look around to see if there are any open or closed tickets that discuss your issue.

Contribute

There are many ways to contribute to Prophet.

  • Submit bugs and help to verify fixes as they are checked in.
  • Review the source code changes.
  • Engage with other Prophet users and developers.
  • Contribute bug fixes.
  • Contribute tests.

Pull requests

If you have made or wish to make some features/fixes, please, make a fork of this repo, do your changes, and send your pull request to this repo into master branch. After review it will be merged to master and during some time it will be available in extension itself. Before making pull request, please, make that it doesn't break anything. (currently there no tests, so test that covers current functionality are welcomed)

Contributors

prophet's People

Contributors

aburgett87 avatar ast-vkosko avatar challmannsf avatar dependabot[bot] avatar dlferro avatar fgiust avatar ghgofort avatar gkkirilov avatar juanpenarandaosf avatar khaitu avatar lisunovdv avatar lunac avatar maxime121294 avatar michaelterryio avatar polluks avatar psa-esteban avatar ranveer5289 avatar scsk-jiro-sato avatar sgd1953 avatar sqrtt avatar suaterkenosf avatar taurgis avatar tolgaevcimen avatar wrobbel-adesso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prophet's Issues

Setting the "cartridgeroot" in launch.json does not change the cartridge root

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 uploads all cartidges on every file change

When i use the uploader to upload my changes to my sandbox it uploads all my cartridges.

Before i use dwupload with gulp. When i added watch to that command it uploaded only the individual file. Is something like that possible for the prophet uploader? Would be nice!

Gulp example:
screen shot 2017-09-15 at 10 51 03

How to view log files

If I refresh logs I get the following error

"command 'extension.prophet.command.refresh.logview' not found"

Add support for "~" in require path

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.

Uploading breaks at the last cartridge upon init

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.

SVG resource not found

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.

Relevant Screen Shots:

  • Error on load:
    Failed to load resource: net::ERR_FILE_NOT_FOUND
    image

  • After Refresh of the log files:
    image

  • Expanded example:
    image

My Setup:

  • Mac OS Sierra Version 10.12.6
  • VS Code Version 1.14.2
  • Prophet Version 0.9.1

Cannot debug ajax request

I'm not able to debug ajax calls to my sandbox.
Regular calls work just like expected.

Is there something I'm missing?

Reduce CPU consumption of the file watching

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.

Open isinclude templates via Ctrl+Click doesn't work with file associations

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!

[Not an issue] Need some advices

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 ;(

Typescript Setup

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?

How to contribute?

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.

Detailed upload status

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.

'Clean Project/Upload All' does not delete old old files

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.

Error on watching multiple sub-directories

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,

VSCode is no longer supporting specifiying a commandId in the "initialConfigurations" contribution

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

Cartridge array in dw.json is ignored.

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:
image

// 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:

  • dw-gg
    -- .DS_Store
    -- .babelrc
    -- .editorconfig
    -- .eslintignore
    -- .eslintrc.json
    -- .flowconfig
    -- .git/
    -- .gitignore
    -- .idea/
    -- .metadata/
    -- .recommenders/
    -- .stylelintignore
    -- .stylelintrc.json
    -- .vscode/
    -- CONTRIBUTING.md
    -- DemandwareServer/
    -- GitVersion.yml
    -- README.md
    -- RemoteSystemsTempFiles/
    -- app_blogparser/
    -- app_cc/
    -- app_contentizer/
    -- app_cssuite_2_0/
    -- app_ctr/
    -- app_loyalty/
    -- app_ordershippingstatus/
    -- app_proaccount/
    -- app_returns/
    -- app_spc/
    -- app_translation/
    -- bc_csc_customization/
    -- bc_drivecommerceintegration/
    -- bc_filemonitoring/
    -- bc_integrationframework/
    -- bm_adyen/
    -- bm_catalogreducer/
    -- bm_drivecommerce/
    -- bm_instore/
    -- bm_integrationframework/
    -- bm_paypal_v16_1_0/
    -- bm_tools/
    -- core_commerce/
    -- core_commerce_emea/
    -- core_commerce_richUI/
    -- core_controllers/
    -- core_deckers/
    -- dw.json
    -- flow-libs/
    -- gulpfile.js
    -- int_3DS/
    -- int_CJ/
    -- int_DCD_avatax/
    -- int_DPDPickup/
    -- int_QAS/
    -- int_accertify/
    -- int_adyen/
    -- int_affiliatewindow/
    -- int_bizrate_survey/
    -- int_buildmanager/
    -- int_channeladvisor/
    -- int_cosmiccart/
    -- int_csvexport/
    -- int_customerexporttool/
    -- int_googleFeed/
    -- int_hreflang_sitemap/
    -- int_janrain/
    -- int_ocapi_ext/
    -- int_ocapi_ext_controllers/
    -- int_ocapi_ext_core/
    -- int_ocapi_ext_test/
    -- int_ocapi_ext_v6/
    -- int_paypal_v16_1_0/
    -- int_paypal_v2_2_0/
    -- int_powerreviews/
    -- int_simplefeeds/
    -- int_sitecatalog/
    -- int_taxclass/
    -- int_tealium/
    -- int_translation/
    -- int_truefit/
    -- int_verifone_dss/
    -- int_verifone_dss_controllers/
    -- int_verifone_dss_core/
    -- int_vwo_plugin/
    -- jsconfig.json
    -- node_modules/
    -- out/
    -- package.json
    -- site_ahnu_v2/
    -- site_hoka_emea_v2/
    -- site_hoka_v2/
    -- site_koolaburra/
    -- site_sanuk/
    -- site_services/
    -- site_teva/
    -- site_teva_sanuk/
    -- site_teva_us/
    -- site_tevaeurope/
    -- site_ugg_closet/
    -- site_ugg_us/
    -- site_ugg_v2/
    -- site_uggeurope/
    -- site_ugguk/
    -- support_order_watcher/
    -- yarn.lock

Prevent Upload Sensitive Data

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.

Unable to set breakpoint to non backend file

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

Unable to set breakpoint to non backend file

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.

ISML server error on git diff

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

Stuck debug on loop

  1. Added breakpoint inside a loop
  2. Once its on debug line, remove debug point and continue,
  3. Debugger still stops on "abstract" debug point (it says PAUSED ON STEP but can't see which line its paused on, and when click to continue, it again says PAUSED ON STEP)

Multiroot wiki

Please provide an example of uploading cartridges/debugging with a multi-root workspace.

Create a common dependency for code uploading

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?

Debugger breaks when opening LinkedHashMap type in variables

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)

Can't open file with cartridges view

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

Debugger not populating values for Object instances created from a custom constructor function.

Summary:

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.

Example:

  • Test Controller:
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]:

image

Another example with the function on the same scope level:

image

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.

Trace enabled all the time

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,

Exclude files from upload

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.

Uploader causing VSCode Extension Host crash

Error Description

About every 1-2 hours I am getting an error stating:
Extension host terminated unexpectedly. Please reload the window to recover.
image

If I examine the developer tools I am getting:
Code: null
Signal: SIGBART
image

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.

Steps Taken So Far:

  • I have disabled all the other extensions -- The issue still occurred.
  • I have re-installed VSCode. -- The issue still occurred.
  • I have disabled uploading in Prophet -- This does make the error go away.
  • I have run the VSCode with the verbose flag to see if I get any further errors. Here are the results:
    image

My Setup

  • OS: Mac OS X Sierra - Version 10.12.6
  • VSCode Version: 1.14.2
  • Prophet Plugin Version: 0.9.1
  • Extensions Installed:
    image

Unexpected token error on expanding variable

Hello,
I've faced bug on expanding variable on debug.

  1. Put debug on line,
  2. When i expand "product" variable in left panel, in both editors (javascript and dwscript) it blows, other variables don't cause any bug

Note: Same case, i can expand product variable in eclipse without errors.

Pictures below;

error0

error

sandbox crashed once hitting the breakpoint

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 :

  1. Turn on debugger, hit the breakpoint
  2. at the debug console, type a few variables, sometime it respond with a value other times it does not.
  3. click on Step over once it hits the debugging point.

"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/"
}
]

Clean debug breakpoints.

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.

Debugger causing Sandbox to crash

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.

Weird Error In Prophet Uploader Log

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

Edit Pipelines without Eclipse?

Hey, I was just wondering if you were planning to implement a way to edit the XML Pipelines without using Eclipse ?
Thanks!

No longer see variables when debugging

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.

image

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.

Why separated config file for upload and debug?

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.

Feature Request: Formatting options for ISML and DSScript language servers.

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!

Proxy support

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

Debugger connects fine but the code doesn't stop on breakpoints

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}}

upload is not working

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.