vxrn 1.27.1 → 2.0.0-beta.45.1
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/cli.mjs +212 -261
- package/dist/cli.mjs.map +1 -1
- package/dist/cli.native.js +216 -265
- package/dist/cli.native.js.map +1 -1
- package/dist/config/getAdditionalViteConfig.mjs +33 -62
- package/dist/config/getAdditionalViteConfig.mjs.map +1 -1
- package/dist/config/getAdditionalViteConfig.native.js +33 -62
- package/dist/config/getAdditionalViteConfig.native.js.map +1 -1
- package/dist/config/getBaseViteConfigOnly.mjs +84 -77
- package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
- package/dist/config/getBaseViteConfigOnly.native.js +86 -79
- package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
- package/dist/config/getBaseViteConfigWithPlugins.mjs +6 -4
- package/dist/config/getBaseViteConfigWithPlugins.mjs.map +1 -1
- package/dist/config/getBaseViteConfigWithPlugins.native.js +6 -4
- package/dist/config/getBaseViteConfigWithPlugins.native.js.map +1 -1
- package/dist/config/getBaseVitePlugins.mjs +102 -130
- package/dist/config/getBaseVitePlugins.mjs.map +1 -1
- package/dist/config/getBaseVitePlugins.native.js +123 -152
- package/dist/config/getBaseVitePlugins.native.js.map +1 -1
- package/dist/config/getNonCliModeOnlyVitePlugins.mjs +3 -3
- package/dist/config/getNonCliModeOnlyVitePlugins.mjs.map +1 -1
- package/dist/config/getNonCliModeOnlyVitePlugins.native.js +3 -1
- package/dist/config/getNonCliModeOnlyVitePlugins.native.js.map +1 -1
- package/dist/config/getOptimizeDeps.mjs +138 -42
- package/dist/config/getOptimizeDeps.mjs.map +1 -1
- package/dist/config/getOptimizeDeps.native.js +138 -42
- package/dist/config/getOptimizeDeps.native.js.map +1 -1
- package/dist/config/getOptionsFilled.mjs +48 -52
- package/dist/config/getOptionsFilled.mjs.map +1 -1
- package/dist/config/getOptionsFilled.native.js +51 -55
- package/dist/config/getOptionsFilled.native.js.map +1 -1
- package/dist/config/getReactNativePlugins.mjs +23 -15
- package/dist/config/getReactNativePlugins.mjs.map +1 -1
- package/dist/config/getReactNativePlugins.native.js +25 -16
- package/dist/config/getReactNativePlugins.native.js.map +1 -1
- package/dist/config/getServerOptionsFilled.mjs +33 -35
- package/dist/config/getServerOptionsFilled.mjs.map +1 -1
- package/dist/config/getServerOptionsFilled.native.js +35 -38
- package/dist/config/getServerOptionsFilled.native.js.map +1 -1
- package/dist/config/getViteServerConfig.mjs +34 -45
- package/dist/config/getViteServerConfig.mjs.map +1 -1
- package/dist/config/getViteServerConfig.native.js +35 -46
- package/dist/config/getViteServerConfig.native.js.map +1 -1
- package/dist/config/mergeUserConfig.mjs +50 -28
- package/dist/config/mergeUserConfig.mjs.map +1 -1
- package/dist/config/mergeUserConfig.native.js +60 -38
- package/dist/config/mergeUserConfig.native.js.map +1 -1
- package/dist/constants/defaults.mjs +29 -12
- package/dist/constants/defaults.mjs.map +1 -1
- package/dist/constants/defaults.native.js +29 -12
- package/dist/constants/defaults.native.js.map +1 -1
- package/dist/constants.mjs +41 -6
- package/dist/constants.mjs.map +1 -1
- package/dist/constants.native.js +41 -6
- package/dist/constants.native.js.map +1 -1
- package/dist/exports/build.mjs +218 -270
- package/dist/exports/build.mjs.map +1 -1
- package/dist/exports/build.native.js +226 -283
- package/dist/exports/build.native.js.map +1 -1
- package/dist/exports/clean.mjs +71 -78
- package/dist/exports/clean.mjs.map +1 -1
- package/dist/exports/clean.native.js +76 -90
- package/dist/exports/clean.native.js.map +1 -1
- package/dist/exports/createServer.mjs +43 -46
- package/dist/exports/createServer.mjs.map +1 -1
- package/dist/exports/createServer.native.js +45 -48
- package/dist/exports/createServer.native.js.map +1 -1
- package/dist/exports/dev.mjs +177 -201
- package/dist/exports/dev.mjs.map +1 -1
- package/dist/exports/dev.native.js +191 -215
- package/dist/exports/dev.native.js.map +1 -1
- package/dist/exports/loadEnv.mjs +51 -48
- package/dist/exports/loadEnv.mjs.map +1 -1
- package/dist/exports/loadEnv.native.js +59 -57
- package/dist/exports/loadEnv.native.js.map +1 -1
- package/dist/exports/patch.mjs +9 -7
- package/dist/exports/patch.mjs.map +1 -1
- package/dist/exports/patch.native.js +9 -7
- package/dist/exports/patch.native.js.map +1 -1
- package/dist/exports/prebuild.mjs +177 -157
- package/dist/exports/prebuild.mjs.map +1 -1
- package/dist/exports/prebuild.native.js +197 -160
- package/dist/exports/prebuild.native.js.map +1 -1
- package/dist/exports/prebuildWithoutExpo.mjs +46 -44
- package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
- package/dist/exports/prebuildWithoutExpo.native.js +48 -46
- package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
- package/dist/exports/runAndroid.mjs +9 -10
- package/dist/exports/runAndroid.mjs.map +1 -1
- package/dist/exports/runAndroid.native.js +10 -11
- package/dist/exports/runAndroid.native.js.map +1 -1
- package/dist/exports/runIos.mjs +9 -10
- package/dist/exports/runIos.mjs.map +1 -1
- package/dist/exports/runIos.native.js +10 -11
- package/dist/exports/runIos.native.js.map +1 -1
- package/dist/exports/serve.mjs +23 -31
- package/dist/exports/serve.mjs.map +1 -1
- package/dist/exports/serve.native.js +26 -34
- package/dist/exports/serve.native.js.map +1 -1
- package/dist/exports/serveStaticAssets.mjs +109 -113
- package/dist/exports/serveStaticAssets.mjs.map +1 -1
- package/dist/exports/serveStaticAssets.native.js +180 -192
- package/dist/exports/serveStaticAssets.native.js.map +1 -1
- package/dist/index.js +25 -14
- package/dist/index.mjs +25 -14
- package/dist/index.native.js +25 -14
- package/dist/patches/builtInDepPatches.mjs +346 -435
- package/dist/patches/builtInDepPatches.mjs.map +1 -1
- package/dist/patches/builtInDepPatches.native.js +349 -438
- package/dist/patches/builtInDepPatches.native.js.map +1 -1
- package/dist/plugins/applyBuiltInPatchesPlugin.mjs +11 -11
- package/dist/plugins/applyBuiltInPatchesPlugin.mjs.map +1 -1
- package/dist/plugins/applyBuiltInPatchesPlugin.native.js +11 -11
- package/dist/plugins/applyBuiltInPatchesPlugin.native.js.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.mjs +87 -90
- package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/autoDepOptimizePlugin.native.js +99 -102
- package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
- package/dist/plugins/clientInjectPlugin.mjs +13 -11
- package/dist/plugins/clientInjectPlugin.mjs.map +1 -1
- package/dist/plugins/clientInjectPlugin.native.js +13 -11
- package/dist/plugins/clientInjectPlugin.native.js.map +1 -1
- package/dist/plugins/defaultDepOptimizePlugin.mjs +15 -23
- package/dist/plugins/defaultDepOptimizePlugin.mjs.map +1 -1
- package/dist/plugins/defaultDepOptimizePlugin.native.js +15 -23
- package/dist/plugins/defaultDepOptimizePlugin.native.js.map +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.mjs +163 -179
- package/dist/plugins/expoManifestRequestHandlerPlugin.mjs.map +1 -1
- package/dist/plugins/expoManifestRequestHandlerPlugin.native.js +169 -191
- package/dist/plugins/expoManifestRequestHandlerPlugin.native.js.map +1 -1
- package/dist/plugins/getResolvedConfigSubset.mjs +6 -5
- package/dist/plugins/getResolvedConfigSubset.mjs.map +1 -1
- package/dist/plugins/getResolvedConfigSubset.native.js +6 -5
- package/dist/plugins/getResolvedConfigSubset.native.js.map +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.mjs +210 -178
- package/dist/plugins/reactNativeCommonJsPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeCommonJsPlugin.native.js +283 -259
- package/dist/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.mjs +72 -83
- package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
- package/dist/plugins/reactNativeDevAssetPlugin.native.js +75 -92
- package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
- package/dist/plugins/reactNativeDevServer.mjs +283 -328
- package/dist/plugins/reactNativeDevServer.mjs.map +1 -1
- package/dist/plugins/reactNativeDevServer.native.js +332 -391
- package/dist/plugins/reactNativeDevServer.native.js.map +1 -1
- package/dist/plugins/rnCodegenPlugin.mjs +13 -12
- package/dist/plugins/rnCodegenPlugin.mjs.map +1 -1
- package/dist/plugins/rnCodegenPlugin.native.js +13 -12
- package/dist/plugins/rnCodegenPlugin.native.js.map +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.mjs +8 -7
- package/dist/plugins/rollupRemoveUnusedImports.mjs.map +1 -1
- package/dist/plugins/rollupRemoveUnusedImports.native.js +8 -7
- package/dist/plugins/rollupRemoveUnusedImports.native.js.map +1 -1
- package/dist/plugins/workletImportsPlugin.mjs +127 -132
- package/dist/plugins/workletImportsPlugin.mjs.map +1 -1
- package/dist/plugins/workletImportsPlugin.native.js +192 -203
- package/dist/plugins/workletImportsPlugin.native.js.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.mjs +45 -79
- package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
- package/dist/rn-commands/bundle/buildBundle.native.js +45 -85
- package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
- package/dist/runtime/hmr-client.mjs +133 -140
- package/dist/runtime/hmr-client.mjs.map +1 -1
- package/dist/runtime/hmr-client.native.js +223 -222
- package/dist/runtime/hmr-client.native.js.map +1 -1
- package/dist/runtime/hmr-runtime.mjs +192 -194
- package/dist/runtime/hmr-runtime.mjs.map +1 -1
- package/dist/runtime/hmr-runtime.native.js +424 -411
- package/dist/runtime/hmr-runtime.native.js.map +1 -1
- package/dist/runtime/hmr-types.mjs +0 -2
- package/dist/runtime/hmr-types.native.js +0 -2
- package/dist/runtime/native-prelude.mjs +2 -1
- package/dist/runtime/native-prelude.mjs.map +1 -1
- package/dist/runtime/native-prelude.native.js +2 -1
- package/dist/runtime/native-prelude.native.js.map +1 -1
- package/dist/runtime/react-refresh-utils.mjs +23 -22
- package/dist/runtime/react-refresh-utils.mjs.map +1 -1
- package/dist/runtime/react-refresh-utils.native.js +23 -27
- package/dist/runtime/react-refresh-utils.native.js.map +1 -1
- package/dist/serve/node.mjs +49 -49
- package/dist/serve/node.mjs.map +1 -1
- package/dist/serve/node.native.js +92 -96
- package/dist/serve/node.native.js.map +1 -1
- package/dist/types.mjs +0 -2
- package/dist/types.native.js +0 -2
- package/dist/user-interface/index.mjs +245 -262
- package/dist/user-interface/index.mjs.map +1 -1
- package/dist/user-interface/index.native.js +274 -298
- package/dist/user-interface/index.native.js.map +1 -1
- package/dist/utils/assert.mjs +7 -6
- package/dist/utils/assert.mjs.map +1 -1
- package/dist/utils/assert.native.js +7 -18
- package/dist/utils/assert.native.js.map +1 -1
- package/dist/utils/bindKeypressInput.mjs +36 -38
- package/dist/utils/bindKeypressInput.mjs.map +1 -1
- package/dist/utils/bindKeypressInput.native.js +36 -38
- package/dist/utils/bindKeypressInput.native.js.map +1 -1
- package/dist/utils/coerceToArray.mjs +2 -1
- package/dist/utils/coerceToArray.mjs.map +1 -1
- package/dist/utils/coerceToArray.native.js +2 -1
- package/dist/utils/coerceToArray.native.js.map +1 -1
- package/dist/utils/connectedNativeClients.mjs +3 -2
- package/dist/utils/connectedNativeClients.mjs.map +1 -1
- package/dist/utils/connectedNativeClients.native.js +3 -2
- package/dist/utils/connectedNativeClients.native.js.map +1 -1
- package/dist/utils/createNativeDevEngine.mjs +992 -966
- package/dist/utils/createNativeDevEngine.mjs.map +1 -1
- package/dist/utils/createNativeDevEngine.native.js +1184 -1179
- package/dist/utils/createNativeDevEngine.native.js.map +1 -1
- package/dist/utils/dispose.mjs +4 -3
- package/dist/utils/dispose.mjs.map +1 -1
- package/dist/utils/dispose.native.js +6 -5
- package/dist/utils/dispose.native.js.map +1 -1
- package/dist/utils/environmentUtils.mjs +5 -4
- package/dist/utils/environmentUtils.mjs.map +1 -1
- package/dist/utils/environmentUtils.native.js +5 -4
- package/dist/utils/environmentUtils.native.js.map +1 -1
- package/dist/utils/execSync.mjs +7 -5
- package/dist/utils/execSync.mjs.map +1 -1
- package/dist/utils/execSync.native.js +8 -6
- package/dist/utils/execSync.native.js.map +1 -1
- package/dist/utils/expoRun.mjs +27 -35
- package/dist/utils/expoRun.mjs.map +1 -1
- package/dist/utils/expoRun.native.js +27 -35
- package/dist/utils/expoRun.native.js.map +1 -1
- package/dist/utils/filterViteServerResolvedUrls.mjs +24 -22
- package/dist/utils/filterViteServerResolvedUrls.mjs.map +1 -1
- package/dist/utils/filterViteServerResolvedUrls.native.js +61 -63
- package/dist/utils/filterViteServerResolvedUrls.native.js.map +1 -1
- package/dist/utils/getBoundPort.mjs +6 -5
- package/dist/utils/getBoundPort.mjs.map +1 -1
- package/dist/utils/getBoundPort.native.js +8 -12
- package/dist/utils/getBoundPort.native.js.map +1 -1
- package/dist/utils/getCacheDir.mjs +3 -1
- package/dist/utils/getCacheDir.mjs.map +1 -1
- package/dist/utils/getCacheDir.native.js +3 -1
- package/dist/utils/getCacheDir.native.js.map +1 -1
- package/dist/utils/getServerEntry.mjs +6 -4
- package/dist/utils/getServerEntry.mjs.map +1 -1
- package/dist/utils/getServerEntry.native.js +8 -11
- package/dist/utils/getServerEntry.native.js.map +1 -1
- package/dist/utils/getVitePath.mjs +42 -42
- package/dist/utils/getVitePath.mjs.map +1 -1
- package/dist/utils/getVitePath.native.js +43 -41
- package/dist/utils/getVitePath.native.js.map +1 -1
- package/dist/utils/globDir.mjs +7 -11
- package/dist/utils/globDir.mjs.map +1 -1
- package/dist/utils/globDir.native.js +10 -14
- package/dist/utils/globDir.native.js.map +1 -1
- package/dist/utils/isWithin.mjs +4 -2
- package/dist/utils/isWithin.mjs.map +1 -1
- package/dist/utils/isWithin.native.js +4 -2
- package/dist/utils/isWithin.native.js.map +1 -1
- package/dist/utils/patches.mjs +233 -255
- package/dist/utils/patches.mjs.map +1 -1
- package/dist/utils/patches.native.js +415 -460
- package/dist/utils/patches.native.js.map +1 -1
- package/dist/utils/printServerUrls.mjs +9 -7
- package/dist/utils/printServerUrls.mjs.map +1 -1
- package/dist/utils/printServerUrls.native.js +48 -51
- package/dist/utils/printServerUrls.native.js.map +1 -1
- package/dist/utils/removeUndefined.mjs +8 -7
- package/dist/utils/removeUndefined.mjs.map +1 -1
- package/dist/utils/removeUndefined.native.js +8 -7
- package/dist/utils/removeUndefined.native.js.map +1 -1
- package/dist/utils/scanDepsToOptimize.mjs +194 -161
- package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
- package/dist/utils/scanDepsToOptimize.native.js +227 -197
- package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
- package/dist/utils/state.mjs +18 -18
- package/dist/utils/state.mjs.map +1 -1
- package/dist/utils/state.native.js +18 -18
- package/dist/utils/state.native.js.map +1 -1
- package/dist/utils/symbolicateNativeStack.mjs +54 -54
- package/dist/utils/symbolicateNativeStack.mjs.map +1 -1
- package/dist/utils/symbolicateNativeStack.native.js +58 -58
- package/dist/utils/symbolicateNativeStack.native.js.map +1 -1
- package/dist/utils/uniq.mjs +2 -1
- package/dist/utils/uniq.mjs.map +1 -1
- package/dist/utils/uniq.native.js +2 -1
- package/dist/utils/uniq.native.js.map +1 -1
- package/dist/utils/utils.mjs +19 -19
- package/dist/utils/utils.mjs.map +1 -1
- package/dist/utils/utils.native.js +38 -40
- package/dist/utils/utils.native.js.map +1 -1
- package/dist/vendor/debugger-app/index.mjs +0 -2
- package/dist/vendor/debugger-app/index.native.js +0 -2
- package/dist/vendor/debugger-app/src/debuggerWorker.mjs +0 -2
- package/dist/vendor/debugger-app/src/debuggerWorker.native.js +0 -2
- package/dist/vendor/debugger-app/src/index.mjs +0 -2
- package/dist/vendor/debugger-app/src/index.native.js +0 -2
- package/dist/vxrn-vite-plugin.mjs +34 -33
- package/dist/vxrn-vite-plugin.mjs.map +1 -1
- package/dist/vxrn-vite-plugin.native.js +35 -34
- package/dist/vxrn-vite-plugin.native.js.map +1 -1
- package/expo-plugin.cjs +12 -6
- package/package.json +12 -13
- package/src/config/getBaseViteConfigOnly.ts +6 -0
- package/src/exports/prebuild.ts +40 -12
- package/src/patches/builtInDepPatches.ts +24 -48
- package/src/utils/createNativeDevEngine.test.ts +1 -1
- package/src/utils/createNativeDevEngine.ts +15 -9
- package/src/utils/scanDepsToOptimize.ts +0 -3
- package/types/config/getBaseViteConfigOnly.d.ts.map +1 -1
- package/types/config/getOptimizeDeps.d.ts.map +1 -1
- package/types/config/getOptionsFilled.d.ts +15 -15
- package/types/config/getOptionsFilled.d.ts.map +1 -1
- package/types/exports/build.d.ts +11 -11
- package/types/exports/build.d.ts.map +1 -1
- package/types/exports/clean.d.ts +1 -1
- package/types/exports/clean.d.ts.map +1 -1
- package/types/exports/createServer.d.ts.map +1 -1
- package/types/exports/dev.d.ts.map +1 -1
- package/types/exports/patch.d.ts.map +1 -1
- package/types/exports/prebuild.d.ts +3 -3
- package/types/exports/prebuild.d.ts.map +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts +1 -1
- package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
- package/types/exports/runAndroid.d.ts.map +1 -1
- package/types/exports/runIos.d.ts.map +1 -1
- package/types/exports/serve.d.ts.map +1 -1
- package/types/patches/builtInDepPatches.d.ts.map +1 -1
- package/types/plugins/autoDepOptimizePlugin.d.ts.map +1 -1
- package/types/plugins/rollupRemoveUnusedImports.d.ts.map +1 -1
- package/types/runtime/hmr-client.d.ts.map +1 -1
- package/types/runtime/hmr-runtime.d.ts.map +1 -1
- package/types/runtime/hmr-types.d.ts.map +1 -1
- package/types/utils/createNativeDevEngine.d.ts +1 -1
- package/types/utils/createNativeDevEngine.d.ts.map +1 -1
- package/types/utils/execSync.d.ts.map +1 -1
- package/types/utils/getServerEntry.d.ts.map +1 -1
- package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
- package/types/vxrn-vite-plugin.d.ts.map +1 -1
- package/dist/config/getOptimizeDeps.test.mjs +0 -20
- package/dist/config/getOptimizeDeps.test.mjs.map +0 -1
- package/dist/config/getOptimizeDeps.test.native.js +0 -39
- package/dist/config/getOptimizeDeps.test.native.js.map +0 -1
- package/dist/config/getServerOptionsFilled.test.mjs +0 -20
- package/dist/config/getServerOptionsFilled.test.mjs.map +0 -1
- package/dist/config/getServerOptionsFilled.test.native.js +0 -20
- package/dist/config/getServerOptionsFilled.test.native.js.map +0 -1
- package/dist/config/getViteServerConfig.test.mjs +0 -26
- package/dist/config/getViteServerConfig.test.mjs.map +0 -1
- package/dist/config/getViteServerConfig.test.native.js +0 -26
- package/dist/config/getViteServerConfig.test.native.js.map +0 -1
- package/dist/config/mergeUserConfig.test.mjs +0 -108
- package/dist/config/mergeUserConfig.test.mjs.map +0 -1
- package/dist/config/mergeUserConfig.test.native.js +0 -108
- package/dist/config/mergeUserConfig.test.native.js.map +0 -1
- package/dist/exports/clean.test.mjs +0 -81
- package/dist/exports/clean.test.mjs.map +0 -1
- package/dist/exports/clean.test.native.js +0 -88
- package/dist/exports/clean.test.native.js.map +0 -1
- package/dist/exports/loadEnv.test.mjs +0 -65
- package/dist/exports/loadEnv.test.mjs.map +0 -1
- package/dist/exports/loadEnv.test.native.js +0 -65
- package/dist/exports/loadEnv.test.native.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/index.native.js.map +0 -1
- package/dist/plugins/autoDepOptimizePlugin.test.mjs +0 -31
- package/dist/plugins/autoDepOptimizePlugin.test.mjs.map +0 -1
- package/dist/plugins/autoDepOptimizePlugin.test.native.js +0 -39
- package/dist/plugins/autoDepOptimizePlugin.test.native.js.map +0 -1
- package/dist/plugins/resolveIdScan.test.mjs +0 -31
- package/dist/plugins/resolveIdScan.test.mjs.map +0 -1
- package/dist/plugins/resolveIdScan.test.native.js +0 -38
- package/dist/plugins/resolveIdScan.test.native.js.map +0 -1
- package/dist/plugins/rnCodegenPlugin.test.mjs +0 -239
- package/dist/plugins/rnCodegenPlugin.test.mjs.map +0 -1
- package/dist/plugins/rnCodegenPlugin.test.native.js +0 -242
- package/dist/plugins/rnCodegenPlugin.test.native.js.map +0 -1
- package/dist/plugins/serverExtensions.test.mjs +0 -106
- package/dist/plugins/serverExtensions.test.mjs.map +0 -1
- package/dist/plugins/serverExtensions.test.native.js +0 -117
- package/dist/plugins/serverExtensions.test.native.js.map +0 -1
- package/dist/runtime/hmr-types.mjs.map +0 -1
- package/dist/runtime/hmr-types.native.js.map +0 -1
- package/dist/serve/node.test.mjs +0 -60
- package/dist/serve/node.test.mjs.map +0 -1
- package/dist/serve/node.test.native.js +0 -72
- package/dist/serve/node.test.native.js.map +0 -1
- package/dist/types.mjs.map +0 -1
- package/dist/types.native.js.map +0 -1
- package/dist/utils/bindKeypressInput.test.mjs +0 -48
- package/dist/utils/bindKeypressInput.test.mjs.map +0 -1
- package/dist/utils/bindKeypressInput.test.native.js +0 -48
- package/dist/utils/bindKeypressInput.test.native.js.map +0 -1
- package/dist/utils/createNativeDevEngine.test.mjs +0 -1788
- package/dist/utils/createNativeDevEngine.test.mjs.map +0 -1
- package/dist/utils/createNativeDevEngine.test.native.js +0 -1942
- package/dist/utils/createNativeDevEngine.test.native.js.map +0 -1
- package/dist/utils/createNativeDevEngineFailure.test.mjs +0 -44
- package/dist/utils/createNativeDevEngineFailure.test.mjs.map +0 -1
- package/dist/utils/createNativeDevEngineFailure.test.native.js +0 -54
- package/dist/utils/createNativeDevEngineFailure.test.native.js.map +0 -1
- package/dist/utils/getBoundPort.test.mjs +0 -71
- package/dist/utils/getBoundPort.test.mjs.map +0 -1
- package/dist/utils/getBoundPort.test.native.js +0 -82
- package/dist/utils/getBoundPort.test.native.js.map +0 -1
- package/dist/utils/imageSizePatch.test.mjs +0 -29
- package/dist/utils/imageSizePatch.test.mjs.map +0 -1
- package/dist/utils/imageSizePatch.test.native.js +0 -30
- package/dist/utils/imageSizePatch.test.native.js.map +0 -1
- package/dist/utils/patches.test.mjs +0 -242
- package/dist/utils/patches.test.mjs.map +0 -1
- package/dist/utils/patches.test.native.js +0 -271
- package/dist/utils/patches.test.native.js.map +0 -1
- package/dist/utils/symbolicateNativeStack.test.mjs +0 -96
- package/dist/utils/symbolicateNativeStack.test.mjs.map +0 -1
- package/dist/utils/symbolicateNativeStack.test.native.js +0 -96
- package/dist/utils/symbolicateNativeStack.test.native.js.map +0 -1
- package/dist/vendor/debugger-app/index.mjs.map +0 -1
- package/dist/vendor/debugger-app/index.native.js.map +0 -1
- package/dist/vendor/debugger-app/src/debuggerWorker.mjs.map +0 -1
- package/dist/vendor/debugger-app/src/debuggerWorker.native.js.map +0 -1
- package/dist/vendor/debugger-app/src/index.mjs.map +0 -1
- package/dist/vendor/debugger-app/src/index.native.js.map +0 -1
- package/types/config/getOptimizeDeps.test.d.ts +0 -2
- package/types/config/getOptimizeDeps.test.d.ts.map +0 -1
- package/types/config/getServerOptionsFilled.test.d.ts +0 -2
- package/types/config/getServerOptionsFilled.test.d.ts.map +0 -1
- package/types/config/getViteServerConfig.test.d.ts +0 -2
- package/types/config/getViteServerConfig.test.d.ts.map +0 -1
- package/types/config/mergeUserConfig.test.d.ts +0 -2
- package/types/config/mergeUserConfig.test.d.ts.map +0 -1
- package/types/exports/clean.test.d.ts +0 -2
- package/types/exports/clean.test.d.ts.map +0 -1
- package/types/exports/loadEnv.test.d.ts +0 -2
- package/types/exports/loadEnv.test.d.ts.map +0 -1
- package/types/plugins/autoDepOptimizePlugin.test.d.ts +0 -2
- package/types/plugins/autoDepOptimizePlugin.test.d.ts.map +0 -1
- package/types/plugins/resolveIdScan.test.d.ts +0 -2
- package/types/plugins/resolveIdScan.test.d.ts.map +0 -1
- package/types/plugins/rnCodegenPlugin.test.d.ts +0 -2
- package/types/plugins/rnCodegenPlugin.test.d.ts.map +0 -1
- package/types/plugins/serverExtensions.test.d.ts +0 -2
- package/types/plugins/serverExtensions.test.d.ts.map +0 -1
- package/types/serve/node.test.d.ts +0 -2
- package/types/serve/node.test.d.ts.map +0 -1
- package/types/utils/bindKeypressInput.test.d.ts +0 -2
- package/types/utils/bindKeypressInput.test.d.ts.map +0 -1
- package/types/utils/createNativeDevEngine.test.d.ts +0 -2
- package/types/utils/createNativeDevEngine.test.d.ts.map +0 -1
- package/types/utils/createNativeDevEngineFailure.test.d.ts +0 -2
- package/types/utils/createNativeDevEngineFailure.test.d.ts.map +0 -1
- package/types/utils/getBoundPort.test.d.ts +0 -2
- package/types/utils/getBoundPort.test.d.ts.map +0 -1
- package/types/utils/imageSizePatch.test.d.ts +0 -2
- package/types/utils/imageSizePatch.test.d.ts.map +0 -1
- package/types/utils/patches.test.d.ts +0 -2
- package/types/utils/patches.test.d.ts.map +0 -1
- package/types/utils/symbolicateNativeStack.test.d.ts +0 -2
- package/types/utils/symbolicateNativeStack.test.d.ts.map +0 -1
|
@@ -3,347 +3,323 @@ import module from "module";
|
|
|
3
3
|
import { pathToFileURL } from "url";
|
|
4
4
|
import { filterViteServerResolvedUrls } from "../utils/filterViteServerResolvedUrls.native.js";
|
|
5
5
|
import { getBoundPort } from "../utils/getBoundPort.native.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
keys: "?",
|
|
95
|
-
label: "open editor",
|
|
96
|
-
terminalLabel: "show this menu",
|
|
97
|
-
action: async function (ctx) {}
|
|
98
|
-
}];
|
|
6
|
+
|
|
7
|
+
var COMMANDS = [
|
|
8
|
+
{
|
|
9
|
+
keys: "ow",
|
|
10
|
+
label: "open web",
|
|
11
|
+
terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1mw\x1B[0meb",
|
|
12
|
+
action: function(ctx) {
|
|
13
|
+
var _ctx_server_resolvedUrls;
|
|
14
|
+
var url = (_ctx_server_resolvedUrls = ctx.server.resolvedUrls) === null || _ctx_server_resolvedUrls === void 0 ? void 0 : _ctx_server_resolvedUrls.local[0];
|
|
15
|
+
if (!url) {
|
|
16
|
+
console.warn("Cannot get the local server URL.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
nativeOpen(url);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
keys: "oi",
|
|
24
|
+
label: "open app in iOS Simulator",
|
|
25
|
+
terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mi\x1B[0mOS Simulator",
|
|
26
|
+
action: function(ctx) {
|
|
27
|
+
openIos(ctx);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
keys: "oa",
|
|
32
|
+
label: "open app in Android Emulator",
|
|
33
|
+
terminalLabel: "\x1B[1mo\x1B[0mpen app in \x1B[1mA\x1B[0mndroid Emulator",
|
|
34
|
+
action: function(ctx) {
|
|
35
|
+
openAndroid(ctx);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
keys: "oe",
|
|
40
|
+
label: "open editor",
|
|
41
|
+
terminalLabel: "\x1B[1mo\x1B[0mpen \x1B[1me\x1B[0mditor",
|
|
42
|
+
action: async function(ctx) {
|
|
43
|
+
var { defaultEditor } = await import("env-editor");
|
|
44
|
+
exec(`${defaultEditor().binary} .`);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
keys: "qr",
|
|
49
|
+
label: "show Expo Go QR code",
|
|
50
|
+
terminalLabel: "show Expo Go \x1B[1mQR\x1B[0m code",
|
|
51
|
+
action: function(ctx) {
|
|
52
|
+
var url = getExpoGoUrl(ctx);
|
|
53
|
+
if (!url) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
printNativeQrCodeAndInstructions(url);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
keys: "dt",
|
|
61
|
+
label: "open React Native DevTools",
|
|
62
|
+
terminalLabel: "open React Native \x1B[1mD\x1B[0mev\x1B[1mT\x1B[0mools",
|
|
63
|
+
action: function(ctx) {
|
|
64
|
+
var { host, port } = ctx.server.config.server;
|
|
65
|
+
var serverUrl = `http://${typeof host === "string" && !!host ? host : "localhost"}:${port}`;
|
|
66
|
+
var url = new URL("/open-debugger", serverUrl);
|
|
67
|
+
(async function() {
|
|
68
|
+
var response = await fetch(url, {
|
|
69
|
+
method: "POST",
|
|
70
|
+
signal: AbortSignal.timeout(3e3)
|
|
71
|
+
}).catch(function(error) {
|
|
72
|
+
if (error.name === "TimeoutError") {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
});
|
|
77
|
+
if (!response) {} else if (response.ok === false) {
|
|
78
|
+
var responseText = await response.text();
|
|
79
|
+
if (responseText.includes("Unable to find debugger target")) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
console.warn(`Failed to open React Native DevTools, ${url} returns ${response.status}: ${responseText}.`);
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
keys: "?",
|
|
89
|
+
label: "open editor",
|
|
90
|
+
terminalLabel: "show this menu",
|
|
91
|
+
action: async function(ctx) {}
|
|
92
|
+
}
|
|
93
|
+
];
|
|
99
94
|
async function startUserInterface(context) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
if (!supportsKeyboardCommands()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
printCommandsTable(context);
|
|
99
|
+
startInterceptingKeyStrokes(context);
|
|
105
100
|
}
|
|
106
101
|
function printCommandsTable(context) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}).join("\n");
|
|
115
|
-
console.info(`
|
|
102
|
+
var longestKeyLength = COMMANDS.reduce(function(max, command) {
|
|
103
|
+
return Math.max(max, command.keys.length);
|
|
104
|
+
}, 0);
|
|
105
|
+
var commandsInfo = COMMANDS.map(function(cmd) {
|
|
106
|
+
return getCommandInfoInTerminal(cmd, { longestKeyLength });
|
|
107
|
+
}).join("\n");
|
|
108
|
+
console.info(`
|
|
116
109
|
${commandsInfo}
|
|
117
110
|
`);
|
|
118
111
|
}
|
|
119
112
|
function getCommandInfoInTerminal(command) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
123
|
-
return `\x1B[90m\u203A\x1B[0m Press \x1B[1m${longestKeyLength ? command.keys.padEnd(longestKeyLength, " ") : command.keys}\x1B[0m \x1B[90m\u2502\x1B[0m ${command.terminalLabel}`;
|
|
113
|
+
var { longestKeyLength = 0 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
114
|
+
return `\x1B[90m\u203A\x1B[0m Press \x1B[1m${longestKeyLength ? command.keys.padEnd(longestKeyLength, " ") : command.keys}\x1B[0m \x1B[90m\u2502\x1B[0m ${command.terminalLabel}`;
|
|
124
115
|
}
|
|
125
116
|
function restoreTerminal() {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
process.stdout.write("\x1B[0m");
|
|
117
|
+
var { stdin } = process;
|
|
118
|
+
if (stdin.isTTY && stdin.setRawMode) {
|
|
119
|
+
try {
|
|
120
|
+
stdin.setRawMode(false);
|
|
121
|
+
} catch (unused) {}
|
|
122
|
+
}
|
|
123
|
+
process.stdout.write("\x1B[0m");
|
|
135
124
|
}
|
|
136
125
|
function supportsKeyboardCommands() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} = process;
|
|
140
|
-
return Boolean(stdin.isTTY && stdin.setRawMode);
|
|
126
|
+
var { stdin } = process;
|
|
127
|
+
return Boolean(stdin.isTTY && stdin.setRawMode);
|
|
141
128
|
}
|
|
142
129
|
function startInterceptingKeyStrokes(context) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
process.exit(0);
|
|
162
|
-
});
|
|
130
|
+
var { stdin } = process;
|
|
131
|
+
if (!supportsKeyboardCommands()) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
stdin.setRawMode(true);
|
|
135
|
+
stdin.resume();
|
|
136
|
+
stdin.setEncoding("utf8");
|
|
137
|
+
stdin.on("data", handleKeypress.bind(null, context));
|
|
138
|
+
stdin.unref();
|
|
139
|
+
process.on("exit", restoreTerminal);
|
|
140
|
+
process.on("SIGINT", function() {
|
|
141
|
+
restoreTerminal();
|
|
142
|
+
process.exit(0);
|
|
143
|
+
});
|
|
144
|
+
process.on("SIGTERM", function() {
|
|
145
|
+
restoreTerminal();
|
|
146
|
+
process.exit(0);
|
|
147
|
+
});
|
|
163
148
|
}
|
|
164
149
|
var pressedKeys = "";
|
|
165
150
|
var clearPressedKeysTimer = null;
|
|
166
151
|
function clearPressedKeys() {
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
pressedKeys = "";
|
|
153
|
+
clearPrintedInfo();
|
|
169
154
|
}
|
|
170
155
|
function resetClearPressedKeysTimer() {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
156
|
+
if (clearPressedKeysTimer) {
|
|
157
|
+
clearTimeout(clearPressedKeysTimer);
|
|
158
|
+
}
|
|
159
|
+
clearPressedKeysTimer = setTimeout(clearPressedKeys, 3e3);
|
|
160
|
+
clearPressedKeysTimer.unref();
|
|
176
161
|
}
|
|
177
162
|
function handleKeypress(context, key) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
163
|
+
if (key === "\x1B") {
|
|
164
|
+
clearPrintedInfo();
|
|
165
|
+
pressedKeys = "";
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (key === "?" || key === "/") {
|
|
169
|
+
clearPrintedInfo();
|
|
170
|
+
console.info("> ?\n⇒ Available commands:");
|
|
171
|
+
printCommandsTable(context);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
resetClearPressedKeysTimer();
|
|
175
|
+
if (key === "") {
|
|
176
|
+
pressedKeys = pressedKeys.slice(0, -1);
|
|
177
|
+
} else {
|
|
178
|
+
key = key.toLowerCase();
|
|
179
|
+
if (/^[a-z]$/.test(key)) {
|
|
180
|
+
pressedKeys += key;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (pressedKeys.length === 0) {
|
|
184
|
+
clearPrintedInfo();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
var matchedCommand = COMMANDS.find(function(command) {
|
|
188
|
+
return command.keys === pressedKeys;
|
|
189
|
+
});
|
|
190
|
+
if (matchedCommand) {
|
|
191
|
+
clearPrintedInfo();
|
|
192
|
+
console.info(`> ${matchedCommand.keys}
|
|
208
193
|
\u21D2 ${matchedCommand.label}...`);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
194
|
+
pressedKeys = "";
|
|
195
|
+
setTimeout(function() {
|
|
196
|
+
var _matchedCommand_action;
|
|
197
|
+
return (_matchedCommand_action = matchedCommand.action) === null || _matchedCommand_action === void 0 ? void 0 : _matchedCommand_action.call(matchedCommand, context);
|
|
198
|
+
}, 500);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (pressedKeys.length >= 3) {
|
|
202
|
+
clearPrintedInfo();
|
|
203
|
+
console.info(`> ${pressedKeys}
|
|
219
204
|
No matching command for "${pressedKeys}"! Press "?" for help.`);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
205
|
+
pressedKeys = "";
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
var possibleCommands = COMMANDS.filter(function(command) {
|
|
209
|
+
return command.keys.startsWith(pressedKeys);
|
|
210
|
+
});
|
|
211
|
+
var commandsInfo = possibleCommands.map(function(command) {
|
|
212
|
+
var matchedPart = command.keys.slice(0, pressedKeys.length);
|
|
213
|
+
var remainingPart = command.keys.slice(pressedKeys.length);
|
|
214
|
+
return ` \x1B[4m${matchedPart}\x1B[0m\x1B[1m${remainingPart}\x1B[0m\x1B[90m - \x1B[0m${command.terminalLabel}`;
|
|
215
|
+
}).join("\n");
|
|
216
|
+
var infoToPrint = `
|
|
232
217
|
${commandsInfo}
|
|
233
218
|
> ${pressedKeys}`;
|
|
234
|
-
|
|
219
|
+
printInfo(infoToPrint);
|
|
235
220
|
}
|
|
236
221
|
var lastPrintedInfo = "";
|
|
237
222
|
function printInfo(info) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
223
|
+
clearPrintedInfo();
|
|
224
|
+
lastPrintedInfo = info;
|
|
225
|
+
process.stdout.write(info);
|
|
241
226
|
}
|
|
242
227
|
function clearPrintedInfo() {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
228
|
+
if (lastPrintedInfo) {
|
|
229
|
+
process.stdout.write("\x1B[2K");
|
|
230
|
+
process.stdout.write("\x1B[1A\x1B[2K".repeat(lastPrintedInfo.split("\n").length - 1));
|
|
231
|
+
process.stdout.write("\x1B[2K");
|
|
232
|
+
process.stdout.write("\x1B[G");
|
|
233
|
+
}
|
|
234
|
+
lastPrintedInfo = "";
|
|
250
235
|
}
|
|
251
236
|
async function printNativeQrCodeAndInstructions(url) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}, function (code) {
|
|
256
|
-
console.info(`To open the app on your iPhone, install the Expo Go app and scan the QR code below with your iPhone camera:
|
|
237
|
+
var qrcode = await import("qrcode-terminal");
|
|
238
|
+
(qrcode.default || qrcode).generate(url, { small: true }, function(code) {
|
|
239
|
+
console.info(`To open the app on your iPhone, install the Expo Go app and scan the QR code below with your iPhone camera:
|
|
257
240
|
${code}`);
|
|
258
|
-
|
|
241
|
+
});
|
|
259
242
|
}
|
|
260
243
|
function nativeOpen(url) {
|
|
261
|
-
|
|
262
|
-
|
|
244
|
+
var start = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
245
|
+
exec(`${start} ${url}`);
|
|
263
246
|
}
|
|
264
247
|
async function openIos(ctx) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
});
|
|
295
|
-
} catch (e) {
|
|
296
|
-
var stack = _instanceof(e, Error) ? e.stack : null;
|
|
297
|
-
console.error(`Failed to open app in iOS Simulator: ${e}${stack ? `
|
|
248
|
+
var projectRoot = ctx.server.config.root;
|
|
249
|
+
var port = getBoundPort(ctx.server);
|
|
250
|
+
try {
|
|
251
|
+
var require2 = module.createRequire(projectRoot);
|
|
252
|
+
var applePlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/ios/ApplePlatformManager.js", { paths: [projectRoot] });
|
|
253
|
+
var applePlatformManagerModule = await import(pathToFileURL(applePlatformManagerModuleImportPath).href);
|
|
254
|
+
var PlatformManager = applePlatformManagerModule.default.ApplePlatformManager;
|
|
255
|
+
var platformManager = new PlatformManager(projectRoot, port, {
|
|
256
|
+
/** Expo Go URL. */
|
|
257
|
+
getExpoGoUrl: function() {
|
|
258
|
+
return getExpoGoUrl(ctx);
|
|
259
|
+
},
|
|
260
|
+
/** Get the base URL for the dev server hosting this platform manager. */
|
|
261
|
+
getDevServerUrl: function() {
|
|
262
|
+
return null;
|
|
263
|
+
},
|
|
264
|
+
/** Get redirect URL for native disambiguation. */
|
|
265
|
+
getRedirectUrl: function() {
|
|
266
|
+
return null;
|
|
267
|
+
},
|
|
268
|
+
/** Dev Client */
|
|
269
|
+
getCustomRuntimeUrl: function(props) {
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
await platformManager.openAsync({ runtime: "expo" });
|
|
274
|
+
} catch (e) {
|
|
275
|
+
var stack = e instanceof Error ? e.stack : null;
|
|
276
|
+
console.error(`Failed to open app in iOS Simulator: ${e}${stack ? `
|
|
298
277
|
${stack}` : ""}`);
|
|
299
|
-
|
|
278
|
+
}
|
|
300
279
|
}
|
|
301
280
|
async function openAndroid(ctx) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
});
|
|
332
|
-
} catch (e) {
|
|
333
|
-
var stack = _instanceof(e, Error) ? e.stack : null;
|
|
334
|
-
console.error(`Failed to open app in Android Emulator: ${e}${stack ? `
|
|
281
|
+
var projectRoot = ctx.server.config.root;
|
|
282
|
+
var port = getBoundPort(ctx.server);
|
|
283
|
+
try {
|
|
284
|
+
var require2 = module.createRequire(projectRoot);
|
|
285
|
+
var androidPlatformManagerModuleImportPath = require2.resolve("@expo/cli/build/src/start/platforms/android/AndroidPlatformManager.js", { paths: [projectRoot] });
|
|
286
|
+
var androidPlatformManagerModule = await import(pathToFileURL(androidPlatformManagerModuleImportPath).href);
|
|
287
|
+
var PlatformManager = androidPlatformManagerModule.default.AndroidPlatformManager;
|
|
288
|
+
var platformManager = new PlatformManager(projectRoot, port, {
|
|
289
|
+
/** Expo Go URL. */
|
|
290
|
+
getExpoGoUrl: function() {
|
|
291
|
+
return getExpoGoUrl(ctx);
|
|
292
|
+
},
|
|
293
|
+
/** Get the base URL for the dev server hosting this platform manager. */
|
|
294
|
+
getDevServerUrl: function() {
|
|
295
|
+
return null;
|
|
296
|
+
},
|
|
297
|
+
/** Get redirect URL for native disambiguation. */
|
|
298
|
+
getRedirectUrl: function() {
|
|
299
|
+
return null;
|
|
300
|
+
},
|
|
301
|
+
/** Dev Client */
|
|
302
|
+
getCustomRuntimeUrl: function(props) {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
await platformManager.openAsync({ runtime: "expo" });
|
|
307
|
+
} catch (e) {
|
|
308
|
+
var stack = e instanceof Error ? e.stack : null;
|
|
309
|
+
console.error(`Failed to open app in Android Emulator: ${e}${stack ? `
|
|
335
310
|
${stack}` : ""}`);
|
|
336
|
-
|
|
311
|
+
}
|
|
337
312
|
}
|
|
338
313
|
function getExpoGoUrl(ctx) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
314
|
+
var _filterViteServerResolvedUrls;
|
|
315
|
+
var urls = (_filterViteServerResolvedUrls = filterViteServerResolvedUrls(ctx.server.resolvedUrls)) === null || _filterViteServerResolvedUrls === void 0 ? void 0 : _filterViteServerResolvedUrls.network;
|
|
316
|
+
var url = urls === null || urls === void 0 ? void 0 : urls[urls.length - 1];
|
|
317
|
+
if (!url) {
|
|
318
|
+
console.warn("Cannot get the local server URL.");
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
return url.replace(/^https?/, "exp");
|
|
347
322
|
}
|
|
323
|
+
|
|
348
324
|
export { startUserInterface };
|
|
349
325
|
//# sourceMappingURL=index.native.js.map
|