@comet/upgrade 1.115.0 → 1.117.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.
Files changed (77) hide show
  1. package/bin/index.js +1 -1
  2. package/lib/index.js +33 -73
  3. package/lib/util/execute-command.util.js +3 -6
  4. package/lib/util/format-code.util.js +3 -6
  5. package/lib/util/get-latest-package-version.js +3 -9
  6. package/lib/util/package-json.util.js +5 -9
  7. package/lib/util/update-dependency-version.util.js +5 -8
  8. package/lib/v4/remove-clear-types-script.js +7 -13
  9. package/lib/v6/rename-build-runtime.js +7 -10
  10. package/lib/v6/rename-job-status-enum.js +7 -10
  11. package/lib/v6/rename-subject-entity-decorator.js +7 -10
  12. package/lib/v7/add-site-preview-secret.js +26 -65
  13. package/lib/v7/hide-graphql-field-suggestions.js +6 -9
  14. package/lib/v7/import-admin-theme-types.js +7 -13
  15. package/lib/v7/rename-date-filter-to-date-time-filter.js +7 -10
  16. package/lib/v7/replace-exception-interceptor-with-exception-filter.js +8 -11
  17. package/lib/v7/replace-gridcoldef-import.js +7 -10
  18. package/lib/v7/replace-roboto-with-roboto-flex.js +11 -14
  19. package/lib/v7/use-graphql-scalars.js +11 -14
  20. package/lib/v8/admin/after-install/add-dialog-content-to-edit-dialog.js +14 -17
  21. package/lib/v8/admin/after-install/clipboard-helpers.js +7 -10
  22. package/lib/v8/admin/after-install/comet-config-provider.js +66 -69
  23. package/lib/v8/admin/after-install/merge-admin-theme-into-admin.js +10 -13
  24. package/lib/v8/admin/after-install/merge-blocks-admin-into-cms-admin.js +8 -11
  25. package/lib/v8/admin/after-install/mui-codemods.js +9 -12
  26. package/lib/v8/admin/after-install/mui-data-grid-remove-error-prop.js +6 -9
  27. package/lib/v8/admin/after-install/mui-grid-sort-to-gql.js +6 -9
  28. package/lib/v8/admin/after-install/mui-x-codemods.js +4 -7
  29. package/lib/v8/admin/after-install/rename-menu-components-in-admin.js +7 -10
  30. package/lib/v8/admin/after-install/replace-mui-button-with-comet-admin-button.js +3 -6
  31. package/lib/v8/admin/after-install/tooltip-1-update-import.js +5 -8
  32. package/lib/v8/admin/after-install/tooltip-2-remove-trigger-prop.js +6 -9
  33. package/lib/v8/admin/after-install/update-import-of-dialog.js +5 -8
  34. package/lib/v8/admin/before-install/remove-admin-theme-package.js +6 -10
  35. package/lib/v8/admin/before-install/remove-blocks-packages-admin.js +6 -10
  36. package/lib/v8/admin/before-install/remove-comet-admin-react-select-dependency.js +6 -10
  37. package/lib/v8/admin/before-install/remove-v8-eslint-disable-comments-admin.js +4 -8
  38. package/lib/v8/admin/before-install/update-graphql-admin.js +6 -10
  39. package/lib/v8/admin/before-install/update-mui-dependencies.js +6 -10
  40. package/lib/v8/admin/before-install/update-mui-x-dependencies.js +6 -10
  41. package/lib/v8/admin/before-install/update-react-dependencies.js +6 -10
  42. package/lib/v8/admin/before-install/update-swc-dependencies.js +6 -10
  43. package/lib/v8/admin/before-install/use-mui-date-picker-in-grid.js +10 -14
  44. package/lib/v8/api/after-install/merge-blocks-api-into-cms-api.js +8 -11
  45. package/lib/v8/api/after-install/mikro-orm-base-entity-generic.js +6 -9
  46. package/lib/v8/api/after-install/mikro-orm-create-request-context.js +7 -10
  47. package/lib/v8/api/after-install/mikro-orm-custom-type.js +6 -9
  48. package/lib/v8/api/after-install/mikro-orm-delete-rule.js +6 -9
  49. package/lib/v8/api/after-install/mikro-orm-dotenv.js +5 -8
  50. package/lib/v8/api/after-install/mikro-orm-imports.js +6 -9
  51. package/lib/v8/api/after-install/mikro-orm-ormconfig.js +5 -8
  52. package/lib/v8/api/after-install/move-maxSrcResolution-in-comet-config.js +7 -13
  53. package/lib/v8/api/after-install/replace-playground-with-graphiql.js +12 -15
  54. package/lib/v8/api/after-install/update-dam-configuration.js +13 -16
  55. package/lib/v8/api/after-install/update-graphql-format-error.js +4 -7
  56. package/lib/v8/api/after-install/update-s3-config.js +8 -11
  57. package/lib/v8/api/before-install/nest-peer-dependencies.js +6 -10
  58. package/lib/v8/api/before-install/remove-blocks-packages-api.js +6 -10
  59. package/lib/v8/api/before-install/remove-passport.js +6 -10
  60. package/lib/v8/api/before-install/replace-nestjs-console-with-nest-commander.js +6 -10
  61. package/lib/v8/api/before-install/update-class-validator.js +7 -11
  62. package/lib/v8/api/before-install/update-kubernetes-client-node.js +6 -10
  63. package/lib/v8/api/before-install/update-mikro-orm-dependencies.js +6 -10
  64. package/lib/v8/api/before-install/update-nest-dependencies.js +6 -10
  65. package/lib/v8/api/before-install/update-sentry.js +9 -13
  66. package/lib/v8/eslint-dev-dependencies.js +22 -26
  67. package/lib/v8/ignore-restricted-imports-admin.js +4 -8
  68. package/lib/v8/prettier-dev-dependencies.js +12 -16
  69. package/lib/v8/remove-react-barrel-imports-admin.js +5 -8
  70. package/lib/v8/remove-react-barrel-imports-site.js +5 -8
  71. package/lib/v8/replace-node-with-v22-in-gitlab-ci-files.js +6 -43
  72. package/lib/v8/replace-node-with-v22-locally.js +9 -13
  73. package/lib/v8/site/after-install/remove-graphql-client-from-site-preview-handlers.js +7 -10
  74. package/lib/v8/site/before-install/update-graphql-site.js +6 -10
  75. package/lib/v9/admin/after-install/tooltip-replace-variant-prop.js +13 -16
  76. package/lib/v9/site/before-install/update-next-dependencies.js +6 -10
  77. package/package.json +4 -3
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = removeGraphQLClientFromSitePreviewHandlers;
4
- const glob_1 = require("glob");
5
- const ts_morph_1 = require("ts-morph");
1
+ import { glob } from "glob";
2
+ import { Project, SyntaxKind } from "ts-morph";
6
3
  /**
7
4
  * Removes the GraphQL client/fetch from the site preview handlers
8
5
  *
9
6
  * App Router: `sitePreviewRoute(request, createGraphQLFetch())` -> `sitePreviewRoute(request)`
10
7
  * Pages Router: `legacyPagesRouterSitePreviewApiHandler(req, res, createGraphQLClient())` -> `legacyPagesRouterSitePreviewApiHandler(req, res)`
11
8
  */
