@comet/upgrade 1.80.0 → 1.82.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.
|
@@ -41,6 +41,11 @@ async function addDialogContentToEditDialog() {
|
|
|
41
41
|
}
|
|
42
42
|
if (!returnedExpression)
|
|
43
43
|
return;
|
|
44
|
+
// Check if already wrapped in DialogContent
|
|
45
|
+
const alreadyWrapped = ts_morph_1.Node.isJsxElement(returnedExpression) &&
|
|
46
|
+
returnedExpression.getOpeningElement().getTagNameNode().getText() === "DialogContent";
|
|
47
|
+
if (alreadyWrapped)
|
|
48
|
+
return;
|
|
44
49
|
if (ts_morph_1.Node.isJsxFragment(returnedExpression)) {
|
|
45
50
|
const fragmentChildren = returnedExpression.getChildrenOfKind(ts_morph_1.SyntaxKind.JsxElement);
|
|
46
51
|
const fragmentText = fragmentChildren.map((child) => child.getText()).join("\n");
|
|
@@ -59,6 +64,9 @@ async function addDialogContentToEditDialog() {
|
|
|
59
64
|
const openEditDialog = jsxElement.getOpeningElement().getText();
|
|
60
65
|
const closeEditDialog = jsxElement.getClosingElement().getText();
|
|
61
66
|
const childrensContent = children.map((child) => child.getText()).join("\n");
|
|
67
|
+
// Check if already wrapped in DialogContent
|
|
68
|
+
if (/^<DialogContent[\s>]/.test(childrensContent.trim()))
|
|
69
|
+
return;
|
|
62
70
|
const newContent = `${openEditDialog}\n<DialogContent>\n${childrensContent}\n</DialogContent>\n${closeEditDialog}`;
|
|
63
71
|
elementsToReplace.push({ node: jsxElement, newText: newContent });
|
|
64
72
|
}
|
|
@@ -14,8 +14,8 @@ const ts_morph_1 = require("ts-morph");
|
|
|
14
14
|
* assuming, with the drawback, that columns variable is already available in the current scope.
|
|
15
15
|
*/
|
|
16
16
|
async function updateMuiXVersion() {
|
|
17
|
-
const project = new ts_morph_1.Project({ tsConfigFilePath: "
|
|
18
|
-
const files = glob_1.glob.sync(["src/**/*.ts", "src/**/*.tsx"]);
|
|
17
|
+
const project = new ts_morph_1.Project({ tsConfigFilePath: "admin/tsconfig.json" });
|
|
18
|
+
const files = glob_1.glob.sync(["admin/src/**/*.ts", "admin/src/**/*.tsx"]);
|
|
19
19
|
for (const filePath of files) {
|
|
20
20
|
const sourceFile = project.getSourceFile(filePath);
|
|
21
21
|
if (!sourceFile) {
|