Skip to content

Commit c855110

Browse files
committed
ide integration
1 parent a382ca1 commit c855110

1 file changed

Lines changed: 29 additions & 23 deletions

File tree

docs/guide/ide-integration.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Configure IDE tooling like Prophet VS Code extension to consume resolved B2C CLI configuration via a generated dw.js bridge script.
2+
description: Configure IDE tooling like Prophet VS Code extension and IntelliJ SFCC plugin to consume resolved B2C CLI configuration.
33
---
44

55
# IDE Integration
@@ -10,29 +10,14 @@ This guide explains how to connect IDE extensions to your B2C CLI configuration.
1010

1111
[Prophet](https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet) can load `dw.json`-compatible configuration by executing a local `dw.js` script in your working directory.
1212

13-
### Why Use `dw.js` with B2C CLI
13+
### Benefits
1414

15-
Using `dw.js` lets Prophet consume the same resolved configuration used by `b2c` commands, including values resolved from:
15+
The generated `dw.js` bridge lets Prophet automatically consume the same resolved configuration used by `b2c` commandsincluding `dw.json`, environment variables, `.env` files, active instance selection, and configuration plugins. No manual syncing required.
1616

17-
- `dw.json`
18-
- environment variables and `.env`
19-
- active instance selection
20-
- configuration plugins registered with the CLI
21-
22-
The script resolves configuration at runtime by running:
23-
24-
```bash
25-
b2c setup inspect --json --unmask
26-
```
27-
28-
Then it maps the resolved config into Prophet-friendly `dw.json`-style keys.
29-
30-
If `setup inspect` cannot be executed in the extension runtime, the script falls back to loading `dw.json` from `SFCC_CONFIG` or the `dw.js` directory.
31-
32-
### Generate `dw.js` Automatically (Recommended)
17+
### Setup
3318

3419
```bash
35-
# Generate ./dw.js
20+
# Generate ./dw.js in your project root
3621
b2c setup ide prophet
3722

3823
# Overwrite an existing file
@@ -42,6 +27,13 @@ b2c setup ide prophet --force
4227
b2c setup ide prophet --output .vscode/dw.js
4328
```
4429

30+
### Switching Active Instances
31+
32+
Prophet evaluates `dw.js` when VS Code starts. If you switch the active instance with `b2c setup instance set-active`, you need to reload the VS Code window for Prophet to pick up the new configuration:
33+
34+
1. Open the command palette (`Cmd+Shift+P` / `Ctrl+Shift+P`)
35+
2. Run **Developer: Reload Window**
36+
4537
### Manual `dw.js` Example
4638

4739
If you want to author the file yourself, match the same pattern as the generated script:
@@ -119,6 +111,20 @@ It also passes through Prophet-specific fields when available:
119111

120112
- The generated script uses `--unmask` at runtime, so secrets are exposed to Prophet as needed for connection.
121113
- You can regenerate the file any time with `b2c setup ide prophet --force`.
122-
- Dynamic cartridge path discovery can be layered on later. For now, `cartridgesPath` is passed through when available.
123-
- When inspect/fallback resolution fails, the script logs diagnostic messages to both stdout and stderr and exports `{}`.
124-
- The generated script resolves the project root from `SFCC_WORKING_DIRECTORY`, `SFCC_CONFIG`, or the script directory (`__dirname`) before falling back to `process.cwd()`.
114+
- If the CLI cannot be executed in the extension runtime, the script falls back to loading `dw.json` directly.
115+
116+
## IntelliJ SFCC Plugin
117+
118+
The [IntelliJ SFCC plugin](https://plugins.jetbrains.com/plugin/13668-salesforce-b2c-commerce-sfcc-) manages its own connection settings in `.idea/misc.xml`. A community B2C CLI plugin lets you share that configuration with the CLI so both tools stay in sync.
119+
120+
### Setup
121+
122+
Install the [b2c-plugin-intellij-sfcc-config](https://github.com/sfcc-solutions-share/b2c-plugin-intellij-sfcc-config) plugin:
123+
124+
```bash
125+
b2c plugins install sfcc-solutions-share/b2c-plugin-intellij-sfcc-config
126+
```
127+
128+
Once installed, run CLI commands from your IntelliJ project directory and the plugin will automatically load connection settings from `.idea/misc.xml`.
129+
130+
See the [3rd Party Plugins](./third-party-plugins#intellij-sfcc-config-plugin) guide for full details on environment variables, credential decryption, and instance selection.

0 commit comments

Comments
 (0)