@forge/cli-shared 8.15.2-next.3-experimental-812ca41 → 8.15.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.
@@ -15,7 +15,6 @@ export declare class I18nResourceBundlingService {
15
15
  private createI18nInfoFile;
16
16
  private createI18nInfo;
17
17
  private loadTranslationLookup;
18
- private extractAllKeysFromTranslationLookup;
19
18
  bundle(modules?: Modules, i18nConfig?: Translations): Promise<I18nResourceBundle>;
20
19
  createFileAccessor(i18nConfig: Translations): I18nResourceFileAccessor;
21
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-resource-bundling-service.d.ts","sourceRoot":"","sources":["../../src/service/i18n-resource-bundling-service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAOjG,oBAAY,kBAAkB,GAC1B;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACd,GACD;IACE,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEN,eAAO,MAAM,0BAA0B,EAAE,kBAAsC,CAAC;AAIhF,aAAK,wBAAwB,GAAG,CAAC,WAAW,EAAE,wBAAwB,GAAG,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE3G,eAAO,MAAM,6BAA6B,uBAAwB,kBAAkB,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAMtG,CAAC;AAEF,qBAAa,2BAA2B;YACxB,0BAA0B;YAU1B,kBAAkB;IAkBhC,OAAO,CAAC,cAAc;YAgCR,qBAAqB;IAmBnC,OAAO,CAAC,mCAAmC;IAgC9B,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWvF,kBAAkB,CAAC,UAAU,EAAE,YAAY,GAAG,wBAAwB;CAuB9E"}
1
+ {"version":3,"file":"i18n-resource-bundling-service.d.ts","sourceRoot":"","sources":["../../src/service/i18n-resource-bundling-service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAOjG,oBAAY,kBAAkB,GAC1B;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACd,GACD;IACE,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEN,eAAO,MAAM,0BAA0B,EAAE,kBAAsC,CAAC;AAIhF,aAAK,wBAAwB,GAAG,CAAC,WAAW,EAAE,wBAAwB,GAAG,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE3G,eAAO,MAAM,6BAA6B,uBAAwB,kBAAkB,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAMtG,CAAC;AAEF,qBAAa,2BAA2B;YACxB,0BAA0B;YAU1B,kBAAkB;IAUhC,OAAO,CAAC,cAAc;YAgCR,qBAAqB;IActB,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWvF,kBAAkB,CAAC,UAAU,EAAE,YAAY,GAAG,wBAAwB;CAuB9E"}
@@ -24,12 +24,8 @@ class I18nResourceBundlingService {
24
24
  }));
25
25
  }
26
26
  async createI18nInfoFile(bundleDirPath, i18nConfig, modules) {
27
- const manifestKeys = (0, i18n_1.extractI18nKeysFromModules)(modules);
27
+ const i18nKeys = (0, i18n_1.extractI18nKeysFromModules)(modules);
28
28
  const translationLookup = await this.loadTranslationLookup(i18nConfig);
29
- const DYNAMIC_MODULE_I18N_PREFIX = 'dynamic.';
30
- const allLocaleKeys = this.extractAllKeysFromTranslationLookup(translationLookup);
31
- const dynamicKeys = allLocaleKeys.filter((key) => key.startsWith(DYNAMIC_MODULE_I18N_PREFIX));
32
- const i18nKeys = [...new Set([...manifestKeys, ...dynamicKeys])].sort();
33
29
  const i18nInfo = this.createI18nInfo(i18nConfig, i18nKeys, translationLookup);
34
30
  const i18nInfoFilePath = (0, path_1.join)(bundleDirPath, i18n_1.I18N_INFO_FILE_NAME);
35
31
  await fs_1.promises.writeFile(i18nInfoFilePath, JSON.stringify(i18nInfo));
@@ -70,29 +66,6 @@ class I18nResourceBundlingService {
70
66
  }));
71
67
  return Object.fromEntries(results);
72
68
  }
73
- extractAllKeysFromTranslationLookup(translationLookup) {
74
- const allKeys = new Set();
75
- const extractKeys = (obj, prefix = '') => {
76
- if (!obj || typeof obj !== 'object') {
77
- return;
78
- }
79
- for (const [key, value] of Object.entries(obj)) {
80
- const fullKey = prefix ? `${prefix}.${key}` : key;
81
- if (typeof value === 'string') {
82
- allKeys.add(fullKey);
83
- }
84
- else if (typeof value === 'object' && value !== null) {
85
- extractKeys(value, fullKey);
86
- }
87
- }
88
- };
89
- for (const localeTranslations of Object.values(translationLookup)) {
90
- if (localeTranslations && typeof localeTranslations === 'object') {
91
- extractKeys(localeTranslations);
92
- }
93
- }
94
- return Array.from(allKeys);
95
- }
96
69
  async bundle(modules, i18nConfig) {
97
70
  if (!modules || !i18nConfig) {
98
71
  return exports.EMPTY_I18N_RESOURCE_BUNDLE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli-shared",
3
- "version": "8.15.2-next.3-experimental-812ca41",
3
+ "version": "8.15.2",
4
4
  "description": "Common functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -12,7 +12,7 @@
12
12
  "generate-graphql-types": "graphql-codegen --config src/graphql/codegen.yml"
13
13
  },
14
14
  "dependencies": {
15
- "@forge/manifest": "12.1.1-next.1-experimental-812ca41",
15
+ "@forge/manifest": "12.1.1",
16
16
  "@forge/util": "2.0.1",
17
17
  "@forge/i18n": "0.0.7",
18
18
  "@sentry/node": "7.106.0",