@lark-apaas/fullstack-cli 1.1.22 → 1.1.23
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 +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -481,6 +481,7 @@ var replaceUnknownTransform = {
|
|
|
481
481
|
transform(ctx) {
|
|
482
482
|
const { sourceFile, stats } = ctx;
|
|
483
483
|
const fullText = sourceFile.getFullText();
|
|
484
|
+
const replacements = [];
|
|
484
485
|
sourceFile.forEachDescendant((node) => {
|
|
485
486
|
if (!Node5.isCallExpression(node)) {
|
|
486
487
|
return;
|
|
@@ -511,13 +512,23 @@ var replaceUnknownTransform = {
|
|
|
511
512
|
break;
|
|
512
513
|
}
|
|
513
514
|
}
|
|
515
|
+
replacements.push({
|
|
516
|
+
expression,
|
|
517
|
+
factoryName,
|
|
518
|
+
foundKnownType,
|
|
519
|
+
isArrayType,
|
|
520
|
+
node
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
for (const { expression, factoryName, foundKnownType, isArrayType, node } of replacements) {
|
|
514
524
|
expression.replaceWithText(factoryName);
|
|
515
525
|
if (isArrayType && foundKnownType) {
|
|
516
526
|
const parent = node.getParent();
|
|
517
527
|
if (Node5.isPropertyAccessExpression(parent) && parent.getName() === "array") {
|
|
518
528
|
const grandParent = parent.getParent();
|
|
519
529
|
if (Node5.isCallExpression(grandParent)) {
|
|
520
|
-
|
|
530
|
+
const nodeText = node.getText();
|
|
531
|
+
grandParent.replaceWithText(nodeText);
|
|
521
532
|
}
|
|
522
533
|
}
|
|
523
534
|
}
|
|
@@ -526,7 +537,7 @@ var replaceUnknownTransform = {
|
|
|
526
537
|
} else {
|
|
527
538
|
stats.fallbackToText++;
|
|
528
539
|
}
|
|
529
|
-
}
|
|
540
|
+
}
|
|
530
541
|
const todoCommentRegex = /\/\/ TODO: failed to parse database type '[^']+'\s*\n/g;
|
|
531
542
|
const currentText = sourceFile.getFullText();
|
|
532
543
|
const cleanedText = currentText.replace(todoCommentRegex, "");
|