@postxl/cli 1.9.0 → 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.
|
@@ -272,7 +272,15 @@ function isValidObjectLiteral(project, text) {
|
|
|
272
272
|
return false;
|
|
273
273
|
}
|
|
274
274
|
// Ensure no syntax errors in the scratch file.
|
|
275
|
-
|
|
275
|
+
// Use syntactic (parse-only) diagnostics rather than getPreEmitDiagnostics:
|
|
276
|
+
// we only care that `text` is a well-formed object literal, not that it
|
|
277
|
+
// type-checks. Full type checking via getPreEmitDiagnostics resolves the
|
|
278
|
+
// ambient lib and was prohibitively slow under CI's constrained host
|
|
279
|
+
// (the malformed-options test exceeded the 5s timeout). The structural
|
|
280
|
+
// checks above already reject anything that isn't a single
|
|
281
|
+
// `const x = <object literal>` statement, and syntactic diagnostics
|
|
282
|
+
// catch malformed contents inside the literal (e.g. `{ this is not valid }`).
|
|
283
|
+
return project.getProgram().getSyntacticDiagnostics(scratch).length === 0;
|
|
276
284
|
}
|
|
277
285
|
catch {
|
|
278
286
|
return false;
|
|
@@ -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",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dotenv": "17.4.2",
|
|
46
46
|
"ts-morph": "26.0.0",
|
|
47
47
|
"zod-validation-error": "5.0.0",
|
|
48
|
-
"@postxl/generator": "^1.6.
|
|
49
|
-
"@postxl/generators": "^2.0
|
|
50
|
-
"@postxl/schema": "^2.0
|
|
48
|
+
"@postxl/generator": "^1.6.3",
|
|
49
|
+
"@postxl/generators": "^2.2.0",
|
|
50
|
+
"@postxl/schema": "^2.1.0",
|
|
51
51
|
"@postxl/utils": "^1.4.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {},
|