@kevisual/project-search 0.0.10 → 0.0.11
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.
- package/dist/app.js +12 -2
- package/dist/remote.js +12 -2
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -39936,13 +39936,23 @@ app.route({
|
|
|
39936
39936
|
args: {
|
|
39937
39937
|
filepath: exports_external2.string().describe("项目根目录的绝对路径,必填"),
|
|
39938
39938
|
repo: exports_external2.string().optional().describe("代码仓库标识,用于搜索结果展示和过滤,格式如 owner/repo,例如 kevisual/cnb,选填(默认自动从 git 配置读取)"),
|
|
39939
|
-
name: exports_external2.string().optional().describe("项目显示名称,用于搜索结果展示,选填(默认使用目录名)")
|
|
39939
|
+
name: exports_external2.string().optional().describe("项目显示名称,用于搜索结果展示,选填(默认使用目录名)"),
|
|
39940
|
+
type: exports_external2.string().optional().describe("项目类型,filepath或cnb-repo,默认为filepath")
|
|
39940
39941
|
}
|
|
39941
39942
|
}
|
|
39942
39943
|
}).define(async (ctx) => {
|
|
39943
|
-
let { filepath, repo, name } = ctx.query;
|
|
39944
|
+
let { filepath, repo, name, type = "filepath" } = ctx.query;
|
|
39944
39945
|
if (!filepath)
|
|
39945
39946
|
ctx.throw(400, "filepath 不能为空");
|
|
39947
|
+
if (type === "cnb-repo") {
|
|
39948
|
+
const msg = {
|
|
39949
|
+
path: "project",
|
|
39950
|
+
key: "clone-cnb"
|
|
39951
|
+
};
|
|
39952
|
+
const res = await app.run({ ...msg, payload: { repo: filepath } }, { state: ctx.state });
|
|
39953
|
+
ctx.forward(res);
|
|
39954
|
+
return;
|
|
39955
|
+
}
|
|
39946
39956
|
let link = "";
|
|
39947
39957
|
if (!repo) {
|
|
39948
39958
|
const gitPathname = getGitPathname(filepath);
|
package/dist/remote.js
CHANGED
|
@@ -39903,13 +39903,23 @@ app.route({
|
|
|
39903
39903
|
args: {
|
|
39904
39904
|
filepath: exports_external2.string().describe("项目根目录的绝对路径,必填"),
|
|
39905
39905
|
repo: exports_external2.string().optional().describe("代码仓库标识,用于搜索结果展示和过滤,格式如 owner/repo,例如 kevisual/cnb,选填(默认自动从 git 配置读取)"),
|
|
39906
|
-
name: exports_external2.string().optional().describe("项目显示名称,用于搜索结果展示,选填(默认使用目录名)")
|
|
39906
|
+
name: exports_external2.string().optional().describe("项目显示名称,用于搜索结果展示,选填(默认使用目录名)"),
|
|
39907
|
+
type: exports_external2.string().optional().describe("项目类型,filepath或cnb-repo,默认为filepath")
|
|
39907
39908
|
}
|
|
39908
39909
|
}
|
|
39909
39910
|
}).define(async (ctx) => {
|
|
39910
|
-
let { filepath, repo, name } = ctx.query;
|
|
39911
|
+
let { filepath, repo, name, type = "filepath" } = ctx.query;
|
|
39911
39912
|
if (!filepath)
|
|
39912
39913
|
ctx.throw(400, "filepath 不能为空");
|
|
39914
|
+
if (type === "cnb-repo") {
|
|
39915
|
+
const msg = {
|
|
39916
|
+
path: "project",
|
|
39917
|
+
key: "clone-cnb"
|
|
39918
|
+
};
|
|
39919
|
+
const res = await app.run({ ...msg, payload: { repo: filepath } }, { state: ctx.state });
|
|
39920
|
+
ctx.forward(res);
|
|
39921
|
+
return;
|
|
39922
|
+
}
|
|
39913
39923
|
let link = "";
|
|
39914
39924
|
if (!repo) {
|
|
39915
39925
|
const gitPathname = getGitPathname(filepath);
|