@comet/upgrade 1.84.0 → 1.86.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.
@@ -7,6 +7,7 @@ async function replaceMuiButtonWithCometAdminButton() {
7
7
  for (const sourceFile of sourceFiles) {
8
8
  let changed = false;
9
9
  const importDeclarations = sourceFile.getImportDeclarations();
10
+ const cometAdminImport = importDeclarations.find((id) => id.getModuleSpecifierValue() === "@comet/admin");
10
11
  for (const importDecl of importDeclarations) {
11
12
  if (importDecl.getModuleSpecifierValue() === "@mui/material") {
12
13
  const namedImports = importDecl.getNamedImports();
@@ -25,7 +26,6 @@ async function replaceMuiButtonWithCometAdminButton() {
25
26
  // Add Button import from @comet/admin if it was removed
26
27
  if (changed) {
27
28
  // Check if already imported from @comet/admin
28
- const cometAdminImport = importDeclarations.find((id) => id.getModuleSpecifierValue() === "@comet/admin");
29
29
  if (cometAdminImport) {
30
30
  // Add Button if not already present
31
31
  if (!cometAdminImport.getNamedImports().some((ni) => ni.getName() === "Button")) {
@@ -10,7 +10,7 @@ async function updateImportOfTooltip() {
10
10
  if (!sourceFile) {
11
11
  throw new Error(`Can't get source file for ${filePath}`);
12
12
  }
13
- const adminImport = sourceFile.getImportDeclaration((declaration) => declaration.getModuleSpecifierValue().includes("@comet/admin"));
13
+ const adminImport = sourceFile.getImportDeclaration((declaration) => declaration.getModuleSpecifierValue() === "@comet/admin");
14
14
  const adminImports = adminImport?.getNamedImports().map((namedImport) => namedImport.getText());
15
15
  if (adminImports) {
16
16
  if (adminImports.includes("Tooltip")) {
@@ -10,7 +10,7 @@ async function updateImportOfDialog() {
10
10
  if (!sourceFile) {
11
11
  throw new Error(`Can't get source file for ${filePath}`);
12
12
  }
13
- const adminImport = sourceFile.getImportDeclaration((declaration) => declaration.getModuleSpecifierValue().includes("@comet/admin"));
13
+ const adminImport = sourceFile.getImportDeclaration((declaration) => declaration.getModuleSpecifierValue() === "@comet/admin");
14
14
  const adminImports = adminImport?.getNamedImports().map((namedImport) => namedImport.getText());
15
15
  if (adminImports) {
16
16
  if (adminImports.includes("Dialog")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/upgrade",
3
- "version": "1.84.0",
3
+ "version": "1.86.0",
4
4
  "description": "Upgrade scripts for Comet DXP",
5
5
  "homepage": "https://github.com/vivid-planet/comet-upgrade#readme",
6
6
  "bugs": {