@strapi/generators 5.0.0-alpha.0 → 5.0.0-alpha.2

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.
@@ -1,4 +1,4 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
1
+ import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
2
2
  import pluginPkg from '../../package.json';
3
3
  import pluginId from './pluginId';
4
4
  import Initializer from './components/Initializer';
@@ -0,0 +1,11 @@
1
+ const prefixPluginTranslations = (trad, pluginId) => {
2
+ if (!pluginId) {
3
+ throw new TypeError("pluginId can't be empty");
4
+ }
5
+ return Object.keys(trad).reduce((acc, current) => {
6
+ acc[`${pluginId}.${current}`] = trad[current];
7
+ return acc;
8
+ }, {});
9
+ };
10
+
11
+ export { prefixPluginTranslations };
@@ -1,4 +1,4 @@
1
- import { prefixPluginTranslations } from '@strapi/helper-plugin';
1
+ import { prefixPluginTranslations } from './utils/prefixPluginTranslations';
2
2
 
3
3
  import pluginPkg from '../../package.json';
4
4
  import pluginId from './pluginId';
@@ -0,0 +1,13 @@
1
+ type TradOptions = Record<string, string>;
2
+
3
+ const prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {
4
+ if (!pluginId) {
5
+ throw new TypeError("pluginId can't be empty");
6
+ }
7
+ return Object.keys(trad).reduce((acc, current) => {
8
+ acc[`${pluginId}.${current}`] = trad[current];
9
+ return acc;
10
+ }, {} as TradOptions);
11
+ };
12
+
13
+ export { prefixPluginTranslations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/generators",
3
- "version": "5.0.0-alpha.0",
3
+ "version": "5.0.0-alpha.2",
4
4
  "description": "Interactive API generator.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@sindresorhus/slugify": "1.1.0",
49
- "@strapi/typescript-utils": "5.0.0-alpha.0",
50
- "@strapi/utils": "5.0.0-alpha.0",
49
+ "@strapi/typescript-utils": "5.0.0-alpha.2",
50
+ "@strapi/utils": "5.0.0-alpha.2",
51
51
  "chalk": "4.1.2",
52
52
  "copyfiles": "2.4.1",
53
53
  "fs-extra": "10.1.0",
@@ -56,13 +56,13 @@
56
56
  "pluralize": "8.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@strapi/pack-up": "5.0.0-alpha.0",
60
- "eslint-config-custom": "5.0.0-alpha.0",
61
- "tsconfig": "5.0.0-alpha.0"
59
+ "@strapi/pack-up": "5.0.0-alpha.2",
60
+ "eslint-config-custom": "5.0.0-alpha.2",
61
+ "tsconfig": "5.0.0-alpha.2"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=18.0.0 <=20.x.x",
65
65
  "npm": ">=6.0.0"
66
66
  },
67
- "gitHead": "ceeb3f383cbaf51eeaa373750a27a2880a10f727"
67
+ "gitHead": "7f3ccd6b244b0357c914ccb50dc5b7018f51305c"
68
68
  }