@saptools/bruno 0.2.4 โ 0.2.6
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 +11 -9
- package/dist/cli.js +338 -274
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ You just ran Bruno against a production-grade XSUAA-protected service **without
|
|
|
46
46
|
- ๐ฆ **Bundled Bruno CLI fallback** โ if `bru` is already on your `PATH`, `saptools-bruno` uses it. If not, it falls back to the bundled [`@usebruno/cli`](https://www.npmjs.com/package/@usebruno/cli).
|
|
47
47
|
- ๐ฏ **Default context** โ `saptools-bruno use <shorthand>` pins a target so subsequent `run` calls need zero arguments. Feels like `cf target` for Bruno.
|
|
48
48
|
- ๐งฉ **CLI & typed API** โ every command has a zero-config Node.js equivalent. Full TypeScript definitions shipped. Bring your own prompts for headless/CI use.
|
|
49
|
-
- ๐งช **Fully tested** โ
|
|
49
|
+
- ๐งช **Fully tested** โ 81 unit tests + 7 offline e2e tests (stub `bru` binary + fixture CF snapshot). No network required in CI.
|
|
50
50
|
- ๐ชถ **Small + boring** โ three runtime deps, no background daemons, no plugin system, no magic.
|
|
51
51
|
|
|
52
52
|
---
|
|
@@ -159,13 +159,16 @@ Your `.bru` requests reference `{{accessToken}}` like any other Bruno variable
|
|
|
159
159
|
|
|
160
160
|
### ๐๏ธ `saptools-bruno setup-app`
|
|
161
161
|
|
|
162
|
-
Interactively scaffold a Bruno app folder inside the current
|
|
162
|
+
Interactively scaffold a Bruno app folder inside the current Bruno collection directory. Walks you through **region โ org โ space โ app**, then lets you **pick which environments to create** and add custom names without leaving the environment picker.
|
|
163
163
|
|
|
164
164
|
```bash
|
|
165
165
|
saptools-bruno setup-app
|
|
166
|
-
saptools-bruno --
|
|
166
|
+
saptools-bruno --collection ./collections setup-app
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
> [!TIP]
|
|
170
|
+
> `--collection` only applies to the current command. If you omit it, `saptools-bruno` falls back to `$SAPTOOLS_BRUNO_COLLECTION`, then to your current working directory.
|
|
171
|
+
|
|
169
172
|
**What you get**
|
|
170
173
|
|
|
171
174
|
- Folder tree: `region__<key>/org__<org>/space__<space>/<app>/environments/`
|
|
@@ -173,7 +176,7 @@ saptools-bruno --root ./collections setup-app
|
|
|
173
176
|
- Existing env files are preserved; only missing `__cf_*` vars are patched back in
|
|
174
177
|
|
|
175
178
|
> [!TIP]
|
|
176
|
-
> The env prompt shows the common names (`local`, `dev`, `staging`, `prod`) plus any envs already on disk. Pre-existing envs are **pre-checked**; common ones are **not** โ so you only create what you actually need. The custom
|
|
179
|
+
> The env prompt shows the common names (`local`, `dev`, `staging`, `prod`) plus any envs already on disk. Pre-existing envs are **pre-checked**; common ones are **not** โ so you only create what you actually need. The menu also includes **Add custom environment**, and once you enter a value like `qa-eu` or `uat.us`, it appears back in the same checklist already selected so you can review the full set before finishing.
|
|
177
180
|
|
|
178
181
|
### โถ๏ธ `saptools-bruno run`
|
|
179
182
|
|
|
@@ -196,7 +199,7 @@ saptools-bruno run ./region__ap10/org__my-org/space__dev/my-srv --env dev
|
|
|
196
199
|
| Flag | Description |
|
|
197
200
|
| --- | --- |
|
|
198
201
|
| `-e, --env <name>` | Environment name (default: current context or first discovered env) |
|
|
199
|
-
| `--
|
|
202
|
+
| `--collection <dir>` | Bruno collection directory (default: `$SAPTOOLS_BRUNO_COLLECTION` or cwd) |
|
|
200
203
|
|
|
201
204
|
Under the hood this spawns `bru run <target> --env <name> --env-var accessToken=<token>`.
|
|
202
205
|
|
|
@@ -238,8 +241,7 @@ const result = await setupApp({
|
|
|
238
241
|
selectSpace: async (choices) => choices[0]!.value,
|
|
239
242
|
selectApp: async (choices) => choices[0]!.value,
|
|
240
243
|
confirmCreate: async () => true,
|
|
241
|
-
selectEnvironments: async ({ common }) => [...common],
|
|
242
|
-
inputCustomEnvName: async () => null,
|
|
244
|
+
selectEnvironments: async ({ common }) => [...common, "qa-eu"],
|
|
243
245
|
},
|
|
244
246
|
});
|
|
245
247
|
console.log(`Created ${result.environments.length} env files at ${result.appPath}`);
|
|
@@ -339,7 +341,7 @@ The `__cf_*` vars drive XSUAA lookup. `run` adds `accessToken` on the fly via `b
|
|
|
339
341
|
|
|
340
342
|
| Variable | Purpose |
|
|
341
343
|
| --- | --- |
|
|
342
|
-
| `
|
|
344
|
+
| `SAPTOOLS_BRUNO_COLLECTION` | Default Bruno collection directory when `--collection` isn't passed |
|
|
343
345
|
| `SAPTOOLS_ACCESS_TOKEN` | Exported to the spawned `bru` process (alongside `--env-var accessToken=โฆ`) |
|
|
344
346
|
| `SAP_EMAIL` / `SAP_PASSWORD` | Consumed by `@saptools/cf-xsuaa` when the token cache is cold |
|
|
345
347
|
|
|
@@ -385,7 +387,7 @@ Only when you add a new app folder. `setup-app` on an existing app is idempotent
|
|
|
385
387
|
<details>
|
|
386
388
|
<summary><b>How do I add an env that isn't <code>local</code> / <code>dev</code> / <code>staging</code> / <code>prod</code>?</b></summary>
|
|
387
389
|
|
|
388
|
-
|
|
390
|
+
Choose **Add custom environment** inside the checkbox list. After you type any `[A-Za-z0-9._-]+` name (for example `qa-eu` or `uat.us`), the prompt returns to the same checklist with that new environment already selected.
|
|
389
391
|
|
|
390
392
|
</details>
|
|
391
393
|
|