@postxl/cli 1.9.1 → 1.9.2
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.
|
@@ -187,10 +187,17 @@ async function planRenameField(params) {
|
|
|
187
187
|
let referenceUpdates = 0;
|
|
188
188
|
if (Array.isArray(target.model.indexes)) {
|
|
189
189
|
for (const index of target.model.indexes) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
// Indexes are either the array shorthand (`["a", "b"]`) or the object form
|
|
191
|
+
// (`{ "fields": ["a", "b"], ... }`); rename field references in both.
|
|
192
|
+
const indexFields = Array.isArray(index)
|
|
193
|
+
? index
|
|
194
|
+
: isObject(index) && Array.isArray(index.fields)
|
|
195
|
+
? index.fields
|
|
196
|
+
: undefined;
|
|
197
|
+
if (indexFields) {
|
|
198
|
+
for (let i = 0; i < indexFields.length; i++) {
|
|
199
|
+
if (indexFields[i] === oldField) {
|
|
200
|
+
indexFields[i] = newField;
|
|
194
201
|
referenceUpdates++;
|
|
195
202
|
}
|
|
196
203
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/cli",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "Command-line interface for PostXL code generation framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"ts-morph": "26.0.0",
|
|
47
47
|
"zod-validation-error": "5.0.0",
|
|
48
48
|
"@postxl/generator": "^1.6.3",
|
|
49
|
-
"@postxl/generators": "^2.
|
|
50
|
-
"@postxl/schema": "^2.0
|
|
49
|
+
"@postxl/generators": "^2.2.0",
|
|
50
|
+
"@postxl/schema": "^2.1.0",
|
|
51
51
|
"@postxl/utils": "^1.4.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {},
|