@react-native-oh/react-native-harmony-cli 0.72.143 → 0.72.144
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 +4 -4
- package/dist/autolinking/JSON5Writer.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @react-native-oh/react-native-harmony-cli
|
|
2
2
|
|
|
3
|
-
Please refer to: [RNOH repo](https://
|
|
3
|
+
Please refer to: [RNOH repo](https://gitcode.com/CPF-RN/ohos_react_native) for more detail.
|
|
4
4
|
|
|
5
5
|
# Documentation
|
|
6
6
|
|
|
7
|
-
- [中文](https://
|
|
8
|
-
- [English](https://
|
|
7
|
+
- [中文](https://gitcode.com/CPF-RN/ohos_react_native/tree/main/docs/zh-cn)
|
|
8
|
+
- [English](https://gitcode.com/CPF-RN/ohos_react_native/tree/main/docs/en)
|
|
9
9
|
|
|
10
10
|
# License
|
|
11
11
|
|
|
12
|
-
This library is licensed under The [MIT License (MIT)](https://
|
|
12
|
+
This library is licensed under The [MIT License (MIT)](https://gitcode.com/CPF-RN/ohos_react_native)
|
|
@@ -36,7 +36,11 @@ class JSON5Writer {
|
|
|
36
36
|
// Return the modified source with JSON5-style formatting
|
|
37
37
|
// Use double quotes for both keys and values, and trailing commas
|
|
38
38
|
// quoteKeys: true ensures keys with special characters (like @, /, -) are properly quoted
|
|
39
|
-
|
|
39
|
+
// NOTE: toSource() preserves the original trailing newlines, so strip them
|
|
40
|
+
// before appending exactly one — otherwise every rewrite appends an extra
|
|
41
|
+
// blank line and they accumulate across builds (idempotency fix).
|
|
42
|
+
const source = writer.toSource({ quote: 'double', quoteKeys: true, trailingComma: true });
|
|
43
|
+
return source.replace(/(\r?\n)+$/, '') + '\n';
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
46
|
* Updates dependencies with fallback to standard JSON5 stringify if preservation fails.
|