diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d334dbf..467d4d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,4 +69,5 @@ jobs: done git tag "v$version" git push origin "v$version" - gh release create "v$version" --generate-notes --verify-tag + (cd backend && npm ci && npm run openapi:generate -- "$version") + gh release create "v$version" backend/dist/openapi.yaml --generate-notes --verify-tag diff --git a/README.md b/README.md index 7c2dba9..cae4366 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ Open any Component with a `backstage.io/source-location` annotation. A "Runtime - [Usage: critical-path workflows](docs/usage.md) - [Architecture and API reference](docs/architecture.md) - [Fulfillment API for adapters](docs/fulfillment-api.md) +- [OpenAPI spec](docs/fulfillment-api.md#openapi-spec): generated from the backend routes and attached to every GitHub release - [Releases](docs/releases.md) ## Ecosystem diff --git a/backend/package-lock.json b/backend/package-lock.json index 4879091..53b7a0b 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -7,9 +7,12 @@ "": { "name": "@runtimeconditions/plugin-runtime-conditions-backend", "version": "0.1.0", + "license": "MIT", "dependencies": { + "@asteasolutions/zod-to-openapi": "^9.1.0", "@backstage/backend-plugin-api": "^0.6.0", - "express": "^4.18.0" + "express": "^4.18.0", + "zod": "^4.6.7" }, "devDependencies": { "@types/express": "^4.17.0", @@ -18,7 +21,20 @@ "jest": "^29.7.0", "supertest": "^6.3.0", "ts-jest": "^29.1.0", - "typescript": "^5.4.0" + "typescript": "^5.4.0", + "yaml": "^2.9.1" + } + }, + "node_modules/@asteasolutions/zod-to-openapi": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@asteasolutions/zod-to-openapi/-/zod-to-openapi-9.1.0.tgz", + "integrity": "sha512-pLMeRgRYS7/vZIgAAkOe2P6+XGTifR1MT9pqDoxZ11EmcJJ+DPmdPqLN8ZZF4U8R9KHCCQCS9c2wtuE8wSrfkw==", + "license": "MIT", + "dependencies": { + "openapi3-ts": "^4.6.0" + }, + "peerDependencies": { + "zod": "^4.0.0" } }, "node_modules/@aws-sdk/abort-controller": { @@ -493,6 +509,7 @@ "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz", "integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==", "license": "MIT", + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -563,6 +580,7 @@ "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", "integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==", "license": "MIT", + "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -762,6 +780,7 @@ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", @@ -1429,6 +1448,15 @@ "uuid": "dist/esm/bin/uuid" } }, + "node_modules/@backstage/backend-common/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@backstage/backend-dev-utils": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/@backstage/backend-dev-utils/-/backend-dev-utils-0.1.7.tgz", @@ -1483,6 +1511,15 @@ "zod": "^3.25.76" } }, + "node_modules/@backstage/catalog-model/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@backstage/cli-common": { "version": "0.1.18", "resolved": "https://registry.npmjs.org/@backstage/cli-common/-/cli-common-0.1.18.tgz", @@ -1676,6 +1713,15 @@ "uuid": "dist/esm/bin/uuid" } }, + "node_modules/@backstage/plugin-auth-node/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@backstage/plugin-catalog-common": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@backstage/plugin-catalog-common/-/plugin-catalog-common-1.2.0.tgz", @@ -1715,6 +1761,15 @@ "zod": "^3.22.4" } }, + "node_modules/@backstage/plugin-permission-common/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@backstage/plugin-search-common": { "version": "1.2.25", "resolved": "https://registry.npmjs.org/@backstage/plugin-search-common/-/plugin-search-common-1.2.25.tgz", @@ -2653,6 +2708,7 @@ "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.4.tgz", "integrity": "sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==", "license": "MIT", + "peer": true, "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", @@ -3272,6 +3328,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz", "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~8.9.0" } @@ -3526,6 +3583,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -3948,6 +4006,7 @@ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz", "integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==", "license": "Apache-2.0", + "peer": true, "peerDependencies": { "bare-abort-controller": "*" }, @@ -4229,6 +4288,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.11.26", "caniuse-lite": "^1.0.30001812", @@ -5548,6 +5608,7 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -7079,6 +7140,7 @@ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -8846,6 +8908,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/openapi3-ts": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-4.6.2.tgz", + "integrity": "sha512-gyyil3DweqhXiEhTqtAs9wwRLfWHmetwhI4kmM5Rn0d6gtmK863Ki7qqbQnp9+Wwlqoe3B1LFWj7kMp5ctE4rQ==", + "license": "MIT", + "dependencies": { + "yaml": "^2.9.1" + } + }, "node_modules/openid-client": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.1.tgz", @@ -9173,7 +9244,8 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/pg-int8": { "version": "1.0.1", @@ -11212,6 +11284,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11579,6 +11652,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz", "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -11739,10 +11813,11 @@ } }, "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/backend/package.json b/backend/package.json index 701d086..2fb5b3f 100644 --- a/backend/package.json +++ b/backend/package.json @@ -20,11 +20,14 @@ }, "scripts": { "build": "tsc -p tsconfig.build.json", - "test": "jest" + "test": "jest", + "openapi:generate": "npm run build && node scripts/generate-openapi.js" }, "dependencies": { + "@asteasolutions/zod-to-openapi": "^9.1.0", "@backstage/backend-plugin-api": "^0.6.0", - "express": "^4.18.0" + "express": "^4.18.0", + "zod": "^4.6.7" }, "devDependencies": { "@types/express": "^4.17.0", @@ -33,6 +36,7 @@ "jest": "^29.7.0", "supertest": "^6.3.0", "ts-jest": "^29.1.0", - "typescript": "^5.4.0" + "typescript": "^5.4.0", + "yaml": "^2.9.1" } } diff --git a/backend/scripts/generate-openapi.js b/backend/scripts/generate-openapi.js new file mode 100644 index 0000000..6d707a2 --- /dev/null +++ b/backend/scripts/generate-openapi.js @@ -0,0 +1,11 @@ +// Writes dist/openapi.yaml from the routes registered on the compiled router. +// Run via `npm run openapi:generate [version]`, which builds first. +const fs = require('fs'); +const path = require('path'); +const { stringify } = require('yaml'); +const { generateOpenApiDocument } = require('../dist/openapi'); + +const version = process.argv[2] || require('../package.json').version; +const out = path.resolve(__dirname, '../dist/openapi.yaml'); +fs.writeFileSync(out, stringify(generateOpenApiDocument(version))); +console.log(`Wrote ${out}`); \ No newline at end of file diff --git a/backend/src/openapi.test.ts b/backend/src/openapi.test.ts new file mode 100644 index 0000000..af2444a --- /dev/null +++ b/backend/src/openapi.test.ts @@ -0,0 +1,24 @@ +import express, { Router } from 'express'; +import { generateOpenApiDocument } from './openapi'; +import { validated } from './route'; + +describe('generateOpenApiDocument', () => { + it('documents every route registered on the router', () => { + const doc = generateOpenApiDocument('test'); + expect(Object.keys(doc.paths ?? {})).toEqual(['/fulfillments']); + expect(Object.keys(doc.paths?.['/fulfillments'] ?? {}).sort()).toEqual(['get', 'post']); + expect(Object.keys(doc.components?.schemas ?? {})).toContain('FulfillmentRecord'); + }); + + it('fails when a route is registered without validated()', () => { + const router = Router(); + router.get( + '/documented', + validated({ description: 'ok', responses: { 200: { description: 'ok' } } }, (_i, res) => + res.end(), + ), + ); + router.get('/undocumented', (_req: express.Request, res: express.Response) => res.end()); + expect(() => generateOpenApiDocument('test', router)).toThrow('/undocumented'); + }); +}); \ No newline at end of file diff --git a/backend/src/openapi.ts b/backend/src/openapi.ts new file mode 100644 index 0000000..c9bef27 --- /dev/null +++ b/backend/src/openapi.ts @@ -0,0 +1,60 @@ +import { OpenAPIRegistry, OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi'; +import { Router } from 'express'; +import { DocumentedHandler } from './route'; +import { createRouter } from './router'; + +type Method = 'get' | 'post' | 'put' | 'patch' | 'delete'; + +interface Layer { + route?: { + path: string; + methods: Record; + stack: { handle: Partial }[]; + }; +} + +/** Builds the OpenAPI document by walking the routes registered on the Express router. */ +export function generateOpenApiDocument(version: string, router: Router = createRouter()) { + const registry = new OpenAPIRegistry(); + + for (const layer of router.stack as Layer[]) { + if (!layer.route) continue; + const docs = layer.route.stack.map(s => s.handle.docs).find(Boolean); + if (!docs) { + throw new Error(`Route ${layer.route.path} has no docs; wrap its handler with validated()`); + } + for (const method of Object.keys(layer.route.methods) as Method[]) { + registry.registerPath({ + method, + path: layer.route.path, + description: docs.description, + request: { + ...(docs.body && { + body: { required: true, content: { 'application/json': { schema: docs.body } } }, + }), + ...(docs.query && { query: docs.query }), + }, + responses: Object.fromEntries( + Object.entries(docs.responses).map(([status, r]) => [ + status, + { + description: r.description, + ...(r.schema && { content: { 'application/json': { schema: r.schema } } }), + }, + ]), + ), + }); + } + } + + return new OpenApiGeneratorV3(registry.definitions).generateDocument({ + openapi: '3.0.3', + info: { + title: 'runtime-conditions', + version, + description: 'Fulfillment API for the Runtime Conditions Backstage plugin.', + license: { name: 'MIT' }, + }, + servers: [{ url: '/api/runtime-conditions' }], + }); +} \ No newline at end of file diff --git a/backend/src/route.ts b/backend/src/route.ts new file mode 100644 index 0000000..ade8244 --- /dev/null +++ b/backend/src/route.ts @@ -0,0 +1,33 @@ +import { Request, Response } from 'express'; +import { z } from 'zod'; + +export interface RouteDocs { + description: string; + body?: z.ZodType; + query?: z.ZodObject; + responses: Record; +} + +/** Docs are attached to the handler Express stores, so the spec can be read from the router. */ +export type DocumentedHandler = ((req: Request, res: Response) => void) & { docs: RouteDocs }; + +/** + * Wraps a route handler with request validation and attaches its docs. + * Use it like any other handler: router.post('/path', validated({...}, handler)). + */ +export function validated( + docs: RouteDocs & { body?: Body; query?: Query }, + handler: (input: { body: z.infer; query: z.infer }, res: Response) => void, +): DocumentedHandler { + const wrapped = (req: Request, res: Response) => { + const body = docs.body?.safeParse(req.body); + const query = docs.query?.safeParse(req.query); + const failed = [body, query].find(r => r && !r.success); + if (failed && !failed.success) { + res.status(400).json({ error: z.prettifyError(failed.error) }); + return; + } + handler({ body: body?.data as z.infer, query: query?.data as z.infer }, res); + }; + return Object.assign(wrapped, { docs }); +} \ No newline at end of file diff --git a/backend/src/router.ts b/backend/src/router.ts index c0c1f14..ba82cd2 100644 --- a/backend/src/router.ts +++ b/backend/src/router.ts @@ -1,15 +1,6 @@ import express, { Router } from 'express'; -import { FulfillmentRecord } from './types'; - -function isValid(record: Partial): record is FulfillmentRecord { - return Boolean( - record.profileName && - record.condition && - record.environment && - record.resources?.length && - record.resources.every(r => r.kind && r.provider && r.reference), - ); -} +import { validated } from './route'; +import { ErrorResponse, FulfillmentQuery, FulfillmentRecord } from './types'; export function createRouter(): Router { const router = Router(); @@ -17,29 +8,46 @@ export function createRouter(): Router { const fulfillments: FulfillmentRecord[] = []; - router.post('/fulfillments', (req, res) => { - const record = req.body as Partial; - if (!isValid(record)) { - res.status(400).json({ - error: - 'profileName, condition, environment, and a non-empty resources array (each with kind/provider/reference) are required', - }); - return; - } - fulfillments.push(record); - res.status(201).json(record); - }); + router.post( + '/fulfillments', + validated( + { + description: + 'Report resources that fulfill a condition in an environment. Additive, never overwrites.', + body: FulfillmentRecord, + responses: { + 201: { description: 'Stored fulfillment.', schema: FulfillmentRecord }, + 400: { description: 'Invalid request.', schema: ErrorResponse }, + }, + }, + ({ body }, res) => { + fulfillments.push(body); + res.status(201).json(body); + }, + ), + ); - router.get('/fulfillments', (req, res) => { - const { profileName, condition } = req.query; - res.json( - fulfillments.filter( - f => - (!profileName || f.profileName === profileName) && - (!condition || f.condition === condition), - ), - ); - }); + router.get( + '/fulfillments', + validated( + { + description: 'List reported fulfillments, optionally filtered.', + query: FulfillmentQuery, + responses: { + 200: { description: 'Matching fulfillments.', schema: FulfillmentRecord.array() }, + }, + }, + ({ query }, res) => { + res.json( + fulfillments.filter( + f => + (!query.profileName || f.profileName === query.profileName) && + (!query.condition || f.condition === query.condition), + ), + ); + }, + ), + ); return router; -} +} \ No newline at end of file diff --git a/backend/src/types.ts b/backend/src/types.ts index f66ee13..2265b5e 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -1,20 +1,46 @@ -export interface FulfillingAutomation { - tool: string; - reference?: string; -} - -export interface FulfillingResource { - kind: string; - provider: string; - reference: string; - componentRef?: string; - automation?: FulfillingAutomation; -} - -export interface FulfillmentRecord { - profileName: string; - profileNamespace?: string; - condition: string; - environment: string; - resources: FulfillingResource[]; -} +import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi'; +import { z } from 'zod'; + +extendZodWithOpenApi(z); + +// Each shape is defined once as a zod schema. The TypeScript type, request +// validation, and the OpenAPI spec are all derived from it. + +const nonEmpty = z.string().min(1); + +export const FulfillingAutomation = z + .object({ + tool: z.string(), + reference: z.string().optional(), + }) + .openapi('FulfillingAutomation'); +export type FulfillingAutomation = z.infer; + +export const FulfillingResource = z + .object({ + kind: nonEmpty, + provider: nonEmpty, + reference: nonEmpty, + componentRef: z.string().optional(), + automation: FulfillingAutomation.optional(), + }) + .openapi('FulfillingResource'); +export type FulfillingResource = z.infer; + +export const FulfillmentRecord = z + .object({ + profileName: nonEmpty, + profileNamespace: z.string().optional(), + condition: nonEmpty, + environment: nonEmpty, + resources: z.array(FulfillingResource).min(1), + }) + .openapi('FulfillmentRecord'); +export type FulfillmentRecord = z.infer; + +export const FulfillmentQuery = z.object({ + profileName: z.string().optional(), + condition: z.string().optional(), +}); + +export const ErrorResponse = z.object({ error: z.string() }).openapi('Error'); \ No newline at end of file diff --git a/docs/fulfillment-api.md b/docs/fulfillment-api.md index ee747bb..b08b06d 100644 --- a/docs/fulfillment-api.md +++ b/docs/fulfillment-api.md @@ -55,6 +55,16 @@ Both query params are optional filters. The frontend uses the `profileName` form The conditions table shows how many distinct environments have reported a fulfillment for a condition, even if multiple adapters posted to the same one. Expanding a row shows every environment, resource, and automation tool involved. A condition with no reported fulfillment shows none. It is never inferred. +## OpenAPI spec + +The spec is generated from the routes registered on the backend router, so it always matches the code. Each GitHub release includes it as `openapi.yaml`. To build it locally: + +``` +npm --prefix backend run openapi:generate +``` + +This writes `backend/dist/openapi.yaml`. New routes must wrap their handler with `validated()` and describe their shapes in `backend/src/types.ts`, or generation fails. + ## Example adapter See `runtimeconditions/rc-demos`, path `cilium-policy/adapter`, for a working adapter that reports CiliumNetworkPolicy fulfillments. diff --git a/docs/releases.md b/docs/releases.md index 135a5d3..7b38573 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -1,5 +1,5 @@ # Releases -Merging a `feat`, `fix`, `perf`, `revert`, or breaking change to `main` publishes both packages to npm at the same version, tags the merge commit `vX.Y.Z`, and creates a GitHub release. Other changes, such as docs or CI, do not release. +Merging a `feat`, `fix`, `perf`, `revert`, or breaking change to `main` publishes both packages to npm at the same version, tags the merge commit `vX.Y.Z`, and creates a GitHub release. The release also includes the backend's `openapi.yaml`. Other changes, such as docs or CI, do not release. -Versions follow semantic versioning and come from the PR titles described in [CONTRIBUTING.md](../CONTRIBUTING.md). Publishing uses npm trusted publishing, so no token is stored. `CONTRIBUTING.md` lists the one-time setup. +Versions follow semantic versioning and come from the PR titles described in [CONTRIBUTING.md](../CONTRIBUTING.md). Publishing uses npm trusted publishing, so no token is stored. `CONTRIBUTING.md` lists the one-time setup. \ No newline at end of file