add quser app

This commit is contained in:
熊潇 2025-05-19 17:28:29 +08:00
parent 7075e9b097
commit ebcdf22f1e
9 changed files with 140 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@kevisual/query-awesome",
"version": "0.0.1",
"version": "0.0.2",
"description": "",
"main": "index.js",
"scripts": {
@ -23,7 +23,8 @@
"@kevisual/router": "^0.0.20",
"@kevisual/types": "^0.0.10",
"@kevisual/use-config": "^1.0.17",
"fast-glob": "^3.3.3"
"fast-glob": "^3.3.3",
"tsup": "^8.4.0"
},
"exports": {
".": {

View File

@ -0,0 +1,30 @@
// @ts-check
import { resolvePath, getDevInputs } from '@kevisual/use-config/env';
import { execSync } from 'node:child_process';
import glob from 'fast-glob';
const files = await glob(['src/defines/*.ts', 'src/query/*.ts', 'src/router/*.ts']);
const inputs = getDevInputs(files);
const external = ['@kevisual/router'];
for (let input of inputs) {
const entry = input.path;
const naming = input.naming;
/**
* @type {import('bun').BuildConfig}
*/
await Bun.build({
target: 'node',
format: 'esm',
entrypoints: [resolvePath(entry, { meta: import.meta })],
outdir: resolvePath('./dist', { meta: import.meta }),
naming: {
entry: naming + '.js',
},
external: external,
env: 'KEVISUAL_*',
});
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
execSync(cmd, { stdio: 'inherit' });
}

View File

@ -0,0 +1,18 @@
{
"name": "@kevisual/query-list",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"build": "bun bun.config.mjs"
},
"keywords": [],
"files": [
"src",
"dist"
],
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
"license": "MIT",
"packageManager": "pnpm@10.6.2",
"type": "module"
}

View File

@ -0,0 +1,27 @@
import { QueryUtil } from '@kevisual/router/define';
export const shopDefine = QueryUtil.create({
getRegistry: {
path: 'shop',
key: 'get-registry',
description: '获取应用商店注册表信息',
},
listInstalled: {
path: 'shop',
key: 'list-installed',
description: '列出当前已安装的所有应用',
},
install: {
path: 'shop',
key: 'install',
description: '安装指定的应用,可以指定 id、type、force 和 yes 参数',
},
uninstall: {
path: 'shop',
key: 'uninstall',
description: '卸载指定的应用,可以指定 id 和 type 参数',
},
});

View File

@ -0,0 +1,19 @@
import { shopDefine } from '../defines/query-shop-define.ts';
import { BaseQuery, DataOpts, Query } from '@kevisual/query/query';
export { shopDefine };
export class QueryApp extends BaseQuery {
appDefine = shopDefine;
constructor(opts?: { query: Query }) {
super(opts!);
this.appDefine.query = this.query;
}
get chain() {
return this.appDefine.queryChain;
}
getInstall(data: any, opts?: DataOpts) {
return this.appDefine.queryChain('install').post(data, opts);
}
}

View File

@ -0,0 +1,18 @@
{
"extends": "@kevisual/types/json/frontend.json",
"compilerOptions": {
"baseUrl": ".",
"typeRoots": [
"./node_modules/@types",
"./node_modules/@kevisual"
],
"paths": {
"@/*": [
"src/*"
]
},
},
"include": [
"src/**/*",
],
}

View File

@ -54,4 +54,9 @@ export const appDefine = QueryUtil.create({
key: 'detectVersionList',
description: '检测版本列表并同步 MinIO 数据',
},
publicList: {
path: 'app',
key: 'public-list',
description: '获取公开应用列表',
},
});

17
pnpm-lock.yaml generated
View File

@ -23,6 +23,11 @@ importers:
fast-glob:
specifier: ^3.3.3
version: 3.3.3
tsup:
specifier: ^8.4.0
version: 8.4.0(typescript@5.8.3)
packages/list: {}
packages/query-app: {}
@ -86,6 +91,18 @@ importers:
specifier: ^8.4.0
version: 8.4.0(typescript@5.8.3)
submodules/query-upload:
devDependencies:
'@types/node':
specifier: ^22.13.14
version: 22.15.18
eventsource:
specifier: ^3.0.6
version: 3.0.7
tsup:
specifier: ^8.4.0
version: 8.4.0(typescript@5.8.3)
packages:
'@babel/code-frame@7.27.1':

3
readme.md Normal file
View File

@ -0,0 +1,3 @@
# query-awesome
对 kevisual 相关的query router 的模块整理