worsoft-frontend-codegen-local-mcp 0.1.66 → 0.1.67

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.
@@ -6,8 +6,9 @@ insert into sys_menu (menu_id, parent_id, path, permission, menu_type, icon, del
6
6
  values ({{MENU_BASE_ID}}, '-1', '/{{MENU_ROUTE_PATH}}/index', '', '0', 'icon-bangzhushouji', '0', null, '8', null, '{{TABLE_COMMENT}}管理', 1);
7
7
 
8
8
  -- Form route SQL for jump-based pages. Hidden from sidebar, used by list page add/edit/view navigation.
9
+ -- Keep it as a sibling of the list page, not a child of the list page, because index.vue has no nested router-view.
9
10
  insert into sys_menu (menu_id, parent_id, path, permission, menu_type, icon, visible, del_flag, create_time, sort_order, update_time, name, tenant_id)
10
- values ({{MENU_BASE_ID_PLUS_6}}, {{MENU_BASE_ID}}, '/{{MENU_ROUTE_PATH}}/form', '', '0', 'icon-biaodan', '0', '0', null, '9', null, '{{TABLE_COMMENT}}表单', 1);
11
+ values ({{MENU_BASE_ID_PLUS_6}}, '-1', '/{{MENU_ROUTE_PATH}}/form', '', '0', 'icon-biaodan', '0', '0', null, '9', null, '{{TABLE_COMMENT}}表单', 1);
11
12
 
12
13
  insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
13
14
  values ({{MENU_BASE_ID_PLUS_1}}, {{MENU_BASE_ID}}, '{{PERMISSION_PREFIX}}_view', '1', null, '1', '0', null, '0', null, '{{TABLE_COMMENT}}查看', 1);
@@ -6,8 +6,9 @@ insert into sys_menu (menu_id, parent_id, path, permission, menu_type, icon, del
6
6
  values ({{MENU_BASE_ID}}, '-1', '/{{MENU_ROUTE_PATH}}/index', '', '0', 'icon-bangzhushouji', '0', null, '8', null, '{{TABLE_COMMENT}}管理', 1);
7
7
 
8
8
  -- Form route SQL for jump-based pages. Hidden from sidebar, used by list page add/edit/view navigation.
9
+ -- Keep it as a sibling of the list page, not a child of the list page, because index.vue has no nested router-view.
9
10
  insert into sys_menu (menu_id, parent_id, path, permission, menu_type, icon, visible, del_flag, create_time, sort_order, update_time, name, tenant_id)
10
- values ({{MENU_BASE_ID_PLUS_6}}, {{MENU_BASE_ID}}, '/{{MENU_ROUTE_PATH}}/form', '', '0', 'icon-biaodan', '0', '0', null, '9', null, '{{TABLE_COMMENT}}表单', 1);
11
+ values ({{MENU_BASE_ID_PLUS_6}}, '-1', '/{{MENU_ROUTE_PATH}}/form', '', '0', 'icon-biaodan', '0', '0', null, '9', null, '{{TABLE_COMMENT}}表单', 1);
11
12
 
12
13
  insert into sys_menu (menu_id, parent_id, permission, menu_type, path, icon, del_flag, create_time, sort_order, update_time, name, tenant_id)
13
14
  values ({{MENU_BASE_ID_PLUS_1}}, {{MENU_BASE_ID}}, '{{PERMISSION_PREFIX}}_view', '1', null, '1', '0', null, '0', null, '{{TABLE_COMMENT}}查看', 1);
package/mcp_server.js CHANGED
@@ -5,7 +5,7 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
 
7
7
  const SERVER_NAME = 'worsoft-codegen-local';
8
- const SERVER_VERSION = '0.1.66';
8
+ const SERVER_VERSION = '0.1.67';
9
9
  const PROTOCOL_VERSION = '2024-11-05';
10
10
  const TOOL_NAME = 'worsoft_codegen_local_generate_frontend';
11
11
  const STYLE_CATALOG_PATH = path.join(__dirname, 'assets', 'style-catalog.json');
@@ -1254,21 +1254,24 @@ function parseOptionalOrder(value, label) {
1254
1254
  if (value === undefined || value === null || value === '') return undefined;
1255
1255
  const order = Number.parseInt(String(value), 10);
1256
1256
  if (Number.isNaN(order) || order < 0) {
1257
- throw new Error(`${label} must be a non-negative integer when provided`);
1257
+ throw new Error(`${label} must be a positive integer when provided, or 0/empty when unspecified`);
1258
1258
  }
1259
+ if (order === 0) return undefined;
1259
1260
  return order;
1260
1261
  }
1261
1262
 
1262
1263
  function sortFieldsForForm(fields) {
1263
1264
  const seenOrders = new Map();
1264
- fields.forEach((field) => {
1265
- if (field.formOrder === undefined) return;
1266
- const existing = seenOrders.get(field.formOrder);
1267
- if (existing) {
1268
- throw new Error(`Duplicate formOrder ${field.formOrder} on fields ${existing} and ${field.fieldName}`);
1269
- }
1270
- seenOrders.set(field.formOrder, field.fieldName);
1271
- });
1265
+ fields
1266
+ .filter((field) => field.formShow !== false && !field.primary)
1267
+ .forEach((field) => {
1268
+ if (field.formOrder === undefined) return;
1269
+ const existing = seenOrders.get(field.formOrder);
1270
+ if (existing) {
1271
+ throw new Error(`Duplicate formOrder ${field.formOrder} on fields ${existing} and ${field.fieldName}`);
1272
+ }
1273
+ seenOrders.set(field.formOrder, field.fieldName);
1274
+ });
1272
1275
  return fields
1273
1276
  .map((field, index) => ({ field, index }))
1274
1277
  .sort((left, right) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worsoft-frontend-codegen-local-mcp",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "description": "Worsoft frontend local-template code generation MCP server.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "worsoft <sw@worsoft.vip>",