@strapi/upgrade 5.0.0-rc.14 → 5.0.0-rc.16

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/dist/cli.js CHANGED
@@ -1470,7 +1470,7 @@ When executed on a Strapi plugin project, it shows every codemods.
1470
1470
  return listCodemods(options);
1471
1471
  });
1472
1472
  };
1473
- const version = "5.0.0-rc.14";
1473
+ const version = "5.0.0-rc.16";
1474
1474
  register$1(commander.program);
1475
1475
  register(commander.program);
1476
1476
  commander.program.usage("<command> [options]").on("command:*", ([invalidCmd]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/upgrade",
3
- "version": "5.0.0-rc.14",
3
+ "version": "5.0.0-rc.16",
4
4
  "description": "CLI to upgrade Strapi applications effortless",
5
5
  "keywords": [
6
6
  "strapi",
@@ -59,7 +59,7 @@
59
59
  "watch": "pack-up watch"
60
60
  },
61
61
  "dependencies": {
62
- "@strapi/utils": "5.0.0-rc.14",
62
+ "@strapi/utils": "5.0.0-rc.16",
63
63
  "chalk": "4.1.2",
64
64
  "cli-table3": "0.6.2",
65
65
  "commander": "8.3.0",
@@ -76,15 +76,15 @@
76
76
  },
77
77
  "devDependencies": {
78
78
  "@strapi/pack-up": "5.0.0",
79
- "@strapi/types": "5.0.0-rc.14",
79
+ "@strapi/types": "5.0.0-rc.16",
80
80
  "@types/fs-extra": "11.0.4",
81
81
  "@types/jscodeshift": "0.11.10",
82
- "eslint-config-custom": "5.0.0-rc.14",
82
+ "eslint-config-custom": "5.0.0-rc.16",
83
83
  "rimraf": "5.0.5"
84
84
  },
85
85
  "engines": {
86
86
  "node": ">=18.0.0 <=20.x.x",
87
87
  "npm": ">=6.0.0"
88
88
  },
89
- "gitHead": "e18c706dc0bfda296f9c3005e719bd60b3732531"
89
+ "gitHead": "d5489625ee1a177a3fe6d180d3f901680a48bbf7"
90
90
  }
@@ -0,0 +1,30 @@
1
+ import type { Transform } from 'jscodeshift';
2
+ import { changeImportSpecifier } from '../../utils/change-import';
3
+ import { replaceJSXElement } from '../../utils/replace-jsx';
4
+
5
+ /**
6
+ * change CheckPagePermissions import from '@strapi/helper-plugin' to Page from '@strapi/strapi/admin'
7
+ * And replace all uses of CheckPagePermissions with Page
8
+ */
9
+ const transform: Transform = (file, api) => {
10
+ const { j } = api;
11
+
12
+ const root = j.withParser('tsx')(file.source);
13
+
14
+ replaceJSXElement(root, j, {
15
+ oldElementName: 'CheckPagePermissions',
16
+ newElementName: 'Page',
17
+ oldDependency: '@strapi/helper-plugin',
18
+ });
19
+
20
+ changeImportSpecifier(root, j, {
21
+ oldMethodName: 'CheckPagePermissions',
22
+ newMethodName: 'Page',
23
+ oldDependency: '@strapi/helper-plugin',
24
+ newDependency: '@strapi/strapi/admin',
25
+ });
26
+
27
+ return root.toSource();
28
+ };
29
+
30
+ export default transform;
@@ -10,7 +10,7 @@ const transform: Transform = (file, api) => {
10
10
  const root = j.withParser('tsx')(file.source);
11
11
 
12
12
  changeImportSpecifier(root, j, {
13
- methodName: 'useAPIErrorHandler',
13
+ oldMethodName: 'useAPIErrorHandler',
14
14
  oldDependency: '@strapi/helper-plugin',
15
15
  newDependency: '@strapi/strapi/admin',
16
16
  });