@comet/upgrade 1.156.0 → 1.158.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.
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @comet/upgrade
2
2
 
3
+ > [!CAUTION]
4
+ > This repository is no longer maintained.
5
+ >
6
+ > Starting with Dextinity (formerly COMET) v9, we're using an AI-assisted migration approach instead of upgrade scripts.
7
+ > See the [migration guide](https://cms-docs.dextinity.com/docs/migration-guide/) for more information.
8
+ >
9
+ > The upgrade scripts for v4 to v8 remain available for upgrading to older versions.
10
+
3
11
  Upgrade scripts for Comet DXP
4
12
 
5
13
  ## Usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/upgrade",
3
- "version": "1.156.0",
3
+ "version": "1.158.0",
4
4
  "description": "Upgrade scripts for Comet DXP",
5
5
  "homepage": "https://github.com/vivid-planet/comet-upgrade#readme",
6
6
  "bugs": {
@@ -1,58 +0,0 @@
1
- import { Project, SyntaxKind } from "ts-morph";
2
- export default async function tooltipReplaceVariantProp() {
3
- const project = new Project({ tsConfigFilePath: "./admin/tsconfig.json" });
4
- const sourceFiles = project.getSourceFiles("admin/src/**/*.tsx");
5
- sourceFiles.forEach((sourceFile) => {
6
- const cometAdminImport = sourceFile.getImportDeclarations().find((importDeclaration) => {
7
- return importDeclaration.getModuleSpecifier().getLiteralValue() === "@comet/admin";
8
- });
9
- if (!cometAdminImport) {
10
- return;
11
- }
12
- const tooltipComponentNames = new Set();
13
- cometAdminImport.getNamedImports().forEach((namedImport) => {
14
- if (namedImport.getName() === "Tooltip") {
15
- const aliasName = namedImport.getAliasNode();
16
- tooltipComponentNames.add(aliasName ? aliasName.getText() : "Tooltip");
17
- }
18
- });
19
- const jsxElements = sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement);
20
- jsxElements.forEach((jsxElement) => {
21
- const componentName = jsxElement.getTagNameNode().getText();
22
- if (tooltipComponentNames.has(componentName)) {
23
- const variantAttribute = jsxElement
24
- .getAttributes()
25
- .find((attribute) => attribute.getKind() === SyntaxKind.JsxAttribute &&
26
- attribute.asKind(SyntaxKind.JsxAttribute)?.getNameNode().getText() === "variant");
27
- if (variantAttribute) {
28
- const jsxAttribute = variantAttribute.asKind(SyntaxKind.JsxAttribute);
29
- if (jsxAttribute) {
30
- const initializer = jsxAttribute.getInitializer();
31
- let variantValue = null;
32
- if (initializer) {
33
- if (initializer.getKind() === SyntaxKind.StringLiteral) {
34
- variantValue = initializer.asKind(SyntaxKind.StringLiteral)?.getLiteralValue() || null;
35
- }
36
- else if (initializer.getKind() === SyntaxKind.JsxExpression) {
37
- const expression = initializer.asKind(SyntaxKind.JsxExpression)?.getExpression();
38
- if (expression && expression.getKind() === SyntaxKind.StringLiteral) {
39
- variantValue = expression.asKind(SyntaxKind.StringLiteral)?.getLiteralValue() || null;
40
- }
41
- }
42
- }
43
- if (variantValue) {
44
- const isValueThatNoLongerExists = variantValue === "primary" || variantValue === "neutral";
45
- if (isValueThatNoLongerExists) {
46
- variantAttribute.remove();
47
- }
48
- else {
49
- jsxAttribute.getNameNode().replaceWithText("color");
50
- }
51
- }
52
- }
53
- }
54
- }
55
- });
56
- sourceFile.save();
57
- });
58
- }
@@ -1,16 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { PackageJson } from "../../../util/package-json.util.js";
3
- export const stage = "before-install";
4
- export default async function updateNextDependencies() {
5
- if (!existsSync("site/package.json")) {
6
- return;
7
- }
8
- const packageJson = new PackageJson("site/package.json");
9
- packageJson.updateDependency("next", "^16.0.3");
10
- packageJson.updateDependency("@next/bundle-analyzer", "^16.0.3");
11
- packageJson.updateDependency("react", "^19.2.0");
12
- packageJson.updateDependency("react-dom", "^19.2.0");
13
- packageJson.updateDependency("@types/react", "^19.2.0");
14
- packageJson.updateDependency("@types/react-dom", "^19.2.0");
15
- packageJson.save();
16
- }