@vira-ui/cli 2.0.0 → 8.0.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/dist/index.js +12 -14
- package/dist/react/indexHtml.js +1 -1
- package/dist/react/kanbanAppTsx.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,7 +127,6 @@ program
|
|
|
127
127
|
if (options.template) {
|
|
128
128
|
template = options.template;
|
|
129
129
|
if (!SUPPORTED_TEMPLATES.includes(template)) {
|
|
130
|
-
console.error(chalk_1.default.red(`Unknown template: ${template}. Use one of: ${SUPPORTED_TEMPLATES.join(", ")}`));
|
|
131
130
|
process.exit(1);
|
|
132
131
|
}
|
|
133
132
|
}
|
|
@@ -180,7 +179,6 @@ program
|
|
|
180
179
|
if (options.template) {
|
|
181
180
|
template = options.template;
|
|
182
181
|
if (!SUPPORTED_TEMPLATES.includes(template)) {
|
|
183
|
-
console.error(chalk_1.default.red(`Unknown template: ${template}. Use one of: ${SUPPORTED_TEMPLATES.join(", ")}`));
|
|
184
182
|
process.exit(1);
|
|
185
183
|
}
|
|
186
184
|
}
|
|
@@ -903,7 +901,7 @@ function buildComponentBody(name, vrpConfig, props, hasProps, useViraUI) {
|
|
|
903
901
|
// import { watch, signal } from '@vira-ui/core';
|
|
904
902
|
// const [editValue, setEditValue] = signal('');
|
|
905
903
|
// watch(() => editValue(), (newValue) => {
|
|
906
|
-
// sendDiff({ [field]: newValue, updated_at:
|
|
904
|
+
// sendDiff({ [field]: newValue, updated_at: getLocalISOString() });
|
|
907
905
|
// }, { debounce: 500 });
|
|
908
906
|
|
|
909
907
|
return createElement('div', { className: '${name.toLowerCase()}' },
|
|
@@ -956,7 +954,7 @@ async function generateComponent(name, dir, config) {
|
|
|
956
954
|
if (vrpConfig) {
|
|
957
955
|
const typeName = vrpConfig.stateType.replace('State', '');
|
|
958
956
|
componentCode += `// TODO: Если у вас есть синхронизированные типы из backend, используйте их:
|
|
959
|
-
// import type { ${typeName} } from '
|
|
957
|
+
// import type { ${typeName} } from '@/vira-types';
|
|
960
958
|
// export type ${vrpConfig.stateType} = ${typeName};
|
|
961
959
|
|
|
962
960
|
export interface ${vrpConfig.stateType} {
|
|
@@ -1045,7 +1043,7 @@ import { createService, useService, batch } from '@vira-ui/core';
|
|
|
1045
1043
|
import { useViraState } from '@vira-ui/react';
|
|
1046
1044
|
import { v4 as uuid } from 'uuid';
|
|
1047
1045
|
// TODO: Если у вас есть синхронизированные типы из backend, используйте их:
|
|
1048
|
-
// import type { ${typeName} } from '
|
|
1046
|
+
// import type { ${typeName} } from '@/vira-types';
|
|
1049
1047
|
// export type ${vrpConfig.stateType} = ${typeName};
|
|
1050
1048
|
|
|
1051
1049
|
export interface ${vrpConfig.stateType} {
|
|
@@ -1093,12 +1091,12 @@ export function use${name}(id?: string) {
|
|
|
1093
1091
|
const newItem: ${vrpConfig.stateType} = {
|
|
1094
1092
|
...item,
|
|
1095
1093
|
id: itemId,
|
|
1096
|
-
created_at:
|
|
1097
|
-
updated_at:
|
|
1094
|
+
created_at: getLocalISOString(),
|
|
1095
|
+
updated_at: getLocalISOString(),
|
|
1098
1096
|
} as ${vrpConfig.stateType};
|
|
1099
1097
|
sendEvent('${lowerName}.created', {
|
|
1100
1098
|
...newItem,
|
|
1101
|
-
timestamp:
|
|
1099
|
+
timestamp: getLocalISOString()
|
|
1102
1100
|
});
|
|
1103
1101
|
},
|
|
1104
1102
|
// Update operations
|
|
@@ -1106,15 +1104,15 @@ export function use${name}(id?: string) {
|
|
|
1106
1104
|
sendDiff(updates);
|
|
1107
1105
|
sendEvent('${lowerName}.updated', {
|
|
1108
1106
|
...updates,
|
|
1109
|
-
updated_at:
|
|
1110
|
-
timestamp:
|
|
1107
|
+
updated_at: getLocalISOString(),
|
|
1108
|
+
timestamp: getLocalISOString()
|
|
1111
1109
|
});
|
|
1112
1110
|
},
|
|
1113
1111
|
// Delete operation
|
|
1114
1112
|
delete(itemId: string) {
|
|
1115
1113
|
sendEvent('${lowerName}.deleted', {
|
|
1116
1114
|
id: itemId,
|
|
1117
|
-
timestamp:
|
|
1115
|
+
timestamp: getLocalISOString()
|
|
1118
1116
|
});
|
|
1119
1117
|
},
|
|
1120
1118
|
sendEvent,
|
|
@@ -1139,8 +1137,8 @@ createService('${lowerName}Bulk', () => ({
|
|
|
1139
1137
|
sendEvent('${lowerName}.updated', {
|
|
1140
1138
|
id,
|
|
1141
1139
|
...payload,
|
|
1142
|
-
updated_at:
|
|
1143
|
-
timestamp:
|
|
1140
|
+
updated_at: getLocalISOString(),
|
|
1141
|
+
timestamp: getLocalISOString()
|
|
1144
1142
|
});
|
|
1145
1143
|
});
|
|
1146
1144
|
});
|
|
@@ -1151,7 +1149,7 @@ createService('${lowerName}Bulk', () => ({
|
|
|
1151
1149
|
ids.forEach(id => {
|
|
1152
1150
|
sendEvent('${lowerName}.deleted', {
|
|
1153
1151
|
id,
|
|
1154
|
-
timestamp:
|
|
1152
|
+
timestamp: getLocalISOString()
|
|
1155
1153
|
});
|
|
1156
1154
|
});
|
|
1157
1155
|
});
|
package/dist/react/indexHtml.js
CHANGED