@contractkit/plugin-bruno 1.0.0 → 1.2.0

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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @contractkit/plugin-bruno@1.0.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
2
+ > @contractkit/plugin-bruno@1.2.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
3
3
  > eslint --max-warnings=0 && pnpm run build
4
4
 
5
5
 
6
- > @contractkit/plugin-bruno@1.0.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
6
+ > @contractkit/plugin-bruno@1.2.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
7
7
  > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
8
8
 
9
9
  CLI Building entry: src/index.ts
@@ -11,9 +11,9 @@
11
11
  CLI tsup v8.5.1
12
12
  CLI Target: esnext
13
13
  ESM Build start
14
- ESM dist/index.js 20.98 KB
15
- ESM dist/index.js.map 50.34 KB
16
- ESM ⚡️ Build success in 158ms
14
+ ESM dist/index.js 22.42 KB
15
+ ESM dist/index.js.map 54.71 KB
16
+ ESM ⚡️ Build success in 130ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 3705ms
19
- DTS dist/index.d.ts 2.09 KB
18
+ DTS ⚡️ Build success in 3824ms
19
+ DTS dist/index.d.ts 2.52 KB
@@ -1,25 +1,25 @@
1
1
 
2
- > @contractkit/plugin-bruno@1.0.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
2
+ > @contractkit/plugin-bruno@1.2.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
3
3
  > vitest run --coverage
4
4
 
5
5
 
6
6
   RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
7
7
  Coverage enabled with v8
8
8
 
9
- ✓ tests/codegen-bruno.test.ts (96 tests) 489ms
9
+ ✓ tests/codegen-bruno.test.ts (102 tests) 424ms
10
10
 
11
11
   Test Files  1 passed (1)
12
-  Tests  96 passed (96)
13
-  Start at  18:49:07
14
-  Duration  4.73s (transform 1.31s, setup 0ms, import 3.04s, tests 489ms, environment 0ms)
12
+  Tests  102 passed (102)
13
+  Start at  19:55:22
14
+  Duration  5.19s (transform 1.36s, setup 0ms, import 3.56s, tests 424ms, environment 0ms)
15
15
 
16
16
   % Coverage report from v8
17
- -------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
18
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
19
- -------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
20
- All files | 85.26 | 76.65 | 85.91 | 87.05 |
21
- src | 86.73 | 76.56 | 91.3 | 88.19 |
22
- codegen-bruno.ts | 86.73 | 76.56 | 91.3 | 88.19 | 285-286,370,378,431-434,441-448,468,474,478-480,496,506,530,540-542,548-550,555,559-567,576,580
23
- tests | 75 | 77.41 | 76 | 78.94 |
24
- helpers.ts | 75 | 77.41 | 76 | 78.94 | 43-47,55-59,71,113,133,145
25
- -------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
17
+ -------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------------
18
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
19
+ -------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------------
20
+ All files | 85.82 | 76.41 | 86.84 | 87.42 |
21
+ src | 87.27 | 76.29 | 92.15 | 88.54 |
22
+ codegen-bruno.ts | 87.27 | 76.29 | 92.15 | 88.54 | 98,334-335,419,427,480-483,490-497,517,523,527-529,545,555,579,589-591,597-599,604,608-616,625,629
23
+ tests | 75 | 77.41 | 76 | 78.94 |
24
+ helpers.ts | 75 | 77.41 | 76 | 78.94 | 43-47,55-59,71,113,133,145
25
+ -------------------|---------|----------|---------|---------|----------------------------------------------------------------------------------------------------
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @contractkit/contractkit-plugin-bruno
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e54256e: Sort the Bruno collection alphabetically during codegen.
8
+
9
+ Top-level folders now order by area name (with subarea as a tiebreaker), and requests within a folder order by request name. The emitted `seq:` numbers — which drive Bruno's UI ordering — line up with that alphabetical sort, regardless of the order the source `.ck` files declare operations.
10
+
11
+ ## 1.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 20ce949: Add `environments` config for the Bruno plugin.
16
+
17
+ Provide a map of environment name → variables in the plugin config and the codegen will emit one `environments/<name>.yml` per entry. Useful for shipping multiple Bruno environments (local, staging, etc.) alongside the generated collection.
18
+
19
+ ```json
20
+ "@contractkit/plugin-bruno": {
21
+ "environments": {
22
+ "local": {
23
+ "baseUrl": "http://localhost:3000",
24
+ "token": ""
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ When `environments` is omitted, the default `environments/local.yml` is emitted (existing behavior). When provided, it replaces the default — include auth variables (e.g. `token`) explicitly if you need them. Also fixes a small omission in `createBrunoPlugin`: `includeInternal` is now forwarded to the codegen, matching the default plugin export.
31
+
3
32
  ## 1.0.0
4
33
 
5
34
  ### Major Changes
package/README.md CHANGED
@@ -41,6 +41,7 @@ pnpm add @contractkit/contractkit-plugin-bruno
41
41
  | `includeInternal` | `boolean` | `true` | Include operations marked `internal`. Set to `false` to omit them from the collection. |
42
42
  | `auth.defaultScheme` | `string` | — | Key from `auth.schemes` to apply by default |
43
43
  | `auth.schemes` | `object` | — | Map of scheme name → security scheme definition |
44
+ | `environments` | `object` | — | Map of environment name → variables. Each entry produces a `environments/<name>.yml` file. See [Environments](#environments). |
44
45
 
45
46
  ### Auth scheme types
46
47
 
@@ -103,6 +104,35 @@ operation /payments/{id}: {
103
104
 
104
105
  The `{{bruno}}` reference can also be supplied workspace-wide via the plugin's `keys` config in `contractkit.config.json`.
105
106
 
107
+ ## Environments
108
+
109
+ Provide an `environments` block in the plugin config to control what `environments/<name>.yml` files Bruno sees. Each top-level key becomes a file; its values become the variables in that file:
110
+
111
+ ```json
112
+ {
113
+ "plugins": {
114
+ "@contractkit/contractkit-plugin-bruno": {
115
+ "environments": {
116
+ "local": {
117
+ "baseUrl": "http://localhost:3000",
118
+ "token": ""
119
+ },
120
+ "staging": {
121
+ "baseUrl": "https://staging.example.com",
122
+ "token": ""
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ Notes:
131
+
132
+ - Variable values are coerced to strings and always emitted with double quotes.
133
+ - When `environments` is omitted or empty, a default `environments/local.yml` is emitted with `baseUrl=http://localhost:3000` plus any auth env-var placeholders the default `auth` scheme requires.
134
+ - When `environments` is provided, the default is replaced entirely — auth variables are not auto-injected, so include them explicitly if needed.
135
+
106
136
  ## Programmatic use
107
137
 
108
138
  ```typescript