@symbiote-native/device 1.0.0 → 3.0.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/README.md +56 -55
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@ are plain re-exports of the same `core`.
|
|
|
17
17
|
npm install @symbiote-native/device
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
Scaffolding or extending a SymbioteNative app? `npx @symbiote-native/cli new --device` (or
|
|
21
|
+
`add --device` in an existing app) installs and wires this for you — see
|
|
22
|
+
[`@symbiote-native/cli`](../cli).
|
|
23
|
+
|
|
20
24
|
`expo-device` and `expo-modules-core` come along as regular dependencies, pinned to exact
|
|
21
25
|
versions — never install either yourself, and never add the `expo` meta-package to your project
|
|
22
26
|
(it bundles its own Metro/Babel pipeline, which conflicts with this project's own).
|
|
@@ -66,7 +70,6 @@ src/angular/ @symbiote-native/device/angular — export * from '../core'
|
|
|
66
70
|
```tsx
|
|
67
71
|
// React
|
|
68
72
|
import { useEffect, useState } from 'react';
|
|
69
|
-
import { Text, View } from '@symbiote-native/react';
|
|
70
73
|
import {
|
|
71
74
|
brand,
|
|
72
75
|
deviceName,
|
|
@@ -88,20 +91,20 @@ function DeviceScreen() {
|
|
|
88
91
|
}, []);
|
|
89
92
|
|
|
90
93
|
return (
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
<
|
|
94
|
+
<view>
|
|
95
|
+
<text>{isDevice ? 'Real device' : 'Simulator/emulator'}</text>
|
|
96
|
+
<text>{`${brand ?? 'unknown'} ${modelName ?? ''}`}</text>
|
|
97
|
+
<text>{`${osName ?? 'unknown OS'} ${osVersion ?? ''}`}</text>
|
|
98
|
+
<text>{deviceName ?? 'unnamed device'}</text>
|
|
99
|
+
<text>
|
|
97
100
|
{uptime === null ? 'checking uptime…' : `Uptime: ${uptime}ms`}
|
|
98
|
-
</
|
|
99
|
-
<
|
|
101
|
+
</text>
|
|
102
|
+
<text>
|
|
100
103
|
{maxMemory === null
|
|
101
104
|
? 'checking memory…'
|
|
102
105
|
: `Max memory: ${maxMemory} bytes`}
|
|
103
|
-
</
|
|
104
|
-
</
|
|
106
|
+
</text>
|
|
107
|
+
</view>
|
|
105
108
|
);
|
|
106
109
|
}
|
|
107
110
|
```
|
|
@@ -110,7 +113,6 @@ function DeviceScreen() {
|
|
|
110
113
|
<!-- Vue -->
|
|
111
114
|
<script setup lang="ts">
|
|
112
115
|
import { onMounted, ref } from 'vue';
|
|
113
|
-
import { Text, View } from '@symbiote-native/vue';
|
|
114
116
|
import {
|
|
115
117
|
brand,
|
|
116
118
|
deviceName,
|
|
@@ -132,25 +134,24 @@ onMounted(() => {
|
|
|
132
134
|
</script>
|
|
133
135
|
|
|
134
136
|
<template>
|
|
135
|
-
<
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
<
|
|
140
|
-
<
|
|
137
|
+
<view>
|
|
138
|
+
<text>{{ isDevice ? 'Real device' : 'Simulator/emulator' }}</text>
|
|
139
|
+
<text>{{ `${brand ?? 'unknown'} ${modelName ?? ''}` }}</text>
|
|
140
|
+
<text>{{ `${osName ?? 'unknown OS'} ${osVersion ?? ''}` }}</text>
|
|
141
|
+
<text>{{ deviceName ?? 'unnamed device' }}</text>
|
|
142
|
+
<text>{{
|
|
141
143
|
uptime === null ? 'checking uptime…' : `Uptime: ${uptime}ms`
|
|
142
|
-
}}</
|
|
143
|
-
<
|
|
144
|
+
}}</text>
|
|
145
|
+
<text>{{
|
|
144
146
|
maxMemory === null ? 'checking memory…' : `Max memory: ${maxMemory} bytes`
|
|
145
|
-
}}</
|
|
146
|
-
</
|
|
147
|
+
}}</text>
|
|
148
|
+
</view>
|
|
147
149
|
</template>
|
|
148
150
|
```
|
|
149
151
|
|
|
150
152
|
```svelte
|
|
151
153
|
<!-- Svelte -->
|
|
152
154
|
<script lang="ts">
|
|
153
|
-
import { Text, View } from '@symbiote-native/svelte';
|
|
154
155
|
import {
|
|
155
156
|
brand,
|
|
156
157
|
deviceName,
|
|
@@ -171,23 +172,22 @@ onMounted(() => {
|
|
|
171
172
|
});
|
|
172
173
|
</script>
|
|
173
174
|
|
|
174
|
-
<
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
<
|
|
180
|
-
<
|
|
175
|
+
<view>
|
|
176
|
+
<text>{isDevice ? 'Real device' : 'Simulator/emulator'}</text>
|
|
177
|
+
<text>{`${brand ?? 'unknown'} ${modelName ?? ''}`}</text>
|
|
178
|
+
<text>{`${osName ?? 'unknown OS'} ${osVersion ?? ''}`}</text>
|
|
179
|
+
<text>{deviceName ?? 'unnamed device'}</text>
|
|
180
|
+
<text>{uptime === null ? 'checking uptime…' : `Uptime: ${uptime}ms`}</text>
|
|
181
|
+
<text>
|
|
181
182
|
{maxMemory === null ? 'checking memory…' : `Max memory: ${maxMemory} bytes`}
|
|
182
|
-
</
|
|
183
|
-
</
|
|
183
|
+
</text>
|
|
184
|
+
</view>
|
|
184
185
|
```
|
|
185
186
|
|
|
186
187
|
```tsx
|
|
187
188
|
// Solid — a component body runs once, so the two async values need a signal; the eager
|
|
188
189
|
// constants (brand, modelName, ...) are plain reads with nothing to subscribe to.
|
|
189
190
|
import { createSignal, onMount } from 'solid-js';
|
|
190
|
-
import { Text, View } from '@symbiote-native/solid';
|
|
191
191
|
import {
|
|
192
192
|
brand,
|
|
193
193
|
deviceName,
|
|
@@ -209,20 +209,20 @@ function DeviceScreen() {
|
|
|
209
209
|
});
|
|
210
210
|
|
|
211
211
|
return (
|
|
212
|
-
<
|
|
213
|
-
<
|
|
214
|
-
<
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
<
|
|
212
|
+
<view>
|
|
213
|
+
<text>{isDevice ? 'Real device' : 'Simulator/emulator'}</text>
|
|
214
|
+
<text>{`${brand ?? 'unknown'} ${modelName ?? ''}`}</text>
|
|
215
|
+
<text>{`${osName ?? 'unknown OS'} ${osVersion ?? ''}`}</text>
|
|
216
|
+
<text>{deviceName ?? 'unnamed device'}</text>
|
|
217
|
+
<text>
|
|
218
218
|
{uptime() === null ? 'checking uptime…' : `Uptime: ${uptime()}ms`}
|
|
219
|
-
</
|
|
220
|
-
<
|
|
219
|
+
</text>
|
|
220
|
+
<text>
|
|
221
221
|
{maxMemory() === null
|
|
222
222
|
? 'checking memory…'
|
|
223
223
|
: `Max memory: ${maxMemory()} bytes`}
|
|
224
|
-
</
|
|
225
|
-
</
|
|
224
|
+
</text>
|
|
225
|
+
</view>
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
```
|
|
@@ -230,7 +230,7 @@ function DeviceScreen() {
|
|
|
230
230
|
```ts
|
|
231
231
|
// Angular
|
|
232
232
|
import { Component, signal } from '@angular/core';
|
|
233
|
-
import {
|
|
233
|
+
import { SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
|
|
234
234
|
import {
|
|
235
235
|
brand,
|
|
236
236
|
deviceName,
|
|
@@ -244,22 +244,22 @@ import {
|
|
|
244
244
|
|
|
245
245
|
@Component({
|
|
246
246
|
standalone: true,
|
|
247
|
-
imports: [
|
|
247
|
+
imports: [SYMBIOTE_ELEMENTS],
|
|
248
248
|
template: `
|
|
249
|
-
<
|
|
250
|
-
<
|
|
251
|
-
<
|
|
252
|
-
<
|
|
253
|
-
<
|
|
254
|
-
<
|
|
249
|
+
<view>
|
|
250
|
+
<text>{{ isDevice ? 'Real device' : 'Simulator/emulator' }}</text>
|
|
251
|
+
<text>{{ brand ?? 'unknown' }} {{ modelName ?? '' }}</text>
|
|
252
|
+
<text>{{ osName ?? 'unknown OS' }} {{ osVersion ?? '' }}</text>
|
|
253
|
+
<text>{{ deviceName ?? 'unnamed device' }}</text>
|
|
254
|
+
<text>{{
|
|
255
255
|
uptime() === null ? 'checking uptime…' : 'Uptime: ' + uptime() + 'ms'
|
|
256
|
-
}}</
|
|
257
|
-
<
|
|
256
|
+
}}</text>
|
|
257
|
+
<text>{{
|
|
258
258
|
maxMemory() === null
|
|
259
259
|
? 'checking memory…'
|
|
260
260
|
: 'Max memory: ' + maxMemory() + ' bytes'
|
|
261
|
-
}}</
|
|
262
|
-
</
|
|
261
|
+
}}</text>
|
|
262
|
+
</view>
|
|
263
263
|
`,
|
|
264
264
|
})
|
|
265
265
|
export class DeviceScreen {
|
|
@@ -284,6 +284,7 @@ There's no per-instance service to `inject()` in the Angular case — every cons
|
|
|
284
284
|
plain export off the core package, read straight in the constructor or class-field initializer.
|
|
285
285
|
These snippets mirror the real canary demo screens — `examples/expo-react/screens/DeviceScreen.tsx`,
|
|
286
286
|
`examples/expo-vue-sfc/screens/DeviceScreen.vue`, `examples/expo-vue-tsx/screens/DeviceScreen.tsx`,
|
|
287
|
+
`examples/expo-svelte/screens/DeviceScreen.svelte`, `examples/expo-solid/screens/DeviceScreen.tsx`,
|
|
287
288
|
`examples/expo-angular/src/screens/DeviceScreen.ts`.
|
|
288
289
|
|
|
289
290
|
## API
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/device",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "expo-device wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Device brand/model/OS constants, uptime, max-memory, root/jailbreak detection, side-loading detection, and platform-feature queries.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"solid-js": ">=1.9.0",
|
|
81
81
|
"svelte": ">=5.56.0",
|
|
82
82
|
"vue": ">=3.5.0",
|
|
83
|
-
"@symbiote-native/angular": "^
|
|
84
|
-
"@symbiote-native/engine": "^0.
|
|
85
|
-
"@symbiote-native/react": "^
|
|
86
|
-
"@symbiote-native/solid": "^
|
|
87
|
-
"@symbiote-native/svelte": "^
|
|
88
|
-
"@symbiote-native/vue": "^
|
|
83
|
+
"@symbiote-native/angular": "^3.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^1.0.0",
|
|
85
|
+
"@symbiote-native/react": "^3.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^3.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^3.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^3.0.0"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"@symbiote-native/angular": {
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
"solid-js": "^1.9.14",
|
|
134
134
|
"svelte": "^5.56.0",
|
|
135
135
|
"typescript": "~6.0.0",
|
|
136
|
-
"@symbiote-native/angular": "
|
|
137
|
-
"@symbiote-native/engine": "0.
|
|
138
|
-
"@symbiote-native/react": "
|
|
139
|
-
"@symbiote-native/solid": "
|
|
140
|
-
"@symbiote-native/svelte": "
|
|
141
|
-
"@symbiote-native/test-utils": "0.3.
|
|
142
|
-
"@symbiote-native/vue": "
|
|
136
|
+
"@symbiote-native/angular": "3.0.0",
|
|
137
|
+
"@symbiote-native/engine": "1.0.0",
|
|
138
|
+
"@symbiote-native/react": "3.0.0",
|
|
139
|
+
"@symbiote-native/solid": "3.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "3.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.1",
|
|
142
|
+
"@symbiote-native/vue": "3.0.0"
|
|
143
143
|
},
|
|
144
144
|
"scripts": {
|
|
145
145
|
"typecheck": "tsc --build",
|