pi-for-excel-python-bridge 0.1.0-pre → 0.1.1-pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/cli.mjs +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,19 +13,19 @@ This command:
|
|
|
13
13
|
1. Ensures `mkcert` exists (installs via Homebrew on macOS if missing)
|
|
14
14
|
2. Creates certificates in `~/.pi-for-excel/certs/` when needed
|
|
15
15
|
3. Starts the bridge at `https://localhost:3340`
|
|
16
|
+
4. Runs in real local execution mode by default
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
For real local execution mode:
|
|
18
|
+
To force safe simulated mode:
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
|
-
PYTHON_BRIDGE_MODE=
|
|
21
|
+
PYTHON_BRIDGE_MODE=stub npx pi-for-excel-python-bridge
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
Then in Pi for Excel:
|
|
26
25
|
|
|
27
|
-
1.
|
|
28
|
-
2. (Optional)
|
|
26
|
+
1. The default Python bridge URL is already `https://localhost:3340`
|
|
27
|
+
2. (Optional) set `/experimental python-bridge-url <url>` to use a non-default URL
|
|
28
|
+
3. (Optional) run `/experimental python-bridge-token <token>` if you set `PYTHON_BRIDGE_TOKEN`
|
|
29
29
|
|
|
30
30
|
## Publishing (maintainers)
|
|
31
31
|
|
package/cli.mjs
CHANGED
|
@@ -174,12 +174,23 @@ function applyDefaultPort(env) {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
function applyDefaultMode(env) {
|
|
178
|
+
const configuredMode = typeof env.PYTHON_BRIDGE_MODE === "string"
|
|
179
|
+
? env.PYTHON_BRIDGE_MODE.trim()
|
|
180
|
+
: "";
|
|
181
|
+
|
|
182
|
+
if (configuredMode.length === 0) {
|
|
183
|
+
env.PYTHON_BRIDGE_MODE = "real";
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
function startBridge(bridgeArgs) {
|
|
178
188
|
fs.mkdirSync(certDir, { recursive: true });
|
|
179
189
|
console.log(`[${PACKAGE_TAG}] Using certificate directory: ${certDir}`);
|
|
180
190
|
|
|
181
191
|
const childEnv = { ...process.env };
|
|
182
192
|
applyDefaultPort(childEnv);
|
|
193
|
+
applyDefaultMode(childEnv);
|
|
183
194
|
|
|
184
195
|
if (typeof childEnv.PI_FOR_EXCEL_CERT_DIR !== "string" || childEnv.PI_FOR_EXCEL_CERT_DIR.trim().length === 0) {
|
|
185
196
|
childEnv.PI_FOR_EXCEL_CERT_DIR = certDir;
|