atomforce

Unofficial Salesforce™ Commerce Cloud uploader & manager for Atom. Upload your files and cartridges on SFCC via WebDAV.

Matteo Bertoldo

278

2

Bug Reports

0.13.1

MIT

GitHub

This package provides the following services:

This package consumes the following services:

Atomforce

Unofficial Salesforce ™ Commerce Cloud B2C uploader & manager for Atom.

Build Status Prettier Package Version


Intro

Atomforce is a package for Atom, that with a simple interface in the Atom Status Bar, helps you upload files and cartridges in your Sandbox via WebDAV for the B2C development.

Installation

Command Line

  1. Install the latest version of Atom
  2. In the terminal, install the package via apm:
apm install atomforce

GUI

  1. Install the latest version of Atom
  2. Launch Atom
  3. Open Settings View using Cmd+, on macOS or Ctrl+, on other platforms
  4. Click the Install tab on the left side
  5. Enter atomforce in the search box and press Enter
  6. Click the "Install" button that appears

Configuration

As required by the standard in the various npm Salesforce packages eg: (dwupload or sgmf-scripts), Atomforce also requires a file named dw.json in the root of the project, which is needed to enable connection to the WebDAV.
In the following indexes you can find most of the examples to be able to upload your files and cartridges to Sandbox correctly.

dw.json

In order to create a connection file to the WebDAV it is available with Atomforce, an integrated provider for the autocompletion of the correct properties. Create a new dw.json file in the root of your SFCC project in order to auto-complete the file correctly.

dw-json-schema

However, it's possible to consult the attributes of the properties and the mandatory fields for the right connection, here.

Keyword Mandatory Type Description
hostname true string The Hostname of your sandbox without the https protocol. The name must end before /on/demandware.store/.
username true string The username used to access on your Sandbox. The same value of the field that in "Sandbox Istance" is called login. In some sandboxes with the SFRA architecture the username, corresponds to the username used in account.demandware.com
password true string The password used to access on your Sandbox. In some sandboxes with the SFRA architecture the password, corresponds to the password used in account.demandware.com
code-version or version true string The version of the code active in your Sandbox. You can check the version in Administration > Site Development > Code Deployment.
root false string Root option allows for path resolution of the file to upload relative to a directory.
cartridges false array List of cartridges to be uploaded and viewed by the watcher filesystem.
p12 false string The absolute path of p12 file necessary for two-factor authentication. If hostname key contains cert initials, this key become mandatory.
passphrase false string The keyword necessary for two-factor authentication. If p12 is set, passphrase become mandatory.

A final example of how the file should be structured.

Remember to add the dw.json file in your .gitignore to avoid committing your Sandbox credentials!.

{
    "hostname": "dev01-eu01-sample.demandware.net",
    "username": "username",
    "password": "mypassword",
    "code-version": "version1"
}

2FA (Two-factor Authentication)

Atomforce supports 2FA (Two-factor Authentication).
The p12 key can be added to the dw.json file, and the path of where the p12 certificate file is allocated as the value. The passphrase key is also required, where the keyword required for authentication is indicated as the value.

{
    "hostname": "cert.staging.eu01.sample.demandware.net",
    "username": "username",
    "password": "mypassword",
    "code-version": "version1",
    "p12": "absolutepath/to/certificate.p12",
    "passphrase": "keyword"
}

Root

Root option allows for path resolution of the file to upload relative to a directory on WebDAV.
To better understand this option, suppose we have the following structure.

cartridges/
├── app_storefront_base/
├── plugin_ups/
├── plugin_wishlist/
└── README.md

In this structure in the WebDAV the cartridges folder will also be uploaded, to avoid this, just insert the initial path in the value of root, where the cartridges are allocated.

{
    "hostname": "dev01-eu01-sample.demandware.net",
    "username": "username",
    "password": "mypassword",
    "code-version": "version1",
    "root": "cartridges"
}

If the value of root is: . the full path will be considered, so the cartridges folder will also be uploaded in the WebDAV. If the path of your cartridges is on several levels: cartridges/src just indicate the complete path. Final slash is not required.

Cartridges List

The cartridges option allows you to stay in watch on one or more cartridges and upload these accordingly in WebDAV. If this option is not defined in the dw.json file, the watcher filesystem will listen all event (add, change and delete) to all files and folders in the project root or path indicated in the root option, and all files and folders will be uploaded.

{
    "hostname": "dev01-eu01-sample.demandware.net",
    "username": "username",
    "password": "mypassword",
    "code-version": "version1",
    "root": "cartridges",
    "cartridges": ["app_storefront_base", "plugin_ups"]
}

Additionals Packages

To improve the development workflow in Salesforce Commerce Cloud we recommend installing the .isml & .ds syntax, snippets and autocompletion package.

Atom SFCC

Contributing

Known Vulnerabilities

Prerequisites

  1. Latest version of Atom installed.
  2. Recommended Installed Packages:

Getting Started

Before cloning the repository, make sure you have node.js installed on your OS.

Contributing Details

Please read CONTRIBUTING.md for details on code of conduct, and the process for submitting pull requests.

License

Atomforce is licensed under the MIT License - see the LICENSE.md file for details.