Update napcat-schema build and OpenAPI version

Renamed the build script from build:schema to build:openapi in napcat-schema and updated the workflow to use the new script. Changed OpenAPI version from 3.1.0 to 3.0.1 in the schema generator. Added napcat-vite as a dependency and integrated its version plugin into the Vite config.
This commit is contained in:
手瓜一十雪 2026-01-27 15:23:12 +08:00
parent 795e64a924
commit 7b9c42cfca
5 changed files with 10 additions and 5 deletions

View File

@ -38,7 +38,7 @@ jobs:
- name: Build napcat-schema
run: |
cd packages/napcat-schema
pnpm run build:schema
pnpm run build:openapi
- name: Checkout NapCatDocs
uses: actions/checkout@v4

View File

@ -66,7 +66,7 @@ export function generateOpenAPI () {
}
const openapi: Record<string, unknown> = {
openapi: '3.1.0',
openapi: '3.0.1',
info: {
title: 'NapCat OneBot 11 HTTP API',
description: 'NapCatOneBot11 HTTP POST 接口文档',

View File

@ -5,12 +5,13 @@
"type": "module",
"main": "index.ts",
"scripts": {
"build:schema": "vite build & node ./dist/schemas.mjs"
"build:openapi": "vite build & node ./dist/schemas.mjs"
},
"dependencies": {
"@sinclair/typebox": "^0.34.38",
"napcat-onebot": "workspace:*",
"napcat-common": "workspace:*"
"napcat-common": "workspace:*",
"napcat-vite": "workspace:*"
},
"devDependencies": {
"tsx": "^4.7.1",

View File

@ -2,7 +2,7 @@ import { defineConfig } from 'vite';
import path, { resolve } from 'path';
import { builtinModules } from 'module';
import nodeResolve from '@rollup/plugin-node-resolve';
import napcatVersion from 'napcat-vite/vite-plugin-version';
// 依赖排除
const external = [
'ws',
@ -25,6 +25,7 @@ export default defineConfig({
},
plugins: [
nodeResolve(),
napcatVersion()
],
build: {
target: 'esnext',

View File

@ -267,6 +267,9 @@ importers:
napcat-onebot:
specifier: workspace:*
version: link:../napcat-onebot
napcat-vite:
specifier: workspace:*
version: link:../napcat-vite
devDependencies:
tsx:
specifier: ^4.7.1