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
|
@@ -9,508 +9,463 @@ import { rename } from "fs/promises";
|
|
|
9
9
|
import semver from "semver";
|
|
10
10
|
import { builtInDepPatches } from "../patches/builtInDepPatches.native.js";
|
|
11
11
|
import { globDir } from "./globDir.native.js";
|
|
12
|
+
|
|
12
13
|
function _assert_this_initialized(self) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (self === void 0) {
|
|
15
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
16
|
+
}
|
|
17
|
+
return self;
|
|
17
18
|
}
|
|
18
19
|
function _call_super(_this, derived, args) {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
derived = _get_prototype_of(derived);
|
|
21
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
21
22
|
}
|
|
22
23
|
function _class_call_check(instance, Constructor) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (!(instance instanceof Constructor)) {
|
|
25
|
+
throw new TypeError("Cannot call a class as a function");
|
|
26
|
+
}
|
|
26
27
|
}
|
|
27
28
|
function _construct(Parent, args, Class) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
if (_is_native_reflect_construct()) {
|
|
30
|
+
_construct = Reflect.construct;
|
|
31
|
+
} else {
|
|
32
|
+
_construct = function construct(Parent2, args2, Class2) {
|
|
33
|
+
var a = [null];
|
|
34
|
+
a.push.apply(a, args2);
|
|
35
|
+
var Constructor = Function.bind.apply(Parent2, a);
|
|
36
|
+
var instance = new Constructor();
|
|
37
|
+
if (Class2) _set_prototype_of(instance, Class2.prototype);
|
|
38
|
+
return instance;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return _construct.apply(null, arguments);
|
|
41
42
|
}
|
|
42
43
|
function _get_prototype_of(o) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
|
|
45
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
46
|
+
};
|
|
47
|
+
return _get_prototype_of(o);
|
|
47
48
|
}
|
|
48
49
|
function _inherits(subClass, superClass) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
60
|
-
}
|
|
61
|
-
function _instanceof(left, right) {
|
|
62
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
63
|
-
return !!right[Symbol.hasInstance](left);
|
|
64
|
-
} else {
|
|
65
|
-
return left instanceof right;
|
|
66
|
-
}
|
|
50
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
51
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
52
|
+
}
|
|
53
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {
|
|
54
|
+
value: subClass,
|
|
55
|
+
writable: true,
|
|
56
|
+
configurable: true
|
|
57
|
+
} });
|
|
58
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
67
59
|
}
|
|
68
60
|
function _is_native_function(fn) {
|
|
69
|
-
|
|
61
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
70
62
|
}
|
|
71
63
|
function _possible_constructor_return(self, call) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
65
|
+
return call;
|
|
66
|
+
}
|
|
67
|
+
return _assert_this_initialized(self);
|
|
76
68
|
}
|
|
77
69
|
function _set_prototype_of(o, p) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
|
|
71
|
+
o2.__proto__ = p2;
|
|
72
|
+
return o2;
|
|
73
|
+
};
|
|
74
|
+
return _set_prototype_of(o, p);
|
|
83
75
|
}
|
|
84
76
|
function _type_of(obj) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
77
|
+
"@swc/helpers - typeof";
|
|
78
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
88
79
|
}
|
|
89
80
|
function _wrap_native_super(Class) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
return _wrap_native_super(Class);
|
|
81
|
+
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
82
|
+
_wrap_native_super = function wrapNativeSuper(Class2) {
|
|
83
|
+
if (Class2 === null || !_is_native_function(Class2)) return Class2;
|
|
84
|
+
if (typeof Class2 !== "function") {
|
|
85
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
86
|
+
}
|
|
87
|
+
if (typeof _cache !== "undefined") {
|
|
88
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
89
|
+
_cache.set(Class2, Wrapper);
|
|
90
|
+
}
|
|
91
|
+
function Wrapper() {
|
|
92
|
+
return _construct(Class2, arguments, _get_prototype_of(this).constructor);
|
|
93
|
+
}
|
|
94
|
+
Wrapper.prototype = Object.create(Class2.prototype, { constructor: {
|
|
95
|
+
value: Wrapper,
|
|
96
|
+
enumerable: false,
|
|
97
|
+
writable: true,
|
|
98
|
+
configurable: true
|
|
99
|
+
} });
|
|
100
|
+
return _set_prototype_of(Wrapper, Class2);
|
|
101
|
+
};
|
|
102
|
+
return _wrap_native_super(Class);
|
|
114
103
|
}
|
|
115
104
|
function _is_native_reflect_construct() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
105
|
+
try {
|
|
106
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
107
|
+
} catch (_) {}
|
|
108
|
+
return (_is_native_reflect_construct = function() {
|
|
109
|
+
return !!result;
|
|
110
|
+
})();
|
|
122
111
|
}
|
|
123
|
-
var Bail = /* @__PURE__ */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}(_wrap_native_super(Error));
|
|
112
|
+
var Bail = /* @__PURE__ */ (function(Error1) {
|
|
113
|
+
"use strict";
|
|
114
|
+
_inherits(Bail2, Error1);
|
|
115
|
+
function Bail2() {
|
|
116
|
+
_class_call_check(this, Bail2);
|
|
117
|
+
return _call_super(this, Bail2, arguments);
|
|
118
|
+
}
|
|
119
|
+
return Bail2;
|
|
120
|
+
})(_wrap_native_super(Error));
|
|
133
121
|
function bailIfUnchanged(obj1, obj2) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
if (JSON.stringify(obj1) === JSON.stringify(obj2)) {
|
|
123
|
+
throw new Bail();
|
|
124
|
+
}
|
|
137
125
|
}
|
|
138
126
|
function bailIfExists(haystack, needle) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
if (haystack.includes(needle)) {
|
|
128
|
+
throw new Bail();
|
|
129
|
+
}
|
|
142
130
|
}
|
|
143
131
|
async function applyBuiltInPatches(options, extraPatches) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
root: options.root
|
|
169
|
-
});
|
|
132
|
+
var all = [...builtInDepPatches];
|
|
133
|
+
if (extraPatches) {
|
|
134
|
+
var _loop = function(key2) {
|
|
135
|
+
var extraPatchFiles = extraPatches[key2];
|
|
136
|
+
var existing = all.find(function(x) {
|
|
137
|
+
return x.module === key2;
|
|
138
|
+
});
|
|
139
|
+
if (existing) {
|
|
140
|
+
for (var patchKey in extraPatchFiles) {
|
|
141
|
+
if (existing.patchFiles[patchKey]) {
|
|
142
|
+
console.warn(`Warning: Overwriting One built-in patch with user patch`, key2, patchKey);
|
|
143
|
+
}
|
|
144
|
+
existing.patchFiles[patchKey] = extraPatchFiles[patchKey];
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
all.push({
|
|
148
|
+
module: key2,
|
|
149
|
+
patchFiles: extraPatchFiles
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
for (var key in extraPatches) _loop(key);
|
|
154
|
+
}
|
|
155
|
+
await applyDependencyPatches(all, { root: options.root });
|
|
170
156
|
}
|
|
171
157
|
var STATS_FILE = ".vxrn.patch-stats.json";
|
|
172
158
|
function getOriginalPath(fullPath) {
|
|
173
|
-
|
|
159
|
+
return fullPath + ".vxrn.original";
|
|
174
160
|
}
|
|
175
161
|
async function readPatchStats(nodeModulesDir) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
162
|
+
try {
|
|
163
|
+
return await FSExtra.readJSON(join(nodeModulesDir, STATS_FILE));
|
|
164
|
+
} catch (unused) {
|
|
165
|
+
return {};
|
|
166
|
+
}
|
|
181
167
|
}
|
|
182
168
|
async function writePatchStats(nodeModulesDir, stats) {
|
|
183
|
-
|
|
169
|
+
await FSExtra.writeJSON(join(nodeModulesDir, STATS_FILE), stats);
|
|
184
170
|
}
|
|
185
171
|
function moduleToPnpmStorePattern(moduleName) {
|
|
186
|
-
|
|
172
|
+
return moduleName.replace("/", "+");
|
|
187
173
|
}
|
|
188
174
|
async function applyDependencyPatches(patches) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
}));
|
|
479
|
-
if (statsChanged) {
|
|
480
|
-
await writePatchStats(nodeModulesDir, patchStats);
|
|
481
|
-
}
|
|
482
|
-
}));
|
|
483
|
-
var _iteratorNormalCompletion = true,
|
|
484
|
-
_didIteratorError = false,
|
|
485
|
-
_iteratorError = void 0;
|
|
486
|
-
try {
|
|
487
|
-
for (var _iterator = results[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
488
|
-
var [module, result] = _step.value;
|
|
489
|
-
if (result === "applied") {
|
|
490
|
-
console.info(` \u{1FA79} ${module}`);
|
|
491
|
-
} else if (result === "ok" && process.env.VXRN_FORCE_PATCH) {
|
|
492
|
-
console.info(` \u2713 ${module}`);
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
} catch (err) {
|
|
496
|
-
_didIteratorError = true;
|
|
497
|
-
_iteratorError = err;
|
|
498
|
-
} finally {
|
|
499
|
-
try {
|
|
500
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
501
|
-
_iterator.return();
|
|
502
|
-
}
|
|
503
|
-
} finally {
|
|
504
|
-
if (_didIteratorError) {
|
|
505
|
-
throw _iteratorError;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
175
|
+
var { root = process.cwd() } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
176
|
+
var patchModuleNames = [...new Set(patches.map(function(p) {
|
|
177
|
+
return p.module;
|
|
178
|
+
}))];
|
|
179
|
+
var nodeModulesDirs = findNodeModules({ cwd: root }).flatMap(function(relativePath) {
|
|
180
|
+
var dir = join(root, relativePath);
|
|
181
|
+
var dirs = [dir];
|
|
182
|
+
var pnpmBase = join(dir, ".pnpm");
|
|
183
|
+
if (!FSExtra.existsSync(pnpmBase)) return dirs;
|
|
184
|
+
var pnpmHoistedDir = join(pnpmBase, "node_modules");
|
|
185
|
+
if (FSExtra.existsSync(pnpmHoistedDir)) {
|
|
186
|
+
dirs.push(pnpmHoistedDir);
|
|
187
|
+
}
|
|
188
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
189
|
+
try {
|
|
190
|
+
for (var _iterator2 = patchModuleNames[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
191
|
+
var moduleName = _step2.value;
|
|
192
|
+
var storePattern = moduleToPnpmStorePattern(moduleName);
|
|
193
|
+
var storeMatches = Glob.sync(`${storePattern}@*/node_modules`, {
|
|
194
|
+
cwd: pnpmBase,
|
|
195
|
+
onlyDirectories: true
|
|
196
|
+
});
|
|
197
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
198
|
+
try {
|
|
199
|
+
for (var _iterator1 = storeMatches[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
200
|
+
var match = _step1.value;
|
|
201
|
+
dirs.push(join(pnpmBase, match));
|
|
202
|
+
}
|
|
203
|
+
} catch (err) {
|
|
204
|
+
_didIteratorError1 = true;
|
|
205
|
+
_iteratorError1 = err;
|
|
206
|
+
} finally {
|
|
207
|
+
try {
|
|
208
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
209
|
+
_iterator1.return();
|
|
210
|
+
}
|
|
211
|
+
} finally {
|
|
212
|
+
if (_didIteratorError1) {
|
|
213
|
+
throw _iteratorError1;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
} catch (err) {
|
|
219
|
+
_didIteratorError2 = true;
|
|
220
|
+
_iteratorError2 = err;
|
|
221
|
+
} finally {
|
|
222
|
+
try {
|
|
223
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
224
|
+
_iterator2.return();
|
|
225
|
+
}
|
|
226
|
+
} finally {
|
|
227
|
+
if (_didIteratorError2) {
|
|
228
|
+
throw _iteratorError2;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return dirs;
|
|
233
|
+
});
|
|
234
|
+
var results = /* @__PURE__ */ new Map();
|
|
235
|
+
var transformWarnedModules = /* @__PURE__ */ new Set();
|
|
236
|
+
var patchedRealPaths = /* @__PURE__ */ new Set();
|
|
237
|
+
await Promise.all(nodeModulesDirs.map(async function(nodeModulesDir) {
|
|
238
|
+
var patchStats = await readPatchStats(nodeModulesDir);
|
|
239
|
+
var statsChanged = false;
|
|
240
|
+
await Promise.all(patches.map(async function(patch) {
|
|
241
|
+
try {
|
|
242
|
+
var nodeModuleDir = join(nodeModulesDir, patch.module);
|
|
243
|
+
if (!FSExtra.existsSync(nodeModuleDir)) return;
|
|
244
|
+
var realModuleDir;
|
|
245
|
+
try {
|
|
246
|
+
realModuleDir = realpathSync(nodeModuleDir);
|
|
247
|
+
} catch (unused) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
var patchIdx = patches.indexOf(patch);
|
|
251
|
+
var dedupKey = `${patchIdx}\0${realModuleDir}`;
|
|
252
|
+
if (patchedRealPaths.has(dedupKey)) return;
|
|
253
|
+
patchedRealPaths.add(dedupKey);
|
|
254
|
+
var version = patch.patchFiles.version;
|
|
255
|
+
if (typeof version === "string") {
|
|
256
|
+
var pkgJSON = await FSExtra.readJSON(join(nodeModuleDir, "package.json"));
|
|
257
|
+
if (!semver.satisfies(pkgJSON.version, version)) return;
|
|
258
|
+
}
|
|
259
|
+
var filePatches = [];
|
|
260
|
+
for (var file in patch.patchFiles) {
|
|
261
|
+
if (file === "version") continue;
|
|
262
|
+
var filesToApply = file.includes("*") ? globDir(nodeModuleDir, file) : [file];
|
|
263
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
264
|
+
try {
|
|
265
|
+
for (var _iterator2 = filesToApply[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
266
|
+
var relativePath = _step2.value;
|
|
267
|
+
filePatches.push({
|
|
268
|
+
relativePath,
|
|
269
|
+
patchDefinition: patch.patchFiles[file]
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
} catch (err) {
|
|
273
|
+
_didIteratorError2 = true;
|
|
274
|
+
_iteratorError2 = err;
|
|
275
|
+
} finally {
|
|
276
|
+
try {
|
|
277
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
278
|
+
_iterator2.return();
|
|
279
|
+
}
|
|
280
|
+
} finally {
|
|
281
|
+
if (_didIteratorError2) {
|
|
282
|
+
throw _iteratorError2;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
var fileStatsResults = await Promise.all(filePatches.map(async function(param) {
|
|
288
|
+
var { relativePath: relativePath2 } = param;
|
|
289
|
+
var fullPath = join(nodeModuleDir, relativePath2);
|
|
290
|
+
try {
|
|
291
|
+
var stat = await FSExtra.stat(fullPath);
|
|
292
|
+
return {
|
|
293
|
+
relativePath: relativePath2,
|
|
294
|
+
fullPath,
|
|
295
|
+
stat,
|
|
296
|
+
exists: true
|
|
297
|
+
};
|
|
298
|
+
} catch (unused) {
|
|
299
|
+
return {
|
|
300
|
+
relativePath: relativePath2,
|
|
301
|
+
fullPath,
|
|
302
|
+
stat: null,
|
|
303
|
+
exists: false
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}));
|
|
307
|
+
var filesToProcess = fileStatsResults.filter(function(param) {
|
|
308
|
+
var { fullPath, stat, exists } = param;
|
|
309
|
+
if (!exists || !stat) return false;
|
|
310
|
+
if (process.env.VXRN_FORCE_PATCH) return true;
|
|
311
|
+
var cached = patchStats[fullPath];
|
|
312
|
+
if (!cached) return true;
|
|
313
|
+
return stat.size !== cached.size || stat.mtimeMs !== cached.mtimeMs;
|
|
314
|
+
});
|
|
315
|
+
if (filesToProcess.length === 0) {
|
|
316
|
+
if (!results.has(patch.module)) {
|
|
317
|
+
results.set(patch.module, "ok");
|
|
318
|
+
}
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
var didApplyPatch = false;
|
|
322
|
+
await Promise.all(filesToProcess.map(async function(param) {
|
|
323
|
+
var { relativePath: relativePath2, fullPath } = param;
|
|
324
|
+
try {
|
|
325
|
+
var patchDef = filePatches.find(function(p) {
|
|
326
|
+
return p.relativePath === relativePath2;
|
|
327
|
+
}).patchDefinition;
|
|
328
|
+
var originalPath = getOriginalPath(fullPath);
|
|
329
|
+
var [targetContent, originalContent] = await Promise.all([FSExtra.readFile(fullPath, "utf-8"), FSExtra.readFile(originalPath, "utf-8").catch(function() {
|
|
330
|
+
return null;
|
|
331
|
+
})]);
|
|
332
|
+
var sourceContent = originalContent !== null && originalContent !== void 0 ? originalContent : targetContent;
|
|
333
|
+
var patchedContent = null;
|
|
334
|
+
if (typeof patchDef === "string") {
|
|
335
|
+
patchedContent = patchDef;
|
|
336
|
+
} else if (Array.isArray(patchDef)) {
|
|
337
|
+
try {
|
|
338
|
+
var contents = sourceContent;
|
|
339
|
+
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
340
|
+
try {
|
|
341
|
+
for (var _iterator3 = patchDef[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
342
|
+
var strategy = _step3.value;
|
|
343
|
+
if (strategy === "flow") {
|
|
344
|
+
contents = await transformFlowBabel(contents);
|
|
345
|
+
}
|
|
346
|
+
if (strategy === "swc" || strategy === "jsx") {
|
|
347
|
+
var _this;
|
|
348
|
+
contents = ((_this = await transformSWC(fullPath, contents, {
|
|
349
|
+
mode: "build",
|
|
350
|
+
environment: "ios",
|
|
351
|
+
forceJSX: strategy === "jsx",
|
|
352
|
+
noHMR: true,
|
|
353
|
+
fixNonTypeSpecificImports: true,
|
|
354
|
+
production: true
|
|
355
|
+
})) === null || _this === void 0 ? void 0 : _this.code) || contents;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} catch (err) {
|
|
359
|
+
_didIteratorError3 = true;
|
|
360
|
+
_iteratorError3 = err;
|
|
361
|
+
} finally {
|
|
362
|
+
try {
|
|
363
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
364
|
+
_iterator3.return();
|
|
365
|
+
}
|
|
366
|
+
} finally {
|
|
367
|
+
if (_didIteratorError3) {
|
|
368
|
+
throw _iteratorError3;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (contents !== sourceContent) {
|
|
373
|
+
patchedContent = contents;
|
|
374
|
+
}
|
|
375
|
+
} catch (transformErr) {
|
|
376
|
+
if (!transformWarnedModules.has(patch.module)) {
|
|
377
|
+
var _ref;
|
|
378
|
+
transformWarnedModules.add(patch.module);
|
|
379
|
+
console.warn(` \u26A0 Patch transform failed for ${patch.module} in ${relativePath2}, skipping non-critical patch: ${(_ref = transformErr === null || transformErr === void 0 ? void 0 : transformErr.stack) !== null && _ref !== void 0 ? _ref : transformErr}`);
|
|
380
|
+
}
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
var out = await patchDef(sourceContent);
|
|
385
|
+
if (typeof out === "string" && out !== sourceContent) {
|
|
386
|
+
patchedContent = out;
|
|
387
|
+
} else if (typeof out === "string") {
|
|
388
|
+
console.warn(`[vxrn] patch for ${patch.module} matched nothing in ${relativePath2} \u2014 it is stale and is no longer protecting anything`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (patchedContent !== null) {
|
|
392
|
+
if (targetContent === patchedContent) {
|
|
393
|
+
var stat = await FSExtra.stat(fullPath);
|
|
394
|
+
patchStats[fullPath] = {
|
|
395
|
+
size: stat.size,
|
|
396
|
+
mtimeMs: stat.mtimeMs
|
|
397
|
+
};
|
|
398
|
+
statsChanged = true;
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
await Promise.all([originalContent === null && atomicWriteFile(originalPath, sourceContent), atomicWriteFile(fullPath, patchedContent)]);
|
|
402
|
+
var stat1 = await FSExtra.stat(fullPath);
|
|
403
|
+
patchStats[fullPath] = {
|
|
404
|
+
size: stat1.size,
|
|
405
|
+
mtimeMs: stat1.mtimeMs
|
|
406
|
+
};
|
|
407
|
+
statsChanged = true;
|
|
408
|
+
didApplyPatch = true;
|
|
409
|
+
if (process.env.DEBUG) {
|
|
410
|
+
console.info(` - Applied patch to ${patch.module}: ${relativePath2}`);
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
var stat2 = await FSExtra.stat(fullPath);
|
|
414
|
+
patchStats[fullPath] = {
|
|
415
|
+
size: stat2.size,
|
|
416
|
+
mtimeMs: stat2.mtimeMs
|
|
417
|
+
};
|
|
418
|
+
statsChanged = true;
|
|
419
|
+
}
|
|
420
|
+
} catch (err) {
|
|
421
|
+
if (err instanceof Bail) return;
|
|
422
|
+
throw err;
|
|
423
|
+
}
|
|
424
|
+
}));
|
|
425
|
+
if (didApplyPatch) {
|
|
426
|
+
results.set(patch.module, "applied");
|
|
427
|
+
} else if (!results.has(patch.module)) {
|
|
428
|
+
results.set(patch.module, "ok");
|
|
429
|
+
}
|
|
430
|
+
} catch (err) {
|
|
431
|
+
console.error(`\u{1F6A8} Error applying patch to`, patch.module);
|
|
432
|
+
console.error(err);
|
|
433
|
+
}
|
|
434
|
+
}));
|
|
435
|
+
if (statsChanged) {
|
|
436
|
+
await writePatchStats(nodeModulesDir, patchStats);
|
|
437
|
+
}
|
|
438
|
+
}));
|
|
439
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
440
|
+
try {
|
|
441
|
+
for (var _iterator = results[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
442
|
+
var [module, result] = _step.value;
|
|
443
|
+
if (result === "applied") {
|
|
444
|
+
console.info(` \u{1FA79} ${module}`);
|
|
445
|
+
} else if (result === "ok" && process.env.VXRN_FORCE_PATCH) {
|
|
446
|
+
console.info(` \u2713 ${module}`);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
} catch (err) {
|
|
450
|
+
_didIteratorError = true;
|
|
451
|
+
_iteratorError = err;
|
|
452
|
+
} finally {
|
|
453
|
+
try {
|
|
454
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
455
|
+
_iterator.return();
|
|
456
|
+
}
|
|
457
|
+
} finally {
|
|
458
|
+
if (_didIteratorError) {
|
|
459
|
+
throw _iteratorError;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
509
463
|
}
|
|
510
464
|
async function atomicWriteFile(filePath, contents) {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
465
|
+
var tempPath = filePath + ".vxrn.tmp." + process.pid + "." + Date.now();
|
|
466
|
+
await FSExtra.writeFile(tempPath, contents);
|
|
467
|
+
await rename(tempPath, filePath);
|
|
514
468
|
}
|
|
469
|
+
|
|
515
470
|
export { applyBuiltInPatches, applyDependencyPatches, bailIfExists, bailIfUnchanged, moduleToPnpmStorePattern };
|
|
516
471
|
//# sourceMappingURL=patches.native.js.map
|