one 1.2.53 → 1.2.55
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/cjs/cli/build.cjs +11 -5
- package/dist/cjs/cli/build.js +11 -4
- package/dist/cjs/cli/build.js.map +1 -1
- package/dist/cjs/cli/build.native.js +9 -2
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/cjs/createApp.cjs +11 -11
- package/dist/cjs/createApp.js +5 -4
- package/dist/cjs/createApp.js.map +1 -1
- package/dist/cjs/getDevServer.native.js.map +1 -1
- package/dist/cjs/image/getImageData.cjs +91 -0
- package/dist/cjs/image/getImageData.js +64 -0
- package/dist/cjs/image/getImageData.js.map +6 -0
- package/dist/cjs/image/getImageData.native.js +95 -0
- package/dist/cjs/image/getImageData.native.js.map +1 -0
- package/dist/cjs/image.cjs +26 -0
- package/dist/cjs/image.js +21 -0
- package/dist/cjs/image.js.map +6 -0
- package/dist/cjs/image.native.js +29 -0
- package/dist/cjs/image.native.js.map +1 -0
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +3 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +2 -2
- package/dist/cjs/metro-config/getViteMetroPluginOptions.js +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +2 -2
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/cjs/router/Route.js.map +1 -1
- package/dist/cjs/router/Route.native.js.map +1 -1
- package/dist/cjs/router/getRoutes.cjs +2 -2
- package/dist/cjs/router/getRoutes.js +1 -2
- package/dist/cjs/router/getRoutes.js.map +1 -1
- package/dist/cjs/router/getRoutes.native.js.map +1 -1
- package/dist/cjs/router/matchers.test.js +7 -1
- package/dist/cjs/router/matchers.test.js.map +1 -1
- package/dist/cjs/router/matchers.test.native.js.map +1 -1
- package/dist/cjs/router/useScreens.js +25 -5
- package/dist/cjs/router/useScreens.js.map +1 -1
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/cjs/router/useViteRoutes.cjs +1 -1
- package/dist/cjs/router/useViteRoutes.js +1 -1
- package/dist/cjs/router/useViteRoutes.js.map +1 -1
- package/dist/cjs/router/useViteRoutes.native.js.map +1 -1
- package/dist/cjs/server/getServerManifest.js +3 -1
- package/dist/cjs/server/getServerManifest.js.map +1 -1
- package/dist/cjs/server/getServerManifest.native.js.map +1 -1
- package/dist/cjs/server/oneServe.js +7 -2
- package/dist/cjs/server/oneServe.js.map +1 -1
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/typed-routes/generateRouteTypes.cjs +2 -2
- package/dist/cjs/typed-routes/generateRouteTypes.js +1 -1
- package/dist/cjs/typed-routes/generateRouteTypes.js.map +1 -1
- package/dist/cjs/typed-routes/generateRouteTypes.native.js +2 -2
- package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.cjs +2 -2
- package/dist/cjs/typed-routes/injectRouteHelpers.js +1 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.js.map +1 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.native.js +2 -2
- package/dist/cjs/typed-routes/injectRouteHelpers.native.js.map +1 -1
- package/dist/cjs/ui/TabSlot.cjs +1 -1
- package/dist/cjs/ui/TabSlot.js +1 -1
- package/dist/cjs/ui/TabSlot.js.map +1 -1
- package/dist/cjs/ui/TabSlot.native.js +2 -2
- package/dist/cjs/ui/TabSlot.native.js.map +1 -1
- package/dist/cjs/ui/TabTrigger.cjs +1 -1
- package/dist/cjs/ui/TabTrigger.js +1 -1
- package/dist/cjs/ui/TabTrigger.js.map +1 -1
- package/dist/cjs/ui/TabTrigger.native.js +1 -1
- package/dist/cjs/ui/TabTrigger.native.js.map +1 -1
- package/dist/cjs/ui/Tabs.cjs +7 -7
- package/dist/cjs/ui/Tabs.js +5 -2
- package/dist/cjs/ui/Tabs.js.map +1 -1
- package/dist/cjs/ui/Tabs.native.js +7 -7
- package/dist/cjs/ui/Tabs.native.js.map +1 -1
- package/dist/cjs/ui/common.cjs +1 -1
- package/dist/cjs/ui/common.js +1 -1
- package/dist/cjs/ui/common.js.map +1 -1
- package/dist/cjs/ui/common.native.js +1 -1
- package/dist/cjs/ui/common.native.js.map +1 -1
- package/dist/cjs/useLoader.cjs +1 -0
- package/dist/cjs/useLoader.js +1 -0
- package/dist/cjs/useLoader.js.map +1 -1
- package/dist/cjs/useLoader.native.js +1 -0
- package/dist/cjs/useLoader.native.js.map +1 -1
- package/dist/cjs/utils/promiseWithResolvers.cjs +4 -5
- package/dist/cjs/utils/promiseWithResolvers.js +2 -1
- package/dist/cjs/utils/promiseWithResolvers.js.map +1 -1
- package/dist/cjs/utils/promiseWithResolvers.native.js.map +1 -1
- package/dist/cjs/utils/trackLoaderDependencies.cjs +51 -0
- package/dist/cjs/utils/trackLoaderDependencies.js +40 -0
- package/dist/cjs/utils/trackLoaderDependencies.js.map +6 -0
- package/dist/cjs/utils/trackLoaderDependencies.native.js +57 -0
- package/dist/cjs/utils/trackLoaderDependencies.native.js.map +1 -0
- package/dist/cjs/utils/watchFile.cjs +35 -0
- package/dist/cjs/utils/watchFile.js +30 -0
- package/dist/cjs/utils/watchFile.js.map +6 -0
- package/dist/cjs/utils/watchFile.native.js +39 -0
- package/dist/cjs/utils/watchFile.native.js.map +1 -0
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.js.map +1 -1
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.cjs +2 -4
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.js +2 -4
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.js.map +1 -1
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js +2 -4
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js.map +1 -1
- package/dist/cjs/vite/DevHead.cjs +22 -0
- package/dist/cjs/vite/DevHead.js +26 -0
- package/dist/cjs/vite/DevHead.js.map +1 -1
- package/dist/cjs/vite/one.cjs +5 -4
- package/dist/cjs/vite/one.js +2 -1
- package/dist/cjs/vite/one.js.map +1 -1
- package/dist/cjs/vite/one.native.js +5 -4
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.cjs +7 -7
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js +2 -3
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js +4 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.cjs +34 -7
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js +43 -7
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js.map +2 -2
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +82 -21
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/imageDataPlugin.cjs +70 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.js +55 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.js.map +6 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.native.js +77 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.native.js.map +1 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.test.cjs +214 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.test.js +184 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.test.js.map +6 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js +228 -0
- package/dist/cjs/vite/plugins/imageDataPlugin.test.native.js.map +1 -0
- package/dist/cjs/zero/useQuery.cjs +2 -2
- package/dist/cjs/zero/useQuery.js +1 -2
- package/dist/cjs/zero/useQuery.js.map +1 -1
- package/dist/cjs/zero/useQuery.native.js.map +1 -1
- package/dist/esm/cli/build.js +11 -4
- package/dist/esm/cli/build.js.map +1 -1
- package/dist/esm/cli/build.mjs +10 -4
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +8 -1
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.js +1 -1
- package/dist/esm/cli/buildPage.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs +1 -1
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +1 -1
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.js +1 -1
- package/dist/esm/cli/generateSitemap.test.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.mjs +1 -1
- package/dist/esm/cli/generateSitemap.test.mjs.map +1 -1
- package/dist/esm/cli/generateSitemap.test.native.js +1 -1
- package/dist/esm/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/esm/createApp.js +5 -4
- package/dist/esm/createApp.js.map +1 -1
- package/dist/esm/createApp.mjs +11 -11
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/getDevServer.native.js.map +1 -1
- package/dist/esm/image/getImageData.js +41 -0
- package/dist/esm/image/getImageData.js.map +6 -0
- package/dist/esm/image/getImageData.mjs +55 -0
- package/dist/esm/image/getImageData.mjs.map +1 -0
- package/dist/esm/image/getImageData.native.js +56 -0
- package/dist/esm/image/getImageData.native.js.map +1 -0
- package/dist/esm/image.js +5 -0
- package/dist/esm/image.js.map +6 -0
- package/dist/esm/image.mjs +3 -0
- package/dist/esm/image.mjs.map +1 -0
- package/dist/esm/image.native.js +3 -0
- package/dist/esm/image.native.js.map +1 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.js +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/router/Route.js.map +1 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/getRoutes.js +1 -2
- package/dist/esm/router/getRoutes.js.map +1 -1
- package/dist/esm/router/getRoutes.mjs +2 -2
- package/dist/esm/router/getRoutes.mjs.map +1 -1
- package/dist/esm/router/getRoutes.native.js.map +1 -1
- package/dist/esm/router/matchers.test.js +7 -1
- package/dist/esm/router/matchers.test.js.map +1 -1
- package/dist/esm/router/matchers.test.mjs.map +1 -1
- package/dist/esm/router/matchers.test.native.js.map +1 -1
- package/dist/esm/router/router.js +1 -1
- package/dist/esm/router/router.js.map +1 -1
- package/dist/esm/router/router.mjs +1 -1
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js +1 -1
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/router/useScreens.js +25 -5
- package/dist/esm/router/useScreens.js.map +1 -1
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/router/useViteRoutes.js +1 -1
- package/dist/esm/router/useViteRoutes.js.map +1 -1
- package/dist/esm/router/useViteRoutes.mjs +1 -1
- package/dist/esm/router/useViteRoutes.mjs.map +1 -1
- package/dist/esm/router/useViteRoutes.native.js.map +1 -1
- package/dist/esm/serve-worker.js +1 -1
- package/dist/esm/serve-worker.mjs +1 -1
- package/dist/esm/serve-worker.mjs.map +1 -1
- package/dist/esm/serve-worker.native.js +1 -1
- package/dist/esm/serve-worker.native.js.map +1 -1
- package/dist/esm/server/getServerManifest.js +3 -1
- package/dist/esm/server/getServerManifest.js.map +1 -1
- package/dist/esm/server/getServerManifest.mjs.map +1 -1
- package/dist/esm/server/getServerManifest.native.js.map +1 -1
- package/dist/esm/server/oneServe.js +7 -2
- package/dist/esm/server/oneServe.js.map +1 -1
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.js +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.js.map +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.mjs +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.mjs.map +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.js +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.js.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.mjs +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.mjs.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.native.js +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.native.js.map +1 -1
- package/dist/esm/ui/Slot.js.map +1 -1
- package/dist/esm/ui/Slot.mjs.map +1 -1
- package/dist/esm/ui/Slot.native.js.map +1 -1
- package/dist/esm/ui/TabList.js +1 -1
- package/dist/esm/ui/TabList.js.map +1 -1
- package/dist/esm/ui/TabList.mjs +1 -1
- package/dist/esm/ui/TabList.mjs.map +1 -1
- package/dist/esm/ui/TabList.native.js +1 -1
- package/dist/esm/ui/TabList.native.js.map +1 -1
- package/dist/esm/ui/TabRouter.js.map +1 -1
- package/dist/esm/ui/TabRouter.mjs.map +1 -1
- package/dist/esm/ui/TabRouter.native.js.map +1 -1
- package/dist/esm/ui/TabSlot.js +2 -2
- package/dist/esm/ui/TabSlot.js.map +1 -1
- package/dist/esm/ui/TabSlot.mjs +2 -2
- package/dist/esm/ui/TabSlot.mjs.map +1 -1
- package/dist/esm/ui/TabSlot.native.js +2 -2
- package/dist/esm/ui/TabSlot.native.js.map +1 -1
- package/dist/esm/ui/TabTrigger.js +3 -3
- package/dist/esm/ui/TabTrigger.js.map +1 -1
- package/dist/esm/ui/TabTrigger.mjs +2 -2
- package/dist/esm/ui/TabTrigger.mjs.map +1 -1
- package/dist/esm/ui/TabTrigger.native.js +2 -2
- package/dist/esm/ui/TabTrigger.native.js.map +1 -1
- package/dist/esm/ui/Tabs.js +10 -7
- package/dist/esm/ui/Tabs.js.map +1 -1
- package/dist/esm/ui/Tabs.mjs +6 -6
- package/dist/esm/ui/Tabs.mjs.map +1 -1
- package/dist/esm/ui/Tabs.native.js +6 -6
- package/dist/esm/ui/Tabs.native.js.map +1 -1
- package/dist/esm/ui/common.js +3 -3
- package/dist/esm/ui/common.js.map +1 -1
- package/dist/esm/ui/common.mjs +1 -1
- package/dist/esm/ui/common.mjs.map +1 -1
- package/dist/esm/ui/common.native.js +1 -1
- package/dist/esm/ui/common.native.js.map +1 -1
- package/dist/esm/ui/useComponent.js +1 -1
- package/dist/esm/ui/useComponent.js.map +1 -1
- package/dist/esm/ui/useComponent.mjs +1 -1
- package/dist/esm/ui/useComponent.mjs.map +1 -1
- package/dist/esm/ui/useComponent.native.js +1 -1
- package/dist/esm/ui/useComponent.native.js.map +1 -1
- package/dist/esm/useLoader.js +1 -0
- package/dist/esm/useLoader.js.map +1 -1
- package/dist/esm/useLoader.mjs +1 -0
- package/dist/esm/useLoader.mjs.map +1 -1
- package/dist/esm/useLoader.native.js +1 -0
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/utils/cleanUrl.js +1 -1
- package/dist/esm/utils/cleanUrl.mjs +1 -1
- package/dist/esm/utils/cleanUrl.mjs.map +1 -1
- package/dist/esm/utils/cleanUrl.native.js +1 -1
- package/dist/esm/utils/cleanUrl.native.js.map +1 -1
- package/dist/esm/utils/promiseWithResolvers.js +2 -1
- package/dist/esm/utils/promiseWithResolvers.js.map +1 -1
- package/dist/esm/utils/promiseWithResolvers.mjs +4 -5
- package/dist/esm/utils/promiseWithResolvers.mjs.map +1 -1
- package/dist/esm/utils/promiseWithResolvers.native.js.map +1 -1
- package/dist/esm/utils/trackLoaderDependencies.js +25 -0
- package/dist/esm/utils/trackLoaderDependencies.js.map +6 -0
- package/dist/esm/utils/trackLoaderDependencies.mjs +28 -0
- package/dist/esm/utils/trackLoaderDependencies.mjs.map +1 -0
- package/dist/esm/utils/trackLoaderDependencies.native.js +31 -0
- package/dist/esm/utils/trackLoaderDependencies.native.js.map +1 -0
- package/dist/esm/utils/watchFile.js +14 -0
- package/dist/esm/utils/watchFile.js.map +6 -0
- package/dist/esm/utils/watchFile.mjs +11 -0
- package/dist/esm/utils/watchFile.mjs.map +1 -0
- package/dist/esm/utils/watchFile.native.js +12 -0
- package/dist/esm/utils/watchFile.native.js.map +1 -0
- package/dist/esm/vercel/build/buildVercelOutputDirectory.js.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.mjs.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/esm/vercel/build/config/vc-build-output-config-base.js +2 -4
- package/dist/esm/vercel/build/config/vc-build-output-config-base.js.map +1 -1
- package/dist/esm/vercel/build/config/vc-build-output-config-base.mjs +2 -4
- package/dist/esm/vercel/build/config/vc-build-output-config-base.mjs.map +1 -1
- package/dist/esm/vercel/build/config/vc-build-output-config-base.native.js +2 -4
- package/dist/esm/vercel/build/config/vc-build-output-config-base.native.js.map +1 -1
- package/dist/esm/vite/DevHead.js +26 -0
- package/dist/esm/vite/DevHead.js.map +1 -1
- package/dist/esm/vite/DevHead.mjs +22 -0
- package/dist/esm/vite/DevHead.mjs.map +1 -1
- package/dist/esm/vite/one.js +4 -2
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +4 -3
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +4 -3
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.js +2 -3
- package/dist/esm/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.mjs +7 -7
- package/dist/esm/vite/plugins/SSRCSSPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js +4 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js +43 -6
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js.map +2 -2
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs +34 -7
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +82 -21
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/imageDataPlugin.js +41 -0
- package/dist/esm/vite/plugins/imageDataPlugin.js.map +6 -0
- package/dist/esm/vite/plugins/imageDataPlugin.mjs +47 -0
- package/dist/esm/vite/plugins/imageDataPlugin.mjs.map +1 -0
- package/dist/esm/vite/plugins/imageDataPlugin.native.js +51 -0
- package/dist/esm/vite/plugins/imageDataPlugin.native.js.map +1 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.js +165 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.js.map +6 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.mjs +193 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.mjs.map +1 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.native.js +204 -0
- package/dist/esm/vite/plugins/imageDataPlugin.test.native.js.map +1 -0
- package/dist/esm/zero/useQuery.js +1 -2
- package/dist/esm/zero/useQuery.js.map +1 -1
- package/dist/esm/zero/useQuery.mjs +2 -2
- package/dist/esm/zero/useQuery.mjs.map +1 -1
- package/dist/esm/zero/useQuery.native.js.map +1 -1
- package/package.json +19 -10
- package/src/cli/build.ts +18 -3
- package/src/cli/buildPage.ts +1 -1
- package/src/cli/generateSitemap.test.ts +2 -2
- package/src/createApp.native.tsx +1 -1
- package/src/createApp.tsx +5 -3
- package/src/createMiddleware.ts +1 -1
- package/src/getDevServer.native.ts +0 -2
- package/src/image/getImageData.ts +104 -0
- package/src/image.ts +1 -0
- package/src/index.ts +20 -1
- package/src/interfaces/router.ts +6 -2
- package/src/metro-config/getViteMetroPluginOptions.ts +2 -2
- package/src/router/Route.tsx +5 -1
- package/src/router/getRoutes.ts +1 -1
- package/src/router/matchers.test.ts +8 -2
- package/src/router/router.ts +1 -1
- package/src/router/useScreens.tsx +19 -3
- package/src/router/useViteRoutes.tsx +1 -1
- package/src/serve-worker.ts +1 -1
- package/src/server/getServerManifest.ts +3 -1
- package/src/server/oneServe.ts +9 -4
- package/src/typed-routes/generateRouteTypes.ts +2 -2
- package/src/typed-routes/injectRouteHelpers.ts +1 -1
- package/src/ui/Slot.tsx +3 -3
- package/src/ui/TabList.tsx +2 -2
- package/src/ui/TabRouter.tsx +2 -2
- package/src/ui/TabSlot.tsx +2 -3
- package/src/ui/TabTrigger.tsx +8 -9
- package/src/ui/Tabs.tsx +15 -13
- package/src/ui/common.tsx +5 -6
- package/src/ui/useComponent.tsx +1 -1
- package/src/useLoader.ts +4 -0
- package/src/utils/cleanUrl.ts +1 -1
- package/src/utils/promiseWithResolvers.ts +1 -1
- package/src/utils/trackLoaderDependencies.ts +53 -0
- package/src/utils/watchFile.ts +19 -0
- package/src/vercel/build/buildVercelOutputDirectory.ts +1 -1
- package/src/vercel/build/config/vc-build-output-config-base.ts +2 -4
- package/src/vite/DevHead.tsx +23 -0
- package/src/vite/one.ts +5 -2
- package/src/vite/plugins/SSRCSSPlugin.ts +2 -2
- package/src/vite/plugins/clientTreeShakePlugin.ts +4 -1
- package/src/vite/plugins/fileSystemRouterPlugin.tsx +76 -3
- package/src/vite/plugins/imageDataPlugin.test.ts +316 -0
- package/src/vite/plugins/imageDataPlugin.ts +89 -0
- package/src/vite/types.ts +1 -1
- package/src/zero/useQuery.ts +1 -1
- package/types/cli/build.d.ts.map +1 -1
- package/types/createApp.d.ts.map +1 -1
- package/types/createMiddleware.d.ts +1 -2
- package/types/createMiddleware.d.ts.map +1 -1
- package/types/env.d.ts +23 -0
- package/types/getDevServer.native.d.ts.map +1 -1
- package/types/image/getImageData.d.ts +34 -0
- package/types/image/getImageData.d.ts.map +1 -0
- package/types/image.d.ts +2 -0
- package/types/image.d.ts.map +1 -0
- package/types/index.d.ts +19 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/router.d.ts.map +1 -1
- package/types/layouts/Drawer.d.ts +2 -2
- package/types/layouts/Stack.d.ts +2 -2
- package/types/layouts/Tabs.d.ts +2 -2
- package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
- package/types/router/Route.d.ts.map +1 -1
- package/types/serve-worker.d.ts +1 -1
- package/types/server/getServerManifest.d.ts.map +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/ui/Slot.d.ts +1 -1
- package/types/ui/Slot.d.ts.map +1 -1
- package/types/ui/TabList.d.ts +1 -1
- package/types/ui/TabList.d.ts.map +1 -1
- package/types/ui/TabRouter.d.ts +1 -1
- package/types/ui/TabRouter.d.ts.map +1 -1
- package/types/ui/TabSlot.d.ts.map +1 -1
- package/types/ui/TabTrigger.d.ts +3 -3
- package/types/ui/TabTrigger.d.ts.map +1 -1
- package/types/ui/Tabs.d.ts +17 -2
- package/types/ui/Tabs.d.ts.map +1 -1
- package/types/ui/common.d.ts +2 -2
- package/types/ui/common.d.ts.map +1 -1
- package/types/ui/useComponent.d.ts.map +1 -1
- package/types/useLoader.d.ts.map +1 -1
- package/types/utils/trackLoaderDependencies.d.ts +6 -0
- package/types/utils/trackLoaderDependencies.d.ts.map +1 -0
- package/types/utils/watchFile.d.ts +8 -0
- package/types/utils/watchFile.d.ts.map +1 -0
- package/types/vercel/build/config/vc-build-output-config-base.d.ts +0 -1
- package/types/vercel/build/config/vc-build-output-config-base.d.ts.map +1 -1
- package/types/vite/DevHead.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/clientTreeShakePlugin.d.ts.map +1 -1
- package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
- package/types/vite/plugins/imageDataPlugin.d.ts +3 -0
- package/types/vite/plugins/imageDataPlugin.d.ts.map +1 -0
- package/types/vite/plugins/imageDataPlugin.test.d.ts +2 -0
- package/types/vite/plugins/imageDataPlugin.test.d.ts.map +1 -0
- package/types/vite/types.d.ts +1 -1
- package/types/vite/types.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","getServerContext","getQueryKey","resolveZeroQuery","useQuery","useQueryZero","clientInitialData","postRenderData","serverQueryData","globalThis","__vxrnServerData__","promises","WeakMap","query","enable","snapshot","queryIdRef","current","queryId","window","promise","get","value","promise2","Promise","res","rej","then","val","catch","err","set"],"sources":["../../../src/zero/useQuery.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,SAASC,WAAA,QAAmB;AAC5B,SAASC,gBAAA,QAAwB;AACjC,SAASC,QAAA,IAAYC,YAAA,QAAoB;AAEzC,
|
|
1
|
+
{"version":3,"names":["useRef","getServerContext","getQueryKey","resolveZeroQuery","useQuery","useQueryZero","clientInitialData","postRenderData","serverQueryData","globalThis","__vxrnServerData__","promises","WeakMap","query","enable","snapshot","queryIdRef","current","queryId","window","promise","get","value","promise2","Promise","res","rej","then","val","catch","err","set"],"sources":["../../../src/zero/useQuery.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,SAASC,WAAA,QAAmB;AAC5B,SAASC,gBAAA,QAAwB;AACjC,SAASC,QAAA,IAAYC,YAAA,QAAoB;AAEzC,MAAMC,iBAAA,GAAmCL,gBAAA,CAAiB,GAAGM,cAAA;EAGvDC,eAAA,GAAkB,CAAC;AAGzBC,UAAA,CAAWC,kBAAA,GAAwBF,eAAA;AAEnC,MAAMG,QAAA,GAAW,mBAAIC,OAAA,CAAQ;EAMhBR,QAAA,GAAYA,CAACS,KAAA,EAAYC,MAAA,GAAS,OAAS;IACtD,MAAMC,QAAA,GAAWV,YAAA,CAAaQ,KAAA,EAAOC,MAAM;MAErCE,UAAA,GAAahB,MAAA,CAA2B,MAAS;IACnDa,KAAA,IAAS,CAACG,UAAA,CAAWC,OAAA,KACvBD,UAAA,CAAWC,OAAA,GAAUf,WAAA,CAAYW,KAAK;IAExC,MAAMK,OAAA,GAAUF,UAAA,CAAWC,OAAA,IAAW;IAKtC,IAA+C,OAAOE,MAAA,GAAW,KAAa;MAC5E,IAAI,CAACN,KAAA,EAAO,OAAO,EAAC;MACpB,MAAMO,OAAA,GAAUT,QAAA,CAASU,GAAA,CAAIR,KAAK;QAC5BS,KAAA,GAAQd,eAAA,CAAgBU,OAAO;MACrC,IAAII,KAAA,EAAO,OAAOA,KAAA;MAElB,IAAI,CAACF,OAAA,EAAS;QACZ,MAAMG,QAAA,GAAU,IAAIC,OAAA,CAAc,CAACC,GAAA,EAAKC,GAAA,KAAQ;UAC9CvB,gBAAA,CAAiBU,KAAK,EACnBc,IAAA,CAAMC,GAAA,IAAQ;YACbpB,eAAA,CAAgBU,OAAO,IAAIU,GAAA,EAC3BH,GAAA,CAAI;UACN,CAAC,EACAI,KAAA,CAAOC,GAAA,IAAQ;YACdnB,QAAA,CAASoB,GAAA,CAAIlB,KAAA,EAAO,IAAI,GACxBa,GAAA,CAAII,GAAG;UACT,CAAC;QACL,CAAC;QACD,MAAAnB,QAAA,CAASoB,GAAA,CAAIlB,KAAA,EAAOU,QAAO,GACrBA,QAAA;MACR;MAEA,IAAIH,OAAA,EAAS,MAAMA,OAAA;MAEnB,OAAO,EAAC;IACV;IAEA,OAAId,iBAAA,IAAqB,CAACS,QAAA,GACjBT,iBAAA,CAAkBY,OAAO,KAAK,EAAC,GAGjCH,QAAA,IAAY,EAAC;EACtB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","getServerContext","getQueryKey","useQuery","useQueryZero","_getServerContext","clientInitialData","postRenderData","serverQueryData","globalThis","__vxrnServerData__","query","enable","arguments","length","snapshot","queryIdRef","current","queryId","promise","value","promise1"],"sources":["../../../src/zero/useQuery.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,SAASC,WAAA,QAAmB;AAC5B,iCAAS;AACT,SAASC,QAAA,IAAYC,YAAA,QAAoB;AAEzC,
|
|
1
|
+
{"version":3,"names":["useRef","getServerContext","getQueryKey","useQuery","useQueryZero","_getServerContext","clientInitialData","postRenderData","serverQueryData","globalThis","__vxrnServerData__","query","enable","arguments","length","snapshot","queryIdRef","current","queryId","promise","value","promise1"],"sources":["../../../src/zero/useQuery.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,gBAAA,QAAwB;AACjC,SAASC,WAAA,QAAmB;AAC5B,iCAAS;AACT,SAASC,QAAA,IAAYC,YAAA,QAAoB;AAEzC,IAAAC,iBAAM;EAAAC,iBAAmC,GAAiB,CAAAD,iBAAG,GAGvDJ,gBAAkB,CAAC,eAAAI,iBAAA,uBAAAA,iBAAA,CAAAE,cAAA;EAAAC,eAAA;AAGzBC,UAAA,CAAWC,kBAAA,GAAwBF,eAAA;AAEnC,IAAAL,QAAM,YAAAA,CAAWQ,KAAA;EAOf,IAAAC,MAAM,GAAAC,SAAW,CAAAC,MAAA,GAAa,KAAOD,SAE/B,aAAa,IAAAA,SAAoC;IAAAE,QAAA,GAAAX,YAAA,CAAAO,KAAA,EAAAC,MAAA;IAAAI,UAAA,GAAAhB,MAAA;EACnDW,KAAA,IAAS,CAACK,UAAA,CAAWC,OAAA,KACvBD,UAAA,CAAWC,OAAA,GAAUf,WAAA,CAAYS,KAAK;EAExC,IAAAO,OAAM,GAAAF,UAAU,CAAAC,OAAW,MAAW;EAKtC,IAA+C;IAC7C,IAAIE,OAAQ,EAAAC,KAAA;IACZ,KAAAD,OAAM,EAEN,IAAIE,QAAO;EAEX;EACE,OAAAf,iBAAgB,IAAI,CAAAS,QAAe,GAAKT,iBAAQ,CAAAY,OAAA,UAAAH,QAAA;AAC9C;AAEI,SACIZ,QACL","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.55",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"setup.mjs",
|
|
@@ -86,6 +86,11 @@
|
|
|
86
86
|
},
|
|
87
87
|
"./env": {
|
|
88
88
|
"types": "./types/env.d.ts"
|
|
89
|
+
},
|
|
90
|
+
"./image": {
|
|
91
|
+
"types": "./types/image.d.ts",
|
|
92
|
+
"import": "./dist/esm/image.mjs",
|
|
93
|
+
"require": "./dist/cjs/image.js"
|
|
89
94
|
}
|
|
90
95
|
},
|
|
91
96
|
"main": "dist/cjs",
|
|
@@ -130,17 +135,17 @@
|
|
|
130
135
|
"@react-navigation/routers": "~7.5.1",
|
|
131
136
|
"@swc/core": "^1.14.0",
|
|
132
137
|
"@ungap/structured-clone": "^1.2.0",
|
|
133
|
-
"@vxrn/color-scheme": "1.2.
|
|
134
|
-
"@vxrn/compiler": "1.2.
|
|
135
|
-
"@vxrn/resolve": "1.2.
|
|
136
|
-
"@vxrn/tslib-lite": "1.2.
|
|
137
|
-
"@vxrn/use-isomorphic-layout-effect": "1.2.
|
|
138
|
-
"@vxrn/vite-plugin-metro": "1.2.
|
|
138
|
+
"@vxrn/color-scheme": "1.2.55",
|
|
139
|
+
"@vxrn/compiler": "1.2.55",
|
|
140
|
+
"@vxrn/resolve": "1.2.55",
|
|
141
|
+
"@vxrn/tslib-lite": "1.2.55",
|
|
142
|
+
"@vxrn/use-isomorphic-layout-effect": "1.2.55",
|
|
143
|
+
"@vxrn/vite-plugin-metro": "1.2.55",
|
|
139
144
|
"babel-dead-code-elimination": "^1.0.10",
|
|
140
145
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
141
146
|
"citty": "^0.1.6",
|
|
142
147
|
"core-js": "^3.38.1",
|
|
143
|
-
"create-vxrn": "1.2.
|
|
148
|
+
"create-vxrn": "1.2.55",
|
|
144
149
|
"escape-string-regexp": "^5.0.0",
|
|
145
150
|
"expo-linking": "~8.0.8",
|
|
146
151
|
"expo-modules-core": "~3.0.24",
|
|
@@ -166,7 +171,7 @@
|
|
|
166
171
|
"vite": "^7.1.12",
|
|
167
172
|
"vite-plugin-barrel": "^0.4.1",
|
|
168
173
|
"vite-tsconfig-paths": "^5.1.4",
|
|
169
|
-
"vxrn": "1.2.
|
|
174
|
+
"vxrn": "1.2.55",
|
|
170
175
|
"ws": "^8.18.0",
|
|
171
176
|
"xxhashjs": "^0.2.2"
|
|
172
177
|
},
|
|
@@ -174,11 +179,15 @@
|
|
|
174
179
|
"@react-navigation/native": "~7.1.0",
|
|
175
180
|
"react-native": "*",
|
|
176
181
|
"react-native-safe-area-context": "~5.6.1",
|
|
177
|
-
"react-native-screens": "~4.16.0"
|
|
182
|
+
"react-native-screens": "~4.16.0",
|
|
183
|
+
"sharp": ">=0.33.0"
|
|
178
184
|
},
|
|
179
185
|
"peerDependenciesMeta": {
|
|
180
186
|
"react-native": {
|
|
181
187
|
"optional": true
|
|
188
|
+
},
|
|
189
|
+
"sharp": {
|
|
190
|
+
"optional": true
|
|
182
191
|
}
|
|
183
192
|
},
|
|
184
193
|
"devDependencies": {
|
package/src/cli/build.ts
CHANGED
|
@@ -17,6 +17,7 @@ import * as constants from '../constants'
|
|
|
17
17
|
import { setServerGlobals } from '../server/setServerGlobals'
|
|
18
18
|
import { getPathnameFromFilePath } from '../utils/getPathnameFromFilePath'
|
|
19
19
|
import { getRouterRootFromOneOptions } from '../utils/getRouterRootFromOneOptions'
|
|
20
|
+
import { isRolldown } from '../utils/isRolldown'
|
|
20
21
|
import { toAbsolute } from '../utils/toAbsolute'
|
|
21
22
|
import { buildVercelOutputDirectory } from '../vercel/build/buildVercelOutputDirectory'
|
|
22
23
|
import { getManifest } from '../vite/getManifest'
|
|
@@ -27,7 +28,6 @@ import { buildPage } from './buildPage'
|
|
|
27
28
|
import { checkNodeVersion } from './checkNodeVersion'
|
|
28
29
|
import { generateSitemap, type RouteSitemapData } from './generateSitemap'
|
|
29
30
|
import { labelProcess } from './label-process'
|
|
30
|
-
import { isRolldown } from '../utils/isRolldown'
|
|
31
31
|
|
|
32
32
|
const { ensureDir, writeJSON } = FSExtra
|
|
33
33
|
|
|
@@ -616,7 +616,7 @@ export async function build(args: {
|
|
|
616
616
|
} = route
|
|
617
617
|
|
|
618
618
|
routeToBuildInfo[route.routeFile] = rest
|
|
619
|
-
for (
|
|
619
|
+
for (const p of getCleanPaths([route.path, route.cleanPath])) {
|
|
620
620
|
pathToRoute[p] = route.routeFile
|
|
621
621
|
}
|
|
622
622
|
preloads[route.preloadPath] = true
|
|
@@ -675,7 +675,7 @@ export async function build(args: {
|
|
|
675
675
|
console.info(`\n 📄 generated sitemap.xml (${sitemapData.length} URLs)\n`)
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
|
|
678
|
+
const postBuildLogs: string[] = []
|
|
679
679
|
|
|
680
680
|
const platform = oneOptions.web?.deploy
|
|
681
681
|
|
|
@@ -685,6 +685,21 @@ export async function build(args: {
|
|
|
685
685
|
|
|
686
686
|
switch (platform) {
|
|
687
687
|
case 'vercel': {
|
|
688
|
+
// Check for cleanUrls in vercel.json - required for SSG direct URL access
|
|
689
|
+
const vercelJsonPath = join(options.root, 'vercel.json')
|
|
690
|
+
if (FSExtra.existsSync(vercelJsonPath)) {
|
|
691
|
+
try {
|
|
692
|
+
const vercelConfig = JSON.parse(FSExtra.readFileSync(vercelJsonPath, 'utf-8'))
|
|
693
|
+
if (!vercelConfig.cleanUrls) {
|
|
694
|
+
console.warn(`\n ⚠️ Warning: Your vercel.json is missing "cleanUrls": true`)
|
|
695
|
+
console.warn(` Without this, direct navigation to SSG pages will 404.`)
|
|
696
|
+
console.warn(` Add "cleanUrls": true to your vercel.json to fix this.\n`)
|
|
697
|
+
}
|
|
698
|
+
} catch {
|
|
699
|
+
// ignore parse errors
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
688
703
|
await buildVercelOutputDirectory({
|
|
689
704
|
apiOutput,
|
|
690
705
|
buildInfoForWriting,
|
package/src/cli/buildPage.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { join } from 'node:path'
|
|
|
2
2
|
import FSExtra from 'fs-extra'
|
|
3
3
|
import * as constants from '../constants'
|
|
4
4
|
import type { LoaderProps, RenderApp } from '../types'
|
|
5
|
-
import { getLoaderPath,
|
|
5
|
+
import { getLoaderPath, getPreloadCSSPath, getPreloadPath } from '../utils/cleanUrl'
|
|
6
6
|
import { isResponse } from '../utils/isResponse'
|
|
7
7
|
import { toAbsolute } from '../utils/toAbsolute'
|
|
8
8
|
import { replaceLoader } from '../vite/replaceLoader'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { generateSitemap, type RouteSitemapData } from './generateSitemap'
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
3
2
|
import type { One } from '../vite/types'
|
|
3
|
+
import { generateSitemap, type RouteSitemapData } from './generateSitemap'
|
|
4
4
|
|
|
5
5
|
describe('generateSitemap', () => {
|
|
6
6
|
let originalEnv: string | undefined
|
package/src/createApp.native.tsx
CHANGED
package/src/createApp.tsx
CHANGED
|
@@ -3,8 +3,8 @@ import './setup'
|
|
|
3
3
|
import { cloneElement } from 'react'
|
|
4
4
|
import { AppRegistry } from 'react-native'
|
|
5
5
|
import { resolveClientLoader } from './clientLoaderResolver'
|
|
6
|
-
import { render } from './render'
|
|
7
6
|
import { Root } from './Root'
|
|
7
|
+
import { render } from './render'
|
|
8
8
|
import { registerPreloadedRoute } from './router/useViteRoutes'
|
|
9
9
|
import type { RenderAppProps } from './types'
|
|
10
10
|
import { getServerHeadInsertions } from './useServerHeadInsertion'
|
|
@@ -36,7 +36,7 @@ export function createApp(options: CreateAppProps) {
|
|
|
36
36
|
ReactDOMServer.default?.renderToStaticMarkup
|
|
37
37
|
const renderToString = serverRender.renderToString
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
const {
|
|
40
40
|
loaderData,
|
|
41
41
|
loaderProps,
|
|
42
42
|
css,
|
|
@@ -88,7 +88,9 @@ export function createApp(options: CreateAppProps) {
|
|
|
88
88
|
try {
|
|
89
89
|
const extraHeadElements: React.ReactElement[] = []
|
|
90
90
|
|
|
91
|
-
const styleTag = Application.getStyleElement({
|
|
91
|
+
const styleTag = Application.getStyleElement({
|
|
92
|
+
nonce: process.env.ONE_NONCE,
|
|
93
|
+
})
|
|
92
94
|
if (styleTag) {
|
|
93
95
|
extraHeadElements.push(styleTag)
|
|
94
96
|
}
|
package/src/createMiddleware.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
// Isolated to suppress deprecation warning for deep import
|
|
2
2
|
// React Native 0.81+ discourages deep imports but doesn't provide official alternative yet
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
-
// @ts-ignore - Types not exported from react-native
|
|
5
3
|
export { default as getDevServer } from 'react-native/Libraries/Core/Devtools/getDevServer'
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
|
|
4
|
+
export type ImageData = {
|
|
5
|
+
src: string
|
|
6
|
+
width: number
|
|
7
|
+
height: number
|
|
8
|
+
blurDataURL: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ImageMeta = {
|
|
12
|
+
width: number
|
|
13
|
+
height: number
|
|
14
|
+
blurDataURL: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let sharpWarned = false
|
|
18
|
+
|
|
19
|
+
export async function getSharp(): Promise<typeof import('sharp') | null> {
|
|
20
|
+
try {
|
|
21
|
+
const sharpModule = await import('sharp')
|
|
22
|
+
return (sharpModule as any).default || sharpModule
|
|
23
|
+
} catch (e) {
|
|
24
|
+
if (!sharpWarned) {
|
|
25
|
+
sharpWarned = true
|
|
26
|
+
console.warn(`\n[one] To use getImageData, install sharp:\n\n npm install sharp\n`)
|
|
27
|
+
}
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Process an image file and return its metadata.
|
|
34
|
+
* Internal helper used by both getImageData and imageDataPlugin.
|
|
35
|
+
*/
|
|
36
|
+
export async function processImageMeta(filePath: string): Promise<ImageMeta | null> {
|
|
37
|
+
const sharp = await getSharp()
|
|
38
|
+
if (!sharp) {
|
|
39
|
+
return null
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const image = sharp(filePath)
|
|
44
|
+
const metadata = await image.metadata()
|
|
45
|
+
const { width = 0, height = 0 } = metadata
|
|
46
|
+
|
|
47
|
+
// Generate blur placeholder (10px wide, maintains aspect ratio)
|
|
48
|
+
const blurBuffer = await image.resize(10).blur(1).jpeg({ quality: 40 }).toBuffer()
|
|
49
|
+
const blurDataURL = `data:image/jpeg;base64,${blurBuffer.toString('base64')}`
|
|
50
|
+
|
|
51
|
+
return { width, height, blurDataURL }
|
|
52
|
+
} catch (e) {
|
|
53
|
+
console.warn(`[one] processImageMeta: Failed to process ${filePath}:`, e)
|
|
54
|
+
return null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get image metadata (dimensions and blur placeholder) for an image file.
|
|
60
|
+
*
|
|
61
|
+
* @param filePath - Path to the image file. Paths starting with "/" are resolved
|
|
62
|
+
* relative to ./public (e.g., "/images/hero.jpg" -> "./public/images/hero.jpg")
|
|
63
|
+
* @returns ImageData with src, width, height, and blurDataURL
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // From a loader or build script
|
|
67
|
+
* const data = await getImageData('/images/hero.jpg')
|
|
68
|
+
* // { src: '/images/hero.jpg', width: 1920, height: 1080, blurDataURL: '...' }
|
|
69
|
+
*
|
|
70
|
+
* // Or with a relative path
|
|
71
|
+
* const data = await getImageData('../public/images/hero.jpg')
|
|
72
|
+
*/
|
|
73
|
+
export async function getImageData(filePath: string): Promise<ImageData> {
|
|
74
|
+
let resolvedPath: string
|
|
75
|
+
let src: string
|
|
76
|
+
|
|
77
|
+
if (filePath.startsWith('/')) {
|
|
78
|
+
// Paths starting with / are web paths, resolve from ./public
|
|
79
|
+
resolvedPath = resolve('./public', filePath.slice(1))
|
|
80
|
+
src = filePath
|
|
81
|
+
} else {
|
|
82
|
+
// Relative or absolute file paths
|
|
83
|
+
resolvedPath = resolve(filePath)
|
|
84
|
+
// Generate src by stripping leading ./ and ensuring starts with /
|
|
85
|
+
src = filePath.replace(/^\.\.?\//, '').replace(/^public\//, '')
|
|
86
|
+
if (!src.startsWith('/')) {
|
|
87
|
+
src = '/' + src
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const defaultResult: ImageData = { src, width: 0, height: 0, blurDataURL: '' }
|
|
92
|
+
|
|
93
|
+
if (!existsSync(resolvedPath)) {
|
|
94
|
+
console.warn(`[one] getImageData: File not found: ${resolvedPath}`)
|
|
95
|
+
return defaultResult
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const meta = await processImageMeta(resolvedPath)
|
|
99
|
+
if (!meta) {
|
|
100
|
+
return defaultResult
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return { src, ...meta }
|
|
104
|
+
}
|
package/src/image.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getImageData, type ImageData, type ImageMeta } from './image/getImageData'
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,24 @@ export { createApp } from './createApp'
|
|
|
2
2
|
|
|
3
3
|
export type { One, OneRouter } from './interfaces/router'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Image data returned by ?imagedata imports.
|
|
7
|
+
* Install `sharp` to enable this feature: `npm install sharp`
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This interface is also declared in types/env.d.ts for Vite module augmentation.
|
|
10
|
+
* Keep both definitions in sync.
|
|
11
|
+
*/
|
|
12
|
+
export interface ImageData {
|
|
13
|
+
/** URL path to the image */
|
|
14
|
+
src: string
|
|
15
|
+
/** Image width in pixels */
|
|
16
|
+
width: number
|
|
17
|
+
/** Image height in pixels */
|
|
18
|
+
height: number
|
|
19
|
+
/** Base64 blur placeholder (10px wide) */
|
|
20
|
+
blurDataURL: string
|
|
21
|
+
}
|
|
22
|
+
|
|
5
23
|
import type { OneRouter } from './interfaces/router'
|
|
6
24
|
|
|
7
25
|
// if not overridden keep it as just string
|
|
@@ -70,13 +88,14 @@ export { registerPreloadedRoute } from './router/useViteRoutes'
|
|
|
70
88
|
export type { Endpoint, LoaderProps } from './types'
|
|
71
89
|
// React Navigation
|
|
72
90
|
export { useFocusEffect } from './useFocusEffect'
|
|
73
|
-
export { useLoader, useLoaderState } from './useLoader'
|
|
91
|
+
export { refetchLoader, useLoader, useLoaderState } from './useLoader'
|
|
74
92
|
export {
|
|
75
93
|
type ServerHeadInsertionCallback,
|
|
76
94
|
useServerHeadInsertion,
|
|
77
95
|
} from './useServerHeadInsertion'
|
|
78
96
|
export { isResponse } from './utils/isResponse'
|
|
79
97
|
export { redirect } from './utils/redirect'
|
|
98
|
+
export { watchFile } from './utils/watchFile'
|
|
80
99
|
export { ErrorBoundary } from './views/ErrorBoundary'
|
|
81
100
|
export { LoadProgressBar } from './views/LoadProgressBar'
|
|
82
101
|
export { Navigator, Slot } from './views/Navigator'
|
package/src/interfaces/router.ts
CHANGED
|
@@ -40,13 +40,17 @@ export namespace OneRouter {
|
|
|
40
40
|
: string
|
|
41
41
|
|
|
42
42
|
type DynamicRoutes<T extends string> =
|
|
43
|
-
__routes<T> extends {
|
|
43
|
+
__routes<T> extends {
|
|
44
|
+
DynamicRoutes: any
|
|
45
|
+
}
|
|
44
46
|
? T extends __routes<infer _>['DynamicRoutes']
|
|
45
47
|
? T
|
|
46
48
|
: never
|
|
47
49
|
: string
|
|
48
50
|
|
|
49
|
-
export type DynamicRouteTemplate = __routes extends {
|
|
51
|
+
export type DynamicRouteTemplate = __routes extends {
|
|
52
|
+
DynamicRouteTemplate: string
|
|
53
|
+
}
|
|
50
54
|
? __routes['DynamicRouteTemplate']
|
|
51
55
|
: string
|
|
52
56
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { metroPlugin } from '@vxrn/vite-plugin-metro'
|
|
2
|
-
import mm from 'micromatch'
|
|
3
1
|
import module from 'node:module'
|
|
4
2
|
import path from 'node:path'
|
|
3
|
+
import type { metroPlugin } from '@vxrn/vite-plugin-metro'
|
|
4
|
+
import mm from 'micromatch'
|
|
5
5
|
import tsconfigPaths from 'tsconfig-paths'
|
|
6
6
|
import {
|
|
7
7
|
API_ROUTE_GLOB_PATTERN,
|
package/src/router/Route.tsx
CHANGED
|
@@ -4,7 +4,11 @@ import type { One } from '../vite/types'
|
|
|
4
4
|
import { getContextKey } from './matchers'
|
|
5
5
|
import { RouteInfoContextProvider } from './RouteInfoContext'
|
|
6
6
|
|
|
7
|
-
export type DynamicConvention = {
|
|
7
|
+
export type DynamicConvention = {
|
|
8
|
+
name: string
|
|
9
|
+
deep: boolean
|
|
10
|
+
notFound?: boolean
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
export type LoadedRoute = {
|
|
10
14
|
ErrorBoundary?: React.ComponentType<ErrorBoundaryProps>
|
package/src/router/getRoutes.ts
CHANGED
|
@@ -550,7 +550,7 @@ function getLayoutNode(node: RouteNode, options: Options) {
|
|
|
550
550
|
const childMatchingGroup = node.children.find((child) => {
|
|
551
551
|
return child.route.replace(/\/index$/, '') === groupName
|
|
552
552
|
})
|
|
553
|
-
|
|
553
|
+
const initialRouteName = childMatchingGroup?.route
|
|
554
554
|
// const loaded = node.loadRoute()
|
|
555
555
|
// if (loaded?.unstable_settings) {
|
|
556
556
|
// // Allow unstable_settings={ initialRouteName: '...' } to override the default initial route name.
|
|
@@ -46,8 +46,14 @@ describe(matchDynamicName, () => {
|
|
|
46
46
|
it(`matches`, () => {
|
|
47
47
|
expect(matchDynamicName('[[...foobar]]')).toEqual(undefined)
|
|
48
48
|
expect(matchDynamicName('[[foobar]]')).toEqual(undefined)
|
|
49
|
-
expect(matchDynamicName('[...foobar]')).toEqual({
|
|
50
|
-
|
|
49
|
+
expect(matchDynamicName('[...foobar]')).toEqual({
|
|
50
|
+
name: 'foobar',
|
|
51
|
+
deep: true,
|
|
52
|
+
})
|
|
53
|
+
expect(matchDynamicName('[foobar]')).toEqual({
|
|
54
|
+
name: 'foobar',
|
|
55
|
+
deep: false,
|
|
56
|
+
})
|
|
51
57
|
expect(matchDynamicName('foobar')).toEqual(undefined)
|
|
52
58
|
})
|
|
53
59
|
})
|
package/src/router/router.ts
CHANGED
|
@@ -21,7 +21,7 @@ import type { OneRouter } from '../interfaces/router'
|
|
|
21
21
|
import { resolveHref } from '../link/href'
|
|
22
22
|
import { resolve } from '../link/path'
|
|
23
23
|
import { assertIsReady } from '../utils/assertIsReady'
|
|
24
|
-
import { getLoaderPath,
|
|
24
|
+
import { getLoaderPath, getPreloadCSSPath, getPreloadPath } from '../utils/cleanUrl'
|
|
25
25
|
import { dynamicImport } from '../utils/dynamicImport'
|
|
26
26
|
import { shouldLinkExternally } from '../utils/url'
|
|
27
27
|
import type { One } from '../vite/types'
|
|
@@ -457,7 +457,11 @@ function routeToScreen(
|
|
|
457
457
|
)
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
type RouteErrorBoundaryState = {
|
|
460
|
+
type RouteErrorBoundaryState = {
|
|
461
|
+
hasError: boolean
|
|
462
|
+
error: any
|
|
463
|
+
errorInfo: any
|
|
464
|
+
}
|
|
461
465
|
|
|
462
466
|
const ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {
|
|
463
467
|
hasError: false,
|
|
@@ -530,12 +534,24 @@ class RouteErrorBoundary extends React.Component<
|
|
|
530
534
|
</TouchableOpacity>
|
|
531
535
|
<ScrollView contentContainerStyle={{ gap: 12 }}>
|
|
532
536
|
{error instanceof Error ? (
|
|
533
|
-
<Text
|
|
537
|
+
<Text
|
|
538
|
+
style={{
|
|
539
|
+
color: 'white',
|
|
540
|
+
fontSize: 12,
|
|
541
|
+
fontFamily: 'monospace',
|
|
542
|
+
}}
|
|
543
|
+
>
|
|
534
544
|
{error.stack}
|
|
535
545
|
</Text>
|
|
536
546
|
) : null}
|
|
537
547
|
{errorInfo?.componentStack ? (
|
|
538
|
-
<Text
|
|
548
|
+
<Text
|
|
549
|
+
style={{
|
|
550
|
+
color: 'white',
|
|
551
|
+
fontSize: 12,
|
|
552
|
+
fontFamily: 'monospace',
|
|
553
|
+
}}
|
|
554
|
+
>
|
|
539
555
|
Component Stack: {errorInfo.componentStack}
|
|
540
556
|
</Text>
|
|
541
557
|
) : null}
|
|
@@ -28,7 +28,7 @@ export function useViteRoutes(
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// store preloaded modules so resolve() can use them synchronously
|
|
31
|
-
|
|
31
|
+
const preloadedModules: Record<string, any> = {}
|
|
32
32
|
|
|
33
33
|
export function registerPreloadedRoute(key: string, module: any): void {
|
|
34
34
|
preloadedModules[key] = module
|
package/src/serve-worker.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ensureExists } from './utils/ensureExists'
|
|
|
5
5
|
import type { One } from './vite/types'
|
|
6
6
|
|
|
7
7
|
// Re-export static HTML fetcher utilities for worker use
|
|
8
|
-
export {
|
|
8
|
+
export { getFetchStaticHtml, setFetchStaticHtml } from './server/staticHtmlFetcher'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Lazy import functions for route modules.
|
|
@@ -237,7 +237,9 @@ function getPathMeta(route: string) {
|
|
|
237
237
|
cleanedKey = getSafeRouteKey()
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
urlPathParts.push({
|
|
240
|
+
urlPathParts.push({
|
|
241
|
+
content: repeat ? '/*' : `/:${name}${optional ? '?' : ''}`,
|
|
242
|
+
})
|
|
241
243
|
routeKeys[cleanedKey] = name
|
|
242
244
|
|
|
243
245
|
return repeat
|
package/src/server/oneServe.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Hono, MiddlewareHandler } from 'hono'
|
|
2
|
-
import type { BlankEnv } from 'hono/types'
|
|
3
1
|
import { readFile } from 'node:fs/promises'
|
|
4
2
|
import { extname, join, resolve } from 'node:path'
|
|
3
|
+
import type { Hono, MiddlewareHandler } from 'hono'
|
|
4
|
+
import type { BlankEnv } from 'hono/types'
|
|
5
5
|
import {
|
|
6
6
|
CSS_PRELOAD_JS_POSTFIX,
|
|
7
7
|
LOADER_JS_POSTFIX_UNCACHED,
|
|
@@ -232,7 +232,10 @@ url: ${url}`)
|
|
|
232
232
|
if (html) {
|
|
233
233
|
const headers = new Headers()
|
|
234
234
|
headers.set('content-type', 'text/html')
|
|
235
|
-
return new Response(html, {
|
|
235
|
+
return new Response(html, {
|
|
236
|
+
headers,
|
|
237
|
+
status: route.isNotFound ? 404 : 200,
|
|
238
|
+
})
|
|
236
239
|
}
|
|
237
240
|
}
|
|
238
241
|
}
|
|
@@ -256,7 +259,9 @@ url: ${url}`)
|
|
|
256
259
|
// If there's no matching not-found or dynamic route, it's very likely that One won't handle it and will fallback to VxRN serving the static asset so it will also work.
|
|
257
260
|
// Note: serveStaticAssets is optional - workers handle static assets via platform config
|
|
258
261
|
if (options?.serveStaticAssets) {
|
|
259
|
-
const staticAssetResponse = await options.serveStaticAssets({
|
|
262
|
+
const staticAssetResponse = await options.serveStaticAssets({
|
|
263
|
+
context,
|
|
264
|
+
})
|
|
260
265
|
if (staticAssetResponse) {
|
|
261
266
|
return await runMiddlewares(
|
|
262
267
|
requestHandlers,
|
|
@@ -2,12 +2,12 @@ import { writeFile } from 'node:fs/promises'
|
|
|
2
2
|
import { dirname, join } from 'node:path'
|
|
3
3
|
import FSExtra from 'fs-extra'
|
|
4
4
|
import micromatch from 'micromatch'
|
|
5
|
+
import { removeSupportedExtensions } from '../router/matchers'
|
|
5
6
|
import { globbedRoutesToRouteContext } from '../router/useViteRoutes'
|
|
6
7
|
import { globDir } from '../utils/globDir'
|
|
7
8
|
import type { One } from '../vite/types'
|
|
8
9
|
import { getTypedRoutesDeclarationFile } from './getTypedRoutesDeclarationFile'
|
|
9
|
-
import {
|
|
10
|
-
import { removeSupportedExtensions } from '../router/matchers'
|
|
10
|
+
import { type InjectMode, injectRouteHelpers } from './injectRouteHelpers'
|
|
11
11
|
|
|
12
12
|
export async function generateRouteTypes(
|
|
13
13
|
outFile: string,
|
package/src/ui/Slot.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Slot as RUISlot } from '@radix-ui/react-slot'
|
|
2
2
|
import {
|
|
3
|
-
forwardRef,
|
|
4
|
-
useMemo,
|
|
5
|
-
type ForwardRefExoticComponent,
|
|
6
3
|
type Component,
|
|
4
|
+
type ForwardRefExoticComponent,
|
|
5
|
+
forwardRef,
|
|
7
6
|
type RefAttributes,
|
|
7
|
+
useMemo,
|
|
8
8
|
} from 'react'
|
|
9
9
|
import { StyleSheet, type ViewProps } from 'react-native'
|
|
10
10
|
|
package/src/ui/TabList.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { ComponentProps, ReactElement } from 'react'
|
|
2
|
+
import { StyleSheet, View, type ViewProps } from 'react-native'
|
|
3
3
|
|
|
4
4
|
import { ViewSlot } from './common'
|
|
5
5
|
|
package/src/ui/TabRouter.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type CommonNavigationAction,
|
|
3
3
|
type ParamListBase,
|
|
4
|
+
type TabActionType as RNTabActionType,
|
|
4
5
|
TabRouter as RNTabRouter,
|
|
6
|
+
type TabRouterOptions as RNTabRouterOptions,
|
|
5
7
|
type Router,
|
|
6
|
-
type TabActionType as RNTabActionType,
|
|
7
8
|
type TabNavigationState,
|
|
8
|
-
type TabRouterOptions as RNTabRouterOptions,
|
|
9
9
|
} from '@react-navigation/native'
|
|
10
10
|
|
|
11
11
|
import type { TriggerMap } from './common'
|
package/src/ui/TabSlot.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactElement, useState } from 'react'
|
|
2
2
|
import { Platform, StyleSheet } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Screen, ScreenContainer } from 'react-native-screens'
|
|
4
|
+
import { useNavigatorContext } from '../views/Navigator'
|
|
5
5
|
import { TabContext, type TabsDescriptor } from './TabContext'
|
|
6
6
|
import type { TabListProps } from './TabList'
|
|
7
|
-
import { useNavigatorContext } from '../views/Navigator'
|
|
8
7
|
|
|
9
8
|
export type TabSlotProps = ComponentProps<typeof ScreenContainer> & {
|
|
10
9
|
/**
|