@expo-harmony/prebuild-config 55.0.0-harmony.7 → 55.0.0-harmony.9

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/README.md CHANGED
@@ -33,7 +33,7 @@ npm install @expo-harmony/prebuild-config
33
33
  }
34
34
  ```
35
35
 
36
- `bundleName` 必填,其余字段有默认值。完整列表见 [@expo-harmony/config-plugins](../config-plugins/README.md)。
36
+ `bundleName` 必填,其余字段有默认值。完整列表见 `@expo-harmony/config-plugins` 的 README。
37
37
 
38
38
  生成或更新原生工程:
39
39
 
@@ -48,7 +48,7 @@ npx expo-harmony prebuild
48
48
  | 文件 | 内容 |
49
49
  | -------------------------------------- | --------------------------------------------------- |
50
50
  | `AppScope/app.json5` | 包名、版本号、vendor、应用名和图标引用 |
51
- | `build-profile.json5` | product、module、SDK 版本、ABI 和签名配置 |
51
+ | `build-profile.json5` | product、module、SDK 版本、原生编译器和签名配置 |
52
52
  | `entry/build-profile.json5` | Entry 模块的 CMake 路径和 ABI |
53
53
  | `entry/src/main/module.json5` | module、Ability、设备类型、权限和 querySchemes |
54
54
  | `entry/src/main/resources/` | 字符串、颜色和 media 资源 |
@@ -96,7 +96,6 @@ function resolveInputFile(root, value) {
96
96
  }
97
97
  function withEntryMods(config) {
98
98
  config = (0, config_plugins_1.withEntryBuildProfile)(config, (mod) => {
99
- const harmony = (0, config_plugins_1.normalizeHarmonyConfig)(mod.modRawConfig);
100
99
  const build = (0, reconcile_1.readRecord)(mod.modResults.buildOption);
101
100
  const native = (0, reconcile_1.readRecord)(build.externalNativeOptions);
102
101
  mod.modResults = {
@@ -107,7 +106,6 @@ function withEntryMods(config) {
107
106
  externalNativeOptions: {
108
107
  ...native,
109
108
  path: './src/main/cpp/CMakeLists.txt',
110
- abiFilters: harmony.abiFilters,
111
109
  },
112
110
  },
113
111
  targets: (0, reconcile_1.upsertNamed)((0, reconcile_1.upsertNamed)(mod.modResults.targets, 'default', existing => ({
@@ -171,6 +169,7 @@ function withEntryMods(config) {
171
169
  ...module,
172
170
  name: harmony.moduleName,
173
171
  type: 'entry',
172
+ srcEntry: './ets/abilitystage/EntryAbilityStage.ets',
174
173
  description: '$string:expo_harmony_module_desc',
175
174
  mainElement: harmony.abilityName,
176
175
  deviceTypes: harmony.deviceTypes,
@@ -102,10 +102,7 @@ function withProjectMods(config) {
102
102
  const product = {
103
103
  ...existing,
104
104
  name: productName,
105
- compatibleSdkVersion: harmony.compatibleSdkVersionString,
106
- targetSdkVersion: harmony.targetSdkVersionString,
107
105
  runtimeOS: 'HarmonyOS',
108
- buildOption: { ...(existing.buildOption || {}), nativeCompiler: 'BiSheng' },
109
106
  ...(signing ? { signingConfig: signing.name } : {}),
110
107
  };
111
108
  if (!signing && product.signingConfig === previousSigning) {
@@ -38,10 +38,11 @@ const config_plugins_1 = require("@expo-harmony/config-plugins");
38
38
  const dependencies_1 = require("../dependencies");
39
39
  const render = __importStar(require("../renderers"));
40
40
  const SourceMods = [
41
+ [config_plugins_1.withAbilityStage, config_plugins_1.HarmonyPaths.HARMONY_PATHS.abilityStage],
41
42
  [config_plugins_1.withEntryAbility, config_plugins_1.HarmonyPaths.HARMONY_PATHS.entryAbility, render.renderEntryAbility],
42
- [config_plugins_1.withIndexPage, config_plugins_1.HarmonyPaths.HARMONY_PATHS.indexPage, render.renderIndexPage],
43
+ [config_plugins_1.withIndexPage, config_plugins_1.HarmonyPaths.HARMONY_PATHS.indexPage],
43
44
  [config_plugins_1.withWorker, config_plugins_1.HarmonyPaths.HARMONY_PATHS.worker],
44
- [config_plugins_1.withArkTSPackageProvider, config_plugins_1.HarmonyPaths.HARMONY_PATHS.arktsPackageProvider],
45
+ [config_plugins_1.withArkTSPackageProvider, config_plugins_1.HarmonyPaths.HARMONY_PATHS.arktsPackageProvider, render.renderPackageProvider],
45
46
  [config_plugins_1.withCppPackageProvider, config_plugins_1.HarmonyPaths.HARMONY_PATHS.cppPackageProvider],
46
47
  [config_plugins_1.withCMakeLists, config_plugins_1.HarmonyPaths.HARMONY_PATHS.cmakeLists],
47
48
  ];
@@ -3,5 +3,5 @@ declare function renderCanonical(source: any, label: any): string;
3
3
  declare function renderReactNativeConfig(): string;
4
4
  declare function renderRootHvigor(source: any, build: HarmonyBuildDescriptor): any;
5
5
  declare function renderEntryAbility(source: any, harmony: any): any;
6
- declare function renderIndexPage(source: any, harmony: any): any;
7
- export { renderCanonical, renderEntryAbility, renderIndexPage, renderReactNativeConfig, renderRootHvigor, };
6
+ declare function renderPackageProvider(source: any, harmony: any): any;
7
+ export { renderCanonical, renderEntryAbility, renderPackageProvider, renderReactNativeConfig, renderRootHvigor, };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderCanonical = renderCanonical;
4
4
  exports.renderEntryAbility = renderEntryAbility;
5
- exports.renderIndexPage = renderIndexPage;
5
+ exports.renderPackageProvider = renderPackageProvider;
6
6
  exports.renderReactNativeConfig = renderReactNativeConfig;
7
7
  exports.renderRootHvigor = renderRootHvigor;
8
8
  const template_1 = require("./template");
@@ -39,7 +39,7 @@ function renderEntryAbility(source, harmony) {
39
39
  source = renderCanonical(source, 'EntryAbility.ets');
40
40
  return replacePlaceholder(source, template_1.TEMPLATE_PLACEHOLDERS.abilityName, harmony.abilityName, 'ability class');
41
41
  }
42
- function renderIndexPage(source, harmony) {
43
- source = renderCanonical(source, 'Index.ets');
42
+ function renderPackageProvider(source, harmony) {
43
+ source = renderCanonical(source, 'PackageProvider.ets');
44
44
  return replacePlaceholder(source, JSON.stringify(template_1.TEMPLATE_PLACEHOLDERS.appLabel), JSON.stringify(harmony.label), 'RN instance name');
45
45
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withHarmonyPrebuildConfig = void 0;
4
4
  const config_plugins_1 = require("@expo-harmony/config-plugins");
5
+ const expo_build_properties_1 = require("@expo-harmony/expo-build-properties");
5
6
  const errors_1 = require("./errors");
6
7
  const withAutolinkingMods_1 = require("./mods/withAutolinkingMods");
7
8
  const withEntryMods_1 = require("./mods/withEntryMods");
@@ -17,6 +18,7 @@ const withDefaults = (config, props) => {
17
18
  throw new errors_1.HarmonyPrebuildError('ERR_HARMONY_CONFIG_INVALID', 'Harmony prebuild options only accept buildType: "debug" or "release".', { operation: 'configure-prebuild' });
18
19
  }
19
20
  config = (0, withPreparationMod_1.withPreparationMod)(config);
21
+ config = (0, expo_build_properties_1.withBuildPropertiesDefaults)(config);
20
22
  config = (0, withProjectMods_1.withProjectMods)(config);
21
23
  config = (0, withEntryMods_1.withEntryMods)(config);
22
24
  config = (0, withSourceMods_1.withSourceMods)(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo-harmony/prebuild-config",
3
- "version": "55.0.0-harmony.7",
3
+ "version": "55.0.0-harmony.9",
4
4
  "keywords": [
5
5
  "react-native",
6
6
  "expo",
@@ -19,7 +19,7 @@
19
19
  "main": "build/index.js",
20
20
  "types": "build/index.d.ts",
21
21
  "scripts": {
22
- "prebuild": "yarn workspace @expo-harmony/config-plugins build && yarn workspace @expo-harmony/expo-modules-autolinking build",
22
+ "prebuild": "yarn workspace @expo-harmony/config-plugins build && yarn workspace @expo-harmony/expo-build-properties build && yarn workspace @expo-harmony/expo-modules-autolinking build",
23
23
  "build": "tsc -p tsconfig.json",
24
24
  "prepare": "yarn build",
25
25
  "typecheck": "tsc --noEmit -p tsconfig.json"
@@ -43,9 +43,10 @@
43
43
  "./package.json": "./package.json"
44
44
  },
45
45
  "dependencies": {
46
- "@expo-harmony/config-plugins": "55.0.10-harmony.3",
47
- "@expo-harmony/expo-modules-autolinking": "55.0.25-harmony.3",
48
- "@expo-harmony/template": "55.0.0-harmony.4",
46
+ "@expo-harmony/config-plugins": "55.0.10-harmony.5",
47
+ "@expo-harmony/expo-build-properties": "55.0.14-harmony.1",
48
+ "@expo-harmony/expo-modules-autolinking": "55.0.25-harmony.5",
49
+ "@expo-harmony/template": "55.0.0-harmony.6",
49
50
  "@expo/config": "55.0.17",
50
51
  "@expo/config-plugins": "55.0.10",
51
52
  "@react-native-community/cli-config": "15.1.3",
@@ -56,6 +57,9 @@
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/node": "18.19.0",
60
+ "expo": "55.0.26",
61
+ "react": "19.2.3",
62
+ "react-native": "0.84.1",
59
63
  "typescript": "6.0.3"
60
64
  },
61
65
  "engines": {
@@ -103,7 +103,6 @@ function resolveInputFile(root, value) {
103
103
 
104
104
  function withEntryMods(config) {
105
105
  config = withEntryBuildProfile(config, (mod) => {
106
- const harmony = normalizeHarmonyConfig(mod.modRawConfig);
107
106
  const build = readRecord(mod.modResults.buildOption);
108
107
  const native = readRecord(build.externalNativeOptions);
109
108
 
@@ -115,7 +114,6 @@ function withEntryMods(config) {
115
114
  externalNativeOptions: {
116
115
  ...native,
117
116
  path: './src/main/cpp/CMakeLists.txt',
118
- abiFilters: harmony.abiFilters,
119
117
  },
120
118
  },
121
119
  targets: upsertNamed(
@@ -218,6 +216,7 @@ function withEntryMods(config) {
218
216
  ...module,
219
217
  name: harmony.moduleName,
220
218
  type: 'entry',
219
+ srcEntry: './ets/abilitystage/EntryAbilityStage.ets',
221
220
  description: '$string:expo_harmony_module_desc',
222
221
  mainElement: harmony.abilityName,
223
222
  deviceTypes: harmony.deviceTypes,
@@ -242,6 +241,7 @@ function withEntryMods(config) {
242
241
  'strings',
243
242
  mod._internal?.harmonyStaleConfigPlugins || []
244
243
  );
244
+
245
245
  const app = mod.modResults.app ??= {};
246
246
  const entry = mod.modResults.entry ??= {};
247
247
 
@@ -263,7 +263,9 @@ function withEntryMods(config) {
263
263
  'colors',
264
264
  mod._internal?.harmonyStaleConfigPlugins || []
265
265
  );
266
+
266
267
  const entry = mod.modResults.entry ??= {};
268
+
267
269
  mod.modResults.entryDark ??= {};
268
270
 
269
271
  HarmonyResources.setColor(entry, { name: 'expo_harmony_start_window_background', value: harmony.backgroundColor });
@@ -109,10 +109,7 @@ export function withProjectMods(config) {
109
109
  const product = {
110
110
  ...existing,
111
111
  name: productName,
112
- compatibleSdkVersion: harmony.compatibleSdkVersionString,
113
- targetSdkVersion: harmony.targetSdkVersionString,
114
112
  runtimeOS: 'HarmonyOS',
115
- buildOption: { ...(existing.buildOption || {}), nativeCompiler: 'BiSheng' },
116
113
  ...(signing ? { signingConfig: signing.name } : {}),
117
114
  };
118
115
 
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  normalizeHarmonyConfig, HarmonyPaths, withArkTSPackageProvider, withCMakeLists, withCppPackageProvider,
3
- withEntryAbility, withIndexPage, withWorker,
3
+ withAbilityStage, withEntryAbility, withIndexPage, withWorker,
4
4
  } from '@expo-harmony/config-plugins';
5
5
 
6
6
  import { readTemplateSource } from '../dependencies';
7
7
  import * as render from '../renderers';
8
8
 
9
9
  const SourceMods = [
10
+ [withAbilityStage, HarmonyPaths.HARMONY_PATHS.abilityStage],
10
11
  [withEntryAbility, HarmonyPaths.HARMONY_PATHS.entryAbility, render.renderEntryAbility],
11
- [withIndexPage, HarmonyPaths.HARMONY_PATHS.indexPage, render.renderIndexPage],
12
+ [withIndexPage, HarmonyPaths.HARMONY_PATHS.indexPage],
12
13
  [withWorker, HarmonyPaths.HARMONY_PATHS.worker],
13
- [withArkTSPackageProvider, HarmonyPaths.HARMONY_PATHS.arktsPackageProvider],
14
+ [withArkTSPackageProvider, HarmonyPaths.HARMONY_PATHS.arktsPackageProvider, render.renderPackageProvider],
14
15
  [withCppPackageProvider, HarmonyPaths.HARMONY_PATHS.cppPackageProvider],
15
16
  [withCMakeLists, HarmonyPaths.HARMONY_PATHS.cmakeLists],
16
17
  ] as const;
package/src/renderers.ts CHANGED
@@ -57,8 +57,8 @@ function renderEntryAbility(source, harmony) {
57
57
  );
58
58
  }
59
59
 
60
- function renderIndexPage(source, harmony) {
61
- source = renderCanonical(source, 'Index.ets');
60
+ function renderPackageProvider(source, harmony) {
61
+ source = renderCanonical(source, 'PackageProvider.ets');
62
62
 
63
63
  return replacePlaceholder(
64
64
  source,
@@ -71,7 +71,7 @@ function renderIndexPage(source, harmony) {
71
71
  export {
72
72
  renderCanonical,
73
73
  renderEntryAbility,
74
- renderIndexPage,
74
+ renderPackageProvider,
75
75
  renderReactNativeConfig,
76
76
  renderRootHvigor,
77
77
  };
@@ -4,6 +4,8 @@ import {
4
4
  type HarmonyConfigPlugin,
5
5
  } from '@expo-harmony/config-plugins';
6
6
 
7
+ import { withBuildPropertiesDefaults } from '@expo-harmony/expo-build-properties';
8
+
7
9
  import { HarmonyPrebuildError } from './errors';
8
10
  import { withAutolinkingMods } from './mods/withAutolinkingMods';
9
11
  import { withEntryMods } from './mods/withEntryMods';
@@ -29,6 +31,7 @@ const withDefaults: HarmonyConfigPlugin<HarmonyPrebuildOptions | void> = (config
29
31
  }
30
32
 
31
33
  config = withPreparationMod(config);
34
+ config = withBuildPropertiesDefaults(config);
32
35
  config = withProjectMods(config);
33
36
  config = withEntryMods(config);
34
37
  config = withSourceMods(config);