@shwfed/config 2.3.9 → 2.3.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/mcp.mjs +1064 -475
- package/dist/module.json +1 -1
- package/dist/preview/assets/config-57-v4VXo.js +1 -0
- package/dist/preview/assets/config-BZahzuEc.js +1 -0
- package/dist/preview/assets/config-Be-2ZA2R.js +1 -0
- package/dist/preview/assets/config-BnZQO-Sp.js +1 -0
- package/dist/preview/assets/config-Bp91DUdU.js +1 -0
- package/dist/preview/assets/config-DNokxY7M.js +1 -0
- package/dist/preview/assets/config-_msO_f2R.js +1 -0
- package/dist/preview/assets/config-_uPI8qV-.js +1 -0
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-BtScXbs1.js +1 -0
- package/dist/preview/assets/index-DDbl2Atj.js +1 -0
- package/dist/preview/assets/index-DGa3Oj3y.js +1075 -0
- package/dist/preview/assets/index-mbGtsgdv.css +1 -0
- package/dist/preview/assets/runtime-B9u14qqB.js +1 -0
- package/dist/preview/assets/runtime-BBms4myv.js +1 -0
- package/dist/preview/assets/runtime-CfR7ZAND.js +1 -0
- package/dist/preview/assets/runtime-D3EyeiyA.js +1 -0
- package/dist/preview/assets/runtime-Dk9u-Ybw.js +1 -0
- package/dist/preview/assets/runtime-XXqIAt53.js +1 -0
- package/dist/preview/assets/runtime-cKWSGFod.js +1 -0
- package/dist/preview/assets/runtime-w7V-p3t1.js +1 -0
- package/dist/preview/index.html +19 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +3 -1
- package/dist/runtime/components/form/ai/fields-button.vue +3 -1
- package/dist/runtime/components/form/unit-config.vue +8 -4
- package/dist/runtime/components/form/utils/resolve.d.ts +48 -9
- package/dist/runtime/components/form/utils/resolve.js +59 -5
- package/dist/runtime/components/table/ai/columns-button.vue +1 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +305 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue +81 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +55 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.js +82 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +310 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue +81 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +66 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +71 -0
- package/dist/runtime/components/table/config.vue +2 -1
- package/dist/runtime/components/table/utils/resolve.d.ts +53 -0
- package/dist/runtime/components/table/utils/resolve.js +66 -1
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ const runtimeModules = import.meta.glob(
|
|
|
11
11
|
"../columns/*/*/runtime.vue",
|
|
12
12
|
{ eager: true, import: "default", exhaustive: true }
|
|
13
13
|
);
|
|
14
|
+
const sourceKey = (type, compatibilityDate) => `${type}@${compatibilityDate}`;
|
|
14
15
|
const registry = defineRegistry({
|
|
15
16
|
hostName: "shwfed-table",
|
|
16
17
|
dirSegment: "columns",
|
|
@@ -21,6 +22,47 @@ const registry = defineRegistry({
|
|
|
21
22
|
if (typeof mod.toColumnDef !== "function") {
|
|
22
23
|
throw new TypeError(`[shwfed-table] column "${type}@${date}" is missing toColumnDef export`);
|
|
23
24
|
}
|
|
25
|
+
},
|
|
26
|
+
// Deprecation rules mirror the form host:
|
|
27
|
+
// (a) date-versioned: another entry shares this entry's `type` with a
|
|
28
|
+
// strictly greater `compatibilityDate`;
|
|
29
|
+
// (b) explicit cross-type: another entry declares this one in its
|
|
30
|
+
// `migrateFrom`. Same source claimed twice → throw.
|
|
31
|
+
deriveEntryExtras: (drafts) => {
|
|
32
|
+
const latestByType = /* @__PURE__ */ new Map();
|
|
33
|
+
for (const d of drafts) {
|
|
34
|
+
const prev = latestByType.get(d.type);
|
|
35
|
+
if (!prev || d.compatibilityDate > prev) latestByType.set(d.type, d.compatibilityDate);
|
|
36
|
+
}
|
|
37
|
+
const migrationTargets2 = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const d of drafts) {
|
|
39
|
+
const sources = d.module.migrateFrom;
|
|
40
|
+
if (!sources || sources.length === 0) continue;
|
|
41
|
+
for (const src of sources) {
|
|
42
|
+
const key = sourceKey(src.type, src.compatibilityDate);
|
|
43
|
+
const existing = migrationTargets2.get(key);
|
|
44
|
+
if (existing) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`[shwfed-table] migrateFrom collision: source "${key}" is claimed by both "${sourceKey(existing.type, existing.compatibilityDate)}" and "${sourceKey(d.type, d.compatibilityDate)}"`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
migrationTargets2.set(key, { type: d.type, compatibilityDate: d.compatibilityDate });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return (draft) => {
|
|
53
|
+
const declared = migrationTargets2.get(sourceKey(draft.type, draft.compatibilityDate));
|
|
54
|
+
if (declared) {
|
|
55
|
+
return { deprecated: true, supersededBy: declared };
|
|
56
|
+
}
|
|
57
|
+
const latest = latestByType.get(draft.type);
|
|
58
|
+
if (draft.compatibilityDate < latest) {
|
|
59
|
+
return {
|
|
60
|
+
deprecated: true,
|
|
61
|
+
supersededBy: { type: draft.type, compatibilityDate: latest }
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return { deprecated: false };
|
|
65
|
+
};
|
|
24
66
|
}
|
|
25
67
|
});
|
|
26
68
|
export const COLUMNS = registry.ENTRIES.map((e) => ({
|
|
@@ -30,14 +72,37 @@ export const COLUMNS = registry.ENTRIES.map((e) => ({
|
|
|
30
72
|
schema: e.module.schema,
|
|
31
73
|
config: e.config,
|
|
32
74
|
runtime: e.runtime,
|
|
33
|
-
toColumnDef: e.module.toColumnDef
|
|
75
|
+
toColumnDef: e.module.toColumnDef,
|
|
76
|
+
deprecated: e.deprecated,
|
|
77
|
+
...e.supersededBy !== void 0 ? { supersededBy: e.supersededBy } : {},
|
|
78
|
+
...e.module.migrate !== void 0 ? { migrate: e.module.migrate } : {},
|
|
79
|
+
...e.module.migrateFrom !== void 0 ? { migrateFrom: e.module.migrateFrom } : {}
|
|
34
80
|
}));
|
|
81
|
+
const migrationTargets = (() => {
|
|
82
|
+
const map = /* @__PURE__ */ new Map();
|
|
83
|
+
for (const entry of COLUMNS) {
|
|
84
|
+
const sources = entry.migrateFrom;
|
|
85
|
+
if (!sources || sources.length === 0) continue;
|
|
86
|
+
for (const src of sources) {
|
|
87
|
+
map.set(sourceKey(src.type, src.compatibilityDate), {
|
|
88
|
+
type: entry.type,
|
|
89
|
+
compatibilityDate: entry.compatibilityDate
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return map;
|
|
94
|
+
})();
|
|
35
95
|
export function allColumnSchemas(configure) {
|
|
36
96
|
return COLUMNS.map((entry) => entry.schema(configure));
|
|
37
97
|
}
|
|
38
98
|
export function findColumn(type, compatibilityDate) {
|
|
39
99
|
return COLUMNS.find((r) => r.type === type && r.compatibilityDate === compatibilityDate);
|
|
40
100
|
}
|
|
101
|
+
export function findMigrationTarget(type, compatibilityDate) {
|
|
102
|
+
const target = migrationTargets.get(sourceKey(type, compatibilityDate));
|
|
103
|
+
if (!target) return void 0;
|
|
104
|
+
return findColumn(target.type, target.compatibilityDate);
|
|
105
|
+
}
|
|
41
106
|
export function latestColumnByType() {
|
|
42
107
|
const byType = /* @__PURE__ */ new Map();
|
|
43
108
|
for (const r of COLUMNS) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shwfed/config",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"description": "Configurable UI for SHWFED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"prepare": "husky && nuxt prepare",
|
|
34
|
-
"prepack": "nuxt-module-build build && vite build --config vite.mcp.config.ts && chmod +x dist/mcp.mjs",
|
|
34
|
+
"prepack": "nuxt-module-build build && vite build --config vite.mcp.config.ts && vite build --config vite.preview.config.ts && chmod +x dist/mcp.mjs",
|
|
35
35
|
"dev": "npm run dev:prepare && nuxt dev playground",
|
|
36
36
|
"dev:build": "nuxt build playground",
|
|
37
37
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|