Skip to content

Commit e2ef491

Browse files
committed
chore: extract oc-docs as bruno-api-docs, remove other packages
1 parent 2fe298c commit e2ef491

729 files changed

Lines changed: 1202 additions & 25399 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.

‎.github/workflows/e2e.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
defaults:
1313
run:
14-
working-directory: packages/oc-docs
14+
working-directory: packages/bruno-api-docs
1515
steps:
1616
- uses: actions/checkout@v4
1717

@@ -31,5 +31,5 @@ jobs:
3131
if: ${{ !cancelled() }}
3232
with:
3333
name: playwright-report
34-
path: packages/oc-docs/playwright-report/
34+
path: packages/bruno-api-docs/playwright-report/
3535
retention-days: 30

‎README.md‎

Lines changed: 13 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,25 @@
1-
# OpenCollection
1+
# bruno-api-docs
22

3-
An open specification for describing **executable API collections**: requests, environments, variables, authentication, scripts, and assertions, stored as plain YAML.
3+
`@opencollection/docs` — an interactive API documentation site and request playground for the [OpenCollection](https://www.opencollection.com) format.
44

5-
## What is OpenCollection?
5+
Point it at an OpenCollection and it renders a browsable docs site: a sidebar of requests, per-request documentation (params, headers, body, auth, scripts, assertions), and a live playground that sends the request and shows the response.
66

7-
OpenCollection is a format for describing API collections in a way that tools can read, write, and run. A collection is a tree of HTTP, GraphQL, gRPC, and WebSocket requests, together with the environments, variables, auth, scripts, and assertions needed to actually send them.
8-
9-
Most API formats describe a contract. OpenAPI tells you an endpoint exists, what it accepts, and what it returns. OpenCollection captures the next step: the concrete request, with these headers, this body, this environment, this token, and these assertions on the response. A collection is something you run, not just something you read.
10-
11-
The format is plain YAML with a published JSON Schema. It is an open specification: published, openly licensed, and not tied to any single application or proprietary format.
12-
13-
## Why it exists
14-
15-
| Layer | Format | Answers |
16-
|---|---|---|
17-
| Contract | OpenAPI | What does this API look like? |
18-
| Orchestration | Arazzo | How do I chain calls across APIs? |
19-
| **Execution** | **OpenCollection** | **Send this request, with these variables, and check this result.** |
20-
21-
OpenAPI has no concept of "send this request now, with these variables, and assert this response." That executable working set is what teams keep in their API client, and until now it has lived in proprietary, tool-locked formats. OpenCollection is that artifact in an open, neutral YAML format.
22-
23-
## The specification
24-
25-
The current version is **1.0.0**. The schema is authored in [JSON Schema (draft-07)](http://json-schema.org/draft-07/schema#).
26-
27-
- Read the human-readable spec at [spec.opencollection.com](https://spec.opencollection.com).
28-
- Browse the schema interactively at [schema.opencollection.com](https://schema.opencollection.com).
29-
- Read the schema source at [`packages/oc-schema/src/opencollection.schema.json`](./packages/oc-schema/src/opencollection.schema.json).
30-
31-
## Example
32-
33-
```yaml
34-
opencollection: "1.0.0"
35-
info:
36-
name: Sample API
37-
version: "1.0.0"
38-
items:
39-
- info:
40-
name: Get Users
41-
type: http
42-
http:
43-
method: GET
44-
url: https://api.example.com/users
45-
params:
46-
- name: limit
47-
value: "10"
48-
type: query
49-
```
50-
51-
A collection can be a single bundled file or a tree of files and folders on disk.
52-
53-
## Adoption
54-
55-
[Bruno](https://www.usebruno.com), the open-source, git-native API client used by tens of thousands of teams, reads and writes OpenCollection as a native storage format. Bruno can generate documentation from a collection and import from and export to other formats through the same schema.
56-
57-
## Repository layout
58-
59-
This repository is an npm-workspaces monorepo.
60-
61-
### Published packages
62-
63-
| Package | Description |
64-
|---|---|
65-
| [`@opencollection/schema`](./packages/oc-schema) | The JSON Schema definitions for the OpenCollection format. |
66-
| [`@opencollection/types`](./packages/oc-types) | TypeScript types for the OpenCollection schema. |
67-
| [`@opencollection/converters`](./packages/oc-converters) | Converters from other collection formats into OpenCollection. |
68-
69-
### Sites in this repository
70-
71-
| Directory | Description |
72-
|---|---|
73-
| [`packages/oc-spec-site`](./packages/oc-spec-site) | The human-readable specification site (spec.opencollection.com). |
74-
| [`packages/oc-schema-explorer`](./packages/oc-schema-explorer) | The interactive schema explorer (schema.opencollection.com). |
75-
76-
## Using OpenCollection in your tools
77-
78-
OpenCollection is meant to be consumed by any tool. The packages below let you read, validate, and manipulate collections through openly-licensed libraries with no dependency on a particular application.
79-
80-
### Validate a collection
81-
82-
For a tool that ingests OpenCollection files (a CI check, an editor integration, a registry that validates on publish), the schema is published so you can validate against it directly:
7+
## Install
838

849
```bash
85-
npm install @opencollection/schema ajv
86-
```
87-
88-
```js
89-
import Ajv from 'ajv';
90-
import { OpenCollectionSchema } from '@opencollection/schema';
91-
92-
const ajv = new Ajv({ allErrors: true });
93-
const validate = ajv.compile(OpenCollectionSchema);
94-
95-
if (!validate(myCollection)) {
96-
console.error(validate.errors);
97-
}
10+
npm install @opencollection/docs
9811
```
9912

100-
### Work with collections in TypeScript
13+
## Usage
10114

102-
For type-safe access to collection objects in a TypeScript project:
103-
104-
```bash
105-
npm install --save-dev @opencollection/types
106-
```
107-
108-
### Migrate existing collections
109-
110-
To convert collections from another format into OpenCollection:
111-
112-
```bash
113-
npm install @opencollection/converters
114-
```
115-
116-
```js
117-
import { brunoToOpenCollection } from '@opencollection/converters';
118-
119-
const collection = brunoToOpenCollection(brunoCollection);
120-
```
15+
It ships three ways:
12116

122-
## Project and maintenance
17+
- **React component** — import `OpenCollection` and pass it a collection.
18+
- **Standalone bundle** — a self-contained JS/CSS build (`dist-standalone/`) for dropping into any page, served from the CDN.
19+
- **Express / server entry** — render the docs from a Node server.
12320

124-
OpenCollection is currently authored and maintained by [Bruno](https://www.usebruno.com). The specification, schema, and tooling are developed in the open, and contributions are welcome.
21+
See [`examples/`](./examples) for a working setup of each (`react`, `standalone-html`, `express-server`).
12522

126-
## Contributing
23+
## Development
12724

128-
See [contributing.md](./contributing.md) to build the packages locally. Issues and pull requests are tracked on [GitHub](https://github.com/opencollection-dev/opencollection).
25+
Work happens in `packages/bruno-api-docs`. See [contributing.md](./contributing.md) for setup, dev/test/build commands, and the PR flow.

‎contributing.md‎

Lines changed: 17 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Contributing to OpenCollection
1+
# Contributing to bruno-api-docs
22

3-
Thanks for your interest in OpenCollection. This guide covers how to set up the repository, work on the packages, and propose changes.
4-
5-
For an overview of what OpenCollection is and how the repository is organized, see the [README](./README.md).
3+
Thanks for your interest. This repo holds `@opencollection/docs`, the interactive API documentation site and request playground for the [OpenCollection](https://www.opencollection.com) format.
64

75
## Prerequisites
86

@@ -11,79 +9,33 @@ For an overview of what OpenCollection is and how the repository is organized, s
119

1210
## Setup
1311

14-
This repository is an npm-workspaces monorepo. Install all packages from the root:
15-
1612
```bash
17-
git clone https://github.com/opencollection-dev/opencollection.git
18-
cd opencollection
13+
git clone https://github.com/usebruno/bruno-api-docs.git
14+
cd bruno-api-docs
1915
npm install
2016
```
2117

22-
A single install at the root wires up every workspace.
23-
24-
## Working on the packages
25-
26-
Run a workspace script with `npm run <script> --workspace=<package-name>`.
27-
28-
### `@opencollection/schema`
29-
30-
The JSON Schema definitions for the OpenCollection format, and the source of truth for the spec. The schema files live in [`packages/oc-schema/src`](./packages/oc-schema/src). There is no build step: edit the JSON directly.
31-
32-
Any change to the schema is a change to the specification. Update the schema explorer and the spec site to match, and follow the versioning rules below.
33-
34-
### `@opencollection/types`
35-
36-
TypeScript types for the OpenCollection schema. Build with:
37-
38-
```bash
39-
npm run build --workspace=@opencollection/types
40-
```
41-
42-
Keep the types in sync with the schema whenever the schema changes.
43-
44-
### `@opencollection/converters`
18+
## Development
4519

46-
Converters from other collection formats into OpenCollection. Plain JavaScript source in [`packages/oc-converters/src`](./packages/oc-converters/src); no build step.
20+
Run these from `packages/bruno-api-docs`:
4721

48-
### Schema explorer
49-
50-
The interactive schema explorer served at schema.opencollection.com. A Vite app:
51-
52-
```bash
53-
npm run dev --workspace=@opencollection/schema-explorer # local dev server
54-
npm run build --workspace=@opencollection/schema-explorer # production build
55-
npm run preview --workspace=@opencollection/schema-explorer # preview the build
56-
```
57-
58-
The build copies the schema from `@opencollection/schema`, so run a fresh build after changing the schema.
59-
60-
### Spec site
61-
62-
The human-readable specification served at spec.opencollection.com. A Vite app:
63-
64-
```bash
65-
npm run dev --workspace=oc-spec-site
66-
npm run build --workspace=oc-spec-site
67-
npm run preview --workspace=oc-spec-site
68-
```
22+
| Task | Command |
23+
|------|---------|
24+
| Dev server | `npm run dev` |
25+
| Unit tests | `npm run test:run` (watch: `npm test`) |
26+
| E2E tests | `npm run test:e2e` |
27+
| Lint | `npm run lint` |
28+
| Build | `npm run build` (CDN bundle: `npm run build:standalone`) |
6929

7030
## Making changes
7131

72-
1. Open or comment on an issue first for anything beyond a small fix, so the change can be discussed before you build it.
32+
1. Open or comment on an issue first for anything beyond a small fix.
7333
2. Create a branch from `main`.
74-
3. Make your change. If it touches the schema, update the types, the schema explorer, and the spec site so they stay consistent.
34+
3. Make your change and add or update tests. Run `npm run lint` and `npm run test:run` before pushing; run `npm run test:e2e` when UI behavior changed.
7535
4. Open a pull request against `main` describing the change and linking the issue.
7636

77-
Continuous integration runs end-to-end tests on pull requests via GitHub Actions.
78-
79-
## Changing the schema
80-
81-
The schema is the specification, so changes are versioned deliberately.
82-
83-
- Additive, backward-compatible changes are minor.
84-
- Changes that break existing valid collections are major and need a clear migration path.
85-
- Note the version impact of your change in the pull request.
37+
Continuous integration runs the end-to-end tests on pull requests via GitHub Actions.
8638

8739
## Reporting issues
8840

89-
File issues on [GitHub](https://github.com/opencollection-dev/opencollection/issues). For bugs, include the smallest collection that reproduces the problem and what you expected to happen.
41+
File issues on [GitHub](https://github.com/usebruno/bruno-api-docs/issues). For bugs, include the smallest collection that reproduces the problem and what you expected to happen.

‎examples/standalone-html/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
height: 100vh;
1515
}
1616
</style>
17-
<link rel="stylesheet" href="../../packages/oc-docs/dist-standalone/api-docs.css">
18-
<script src="../../packages/oc-docs/dist-standalone/api-docs.js"></script>
17+
<link rel="stylesheet" href="../../packages/bruno-api-docs/dist-standalone/api-docs.css">
18+
<script src="../../packages/bruno-api-docs/dist-standalone/api-docs.js"></script>
1919
</head>
2020

2121

‎examples/standalone-html/index2.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
height: 100vh;
1515
}
1616
</style>
17-
<link rel="stylesheet" href="../../packages/oc-docs/dist-standalone/api-docs.css">
18-
<script src="../../packages/oc-docs/dist-standalone/api-docs.js"></script>
17+
<link rel="stylesheet" href="../../packages/bruno-api-docs/dist-standalone/api-docs.css">
18+
<script src="../../packages/bruno-api-docs/dist-standalone/api-docs.js"></script>
1919
</head>
2020

2121

0 commit comments

Comments
 (0)