12
- async function removeGraphQLClientFromSitePreviewHandlers() {
13
- const project = new ts_morph_1.Project({ tsConfigFilePath: "./site/tsconfig.json" });
14
- const files = glob_1.glob.sync(["site/src/**/*.ts"]);
9
+ export default async function removeGraphQLClientFromSitePreviewHandlers() {
10
+ const project = new Project({ tsConfigFilePath: "./site/tsconfig.json" });
11
+ const files = glob.sync(["site/src/**/*.ts"]);
15
12
  for (const filePath of files) {
16
13
  const sourceFile = project.getSourceFile(filePath);
17
14
  if (!sourceFile) {
@@ -24,7 +21,7 @@ async function removeGraphQLClientFromSitePreviewHandlers() {
24
21
  .includes("sitePreviewRoute")));
25
22
  if (importsSitePreviewRoute) {
26
23
  sourceFile.forEachDescendant((node) => {
27
- if (node.isKind(ts_morph_1.SyntaxKind.CallExpression)) {
24
+ if (node.isKind(SyntaxKind.CallExpression)) {
28
25
  const callExpr = node;
29
26
  const expression = callExpr.getExpression();
30
27
  if (expression.getText() === "sitePreviewRoute") {
@@ -42,7 +39,7 @@ async function removeGraphQLClientFromSitePreviewHandlers() {
42
39
  .includes("legacyPagesRouterSitePreviewApiHandler")));
43
40
  if (legacyPagesRouterSitePreviewApiHandler) {
44
41
  sourceFile.forEachDescendant((node) => {
45
- if (node.isKind(ts_morph_1.SyntaxKind.CallExpression)) {
42
+ if (node.isKind(SyntaxKind.CallExpression)) {
46
43
  const callExpr = node;
47
44
  const expression = callExpr.getExpression();
48
45
  if (expression.getText() === "legacyPagesRouterSitePreviewApiHandler") {
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stage = void 0;
4
- exports.default = updateGraphqlSite;
5
- const fs_1 = require("fs");
6
- const package_json_util_1 = require("../../../util/package-json.util");
7
- exports.stage = "before-install";
8
- async function updateGraphqlSite() {
9
- if (!(0, fs_1.existsSync)("site/package.json")) {
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 updateGraphqlSite() {
5
+ if (!existsSync("site/package.json")) {
10
6
  return;
11
7
  }
12
- const packageJson = new package_json_util_1.PackageJson("site/package.json");
8
+ const packageJson = new PackageJson("site/package.json");
13
9
  packageJson.updateDependency("graphql", "^16.10.0");
14
10
  packageJson.save();
15
11
  }
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = tooltipReplaceVariantProp;
4
- const ts_morph_1 = require("ts-morph");
5
- async function tooltipReplaceVariantProp() {
6
- const project = new ts_morph_1.Project({ tsConfigFilePath: "./admin/tsconfig.json" });
1
+ import { Project, SyntaxKind } from "ts-morph";
2
+ export default async function tooltipReplaceVariantProp() {
3
+ const project = new Project({ tsConfigFilePath: "./admin/tsconfig.json" });
7
4
  const sourceFiles = project.getSourceFiles("admin/src/**/*.tsx");
8
5
  sourceFiles.forEach((sourceFile) => {
9
6
  const cometAdminImport = sourceFile.getImportDeclarations().find((importDeclaration) => {
@@ -19,27 +16,27 @@ async function tooltipReplaceVariantProp() {
19
16
  tooltipComponentNames.add(aliasName ? aliasName.getText() : "Tooltip");
20
17
  }
21
18
  });
22
- const jsxElements = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.JsxOpeningElement);
19
+ const jsxElements = sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement);
23
20
  jsxElements.forEach((jsxElement) => {
24
21
  const componentName = jsxElement.getTagNameNode().getText();
25
22
  if (tooltipComponentNames.has(componentName)) {
26
23
  const variantAttribute = jsxElement
27
24
  .getAttributes()
28
- .find((attribute) => attribute.getKind() === ts_morph_1.SyntaxKind.JsxAttribute &&
29
- attribute.asKind(ts_morph_1.SyntaxKind.JsxAttribute)?.getNameNode().getText() === "variant");
25
+ .find((attribute) => attribute.getKind() === SyntaxKind.JsxAttribute &&
26
+ attribute.asKind(SyntaxKind.JsxAttribute)?.getNameNode().getText() === "variant");
30
27
  if (variantAttribute) {
31
- const jsxAttribute = variantAttribute.asKind(ts_morph_1.SyntaxKind.JsxAttribute);
28
+ const jsxAttribute = variantAttribute.asKind(SyntaxKind.JsxAttribute);
32
29
  if (jsxAttribute) {
33
30
  const initializer = jsxAttribute.getInitializer();
34
31
  let variantValue = null;
35
32
  if (initializer) {
36
- if (initializer.getKind() === ts_morph_1.SyntaxKind.StringLiteral) {
37
- variantValue = initializer.asKind(ts_morph_1.SyntaxKind.StringLiteral)?.getLiteralValue() || null;
33
+ if (initializer.getKind() === SyntaxKind.StringLiteral) {
34
+ variantValue = initializer.asKind(SyntaxKind.StringLiteral)?.getLiteralValue() || null;
38
35
  }
39
- else if (initializer.getKind() === ts_morph_1.SyntaxKind.JsxExpression) {
40
- const expression = initializer.asKind(ts_morph_1.SyntaxKind.JsxExpression)?.getExpression();
41
- if (expression && expression.getKind() === ts_morph_1.SyntaxKind.StringLiteral) {
42
- variantValue = expression.asKind(ts_morph_1.SyntaxKind.StringLiteral)?.getLiteralValue() || null;
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;
43
40
  }
44
41
  }
45
42
  }
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stage = void 0;
4
- exports.default = updateNextDependencies;
5
- const fs_1 = require("fs");
6
- const package_json_util_1 = require("../../../util/package-json.util");
7
- exports.stage = "before-install";
8
- async function updateNextDependencies() {
9
- if (!(0, fs_1.existsSync)("site/package.json")) {
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")) {
10
6
  return;
11
7
  }
12
- const packageJson = new package_json_util_1.PackageJson("site/package.json");
8
+ const packageJson = new PackageJson("site/package.json");
13
9
  packageJson.updateDependency("next", "^15.5.4");
14
10
  packageJson.updateDependency("@next/bundle-analyzer", "^15.5.4");
15
11
  packageJson.updateDependency("react", "^19.2.0");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/upgrade",
3
- "version": "1.115.0",
3
+ "version": "1.117.0",
4
4
  "description": "Upgrade scripts for Comet DXP",
5
5
  "homepage": "https://github.com/vivid-planet/comet-upgrade#readme",
6
6
  "bugs": {
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "license": "BSD-2-Clause",
14
14
  "author": "Vivid Planet Software GmbH <office@vivid-planet.com> (https://www.vivid-planet.com/)",
15
- "main": "lib/index.js",
15
+ "type": "module",
16
+ "exports": "./lib/index.js",
16
17
  "bin": "bin/index.js",
17
18
  "files": [
18
19
  "lib/**/*.js"
@@ -40,7 +41,7 @@
40
41
  "@types/node": "^22.18.9",
41
42
  "@types/semver": "^7.7.1",
42
43
  "husky": "^9.1.7",
43
- "lint-staged": "^16.2.3",
44
+ "lint-staged": "^16.2.4",
44
45
  "npm-run-all2": "^8.0.4",
45
46
  "rimraf": "^6.0.1",
46
47
  "typescript": "^5.9.3"