Skip to content

Commit 0088ac0

Browse files
committed
release: v0.17.1
Add 'GET /openapi.yaml' endpoint
1 parent 358489b commit 0088ac0

File tree

14 files changed

+29
-25
lines changed

14 files changed

+29
-25
lines changed

packages/aws/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybooker/aws",
3-
"version": "0.17.0",
3+
"version": "0.17.1",
44
"type": "module",
55
"description": "StoryBooker Adapter for interacting with AWS services.",
66
"author": {

packages/azure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybooker/azure",
3-
"version": "0.17.0",
3+
"version": "0.17.1",
44
"type": "module",
55
"description": "StoryBooker Adapter for interacting with Azure services.",
66
"author": {

packages/azure/src/functions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import type {
66
SetupOptions,
77
TimerFunctionOptions,
88
} from "@azure/functions";
9-
import {
10-
createPurgeHandler,
11-
createRequestHandler,
12-
SERVICE_NAME,
13-
} from "@storybooker/core";
9+
import { createPurgeHandler, createRequestHandler } from "@storybooker/core";
1410
import type {
1511
ErrorParser,
1612
RequestHandlerOptions,
1713
StoryBookerUser,
1814
} from "@storybooker/core/types";
19-
import { generatePrefixFromBaseRoute, urlJoin } from "@storybooker/core/utils";
15+
import {
16+
generatePrefixFromBaseRoute,
17+
SERVICE_NAME,
18+
urlJoin,
19+
} from "@storybooker/core/utils";
2020
import type { BodyInit } from "undici";
2121

2222
const DEFAULT_PURGE_SCHEDULE_CRON = "0 0 0 * * *";

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "storybooker",
3-
"version": "0.17.0",
3+
"version": "0.17.1",
44
"type": "module",
55
"bin": "./dist/index.js",
66
"description": "Storybooker CLI for uploading builds and files.",

packages/core/deno.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json",
33
"name": "@storybooker/core",
4-
"version": "0.17.0",
4+
"version": "0.17.1",
55
"license": "MIT",
66
"publish": {
77
"include": [
88
"src",
99
"README.md",
10-
"dist/openapi.json"
10+
"package.json",
11+
"openapi.json"
1112
]
1213
},
1314
"compilerOptions": {
@@ -23,6 +24,6 @@
2324
"./types": "./src/types.ts",
2425
"./url": "./src/urls.ts",
2526
"./utils": "./src/utils/index.ts",
26-
"./openapi.json": "./dist/openapi.json"
27+
"./openapi.json": "./openapi.json"
2728
}
2829
}

packages/core/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@storybooker/core",
3-
"version": "0.17.0",
3+
"version": "0.17.1",
44
"type": "module",
55
"description": "Storybooker platform agnostic router core.",
66
"author": {
@@ -15,7 +15,8 @@
1515
},
1616
"files": [
1717
"src",
18-
"dist"
18+
"dist",
19+
"openapi.json"
1920
],
2021
"license": "MIT",
2122
"sideEffects": false,
@@ -89,7 +90,7 @@
8990
"default": "./dist/utils.js"
9091
},
9192
"./package.json": "./package.json",
92-
"./openapi.json": "./dist/openapi.json"
93+
"./openapi.json": "./openapi.json"
9394
},
9495
"publishConfig": {
9596
"exports": {

packages/core/scripts/gen-openapi-spec-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function generateOpenApiSpecFiles(
88
const logger = config?.logger;
99
const { readFile, writeFile } = await import("node:fs/promises");
1010

11-
const outputJSONFilepath = "./dist/openapi.json";
11+
const outputJSONFilepath = "./openapi.json";
1212
const specJSONContent = JSON.stringify(spec, null, 2);
1313
await writeFile(outputJSONFilepath, specJSONContent, { encoding: "utf8" });
1414
logger?.success(`Generated OpenAPI spec files (${outputJSONFilepath})`);

packages/core/src/adapters/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
ProjectType,
66
StoryBookerUser,
77
TagType,
8-
} from "..";
8+
} from "../types";
99
import type { LoggerAdapter } from "./logger";
1010

1111
type RenderedContent = string | Promise<string>;

packages/core/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ import { DEFAULT_LOCALE } from "./utils/constants";
1313
import { parseErrorMessage } from "./utils/error";
1414
import { localStore } from "./utils/store";
1515

16-
export { SERVICE_NAME } from "./utils/constants";
17-
export type * from "./types";
18-
1916
if ("setEncoding" in process.stdout) {
2017
process.stdout.setEncoding("utf8");
2118
}

packages/core/src/routers/_app-router.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { swaggerUI } from "@hono/swagger-ui";
22
import { OpenAPIHono, type OpenAPIObjectConfigure } from "@hono/zod-openapi";
3-
import type { Env } from "hono";
3+
import type { Context, Env } from "hono";
44
import pkgJson from "../../package.json" with { type: "json" };
55
import { SERVICE_NAME } from "../utils/constants";
66
import { getStore } from "../utils/store";
@@ -12,10 +12,14 @@ import { rootRouter } from "./root-router";
1212
import { tagsRouter } from "./tags-router";
1313
import { tasksRouter } from "./tasks-router";
1414

15+
type OpenAPIObjectConfig<Configure extends OpenAPIObjectConfigure<Env, "">> =
16+
Configure extends (context: Context) => infer Config ? Config : Configure;
1517
/**
1618
* @private
1719
*/
18-
export const openapiConfig: OpenAPIObjectConfigure<Env, ""> = {
20+
export const openapiConfig: OpenAPIObjectConfig<
21+
OpenAPIObjectConfigure<Env, "">
22+
> = {
1923
openapi: "3.1.0",
2024
info: { version: pkgJson.version, title: SERVICE_NAME },
2125
};

0 commit comments

Comments
 (0)