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

Remove exchange connector #181

Merged
merged 11 commits into from
May 12, 2020
Merged
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# commerce-sdk

Salesforce Commerce Node.js SDK
# Salesforce Commerce Node.js SDK

[![CircleCI][circleci-image]][circleci-url]

## What is This?

A mono repo containing packages that generate the Salesforce Commerce SDK. Read more about the SDK [here](./packages/generator/README.md) and the tools in this toolkit in the [Packages](#packages) section.
A monorepo containing packages that generate the Salesforce Commerce SDK. Read more about the SDK [here](./packages/generator/README.md).

Visit the [Commerce Cloud Developer Center](https://developer.commercecloud.com/) to learn more about Salesforce Commerce. The developer center has API documentation, getting started guides, community forums, and more.

## Packages

> **Note**: This repository formerly contained @commerce-apps/exchange-connector. That package has been deprecated, and its functionality has been moved to [@commerce-apps/raml-toolkit](https://npmjs.com/package/@commerce-apps/raml-toolkit).

### commerce-sdk

The generator package is responsible for generating the SDK from RAML files. Since the SDK is generated it is not a part of any repository. Read more about the SDK [here](./packages/generator/README.md) and how the generator works [here](./packages/generator/docs/GENERATOR.md).
Expand All @@ -20,41 +20,42 @@ The generator package is responsible for generating the SDK from RAML files. Sin

The Core package represents the core functions that call the APIs and interact with Salesforce Commerce. It is used by the SDK. Read more about the core package [here](./packages/generator/README.md).

### @commerce-apps/exchange-connector

The exchange-connector package downloads RAML files from Anypoint Exchange to build the SDK. It is used by the generator but not the generated SDK. Read more about the exchange-connector package [here](./packages/exchange-connector/README.md).
> **Note:** `@commerce-apps/exchange-connector` is soon going to be replaced with [@commerce-apps/raml-toolkit](https://www.npmjs.com/package/@commerce-apps/raml-toolkit)

## Setup

All of these commands can be run from either the repo root or the package root.

# To setup
npm install
```bash
# To setup
npm install

# To build
npm run build
# To build
npm run build
```

## Running Tests

> **Note:** Instructions in the Setup section are prerequisites for this section

To run tests in all the packages, execute

```bash
npm test
```

To print the detailed test results and errors on the console, execute

```bash
npm run test:debug
```

To run tests in the core package only, execute

```bash
npm run test:core
```
To run tests in the exchange-connector package only, execute
```bash
npm run test:ec
```

To run tests in the generator package only, execute

```bash
npm run test:generator
```
Expand All @@ -75,8 +76,6 @@ If you would like to contribute please take a look at our [contributors' guide](
[Code Generation](./packages/generator/docs/GENERATOR.md)
[API Documentation](./packages/generator/APICLIENTS.md)


<!-- Markdown link & img dfn's -->
[circleci-image]: https://circleci.com/gh/SalesforceCommerceCloud/commerce-sdk.svg?style=svg&circle-token=c68cee5cb20ee75f00cbda1b0eec5b5484c58b2a
[circleci-url]: https://circleci.com/gh/SalesforceCommerceCloud/commerce-sdk

4 changes: 0 additions & 4 deletions commerce-sdk.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
"name": "Core",
"path": "packages/core"
},
{
"name": "Exchange Connector",
"path": "packages/exchange-connector"
},
{
"name": "Generator",
"path": "packages/generator"
Expand Down
13 changes: 5 additions & 8 deletions docs/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ If the workspace bar on the left does not look like this there are a couple of w
2) Open the `commerce-sdk.code-workspace` in vscode, there is a button in the lower right to open that workspace directly.
![Open Workspace Button](./images/open-workspace.png "Open Workspace button")



"Monorepo config" represents the files at the root of the folder that let you configure or run the commands in the monorepo itself.

Each other workspace corresponds directly with the lerna packages of the same name.
Expand All @@ -25,14 +23,14 @@ Each other workspace corresponds directly with the lerna packages of the same na
VSCode lets you define launch configurations via JSON. See examples below to get started.

> NOTE: The below configurations will only work in a multi-workspace otherwise ${workspaceFolder} will point to the root of the project and not the root of the workspace

### Debugging the Generator

The exchange-connector and core don't have any logic when you build them. If you want to debug those you should write a test and use the below example for debugging tests.
The core package doesn't have any logic when you build it. If you want to debug it, then you should write a test and use the below example for debugging tests.

The generator however is unique in that the build itself has a lot of logic in it depending on the input. (Different RAML produces different results) So often you will need to debug the actual build of the generator.
The generator, however, is unique in that the build itself has a lot of logic in it depending on the input. (Different RAML produces different results.) Often, you will need to debug the actual build of the generator.

> NOTE: Core and Exchange-connector must already be built for these to work
> NOTE: Core must already be built for these to work

```json
{
Expand Down Expand Up @@ -74,7 +72,6 @@ What if you want to troubleshoot a part of the rendering that is happening when

As long as you have a .env with your credentials for Exchange, this will now download from Exchange and let you step through to debug as well.


### Debugging Tests

Sometimes you need to debug what a test is doing. This can be accomplished by adding the example below as a workspace config to any workspace.
Expand Down Expand Up @@ -104,4 +101,4 @@ Specifically, this allows you to debug a single test file easily and add breakpo
}
```

See [Debugging](https://code.visualstudio.com/docs/editor/debugging) for details on debugging in VSCODE.
See [Debugging](https://code.visualstudio.com/docs/editor/debugging) for details on debugging in VSCODE.