@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.
- package/.turbo/turbo-build$colon$ci.log +7 -7
- package/.turbo/turbo-test$colon$ci.log +14 -14
- package/CHANGELOG.md +29 -0
- package/README.md +30 -0
- package/coverage/clover.xml +297 -280
- package/coverage/coverage-final.json +2 -2
- package/coverage/index.html +19 -19
- package/coverage/src/codegen-bruno.ts.html +273 -126
- package/coverage/src/index.html +19 -19
- package/coverage/tests/helpers.ts.html +9 -9
- package/coverage/tests/index.html +1 -1
- package/dist/codegen-bruno.d.ts +11 -0
- package/dist/codegen-bruno.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen-bruno.ts +68 -19
- package/src/index.ts +11 -0
- package/tests/codegen-bruno.test.ts +97 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @contractkit/plugin-bruno@1.
|
|
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.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
[34mCLI[39m tsup v8.5.1
|
|
12
12
|
[34mCLI[39m Target: esnext
|
|
13
13
|
[34mESM[39m Build start
|
|
14
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
15
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m22.42 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m54.71 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 130ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 3824ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.52 KB[39m
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
> @contractkit/plugin-bruno@1.
|
|
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
|
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/packages/plugin-bruno[39m
|
|
7
7
|
[2mCoverage enabled with [22m[33mv8[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m tests/codegen-bruno.test.ts [2m([22m[
|
|
9
|
+
[32m✓[39m tests/codegen-bruno.test.ts [2m([22m[2m102 tests[22m[2m)[22m[33m 424[2mms[22m[39m
|
|
10
10
|
|
|
11
11
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
|
-
[2m Tests [22m [1m[
|
|
13
|
-
[2m Start at [22m
|
|
14
|
-
[2m Duration [22m
|
|
12
|
+
[2m Tests [22m [1m[32m102 passed[39m[22m[90m (102)[39m
|
|
13
|
+
[2m Start at [22m 19:55:22
|
|
14
|
+
[2m Duration [22m 5.19s[2m (transform 1.36s, setup 0ms, import 3.56s, tests 424ms, environment 0ms)[22m
|
|
15
15
|
|
|
16
16
|
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
17
|
-
|
|
18
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
19
|
-
|
|
20
|
-
All files | 85.
|
|
21
|
-
src |
|
|
22
|
-
codegen-bruno.ts |
|
|
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
|