@ohos-ports/react-native-mmkv-storage 13.0.1-beta.0 → 13.1.0-beta.0
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/index.js +0 -4
- package/dist/src/mmkv/IDStore.js +1 -1
- package/dist/src/mmkvloader.js +0 -8
- package/dist/src/module/node-bridge.js +4 -2
- package/package.json +7 -25
- package/react-native.config.js +8 -5
- package/src/mmkvloader.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -96,10 +96,6 @@ const MMKVStorage = {
|
|
|
96
96
|
_bridgeModule: module_1.mmkvBridgeModule
|
|
97
97
|
};
|
|
98
98
|
exports.default = MMKVStorage;
|
|
99
|
-
// Round 2 (HarmonyOS migration): also expose the native module handles as
|
|
100
|
-
// named exports (additive; previously only present on the default export).
|
|
101
|
-
exports._jsiModule = module_1.default;
|
|
102
|
-
exports._bridgeModule = module_1.mmkvBridgeModule;
|
|
103
99
|
const { getAllMMKVInstanceIDs, STORE_ID: IDSTORE_ID } = IDStore_1.default;
|
|
104
100
|
exports.getAllMMKVInstanceIDs = getAllMMKVInstanceIDs;
|
|
105
101
|
exports.IDSTORE_ID = IDSTORE_ID;
|
package/dist/src/mmkv/IDStore.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const module_1 = __importDefault(require("../module"));
|
|
7
6
|
/**
|
|
8
7
|
* Detect the host platform. RN-first: prefer react-native's Platform.OS when
|
|
9
8
|
* the RN host runtime is available. Under plain Node.js (HarmonyOS migration)
|
|
@@ -21,6 +20,7 @@ catch (e) {
|
|
|
21
20
|
platformOS = process.platform;
|
|
22
21
|
}
|
|
23
22
|
}
|
|
23
|
+
const module_1 = __importDefault(require("../module"));
|
|
24
24
|
const STORE_ID = platformOS === 'ios' ? 'mmkvIdStore' : 'mmkvIDStore';
|
|
25
25
|
/**
|
|
26
26
|
* Store instance properties that we will use later to
|
package/dist/src/mmkvloader.js
CHANGED
|
@@ -43,14 +43,6 @@ class MMKVLoader {
|
|
|
43
43
|
this.options.instanceID = id;
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Alias of withInstanceID(id) (round 2, HarmonyOS migration): chainable
|
|
48
|
-
* builder that sets the storage instance ID. Kept for API compatibility
|
|
49
|
-
* with consumers that use the setInstanceID naming.
|
|
50
|
-
*/
|
|
51
|
-
setInstanceID(id) {
|
|
52
|
-
return this.withInstanceID(id);
|
|
53
|
-
}
|
|
54
46
|
/**
|
|
55
47
|
* Persist default values in hooks.
|
|
56
48
|
* Normally hooks do not persist default values in storage,
|
|
@@ -48,12 +48,14 @@ function loadAddon() {
|
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
50
50
|
return require('@ohos-ports/mmkv-node-native');
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
52
53
|
/* ohos-ports companion not installed; try the plain companion name */
|
|
53
54
|
}
|
|
54
55
|
try {
|
|
55
56
|
return require('mmkv-node-native');
|
|
56
|
-
}
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
57
59
|
/* companion module not installed; try package-local build */
|
|
58
60
|
}
|
|
59
61
|
const localBuild = path.join(__dirname, '..', '..', '..', 'build', 'Release', 'mmkv_node.node');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohos-ports/react-native-mmkv-storage",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0-beta.0",
|
|
4
4
|
"description": "[OpenHarmony port] This library aims to provide a fast & reliable solution for you data storage needs in react-native apps. It uses [MMKV](https://github.com/Tencent/MMKV) by Tencent under the hood on Android and iOS both that is used by their WeChat app(more than 1 Billion users). Unlike other storage solutions for React Native, this library lets you store any kind of data type, in any number of database instances, with or without encryption in a very fast and efficient way.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,30 +43,12 @@
|
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "https://github.com/ohos-ports/ohos-ports.git",
|
|
46
|
-
"directory": "ports/react-native-mmkv-storage/13.0
|
|
46
|
+
"directory": "ports/react-native-mmkv-storage/13.1.0"
|
|
47
47
|
},
|
|
48
48
|
"author": "Ammar Ahmed for @ammarahm-ed",
|
|
49
49
|
"license": "MIT",
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"react-native": "
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.26.0",
|
|
55
|
-
"@babel/runtime": "^7.26.0",
|
|
56
|
-
"@types/react": "^19.2.0",
|
|
57
|
-
"@react-native-community/cli": "20.2.0",
|
|
58
|
-
"@react-native/babel-preset": "0.87.0-rc.4",
|
|
59
|
-
"@react-native/eslint-config": "0.87.0-rc.4",
|
|
60
|
-
"@react-native/metro-config": "0.87.0-rc.4",
|
|
61
|
-
"@react-native/typescript-config": "0.87.0-rc.4",
|
|
62
|
-
"metro": "^0.87.0",
|
|
63
|
-
"jest": "^29.2.1",
|
|
64
|
-
"react": "19.2.3",
|
|
65
|
-
"react-native": "0.87.0-rc.4",
|
|
66
|
-
"typescript": "^5.1.6",
|
|
67
|
-
"eslint": "^8.57.1",
|
|
68
|
-
"@react-native-community/eslint-config": "^3.2.0",
|
|
69
|
-
"vitepress": "^1.6.3"
|
|
51
|
+
"@ohos-ports/react-native": "^0.87.1-beta.3"
|
|
70
52
|
},
|
|
71
53
|
"codegenConfig": {
|
|
72
54
|
"name": "MMKVStorageSpec",
|
|
@@ -79,6 +61,9 @@
|
|
|
79
61
|
"bugs": {
|
|
80
62
|
"url": "https://github.com/ohos-ports/ohos-ports/issues"
|
|
81
63
|
},
|
|
64
|
+
"optionalDependencies": {
|
|
65
|
+
"@ohos-ports/mmkv-node-native": "^13.1.0-beta.0"
|
|
66
|
+
},
|
|
82
67
|
"files": [
|
|
83
68
|
"dist",
|
|
84
69
|
"src",
|
|
@@ -92,8 +77,5 @@
|
|
|
92
77
|
"LICENSE",
|
|
93
78
|
"README.md",
|
|
94
79
|
"!android/build"
|
|
95
|
-
]
|
|
96
|
-
"optionalDependencies": {
|
|
97
|
-
"@ohos-ports/mmkv-node-native": "^13.0.1-beta.0"
|
|
98
|
-
}
|
|
80
|
+
]
|
|
99
81
|
}
|
package/react-native.config.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
|
3
|
-
*/
|
|
4
1
|
module.exports = {
|
|
5
2
|
dependency: {
|
|
6
3
|
platforms: {
|
|
7
4
|
android: {},
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
desktop: {
|
|
6
|
+
cmake: "desktop",
|
|
7
|
+
crate: "rn-gpui-mmkv-secure",
|
|
8
|
+
path: "desktop/secure",
|
|
9
|
+
cppProvider: "create_mmkv_storage_module"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
10
13
|
};
|
package/src/mmkvloader.ts
CHANGED
|
@@ -45,15 +45,6 @@ export default class MMKVLoader {
|
|
|
45
45
|
return this;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* Alias of withInstanceID(id) (round 2, HarmonyOS migration): chainable
|
|
50
|
-
* builder that sets the storage instance ID. Kept for API compatibility
|
|
51
|
-
* with consumers that use the setInstanceID naming.
|
|
52
|
-
*/
|
|
53
|
-
setInstanceID(id: string) {
|
|
54
|
-
return this.withInstanceID(id);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
48
|
/**
|
|
58
49
|
* Persist default values in hooks.
|
|
59
50
|
* Normally hooks do not persist default values in storage,
|