Skip to content

Commit 413c5f7

Browse files
committed
Merge release/v0.4.0
2 parents 2863e20 + 762047a commit 413c5f7

400 files changed

Lines changed: 22516 additions & 4736 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can also write the file by hand if you prefer:
1717

1818
```md
1919
---
20-
"@opencollection/docs": patch
20+
"@usebruno/api-docs": patch
2121
---
2222

2323
Short, user-facing summary of what changed.

‎.changeset/eslint-husky-tooling.md‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.github/workflows/changeset.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
| sed -e 's#[^a-z0-9]#-#g' -e 's#--*#-#g' -e 's#^-##' -e 's#-$##')
3636
3737
mkdir -p .changeset
38-
printf -- '---\n"@opencollection/docs": %s\n---\n\n%s (#%s)\n' \
38+
printf -- '---\n"@usebruno/api-docs": %s\n---\n\n%s (#%s)\n' \
3939
"$bump" "$TITLE" "$NUMBER" > ".changeset/${slug}.md"
4040
4141
cat ".changeset/${slug}.md"

‎.github/workflows/ci.yml‎

Lines changed: 111 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ on:
66
types: [opened, synchronize, reopened, ready_for_review]
77
push:
88
branches: [main, 'release/**']
9+
paths-ignore: ['**/*.md', 'LICENSE', '.gitignore']
910

1011

1112

13+
permissions:
14+
contents: read
15+
pull-requests: read
16+
1217
concurrency:
1318
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1520

1621
jobs:
1722
lint_unit_tests_and_builds:
23+
needs: changes
24+
if: needs.changes.outputs.renderer == 'true'
1825
runs-on: ubuntu-latest
1926
steps:
2027
# eslint-plugin-diff needs the base branch present to diff against.
@@ -43,8 +50,8 @@ jobs:
4350
run: npm run build:standalone -w packages/bruno-api-docs
4451

4552
e2e:
46-
needs: lint_unit_tests_and_builds
47-
if: github.event_name == 'push' || github.event.pull_request.draft == false
53+
needs: [changes, lint_unit_tests_and_builds]
54+
if: needs.changes.outputs.renderer == 'true'
4855
runs-on: ubuntu-latest
4956
defaults:
5057
run:
@@ -70,3 +77,104 @@ jobs:
7077
name: playwright-report
7178
path: packages/bruno-api-docs/playwright-report/
7279
retention-days: 30
80+
81+
changes:
82+
# nothing runs on a draft; marking it ready is a trigger of its own
83+
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
84+
runs-on: ubuntu-latest
85+
outputs:
86+
renderer: ${{ steps.renderer.outputs.renderer }}
87+
integrations: ${{ steps.integrations.outputs.integrations }}
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
91+
id: renderer
92+
with:
93+
predicate-quantifier: 'every'
94+
filters: |
95+
renderer:
96+
- '!integrations/**'
97+
- '!examples/integrations/**'
98+
- '!**/*.md'
99+
- '!LICENSE'
100+
- '!.gitignore'
101+
- uses: dorny/paths-filter@0e4a8c6effa4802afeda77dc8d303f8176d7dfad # v3
102+
id: integrations
103+
with:
104+
filters: |
105+
integrations:
106+
- 'integrations/**'
107+
- 'examples/integrations/**'
108+
- '.github/workflows/ci.yml'
109+
- '.github/workflows/integrations-matrix.yml'
110+
111+
integrations:
112+
needs: changes
113+
# a job-level if, not a workflow paths filter: a skipped job still reports and satisfies the required check
114+
if: needs.changes.outputs.integrations == 'true'
115+
runs-on: ubuntu-latest
116+
# checks: write is for the test reporter; job-scoped so the renderer jobs keep least privilege
117+
permissions:
118+
contents: read
119+
checks: write
120+
defaults:
121+
run:
122+
working-directory: integrations
123+
env:
124+
FORCE_COLOR: 1
125+
JUNIT_DIR: results
126+
steps:
127+
- uses: actions/checkout@v4
128+
129+
- uses: jdx/mise-action@v2
130+
with:
131+
working_directory: integrations
132+
133+
- uses: actions/cache@v4
134+
with:
135+
path: ~/.npm
136+
key: npm-integrations-${{ hashFiles('integrations/package-lock.json') }}
137+
restore-keys: npm-integrations-
138+
139+
- run: npm ci
140+
141+
- name: lint
142+
run: npm run lint
143+
144+
- name: build
145+
run: npm run build
146+
147+
- name: unit
148+
run: bash nodejs/scripts/unit.sh
149+
150+
- name: contract, every framework byte for byte
151+
run: bash nodejs/scripts/check-all.sh
152+
153+
- name: examples
154+
run: bash contract-tests/examples.sh
155+
156+
- name: one matrix cell, from packed tarballs
157+
run: bash nodejs/scripts/matrix.sh --cell express@5 --results results
158+
159+
# every assertion in the Checks tab, failures as annotations
160+
- uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
161+
if: always()
162+
with:
163+
name: integrations
164+
path: integrations/results/**/*.xml
165+
reporter: java-junit
166+
fail-on-error: false
167+
168+
# both tiers depend on the live CDN bundle, which this repo does not control, so neither can
169+
# block a merge. `contract` is ours to fix when red; `renderer` is theirs to know about.
170+
- name: browser
171+
continue-on-error: true
172+
run: npx playwright install --with-deps chromium
173+
174+
- name: browser, our contract
175+
continue-on-error: true
176+
run: npx playwright test --config contract-tests/browser/playwright.config.mjs --project=contract
177+
178+
- name: browser, the renderer
179+
continue-on-error: true
180+
run: npx playwright test --config contract-tests/browser/playwright.config.mjs --project=renderer
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Integrations matrix
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
pull_request:
8+
branches: [main, 'release/**']
9+
types: [labeled, synchronize, ready_for_review]
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
checks: write
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19+
20+
env:
21+
FORCE_COLOR: 1
22+
23+
jobs:
24+
cells:
25+
if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'run-integrations-matrix-tests'))
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
node: [22, 24]
31+
family: [express, fastify, nestjs]
32+
name: node ${{ matrix.node }} / ${{ matrix.family }}
33+
defaults:
34+
run:
35+
working-directory: integrations
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- run: npm ci
44+
45+
- run: npm run build
46+
47+
- run: bash nodejs/scripts/matrix.sh --family ${{ matrix.family }} --results results
48+
49+
- uses: actions/upload-artifact@v4
50+
if: always()
51+
with:
52+
name: matrix-${{ matrix.node }}-${{ matrix.family }}
53+
path: integrations/results
54+
55+
node-20:
56+
if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'run-integrations-matrix-tests'))
57+
runs-on: ubuntu-latest
58+
continue-on-error: true
59+
name: node 20 (end of life, courtesy)
60+
defaults:
61+
run:
62+
working-directory: integrations
63+
steps:
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: 20
68+
- run: npm ci
69+
- run: npm run build
70+
- run: bash nodejs/scripts/matrix.sh --results results
71+
- uses: actions/upload-artifact@v4
72+
if: always()
73+
with:
74+
name: matrix-20-all
75+
path: integrations/results
76+
77+
report:
78+
needs: [cells, node-20]
79+
if: always() && needs.cells.result != 'skipped'
80+
runs-on: ubuntu-latest
81+
name: results table
82+
defaults:
83+
run:
84+
working-directory: integrations
85+
steps:
86+
- uses: actions/checkout@v4
87+
88+
- uses: actions/download-artifact@v4
89+
with:
90+
pattern: matrix-*
91+
merge-multiple: true
92+
path: integrations/results
93+
94+
- run: |
95+
{
96+
echo "## Integrations matrix"
97+
echo
98+
bash nodejs/scripts/matrix.sh --report results --md
99+
echo
100+
echo "_${{ github.sha }} · node 20 is informational_"
101+
} > table.md
102+
cat table.md >> "$GITHUB_STEP_SUMMARY"
103+
104+
# every assertion in the Checks tab, failures as annotations
105+
- uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
106+
with:
107+
name: integrations matrix
108+
path: integrations/results/**/*.xml
109+
reporter: java-junit
110+
fail-on-error: false
111+
112+
# one comment per PR, updated in place on every run
113+
- if: github.event_name == 'pull_request'
114+
env:
115+
GH_TOKEN: ${{ github.token }}
116+
PR: ${{ github.event.pull_request.number }}
117+
run: |
118+
marker='<!-- integrations-matrix -->'
119+
printf '%s\n' "$marker" > body.md
120+
cat table.md >> body.md
121+
existing=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR/comments" --paginate \
122+
--jq ".[] | select(.body | startswith(\"$marker\")) | .id" | head -1)
123+
if [ -n "$existing" ]; then
124+
gh api -X PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$existing" -F body=@body.md >/dev/null
125+
else
126+
gh pr comment "$PR" --body-file body.md
127+
fi

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ test.js
66

77
# Claude Code
88
.claude/
9-
CLAUDE.md
9+
CLAUDE.md
10+
test-results
11+
!integrations/contract-tests/fixtures/walk-safety/node_modules/
12+
integrations/dist-tarballs
13+
integrations/shell/bru.js

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ See [Auto-generate documentation](https://docs.usebruno.com/api-docs/auto-genera
5353
| Path | What it is |
5454
|---|---|
5555
| [`packages/bruno-api-docs`](./packages/bruno-api-docs) | The renderer: a React app built as a library and as the **standalone bundle** (`dist-standalone/`), the artifact the Bruno app's generated HTML loads from the CDN. |
56-
| [`examples/`](./examples) | Consumption patterns: `standalone-html` (how a generated HTML file uses the bundle), `react` and `express-server` (design sketches of the intended embedding API; not shipped packages yet, see Roadmap). |
56+
| [`examples/`](./examples) | `standalone-html`, how a generated HTML page uses the bundle. `integrations/nodejs`, runnable examples for the framework packages, one folder per framework. |
5757

5858
## Roadmap
5959

0 commit comments

Comments
 (0)