@react-native-oh/react-native-harmony-cli 0.77.59 → 0.82.18
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/codegen/generators/NativeModuleCodeGenerator.js +3 -3
- package/dist/commands/bundle-harmony.js +24 -20
- package/dist/init/templates/harmony/build-profile.json5 +1 -0
- package/harmony/rnoh-hvigor-plugin-0.82.18.tgz +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/00a68392 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0544a6cc +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0f36b2db +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12f23f1e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/13d95d98 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1629e86b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/180c8379 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a697147 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a8271b1 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1b7fa689 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/255a9f13 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/268d155b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/27db9aa4 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/28db79ed +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2dc2bbcb +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2df5f8c5 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2f88aedb +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/31b3a7ea +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/36335b1c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/38fca641 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/397722eb +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/397b6432 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b17421f +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/454f5e18 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/45ec6cce +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/482d51b1 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4ac5cd67 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4d40499a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4dcad919 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4fc31929 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/54edc8f5 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/558a5405 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/58d2b670 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5ec7feca +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62180f3e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/63981360 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64096c89 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64af560b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6585e783 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{8e83cbe1 → 6954304f} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{1184678c → 69fd6235} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6d3a0478 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6e131db7 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/778cd8f1 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/788206b6 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7882dc26 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7b3c14f7 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7cdfe667 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8048c487 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8332d9a3 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84e5b603 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/854d8127 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88c97376 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/90d5f644 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/967e25ac +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/969896c2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9790193e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{c342b18e → 97ae40c5} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9a5bf482 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a07adeb9 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a427f355 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{cf039161 → a9dd7eb7} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a9e9d79e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab920855 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab9e3038 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/af054988 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/afe03e51 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b3b83913 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b4db7b4d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b5225355 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b8c00f06 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b917a081 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b9e2f3bd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{5c2aafe7 → bd70db0e} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bdbda648 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be1e5469 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{333648cc → c9462295} +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ca6e5efa +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caf52beb +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cb268960 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cca16b15 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cfc1c937 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d10e6e05 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d172fc04 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d4e94e50 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d59f8d2c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/da964053 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0bb712a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e3e6ca34 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e50f7385 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f1a1d282 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f2514c3c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f66207cf +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f8d129ce +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fb1e9558 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ff7e3608 +0 -0
- package/package.json +4 -4
- package/src/assetResolver.ts +3 -3
- package/src/codegen/generators/NativeModuleCodeGenerator.ts +3 -3
- package/src/commands/bundle-harmony.ts +26 -34
- package/src/init/templates/harmony/build-profile.json5 +1 -0
- package/tsconfig.json +5 -0
- package/harmony/rnoh-hvigor-plugin-0.77.59.tgz +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0271b9dd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/07ba0208 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/082dd09d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0a9e1b0b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0c3d528a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1014d3ff +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12621366 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/19262852 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/203fac53 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/237b660a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2528002d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2587d041 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2893bd11 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2af6ff9d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2bf31f33 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/386f6df0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b8c270e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3bcc34ba +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/444808bd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/44a775e2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/46da3ccd +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/51f80e35 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5203a2ca +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/52795646 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/577f8208 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5c69bcfe +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62695b92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62698102 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6411ab00 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6569ba92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/65e5133c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/66029655 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/69e85d0d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6afcb99e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6de07367 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/72498307 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7babd1de +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7fe56d21 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/810cbd72 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/812386d2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8448897d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84ab0a41 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/853825e2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/862ad93a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/86b14da6 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/87f0fe62 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88ee8f74 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c5237c9 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c725800 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8f4085b9 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/931f0b2e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/940c8f92 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/968191a3 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/970780c0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/99a3b0b0 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9c0ffa6b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9d9b42c2 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a04266ef +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a18f78c5 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a642fb0e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a97edf40 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/aa672a20 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ae25c61a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b2bebae6 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ba492422 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bd3e6c21 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be9e564e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bfd71502 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c3993e7e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c52ffd54 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c7079ad4 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caee5d30 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d0377c40 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d262bc85 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d287cb5c +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d716a608 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d751012b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0873711 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e1fcf77b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e8548d8a +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eaedd71d +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eca0019e +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f7189953 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f75cb201 +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f888164b +0 -0
- package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fdb9eb5a +0 -0
|
@@ -41,9 +41,9 @@ class NativeModuleCodeGenerator {
|
|
|
41
41
|
name,
|
|
42
42
|
members: enumSpec.members.map((member) => ({
|
|
43
43
|
name: member.name,
|
|
44
|
-
value:
|
|
45
|
-
? (0, core_1.wrapWithQuotes)(member.value)
|
|
46
|
-
: member.value.toString(),
|
|
44
|
+
value: member.value.type === 'StringLiteralTypeAnnotation'
|
|
45
|
+
? (0, core_1.wrapWithQuotes)(member.value.value)
|
|
46
|
+
: member.value.value.toString(),
|
|
47
47
|
})),
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -8,16 +8,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
25
|
+
var _a;
|
|
14
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
27
|
exports.commandBundleHarmony = void 0;
|
|
16
28
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
17
29
|
const os_1 = __importDefault(require("os"));
|
|
18
30
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
19
|
-
const metro_1 =
|
|
20
|
-
const Server_1 = __importDefault(require("metro/src/Server"));
|
|
31
|
+
const metro_1 = require("metro");
|
|
21
32
|
const path_1 = __importDefault(require("path"));
|
|
22
33
|
const assetResolver_1 = require("../assetResolver");
|
|
23
34
|
const child_process_1 = require("child_process");
|
|
@@ -36,7 +47,8 @@ const HERMESC_BIN_PATH = {
|
|
|
36
47
|
linux: path_1.default.normalize('linux64-bin/hermesc'),
|
|
37
48
|
win32: path_1.default.normalize('win64-bin/hermesc.exe'),
|
|
38
49
|
};
|
|
39
|
-
const
|
|
50
|
+
const isHermesV1Enabled = ((_a = process.env.HERMES_V1_ENABLED) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true';
|
|
51
|
+
const HERMESC_PATH_PREFIX = path_1.default.normalize(isHermesV1Enabled ? './node_modules/hermes-compiler/hermesc' : './node_modules/react-native/sdks/hermesc/');
|
|
40
52
|
const HARMONY_RESOURCE_PATH = path_1.default.normalize('./harmony/entry/src/main/resources/rawfile');
|
|
41
53
|
const ASSETS_DEFAULT_DEST_PATH = path_1.default.normalize('./harmony/entry/src/main/resources/rawfile/assets');
|
|
42
54
|
exports.commandBundleHarmony = {
|
|
@@ -122,6 +134,7 @@ exports.commandBundleHarmony = {
|
|
|
122
134
|
const assetsDest = args.assetsDest;
|
|
123
135
|
yield fs_extra_1.default.ensureDir(assetsDest);
|
|
124
136
|
const buildOptions = {
|
|
137
|
+
assets: true,
|
|
125
138
|
entry: args.entryFile,
|
|
126
139
|
platform: 'harmony',
|
|
127
140
|
minify: args.minify !== undefined ? args.minify : !args.dev,
|
|
@@ -133,8 +146,7 @@ exports.commandBundleHarmony = {
|
|
|
133
146
|
config: args.config,
|
|
134
147
|
resetCache: args.resetCache,
|
|
135
148
|
});
|
|
136
|
-
const
|
|
137
|
-
const assets = yield retrieveAssetsData(metroConfig, buildOptions);
|
|
149
|
+
const _b = yield createBundle(metroConfig, buildOptions), { assets } = _b, bundle = __rest(_b, ["assets"]);
|
|
138
150
|
if (shouldGenerateHbcBundle) {
|
|
139
151
|
debugLog('Starting Hermes bytecode compilation...');
|
|
140
152
|
yield saveHbcBundle(logger, bundle.code, bundleOutput, args.hermescDir, args.hermescOptions);
|
|
@@ -144,8 +156,10 @@ exports.commandBundleHarmony = {
|
|
|
144
156
|
yield saveJSBundle(logger, bundle, bundleOutput);
|
|
145
157
|
}
|
|
146
158
|
maybeSaveSourceMap(logger, bundle, args.sourcemapOutput);
|
|
147
|
-
|
|
148
|
-
|
|
159
|
+
if (assets) {
|
|
160
|
+
yield (0, assetResolver_1.copyAssets)(logger, assets, assetsDest);
|
|
161
|
+
debugLog('Assets copy completed, cleaning up...');
|
|
162
|
+
}
|
|
149
163
|
debugLog('Bundle process finished, exiting');
|
|
150
164
|
}
|
|
151
165
|
catch (err) {
|
|
@@ -164,14 +178,15 @@ function loadMetroConfig(options) {
|
|
|
164
178
|
if (!options.config) {
|
|
165
179
|
delete options.config;
|
|
166
180
|
}
|
|
167
|
-
return yield metro_1.
|
|
181
|
+
return yield (0, metro_1.loadConfig)(options);
|
|
168
182
|
});
|
|
169
183
|
}
|
|
170
184
|
function createBundle(metroConfig, buildOptions) {
|
|
171
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
186
|
// casting needed as Metro.runBuild returns Promise<{code: string, map: string}>
|
|
173
187
|
// despite being typed as Promise<void>
|
|
174
|
-
|
|
188
|
+
// TODO: adjust if https://github.com/facebook/metro/pull/1621 is merged
|
|
189
|
+
return yield (0, metro_1.runBuild)(metroConfig, buildOptions);
|
|
175
190
|
});
|
|
176
191
|
}
|
|
177
192
|
function saveHbcBundle(logger, bundleCode, bundleOutput, hermescPath, hermescOptions) {
|
|
@@ -219,14 +234,3 @@ function maybeSaveSourceMap(logger, bundle, sourceMapOutput) {
|
|
|
219
234
|
logger.info((s) => `Created ${sourceMapOutput}`);
|
|
220
235
|
}
|
|
221
236
|
}
|
|
222
|
-
function retrieveAssetsData(metroConfig, buildOptions) {
|
|
223
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
-
const metroServer = new Server_1.default(metroConfig);
|
|
225
|
-
try {
|
|
226
|
-
return yield metroServer.getAssets(Object.assign(Object.assign(Object.assign({}, Server_1.default.DEFAULT_BUNDLE_OPTIONS), buildOptions), { entryFile: buildOptions.entry, bundleType: 'todo' }));
|
|
227
|
-
}
|
|
228
|
-
finally {
|
|
229
|
-
metroServer.end();
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-oh/react-native-harmony-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"metro": "^0.
|
|
28
|
+
"metro": "^0.83.1"
|
|
29
29
|
},
|
|
30
30
|
"main": "dist/index.js",
|
|
31
31
|
"devDependencies": {
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"directory-tree": "^3.5.1",
|
|
41
41
|
"execa": "npm:@esm2cjs/execa@^6.1.1-cjs.1",
|
|
42
42
|
"jest": "^29.5.0",
|
|
43
|
-
"react-native": "
|
|
43
|
+
"react-native": "0.82.1",
|
|
44
44
|
"ts-jest": "^29.1.0",
|
|
45
45
|
"typescript": "^5.0.4"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@react-native-community/cli-tools": "^13.6.5",
|
|
49
|
-
"@react-native/codegen": "0.
|
|
49
|
+
"@react-native/codegen": "0.82.1",
|
|
50
50
|
"@tsconfig/recommended": "^1.0.2",
|
|
51
51
|
"case": "^1.6.3",
|
|
52
52
|
"chalk": "^4",
|
package/src/assetResolver.ts
CHANGED
|
@@ -9,6 +9,9 @@ import pathUtils from 'path';
|
|
|
9
9
|
import type { AssetData } from 'metro';
|
|
10
10
|
import { Logger } from './io';
|
|
11
11
|
|
|
12
|
+
type Path = string;
|
|
13
|
+
type CopiedFiles = Record<Path, Path>;
|
|
14
|
+
|
|
12
15
|
const ENABLE_DEBUG_LOG = process.env.RNOH_BUNDLE_DEBUG === 'true';
|
|
13
16
|
|
|
14
17
|
function debugLog(message: string) {
|
|
@@ -18,9 +21,6 @@ function debugLog(message: string) {
|
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
type Path = string;
|
|
22
|
-
type CopiedFiles = Record<Path, Path>;
|
|
23
|
-
|
|
24
24
|
const ALLOWED_SCALES: number[] = [1, 2, 3, 4];
|
|
25
25
|
|
|
26
26
|
function filterAssetScales(
|
|
@@ -70,9 +70,9 @@ export class NativeModuleCodeGenerator implements SpecCodeGenerator {
|
|
|
70
70
|
members: enumSpec.members.map((member) => ({
|
|
71
71
|
name: member.name,
|
|
72
72
|
value:
|
|
73
|
-
|
|
74
|
-
? wrapWithQuotes(member.value)
|
|
75
|
-
: member.value.toString(),
|
|
73
|
+
member.value.type === 'StringLiteralTypeAnnotation'
|
|
74
|
+
? wrapWithQuotes(member.value.value)
|
|
75
|
+
: member.value.value.toString(),
|
|
76
76
|
})),
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -2,9 +2,7 @@ import { Command } from './types';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import os from 'os';
|
|
4
4
|
import fse from 'fs-extra';
|
|
5
|
-
import
|
|
6
|
-
import { RunBuildOptions as BuildOptions } from 'metro';
|
|
7
|
-
import MetroServer from 'metro/src/Server';
|
|
5
|
+
import {runBuild, loadConfig, AssetData, RunBuildOptions as BuildOptions} from 'metro';
|
|
8
6
|
import pathUtils from 'path';
|
|
9
7
|
import { copyAssets } from '../assetResolver';
|
|
10
8
|
import { execSync } from 'child_process';
|
|
@@ -12,6 +10,8 @@ import { Logger } from '../io';
|
|
|
12
10
|
import { DescriptiveError } from '../core';
|
|
13
11
|
import { randomUUID } from 'node:crypto';
|
|
14
12
|
|
|
13
|
+
type MetroConfig = Awaited<ReturnType<typeof loadConfig>>;
|
|
14
|
+
|
|
15
15
|
const ENABLE_DEBUG_LOG = process.env.RNOH_BUNDLE_DEBUG === 'true';
|
|
16
16
|
|
|
17
17
|
function debugLog(message: string) {
|
|
@@ -21,15 +21,14 @@ function debugLog(message: string) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type MetroConfig = Awaited<ReturnType<typeof Metro.loadConfig>>;
|
|
25
|
-
|
|
26
24
|
const HERMESC_BIN_PATH = {
|
|
27
25
|
darwin: pathUtils.normalize('osx-bin/hermesc'),
|
|
28
26
|
linux: pathUtils.normalize('linux64-bin/hermesc'),
|
|
29
27
|
win32: pathUtils.normalize('win64-bin/hermesc.exe'),
|
|
30
28
|
};
|
|
29
|
+
const isHermesV1Enabled = process.env.HERMES_V1_ENABLED?.toLowerCase() === 'true';
|
|
31
30
|
const HERMESC_PATH_PREFIX = pathUtils.normalize(
|
|
32
|
-
'./node_modules/react-native/sdks/hermesc/'
|
|
31
|
+
isHermesV1Enabled ? './node_modules/hermes-compiler/hermesc' : './node_modules/react-native/sdks/hermesc/'
|
|
33
32
|
);
|
|
34
33
|
const HARMONY_RESOURCE_PATH = pathUtils.normalize(
|
|
35
34
|
'./harmony/entry/src/main/resources/rawfile'
|
|
@@ -38,8 +37,15 @@ const ASSETS_DEFAULT_DEST_PATH = pathUtils.normalize(
|
|
|
38
37
|
'./harmony/entry/src/main/resources/rawfile/assets'
|
|
39
38
|
);
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
type Bundle = {
|
|
40
|
+
// TODO: adjust if https://github.com/facebook/metro/pull/1621 is merged
|
|
41
|
+
type Bundle = {
|
|
42
|
+
code: string;
|
|
43
|
+
map: string;
|
|
44
|
+
}
|
|
45
|
+
type RunBuildResult = Bundle & {
|
|
46
|
+
assets?: ReadonlyArray<AssetData>;
|
|
47
|
+
}
|
|
48
|
+
type RunBuildOptions = BuildOptions & {assets?: boolean};
|
|
43
49
|
type Path = string;
|
|
44
50
|
type OSType = 'darwin' | 'linux' | 'win32';
|
|
45
51
|
|
|
@@ -136,7 +142,8 @@ export const commandBundleHarmony: Command = {
|
|
|
136
142
|
await fse.ensureDir(pathUtils.dirname(bundleOutput));
|
|
137
143
|
const assetsDest: Path = args.assetsDest;
|
|
138
144
|
await fse.ensureDir(assetsDest);
|
|
139
|
-
const buildOptions:
|
|
145
|
+
const buildOptions: RunBuildOptions = {
|
|
146
|
+
assets: true,
|
|
140
147
|
entry: args.entryFile,
|
|
141
148
|
platform: 'harmony',
|
|
142
149
|
minify: args.minify !== undefined ? args.minify : !args.dev,
|
|
@@ -149,8 +156,7 @@ export const commandBundleHarmony: Command = {
|
|
|
149
156
|
resetCache: args.resetCache,
|
|
150
157
|
});
|
|
151
158
|
|
|
152
|
-
const bundle
|
|
153
|
-
const assets = await retrieveAssetsData(metroConfig, buildOptions);
|
|
159
|
+
const {assets, ...bundle}= await createBundle(metroConfig, buildOptions);
|
|
154
160
|
|
|
155
161
|
if (shouldGenerateHbcBundle) {
|
|
156
162
|
debugLog('Starting Hermes bytecode compilation...');
|
|
@@ -166,8 +172,10 @@ export const commandBundleHarmony: Command = {
|
|
|
166
172
|
await saveJSBundle(logger, bundle, bundleOutput);
|
|
167
173
|
}
|
|
168
174
|
maybeSaveSourceMap(logger, bundle, args.sourcemapOutput);
|
|
169
|
-
|
|
170
|
-
|
|
175
|
+
if(assets){
|
|
176
|
+
await copyAssets(logger, assets, assetsDest);
|
|
177
|
+
debugLog('Assets copy completed, cleaning up...');
|
|
178
|
+
}
|
|
171
179
|
debugLog('Bundle process finished, exiting');
|
|
172
180
|
} catch (err) {
|
|
173
181
|
if (err instanceof DescriptiveError) {
|
|
@@ -187,16 +195,17 @@ async function loadMetroConfig(options: {
|
|
|
187
195
|
if (!options.config) {
|
|
188
196
|
delete options.config;
|
|
189
197
|
}
|
|
190
|
-
return await
|
|
198
|
+
return await loadConfig(options);
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
async function createBundle(
|
|
194
202
|
metroConfig: MetroConfig,
|
|
195
|
-
buildOptions:
|
|
196
|
-
)
|
|
203
|
+
buildOptions: RunBuildOptions
|
|
204
|
+
) {
|
|
197
205
|
// casting needed as Metro.runBuild returns Promise<{code: string, map: string}>
|
|
198
206
|
// despite being typed as Promise<void>
|
|
199
|
-
|
|
207
|
+
// TODO: adjust if https://github.com/facebook/metro/pull/1621 is merged
|
|
208
|
+
return await runBuild(metroConfig, buildOptions) as unknown as RunBuildResult;
|
|
200
209
|
}
|
|
201
210
|
|
|
202
211
|
async function saveHbcBundle(
|
|
@@ -267,20 +276,3 @@ function maybeSaveSourceMap(
|
|
|
267
276
|
logger.info((s) => `Created ${sourceMapOutput}`);
|
|
268
277
|
}
|
|
269
278
|
}
|
|
270
|
-
|
|
271
|
-
async function retrieveAssetsData(
|
|
272
|
-
metroConfig: MetroConfig,
|
|
273
|
-
buildOptions: BuildOptions
|
|
274
|
-
): Promise<readonly AssetData[]> {
|
|
275
|
-
const metroServer = new MetroServer(metroConfig);
|
|
276
|
-
try {
|
|
277
|
-
return await metroServer.getAssets({
|
|
278
|
-
...MetroServer.DEFAULT_BUNDLE_OPTIONS,
|
|
279
|
-
...buildOptions,
|
|
280
|
-
entryFile: buildOptions.entry,
|
|
281
|
-
bundleType: 'todo',
|
|
282
|
-
});
|
|
283
|
-
} finally {
|
|
284
|
-
metroServer.end();
|
|
285
|
-
}
|
|
286
|
-
}
|
package/tsconfig.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|