@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 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: new Date().toISOString() });
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 '../vira-types';
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 '../vira-types';
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: new Date().toISOString(),
1097
- updated_at: new Date().toISOString(),
1094
+ created_at: getLocalISOString(),
1095
+ updated_at: getLocalISOString(),
1098
1096
  } as ${vrpConfig.stateType};
1099
1097
  sendEvent('${lowerName}.created', {
1100
1098
  ...newItem,
1101
- timestamp: new Date().toISOString()
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: new Date().toISOString(),
1110
- timestamp: new Date().toISOString()
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: new Date().toISOString()
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: new Date().toISOString(),
1143
- timestamp: new Date().toISOString()
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: new Date().toISOString()
1152
+ timestamp: getLocalISOString()
1155
1153
  });
1156
1154
  });
1157
1155
  });
@@ -6,7 +6,7 @@ exports.indexHtml = `<!DOCTYPE html>
6
6
  <head>
7
7
  <meta charset="UTF-8" />
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <title>Vira App</title>
9
+ <title>VIRA SMP</title>
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
@@ -17,7 +17,7 @@ import './index.css';
17
17
  * ✅ Server-authoritative state (client is terminal)
18
18
  * ✅ Auto-binding ready (action/model props)
19
19
  *
20
- * This is THE standard for Vira apps.
20
+ * This is THE standard for VIRA SMPs.
21
21
  */
22
22
 
23
23
  export function App() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vira-ui/cli",
3
- "version": "2.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "CLI tool for ViraJS project generation",
5
5
  "author": "Vira Team",
6
6
  "license": "MIT",