@comet/upgrade 1.43.0 → 1.44.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.
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ts_morph_1 = require("ts-morph");
4
+ async function removeTooltipTriggerProp() {
5
+ const project = new ts_morph_1.Project({ tsConfigFilePath: "./admin/tsconfig.json" });
6
+ const sourceFiles = project.getSourceFiles("admin/src/**/*.tsx");
7
+ sourceFiles.forEach((sourceFile) => {
8
+ const importDeclarations = sourceFile.getImportDeclarations();
9
+ const tooltipImports = importDeclarations.filter((importDeclaration) => {
10
+ const moduleSpecifier = importDeclaration.getModuleSpecifier().getLiteralValue();
11
+ return moduleSpecifier === "@comet/admin";
12
+ });
13
+ if (tooltipImports.length > 0) {
14
+ const jsxElements = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.JsxOpeningElement);
15
+ jsxElements.forEach((jsxElement) => {
16
+ const tagName = jsxElement.getTagNameNode().getText();
17
+ if (tagName.includes("Tooltip")) {
18
+ const triggerProp = jsxElement
19
+ .getAttributes()
20
+ .find((attribute) => attribute.getKind() === ts_morph_1.SyntaxKind.JsxAttribute &&
21
+ attribute.asKind(ts_morph_1.SyntaxKind.JsxAttribute)?.getNameNode().getText() === "trigger");
22
+ if (triggerProp) {
23
+ triggerProp.remove();
24
+ }
25
+ }
26
+ });
27
+ sourceFile.save();
28
+ }
29
+ });
30
+ }
31
+ exports.default = removeTooltipTriggerProp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/upgrade",
3
- "version": "1.43.0",
3
+ "version": "1.44.0",
4
4
  "description": "Upgrade scripts for Comet DXP",
5
5
  "homepage": "https://github.com/vivid-planet/comet-upgrade#readme",
6
6
  "bugs": {