@mbws/plugin-sdk 0.3.2 → 0.3.3

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/version.d.ts CHANGED
@@ -12,4 +12,4 @@ export declare const PROTOCOL_VERSION: 1;
12
12
  * SDK 自身版本(与 package.json version 保持一致)。
13
13
  * init-ack 上报给宿主做审计,与 manifest.sdk(build 写入)交叉核对。
14
14
  */
15
- export declare const SDK_VERSION = "0.3.2";
15
+ export declare const SDK_VERSION = "0.3.3";
package/dist/version.js CHANGED
@@ -12,4 +12,4 @@ export const PROTOCOL_VERSION = 1;
12
12
  * SDK 自身版本(与 package.json version 保持一致)。
13
13
  * init-ack 上报给宿主做审计,与 manifest.sdk(build 写入)交叉核对。
14
14
  */
15
- export const SDK_VERSION = "0.3.2";
15
+ export const SDK_VERSION = "0.3.3";
package/dist/vite.js CHANGED
@@ -33,9 +33,11 @@ function resolveApiBase(config) {
33
33
  return (config.apiBaseUrl ?? process.env.MBWS_API_BASE_URL ?? DEFAULT_API_BASE).replace(/\/+$/, "");
34
34
  }
35
35
  /**
36
- * 官方附件库地址(构建期解析 platforms hash 用):env > 线上,**刻意不走
36
+ * 官方附件库地址(**构建期**解析 platforms hash 用):env > 线上,**刻意不走
37
37
  * config.apiBaseUrl**——它是本地联调字段,而附件库是平台生产设施,产物 hash 必须
38
38
  * 钉生产库(在线构建容器里按本地地址 fetch 会不可达)。
39
+ * dev 侧(spawn 附件下载 / dev manifest)直接用 resolveApiBase:dev 跑在开发者
40
+ * 本机,apiBaseUrl 指向的本地后端就是正确地址,免导环境变量。
39
41
  */
40
42
  function attachmentApiBase() {
41
43
  return (process.env.MBWS_API_BASE_URL ?? DEFAULT_API_BASE).replace(/\/+$/, "");
@@ -67,7 +69,7 @@ export function mbwsVitePlugin(opts) {
67
69
  return [];
68
70
  if (resolvedAttachmentsCache)
69
71
  return resolvedAttachmentsCache;
70
- resolvedAttachmentsCache = await resolveAttachmentRefs(refs, attachmentApiBase());
72
+ resolvedAttachmentsCache = await resolveAttachmentRefs(refs, resolveApiBase(config));
71
73
  return resolvedAttachmentsCache;
72
74
  };
73
75
  // manifest 是纯派生物,构建/供给共用同一序列化姿势(尾换行对齐文件写习惯)。
@@ -344,7 +346,7 @@ async function ensureLibraryAttachment(config, root, name, log) {
344
346
  let resolved = devAttachmentResolves.get(resolveKey);
345
347
  if (!resolved) {
346
348
  try {
347
- const response = await fetch(`${attachmentApiBase()}/api/plugin-attachments/resolve` +
349
+ const response = await fetch(`${resolveApiBase(config)}/api/plugin-attachments/resolve` +
348
350
  `?name=${encodeURIComponent(name)}&version=${encodeURIComponent(ref.version)}` +
349
351
  `&platform=${platform}`);
350
352
  // 未登记/平台缺失/后端不可达都归「dev 不可用」,交给调用方 501 文案
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbws/plugin-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Moye 插件开发 SDK——panel/viewer 与宿主的类型定义与运行时端口适配",
5
5
  "license": "MIT",
6
6
  "type": "module",