made-market 0.4.1 → 0.4.2

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.
@@ -315,13 +315,18 @@ async function main() {
315
315
  // (自建源/精确复现用)。
316
316
  if (!options.registry && !process.env.MADE_MARKET_REGISTRY) {
317
317
  const server = options.server || process.env.MADE_MARKET_SERVER || DEFAULT_SERVER;
318
+ // 只把「解析包信息」的失败当成线上市场不可用;install 的业务错误
319
+ // (已存在、校验不匹配等)必须原样抛出,不能混进离线回落误导用户。
320
+ let resolved = null;
318
321
  try {
319
- const { packages, base } = await resolveViaApi(options.args, server);
320
- await install(options.args, { home: options.home, registry: base, index: { packages }, force: options.force, dryRun: options.dryRun });
321
- return;
322
+ resolved = await resolveViaApi(options.args, server);
322
323
  } catch (error) {
323
324
  console.error(`线上市场不可用(${error.message}),改用包内自带索引(仅示例包,离线兜底)。`);
324
325
  }
326
+ if (resolved) {
327
+ await install(options.args, { home: options.home, registry: resolved.base, index: { packages: resolved.packages }, force: options.force, dryRun: options.dryRun });
328
+ return;
329
+ }
325
330
  }
326
331
  // 归档从索引所在的位置取:远端索引配远端归档,自带索引配包内归档,可离线。
327
332
  const { source, index } = await loadIndex();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "made-market",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "码得(made)公开插件市场的命令行工具:列出、搜索、安装主题/管控/agent 包,以及登录后发布新包。市场服务端在 github.com/jobop/made-market 仓库内,不随本包分发。",
5
5
  "type": "module",
6
6
  "license": "MIT",