@rozenite/storage-plugin 2.2.0 → 2.3.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/CHANGELOG.md +16 -0
- package/dist/devtools/assets/panel-CcThj-0Z.js +32 -0
- package/dist/devtools/assets/panel-DTYbHqnH.css +1 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/react-native/cjs/package.json +3 -0
- package/dist/react-native/cjs/react-native.js +38 -0
- package/dist/react-native/cjs/src/react-native/adapters/async-storage.js +60 -0
- package/dist/react-native/cjs/src/react-native/adapters/index.js +10 -0
- package/dist/react-native/cjs/src/react-native/adapters/mmkv.js +143 -0
- package/dist/react-native/cjs/src/react-native/adapters/secure-storage.js +51 -0
- package/dist/react-native/cjs/src/react-native/entry-preview-pagination.js +198 -0
- package/dist/react-native/cjs/src/react-native/export-snapshot.js +70 -0
- package/dist/react-native/cjs/src/react-native/full-entry-request.js +72 -0
- package/dist/react-native/cjs/src/react-native/import.js +185 -0
- package/dist/react-native/cjs/src/react-native/storage-discovery.js +69 -0
- package/dist/react-native/cjs/src/react-native/storage-view.js +128 -0
- package/dist/react-native/cjs/src/react-native/useRozeniteStoragePlugin.js +145 -0
- package/dist/react-native/cjs/src/react-native/useStorageAgentTools.js +228 -0
- package/dist/react-native/cjs/src/shared/agent-tools.js +119 -0
- package/dist/react-native/cjs/src/shared/entry-preview.js +48 -0
- package/dist/react-native/cjs/src/shared/messaging.js +2 -0
- package/dist/react-native/cjs/src/shared/snapshot.js +185 -0
- package/dist/react-native/cjs/src/shared/types.js +13 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/react-native.d.ts +7 -0
- package/dist/react-native/react-native.js +40 -0
- package/dist/react-native/src/react-native/adapters/async-storage.d.ts +34 -0
- package/dist/react-native/src/react-native/adapters/async-storage.js +56 -0
- package/dist/react-native/src/react-native/adapters/index.d.ts +6 -0
- package/dist/react-native/src/react-native/adapters/index.js +3 -0
- package/dist/react-native/src/react-native/adapters/mmkv.d.ts +13 -0
- package/dist/react-native/src/react-native/adapters/mmkv.js +139 -0
- package/dist/react-native/src/react-native/adapters/secure-storage.d.ts +18 -0
- package/dist/react-native/src/react-native/adapters/secure-storage.js +47 -0
- package/dist/react-native/src/react-native/entry-preview-pagination.d.ts +7 -0
- package/dist/react-native/src/react-native/entry-preview-pagination.js +194 -0
- package/dist/react-native/src/react-native/export-snapshot.d.ts +5 -0
- package/dist/react-native/src/react-native/export-snapshot.js +66 -0
- package/dist/react-native/src/react-native/full-entry-request.d.ts +5 -0
- package/dist/react-native/src/react-native/full-entry-request.js +68 -0
- package/dist/react-native/src/react-native/import.d.ts +7 -0
- package/dist/react-native/src/react-native/import.js +180 -0
- package/dist/react-native/src/react-native/storage-discovery.d.ts +5 -0
- package/dist/react-native/src/react-native/storage-discovery.js +65 -0
- package/dist/react-native/src/react-native/storage-view.d.ts +19 -0
- package/dist/react-native/src/react-native/storage-view.js +123 -0
- package/dist/react-native/src/react-native/useRozeniteStoragePlugin.d.ts +6 -0
- package/dist/react-native/src/react-native/useRozeniteStoragePlugin.js +141 -0
- package/dist/react-native/src/react-native/useStorageAgentTools.d.ts +37 -0
- package/dist/react-native/src/react-native/useStorageAgentTools.js +223 -0
- package/dist/react-native/src/shared/agent-tools.d.ts +76 -0
- package/dist/react-native/src/shared/agent-tools.js +116 -0
- package/dist/react-native/src/shared/entry-preview.d.ts +4 -0
- package/dist/react-native/src/shared/entry-preview.js +44 -0
- package/dist/react-native/src/shared/messaging.d.ts +134 -0
- package/dist/react-native/src/shared/messaging.js +1 -0
- package/dist/react-native/src/shared/snapshot.d.ts +53 -0
- package/dist/react-native/src/shared/snapshot.js +179 -0
- package/dist/react-native/src/shared/types.d.ts +78 -0
- package/dist/react-native/src/shared/types.js +8 -0
- package/dist/rozenite.json +1 -1
- package/dist/sdk/package.json +3 -0
- package/dist/sdk/sdk.d.ts +44 -0
- package/dist/sdk/sdk.js +9 -0
- package/dist/sdk/src/shared/agent-tools.d.ts +76 -0
- package/dist/sdk/src/shared/agent-tools.js +119 -0
- package/dist/sdk/src/shared/types.d.ts +78 -0
- package/dist/sdk/src/shared/types.js +13 -0
- package/package.json +16 -16
- package/react-native.ts +8 -1
- package/rozenite.config.ts +1 -0
- package/src/__tests__/release-bundle.test.ts +32 -0
- package/dist/devtools/assets/panel-D5z1BY8U.js +0 -32
- package/dist/devtools/assets/panel-DVlWRg6d.css +0 -1
- package/dist/react-native/chunks/async-storage.require.cjs +0 -1
- package/dist/react-native/chunks/async-storage.require.js +0 -53
- package/dist/react-native/chunks/index.require.cjs +0 -1
- package/dist/react-native/chunks/index.require.js +0 -103
- package/dist/react-native/chunks/secure-storage.require.cjs +0 -1
- package/dist/react-native/chunks/secure-storage.require.js +0 -46
- package/dist/react-native/chunks/types.cjs +0 -1
- package/dist/react-native/chunks/types.js +0 -11
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.cjs +0 -1
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.js +0 -1037
- package/dist/react-native/index.cjs +0 -1
- package/dist/react-native/index.d.ts +0 -365
- package/dist/react-native/index.js +0 -28
- package/dist/sdk/index.cjs +0 -1
- package/dist/sdk/index.d.ts +0 -206
- package/dist/sdk/index.js +0 -122
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozenite/storage-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Generic Storage Inspector for Rozenite.",
|
|
5
5
|
"homepage": "https://github.com/callstackincubator/rozenite#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,20 +12,19 @@
|
|
|
12
12
|
"url": "https://github.com/callstackincubator/rozenite.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
|
-
"main": "./dist/react-native/
|
|
16
|
-
"module": "./dist/react-native/
|
|
17
|
-
"types": "./dist/react-native/
|
|
15
|
+
"main": "./dist/react-native/cjs/react-native.js",
|
|
16
|
+
"module": "./dist/react-native/react-native.js",
|
|
17
|
+
"types": "./dist/react-native/react-native.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./dist/react-native/
|
|
21
|
-
"import": "./dist/react-native/
|
|
22
|
-
"require": "./dist/react-native/
|
|
20
|
+
"types": "./dist/react-native/react-native.d.ts",
|
|
21
|
+
"import": "./dist/react-native/react-native.js",
|
|
22
|
+
"require": "./dist/react-native/cjs/react-native.js"
|
|
23
23
|
},
|
|
24
24
|
"./sdk": {
|
|
25
25
|
"development": "./sdk.ts",
|
|
26
|
-
"types": "./dist/sdk/
|
|
27
|
-
"
|
|
28
|
-
"require": "./dist/sdk/index.cjs"
|
|
26
|
+
"types": "./dist/sdk/sdk.d.ts",
|
|
27
|
+
"default": "./dist/sdk/sdk.js"
|
|
29
28
|
},
|
|
30
29
|
"./package.json": "./package.json"
|
|
31
30
|
},
|
|
@@ -33,10 +32,10 @@
|
|
|
33
32
|
"access": "public"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
|
-
"@rozenite/agent-
|
|
37
|
-
"@rozenite/
|
|
38
|
-
"@rozenite/
|
|
39
|
-
"@rozenite/
|
|
35
|
+
"@rozenite/agent-shared": "2.3.0",
|
|
36
|
+
"@rozenite/plugin-bridge": "2.3.0",
|
|
37
|
+
"@rozenite/ui": "2.3.0",
|
|
38
|
+
"@rozenite/agent-bridge": "2.3.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@codemirror/commands": "^6.10.3",
|
|
@@ -57,8 +56,9 @@
|
|
|
57
56
|
"react-virtuoso": "^4.14.1",
|
|
58
57
|
"typescript": "~5.9.3",
|
|
59
58
|
"vite": "^7.3.1",
|
|
60
|
-
"@rozenite/
|
|
61
|
-
"rozenite": "2.
|
|
59
|
+
"@rozenite/test-utils": "2.3.0",
|
|
60
|
+
"@rozenite/vite-plugin": "2.3.0",
|
|
61
|
+
"rozenite": "2.3.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@react-native-async-storage/async-storage": "*",
|
package/react-native.ts
CHANGED
|
@@ -26,8 +26,15 @@ export let createMMKVStorageAdapter: typeof import('./src/react-native/adapters'
|
|
|
26
26
|
export let useRozeniteStoragePlugin: typeof import('./src/react-native/useRozeniteStoragePlugin').useRozeniteStoragePlugin;
|
|
27
27
|
|
|
28
28
|
const isWeb = typeof window !== 'undefined' && window.navigator.product !== 'ReactNative';
|
|
29
|
+
// Neither Lynx runtime has a `window`, so `typeof window` alone reported
|
|
30
|
+
// every Lynx app as a server and installed the no-op stub below. `lynx` is
|
|
31
|
+
// a free binding in module scope, not a property of `globalThis`. Kept
|
|
32
|
+
// inline rather than imported so this stays a foldable expression and the
|
|
33
|
+
// `require`s below can still be dropped from production bundles.
|
|
34
|
+
declare const lynx: unknown;
|
|
35
|
+
|
|
29
36
|
const isDev = process.env.NODE_ENV !== 'production';
|
|
30
|
-
const isServer = typeof window === 'undefined';
|
|
37
|
+
const isServer = typeof window === 'undefined' && typeof lynx === 'undefined';
|
|
31
38
|
|
|
32
39
|
const createNoopStorageAdapter = (
|
|
33
40
|
options: { adapterId?: string; adapterName?: string } | undefined,
|
package/rozenite.config.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { bundleForRelease, RELEASE_BUNDLE_TIMEOUT } from '@rozenite/test-utils';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
|
|
6
|
+
// An app importing this plugin ships its React Native code -- that much is
|
|
7
|
+
// the app's own choice. What must never follow it into the bundle is the
|
|
8
|
+
// panel: the DevTools UI, its React DOM tree and `@rozenite/ui`.
|
|
9
|
+
// See docs/agents/release-bundle-testing.md.
|
|
10
|
+
const packageRoot = path.resolve(fileURLToPath(import.meta.url), '../../..');
|
|
11
|
+
const reactNativeEntry = path.join(packageRoot, 'dist/react-native/cjs/react-native.js');
|
|
12
|
+
|
|
13
|
+
describe('@rozenite/storage-plugin in a release bundle', () => {
|
|
14
|
+
it(
|
|
15
|
+
'ships no panel code when an app imports it',
|
|
16
|
+
async () => {
|
|
17
|
+
const result = await bundleForRelease({
|
|
18
|
+
resolveFrom: packageRoot,
|
|
19
|
+
files: {
|
|
20
|
+
'index.js': `require(${JSON.stringify(reactNativeEntry)});\n`,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Keeps the check below honest: the entry really did get bundled.
|
|
25
|
+
expect(result.rozeniteModules).toContain(
|
|
26
|
+
'packages/storage-plugin/dist/react-native/cjs/react-native.js',
|
|
27
|
+
);
|
|
28
|
+
expect(result.panelModules).toEqual([]);
|
|
29
|
+
},
|
|
30
|
+
RELEASE_BUNDLE_TIMEOUT,
|
|
31
|
+
);
|
|
32
|
+
});
|