@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.
- package/bin/index.js +1 -1
- package/lib/index.js +33 -73
- package/lib/util/execute-command.util.js +3 -6
- package/lib/util/format-code.util.js +3 -6
- package/lib/util/get-latest-package-version.js +3 -9
- package/lib/util/package-json.util.js +5 -9
- package/lib/util/update-dependency-version.util.js +5 -8
- package/lib/v4/remove-clear-types-script.js +7 -13
- package/lib/v6/rename-build-runtime.js +7 -10
- package/lib/v6/rename-job-status-enum.js +7 -10
- package/lib/v6/rename-subject-entity-decorator.js +7 -10
- package/lib/v7/add-site-preview-secret.js +26 -65
- package/lib/v7/hide-graphql-field-suggestions.js +6 -9
- package/lib/v7/import-admin-theme-types.js +7 -13
- package/lib/v7/rename-date-filter-to-date-time-filter.js +7 -10
- package/lib/v7/replace-exception-interceptor-with-exception-filter.js +8 -11
- package/lib/v7/replace-gridcoldef-import.js +7 -10
- package/lib/v7/replace-roboto-with-roboto-flex.js +11 -14
- package/lib/v7/use-graphql-scalars.js +11 -14
- package/lib/v8/admin/after-install/add-dialog-content-to-edit-dialog.js +14 -17
- package/lib/v8/admin/after-install/clipboard-helpers.js +7 -10
- package/lib/v8/admin/after-install/comet-config-provider.js +66 -69
- package/lib/v8/admin/after-install/merge-admin-theme-into-admin.js +10 -13
- package/lib/v8/admin/after-install/merge-blocks-admin-into-cms-admin.js +8 -11
- package/lib/v8/admin/after-install/mui-codemods.js +9 -12
- package/lib/v8/admin/after-install/mui-data-grid-remove-error-prop.js +6 -9
- package/lib/v8/admin/after-install/mui-grid-sort-to-gql.js +6 -9
- package/lib/v8/admin/after-install/mui-x-codemods.js +4 -7
- package/lib/v8/admin/after-install/rename-menu-components-in-admin.js +7 -10
- package/lib/v8/admin/after-install/replace-mui-button-with-comet-admin-button.js +3 -6
- package/lib/v8/admin/after-install/tooltip-1-update-import.js +5 -8
- package/lib/v8/admin/after-install/tooltip-2-remove-trigger-prop.js +6 -9
- package/lib/v8/admin/after-install/update-import-of-dialog.js +5 -8
- package/lib/v8/admin/before-install/remove-admin-theme-package.js +6 -10
- package/lib/v8/admin/before-install/remove-blocks-packages-admin.js +6 -10
- package/lib/v8/admin/before-install/remove-comet-admin-react-select-dependency.js +6 -10
- package/lib/v8/admin/before-install/remove-v8-eslint-disable-comments-admin.js +4 -8
- package/lib/v8/admin/before-install/update-graphql-admin.js +6 -10
- package/lib/v8/admin/before-install/update-mui-dependencies.js +6 -10
- package/lib/v8/admin/before-install/update-mui-x-dependencies.js +6 -10
- package/lib/v8/admin/before-install/update-react-dependencies.js +6 -10
- package/lib/v8/admin/before-install/update-swc-dependencies.js +6 -10
- package/lib/v8/admin/before-install/use-mui-date-picker-in-grid.js +10 -14
- package/lib/v8/api/after-install/merge-blocks-api-into-cms-api.js +8 -11
- package/lib/v8/api/after-install/mikro-orm-base-entity-generic.js +6 -9
- package/lib/v8/api/after-install/mikro-orm-create-request-context.js +7 -10
- package/lib/v8/api/after-install/mikro-orm-custom-type.js +6 -9
- package/lib/v8/api/after-install/mikro-orm-delete-rule.js +6 -9
- package/lib/v8/api/after-install/mikro-orm-dotenv.js +5 -8
- package/lib/v8/api/after-install/mikro-orm-imports.js +6 -9
- package/lib/v8/api/after-install/mikro-orm-ormconfig.js +5 -8
- package/lib/v8/api/after-install/move-maxSrcResolution-in-comet-config.js +7 -13
- package/lib/v8/api/after-install/replace-playground-with-graphiql.js +12 -15
- package/lib/v8/api/after-install/update-dam-configuration.js +13 -16
- package/lib/v8/api/after-install/update-graphql-format-error.js +4 -7
- package/lib/v8/api/after-install/update-s3-config.js +8 -11
- package/lib/v8/api/before-install/nest-peer-dependencies.js +6 -10
- package/lib/v8/api/before-install/remove-blocks-packages-api.js +6 -10
- package/lib/v8/api/before-install/remove-passport.js +6 -10
- package/lib/v8/api/before-install/replace-nestjs-console-with-nest-commander.js +6 -10
- package/lib/v8/api/before-install/update-class-validator.js +7 -11
- package/lib/v8/api/before-install/update-kubernetes-client-node.js +6 -10
- package/lib/v8/api/before-install/update-mikro-orm-dependencies.js +6 -10
- package/lib/v8/api/before-install/update-nest-dependencies.js +6 -10
- package/lib/v8/api/before-install/update-sentry.js +9 -13
- package/lib/v8/eslint-dev-dependencies.js +22 -26
- package/lib/v8/ignore-restricted-imports-admin.js +4 -8
- package/lib/v8/prettier-dev-dependencies.js +12 -16
- package/lib/v8/remove-react-barrel-imports-admin.js +5 -8
- package/lib/v8/remove-react-barrel-imports-site.js +5 -8
- package/lib/v8/replace-node-with-v22-in-gitlab-ci-files.js +6 -43
- package/lib/v8/replace-node-with-v22-locally.js +9 -13
- package/lib/v8/site/after-install/remove-graphql-client-from-site-preview-handlers.js +7 -10
- package/lib/v8/site/before-install/update-graphql-site.js +6 -10
- package/lib/v9/admin/after-install/tooltip-replace-variant-prop.js +13 -16
- package/lib/v9/site/before-install/update-next-dependencies.js +6 -10
- package/package.json +4 -3
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
14
|
-
const files =
|
|
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(
|
|
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(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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(
|
|
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() ===
|
|
29
|
-
attribute.asKind(
|
|
25
|
+
.find((attribute) => attribute.getKind() === SyntaxKind.JsxAttribute &&
|
|
26
|
+
attribute.asKind(SyntaxKind.JsxAttribute)?.getNameNode().getText() === "variant");
|
|
30
27
|
if (variantAttribute) {
|
|
31
|
-
const jsxAttribute = variantAttribute.asKind(
|
|
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() ===
|
|
37
|
-
variantValue = initializer.asKind(
|
|
33
|
+
if (initializer.getKind() === SyntaxKind.StringLiteral) {
|
|
34
|
+
variantValue = initializer.asKind(SyntaxKind.StringLiteral)?.getLiteralValue() || null;
|
|
38
35
|
}
|
|
39
|
-
else if (initializer.getKind() ===
|
|
40
|
-
const expression = initializer.asKind(
|
|
41
|
-
if (expression && expression.getKind() ===
|
|
42
|
-
variantValue = expression.asKind(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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.
|
|
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
|
-
"
|
|
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.
|
|
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"
|