one 1.1.297 → 1.1.299
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.js.map +1 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/cleanUrl.js +9 -2
- package/dist/cjs/cleanUrl.js.map +1 -1
- package/dist/cjs/cleanUrl.native.js +5 -2
- package/dist/cjs/cleanUrl.native.js.map +2 -2
- package/dist/cjs/vite/replaceLoader.js +7 -1
- package/dist/cjs/vite/replaceLoader.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.native.js +7 -1
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +110 -104
- package/dist/esm/Root.native.js.map +6 -1
- package/dist/esm/Route.native.js +12 -10
- package/dist/esm/Route.native.js.map +6 -1
- package/dist/esm/cleanUrl.js +9 -2
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs +7 -2
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js +16 -13
- package/dist/esm/cleanUrl.native.js.map +6 -1
- package/dist/esm/cli/label-process.native.js +5 -4
- package/dist/esm/cli/label-process.native.js.map +6 -1
- package/dist/esm/cli/main.native.js +8 -13
- package/dist/esm/cli/main.native.js.map +6 -1
- package/dist/esm/cli/prebuild.native.js +5 -5
- package/dist/esm/cli/prebuild.native.js.map +6 -1
- package/dist/esm/cli/run.native.js +21 -28
- package/dist/esm/cli/run.native.js.map +6 -1
- package/dist/esm/cli.native.js +119 -148
- package/dist/esm/cli.native.js.map +6 -1
- package/dist/esm/clientLoaderResolver.native.js +9 -6
- package/dist/esm/clientLoaderResolver.native.js.map +6 -1
- package/dist/esm/config.native.js +12 -11
- package/dist/esm/config.native.js.map +6 -1
- package/dist/esm/constants.native.js +7 -5
- package/dist/esm/constants.native.js.map +6 -1
- package/dist/esm/createApp.native.js +13 -9
- package/dist/esm/createApp.native.js.map +6 -1
- package/dist/esm/createHandleRequest.native.js +55 -64
- package/dist/esm/createHandleRequest.native.js.map +6 -1
- package/dist/esm/createRoute.native.js +16 -16
- package/dist/esm/createRoute.native.js.map +6 -1
- package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
- package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
- package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
- package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
- package/dist/esm/fork/NavigationContainer.native.js +24 -31
- package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
- package/dist/esm/fork/createMemoryHistory.native.js +99 -115
- package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
- package/dist/esm/fork/extractPathFromURL.native.js +16 -15
- package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
- package/dist/esm/fork/findFocusedRoute.native.js +6 -5
- package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
- package/dist/esm/fork/getPathFromState.native.js +127 -140
- package/dist/esm/fork/getPathFromState.native.js.map +6 -1
- package/dist/esm/fork/getStateFromPath.native.js +292 -288
- package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
- package/dist/esm/fork/useLinking.native.js +70 -61
- package/dist/esm/fork/useLinking.native.js.map +6 -1
- package/dist/esm/fork/validatePathConfig.native.js +15 -9
- package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
- package/dist/esm/getLinkingConfig.native.js +11 -6
- package/dist/esm/getLinkingConfig.native.js.map +6 -1
- package/dist/esm/getReactNavigationConfig.native.js +28 -20
- package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
- package/dist/esm/getRoutes.native.js +249 -229
- package/dist/esm/getRoutes.native.js.map +6 -1
- package/dist/esm/getURL.native.js +4 -4
- package/dist/esm/getURL.native.js.map +6 -1
- package/dist/esm/head/Head.android.js +5 -3
- package/dist/esm/head/Head.android.js.map +6 -1
- package/dist/esm/head/Head.ios.js +144 -132
- package/dist/esm/head/Head.ios.js.map +6 -1
- package/dist/esm/head/Head.native.js +7 -7
- package/dist/esm/head/Head.native.js.map +6 -1
- package/dist/esm/head/HeadModule.native.js +6 -6
- package/dist/esm/head/HeadModule.native.js.map +6 -1
- package/dist/esm/head/index.native.js +2 -2
- package/dist/esm/head/index.native.js.map +6 -1
- package/dist/esm/head/types.native.js +1 -2
- package/dist/esm/head/types.native.js.map +6 -1
- package/dist/esm/head/url.native.js +10 -8
- package/dist/esm/head/url.native.js.map +6 -1
- package/dist/esm/hooks.native.js +53 -34
- package/dist/esm/hooks.native.js.map +6 -1
- package/dist/esm/imperative-api.native.js +9 -6
- package/dist/esm/imperative-api.native.js.map +6 -1
- package/dist/esm/import-mode/index.android.js +4 -3
- package/dist/esm/import-mode/index.android.js.map +6 -1
- package/dist/esm/import-mode/index.ios.js +4 -3
- package/dist/esm/import-mode/index.ios.js.map +6 -1
- package/dist/esm/import-mode/index.native.js +3 -1
- package/dist/esm/import-mode/index.native.js.map +6 -1
- package/dist/esm/index.native.js +65 -27
- package/dist/esm/index.native.js.map +6 -1
- package/dist/esm/interfaces/router.native.js +4 -2
- package/dist/esm/interfaces/router.native.js.map +6 -1
- package/dist/esm/layouts/Drawer.native.js +7 -6
- package/dist/esm/layouts/Drawer.native.js.map +6 -1
- package/dist/esm/layouts/Stack.native.js +7 -6
- package/dist/esm/layouts/Stack.native.js.map +6 -1
- package/dist/esm/layouts/Tabs.native.js +42 -39
- package/dist/esm/layouts/Tabs.native.js.map +6 -1
- package/dist/esm/layouts/withLayoutContext.native.js +51 -48
- package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
- package/dist/esm/link/Link.native.js +62 -53
- package/dist/esm/link/Link.native.js.map +6 -1
- package/dist/esm/link/Redirect.native.js +8 -9
- package/dist/esm/link/Redirect.native.js.map +6 -1
- package/dist/esm/link/href.native.js +28 -27
- package/dist/esm/link/href.native.js.map +6 -1
- package/dist/esm/link/linking.native.js +51 -40
- package/dist/esm/link/linking.native.js.map +6 -1
- package/dist/esm/link/path.native.js +28 -19
- package/dist/esm/link/path.native.js.map +6 -1
- package/dist/esm/link/useLinkTo.native.js +22 -20
- package/dist/esm/link/useLinkTo.native.js.map +6 -1
- package/dist/esm/link/useLoadedNavigation.native.js +30 -23
- package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
- package/dist/esm/matchers.native.js +16 -3
- package/dist/esm/matchers.native.js.map +6 -1
- package/dist/esm/platform.native.js +4 -2
- package/dist/esm/platform.native.js.map +6 -1
- package/dist/esm/polyfills-mobile.native.js +4 -5
- package/dist/esm/polyfills-mobile.native.js.map +6 -1
- package/dist/esm/polyfills-server.native.js +1 -1
- package/dist/esm/polyfills-server.native.js.map +6 -1
- package/dist/esm/render.native.js +3 -1
- package/dist/esm/render.native.js.map +6 -1
- package/dist/esm/router/RouterStore.native.js +1 -2
- package/dist/esm/router/RouterStore.native.js.map +6 -1
- package/dist/esm/router/constants.native.js +4 -2
- package/dist/esm/router/constants.native.js.map +6 -1
- package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
- package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
- package/dist/esm/router/lastAction.native.js +10 -9
- package/dist/esm/router/lastAction.native.js.map +6 -1
- package/dist/esm/router/router.native.js +135 -114
- package/dist/esm/router/router.native.js.map +6 -1
- package/dist/esm/router/serverLocationContext.native.js +4 -2
- package/dist/esm/router/serverLocationContext.native.js.map +6 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
- package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
- package/dist/esm/serve.native.js +77 -104
- package/dist/esm/serve.native.js.map +6 -1
- package/dist/esm/server/createRoutesManifest.native.js +14 -11
- package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
- package/dist/esm/server/getServerManifest.native.js +61 -67
- package/dist/esm/server/getServerManifest.native.js.map +6 -1
- package/dist/esm/server-render.native.js +9 -10
- package/dist/esm/server-render.native.js.map +6 -1
- package/dist/esm/sortRoutes.native.js +27 -17
- package/dist/esm/sortRoutes.native.js.map +6 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
- package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +6 -1
- package/dist/esm/useFocusEffect.native.js +25 -22
- package/dist/esm/useFocusEffect.native.js.map +6 -1
- package/dist/esm/useLoader.native.js +50 -50
- package/dist/esm/useLoader.native.js.map +6 -1
- package/dist/esm/useNavigation.native.js +23 -19
- package/dist/esm/useNavigation.native.js.map +6 -1
- package/dist/esm/useScreens.native.js +143 -160
- package/dist/esm/useScreens.native.js.map +6 -1
- package/dist/esm/useViteRoutes.native.js +25 -28
- package/dist/esm/useViteRoutes.native.js.map +6 -1
- package/dist/esm/utils/assertIsReady.native.js +6 -3
- package/dist/esm/utils/assertIsReady.native.js.map +6 -1
- package/dist/esm/utils/dynamicImport.native.js +5 -3
- package/dist/esm/utils/dynamicImport.native.js.map +6 -1
- package/dist/esm/utils/existsAsync.native.js +6 -4
- package/dist/esm/utils/existsAsync.native.js.map +6 -1
- package/dist/esm/utils/getPageExport.native.js +12 -11
- package/dist/esm/utils/getPageExport.native.js.map +6 -1
- package/dist/esm/utils/globDir.native.js +5 -3
- package/dist/esm/utils/globDir.native.js.map +6 -1
- package/dist/esm/utils/hashString.native.js +4 -2
- package/dist/esm/utils/hashString.native.js.map +6 -1
- package/dist/esm/utils/isResponse.native.js +4 -2
- package/dist/esm/utils/isResponse.native.js.map +6 -1
- package/dist/esm/utils/isStatus.native.js +4 -2
- package/dist/esm/utils/isStatus.native.js.map +6 -1
- package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
- package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
- package/dist/esm/utils/rand.native.js +5 -3
- package/dist/esm/utils/rand.native.js.map +6 -1
- package/dist/esm/utils/redirect.native.js +7 -5
- package/dist/esm/utils/redirect.native.js.map +6 -1
- package/dist/esm/utils/removeSearch.native.js +4 -2
- package/dist/esm/utils/removeSearch.native.js.map +6 -1
- package/dist/esm/utils/removeUndefined.native.js +6 -3
- package/dist/esm/utils/removeUndefined.native.js.map +6 -1
- package/dist/esm/utils/requireResolve.native.js +4 -2
- package/dist/esm/utils/requireResolve.native.js.map +6 -1
- package/dist/esm/utils/url.native.js +6 -2
- package/dist/esm/utils/url.native.js.map +6 -1
- package/dist/esm/utils/weakKey.native.js +11 -10
- package/dist/esm/utils/weakKey.native.js.map +6 -1
- package/dist/esm/utils/weakMemo.native.js +8 -8
- package/dist/esm/utils/weakMemo.native.js.map +6 -1
- package/dist/esm/views/EmptyRoute.native.js +5 -3
- package/dist/esm/views/EmptyRoute.native.js.map +6 -1
- package/dist/esm/views/ErrorBoundary.native.js +5 -8
- package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/LoadProgressBar.native.js +58 -57
- package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
- package/dist/esm/views/Navigator.native.js +54 -71
- package/dist/esm/views/Navigator.native.js.map +6 -1
- package/dist/esm/views/PreloadLinks.native.js +3 -1
- package/dist/esm/views/PreloadLinks.native.js.map +6 -1
- package/dist/esm/views/RootErrorBoundary.native.js +39 -29
- package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/Screen.native.js +12 -12
- package/dist/esm/views/Screen.native.js.map +6 -1
- package/dist/esm/views/ScrollRestoration.native.js +27 -27
- package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
- package/dist/esm/views/Try.native.js +40 -37
- package/dist/esm/views/Try.native.js.map +6 -1
- package/dist/esm/vite/build.native.js +260 -295
- package/dist/esm/vite/build.native.js.map +6 -1
- package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
- package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
- package/dist/esm/vite/constants.native.js +6 -4
- package/dist/esm/vite/constants.native.js.map +6 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
- package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
- package/dist/esm/vite/customNodeExternals.native.js +9 -10
- package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
- package/dist/esm/vite/ensureTsConfig.native.js +7 -5
- package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
- package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
- package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
- package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
- package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
- package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
- package/dist/esm/vite/getManifest.native.js +6 -4
- package/dist/esm/vite/getManifest.native.js.map +6 -1
- package/dist/esm/vite/headers.native.js +11 -5
- package/dist/esm/vite/headers.native.js.map +6 -1
- package/dist/esm/vite/loadEnv.native.js +7 -6
- package/dist/esm/vite/loadEnv.native.js.map +6 -1
- package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
- package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
- package/dist/esm/vite/one.native.js +142 -127
- package/dist/esm/vite/one.native.js.map +6 -1
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
- package/dist/esm/vite/replaceLoader.js +7 -1
- package/dist/esm/vite/replaceLoader.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs +5 -1
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js +13 -10
- package/dist/esm/vite/replaceLoader.native.js.map +6 -1
- package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
- package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
- package/dist/esm/vite/server.native.js +5 -4
- package/dist/esm/vite/server.native.js.map +6 -1
- package/dist/esm/vite/types.native.js +1 -2
- package/dist/esm/vite/types.native.js.map +6 -1
- package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
- package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
- package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
- package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
- package/dist/esm/vite.native.js +19 -10
- package/dist/esm/vite.native.js.map +6 -1
- package/dist/esm/zero/getQueryKey.native.js +5 -3
- package/dist/esm/zero/getQueryKey.native.js.map +6 -1
- package/dist/esm/zero/isZeroQuery.native.js +4 -2
- package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
- package/dist/esm/zero/resolveQuery.native.js +9 -8
- package/dist/esm/zero/resolveQuery.native.js.map +6 -1
- package/dist/esm/zero/subscribeToQuery.native.js +5 -3
- package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
- package/dist/esm/zero/types.native.js +1 -2
- package/dist/esm/zero/types.native.js.map +6 -1
- package/dist/esm/zero/useQuery.native.js +12 -12
- package/dist/esm/zero/useQuery.native.js.map +6 -1
- package/dist/esm/zero/useQueryZero.native.js +24 -20
- package/dist/esm/zero/useQueryZero.native.js.map +6 -1
- package/dist/esm/zero.native.js +9 -5
- package/dist/esm/zero.native.js.map +6 -1
- package/package.json +7 -7
- package/src/Root.tsx +20 -16
- package/src/cleanUrl.ts +15 -1
- package/src/vite/replaceLoader.ts +7 -1
- package/types/cleanUrl.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
package/dist/esm/cleanUrl.mjs
CHANGED
@@ -13,11 +13,16 @@ function getPreloadPath(currentPath) {
|
|
13
13
|
}
|
14
14
|
function getLoaderPath(currentPath, includeUrl = isNative) {
|
15
15
|
const baseURL = includeUrl ? getURL() : "",
|
16
|
-
devPath = process.env.NODE_ENV === "development" ? "/_one" : ""
|
17
|
-
|
16
|
+
devPath = process.env.NODE_ENV === "development" ? "/_one" : "",
|
17
|
+
currentPathUrl = new URL(currentPath, "http://example.com"
|
18
|
+
/* not important, just for `new URL()` to work */);
|
19
|
+
return `${baseURL}${devPath}/assets/${cleanUrl(currentPathUrl.pathname.slice(1))}_vxrn_loader.js${getSearchParams(currentPathUrl.search)}`;
|
18
20
|
}
|
19
21
|
function getPathFromLoaderPath(loaderPath) {
|
20
22
|
return loaderPath.replace("_vxrn_loader.js", "").replace(/^(\/_one)?\/assets/, "").replace("_", "/");
|
21
23
|
}
|
24
|
+
function getSearchParams(searchParams) {
|
25
|
+
return searchParams ? `${searchParams}&${clientSideSearch.slice(1)}` : clientSideSearch;
|
26
|
+
}
|
22
27
|
export { getLoaderPath, getPathFromLoaderPath, getPreloadPath };
|
23
28
|
//# sourceMappingURL=cleanUrl.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isNative","getURL","CACHE_KEY","removeSearch","cleanUrl","path","replaceAll","replace","isClient","window","clientSideSearch","clientSideURL","getPreloadPath","currentPath","slice","getLoaderPath","includeUrl","baseURL","devPath","process","env","NODE_ENV","getPathFromLoaderPath","loaderPath"],"sources":["../../src/cleanUrl.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,MAAA,QAAc;AACvB,SAASC,SAAA,QAAiB;AAC1B,SAASC,YAAA,QAAoB;AAE7B,SAASC,SAASC,IAAA,EAAc;EAC9B,OACEF,YAAA,CAAaE,IAAI,EACdC,UAAA,CAAW,KAAK,GAAG,EAEnBC,OAAA,CAAQ,MAAM,EAAE;AAEvB;AAEA,MAAMC,QAAA,GAAW,OAAOC,MAAA,GAAW;EAC7BC,gBAAA,GAAmBF,QAAA,GAAW,UAAUN,SAAS,KAAK;EACtDS,aAAA,GAAgBH,QAAA,GAAWP,MAAA,CAAO,IAAI;AAErC,SAASW,eAAeC,WAAA,EAAqB;EAClD,OAAO,GAAGF,aAAa,WAAWP,QAAA,CAASS,WAAA,CAAYC,KAAA,CAAM,CAAC,CAAC,CAAC,cAAcJ,gBAAgB;AAChG;AAEO,SAASK,cACdF,WAAA,EAEAG,UAAA,GAAahB,QAAA,EACb;EACA,MAAMiB,OAAA,GAAUD,UAAA,GAAaf,MAAA,CAAO,IAAI;IAClCiB,OAAA,GAAUC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,gBAAgB,UAAU;
|
1
|
+
{"version":3,"names":["isNative","getURL","CACHE_KEY","removeSearch","cleanUrl","path","replaceAll","replace","isClient","window","clientSideSearch","clientSideURL","getPreloadPath","currentPath","slice","getLoaderPath","includeUrl","baseURL","devPath","process","env","NODE_ENV","currentPathUrl","URL","pathname","getSearchParams","search","getPathFromLoaderPath","loaderPath","searchParams"],"sources":["../../src/cleanUrl.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,SAASC,MAAA,QAAc;AACvB,SAASC,SAAA,QAAiB;AAC1B,SAASC,YAAA,QAAoB;AAE7B,SAASC,SAASC,IAAA,EAAc;EAC9B,OACEF,YAAA,CAAaE,IAAI,EACdC,UAAA,CAAW,KAAK,GAAG,EAEnBC,OAAA,CAAQ,MAAM,EAAE;AAEvB;AAEA,MAAMC,QAAA,GAAW,OAAOC,MAAA,GAAW;EAC7BC,gBAAA,GAAmBF,QAAA,GAAW,UAAUN,SAAS,KAAK;EACtDS,aAAA,GAAgBH,QAAA,GAAWP,MAAA,CAAO,IAAI;AAErC,SAASW,eAAeC,WAAA,EAAqB;EAClD,OAAO,GAAGF,aAAa,WAAWP,QAAA,CAASS,WAAA,CAAYC,KAAA,CAAM,CAAC,CAAC,CAAC,cAAcJ,gBAAgB;AAChG;AAEO,SAASK,cACdF,WAAA,EAEAG,UAAA,GAAahB,QAAA,EACb;EACA,MAAMiB,OAAA,GAAUD,UAAA,GAAaf,MAAA,CAAO,IAAI;IAClCiB,OAAA,GAAUC,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,gBAAgB,UAAU;IAE7DC,cAAA,GAAiB,IAAIC,GAAA,CACzBV,WAAA,EACA;IAAA,iDACF;EAEA,OAAO,GAAGI,OAAO,GAAGC,OAAO,WAAWd,QAAA,CAASkB,cAAA,CAAeE,QAAA,CAASV,KAAA,CAAM,CAAC,CAAC,CAAC,kBAAkBW,eAAA,CAAgBH,cAAA,CAAeI,MAAM,CAAC;AAC1I;AAEO,SAASC,sBAAsBC,UAAA,EAAoB;EACxD,OAAOA,UAAA,CACJrB,OAAA,CAAQ,mBAAmB,EAAE,EAC7BA,OAAA,CAAQ,sBAAsB,EAAE,EAChCA,OAAA,CAAQ,KAAK,GAAG;AACrB;AAEA,SAASkB,gBAAgBI,YAAA,EAAc;EACrC,OAAKA,YAAA,GAIE,GAAGA,YAAY,IAAInB,gBAAA,CAAiBI,KAAA,CAAM,CAAC,CAA8B,KAHvEJ,gBAAA;AAIX","ignoreList":[]}
|
@@ -1,24 +1,27 @@
|
|
1
|
-
import { isNative } from "./constants
|
2
|
-
import { getURL } from "./getURL
|
3
|
-
import { CACHE_KEY } from "./router/constants
|
4
|
-
import { removeSearch } from "./utils/removeSearch
|
1
|
+
import { isNative } from "./constants";
|
2
|
+
import { getURL } from "./getURL";
|
3
|
+
import { CACHE_KEY } from "./router/constants";
|
4
|
+
import { removeSearch } from "./utils/removeSearch";
|
5
5
|
function cleanUrl(path) {
|
6
6
|
return removeSearch(path).replaceAll("/", "_").replace(/_$/, "");
|
7
7
|
}
|
8
|
-
var isClient = typeof window < "u",
|
9
|
-
clientSideSearch = isClient ? `?cache=${CACHE_KEY}` : "",
|
10
|
-
clientSideURL = isClient ? getURL() : "";
|
8
|
+
var isClient = typeof window < "u", clientSideSearch = isClient ? `?cache=${CACHE_KEY}` : "", clientSideURL = isClient ? getURL() : "";
|
11
9
|
function getPreloadPath(currentPath) {
|
12
10
|
return `${clientSideURL}/assets/${cleanUrl(currentPath.slice(1))}_preload.js${clientSideSearch}`;
|
13
11
|
}
|
14
12
|
function getLoaderPath(currentPath) {
|
15
|
-
var includeUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : isNative,
|
16
|
-
|
17
|
-
devPath = process.env.NODE_ENV === "development" ? "/_one" : "";
|
18
|
-
return `${baseURL}${devPath}/assets/${cleanUrl(currentPath.slice(1))}_vxrn_loader.js${clientSideSearch}`;
|
13
|
+
var includeUrl = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : isNative, baseURL = includeUrl ? getURL() : "", devPath = process.env.NODE_ENV === "development" ? "/_one" : "", currentPathUrl = new URL(currentPath, "http://example.com");
|
14
|
+
return `${baseURL}${devPath}/assets/${cleanUrl(currentPathUrl.pathname.slice(1))}_vxrn_loader.js${getSearchParams(currentPathUrl.search)}`;
|
19
15
|
}
|
20
16
|
function getPathFromLoaderPath(loaderPath) {
|
21
17
|
return loaderPath.replace("_vxrn_loader.js", "").replace(/^(\/_one)?\/assets/, "").replace("_", "/");
|
22
18
|
}
|
23
|
-
|
24
|
-
|
19
|
+
function getSearchParams(searchParams) {
|
20
|
+
return searchParams ? `${searchParams}&${clientSideSearch.slice(1)}` : clientSideSearch;
|
21
|
+
}
|
22
|
+
export {
|
23
|
+
getLoaderPath,
|
24
|
+
getPathFromLoaderPath,
|
25
|
+
getPreloadPath
|
26
|
+
};
|
27
|
+
//# sourceMappingURL=cleanUrl.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/cleanUrl.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,oBAAoB;AAE7B,SAASC,SAASC,MAAY;AAC5B,SACEF,aAAaE,IAAAA,EACVC,WAAW,KAAK,GAAA,EAEhBC,QAAQ,MAAM,EAAA;AAErB;AAEA,IAAMC,WAAW,OAAOC,SAAW,KAC7BC,mBAAmBF,WAAW,UAAUN,SAAAA,KAAc,IACtDS,gBAAgBH,WAAWP,OAAAA,IAAW;AAErC,SAASW,eAAeC,aAAmB;AAChD,SAAO,GAAGF,aAAAA,WAAwBP,SAASS,YAAYC,MAAM,CAAA,CAAA,CAAA,cAAiBJ,gBAAAA;AAChF;AAEO,SAASK,cACdF,aAAmB;MAEnBG,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAahB,UAEPiB,UAAUD,aAAaf,OAAAA,IAAW,IAClCiB,UAAUC,QAAQC,IAAIC,aAAa,gBAAgB,UAAU,IAE7DC,iBAAiB,IAAIC,IACzBV,aACA,oBAAA;AAGF,SAAO,GAAGI,OAAAA,GAAUC,OAAAA,WAAkBd,SAASkB,eAAeE,SAASV,MAAM,CAAA,CAAA,CAAA,kBAAqBW,gBAAgBH,eAAeI,MAAM,CAAA;AACzI;AAEO,SAASC,sBAAsBC,YAAkB;AACtD,SAAOA,WACJrB,QAAQ,mBAAmB,EAAA,EAC3BA,QAAQ,sBAAsB,EAAA,EAC9BA,QAAQ,KAAK,GAAA;AAClB;AAEA,SAASkB,gBAAgBI,cAAY;AACnC,SAAKA,eAIE,GAAGA,YAAAA,IAAgBnB,iBAAiBI,MAAM,CAAA,CAAA,KAHxCJ;AAIX;",
|
5
|
+
"names": ["isNative", "getURL", "CACHE_KEY", "removeSearch", "cleanUrl", "path", "replaceAll", "replace", "isClient", "window", "clientSideSearch", "clientSideURL", "getPreloadPath", "currentPath", "slice", "getLoaderPath", "includeUrl", "baseURL", "devPath", "process", "env", "NODE_ENV", "currentPathUrl", "URL", "pathname", "getSearchParams", "search", "getPathFromLoaderPath", "loaderPath", "searchParams"]
|
6
|
+
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { homedir } from "node:os";
|
2
2
|
function labelProcess(title) {
|
3
|
-
var home = homedir(),
|
4
|
-
cwd = process.cwd();
|
3
|
+
var home = homedir(), cwd = process.cwd();
|
5
4
|
process.title = `Onejs:${title} > ${cwd.replace(home, "~")}`;
|
6
5
|
}
|
7
|
-
export {
|
8
|
-
|
6
|
+
export {
|
7
|
+
labelProcess
|
8
|
+
};
|
9
|
+
//# sourceMappingURL=label-process.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/cli/Users/n8/one/packages/one/src/cli/label-process.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,eAAe;AAEjB,SAASC,aAAaC,OAAa;AACxC,MAAMC,OAAOH,QAAAA,GACPI,MAAMC,QAAQD,IAAG;AACvBC,UAAQH,QAAQ,SAASA,KAAAA,MAAWE,IAAIE,QAAQH,MAAM,GAAA,CAAA;AACxD;",
|
5
|
+
"names": ["homedir", "labelProcess", "title", "home", "cwd", "process", "replace"]
|
6
|
+
}
|
@@ -1,15 +1,10 @@
|
|
1
1
|
import { existsSync } from "node:fs";
|
2
2
|
import { createRequire } from "node:module";
|
3
|
-
import { run } from "./run
|
3
|
+
import { run } from "./run";
|
4
4
|
async function getLatestVersion(packageName) {
|
5
|
-
var require2 = createRequire(import.meta.url),
|
6
|
-
_confuseDepCheck = require2,
|
7
|
-
packageJson = _confuseDepCheck("one/package.json"),
|
8
|
-
currentVersion = packageJson.version;
|
5
|
+
var require2 = createRequire(import.meta.url), _confuseDepCheck = require2, packageJson = _confuseDepCheck("one/package.json"), currentVersion = packageJson.version;
|
9
6
|
try {
|
10
|
-
var response = await fetch(`https://registry.npmjs.org/${packageName}`),
|
11
|
-
data = await response.json(),
|
12
|
-
latest = data["dist-tags"].latest;
|
7
|
+
var response = await fetch(`https://registry.npmjs.org/${packageName}`), data = await response.json(), latest = data["dist-tags"].latest;
|
13
8
|
latest && currentVersion !== latest && (console.info(`
|
14
9
|
\u2776 Update available: ${currentVersion} \u2192 ${latest}`), console.info(`Run "npx one@latest" or "npm install -g one@latest" to update globally.
|
15
10
|
`));
|
@@ -20,10 +15,10 @@ async function getLatestVersion(packageName) {
|
|
20
15
|
async function cliMain() {
|
21
16
|
var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
22
17
|
getLatestVersion("one"), existsSync("vite.config.ts") && (await run(args), process.exit(0));
|
23
|
-
var {
|
24
|
-
create
|
25
|
-
} = await import("create-vxrn/create");
|
18
|
+
var { create } = await import("create-vxrn/create");
|
26
19
|
await create({});
|
27
20
|
}
|
28
|
-
export {
|
29
|
-
|
21
|
+
export {
|
22
|
+
cliMain
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=main.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/cli/Users/n8/one/packages/one/src/cli/main.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,kBAAkB;AAC3B,SAASC,qBAAqB;AAC9B,SAASC,WAAW;AAEpB,eAAeC,iBAAiBC,aAAmB;AACjD,MAAMC,WAAUJ,cAAc,YAAYK,GAAG,GACvCC,mBAAmBF,UACnBG,cAAcD,iBAAiB,kBAAA,GAC/BE,iBAAiBD,YAAYE;AAEnC,MAAI;AACF,QAAMC,WAAW,MAAMC,MAAM,8BAA8BR,WAAAA,EAAa,GAClES,OAAO,MAAMF,SAASG,KAAI,GAC1BC,SAASF,KAAK,WAAA,EAAaE;AAEjC,IAAIA,UAAUN,mBAAmBM,WAE/BC,QAAQC,KAAK;2BAAyBR,cAAAA,WAAoBM,MAAAA,EAAQ,GAClEC,QAAQC,KAAK;CAAA;EAEjB,SAASC,OAAO;AACdF,YAAQE,MAAM,uCAAuCA,KAAAA;EACvD;AACF;AAEA,eAAsBC,UAAAA;MAAQC,OAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAO,CAAC;AAEpC,EAAKjB,iBAAiB,KAAA,GAElBH,WAAW,gBAAA,MAEb,MAAME,IAAIkB,IAAAA,GACVC,QAAQC,KAAK,CAAA;AAGf,MAAM,EAAEC,OAAM,IAAK,MAAM,OAAO,oBAAA;AAChC,QAAMA,OAAO,CAAC,CAAA;AAChB;",
|
5
|
+
"names": ["existsSync", "createRequire", "run", "getLatestVersion", "packageName", "require", "url", "_confuseDepCheck", "packageJson", "currentVersion", "version", "response", "fetch", "data", "json", "latest", "console", "info", "error", "cliMain", "args", "process", "exit", "create"]
|
6
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
async function run(args) {
|
2
|
-
var {
|
3
|
-
prebuild
|
4
|
-
} = await import("vxrn");
|
2
|
+
var { prebuild } = await import("vxrn");
|
5
3
|
await prebuild({
|
6
4
|
root: process.cwd()
|
7
5
|
});
|
8
6
|
}
|
9
|
-
export {
|
10
|
-
|
7
|
+
export {
|
8
|
+
run
|
9
|
+
};
|
10
|
+
//# sourceMappingURL=prebuild.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/cli/Users/n8/one/packages/one/src/cli/prebuild.ts"],
|
4
|
+
"mappings": "AAAA,eAAsBA,IAAIC,MAAQ;AAChC,MAAM,EAAEC,SAAQ,IAAK,MAAM,OAAO,MAAA;AAClC,QAAMA,SAAS;IACbC,MAAMC,QAAQC,IAAG;EACnB,CAAA;AACF;",
|
5
|
+
"names": ["run", "args", "prebuild", "root", "process", "cwd"]
|
6
|
+
}
|
@@ -1,35 +1,28 @@
|
|
1
|
-
import { virtualEntryIdNative } from "../vite/virtualEntryPlugin
|
2
|
-
import { labelProcess } from "./label-process
|
1
|
+
import { virtualEntryIdNative } from "../vite/virtualEntryPlugin";
|
2
|
+
import { labelProcess } from "./label-process";
|
3
3
|
async function run(args) {
|
4
4
|
labelProcess("dev");
|
5
|
-
var {
|
6
|
-
|
7
|
-
|
8
|
-
{
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
},
|
19
|
-
entries: {
|
20
|
-
native: virtualEntryIdNative
|
21
|
-
}
|
22
|
-
}),
|
23
|
-
{
|
24
|
-
closePromise
|
25
|
-
} = await start();
|
26
|
-
process.on("beforeExit", function () {
|
5
|
+
var { dev } = await import("vxrn"), { start, stop } = await dev({
|
6
|
+
clean: args.clean,
|
7
|
+
root: process.cwd(),
|
8
|
+
server: {
|
9
|
+
https: args.https,
|
10
|
+
host: args.host,
|
11
|
+
port: args.port ? +args.port : void 0
|
12
|
+
},
|
13
|
+
entries: {
|
14
|
+
native: virtualEntryIdNative
|
15
|
+
}
|
16
|
+
}), { closePromise } = await start();
|
17
|
+
process.on("beforeExit", function() {
|
27
18
|
stop();
|
28
|
-
}), process.on("SIGINT", function
|
19
|
+
}), process.on("SIGINT", function() {
|
29
20
|
stop();
|
30
|
-
}), process.on("uncaughtException", function
|
21
|
+
}), process.on("uncaughtException", function(err) {
|
31
22
|
console.error(err?.message || err);
|
32
23
|
}), await closePromise;
|
33
24
|
}
|
34
|
-
export {
|
35
|
-
|
25
|
+
export {
|
26
|
+
run
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=run.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/cli/Users/n8/one/packages/one/src/cli/run.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,4BAA4B;AACrC,SAASC,oBAAoB;AAE7B,eAAsBC,IAAIC,MAKzB;AACCF,eAAa,KAAA;AACb,MAAM,EAAEG,IAAG,IAAK,MAAM,OAAO,MAAA,GACvB,EAAEC,OAAOC,KAAI,IAAK,MAAMF,IAAI;IAChCG,OAAOJ,KAAKI;IACZC,MAAMC,QAAQC,IAAG;IACjBC,QAAQ;MACNC,OAAOT,KAAKS;MACZC,MAAMV,KAAKU;MACXC,MAAMX,KAAKW,OAAO,CAACX,KAAKW,OAAOC;IACjC;IACAC,SAAS;MACPC,QAAQjB;IACV;EACF,CAAA,GAEM,EAAEkB,aAAY,IAAK,MAAMb,MAAAA;AAE/BI,UAAQU,GAAG,cAAc,WAAA;AACvBb,SAAAA;EACF,CAAA,GAEAG,QAAQU,GAAG,UAAU,WAAA;AACnBb,SAAAA;EACF,CAAA,GAEAG,QAAQU,GAAG,qBAAqB,SAACC,KAAAA;AAC/BC,YAAQC,MAAMF,KAAKG,WAAWH,GAAAA;EAChC,CAAA,GAEA,MAAMF;AACR;",
|
5
|
+
"names": ["virtualEntryIdNative", "labelProcess", "run", "args", "dev", "start", "stop", "clean", "root", "process", "cwd", "server", "https", "host", "port", "undefined", "entries", "native", "closePromise", "on", "err", "console", "error", "message"]
|
6
|
+
}
|
package/dist/esm/cli.native.js
CHANGED
@@ -1,172 +1,143 @@
|
|
1
1
|
import { defineCommand, runMain } from "citty";
|
2
|
-
import { loadEnv } from "./vite/loadEnv
|
2
|
+
import { loadEnv } from "./vite/loadEnv";
|
3
3
|
import { readFileSync } from "node:fs";
|
4
4
|
import path from "node:path";
|
5
5
|
import { fileURLToPath } from "node:url";
|
6
6
|
function getPackageVersion() {
|
7
7
|
var dirname;
|
8
8
|
typeof __dirname < "u" ? dirname = __dirname : dirname = path.dirname(fileURLToPath(import.meta.url));
|
9
|
-
var packagePath = path.join(dirname, "..", "..", "package.json"),
|
10
|
-
packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
9
|
+
var packagePath = path.join(dirname, "..", "..", "package.json"), packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
11
10
|
return packageJson.version;
|
12
11
|
}
|
13
12
|
var version = getPackageVersion();
|
14
13
|
loadEnv(process.cwd());
|
15
14
|
var dev = defineCommand({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
meta: {
|
16
|
+
name: "dev",
|
17
|
+
version,
|
18
|
+
description: "Start the dev server"
|
19
|
+
},
|
20
|
+
args: {
|
21
|
+
clean: {
|
22
|
+
type: "boolean"
|
20
23
|
},
|
21
|
-
|
22
|
-
|
23
|
-
type: "boolean"
|
24
|
-
},
|
25
|
-
host: {
|
26
|
-
type: "string"
|
27
|
-
},
|
28
|
-
port: {
|
29
|
-
type: "string"
|
30
|
-
},
|
31
|
-
https: {
|
32
|
-
type: "boolean"
|
33
|
-
}
|
24
|
+
host: {
|
25
|
+
type: "string"
|
34
26
|
},
|
35
|
-
|
36
|
-
|
37
|
-
args
|
38
|
-
} = param,
|
39
|
-
{
|
40
|
-
run
|
41
|
-
} = await import("./cli/run.native.js");
|
42
|
-
await run(args);
|
43
|
-
}
|
44
|
-
}),
|
45
|
-
buildCommand = defineCommand({
|
46
|
-
meta: {
|
47
|
-
name: "build",
|
48
|
-
version,
|
49
|
-
description: "Build your app"
|
50
|
-
},
|
51
|
-
args: {
|
52
|
-
step: {
|
53
|
-
type: "string",
|
54
|
-
required: !1
|
55
|
-
},
|
56
|
-
// limit the pages built
|
57
|
-
only: {
|
58
|
-
type: "string",
|
59
|
-
required: !1
|
60
|
-
}
|
27
|
+
port: {
|
28
|
+
type: "string"
|
61
29
|
},
|
62
|
-
|
63
|
-
|
64
|
-
args
|
65
|
-
} = param,
|
66
|
-
{
|
67
|
-
build
|
68
|
-
} = await import("./vite/build.native.js");
|
69
|
-
await build(args), process.exit(0);
|
30
|
+
https: {
|
31
|
+
type: "boolean"
|
70
32
|
}
|
71
|
-
}
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
type: "string"
|
87
|
-
},
|
88
|
-
compress: {
|
89
|
-
type: "boolean"
|
90
|
-
},
|
91
|
-
cacheHeaders: {
|
92
|
-
type: "boolean"
|
93
|
-
}
|
33
|
+
},
|
34
|
+
async run(param) {
|
35
|
+
var { args } = param, { run } = await import("./cli/run");
|
36
|
+
await run(args);
|
37
|
+
}
|
38
|
+
}), buildCommand = defineCommand({
|
39
|
+
meta: {
|
40
|
+
name: "build",
|
41
|
+
version,
|
42
|
+
description: "Build your app"
|
43
|
+
},
|
44
|
+
args: {
|
45
|
+
step: {
|
46
|
+
type: "string",
|
47
|
+
required: !1
|
94
48
|
},
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
{
|
100
|
-
serve
|
101
|
-
} = await import("./serve.native.js");
|
102
|
-
await serve({
|
103
|
-
port: args.port ? +args.port : void 0,
|
104
|
-
host: args.host,
|
105
|
-
cacheHeaders: args.cacheHeaders === !1 ? "off" : void 0,
|
106
|
-
compress: args.compress,
|
107
|
-
platform: args.platform === "vercel" ? "vercel" : "node"
|
108
|
-
});
|
49
|
+
// limit the pages built
|
50
|
+
only: {
|
51
|
+
type: "string",
|
52
|
+
required: !1
|
109
53
|
}
|
110
|
-
}
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
54
|
+
},
|
55
|
+
async run(param) {
|
56
|
+
var { args } = param, { build } = await import("./vite/build");
|
57
|
+
await build(args), process.exit(0);
|
58
|
+
}
|
59
|
+
}), serveCommand = defineCommand({
|
60
|
+
meta: {
|
61
|
+
name: "serve",
|
62
|
+
version,
|
63
|
+
description: "Serve a built app for production"
|
64
|
+
},
|
65
|
+
args: {
|
66
|
+
host: {
|
67
|
+
type: "string"
|
116
68
|
},
|
117
|
-
|
118
|
-
|
119
|
-
async run(param) {
|
120
|
-
var {
|
121
|
-
args
|
122
|
-
} = param,
|
123
|
-
{
|
124
|
-
run
|
125
|
-
} = await import("./cli/prebuild.native.js");
|
126
|
-
await run(args);
|
127
|
-
}
|
128
|
-
}),
|
129
|
-
clean = defineCommand({
|
130
|
-
meta: {
|
131
|
-
name: "clean",
|
132
|
-
version: "0.0.0",
|
133
|
-
description: "Clean build folders"
|
69
|
+
port: {
|
70
|
+
type: "string"
|
134
71
|
},
|
135
|
-
|
136
|
-
|
137
|
-
var {
|
138
|
-
clean: vxrnClean
|
139
|
-
} = await import("vxrn");
|
140
|
-
await vxrnClean({
|
141
|
-
root: process.cwd()
|
142
|
-
});
|
143
|
-
}
|
144
|
-
}),
|
145
|
-
main = defineCommand({
|
146
|
-
meta: {
|
147
|
-
name: "main",
|
148
|
-
version,
|
149
|
-
description: "Welcome to One"
|
72
|
+
platform: {
|
73
|
+
type: "string"
|
150
74
|
},
|
151
|
-
|
152
|
-
|
153
|
-
var {
|
154
|
-
args
|
155
|
-
} = param;
|
156
|
-
if (!["clean", "prebuild"].includes(args._[0])) {
|
157
|
-
var {
|
158
|
-
cliMain
|
159
|
-
} = await import("./cli/main.native.js");
|
160
|
-
await cliMain(args);
|
161
|
-
}
|
75
|
+
compress: {
|
76
|
+
type: "boolean"
|
162
77
|
},
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
78
|
+
cacheHeaders: {
|
79
|
+
type: "boolean"
|
80
|
+
}
|
81
|
+
},
|
82
|
+
async run(param) {
|
83
|
+
var { args } = param, { serve } = await import("./serve");
|
84
|
+
await serve({
|
85
|
+
port: args.port ? +args.port : void 0,
|
86
|
+
host: args.host,
|
87
|
+
cacheHeaders: args.cacheHeaders === !1 ? "off" : void 0,
|
88
|
+
compress: args.compress,
|
89
|
+
platform: args.platform === "vercel" ? "vercel" : "node"
|
90
|
+
});
|
91
|
+
}
|
92
|
+
}), prebuild = defineCommand({
|
93
|
+
meta: {
|
94
|
+
name: "prebuild",
|
95
|
+
version,
|
96
|
+
description: "Prebuild native iOS project"
|
97
|
+
},
|
98
|
+
// TODO: Android
|
99
|
+
args: {},
|
100
|
+
async run(param) {
|
101
|
+
var { args } = param, { run } = await import("./cli/prebuild");
|
102
|
+
await run(args);
|
103
|
+
}
|
104
|
+
}), clean = defineCommand({
|
105
|
+
meta: {
|
106
|
+
name: "clean",
|
107
|
+
version: "0.0.0",
|
108
|
+
description: "Clean build folders"
|
109
|
+
},
|
110
|
+
args: {},
|
111
|
+
async run() {
|
112
|
+
var { clean: vxrnClean } = await import("vxrn");
|
113
|
+
await vxrnClean({
|
114
|
+
root: process.cwd()
|
115
|
+
});
|
116
|
+
}
|
117
|
+
}), main = defineCommand({
|
118
|
+
meta: {
|
119
|
+
name: "main",
|
120
|
+
version,
|
121
|
+
description: "Welcome to One"
|
122
|
+
},
|
123
|
+
args: {},
|
124
|
+
async run(param) {
|
125
|
+
var { args } = param;
|
126
|
+
if (![
|
127
|
+
"clean",
|
128
|
+
"prebuild"
|
129
|
+
].includes(args._[0])) {
|
130
|
+
var { cliMain } = await import("./cli/main");
|
131
|
+
await cliMain(args);
|
169
132
|
}
|
170
|
-
}
|
133
|
+
},
|
134
|
+
subCommands: {
|
135
|
+
dev,
|
136
|
+
clean,
|
137
|
+
build: buildCommand,
|
138
|
+
prebuild,
|
139
|
+
serve: serveCommand
|
140
|
+
}
|
141
|
+
});
|
171
142
|
runMain(main);
|
172
|
-
//# sourceMappingURL=cli.
|
143
|
+
//# sourceMappingURL=cli.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/cli.ts"],
|
4
|
+
"mappings": "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",
|
5
|
+
"names": ["defineCommand", "runMain", "loadEnv", "readFileSync", "path", "fileURLToPath", "getPackageVersion", "dirname", "__dirname", "url", "packagePath", "join", "packageJson", "JSON", "parse", "version", "process", "cwd", "dev", "meta", "name", "description", "args", "clean", "type", "host", "port", "https", "run", "buildCommand", "step", "required", "only", "build", "exit", "serveCommand", "platform", "compress", "cacheHeaders", "serve", "undefined", "prebuild", "vxrnClean", "root", "main", "includes", "_", "cliMain", "subCommands"]
|
6
|
+
}
|
@@ -1,11 +1,14 @@
|
|
1
|
-
var clientLoaderResolver = null,
|
2
|
-
didRun = !1;
|
1
|
+
var clientLoaderResolver = null, didRun = !1;
|
3
2
|
function onClientLoaderResolve(resolver) {
|
4
|
-
if (didRun)
|
3
|
+
if (didRun)
|
4
|
+
throw new Error(process.env.NODE_ENV === "production" ? "Error 002" : "Error: You called onClientLoaderResolve after it was run, register it in your root _layout.tsx");
|
5
5
|
clientLoaderResolver = resolver;
|
6
6
|
}
|
7
7
|
async function resolveClientLoader(props) {
|
8
|
-
didRun = !0, clientLoaderResolver &&
|
8
|
+
didRun = !0, clientLoaderResolver && await clientLoaderResolver(props);
|
9
9
|
}
|
10
|
-
export {
|
11
|
-
|
10
|
+
export {
|
11
|
+
onClientLoaderResolve,
|
12
|
+
resolveClientLoader
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=clientLoaderResolver.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/clientLoaderResolver.ts"],
|
4
|
+
"mappings": "AAKA,IAAIA,uBAAoD,MACpDC,SAAS;AAEN,SAASC,sBAAsBC,UAA8B;AAClE,MAAIF;AACF,UAAM,IAAIG,MACRC,QAAQC,IAAIC,aAAa,eACrB,cACA,gGAAgG;AAGxGP,yBAAuBG;AACzB;AAEA,eAAsBK,oBAAoBC,OAA0B;AAElE,EADAR,SAAS,IACJD,wBACL,MAAMA,qBAAqBS,KAAAA;AAC7B;",
|
5
|
+
"names": ["clientLoaderResolver", "didRun", "onClientLoaderResolve", "resolver", "Error", "process", "env", "NODE_ENV", "resolveClientLoader", "props"]
|
6
|
+
}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { isWebServer } from "./constants
|
2
|
-
var CLIENT_RENDER_MODE = process.env.One_DEFAULT_RENDER_MODE,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
import { isWebServer } from "./constants";
|
2
|
+
var CLIENT_RENDER_MODE = process.env.One_DEFAULT_RENDER_MODE, getDefaultRenderMode = function() {
|
3
|
+
var _serverConfig_web, serverConfig = globalThis.__vxrnPluginConfig__;
|
4
|
+
if (isWebServer && !serverConfig)
|
5
|
+
throw new Error("Internal one error: should call setServerConfig before createManifest");
|
6
|
+
var _ref;
|
7
|
+
return (_ref = CLIENT_RENDER_MODE ?? (serverConfig == null || (_serverConfig_web = serverConfig.web) === null || _serverConfig_web === void 0 ? void 0 : _serverConfig_web.defaultRenderMode)) !== null && _ref !== void 0 ? _ref : "ssg";
|
8
|
+
};
|
9
|
+
export {
|
10
|
+
getDefaultRenderMode
|
11
|
+
};
|
12
|
+
//# sourceMappingURL=config.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/config.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,mBAAmB;AAG5B,IAAMC,qBAAqBC,QAAQC,IAAIC,yBAG1BC,uBAAuB,WAAA;MAOLC,mBANvBA,eAAeC,WAAW;AAEhC,MAAIP,eAAe,CAACM;AAClB,UAAM,IAAIE,MAAM,uEAAuE;MAGlFP;AAAP,UAAOA,OAAAA,uBAAsBK,gBAAAA,SAAAA,oBAAAA,aAAcG,SAAG,QAAjBH,sBAAAA,SAAAA,SAAAA,kBAAmBI,wBAAiB,QAA1DT,SAAAA,SAAAA,OAA8D;AACvE;",
|
5
|
+
"names": ["isWebServer", "CLIENT_RENDER_MODE", "process", "env", "One_DEFAULT_RENDER_MODE", "getDefaultRenderMode", "serverConfig", "globalThis", "Error", "web", "defaultRenderMode"]
|
6
|
+
}
|