dsh-ds-balance 2.0.0 → 2.1.0
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/lib/client.js +24 -0
- package/lib/types/client/index.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -2091,6 +2091,22 @@ function apply(ctx) {
|
|
|
2091
2091
|
const configSlotProbe = createConfigSlotProbe();
|
|
2092
2092
|
ctx.effect(() => () => configSlotProbe.dispose(), "ds-balance: config slot probe");
|
|
2093
2093
|
const pluginsNavigation = createPluginsNavigation();
|
|
2094
|
+
let openBundlePanel;
|
|
2095
|
+
ctx.inject(["pluginNavigation"], (navCtx) => {
|
|
2096
|
+
const face = navCtx["pluginNavigation"];
|
|
2097
|
+
if (typeof face !== "object" || face === null) return;
|
|
2098
|
+
const candidate = face["openBundle"];
|
|
2099
|
+
if (typeof candidate !== "function") return;
|
|
2100
|
+
const openBundle = candidate.bind(face);
|
|
2101
|
+
navCtx.effect(() => {
|
|
2102
|
+
openBundlePanel = (packageName) => {
|
|
2103
|
+
openBundle(packageName);
|
|
2104
|
+
};
|
|
2105
|
+
return () => {
|
|
2106
|
+
openBundlePanel = void 0;
|
|
2107
|
+
};
|
|
2108
|
+
}, "ds-balance: bundle config deep link");
|
|
2109
|
+
});
|
|
2094
2110
|
ctx.inject(["layout"], (layoutCtx) => {
|
|
2095
2111
|
if (!("layout" in layoutCtx)) return;
|
|
2096
2112
|
const face = layoutCtx.layout;
|
|
@@ -2098,6 +2114,14 @@ function apply(ctx) {
|
|
|
2098
2114
|
if (!("selectPanel" in face) || typeof face.selectPanel !== "function") return;
|
|
2099
2115
|
const selectPanel = face.selectPanel.bind(face);
|
|
2100
2116
|
layoutCtx.effect(() => pluginsNavigation.attach(() => {
|
|
2117
|
+
if (openBundlePanel !== void 0) {
|
|
2118
|
+
try {
|
|
2119
|
+
openBundlePanel(BUNDLE_CONFIG_KEY);
|
|
2120
|
+
return;
|
|
2121
|
+
} catch (error) {
|
|
2122
|
+
console.warn("[WARN] ds-balance: cannot open the bundle config page", error);
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2101
2125
|
try {
|
|
2102
2126
|
selectPanel(PLUGINS_PANEL_ID);
|
|
2103
2127
|
} catch (error) {
|
|
@@ -35,6 +35,8 @@ export declare const ENTRY_ID = "dsh-ds-balance";
|
|
|
35
35
|
* **Loader 条目 id**;两者今天同串,漂开的表现是卡片在、表单永远只读。
|
|
36
36
|
* 这条静默耦合由 `test/redlines.test.ts` 与 `test/artifacts.test.ts` 对账。
|
|
37
37
|
*
|
|
38
|
+
* **真源是 package.json 的 name**;本处手写一份字面量是因为浏览器半体不 import
|
|
39
|
+
* package.json(产物要能在信封里照字面找到这个键),由 redlines 断言与 `pkg.name` 逐字相等。
|
|
38
40
|
* **写成独立具名常量而不是直接用 `ENTRY_ID`**:产物级断言要在打包后的信封里照字面
|
|
39
41
|
* 找到这个键 —— 直接复用那个常量会让「键」与「命名空间」在产物里无从分辨。
|
|
40
42
|
*/
|
package/lib/version.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
/** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
|
|
9
9
|
export declare const SCHEMA_VERSION = 1;
|
|
10
10
|
/** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
|
|
11
|
-
export declare const PLUGIN_VERSION = "2.
|
|
11
|
+
export declare const PLUGIN_VERSION = "2.1.0";
|
|
12
12
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
package/package.json
CHANGED