expo-router 3.5.0 → 3.5.2
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/build/ExpoRoot.js +2 -1
- package/build/ExpoRoot.js.map +1 -1
- package/build/LocationProvider.js +3 -2
- package/build/LocationProvider.js.map +1 -1
- package/build/Route.js +4 -4
- package/build/Route.js.map +1 -1
- package/build/fork/NavigationContainer.d.ts +8 -2
- package/build/fork/NavigationContainer.d.ts.map +1 -1
- package/build/fork/NavigationContainer.js.map +1 -1
- package/build/fork/NavigationContainer.native.d.ts +8 -2
- package/build/fork/NavigationContainer.native.d.ts.map +1 -1
- package/build/fork/NavigationContainer.native.js.map +1 -1
- package/build/fork/extractPathFromURL.d.ts +5 -4
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.js +29 -43
- package/build/fork/extractPathFromURL.js.map +1 -1
- package/build/fork/findFocusedRoute.js +2 -1
- package/build/fork/findFocusedRoute.js.map +1 -1
- package/build/fork/getPathFromState.js +5 -4
- package/build/fork/getPathFromState.js.map +1 -1
- package/build/fork/getStateFromPath.js +5 -4
- package/build/fork/getStateFromPath.js.map +1 -1
- package/build/fork/useLinking.d.ts +42 -3
- package/build/fork/useLinking.d.ts.map +1 -1
- package/build/fork/useLinking.js +1 -1
- package/build/fork/useLinking.js.map +1 -1
- package/build/fork/useLinking.native.js +1 -1
- package/build/fork/useLinking.native.js.map +1 -1
- package/build/fork/validatePathConfig.js +1 -1
- package/build/fork/validatePathConfig.js.map +1 -1
- package/build/getDevServer/index.js.map +1 -1
- package/build/getLinkingConfig.js +3 -3
- package/build/getLinkingConfig.js.map +1 -1
- package/build/getReactNavigationConfig.js +3 -2
- package/build/getReactNavigationConfig.js.map +1 -1
- package/build/getRoutes.js +8 -7
- package/build/getRoutes.js.map +1 -1
- package/build/getServerManifest.js +3 -2
- package/build/getServerManifest.js.map +1 -1
- package/build/global-state/router-store.js +5 -5
- package/build/global-state/router-store.js.map +1 -1
- package/build/global-state/routing.js +11 -10
- package/build/global-state/routing.js.map +1 -1
- package/build/global-state/serverLocationContext.d.ts +1 -0
- package/build/global-state/serverLocationContext.d.ts.map +1 -1
- package/build/global-state/sort-routes.js +2 -1
- package/build/global-state/sort-routes.js.map +1 -1
- package/build/head/ExpoHead.android.js +2 -1
- package/build/head/ExpoHead.android.js.map +1 -1
- package/build/head/ExpoHead.ios.js.map +1 -1
- package/build/head/ExpoHeadModule.js.map +1 -1
- package/build/head/url.js +2 -1
- package/build/head/url.js.map +1 -1
- package/build/hooks.js +11 -10
- package/build/hooks.js.map +1 -1
- package/build/layouts/Drawer.d.ts +1 -0
- package/build/layouts/Drawer.d.ts.map +1 -1
- package/build/layouts/Stack.d.ts +1 -0
- package/build/layouts/Stack.d.ts.map +1 -1
- package/build/layouts/Tabs.d.ts +4 -4
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/withLayoutContext.js +3 -2
- package/build/layouts/withLayoutContext.js.map +1 -1
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +2 -2
- package/build/link/Link.js.map +1 -1
- package/build/link/href.d.ts.map +1 -1
- package/build/link/href.js.map +1 -1
- package/build/link/linking.d.ts.map +1 -1
- package/build/link/linking.js +31 -41
- package/build/link/linking.js.map +1 -1
- package/build/link/path.js +2 -1
- package/build/link/path.js.map +1 -1
- package/build/link/useLinkToPathProps.d.ts.map +1 -1
- package/build/link/useLinkToPathProps.js +1 -1
- package/build/link/useLinkToPathProps.js.map +1 -1
- package/build/link/useLoadedNavigation.d.ts.map +1 -1
- package/build/link/useLoadedNavigation.js +3 -2
- package/build/link/useLoadedNavigation.js.map +1 -1
- package/build/loadStaticParamsAsync.js +3 -2
- package/build/loadStaticParamsAsync.js.map +1 -1
- package/build/matchers.js +13 -12
- package/build/matchers.js.map +1 -1
- package/build/onboard/Tutorial.d.ts +1 -0
- package/build/onboard/Tutorial.d.ts.map +1 -1
- package/build/onboard/Tutorial.js +2 -1
- package/build/onboard/Tutorial.js.map +1 -1
- package/build/onboard/createEntryFile.js +3 -2
- package/build/onboard/createEntryFile.js.map +1 -1
- package/build/primitives.d.ts +1 -0
- package/build/primitives.d.ts.map +1 -1
- package/build/qualified-entry.d.ts +1 -0
- package/build/qualified-entry.d.ts.map +1 -1
- package/build/qualified-entry.js +2 -1
- package/build/qualified-entry.js.map +1 -1
- package/build/renderRootComponent.js +2 -1
- package/build/renderRootComponent.js.map +1 -1
- package/build/routes-manifest.js +2 -1
- package/build/routes-manifest.js.map +1 -1
- package/build/sortRoutes.js +3 -2
- package/build/sortRoutes.js.map +1 -1
- package/build/static/getRootComponent.js +2 -1
- package/build/static/getRootComponent.js.map +1 -1
- package/build/static/html.js +3 -2
- package/build/static/html.js.map +1 -1
- package/build/static/renderStaticContent.js +4 -2
- package/build/static/renderStaticContent.js.map +1 -1
- package/build/testing-library/context-stubs.d.ts +1 -0
- package/build/testing-library/context-stubs.d.ts.map +1 -1
- package/build/testing-library/context-stubs.js +3 -3
- package/build/testing-library/context-stubs.js.map +1 -1
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/index.js +2 -2
- package/build/testing-library/index.js.map +1 -1
- package/build/testing-library/mock-config.js +3 -2
- package/build/testing-library/mock-config.js.map +1 -1
- package/build/testing-library/mocks.js +2 -1
- package/build/testing-library/mocks.js.map +1 -1
- package/build/testing-library/require-context-ponyfill.js +1 -1
- package/build/testing-library/require-context-ponyfill.js.map +1 -1
- package/build/typed-routes/generate.js +2 -1
- package/build/typed-routes/generate.js.map +1 -1
- package/build/typed-routes/index.d.ts.map +1 -1
- package/build/typed-routes/index.js +2 -2
- package/build/typed-routes/index.js.map +1 -1
- package/build/useDeprecated.js +3 -2
- package/build/useDeprecated.js.map +1 -1
- package/build/useFocusEffect.js +2 -1
- package/build/useFocusEffect.js.map +1 -1
- package/build/useNavigation.js +3 -2
- package/build/useNavigation.js.map +1 -1
- package/build/useScreens.d.ts +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +4 -3
- package/build/useScreens.js.map +1 -1
- package/build/utils/url.js +4 -3
- package/build/utils/url.js.map +1 -1
- package/build/views/EmptyRoute.d.ts +1 -0
- package/build/views/EmptyRoute.d.ts.map +1 -1
- package/build/views/EmptyRoute.js +2 -1
- package/build/views/EmptyRoute.js.map +1 -1
- package/build/views/ErrorBoundary.d.ts +1 -0
- package/build/views/ErrorBoundary.d.ts.map +1 -1
- package/build/views/ErrorBoundary.js +2 -1
- package/build/views/ErrorBoundary.js.map +1 -1
- package/build/views/Navigator.d.ts +5 -5
- package/build/views/Navigator.d.ts.map +1 -1
- package/build/views/Navigator.js +7 -7
- package/build/views/Navigator.js.map +1 -1
- package/build/views/Pressable.d.ts.map +1 -1
- package/build/views/Screen.js +2 -1
- package/build/views/Screen.js.map +1 -1
- package/build/views/Sitemap.d.ts +1 -0
- package/build/views/Sitemap.d.ts.map +1 -1
- package/build/views/Sitemap.js +3 -2
- package/build/views/Sitemap.js.map +1 -1
- package/build/views/SuspenseFallback.d.ts +1 -0
- package/build/views/SuspenseFallback.d.ts.map +1 -1
- package/build/views/SuspenseFallback.js +2 -1
- package/build/views/SuspenseFallback.js.map +1 -1
- package/build/views/Toast.js +3 -3
- package/build/views/Toast.js.map +1 -1
- package/build/views/Try.js.map +1 -1
- package/build/views/Unmatched.d.ts +1 -0
- package/build/views/Unmatched.d.ts.map +1 -1
- package/build/views/Unmatched.js +2 -1
- package/build/views/Unmatched.js.map +1 -1
- package/package.json +4 -4
package/build/static/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;GAKG;AACH,kDAAsD;AAEtD;;GAEG;AACH,SAAgB,oBAAoB;IAClC,OAAO,CACL,CAAC,KAAK,CACJ,EAAE,CAAC,YAAY,CACf,uBAAuB,CAAC,CAAC;YACvB,MAAM,EAAE,sEAAsE;SAC/E,CAAC,EACF,CACH,CAAC;AACJ,CAAC;AATD,oDASC;AAED,SAAgB,IAAI,CAAC,EAAE,QAAQ,EAAqB;IAClD,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACb;MAAA,CAAC,IAAI,CACH;QAAA,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EACrB;QAAA,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,SAAS,EACnD;QAAA,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,uDAAuD,EACrF;QAAA,CAAC,oBAAoB,CAAC,AAAD,EACvB;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CACxB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAZD,oBAYC","sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React, { type PropsWithChildren } from 'react';\n\n/**\n * Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).\n */\nexport function ScrollViewStyleReset() {\n return (\n <style\n id=\"expo-reset\"\n dangerouslySetInnerHTML={{\n __html: `#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}`,\n }}\n />\n );\n}\n\nexport function Html({ children }: PropsWithChildren) {\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"utf-8\" />\n <meta httpEquiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\" />\n <ScrollViewStyleReset />\n </head>\n <body>{children}</body>\n </html>\n );\n}\n"]}
|
|
@@ -26,8 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getBuildTimeServerManifestAsync = exports.getManifest = void 0;
|
|
30
|
-
exports.getStaticContent = getStaticContent;
|
|
29
|
+
exports.getBuildTimeServerManifestAsync = exports.getManifest = exports.getStaticContent = void 0;
|
|
31
30
|
/**
|
|
32
31
|
* Copyright © 2023 650 Industries.
|
|
33
32
|
*
|
|
@@ -60,6 +59,7 @@ async function getManifest(options = {}) {
|
|
|
60
59
|
await (0, loadStaticParamsAsync_1.loadStaticParamsAsync)(routeTree);
|
|
61
60
|
return (0, getReactNavigationConfig_1.getReactNavigationConfig)(routeTree, false);
|
|
62
61
|
}
|
|
62
|
+
exports.getManifest = getManifest;
|
|
63
63
|
/**
|
|
64
64
|
* Get the server manifest with all dynamic routes loaded with `generateStaticParams`.
|
|
65
65
|
* Unlike the `expo-router/src/routes-manifest.ts` method, this requires loading the entire app in-memory, which
|
|
@@ -76,6 +76,7 @@ async function getBuildTimeServerManifestAsync(options = {}) {
|
|
|
76
76
|
await (0, loadStaticParamsAsync_1.loadStaticParamsAsync)(routeTree);
|
|
77
77
|
return (0, getServerManifest_1.getServerManifest)(routeTree);
|
|
78
78
|
}
|
|
79
|
+
exports.getBuildTimeServerManifestAsync = getBuildTimeServerManifestAsync;
|
|
79
80
|
function resetReactNavigationContexts() {
|
|
80
81
|
// https://github.com/expo/router/discussions/588
|
|
81
82
|
// https://github.com/react-navigation/react-navigation/blob/9fe34b445fcb86e5666f61e144007d7540f014fa/packages/elements/src/getNamedContext.tsx#LL3C1-L4C1
|
|
@@ -124,6 +125,7 @@ async function getStaticContent(location) {
|
|
|
124
125
|
output = output.replace('</head>', `${fonts.join('')}</head>`);
|
|
125
126
|
return '<!DOCTYPE html>' + output;
|
|
126
127
|
}
|
|
128
|
+
exports.getStaticContent = getStaticContent;
|
|
127
129
|
function mixHeadComponentsWithStaticResults(helmet, html) {
|
|
128
130
|
// Head components
|
|
129
131
|
for (const key of ['title', 'priority', 'meta', 'link', 'script', 'style'].reverse()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderStaticContent.js","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"renderStaticContent.js","sourceRoot":"","sources":["../../src/static/renderStaticContent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,+BAA6B;AAE7B,qDAA+E;AAC/E,6DAA+C;AAC/C,kDAA0B;AAC1B,wEAAmD;AACnD,uDAA+C;AAE/C,yDAAsD;AACtD,qCAAiC;AACjC,0CAAuC;AACvC,0EAAuE;AACvE,4CAAyC;AACzC,4DAAqF;AACrF,kCAA+B;AAC/B,oEAAiE;AAEjE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,CAAC;AAElE,8BAAW,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,mBAAQ,CAAC,CAAC;AAErD,uDAAuD;AACvD,KAAK,UAAU,WAAW,CAAC,UAA2C,EAAE;IACtE,MAAM,SAAS,GAAG,IAAA,qBAAS,EAAC,UAAG,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAE1E,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;IAED,6BAA6B;IAC7B,MAAM,IAAA,6CAAqB,EAAC,SAAS,CAAC,CAAC;IAEvC,OAAO,IAAA,mDAAwB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC;AA+GQ,kCAAW;AA7GpB;;;;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M,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE;YACV,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;SAClD;KACF;IAED,aAAa;IACb,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7E,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport '@expo/metro-runtime';\n\nimport { ServerContainer, ServerContainerRef } from '@react-navigation/native';\nimport * as Font from 'expo-font/build/server';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server.node';\nimport { AppRegistry } from 'react-native-web';\n\nimport { getRootComponent } from './getRootComponent';\nimport { ctx } from '../../_ctx';\nimport { ExpoRoot } from '../ExpoRoot';\nimport { getReactNavigationConfig } from '../getReactNavigationConfig';\nimport { getRoutes } from '../getRoutes';\nimport { ExpoRouterServerManifestV1, getServerManifest } from '../getServerManifest';\nimport { Head } from '../head';\nimport { loadStaticParamsAsync } from '../loadStaticParamsAsync';\n\nconst debug = require('debug')('expo:router:renderStaticContent');\n\nAppRegistry.registerComponent('App', () => ExpoRoot);\n\n/** Get the linking manifest from a Node.js process. */\nasync function getManifest(options: Parameters<typeof getRoutes>[1] = {}) {\n const routeTree = getRoutes(ctx, { preserveApiRoutes: true, ...options });\n\n if (!routeTree) {\n throw new Error('No routes found');\n }\n\n // Evaluate all static params\n await loadStaticParamsAsync(routeTree);\n\n return getReactNavigationConfig(routeTree, false);\n}\n\n/**\n * Get the server manifest with all dynamic routes loaded with `generateStaticParams`.\n * Unlike the `expo-router/src/routes-manifest.ts` method, this requires loading the entire app in-memory, which\n * takes substantially longer and requires Metro bundling.\n *\n * This is used for the production manifest where we pre-render certain pages and should no longer treat them as dynamic.\n */\nasync function getBuildTimeServerManifestAsync(\n options: Parameters<typeof getRoutes>[1] = {}\n): Promise<ExpoRouterServerManifestV1> {\n const routeTree = getRoutes(ctx, options);\n\n if (!routeTree) {\n throw new Error('No routes found');\n }\n\n // Evaluate all static params\n await loadStaticParamsAsync(routeTree);\n\n return getServerManifest(routeTree);\n}\n\nfunction resetReactNavigationContexts() {\n // https://github.com/expo/router/discussions/588\n // https://github.com/react-navigation/react-navigation/blob/9fe34b445fcb86e5666f61e144007d7540f014fa/packages/elements/src/getNamedContext.tsx#LL3C1-L4C1\n\n // React Navigation is storing providers in a global, this is fine for the first static render\n // but subsequent static renders of Stack or Tabs will cause React to throw a warning. To prevent this warning, we'll reset the globals before rendering.\n const contexts = '__react_navigation__elements_contexts';\n global[contexts] = new Map<string, React.Context<any>>();\n}\n\nexport async function getStaticContent(location: URL): Promise<string> {\n const headContext: { helmet?: any } = {};\n\n const ref = React.createRef<ServerContainerRef>();\n\n const {\n // NOTE: The `element` that's returned adds two extra Views and\n // the seemingly unused `RootTagContext.Provider`.\n element,\n getStyleElement,\n } = AppRegistry.getApplication('App', {\n initialProps: {\n location,\n context: ctx,\n wrapper: ({ children }) => (\n <Root>\n <div id=\"root\">{children}</div>\n </Root>\n ),\n },\n });\n\n const Root = getRootComponent();\n\n // Clear any existing static resources from the global scope to attempt to prevent leaking between pages.\n // This could break if pages are rendered in parallel or if fonts are loaded outside of the React tree\n Font.resetServerContext();\n\n // This MUST be run before `ReactDOMServer.renderToString` to prevent\n // \"Warning: Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.\"\n resetReactNavigationContexts();\n\n const stream = await ReactDOMServer.renderToStaticNodeStream(\n <Head.Provider context={headContext}>\n <ServerContainer ref={ref}>{element}</ServerContainer>\n </Head.Provider>\n );\n\n let html = '';\n\n for await (const chunk of stream) {\n html += chunk;\n }\n\n // Eval the CSS after the HTML is rendered so that the CSS is in the same order\n const css = ReactDOMServer.renderToStaticMarkup(getStyleElement());\n\n let output = mixHeadComponentsWithStaticResults(headContext.helmet, html);\n\n output = output.replace('</head>', `${css}</head>`);\n\n const fonts = Font.getServerResources();\n debug(`Pushing static fonts: (count: ${fonts.length})`, fonts);\n // debug('Push static fonts:', fonts)\n // Inject static fonts loaded with expo-font\n output = output.replace('</head>', `${fonts.join('')}</head>`);\n\n return '<!DOCTYPE html>' + output;\n}\n\nfunction mixHeadComponentsWithStaticResults(helmet: any, html: string) {\n // Head components\n for (const key of ['title', 'priority', 'meta', 'link', 'script', 'style'].reverse()) {\n const result = helmet?.[key]?.toString();\n if (result) {\n html = html.replace('<head>', `<head>${result}`);\n }\n }\n\n // attributes\n html = html.replace('<html ', `<html ${helmet?.htmlAttributes.toString()} `);\n html = html.replace('<body ', `<body ${helmet?.bodyAttributes.toString()} `);\n\n return html;\n}\n\n// Re-export for use in server\nexport { getManifest, getBuildTimeServerManifestAsync };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,QAAQ,GAChB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzC,CAAC,GACF,cAAc,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,CAAC;AAI1B,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAE/C,MAAM;;;;;;mBAKH,MAAM;;;EAU1B;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAI1E,MAAM;;mBAUH,MAAM;;EAI1B"}
|
|
1
|
+
{"version":3,"file":"context-stubs.d.ts","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";AAEA,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,QAAQ,GAChB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzC,CAAC,GACF,cAAc,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,CAAC;AAI1B,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAE/C,MAAM;;;;;;mBAKH,MAAM;;;EAU1B;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,SAI1E,MAAM;;mBAUH,MAAM;;EAI1B"}
|
|
@@ -3,9 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.requireContext = void 0;
|
|
7
|
-
exports.inMemoryContext = inMemoryContext;
|
|
8
|
-
exports.requireContextWithOverrides = requireContextWithOverrides;
|
|
6
|
+
exports.requireContextWithOverrides = exports.inMemoryContext = exports.requireContext = void 0;
|
|
9
7
|
const path_1 = __importDefault(require("path"));
|
|
10
8
|
const require_context_ponyfill_1 = __importDefault(require("./require-context-ponyfill"));
|
|
11
9
|
exports.requireContext = require_context_ponyfill_1.default;
|
|
@@ -24,6 +22,7 @@ function inMemoryContext(context) {
|
|
|
24
22
|
}),
|
|
25
23
|
});
|
|
26
24
|
}
|
|
25
|
+
exports.inMemoryContext = inMemoryContext;
|
|
27
26
|
function requireContextWithOverrides(dir, overrides) {
|
|
28
27
|
const existingContext = (0, require_context_ponyfill_1.default)(path_1.default.resolve(process.cwd(), dir));
|
|
29
28
|
return Object.assign(function (id) {
|
|
@@ -40,4 +39,5 @@ function requireContextWithOverrides(dir, overrides) {
|
|
|
40
39
|
id: '0',
|
|
41
40
|
});
|
|
42
41
|
}
|
|
42
|
+
exports.requireContextWithOverrides = requireContextWithOverrides;
|
|
43
43
|
//# sourceMappingURL=context-stubs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"context-stubs.js","sourceRoot":"","sources":["../../src/testing-library/context-stubs.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,0FAAwD;AAU/C,yBAVF,kCAAc,CAUE;AAEvB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEvD,SAAgB,eAAe,CAAC,OAAiC;IAC/D,OAAO,MAAM,CAAC,MAAM,CAClB,UAAU,EAAU;QAClB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnD,OAAO,OAAO,OAAO,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC,CA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GAAG,eAAe,CAAC,IAAI,EAAE,CAAC;QAClE,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG;QAC7B,EAAE,EAAE,GAAG;KACR,CACF,CAAC;AACJ,CAAC;AAlBD,kEAkBC","sourcesContent":["import path from 'path';\n\nimport requireContext from './require-context-ponyfill';\n\nexport type ReactComponent = () => React.ReactElement<any, any> | null;\nexport type FileStub =\n | (Record<string, unknown> & {\n default: ReactComponent;\n unstable_settings?: Record<string, any>;\n })\n | ReactComponent;\n\nexport { requireContext };\n\nconst validExtensions = ['.js', '.jsx', '.ts', '.tsx'];\n\nexport function inMemoryContext(context: Record<string, FileStub>) {\n return Object.assign(\n function (id: string) {\n id = id.replace(/^\\.\\//, '').replace(/\\.\\w*$/, '');\n return typeof context[id] === 'function' ? { default: context[id] } : context[id];\n },\n {\n resolve: (key: string) => key,\n id: '0',\n keys: () =>\n Object.keys(context).map((key) => {\n const ext = path.extname(key);\n key = key.replace(/^\\.\\//, '');\n return validExtensions.includes(ext) ? `./${key}` : `./${key}.js`;\n }),\n }\n );\n}\n\nexport function requireContextWithOverrides(dir: string, overrides: Record<string, FileStub>) {\n const existingContext = requireContext(path.resolve(process.cwd(), dir));\n\n return Object.assign(\n function (id: string) {\n if (id in overrides) {\n const route = overrides[id];\n return typeof route === 'function' ? { default: route } : route;\n } else {\n return existingContext(id);\n }\n },\n {\n keys: () => [...Object.keys(overrides), ...existingContext.keys()],\n resolve: (key: string) => key,\n id: '0',\n }\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAO,MAAM,EAAwB,MAAM,+BAA+B,CAAC;AAGlF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EA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,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;YACjE,iBAAiB,CAAC,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACvE;KACF;CACF;AAED,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAE5D,wBAAgB,YAAY,CAC1B,OAAO,GAAE,iBAA2B,EACpC,EAAE,UAAgB,EAAE,GAAG,OAAO,EAAE,GAAE,mBAAwB,GACzD,MAAM,CAyCR;AAED,eAAO,MAAM,UAAU;IACrB,yDAAyD;mBAC1C,MAAM;IAIrB,yDAAyD;eAC9C,MAAM;IAIjB,6DAA6D;kBAC/C,MAAM;IAIpB,oDAAoD;gBACxC,MAAM;IAOlB,qEAAqE;;IAIrE,wEAAwE;uBACrD,OAAO,MAAM,EAAE,MAAM,CAAC,SAAS,MAAM;IAMxD,qEAAqE;;CAItE,CAAC"}
|
|
@@ -17,8 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.testRouter = exports.getMockContext = exports.getMockConfig = void 0;
|
|
21
|
-
exports.renderRouter = renderRouter;
|
|
20
|
+
exports.testRouter = exports.renderRouter = exports.getMockContext = exports.getMockConfig = void 0;
|
|
22
21
|
require("./expect");
|
|
23
22
|
const react_native_1 = require("@testing-library/react-native");
|
|
24
23
|
const react_1 = __importDefault(require("react"));
|
|
@@ -72,6 +71,7 @@ function renderRouter(context = './app', { initialUrl = '/', ...options } = {})
|
|
|
72
71
|
},
|
|
73
72
|
});
|
|
74
73
|
}
|
|
74
|
+
exports.renderRouter = renderRouter;
|
|
75
75
|
exports.testRouter = {
|
|
76
76
|
/** Navigate to the provided pathname and the pathname */
|
|
77
77
|
navigate(path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing-library/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oBAAkB;AAGlB,gEAAkF;AAClF,kDAA0B;AAE1B,+CAAiF;AAuCrD,8FAvCA,2BAAa,OAuCA;AAAE,+FAvCA,4BAAc,OAuCA;AAtCzD,mCAAwC;AACxC,0CAAuC;AACvC,gFAAwD;AACxD,0DAAiD;AACjD,+DAAqD;AACrD,sDAA2C;AAE3C,uBAAuB;AACvB,gEAA8C;AAE9C,QAAQ,CAAC,GAAG,EAAE;IACZ,oBAAK,CAAC,OAAO,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AA4BH,SAAgB,YAAY,CAC1B,UAA6B,OAAO,EACpC,EAAE,UAAU,GAAG,GAAG,EAAE,GAAG,OAAO,KAA0B,EAAE;IAE1D,IAAI,CAAC,aAAa,EAAE,CAAC;IAErB,MAAM,WAAW,GAAG,IAAA,4BAAc,EAAC,OAAO,CAAC,CAAC;IAE5C,wBAAwB;IACxB,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAE1B,qCAAqC;IACrC,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,MAAM,CAAC;IAC7C,6BAAU,CAAC,KAAK,EAAE,CAAC;IAEnB,IAAI,QAAyB,CAAC;IAE9B,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAClC,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KAC3C;SAAM,IAAI,UAAU,YAAY,GAAG,EAAE;QACpC,QAAQ,GAAG,UAAU,CAAC;KACvB;IAED,MAAM,MAAM,GAAG,IAAA,qBAAM,EAAC,CAAC,mBAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC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AAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACD,oDAAoD;IACpD,IAAI,CAAC,IAAa;QAChB,MAAM,CAAC,uBAAM,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,IAAA,kBAAG,EAAC,GAAG,EAAE,CAAC,uBAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,qBAAM,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC;IACD,qEAAqE;IACrE,SAAS;QACP,OAAO,uBAAM,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IACD,wEAAwE;IACxE,SAAS,CAAC,MAA+B,EAAE,IAAa;QACtD,uBAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,qBAAM,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC;IACD,qEAAqE;IACrE,UAAU;QACR,IAAA,kBAAG,EAAC,GAAG,EAAE,CAAC,uBAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IACjC,CAAC;CACF,CAAC","sourcesContent":["import './expect';\n\nimport { NavigationState, PartialState } from '@react-navigation/native';\nimport { act, render, RenderResult, screen } from '@testing-library/react-native';\nimport React from 'react';\n\nimport { MockContextConfig, getMockConfig, getMockContext } from './mock-config';\nimport { setInitialUrl } from './mocks';\nimport { ExpoRoot } from '../ExpoRoot';\nimport getPathFromState from '../fork/getPathFromState';\nimport { stateCache } from '../getLinkingConfig';\nimport { store } from '../global-state/router-store';\nimport { router } from '../imperative-api';\n\n// re-export everything\nexport * from '@testing-library/react-native';\n\nafterAll(() => {\n store.cleanup();\n});\n\ntype RenderRouterOptions = Parameters<typeof render>[1] & {\n initialUrl?: any;\n};\n\ntype Result = ReturnType<typeof render> & {\n getPathname(): string;\n getPathnameWithParams(): string;\n getSegments(): string[];\n getSearchParams(): Record<string, string | string[]>;\n getRouterState(): NavigationState<any> | PartialState<any>;\n};\n\ndeclare global {\n namespace jest {\n interface Matchers<R> {\n toHavePathname(pathname: string): R;\n toHavePathnameWithParams(pathname: string): R;\n toHaveSegments(segments: string[]): R;\n toHaveSearchParams(params: Record<string, string | string[]>): R;\n toHaveRouterState(state: NavigationState<any> | PartialState<any>): R;\n }\n }\n}\n\nexport { MockContextConfig, getMockConfig, getMockContext };\n\nexport function renderRouter(\n context: MockContextConfig = './app',\n { initialUrl = '/', ...options }: RenderRouterOptions = {}\n): Result {\n jest.useFakeTimers();\n\n const mockContext = getMockContext(context);\n\n // Reset the initial URL\n setInitialUrl(initialUrl);\n\n // Force the render to be synchronous\n process.env.EXPO_ROUTER_IMPORT_MODE = 'sync';\n stateCache.clear();\n\n let location: URL | undefined;\n\n if (typeof initialUrl === 'string') {\n location = new URL(initialUrl, 'test://');\n } else if (initialUrl instanceof URL) {\n location = initialUrl;\n }\n\n const result = render(<ExpoRoot context={mockContext} location={location} />, {\n ...options,\n });\n\n return Object.assign(result, {\n getPathname(this: RenderResult): string {\n return store.routeInfoSnapshot().pathname;\n },\n getSegments(this: RenderResult): string[] {\n return store.routeInfoSnapshot().segments;\n },\n getSearchParams(this: RenderResult): Record<string, string | string[]> {\n return store.routeInfoSnapshot().params;\n },\n getPathnameWithParams(this: RenderResult): string {\n return getPathFromState(store.rootState!, store.linking!.config);\n },\n getRouterState(this: RenderResult) {\n return store.rootStateSnapshot();\n },\n });\n}\n\nexport const testRouter = {\n /** Navigate to the provided pathname and the pathname */\n navigate(path: string) {\n act(() => router.navigate(path));\n expect(screen).toHavePathnameWithParams(path);\n },\n /** Push the provided pathname and assert the pathname */\n push(path: string) {\n act(() => router.push(path));\n expect(screen).toHavePathnameWithParams(path);\n },\n /** Replace with provided pathname and assert the pathname */\n replace(path: string) {\n act(() => router.replace(path));\n expect(screen).toHavePathnameWithParams(path);\n },\n /** Go back in history and asset the new pathname */\n back(path?: string) {\n expect(router.canGoBack()).toBe(true);\n act(() => router.back());\n if (path) {\n expect(screen).toHavePathnameWithParams(path);\n }\n },\n /** If there's history that supports invoking the `back` function. */\n canGoBack() {\n return router.canGoBack();\n },\n /** Update the current route query params and assert the new pathname */\n setParams(params?: Record<string, string>, path?: string) {\n router.setParams(params);\n if (path) {\n expect(screen).toHavePathnameWithParams(path);\n }\n },\n /** If there's history that supports invoking the `back` function. */\n dismissAll() {\n act(() => router.dismissAll());\n },\n};\n"]}
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getMockConfig =
|
|
7
|
-
exports.getMockContext = getMockContext;
|
|
6
|
+
exports.getMockContext = exports.getMockConfig = void 0;
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
9
8
|
const context_stubs_1 = require("./context-stubs");
|
|
10
9
|
const getLinkingConfig_1 = require("../getLinkingConfig");
|
|
@@ -15,6 +14,7 @@ function isOverrideContext(context) {
|
|
|
15
14
|
function getMockConfig(context, metaOnly = true) {
|
|
16
15
|
return (0, getLinkingConfig_1.getNavigationConfig)((0, getRoutes_1.getExactRoutes)(getMockContext(context)), metaOnly);
|
|
17
16
|
}
|
|
17
|
+
exports.getMockConfig = getMockConfig;
|
|
18
18
|
function getMockContext(context) {
|
|
19
19
|
if (typeof context === 'string') {
|
|
20
20
|
return (0, context_stubs_1.requireContext)(path_1.default.resolve(process.cwd(), context));
|
|
@@ -29,4 +29,5 @@ function getMockContext(context) {
|
|
|
29
29
|
return (0, context_stubs_1.inMemoryContext)(context);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
exports.getMockContext = getMockContext;
|
|
32
33
|
//# sourceMappingURL=mock-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-config.js","sourceRoot":"","sources":["../../src/testing-library/mock-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock-config.js","sourceRoot":"","sources":["../../src/testing-library/mock-config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,mDAKyB;AACzB,0DAA0D;AAC1D,4CAA8C;AAE9C,SAAS,iBAAiB,CACxB,OAAe;IAEf,OAAO,OAAO,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,QAAQ,IAAI,OAAO,CAAC,CAAC;AACrE,CAAC;AAaD,SAAgB,aAAa,CAAC,OAA0B,EAAE,WAAoB,IAAI;IAChF,OAAO,IAAA,sCAAmB,EAAC,IAAA,0BAAc,EAAC,cAAc,CAAC,OAAO,CAAC,CAAE,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAFD,sCAEC;AAED,SAAgB,cAAc,CAAC,OAA0B;IACvD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,IAAA,8BAAc,EAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;KAC7D;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACjC,OAAO,IAAA,+BAAe,EACpB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;KACH;SAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;QACrC,OAAO,IAAA,2CAA2B,EAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;KACvE;SAAM;QACL,OAAO,IAAA,+BAAe,EAAC,OAAO,CAAC,CAAC;KACjC;AACH,CAAC;AAZD,wCAYC","sourcesContent":["import path from 'path';\n\nimport {\n FileStub,\n inMemoryContext,\n requireContext,\n requireContextWithOverrides,\n} from './context-stubs';\nimport { getNavigationConfig } from '../getLinkingConfig';\nimport { getExactRoutes } from '../getRoutes';\n\nfunction isOverrideContext(\n context: object\n): context is { appDir: string; overrides: Record<string, FileStub> } {\n return Boolean(typeof context === 'object' && 'appDir' in context);\n}\n\nexport type MockContextConfig =\n | string // Pathname to a directory\n | string[] // Array of filenames to mock as empty components, e.g () => null\n | Record<string, FileStub> // Map of filenames and their exports\n | {\n // Directory to load as context\n appDir: string;\n // Map of filenames and their exports. Will override contents of files loaded in `appDir\n overrides: Record<string, FileStub>;\n };\n\nexport function getMockConfig(context: MockContextConfig, metaOnly: boolean = true) {\n return getNavigationConfig(getExactRoutes(getMockContext(context))!, metaOnly);\n}\n\nexport function getMockContext(context: MockContextConfig) {\n if (typeof context === 'string') {\n return requireContext(path.resolve(process.cwd(), context));\n } else if (Array.isArray(context)) {\n return inMemoryContext(\n Object.fromEntries(context.map((filename) => [filename, { default: () => null }]))\n );\n } else if (isOverrideContext(context)) {\n return requireContextWithOverrides(context.appDir, context.overrides);\n } else {\n return inMemoryContext(context);\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setInitialUrl =
|
|
3
|
+
exports.setInitialUrl = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Optionally enable @testing-library/jest-native/extend-expect. We use this internally for the `toBeOnTheScreen` matcher()
|
|
6
6
|
*/
|
|
@@ -27,6 +27,7 @@ let mockInitialUrl = '';
|
|
|
27
27
|
function setInitialUrl(value) {
|
|
28
28
|
mockInitialUrl = value;
|
|
29
29
|
}
|
|
30
|
+
exports.setInitialUrl = setInitialUrl;
|
|
30
31
|
jest.mock('expo-linking', () => {
|
|
31
32
|
const module = {
|
|
32
33
|
...jest.requireActual('expo-linking'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/testing-library/mocks.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAI;IACF,OAAO,CAAC,4CAA4C,CAAC,CAAC;CACvD;AAAC,MAAM,GAAE;AAEV,gGAAgG;AAChG,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACxC,IAAI;QACF,MAAM,UAAU,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;QAE3D,wEAAwE;QACxE,iCAAiC;QACjC,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QAEnC,OAAO,UAAU,CAAC;KACnB;IAAC,MAAM;QACN,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC,CAAC;AAEH,kHAAkH;AAClH,IAAI,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;AAElE,IAAI,cAAc,GAA6B,EAAE,CAAC;AAElD,SAAgB,aAAa,CAAC,KAAa;IACzC,cAAc,GAAG,KAAK,CAAC;AACzB,CAAC;AAFD,sCAEC;AAED,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAkC;QAC5C,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;QACrC,SAAS,CAAC,IAAY;YACpB,OAAO,eAAe,GAAG,IAAI,CAAC;QAChC,CAAC;QACD,aAAa;YACX,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,gBAAgB;YACd,OAAO,EAAE,MAAM,KAAI,CAAC,EAAS,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,aAAa;YACjB,OAAO,cAAc,CAAC;QACxB,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Optionally enable @testing-library/jest-native/extend-expect. We use this internally for the `toBeOnTheScreen` matcher()\n */\ntry {\n require('@testing-library/jest-native/extend-expect');\n} catch {}\n\n// include this section and the NativeAnimatedHelper section for mocking react-native-reanimated\njest.mock('react-native-reanimated', () => {\n try {\n const Reanimated = require('react-native-reanimated/mock');\n\n // The mock for `call` immediately calls the callback which is incorrect\n // So we override it with a no-op\n Reanimated.default.call = () => {};\n\n return Reanimated;\n } catch {\n return {};\n }\n});\n\n// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing\njest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');\n\nlet mockInitialUrl: string | Promise<string> = '';\n\nexport function setInitialUrl(value: string) {\n mockInitialUrl = value;\n}\n\njest.mock('expo-linking', () => {\n const module: typeof import('expo-linking') = {\n ...jest.requireActual('expo-linking'),\n createURL(path: string) {\n return 'yourscheme://' + path;\n },\n resolveScheme() {\n return 'yourscheme';\n },\n addEventListener() {\n return { remove() {} } as any;\n },\n async getInitialURL() {\n return mockInitialUrl;\n },\n };\n\n return module;\n});\n"]}
|
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = requireContext;
|
|
7
6
|
// @ts-ignore: types node
|
|
8
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
8
|
// @ts-ignore: types node
|
|
@@ -40,4 +39,5 @@ function requireContext(base = '.', scanSubDirectories = true, regularExpression
|
|
|
40
39
|
});
|
|
41
40
|
return context;
|
|
42
41
|
}
|
|
42
|
+
exports.default = requireContext;
|
|
43
43
|
//# sourceMappingURL=require-context-ponyfill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-context-ponyfill.js","sourceRoot":"","sources":["../../src/testing-library/require-context-ponyfill.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"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9B,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG;QAC7B,EAAE,EAAE,GAAG;QACP,KAAK,CAAC,IAAY;YAChB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,QAAQ,CAAC,IAAY;YACnB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;KACF,CACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AA5CD,iCA4CC","sourcesContent":["// @ts-ignore: types node\nimport fs from 'node:fs';\n// @ts-ignore: types node\nimport path from 'node:path';\n\nimport type { RequireContext } from '../types';\n\ninterface RequireContextPonyFill extends RequireContext {\n __add(file: string): void;\n __delete(file: string): void;\n}\n\nexport default function requireContext(\n base = '.',\n scanSubDirectories = true,\n regularExpression = /\\.[tj]sx?$/\n) {\n const files: Record<string, unknown> = {};\n\n function readDirectory(directory: string) {\n fs.readdirSync(directory).forEach((file: string) => {\n const fullPath = path.resolve(directory, file);\n const relativePath = `./${path.relative(base, fullPath).split(path.sep).join('/')}`;\n\n if (fs.statSync(fullPath).isDirectory()) {\n if (scanSubDirectories) readDirectory(fullPath);\n\n return;\n }\n\n if (!regularExpression.test(relativePath)) return;\n\n files[relativePath] = true;\n });\n }\n\n readDirectory(base);\n\n const context: RequireContextPonyFill = Object.assign(\n function Module(file: string) {\n return require(path.join(base, file));\n },\n {\n keys: () => Object.keys(files),\n resolve: (key: string) => key,\n id: '0',\n __add(file: string) {\n files[file] = true;\n },\n __delete(file: string) {\n delete files[file];\n },\n }\n );\n\n return context;\n}\n"]}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTypedRoutesDeclarationFile =
|
|
6
|
+
exports.getTypedRoutesDeclarationFile = void 0;
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const getRoutes_1 = require("../getRoutes");
|
|
@@ -31,6 +31,7 @@ function getTypedRoutesDeclarationFile(ctx) {
|
|
|
31
31
|
.replace('type DynamicRoutes<T extends string> = string;', `type DynamicRoutes<T extends string> = ${setToUnionType(dynamicRoutes)};`)
|
|
32
32
|
.replace('type DynamicRouteTemplate = never;', `type DynamicRouteTemplate = ${setToUnionType(dynamicRouteContextKeys)};`));
|
|
33
33
|
}
|
|
34
|
+
exports.getTypedRoutesDeclarationFile = getTypedRoutesDeclarationFile;
|
|
34
35
|
/**
|
|
35
36
|
* Walks a RouteNode tree and adds the routes to the provided sets
|
|
36
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/typed-routes/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/typed-routes/generate.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,gDAAwB;AAGxB,4CAAyC;AACzC,0CAAsE;AAGtE,oCAAoC;AACpC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AACnC,6BAA6B;AAC7B,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,SAAgB,6BAA6B,CAAC,GAAmB;IAC/D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;IACxC,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAU,CAAC;IAElD,aAAa,CACX,IAAA,qBAAS,EAAC,GAAG,EAAE;QACb,iBAAiB,EAAE,IAAI;QACvB,mBAAmB,EAAE,IAAI;QACzB,UAAU,EAAE,OAAO;KACpB,CAAC,EACF,YAAY,EACZ,aAAa,EACb,uBAAuB,CACxB,CAAC;IAEF,mFAAmF;IACnF,OAAO,CACL,iBAAE;SAC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M,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QACnC,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpD,QAAQ,CAAC,YAAY,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;QACzC,QAAQ,CAAC,YAAY,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtB,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import fs from 'node:fs';\nimport path from 'path';\n\nimport { RouteNode } from '../Route';\nimport { getRoutes } from '../getRoutes';\nimport { isTypedRoute, removeSupportedExtensions } from '../matchers';\nimport { RequireContext } from '../types';\n\n// /[...param1]/ - Match [...param1]\nconst CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\n// /[param1] - Match [param1]\nconst SLUG = /\\[.+?\\]/g;\n\nexport function getTypedRoutesDeclarationFile(ctx: RequireContext) {\n const staticRoutes = new Set<string>();\n const dynamicRoutes = new Set<string>();\n const dynamicRouteContextKeys = new Set<string>();\n\n walkRouteNode(\n getRoutes(ctx, {\n ignoreEntryPoints: true,\n ignoreRequireErrors: true,\n importMode: 'async',\n }),\n staticRoutes,\n dynamicRoutes,\n dynamicRouteContextKeys\n );\n\n // If the user has expo-router v3+ installed, we can use the types from the package\n return (\n fs\n .readFileSync(path.join(__dirname, '../../types/expo-router.d.ts'), 'utf-8')\n // Swap from being a namespace to a module\n .replace('declare namespace ExpoRouter {', `declare module \"expo-router\" {`)\n // Add the route values\n .replace(\n 'type StaticRoutes = string;',\n `type StaticRoutes = ${setToUnionType(staticRoutes)};`\n )\n .replace(\n 'type DynamicRoutes<T extends string> = string;',\n `type DynamicRoutes<T extends string> = ${setToUnionType(dynamicRoutes)};`\n )\n .replace(\n 'type DynamicRouteTemplate = never;',\n `type DynamicRouteTemplate = ${setToUnionType(dynamicRouteContextKeys)};`\n )\n );\n}\n\n/**\n * Walks a RouteNode tree and adds the routes to the provided sets\n */\nfunction walkRouteNode(\n routeNode: RouteNode | null,\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteContextKeys: Set<string>\n) {\n if (!routeNode) return;\n\n addRouteNode(routeNode, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);\n\n for (const child of routeNode.children) {\n walkRouteNode(child, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);\n }\n}\n\n/**\n * Given a RouteNode, adds the route to the correct sets\n * Modifies the RouteNode.route to be a typed-route string\n */\nfunction addRouteNode(\n routeNode: RouteNode | null,\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteContextKeys: Set<string>\n) {\n if (!routeNode?.route) return;\n if (!isTypedRoute(routeNode.route)) return;\n\n let routePath = `${removeSupportedExtensions(routeNode.route).replace(/\\/?index$/, '')}`; // replace /index with /\n\n if (!routePath.startsWith('/')) {\n routePath = `/${routePath}`;\n }\n\n if (routeNode.dynamic) {\n for (const path of generateCombinations(routePath)) {\n dynamicRouteContextKeys.add(path);\n dynamicRoutes.add(\n `${path\n .replaceAll(CATCH_ALL, '${CatchAllRoutePart<T>}')\n .replaceAll(SLUG, '${SingleRoutePart<T>}')}`\n );\n }\n } else {\n for (const combination of generateCombinations(routePath)) {\n staticRoutes.add(combination);\n }\n }\n}\n\n/**\n * Converts a Set to a TypeScript union type\n */\nconst setToUnionType = <T>(set: Set<T>) => {\n return set.size > 0 ? [...set].map((s) => `\\`${s}\\``).join(' | ') : 'never';\n};\n\nfunction generateCombinations(pathname) {\n const groups = pathname.split('/').filter((part) => part.startsWith('(') && part.endsWith(')'));\n const combinations: string[] = [];\n\n function generate(currentIndex, currentPath) {\n if (currentIndex === groups.length) {\n combinations.push(currentPath.replace(/\\/{2,}/g, '/'));\n return;\n }\n\n const group = groups[currentIndex];\n const withoutGroup = currentPath.replace(group, '');\n generate(currentIndex + 1, withoutGroup);\n generate(currentIndex + 1, currentPath);\n }\n\n generate(0, pathname);\n return combinations;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typed-routes/index.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typed-routes/index.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;cAGgB,MAAM;UAAQ,MAAM;oBAoBpF;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,6BAI5B,CAAC"}
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.regenerateDeclarations = void 0;
|
|
7
|
-
exports.getWatchHandler = getWatchHandler;
|
|
6
|
+
exports.regenerateDeclarations = exports.getWatchHandler = void 0;
|
|
8
7
|
const _ctx_shared_1 = require("expo-router/_ctx-shared");
|
|
9
8
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
9
|
const node_path_1 = __importDefault(require("node:path"));
|
|
@@ -38,6 +37,7 @@ function getWatchHandler(outputDir) {
|
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
39
|
}
|
|
40
|
+
exports.getWatchHandler = getWatchHandler;
|
|
41
41
|
/**
|
|
42
42
|
* A throttled function that regenerates the typed routes declaration file
|
|
43
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typed-routes/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typed-routes/index.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAiE;AACjE,sD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AChD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,iBAAE,CAAC,aAAa,CAAC,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;AACnE,CAAC,EAAE,GAAG,CAAC,CAAC;AAER;;;GAGG;AACH,SAAS,QAAQ,CAAoC,EAAK,EAAE,QAAgB;IAC1E,IAAI,OAAO,CAAC;IACZ,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,OAAO,SAAS,GAAG,CAAC,GAAG,IAAmB;QACxC,IAAI,OAAO,EAAE;YACX,cAAc,GAAG,IAAI,CAAC;SACvB;aAAM;YACL,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;YACZ,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,OAAO,GAAG,IAAI,CAAC,CAAC,gDAAgD;gBAChE,IAAI,cAAc,EAAE;oBAClB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,0BAA0B;iBACzC;YACH,CAAC,EAAE,QAAQ,CAAC,CAAC;SACd;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { EXPO_ROUTER_CTX_IGNORE } from 'expo-router/_ctx-shared';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { getTypedRoutesDeclarationFile } from './generate';\nimport { isTypedRoute } from '../matchers';\nimport requireContext from '../testing-library/require-context-ponyfill';\n\nconst ctx = requireContext(process.env.EXPO_ROUTER_APP_ROOT, true, EXPO_ROUTER_CTX_IGNORE);\n\n/**\n * Generate a Metro watch handler that regenerates the typed routes declaration file\n */\nexport function getWatchHandler(outputDir: string) {\n const routeFiles = new Set(ctx.keys().filter((key) => isTypedRoute(key)));\n\n return async function callback({ filePath, type }: { filePath: string; type: string }) {\n let shouldRegenerate = false;\n\n if (type === 'delete') {\n ctx.__delete(filePath);\n if (routeFiles.has(filePath)) {\n routeFiles.delete(filePath);\n shouldRegenerate = true;\n }\n } else if (type === 'add') {\n ctx.__add(filePath);\n shouldRegenerate = isTypedRoute(filePath);\n } else {\n shouldRegenerate = routeFiles.has(filePath);\n }\n\n if (shouldRegenerate) {\n regenerateDeclarations(outputDir);\n }\n };\n}\n\n/**\n * A throttled function that regenerates the typed routes declaration file\n */\nexport const regenerateDeclarations = throttle((outputDir: string) => {\n const file = getTypedRoutesDeclarationFile(ctx);\n if (!file) return;\n fs.writeFileSync(path.resolve(outputDir, './router.d.ts'), file);\n}, 100);\n\n/**\n * Throttles a function to only run once every `internal` milliseconds.\n * If called while waiting, it will run again after the timer has elapsed.\n */\nfunction throttle<T extends (...args: any[]) => any>(fn: T, interval: number) {\n let timerId;\n let shouldRunAgain = false;\n return function run(...args: Parameters<T>) {\n if (timerId) {\n shouldRunAgain = true;\n } else {\n fn(...args);\n timerId = setTimeout(() => {\n timerId = null; // reset the timer so next call will be executed\n if (shouldRunAgain) {\n run(...args); // call the function again\n }\n }, interval);\n }\n };\n}\n"]}
|
package/build/useDeprecated.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useWarnOnce =
|
|
4
|
-
exports.useDeprecated = useDeprecated;
|
|
3
|
+
exports.useDeprecated = exports.useWarnOnce = void 0;
|
|
5
4
|
const react_1 = require("react");
|
|
6
5
|
const react_native_1 = require("react-native");
|
|
7
6
|
// Node environment may render in multiple processes causing the warning to log mutiple times
|
|
@@ -21,7 +20,9 @@ function useWarnOnce(message, guard = true, key = message) {
|
|
|
21
20
|
}
|
|
22
21
|
}, [guard]);
|
|
23
22
|
}
|
|
23
|
+
exports.useWarnOnce = useWarnOnce;
|
|
24
24
|
function useDeprecated(message, guard = true, key = message) {
|
|
25
25
|
return useWarnOnce(key, guard, `Expo Router: ${message}`);
|
|
26
26
|
}
|
|
27
|
+
exports.useDeprecated = useDeprecated;
|
|
27
28
|
//# sourceMappingURL=useDeprecated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeprecated.js","sourceRoot":"","sources":["../src/useDeprecated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDeprecated.js","sourceRoot":"","sources":["../src/useDeprecated.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AACxC,+CAAwC;AAExC,6FAA6F;AAC7F,mDAAmD;AACnD,MAAM,OAAO,GAAG,uBAAQ,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IAC7C,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,OAAO,MAAM,KAAK,WAAW;CAChF,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAgB,WAAW,CAAC,OAAe,EAAE,QAAiB,IAAI,EAAE,GAAG,GAAG,OAAO;IAC/E,8DAA8D;IAC9D,gEAAgE;IAChE,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,IAAI,KAAK,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACxC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvB;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,CAAC;AATD,kCASC;AAED,SAAgB,aAAa,CAAC,OAAe,EAAE,QAAiB,IAAI,EAAE,GAAG,GAAG,OAAO;IACjF,OAAO,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,OAAO,EAAE,CAAC,CAAC;AAC5D,CAAC;AAFD,sCAEC","sourcesContent":["import { useLayoutEffect } from 'react';\nimport { Platform } from 'react-native';\n\n// Node environment may render in multiple processes causing the warning to log mutiple times\n// Hence we skip the warning in these environments.\nconst canWarn = Platform.select({\n native: process.env.NODE_ENV !== 'production',\n default: process.env.NODE_ENV !== 'production' && typeof window !== 'undefined',\n});\n\nconst warned = new Set<string>();\n\nexport function useWarnOnce(message: string, guard: unknown = true, key = message) {\n // useLayoutEffect typically doesn't run in node environments.\n // Combined with skipWarn, this should prevent unwanted warnings\n useLayoutEffect(() => {\n if (guard && canWarn && !warned.has(key)) {\n warned.add(key);\n console.warn(message);\n }\n }, [guard]);\n}\n\nexport function useDeprecated(message: string, guard: unknown = true, key = message) {\n return useWarnOnce(key, guard, `Expo Router: ${message}`);\n}\n"]}
|
package/build/useFocusEffect.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useFocusEffect =
|
|
26
|
+
exports.useFocusEffect = void 0;
|
|
27
27
|
// A fork of `useFocusEffect` that waits for the navigation state to load before
|
|
28
28
|
// running the effect. This is especially useful for native redirects.
|
|
29
29
|
const React = __importStar(require("react"));
|
|
@@ -121,4 +121,5 @@ function useFocusEffect(effect, do_not_pass_a_second_prop) {
|
|
|
121
121
|
};
|
|
122
122
|
}, [effect, navigation]);
|
|
123
123
|
}
|
|
124
|
+
exports.useFocusEffect = useFocusEffect;
|
|
124
125
|
//# sourceMappingURL=useFocusEffect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFocusEffect.js","sourceRoot":"","sources":["../src/useFocusEffect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gFAAgF;AAChF,sEAAsE;AACtE,6CAA+B;AAE/B,oEAAmE;AAInE;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,MAAsB,EAAE,yBAAiC;IACtF,MAAM,UAAU,GAAG,IAAA,2CAAqB,GAAE,CAAC;IAE3C,IAAI,yBA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,EAAE;YAC1B,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;SAClB;QAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;YAC5D,mEAAmE;YACnE,8FAA8F;YAC9F,IAAI,SAAS,EAAE;gBACb,OAAO;aACR;YAED,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,QAAQ,EAAE,CAAC;YACrB,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE;YAC1D,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,SAAS,CAAC;YACpB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,EAAE,CAAC;aACX;YAED,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAC3B,CAAC;AAtGD,wCAsGC","sourcesContent":["// A fork of `useFocusEffect` that waits for the navigation state to load before\n// running the effect. This is especially useful for native redirects.\nimport * as React from 'react';\n\nimport { useOptionalNavigation } from './link/useLoadedNavigation';\n\ntype EffectCallback = () => undefined | void | (() => void);\n\n/**\n * Hook to run an effect in a focused screen, similar to `React.useEffect`.\n * This can be used to perform side-effects such as fetching data or subscribing to events.\n * The passed callback should be wrapped in `React.useCallback` to avoid running the effect too often.\n *\n * @param callback Memoized callback containing the effect, should optionally return a cleanup function.\n */\nexport function useFocusEffect(effect: EffectCallback, do_not_pass_a_second_prop?: never) {\n const navigation = useOptionalNavigation();\n\n if (do_not_pass_a_second_prop !== undefined) {\n const message =\n \"You passed a second argument to 'useFocusEffect', but it only accepts one argument. \" +\n \"If you want to pass a dependency array, you can use 'React.useCallback':\\n\\n\" +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' // Your code here\\n' +\n ' }, [depA, depB])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n\n console.error(message);\n }\n\n React.useEffect(() => {\n if (!navigation) {\n return;\n }\n\n let isFocused = false;\n let cleanup: undefined | void | (() => void);\n\n const callback = () => {\n const destroy = effect();\n\n if (destroy === undefined || typeof destroy === 'function') {\n return destroy;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n let message =\n 'An effect function must not return anything besides a function, which is used for clean-up.';\n\n if (destroy === null) {\n message +=\n \" You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing).\";\n } else if (typeof (destroy as any).then === 'function') {\n message +=\n \"\\n\\nIt looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. \" +\n 'Instead, write the async function inside your effect ' +\n 'and call it immediately:\\n\\n' +\n 'useFocusEffect(\\n' +\n ' React.useCallback(() => {\\n' +\n ' async function fetchData() {\\n' +\n ' // You can await here\\n' +\n ' const response = await MyAPI.getData(someId);\\n' +\n ' // ...\\n' +\n ' }\\n\\n' +\n ' fetchData();\\n' +\n ' }, [someId])\\n' +\n ');\\n\\n' +\n 'See usage guide: https://reactnavigation.org/docs/use-focus-effect';\n } else {\n message += ` You returned '${JSON.stringify(destroy)}'.`;\n }\n\n console.error(message);\n }\n };\n\n // We need to run the effect on intial render/dep changes if the screen is focused\n if (navigation.isFocused()) {\n cleanup = callback();\n isFocused = true;\n }\n\n const unsubscribeFocus = navigation.addListener('focus', () => {\n // If callback was already called for focus, avoid calling it again\n // The focus event may also fire on intial render, so we guard against runing the effect twice\n if (isFocused) {\n return;\n }\n\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = callback();\n isFocused = true;\n });\n\n const unsubscribeBlur = navigation.addListener('blur', () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n cleanup = undefined;\n isFocused = false;\n });\n\n return () => {\n if (cleanup !== undefined) {\n cleanup();\n }\n\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [effect, navigation]);\n}\n"]}
|
package/build/useNavigation.js
CHANGED
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useNavigation =
|
|
7
|
-
exports.resolveParentId = resolveParentId;
|
|
6
|
+
exports.resolveParentId = exports.useNavigation = void 0;
|
|
8
7
|
const native_1 = require("@react-navigation/native");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
const Route_1 = require("./Route");
|
|
@@ -38,6 +37,7 @@ function useNavigation(parent) {
|
|
|
38
37
|
}
|
|
39
38
|
return navigation;
|
|
40
39
|
}
|
|
40
|
+
exports.useNavigation = useNavigation;
|
|
41
41
|
function resolveParentId(contextKey, parentId) {
|
|
42
42
|
if (!parentId) {
|
|
43
43
|
return null;
|
|
@@ -47,6 +47,7 @@ function resolveParentId(contextKey, parentId) {
|
|
|
47
47
|
}
|
|
48
48
|
return (0, matchers_1.getNameFromFilePath)(parentId);
|
|
49
49
|
}
|
|
50
|
+
exports.resolveParentId = resolveParentId;
|
|
50
51
|
// Resolve a path like `../` relative to a path like `/foo/bar`
|
|
51
52
|
function relativePaths(from, to) {
|
|
52
53
|
const fromParts = from.split('/').filter(Boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNavigation.js","sourceRoot":"","sources":["../src/useNavigation.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAkG;AA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KACjE;IACD,OAAO,IAAA,8BAAmB,EAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AATD,0CASC;AAED,+DAA+D;AAC/D,SAAS,aAAa,CAAC,IAAY,EAAE,EAAU;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE9C,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;QAC1B,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,kBAAkB,IAAI,GAAG,CAAC,CAAC;aACtE;YACD,SAAS,CAAC,GAAG,EAAE,CAAC;SACjB;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE;YACvB,SAAS;SACV;aAAM;YACL,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;KACF;IAED,OAAO,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { useNavigation as useUpstreamNavigation, NavigationProp } from '@react-navigation/native';\nimport React from 'react';\n\nimport { useContextKey } from './Route';\nimport { getNameFromFilePath } from './matchers';\n\n/**\n * Return the navigation object for the current route.\n * @param parent Provide an absolute path like `/(root)` to the parent route or a relative path like `../../` to the parent route.\n * @returns the navigation object for the provided route.\n */\nexport function useNavigation<T = NavigationProp<ReactNavigation.RootParamList>>(\n parent?: string\n): T {\n const navigation = useUpstreamNavigation<any>();\n\n const contextKey = useContextKey();\n const normalizedParent = React.useMemo(() => {\n if (!parent) {\n return null;\n }\n const normalized = getNameFromFilePath(parent);\n\n if (parent.startsWith('.')) {\n return relativePaths(contextKey, parent);\n }\n return normalized;\n }, [contextKey, parent]);\n\n if (normalizedParent != null) {\n const parentNavigation = navigation.getParent(normalizedParent);\n\n // TODO: Maybe print a list of parents...\n\n if (!parentNavigation) {\n throw new Error(\n `Could not find parent navigation with route \"${parent}\".` +\n (normalizedParent !== parent ? ` (normalized: ${normalizedParent})` : '')\n );\n }\n return parentNavigation;\n }\n return navigation;\n}\n\nexport function resolveParentId(contextKey: string, parentId?: string | null): string | null {\n if (!parentId) {\n return null;\n }\n\n if (parentId.startsWith('.')) {\n return getNameFromFilePath(relativePaths(contextKey, parentId));\n }\n return getNameFromFilePath(parentId);\n}\n\n// Resolve a path like `../` relative to a path like `/foo/bar`\nfunction relativePaths(from: string, to: string): string {\n const fromParts = from.split('/').filter(Boolean);\n const toParts = to.split('/').filter(Boolean);\n\n for (const part of toParts) {\n if (part === '..') {\n if (fromParts.length === 0) {\n throw new Error(`Cannot resolve path \"${to}\" relative to \"${from}\"`);\n }\n fromParts.pop();\n } else if (part === '.') {\n // Ignore\n } else {\n fromParts.push(part);\n }\n }\n\n return '/' + fromParts.join('/');\n}\n"]}
|
package/build/useScreens.d.ts
CHANGED
|
@@ -27,6 +27,6 @@ export declare function useSortedScreens(order: ScreenProps[]): React.ReactNode[
|
|
|
27
27
|
export declare function getQualifiedRouteComponent(value: RouteNode): React.ComponentType<any> | React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
28
28
|
/** @returns a function which provides a screen id that matches the dynamic route name in params. */
|
|
29
29
|
export declare function createGetIdForRoute(route: Pick<RouteNode, 'dynamic' | 'route' | 'contextKey' | 'children'>): ({ params }?: {
|
|
30
|
-
params?: Record<string, any
|
|
30
|
+
params?: Record<string, any> | undefined;
|
|
31
31
|
}) => string;
|
|
32
32
|
//# sourceMappingURL=useScreens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAA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