You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/ide-integration.md
+29-23Lines changed: 29 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
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.
3
3
---
4
4
5
5
# IDE Integration
@@ -10,29 +10,14 @@ This guide explains how to connect IDE extensions to your B2C CLI configuration.
10
10
11
11
[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.
12
12
13
-
### Why Use `dw.js` with B2C CLI
13
+
### Benefits
14
14
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` commands — including `dw.json`, environment variables, `.env` files, active instance selection, and configuration plugins. No manual syncing required.
16
16
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
33
18
34
19
```bash
35
-
# Generate ./dw.js
20
+
# Generate ./dw.js in your project root
36
21
b2c setup ide prophet
37
22
38
23
# Overwrite an existing file
@@ -42,6 +27,13 @@ b2c setup ide prophet --force
42
27
b2c setup ide prophet --output .vscode/dw.js
43
28
```
44
29
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
+
45
37
### Manual `dw.js` Example
46
38
47
39
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:
119
111
120
112
- The generated script uses `--unmask` at runtime, so secrets are exposed to Prophet as needed for connection.
121
113
- 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:
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