@http-forge/core 0.6.38 → 0.6.39
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 +47 -0
- package/dist/index.js +76 -76
- package/dist/index.mjs +76 -76
- package/dist/infrastructure/collection/folder-collection-store.d.ts +1 -0
- package/dist/infrastructure/collection/json-collection-loader.d.ts +1 -1
- package/dist/infrastructure/config/config-service.d.ts +9 -4
- package/dist/infrastructure/test-suite/test-suite-service.d.ts +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -394,6 +394,53 @@ const forge = new ForgeContainer({
|
|
|
394
394
|
- If using CLI, include `--exit-code`.
|
|
395
395
|
- If embedding `@http-forge/core` directly or bootstrapping a Node runtime, call `container.dispose()` before your process exits so runtime file watchers and disposable services are released cleanly.
|
|
396
396
|
|
|
397
|
+
## 🗂️ Workspace Modes & Configuration
|
|
398
|
+
|
|
399
|
+
HTTP Forge supports two Git layouts with the same engine. All paths in `http-forge.config.json` are **relative to the config file that defines them**, not to the workspace root.
|
|
400
|
+
|
|
401
|
+
### Integrated — `.http-forge` inside a project (default)
|
|
402
|
+
|
|
403
|
+
You open the project root (`my-project`). `.http-forge` is a literal subfolder:
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
my-project/ ← workspace you open
|
|
407
|
+
├─ http-forge.config.json ← OPTIONAL, if present it WINS
|
|
408
|
+
└─ .http-forge/
|
|
409
|
+
├─ http-forge.config.json ← fallback if root config missing
|
|
410
|
+
└─ assets/
|
|
411
|
+
├─ collections/ (shopping-cart-api/ …)
|
|
412
|
+
├─ environments/ (dev.json, _global.json)
|
|
413
|
+
└─ suites/
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
*No config:* `root = my-project/.http-forge/assets`.
|
|
417
|
+
*Root config* `{"storage":{"root":"./custom"}}` → `my-project/custom`.
|
|
418
|
+
*Nested config* `{"storage":{"root":"./assets"}}` in `.http-forge/` → `my-project/.http-forge/assets`. Old `"./.http-forge/assets"` inside `.http-forge` is automatically stripped for backward compat.
|
|
419
|
+
|
|
420
|
+
### Standalone — `.http-forge` is its own repo (any name)
|
|
421
|
+
|
|
422
|
+
Clone the forge repo anywhere (`my-standalone`, `http-forge-assets`, `acme-tests` — **not** required to be named `.http-forge`) and open that folder. No nested `.http-forge` layer:
|
|
423
|
+
|
|
424
|
+
```
|
|
425
|
+
my-standalone/ ← workspace = forge root, any name
|
|
426
|
+
├─ http-forge.config.json ← OPTIONAL {"storage":{"root":"./assets"}}
|
|
427
|
+
├─ assets/
|
|
428
|
+
│ ├─ collections/
|
|
429
|
+
│ └─ environments/
|
|
430
|
+
└─ .cache/
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Bare `collections/` at root (`http-forge-assets` today) also works: `root = my-bare` when `my-bare/collections/c1/collection.json` exists.
|
|
434
|
+
|
|
435
|
+
*No config:* probes `my-standalone/.http-forge/assets` (miss) → `my-standalone/assets` (hit) → `my-standalone/assets`; bare → `my-standalone` itself.
|
|
436
|
+
*With `my-standalone/http-forge.config.json` `{"storage":{"root":"./assets"}}` → `my-standalone/assets`. Old `"./.http-forge/assets"` + standalone is stripped to `"./assets"`.
|
|
437
|
+
|
|
438
|
+
**Priority:** `workspace/http-forge.config.json` **before** `workspace/.http-forge/http-forge.config.json` (previously opposite). Same for `proxy`, `scripts.modulePaths`, `storage.history/results`, `restClientExport.path`, cert paths.
|
|
439
|
+
|
|
440
|
+
**Opening `assets` directly:** `my-standalone/assets` → normalizes to `my-standalone`; `my-project/.http-forge/assets` → normalizes to `my-project`. Both load the same `assets/collections`. The check is structural (`assets/collections` exists), not name-based, so a standalone repo named anything works.
|
|
441
|
+
|
|
442
|
+
**Lazy creation:** Opening an empty folder does **not** create `.http-forge` on activation. It is created only on first `createCollection()` / `createSuite()` / `saveEnvironment()` — then `assets/collections` + `AGENTS.md` appear. This applies to both modes and any folder name.
|
|
443
|
+
|
|
397
444
|
## 📚 Core Concepts
|
|
398
445
|
|
|
399
446
|
### ForgeContainer
|