@stacksjs/buddy 0.70.376 → 0.70.377
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OpenApiDocument } from '../../../../api/src/generate-types';
|
|
2
2
|
export declare function validateOpenApi(document: OpenApiDocument): string[];
|
|
3
3
|
export declare function run(): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readFileSync,writeFileSync}from"node:fs";import{resolve}from"node:path";import{assertFrameworkRepo}from"./framework-repo";import
|
|
1
|
+
import{readFileSync,writeFileSync}from"node:fs";import{resolve}from"node:path";import{assertFrameworkRepo}from"./framework-repo";async function generators(){const[client,openapi,types]=await Promise.all([import("../../../../api/src/generate-client"),import("../../../../api/src/generate-openapi"),import("../../../../api/src/generate-types")]);return{renderApiClient:client.renderApiClient,generateOpenApi:openapi.generateOpenApi,renderOpenApiTypes:types.renderOpenApiTypes}}const root=resolve(import.meta.dir,"../../../../../../.."),openApiPath=resolve(root,"storage/framework/api/openapi.json"),apiTypesPath=resolve(root,"storage/framework/api/api-types.ts"),clientPath=resolve(root,"storage/framework/api/client.ts");export function validateOpenApi(document){const errors=[],paths=Object.entries(document.paths||{});if(paths.length<10)errors.push("OpenAPI document has fewer than 10 registered paths");const operationIds=new Set;for(const[route,item]of paths)for(const[method,operation]of Object.entries(item)){if(!operation.operationId)errors.push(`${method.toUpperCase()} ${route}: operationId is missing`);else if(operationIds.has(operation.operationId))errors.push(`${method.toUpperCase()} ${route}: duplicate operationId ${operation.operationId}`);else operationIds.add(operation.operationId);for(const parameter of operation.parameters||[])if(parameter.in==="path"&&!parameter.required)errors.push(`${method.toUpperCase()} ${route}: path parameter ${parameter.name} must be required`)}return errors}async function expectedArtifacts(){const{renderApiClient,generateOpenApi,renderOpenApiTypes}=await generators(),document=await generateOpenApi({write:!1}),errors=validateOpenApi(document);if(errors.length)throw Error(errors.join(`
|
|
2
2
|
`));return{openApi:JSON.stringify(document,null,2),apiTypes:renderOpenApiTypes(document),client:renderApiClient(document,{name:document.info?.title})}}async function write(){const expected=await expectedArtifacts();writeFileSync(openApiPath,expected.openApi);writeFileSync(apiTypesPath,expected.apiTypes);writeFileSync(clientPath,expected.client);console.log("Generated OpenAPI, API type and client artifacts")}async function check(){const expected=await expectedArtifacts(),errors=[];if(readFileSync(openApiPath,"utf8")!==expected.openApi)errors.push("storage/framework/api/openapi.json is stale");if(readFileSync(apiTypesPath,"utf8")!==expected.apiTypes)errors.push("storage/framework/api/api-types.ts is stale");if(readFileSync(clientPath,"utf8")!==expected.client)errors.push("storage/framework/api/client.ts is stale");if(errors.length)throw Error(`${errors.join(`
|
|
3
3
|
`)}
|
|
4
4
|
Run bun run docs:artifacts and review the generated diff.`);console.log(`Generated API artifacts are current (${Object.keys(JSON.parse(expected.openApi).paths).length} paths)`)}export async function run(){assertFrameworkRepo(root,"docs:artifacts");try{if(process.argv.includes("--write"))await write();else if(process.argv.includes("--check"))await check();else{console.error("usage: bun storage/framework/core/buddy/src/commands/docs/generated-artifacts.ts --write | --check");process.exit(2)}}catch(error){console.error(error instanceof Error?error.message:String(error));process.exit(1)}}if(import.meta.main)await run();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.377",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -95,53 +95,53 @@
|
|
|
95
95
|
"prepublishOnly": "bun run build"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@stacksjs/actions": "^0.70.
|
|
99
|
-
"@stacksjs/ai": "^0.70.
|
|
100
|
-
"@stacksjs/alias": "^0.70.
|
|
101
|
-
"@stacksjs/arrays": "^0.70.
|
|
102
|
-
"@stacksjs/auth": "^0.70.
|
|
103
|
-
"@stacksjs/build": "^0.70.
|
|
104
|
-
"@stacksjs/cache": "^0.70.
|
|
105
|
-
"@stacksjs/cli": "^0.70.
|
|
98
|
+
"@stacksjs/actions": "^0.70.377",
|
|
99
|
+
"@stacksjs/ai": "^0.70.377",
|
|
100
|
+
"@stacksjs/alias": "^0.70.377",
|
|
101
|
+
"@stacksjs/arrays": "^0.70.377",
|
|
102
|
+
"@stacksjs/auth": "^0.70.377",
|
|
103
|
+
"@stacksjs/build": "^0.70.377",
|
|
104
|
+
"@stacksjs/cache": "^0.70.377",
|
|
105
|
+
"@stacksjs/cli": "^0.70.377",
|
|
106
106
|
"@stacksjs/clapp": "^0.2.12",
|
|
107
|
-
"@stacksjs/cloud": "^0.70.
|
|
108
|
-
"@stacksjs/collections": "^0.70.
|
|
109
|
-
"@stacksjs/config": "^0.70.
|
|
110
|
-
"@stacksjs/database": "^0.70.
|
|
111
|
-
"@stacksjs/desktop-build": "^0.70.
|
|
112
|
-
"@stacksjs/dns": "^0.70.
|
|
113
|
-
"@stacksjs/email": "^0.70.
|
|
114
|
-
"@stacksjs/enums": "^0.70.
|
|
115
|
-
"@stacksjs/error-handling": "^0.70.
|
|
116
|
-
"@stacksjs/events": "^0.70.
|
|
117
|
-
"@stacksjs/git": "^0.70.
|
|
107
|
+
"@stacksjs/cloud": "^0.70.377",
|
|
108
|
+
"@stacksjs/collections": "^0.70.377",
|
|
109
|
+
"@stacksjs/config": "^0.70.377",
|
|
110
|
+
"@stacksjs/database": "^0.70.377",
|
|
111
|
+
"@stacksjs/desktop-build": "^0.70.377",
|
|
112
|
+
"@stacksjs/dns": "^0.70.377",
|
|
113
|
+
"@stacksjs/email": "^0.70.377",
|
|
114
|
+
"@stacksjs/enums": "^0.70.377",
|
|
115
|
+
"@stacksjs/error-handling": "^0.70.377",
|
|
116
|
+
"@stacksjs/events": "^0.70.377",
|
|
117
|
+
"@stacksjs/git": "^0.70.377",
|
|
118
118
|
"@stacksjs/gitit": "^0.2.5",
|
|
119
|
-
"@stacksjs/health": "^0.70.
|
|
119
|
+
"@stacksjs/health": "^0.70.377",
|
|
120
120
|
"@stacksjs/dnsx": "^0.2.3",
|
|
121
121
|
"@stacksjs/httx": "^0.1.10",
|
|
122
|
-
"@stacksjs/image": "^0.70.
|
|
123
|
-
"@stacksjs/lint": "^0.70.
|
|
124
|
-
"@stacksjs/logging": "^0.70.
|
|
125
|
-
"@stacksjs/notifications": "^0.70.
|
|
126
|
-
"@stacksjs/objects": "^0.70.
|
|
127
|
-
"@stacksjs/orm": "^0.70.
|
|
128
|
-
"@stacksjs/path": "^0.70.
|
|
129
|
-
"@stacksjs/skills": "^0.70.
|
|
130
|
-
"@stacksjs/payments": "^0.70.
|
|
131
|
-
"@stacksjs/realtime": "^0.70.
|
|
132
|
-
"@stacksjs/router": "^0.70.
|
|
122
|
+
"@stacksjs/image": "^0.70.377",
|
|
123
|
+
"@stacksjs/lint": "^0.70.377",
|
|
124
|
+
"@stacksjs/logging": "^0.70.377",
|
|
125
|
+
"@stacksjs/notifications": "^0.70.377",
|
|
126
|
+
"@stacksjs/objects": "^0.70.377",
|
|
127
|
+
"@stacksjs/orm": "^0.70.377",
|
|
128
|
+
"@stacksjs/path": "^0.70.377",
|
|
129
|
+
"@stacksjs/skills": "^0.70.377",
|
|
130
|
+
"@stacksjs/payments": "^0.70.377",
|
|
131
|
+
"@stacksjs/realtime": "^0.70.377",
|
|
132
|
+
"@stacksjs/router": "^0.70.377",
|
|
133
133
|
"@stacksjs/rpx": "^0.11.42",
|
|
134
|
-
"@stacksjs/search-engine": "^0.70.
|
|
135
|
-
"@stacksjs/security": "^0.70.
|
|
136
|
-
"@stacksjs/server": "^0.70.
|
|
137
|
-
"@stacksjs/storage": "^0.70.
|
|
138
|
-
"@stacksjs/strings": "^0.70.
|
|
139
|
-
"@stacksjs/testing": "^0.70.
|
|
140
|
-
"@stacksjs/tunnel": "^0.70.
|
|
141
|
-
"@stacksjs/types": "^0.70.
|
|
142
|
-
"@stacksjs/ui": "^0.70.
|
|
143
|
-
"@stacksjs/utils": "^0.70.
|
|
144
|
-
"@stacksjs/validation": "^0.70.
|
|
134
|
+
"@stacksjs/search-engine": "^0.70.377",
|
|
135
|
+
"@stacksjs/security": "^0.70.377",
|
|
136
|
+
"@stacksjs/server": "^0.70.377",
|
|
137
|
+
"@stacksjs/storage": "^0.70.377",
|
|
138
|
+
"@stacksjs/strings": "^0.70.377",
|
|
139
|
+
"@stacksjs/testing": "^0.70.377",
|
|
140
|
+
"@stacksjs/tunnel": "^0.70.377",
|
|
141
|
+
"@stacksjs/types": "^0.70.377",
|
|
142
|
+
"@stacksjs/ui": "^0.70.377",
|
|
143
|
+
"@stacksjs/utils": "^0.70.377",
|
|
144
|
+
"@stacksjs/validation": "^0.70.377",
|
|
145
145
|
"@stacksjs/ts-cloud": "^0.7.126",
|
|
146
146
|
"ajv": "^8.20.0",
|
|
147
147
|
"ajv-formats": "^3.0.1",
|