@qvac/sdk 0.22.0 → 0.24.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/NOTICE +194 -97
- package/README.md +29 -470
- package/dist/examples/asr/parakeet-sortformer.js +24 -14
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +105 -0
- package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
- package/dist/examples/asr/whispercpp-prompt.js +9 -5
- package/dist/examples/assess-model-fit.d.ts +7 -9
- package/dist/examples/assess-model-fit.js +22 -43
- package/dist/examples/calc-tokens.d.ts +2 -0
- package/dist/examples/calc-tokens.js +21 -0
- package/dist/examples/classification/classify-image.js +11 -5
- package/dist/examples/completion-stop-reason.d.ts +3 -3
- package/dist/examples/completion-stop-reason.js +4 -4
- package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
- package/dist/examples/diffusion-flux3-klein.js +102 -0
- package/dist/examples/diffusion-img2vid-ltx.js +7 -14
- package/dist/examples/diffusion-moss-image.d.ts +2 -0
- package/dist/examples/diffusion-moss-image.js +126 -0
- package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
- package/dist/examples/diffusion-qwen-image-21.js +115 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
- package/dist/examples/embed-multimodal.d.ts +2 -0
- package/dist/examples/embed-multimodal.js +80 -0
- package/dist/examples/embed-p2p.js +2 -2
- package/dist/examples/finetune/llamacpp-finetune.js +9 -4
- package/dist/examples/image/megaloc.d.ts +2 -0
- package/dist/examples/image/megaloc.js +37 -0
- package/dist/examples/llamacpp-multimodal.js +21 -1
- package/dist/examples/mcp-websearch.js +1 -1
- package/dist/examples/plugins.js +1 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
- package/dist/examples/rag/rag-turbovec.js +2 -2
- package/dist/examples/rerank.d.ts +2 -0
- package/dist/examples/rerank.js +33 -0
- package/dist/examples/sessions.d.ts +17 -0
- package/dist/examples/sessions.js +63 -0
- package/dist/examples/tools/llamacpp-deferred-tools.js +12 -8
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
- package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
- package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
- package/dist/scripts/check-resource-collectors-packaging.js +7 -6
- package/dist/scripts/contract/build-contract.d.ts +2 -1
- package/dist/scripts/contract/build-contract.js +13 -1
- package/dist/scripts/contract/constants-registry.d.ts +19 -0
- package/dist/scripts/contract/constants-registry.js +9 -2
- package/dist/scripts/contract/method-shapes.d.ts +5 -0
- package/dist/scripts/contract/method-shapes.js +5 -0
- package/dist/scripts/enforce-inference-versions.d.ts +1 -1
- package/dist/scripts/enforce-inference-versions.js +28 -18
- package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
- package/dist/src/client/api/assess-model-fit.d.ts +17 -17
- package/dist/src/client/api/assess-model-fit.js +19 -32
- package/dist/src/client/api/audio-edit.d.ts +5 -3
- package/dist/src/client/api/audio-edit.js +7 -5
- package/dist/src/client/api/audio-gen-result.js +136 -47
- package/dist/src/client/api/audio-gen.d.ts +40 -3
- package/dist/src/client/api/audio-gen.js +42 -5
- package/dist/src/client/api/audio-understand.d.ts +2 -2
- package/dist/src/client/api/audio-understand.js +4 -4
- package/dist/src/client/api/batch-completion.js +4 -3
- package/dist/src/client/api/bci-transcribe.js +3 -3
- package/dist/src/client/api/calc-tokens.d.ts +33 -0
- package/dist/src/client/api/calc-tokens.js +44 -0
- package/dist/src/client/api/cancel.d.ts +2 -2
- package/dist/src/client/api/cancel.js +3 -3
- package/dist/src/client/api/classify.d.ts +12 -5
- package/dist/src/client/api/classify.js +18 -6
- package/dist/src/client/api/client-request-id.d.ts +0 -15
- package/dist/src/client/api/client-request-id.js +15 -12
- package/dist/src/client/api/completion-stream.d.ts +9 -1
- package/dist/src/client/api/completion-stream.js +14 -3
- package/dist/src/client/api/decide.d.ts +1 -1
- package/dist/src/client/api/decide.js +3 -3
- package/dist/src/client/api/delete-cache.d.ts +9 -2
- package/dist/src/client/api/delete-cache.js +14 -4
- package/dist/src/client/api/diffusion.d.ts +38 -5
- package/dist/src/client/api/diffusion.js +42 -7
- package/dist/src/client/api/download-asset.js +3 -3
- package/dist/src/client/api/embed.d.ts +82 -29
- package/dist/src/client/api/embed.js +66 -21
- package/dist/src/client/api/finetune.js +3 -3
- package/dist/src/client/api/get-loaded-model-info.js +1 -1
- package/dist/src/client/api/get-model-info.d.ts +2 -2
- package/dist/src/client/api/get-model-info.js +3 -3
- package/dist/src/client/api/get-system-resources.d.ts +2 -2
- package/dist/src/client/api/get-system-resources.js +3 -3
- package/dist/src/client/api/heartbeat.d.ts +3 -2
- package/dist/src/client/api/heartbeat.js +4 -3
- package/dist/src/client/api/index.d.ts +8 -6
- package/dist/src/client/api/index.js +6 -4
- package/dist/src/client/api/invoke-plugin.d.ts +8 -2
- package/dist/src/client/api/invoke-plugin.js +18 -3
- package/dist/src/client/api/load-model.js +9 -6
- package/dist/src/client/api/logging-stream.d.ts +11 -2
- package/dist/src/client/api/logging-stream.js +12 -3
- package/dist/src/client/api/ocr.d.ts +5 -3
- package/dist/src/client/api/ocr.js +45 -22
- package/dist/src/client/api/rag.d.ts +1 -1
- package/dist/src/client/api/rag.js +3 -3
- package/dist/src/client/api/registry.d.ts +19 -8
- package/dist/src/client/api/registry.js +43 -17
- package/dist/src/client/api/rerank.d.ts +22 -0
- package/dist/src/client/api/rerank.js +39 -0
- package/dist/src/client/api/resume.d.ts +2 -1
- package/dist/src/client/api/resume.js +3 -3
- package/dist/src/client/api/rpc-server.d.ts +4 -4
- package/dist/src/client/api/rpc-server.js +12 -12
- package/dist/src/client/api/state.d.ts +2 -2
- package/dist/src/client/api/state.js +3 -3
- package/dist/src/client/api/subscribe-logs.d.ts +2 -2
- package/dist/src/client/api/subscribe-logs.js +4 -3
- package/dist/src/client/api/suspend.d.ts +4 -2
- package/dist/src/client/api/suspend.js +5 -4
- package/dist/src/client/api/text-to-speech.d.ts +14 -5
- package/dist/src/client/api/text-to-speech.js +86 -32
- package/dist/src/client/api/transcribe.d.ts +7 -3
- package/dist/src/client/api/transcribe.js +9 -3
- package/dist/src/client/api/translate.js +2 -2
- package/dist/src/client/api/unload-model.d.ts +19 -7
- package/dist/src/client/api/unload-model.js +31 -13
- package/dist/src/client/api/upscale.d.ts +6 -3
- package/dist/src/client/api/upscale.js +10 -5
- package/dist/src/client/api/vector-index.d.ts +51 -17
- package/dist/src/client/api/vector-index.js +101 -49
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +3 -2
- package/dist/src/client/api/video.js +6 -5
- package/dist/src/client/api/vla.d.ts +9 -5
- package/dist/src/client/api/vla.js +17 -8
- package/dist/src/client/api/world-result.js +2 -2
- package/dist/src/client/api/world.d.ts +6 -6
- package/dist/src/client/api/world.js +6 -6
- package/dist/src/client/init-hooks.d.ts +6 -4
- package/dist/src/client/init-hooks.js +12 -15
- package/dist/src/client/logging-stream-registry.d.ts +6 -3
- package/dist/src/client/logging-stream-registry.js +36 -14
- package/dist/src/client/plugins-factory.d.ts +1 -1
- package/dist/src/client/plugins-factory.js +1 -1
- package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
- package/dist/src/client/rpc/bundle-stamp.js +75 -0
- package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
- package/dist/src/client/rpc/expo-home-dir.js +4 -0
- package/dist/src/client/rpc/expo-rpc-client.js +192 -138
- package/dist/src/client/rpc/node-rpc-client.js +324 -426
- package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
- package/dist/src/client/rpc/pear-runtime.js +12 -0
- package/dist/src/client/rpc/rpc-client.d.ts +6 -4
- package/dist/src/client/rpc/rpc-client.js +168 -31
- package/dist/src/client/rpc/rpc-error.js +24 -2
- package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
- package/dist/src/client/rpc/unbundled-harness.js +27 -0
- package/dist/src/client/rpc/worker-failure.d.ts +27 -0
- package/dist/src/client/rpc/worker-failure.js +61 -0
- package/dist/src/client/session-registry.d.ts +75 -0
- package/dist/src/client/session-registry.js +149 -0
- package/dist/src/client/session.d.ts +125 -0
- package/dist/src/client/session.js +148 -0
- package/dist/src/commands/bundle/addons.d.ts +14 -0
- package/dist/src/commands/bundle/addons.js +65 -0
- package/dist/src/commands/bundle/constants.js +2 -0
- package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
- package/dist/src/commands/bundle/entry-gen.js +18 -51
- package/dist/src/commands/bundle/index.d.ts +60 -14
- package/dist/src/commands/bundle/index.js +350 -126
- package/dist/src/commands/bundle/link.d.ts +58 -0
- package/dist/src/commands/bundle/link.js +135 -0
- package/dist/src/commands/bundle/node-support.d.ts +13 -0
- package/dist/src/commands/bundle/node-support.js +23 -0
- package/dist/src/commands/bundle/plugins.js +1 -1
- package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
- package/dist/src/commands/bundle/read-bundle.js +27 -0
- package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
- package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
- package/dist/src/commands/bundle/scratch.d.ts +35 -0
- package/dist/src/commands/bundle/scratch.js +178 -0
- package/dist/src/commands/bundle/targets.d.ts +14 -0
- package/dist/src/commands/bundle/targets.js +37 -0
- package/dist/src/commands/host-prebuilds/index.d.ts +8 -7
- package/dist/src/commands/host-prebuilds/index.js +13 -11
- package/dist/src/commands/index.d.ts +13 -12
- package/dist/src/commands/index.js +7 -7
- package/dist/src/commands/verify/abi.d.ts +21 -15
- package/dist/src/commands/verify/abi.js +12 -80
- package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
- package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
- package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
- package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
- package/dist/src/commands/verify/bundle-source.d.ts +1 -1
- package/dist/src/commands/verify/bundle-source.js +27 -23
- package/dist/src/commands/verify/engines-advice.d.ts +6 -12
- package/dist/src/commands/verify/engines-advice.js +9 -56
- package/dist/src/commands/verify/index.d.ts +34 -33
- package/dist/src/commands/verify/index.js +96 -204
- package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/src/commands/verify/node-modules-source.js +1 -1
- package/dist/src/commands/verify/prebuilds.d.ts +4 -6
- package/dist/src/commands/verify/prebuilds.js +3 -4
- package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
- package/dist/src/commands/verify/resource-collectors.js +3 -52
- package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
- package/dist/src/commands/verify/sidecar-runtime.js +51 -0
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
- package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
- package/dist/src/expo/plugins/withBareKit.js +204 -0
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
- package/dist/src/expo/plugins/withMobileBundle.d.ts +5 -12
- package/dist/src/expo/plugins/withMobileBundle.js +38 -59
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +2 -1
- package/dist/src/expo/plugins/withQvacSDK.js +3 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +10 -14
- package/dist/src/logging/addon.d.ts +1 -1
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +11 -3
- package/dist/src/plugin-ids.d.ts +3 -1
- package/dist/src/plugin-ids.js +4 -0
- package/dist/src/schemas/public.d.ts +1 -1
- package/dist/src/schemas/public.js +1 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
- package/dist/src/schemas/sdk-errors-client.js +30 -36
- package/dist/src/schemas/sdk-errors-server.d.ts +12 -1
- package/dist/src/schemas/sdk-errors-server.js +65 -2
- package/dist/src/server/rpc/rpc-utils.d.ts +26 -0
- package/dist/src/server/rpc/rpc-utils.js +41 -0
- package/dist/src/utils/aggregate-events.d.ts +1 -1
- package/dist/src/utils/aggregate-events.js +2 -2
- package/dist/src/utils/errors-client.d.ts +37 -29
- package/dist/src/utils/errors-client.js +50 -41
- package/dist/src/utils/errors-server.d.ts +65 -1
- package/dist/src/utils/errors-server.js +122 -1
- package/dist/src/utils/mcp-adapter.d.ts +1 -1
- package/dist/src/utils/mcp-adapter.js +1 -1
- package/dist/src/utils/tool-helpers.js +1 -1
- package/dist/src/utils/withTimeout.js +34 -17
- package/dist/src/worker/handle-request.js +26 -21
- package/dist/src/worker/handler-utils.d.ts +2 -6
- package/dist/src/worker/handler-utils.js +2 -20
- package/dist/src/worker/index.d.ts +2 -4
- package/dist/src/worker/index.js +24 -34
- package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
- package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
- package/dist/src/worker/shim.d.ts +4 -0
- package/dist/src/worker/shim.js +7 -0
- package/dist/src/worker/start.d.ts +9 -0
- package/dist/src/worker/start.js +16 -0
- package/dist/src/worker/unbundled-shim.d.ts +2 -0
- package/dist/src/worker/unbundled-shim.js +4 -0
- package/docs/system-resources-support-matrix.md +27 -19
- package/package.json +91 -74
- package/src/electron-forge/index.cjs +65 -91
- package/dist/examples/model-fit-ui/server.d.ts +0 -24
- package/dist/examples/model-fit-ui/server.js +0 -221
- package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
- package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
- package/dist/src/client/rpc/init-timeout.d.ts +0 -26
- package/dist/src/client/rpc/init-timeout.js +0 -25
- package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
- package/dist/src/client/rpc/worker-startup-error.js +0 -13
- package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
- package/dist/src/commands/bundle/bare-pack.js +0 -77
- package/dist/src/commands/bundle/manifest.d.ts +0 -25
- package/dist/src/commands/bundle/manifest.js +0 -192
- package/dist/src/expo/plugins/link-addons.d.ts +0 -18
- package/dist/src/expo/plugins/link-addons.js +0 -65
- package/dist/src/pear/pre.d.ts +0 -21
- package/dist/src/pear/pre.js +0 -448
- package/dist/src/server/env.d.ts +0 -22
- package/dist/src/server/env.js +0 -59
- package/dist/src/server/utils/qvac-paths.d.ts +0 -2
- package/dist/src/server/utils/qvac-paths.js +0 -5
- package/dist/src/server/utils/worker-lock.d.ts +0 -3
- package/dist/src/server/utils/worker-lock.js +0 -67
- package/dist/src/worker/create-server.d.ts +0 -8
- package/dist/src/worker/create-server.js +0 -51
- package/dist/src/worker/lifecycle.d.ts +0 -23
- package/dist/src/worker/lifecycle.js +0 -149
|
@@ -2,8 +2,8 @@ import { promises as fsp } from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { createGzip } from 'node:zlib';
|
|
4
4
|
import tarStream, {} from 'tar-stream';
|
|
5
|
-
import { collectAddonsFromBundle } from '
|
|
6
|
-
import { listBarePrebuildFiles } from '
|
|
5
|
+
import { collectAddonsFromBundle } from '../../commands/verify/bundle-source.js';
|
|
6
|
+
import { listBarePrebuildFiles } from '../../commands/verify/prebuilds.js';
|
|
7
7
|
export const RESOURCE_COLLECTOR_PACKAGES = ['bare-cpu-info', 'bare-gpu-info'];
|
|
8
8
|
export const RESOURCE_COLLECTOR_SIZE_BUDGETS = {
|
|
9
9
|
compressedBytes: 2 * 1024 * 1024,
|
|
@@ -21,13 +21,9 @@ export async function acceptResourceCollectorPackaging(options) {
|
|
|
21
21
|
const collectors = new Map(addons
|
|
22
22
|
.filter((addon) => isResourceCollectorPackage(addon.name))
|
|
23
23
|
.map((addon) => [addon.name, addon]));
|
|
24
|
-
const manifestResult = await readAddonsManifest(options.manifestPath);
|
|
25
|
-
const manifestAddons = new Set(manifestResult.manifest?.addons);
|
|
26
24
|
const issues = [];
|
|
27
25
|
const entriesByHost = new Map(options.hosts.map((host) => [host, []]));
|
|
28
26
|
const budgets = options.budgets ?? RESOURCE_COLLECTOR_SIZE_BUDGETS;
|
|
29
|
-
if (manifestResult.issue !== undefined)
|
|
30
|
-
issues.push(manifestResult.issue);
|
|
31
27
|
for (const packageName of RESOURCE_COLLECTOR_PACKAGES) {
|
|
32
28
|
const collector = collectors.get(packageName);
|
|
33
29
|
if (collector === undefined) {
|
|
@@ -35,21 +31,10 @@ export async function acceptResourceCollectorPackaging(options) {
|
|
|
35
31
|
code: 'missing-collector',
|
|
36
32
|
level: 'error',
|
|
37
33
|
package: packageName,
|
|
38
|
-
location: 'bundle',
|
|
39
34
|
message: `${packageName} is missing from the linked worker bundle graph.`
|
|
40
35
|
});
|
|
41
|
-
}
|
|
42
|
-
if (manifestResult.manifest !== undefined && !manifestAddons.has(packageName)) {
|
|
43
|
-
issues.push({
|
|
44
|
-
code: 'missing-collector',
|
|
45
|
-
level: 'error',
|
|
46
|
-
package: packageName,
|
|
47
|
-
location: 'manifest',
|
|
48
|
-
message: `${packageName} is missing from ${options.manifestPath}.`
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (collector === undefined)
|
|
52
36
|
continue;
|
|
37
|
+
}
|
|
53
38
|
for (const host of options.hosts) {
|
|
54
39
|
const hostDir = path.join(collector.packageRoot, 'prebuilds', host);
|
|
55
40
|
const files = await listBarePrebuildFiles(hostDir);
|
|
@@ -226,37 +211,3 @@ function measurementFailedIssue(packageName, host, cause) {
|
|
|
226
211
|
function isResourceCollectorPackage(packageName) {
|
|
227
212
|
return RESOURCE_COLLECTOR_PACKAGES.some((collector) => collector === packageName);
|
|
228
213
|
}
|
|
229
|
-
async function readAddonsManifest(manifestPath) {
|
|
230
|
-
let parsed;
|
|
231
|
-
try {
|
|
232
|
-
parsed = JSON.parse(await fsp.readFile(manifestPath, 'utf8'));
|
|
233
|
-
}
|
|
234
|
-
catch (error) {
|
|
235
|
-
return {
|
|
236
|
-
issue: invalidManifestIssue(manifestPath, error)
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
if (!isAddonsManifest(parsed)) {
|
|
240
|
-
return {
|
|
241
|
-
issue: invalidManifestIssue(manifestPath, 'manifest does not match the expected shape')
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
return { manifest: parsed };
|
|
245
|
-
}
|
|
246
|
-
function isAddonsManifest(value) {
|
|
247
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
248
|
-
return false;
|
|
249
|
-
const manifest = value;
|
|
250
|
-
return (manifest['version'] === 1 &&
|
|
251
|
-
typeof manifest['bundleId'] === 'string' &&
|
|
252
|
-
Array.isArray(manifest['addons']) &&
|
|
253
|
-
manifest['addons'].every((addon) => typeof addon === 'string'));
|
|
254
|
-
}
|
|
255
|
-
function invalidManifestIssue(manifestPath, cause) {
|
|
256
|
-
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
257
|
-
return {
|
|
258
|
-
code: 'invalid-manifest',
|
|
259
|
-
level: 'error',
|
|
260
|
-
message: `Could not read a valid addon manifest at ${manifestPath}: ${reason}.`
|
|
261
|
-
};
|
|
262
|
-
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BareRuntimeResolution } from '../../commands/verify/abi.js';
|
|
2
|
+
/** The Bare that the bare-sidecar `from` resolves runs desktop workers on, from its `versions.json`. */
|
|
3
|
+
export declare function resolveSidecarRuntime(from: string): BareRuntimeResolution;
|
|
4
|
+
/** The Bare of the bare-sidecar that the project's pear-runtime starts workers with. */
|
|
5
|
+
export declare function resolvePearRuntime(projectRoot: string): BareRuntimeResolution;
|
|
6
|
+
//# sourceMappingURL=sidecar-runtime.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { findInAncestorNodeModules } from '../../expo/plugins/find-in-ancestor-node-modules.js';
|
|
4
|
+
function unresolved(reason, triedPaths) {
|
|
5
|
+
return { resolved: false, error: { reason, triedPaths } };
|
|
6
|
+
}
|
|
7
|
+
function readJson(file) {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** The Bare that the bare-sidecar `from` resolves runs desktop workers on, from its `versions.json`. */
|
|
16
|
+
export function resolveSidecarRuntime(from) {
|
|
17
|
+
const dir = findInAncestorNodeModules(from, 'bare-sidecar');
|
|
18
|
+
if (dir === null) {
|
|
19
|
+
return unresolved('bare-sidecar is not installed, so the desktop Bare version is unknown', [
|
|
20
|
+
path.join(from, 'node_modules', 'bare-sidecar')
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
const versionsPath = path.join(dir, 'versions.json');
|
|
24
|
+
const bare = readJson(versionsPath)?.['bare'];
|
|
25
|
+
if (typeof bare !== 'string') {
|
|
26
|
+
return unresolved(`${versionsPath} does not name the Bare version`, [versionsPath]);
|
|
27
|
+
}
|
|
28
|
+
const version = readJson(path.join(dir, 'package.json'))?.['version'];
|
|
29
|
+
const packageVersion = typeof version === 'string' ? version : 'unknown';
|
|
30
|
+
return {
|
|
31
|
+
resolved: true,
|
|
32
|
+
runtime: {
|
|
33
|
+
version: bare,
|
|
34
|
+
source: 'bare-sidecar',
|
|
35
|
+
packageVersion,
|
|
36
|
+
detail: `bare-sidecar ${packageVersion} at ${dir}`
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** The Bare of the bare-sidecar that the project's pear-runtime starts workers with. */
|
|
41
|
+
export function resolvePearRuntime(projectRoot) {
|
|
42
|
+
const dir = findInAncestorNodeModules(projectRoot, 'pear-runtime');
|
|
43
|
+
if (dir === null) {
|
|
44
|
+
return unresolved('pear-runtime is not installed, so the desktop Bare version is unknown', [
|
|
45
|
+
path.join(projectRoot, 'node_modules', 'pear-runtime')
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
// pnpm links pear-runtime into node_modules; its bare-sidecar sits next to
|
|
49
|
+
// the real directory in the store, not next to the link.
|
|
50
|
+
return resolveSidecarRuntime(fs.realpathSync(dir));
|
|
51
|
+
}
|
|
@@ -13,17 +13,23 @@ function withAndroidNdkVersion(config) {
|
|
|
13
13
|
'android',
|
|
14
14
|
function (config) {
|
|
15
15
|
const buildGradlePath = path.join(config.modRequest.platformProjectRoot, 'build.gradle');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
buildGradle = buildGradle.replace(/ndkVersion\s*=\s*["'][^"']+["']/g, `ndkVersion = "${ndkVersion}"`);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
buildGradle = buildGradle.replace(/(buildscript\s*\{)/, `$1\n ext {\n ndkVersion = "${ndkVersion}"\n }`);
|
|
23
|
-
}
|
|
24
|
-
fs.writeFileSync(buildGradlePath, buildGradle);
|
|
25
|
-
console.log(`[withAndroidNdkVersion] 🔧 QVAC: Set Android NDK version to ${ndkVersion}`);
|
|
16
|
+
let buildGradle;
|
|
17
|
+
try {
|
|
18
|
+
buildGradle = fs.readFileSync(buildGradlePath, 'utf8');
|
|
26
19
|
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
if (err.code === 'ENOENT')
|
|
22
|
+
return config;
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
if (buildGradle.includes('ndkVersion')) {
|
|
26
|
+
buildGradle = buildGradle.replace(/ndkVersion\s*=\s*["'][^"']+["']/g, `ndkVersion = "${ndkVersion}"`);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
buildGradle = buildGradle.replace(/(buildscript\s*\{)/, `$1\n ext {\n ndkVersion = "${ndkVersion}"\n }`);
|
|
30
|
+
}
|
|
31
|
+
fs.writeFileSync(buildGradlePath, buildGradle);
|
|
32
|
+
console.log(`[withAndroidNdkVersion] 🔧 QVAC: Set Android NDK version to ${ndkVersion}`);
|
|
27
33
|
return config;
|
|
28
34
|
}
|
|
29
35
|
]);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import configPlugins from '@expo/config-plugins';
|
|
2
|
+
import type { ExpoConfig } from 'expo/config';
|
|
3
|
+
/**
|
|
4
|
+
* Expo plugin: adds the Bare Kit module that `withMobileBundle` writes to the
|
|
5
|
+
* app, as a Gradle module on Android and a local Swift package on iOS, and
|
|
6
|
+
* raises the app's Kotlin to the version Bare Kit needs. Fails when
|
|
7
|
+
* expo-bare-kit is also configured, since both write Bare Kit and the native
|
|
8
|
+
* addons into the app.
|
|
9
|
+
*/
|
|
10
|
+
declare function withBareKit(config: ExpoConfig): ExpoConfig;
|
|
11
|
+
export declare function includeModule(settings: string): string;
|
|
12
|
+
export declare function addModuleDependency(appBuildGradle: string): string;
|
|
13
|
+
/** bare-kit-kotlin is published on JitPack. */
|
|
14
|
+
export declare function addJitPack(buildGradle: string): string;
|
|
15
|
+
type GradleProperties = configPlugins.AndroidConfig.Properties.PropertiesItem[];
|
|
16
|
+
export declare function raiseKotlinVersion(properties: GradleProperties): void;
|
|
17
|
+
interface PbxEntry {
|
|
18
|
+
value: string;
|
|
19
|
+
comment: string;
|
|
20
|
+
}
|
|
21
|
+
interface XcodeObjects {
|
|
22
|
+
PBXNativeTarget: Record<string, {
|
|
23
|
+
name?: string;
|
|
24
|
+
packageProductDependencies?: PbxEntry[];
|
|
25
|
+
}>;
|
|
26
|
+
PBXFileReference: Record<string, unknown>;
|
|
27
|
+
PBXBuildFile: Record<string, unknown>;
|
|
28
|
+
PBXGroup: Record<string, {
|
|
29
|
+
children: PbxEntry[];
|
|
30
|
+
}>;
|
|
31
|
+
XCLocalSwiftPackageReference?: Record<string, unknown>;
|
|
32
|
+
XCSwiftPackageProductDependency?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export interface XcodeProject {
|
|
35
|
+
hash: {
|
|
36
|
+
project: {
|
|
37
|
+
objects: XcodeObjects;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
generateUuid(): string;
|
|
41
|
+
getFirstProject(): {
|
|
42
|
+
firstProject: {
|
|
43
|
+
mainGroup: string;
|
|
44
|
+
packageReferences?: PbxEntry[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
pbxFrameworksBuildPhaseObj(target: string): {
|
|
48
|
+
files: PbxEntry[];
|
|
49
|
+
} | null;
|
|
50
|
+
pbxResourcesBuildPhaseObj(target: string): {
|
|
51
|
+
files: PbxEntry[];
|
|
52
|
+
} | null;
|
|
53
|
+
}
|
|
54
|
+
/** Links the product of the local Swift package at `relativePath`, named the same, into `target`. */
|
|
55
|
+
export declare function addSwiftPackage(project: XcodeProject, target: string, relativePath: string): void;
|
|
56
|
+
/** Copies the folder at `relativePath` into the app bundle as is. */
|
|
57
|
+
export declare function addFolderResource(project: XcodeProject, target: string, relativePath: string): void;
|
|
58
|
+
export default withBareKit;
|
|
59
|
+
//# sourceMappingURL=withBareKit.d.ts.map
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import configPlugins from '@expo/config-plugins';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { BARE_KIT_RESOURCES, NATIVE_MODULES } from '../../commands/bundle/link.js';
|
|
4
|
+
const { IOSConfig, WarningAggregator, withAppBuildGradle, withGradleProperties, withPlugins, withProjectBuildGradle, withSettingsGradle, withXcodeProject } = configPlugins;
|
|
5
|
+
const PLUGIN = '@qvac/sdk/expo-plugin';
|
|
6
|
+
const ANDROID_MODULE = path.basename(NATIVE_MODULES.android.dir);
|
|
7
|
+
const IOS_PACKAGE = path.basename(NATIVE_MODULES.ios.dir);
|
|
8
|
+
const JITPACK = 'https://www.jitpack.io';
|
|
9
|
+
/** bare-kit-kotlin is built with Kotlin 2.4, which Expo builds from SDK 58. */
|
|
10
|
+
const MIN_KOTLIN_VERSION = '2.4.20';
|
|
11
|
+
/**
|
|
12
|
+
* Expo plugin: adds the Bare Kit module that `withMobileBundle` writes to the
|
|
13
|
+
* app, as a Gradle module on Android and a local Swift package on iOS, and
|
|
14
|
+
* raises the app's Kotlin to the version Bare Kit needs. Fails when
|
|
15
|
+
* expo-bare-kit is also configured, since both write Bare Kit and the native
|
|
16
|
+
* addons into the app.
|
|
17
|
+
*/
|
|
18
|
+
function withBareKit(config) {
|
|
19
|
+
if (hasPlugin(config, 'expo-bare-kit')) {
|
|
20
|
+
throw new Error(`QVAC: ${PLUGIN} cannot be used with expo-bare-kit, since both add Bare Kit and its native ` +
|
|
21
|
+
'addons to the app. Remove expo-bare-kit from the plugins.');
|
|
22
|
+
}
|
|
23
|
+
return withPlugins(config, [withAndroidModule, withJitPack, withKotlinVersion, withIosPackage]);
|
|
24
|
+
}
|
|
25
|
+
function hasPlugin(config, name) {
|
|
26
|
+
return (config.plugins ?? []).some((plugin) => Array.isArray(plugin) ? plugin[0] === name : plugin === name);
|
|
27
|
+
}
|
|
28
|
+
export function includeModule(settings) {
|
|
29
|
+
const include = `include ':${ANDROID_MODULE}'`;
|
|
30
|
+
return settings.includes(include) ? settings : `${settings}\n${include}\n`;
|
|
31
|
+
}
|
|
32
|
+
export function addModuleDependency(appBuildGradle) {
|
|
33
|
+
const dependency = `implementation project(':${ANDROID_MODULE}')`;
|
|
34
|
+
if (appBuildGradle.includes(dependency))
|
|
35
|
+
return appBuildGradle;
|
|
36
|
+
return appBuildGradle.replace(/dependencies\s*{/, (match) => `${match}\n ${dependency}`);
|
|
37
|
+
}
|
|
38
|
+
/** bare-kit-kotlin is published on JitPack. */
|
|
39
|
+
export function addJitPack(buildGradle) {
|
|
40
|
+
const repository = `maven { url '${JITPACK}' }`;
|
|
41
|
+
if (buildGradle.includes(repository))
|
|
42
|
+
return buildGradle;
|
|
43
|
+
return buildGradle.replace(/allprojects\s*{\s*repositories\s*{/, (match) => `${match}\n ${repository}`);
|
|
44
|
+
}
|
|
45
|
+
export function raiseKotlinVersion(properties) {
|
|
46
|
+
const key = 'android.kotlinVersion';
|
|
47
|
+
const property = properties.find((item) => item.type === 'property' && item.key === key);
|
|
48
|
+
if (property === undefined) {
|
|
49
|
+
properties.push({ type: 'property', key, value: MIN_KOTLIN_VERSION });
|
|
50
|
+
}
|
|
51
|
+
else if (property.type === 'property' &&
|
|
52
|
+
compareVersions(property.value, MIN_KOTLIN_VERSION) < 0) {
|
|
53
|
+
property.value = MIN_KOTLIN_VERSION;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Compares the numeric parts of two versions; a suffix such as `-RC` is ignored. */
|
|
57
|
+
function compareVersions(a, b) {
|
|
58
|
+
const numbers = (version) => version.split('.').map((part) => parseInt(part, 10) || 0);
|
|
59
|
+
const x = numbers(a);
|
|
60
|
+
const y = numbers(b);
|
|
61
|
+
for (let i = 0; i < Math.max(x.length, y.length); i++) {
|
|
62
|
+
const difference = (x[i] ?? 0) - (y[i] ?? 0);
|
|
63
|
+
if (difference !== 0)
|
|
64
|
+
return difference;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function withKotlinVersion(config) {
|
|
69
|
+
return withGradleProperties(config, (config) => {
|
|
70
|
+
raiseKotlinVersion(config.modResults);
|
|
71
|
+
return config;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function withAndroidModule(config) {
|
|
75
|
+
config = withSettingsGradle(config, (config) => {
|
|
76
|
+
config.modResults.contents = includeModule(config.modResults.contents);
|
|
77
|
+
return config;
|
|
78
|
+
});
|
|
79
|
+
return withAppBuildGradle(config, (config) => {
|
|
80
|
+
if (!isGroovy(config.modResults.language, 'app build.gradle'))
|
|
81
|
+
return config;
|
|
82
|
+
config.modResults.contents = addModuleDependency(config.modResults.contents);
|
|
83
|
+
warnUnless(config.modResults.contents, `:${ANDROID_MODULE}`, 'a dependencies block in app build.gradle');
|
|
84
|
+
return config;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function withJitPack(config) {
|
|
88
|
+
return withProjectBuildGradle(config, (config) => {
|
|
89
|
+
if (!isGroovy(config.modResults.language, 'build.gradle'))
|
|
90
|
+
return config;
|
|
91
|
+
config.modResults.contents = addJitPack(config.modResults.contents);
|
|
92
|
+
warnUnless(config.modResults.contents, JITPACK, 'allprojects.repositories in build.gradle');
|
|
93
|
+
return config;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/** Warns when `contents` lacks `expected`, which the plugin adds to `place`. */
|
|
97
|
+
function warnUnless(contents, expected, place) {
|
|
98
|
+
if (contents.includes(expected))
|
|
99
|
+
return;
|
|
100
|
+
WarningAggregator.addWarningAndroid(PLUGIN, `Cannot find ${place} to add Bare Kit to; add ${expected} there yourself`);
|
|
101
|
+
}
|
|
102
|
+
function isGroovy(language, file) {
|
|
103
|
+
if (language === 'groovy')
|
|
104
|
+
return true;
|
|
105
|
+
WarningAggregator.addWarningAndroid(PLUGIN, `Cannot add Bare Kit to a non-Groovy ${file}`);
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
function withIosPackage(config) {
|
|
109
|
+
return withXcodeProject(config, (config) => {
|
|
110
|
+
// The Swift package is written only on macOS, which signs its frameworks.
|
|
111
|
+
if (process.platform !== 'darwin')
|
|
112
|
+
return config;
|
|
113
|
+
const project = config.modResults;
|
|
114
|
+
const { uuid } = IOSConfig.XcodeUtils.getApplicationNativeTarget({
|
|
115
|
+
project: config.modResults,
|
|
116
|
+
projectName: config.modRequest.projectName
|
|
117
|
+
});
|
|
118
|
+
addSwiftPackage(project, uuid, IOS_PACKAGE);
|
|
119
|
+
addFolderResource(project, uuid, `${IOS_PACKAGE}/${BARE_KIT_RESOURCES}`);
|
|
120
|
+
return config;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function unquote(value) {
|
|
124
|
+
return typeof value === 'string' ? value.replace(/^"|"$/g, '') : value;
|
|
125
|
+
}
|
|
126
|
+
/** Links the product of the local Swift package at `relativePath`, named the same, into `target`. */
|
|
127
|
+
export function addSwiftPackage(project, target, relativePath) {
|
|
128
|
+
const objects = project.hash.project.objects;
|
|
129
|
+
const nativeTarget = objects.PBXNativeTarget[target];
|
|
130
|
+
if (nativeTarget === undefined)
|
|
131
|
+
throw new Error(`QVAC: unknown Xcode target '${target}'`);
|
|
132
|
+
const packages = (objects.XCLocalSwiftPackageReference ??= {});
|
|
133
|
+
const products = (objects.XCSwiftPackageProductDependency ??= {});
|
|
134
|
+
const comment = `XCLocalSwiftPackageReference "${relativePath}"`;
|
|
135
|
+
let packageId = Object.entries(packages).find(([, value]) => typeof value === 'object' &&
|
|
136
|
+
unquote(value.relativePath) === relativePath)?.[0];
|
|
137
|
+
if (packageId === undefined) {
|
|
138
|
+
packageId = project.generateUuid();
|
|
139
|
+
packages[packageId] = {
|
|
140
|
+
isa: 'XCLocalSwiftPackageReference',
|
|
141
|
+
relativePath: `"${relativePath}"`
|
|
142
|
+
};
|
|
143
|
+
packages[`${packageId}_comment`] = comment;
|
|
144
|
+
const root = project.getFirstProject().firstProject;
|
|
145
|
+
(root.packageReferences ??= []).push({ value: packageId, comment });
|
|
146
|
+
}
|
|
147
|
+
const dependencies = (nativeTarget.packageProductDependencies ??= []);
|
|
148
|
+
const linked = dependencies.some(({ value }) => {
|
|
149
|
+
const dependency = products[value];
|
|
150
|
+
return dependency?.package === packageId && dependency.productName === relativePath;
|
|
151
|
+
});
|
|
152
|
+
if (linked)
|
|
153
|
+
return;
|
|
154
|
+
const dependency = project.generateUuid();
|
|
155
|
+
products[dependency] = {
|
|
156
|
+
isa: 'XCSwiftPackageProductDependency',
|
|
157
|
+
package: packageId,
|
|
158
|
+
package_comment: comment,
|
|
159
|
+
productName: relativePath
|
|
160
|
+
};
|
|
161
|
+
products[`${dependency}_comment`] = relativePath;
|
|
162
|
+
dependencies.push({ value: dependency, comment: relativePath });
|
|
163
|
+
const file = project.generateUuid();
|
|
164
|
+
objects.PBXBuildFile[file] = {
|
|
165
|
+
isa: 'PBXBuildFile',
|
|
166
|
+
productRef: dependency,
|
|
167
|
+
productRef_comment: relativePath
|
|
168
|
+
};
|
|
169
|
+
objects.PBXBuildFile[`${file}_comment`] = `${relativePath} in Frameworks`;
|
|
170
|
+
const phase = project.pbxFrameworksBuildPhaseObj(target);
|
|
171
|
+
if (phase === null) {
|
|
172
|
+
throw new Error(`QVAC: Xcode target '${nativeTarget.name}' has no Frameworks phase`);
|
|
173
|
+
}
|
|
174
|
+
phase.files.push({ value: file, comment: `${relativePath} in Frameworks` });
|
|
175
|
+
}
|
|
176
|
+
/** Copies the folder at `relativePath` into the app bundle as is. */
|
|
177
|
+
export function addFolderResource(project, target, relativePath) {
|
|
178
|
+
const objects = project.hash.project.objects;
|
|
179
|
+
const exists = Object.values(objects.PBXFileReference).some((value) => typeof value === 'object' && unquote(value.path) === relativePath);
|
|
180
|
+
if (exists)
|
|
181
|
+
return;
|
|
182
|
+
const name = path.posix.basename(relativePath);
|
|
183
|
+
const file = project.generateUuid();
|
|
184
|
+
objects.PBXFileReference[file] = {
|
|
185
|
+
isa: 'PBXFileReference',
|
|
186
|
+
lastKnownFileType: 'folder',
|
|
187
|
+
name: `"${name}"`,
|
|
188
|
+
path: `"${relativePath}"`,
|
|
189
|
+
sourceTree: '"<group>"'
|
|
190
|
+
};
|
|
191
|
+
objects.PBXFileReference[`${file}_comment`] = name;
|
|
192
|
+
objects.PBXGroup[project.getFirstProject().firstProject.mainGroup].children.push({
|
|
193
|
+
value: file,
|
|
194
|
+
comment: name
|
|
195
|
+
});
|
|
196
|
+
const build = project.generateUuid();
|
|
197
|
+
objects.PBXBuildFile[build] = { isa: 'PBXBuildFile', fileRef: file, fileRef_comment: name };
|
|
198
|
+
objects.PBXBuildFile[`${build}_comment`] = `${name} in Resources`;
|
|
199
|
+
const phase = project.pbxResourcesBuildPhaseObj(target);
|
|
200
|
+
if (phase === null)
|
|
201
|
+
throw new Error(`QVAC: Xcode target '${target}' has no Resources phase`);
|
|
202
|
+
phase.files.push({ value: build, comment: `${name} in Resources` });
|
|
203
|
+
}
|
|
204
|
+
export default withBareKit;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
import { resolveSDKPackageDir } from '
|
|
4
|
-
import { getProjectRootFromBaseConfig } from '
|
|
3
|
+
import { resolveSDKPackageDir } from '../../expo/plugins/resolve-sdk-package-dir.js';
|
|
4
|
+
import { getProjectRootFromBaseConfig } from '../../expo/plugins/get-project-root.js';
|
|
5
5
|
let didRun = false;
|
|
6
6
|
/**
|
|
7
7
|
* Expo plugin that stubs expo-device-info when expo-device is not a declared
|
|
@@ -29,8 +29,19 @@ function withDeviceInfo(config) {
|
|
|
29
29
|
}
|
|
30
30
|
if (!hasExpoDevice) {
|
|
31
31
|
const deviceInfoPath = path.join(qvacSdkPath, 'dist', 'client', 'rpc', 'expo-device-info.js');
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// r+ so a build without this module is left alone; truncate because the stub is shorter.
|
|
33
|
+
let fd;
|
|
34
|
+
try {
|
|
35
|
+
fd = fs.openSync(deviceInfoPath, 'r+');
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
if (err.code === 'ENOENT')
|
|
39
|
+
return config;
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
fs.ftruncateSync(fd, 0);
|
|
44
|
+
fs.writeFileSync(fd, [
|
|
34
45
|
`"use strict";`,
|
|
35
46
|
`Object.defineProperty(exports, "__esModule", { value: true });`,
|
|
36
47
|
`async function getDeviceInfo() {`,
|
|
@@ -38,8 +49,11 @@ function withDeviceInfo(config) {
|
|
|
38
49
|
`}`,
|
|
39
50
|
`exports.getDeviceInfo = getDeviceInfo;`
|
|
40
51
|
].join('\n'));
|
|
41
|
-
console.log('[withDeviceInfo] 🔧 QVAC: expo-device not in app dependencies, stubbed device info');
|
|
42
52
|
}
|
|
53
|
+
finally {
|
|
54
|
+
fs.closeSync(fd);
|
|
55
|
+
}
|
|
56
|
+
console.log('[withDeviceInfo] 🔧 QVAC: expo-device not in app dependencies, stubbed device info');
|
|
43
57
|
}
|
|
44
58
|
else {
|
|
45
59
|
console.log('[withDeviceInfo] 🔧 QVAC: expo-device in app dependencies, using expo-device info');
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import configPlugins from '@expo/config-plugins';
|
|
2
|
-
import type { ExpoConfig } from 'expo/config
|
|
3
|
-
/**
|
|
4
|
-
* Desktop-only spawn path, deferred so bare-pack does not walk `bare-process`
|
|
5
|
-
* -> `bare-posix` (no `android-arm64` prebuild). Mobile runs the engine fitter
|
|
6
|
-
* in process instead, so it never reaches this.
|
|
7
|
-
*/
|
|
8
|
-
declare const MOBILE_UNSUPPORTED_MODULES: string[];
|
|
2
|
+
import type { ExpoConfig } from 'expo/config';
|
|
9
3
|
type MobilePlatform = 'android' | 'ios';
|
|
10
4
|
declare const MOBILE_HOSTS_BY_PLATFORM: Record<MobilePlatform, string[]>;
|
|
11
5
|
/** Every mobile host, in platform order. The bundle covers all of them. */
|
|
@@ -20,15 +14,14 @@ type MobileBundleOptions = {
|
|
|
20
14
|
installMissingPrebuilds?: boolean;
|
|
21
15
|
};
|
|
22
16
|
/**
|
|
23
|
-
* Expo plugin:
|
|
24
|
-
* platform being
|
|
25
|
-
*
|
|
26
|
-
* `qvac.config.*` if present.
|
|
17
|
+
* Expo plugin: bundle and verify the worker, write Bare Kit and the native
|
|
18
|
+
* addons for the platform being built, then copy the worker into the SDK.
|
|
19
|
+
* Uses `qvac.config.*` if present.
|
|
27
20
|
*/
|
|
28
21
|
declare function withMobileBundle(config: ExpoConfig, options?: MobileBundleOptions): ExpoConfig;
|
|
29
22
|
declare function buildMobileBundle<T extends configPlugins.ExportedConfigWithProps<unknown>>(config: T, options: MobileBundleOptions): Promise<T>;
|
|
30
23
|
declare function mobileHostsForPlatform(platform: string): string[];
|
|
31
|
-
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM,
|
|
24
|
+
export { MOBILE_HOSTS, MOBILE_HOSTS_BY_PLATFORM, buildMobileBundle, mobileHostsForPlatform };
|
|
32
25
|
export type { MobileBundleOptions, MobilePlatform };
|
|
33
26
|
export default withMobileBundle;
|
|
34
27
|
//# sourceMappingURL=withMobileBundle.d.ts.map
|