bfi-cli 0.1.38 → 0.1.39

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +19 -3
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -4914,7 +4914,17 @@ async function resolveUpdateScope(options) {
4914
4914
  function matchesSkillFilter(name, filter) {
4915
4915
  if (!filter || filter.length === 0) return true;
4916
4916
  const lower = name.toLowerCase();
4917
- return filter.some((f) => f.toLowerCase() === lower);
4917
+ return filter.some((f) => {
4918
+ const fl = f.toLowerCase();
4919
+ if (fl === lower) return true;
4920
+ if (fl.startsWith("@")) {
4921
+ const slashIdx = fl.lastIndexOf("/");
4922
+ if (slashIdx > 0 && fl.slice(slashIdx + 1) === lower) return true;
4923
+ }
4924
+ const dashIdx = fl.indexOf("--");
4925
+ if (dashIdx > 0 && fl.slice(dashIdx + 2) === lower) return true;
4926
+ return false;
4927
+ });
4918
4928
  }
4919
4929
  function getSkipReason(entry) {
4920
4930
  if (entry.sourceType === "local") return "本地路径";
@@ -7061,8 +7071,14 @@ async function runInstall(args, globalOpts) {
7061
7071
  slug: name
7062
7072
  };
7063
7073
  } catch {}
7064
- const skillEntries = Object.entries(lock.skills);
7065
- const packageEntries = Object.entries(lock.packages);
7074
+ const filterArg = args[0];
7075
+ let skillEntries = Object.entries(lock.skills);
7076
+ let packageEntries = Object.entries(lock.packages);
7077
+ if (filterArg) {
7078
+ const slug = filterArg.replace(/^@[\w-]+\//, "").replace(/^[\w-]+--/, "");
7079
+ skillEntries = skillEntries.filter(([name]) => name === slug || name.includes(slug));
7080
+ packageEntries = packageEntries.filter(([ref]) => ref.includes(slug));
7081
+ }
7066
7082
  if (skillEntries.length === 0 && packageEntries.length === 0) {
7067
7083
  console.log(`${DIM$1}锁文件 (.bfi/lock.json) 中未找到技能或包。${RESET$1}`);
7068
7084
  console.log(`${DIM$1}请先运行 'bfi skills add <source>' 安装技能。${RESET$1}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bfi-cli",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "用友大业财BFI统一命令行工具,支持技能,技能包,元数据,UI元数据等",
5
5
  "type": "module",
6
6
  "bin": {