From edaa19ae6ec51e4d03e5fd0a744c683e5080b588 Mon Sep 17 00:00:00 2001 From: Evan Bacon Date: Fri, 29 Dec 2023 13:31:22 +0100 Subject: [PATCH 001/124] fix(cli): fix nested import in type generation (#26145) # Why # How # Test Plan # Checklist - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com> --- packages/@expo/cli/CHANGELOG.md | 2 ++ packages/@expo/cli/src/start/server/type-generation/routes.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@expo/cli/CHANGELOG.md b/packages/@expo/cli/CHANGELOG.md index 763a7a15f1e257..338458ca6372dd 100644 --- a/packages/@expo/cli/CHANGELOG.md +++ b/packages/@expo/cli/CHANGELOG.md @@ -8,6 +8,8 @@ ### 🐛 Bug fixes +- Update import for type generation. ([#26145](https://github.com/expo/expo/pull/26145) by [@EvanBacon](https://github.com/EvanBacon)) + ### 💡 Others ## 0.16.5 - 2023-12-21 diff --git a/packages/@expo/cli/src/start/server/type-generation/routes.ts b/packages/@expo/cli/src/start/server/type-generation/routes.ts index 4d6e83c2a732d4..2e08d104f0a126 100644 --- a/packages/@expo/cli/src/start/server/type-generation/routes.ts +++ b/packages/@expo/cli/src/start/server/type-generation/routes.ts @@ -305,7 +305,7 @@ const routerDotTSTemplate = unsafeTemplate`/* eslint-disable @typescript-eslint/ /* eslint-disable @typescript-eslint/ban-types */ declare module "expo-router" { import type { LinkProps as OriginalLinkProps } from 'expo-router/build/link/Link'; - import type { Router as OriginalRouter } from 'expo-router/src/types'; + import type { Router as OriginalRouter } from 'expo-router/build/types'; export * from 'expo-router/build'; // prettier-ignore From f44004b84e875a7d16c68e52548adf0e4b854f92 Mon Sep 17 00:00:00 2001 From: Baraa Bilal Date: Sat, 30 Dec 2023 01:58:02 -0600 Subject: [PATCH 002/124] Update lottie.mdx (#26146) # Why # How # Test Plan # Checklist - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --- docs/pages/versions/unversioned/sdk/lottie.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/versions/unversioned/sdk/lottie.mdx b/docs/pages/versions/unversioned/sdk/lottie.mdx index 9606aca8fee5c4..5773f45e39167d 100644 --- a/docs/pages/versions/unversioned/sdk/lottie.mdx +++ b/docs/pages/versions/unversioned/sdk/lottie.mdx @@ -13,7 +13,7 @@ import { SnackInline } from '~/ui/components/Snippet'; [Lottie](https://airbnb.design/lottie/) renders After Effects animations in real time, allowing apps to use animations as easily as they use static images. - + ## Installation From 7cc1c08fa57f8b4d8902bc273dab2a3477f009f7 Mon Sep 17 00:00:00 2001 From: ts-candide <145444954+ts-candide@users.noreply.github.com> Date: Sat, 30 Dec 2023 08:04:13 +0000 Subject: [PATCH 003/124] Add `--no-wait` flag to CI execution examples (#25944) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Why The current instructions for triggering EAS Builds from a CI environment will block the CI environment from finishing until EAS completes the build, wasting CI resources. # How Adding a suggestion to use the `--no-wait` flag will allow CI to finish as soon as the build is triggered, saving on CI execution time. # Test Plan Triggering a build with CircleCI outputs the following in the Circle logs, ending as soon as the build is triggered. A URL is printed, which can be used to check on build progress in EAS. ``` #!/bin/bash -eo pipefail npx eas-cli build --platform android --profile preview --non-interactive --no-wait npm WARN exec The following package was not found and will be installed: eas-cli@5.9.1 The EAS build profile does not specify a Node.js version. Using the version specified in .nvmrc: v20 Loaded "env" configuration for the "preview" profile: . Learn more: https://docs.expo.dev/build-reference/variables/ ✔ Using remote Android credentials (Expo server) ✔ Using Keystore from configuration: (default) Compressing project files and uploading to EAS Build. Learn more: https://expo.fyi/eas-build-archive - Uploading to EAS Build (0 / 535 KB) ✔ Uploaded to EAS Build details: https://expo.dev/accounts//projects//builds/850da346-8acd-4a63-9eb0-bee073111430 ``` # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [x] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Aman Mittal --- docs/pages/build/building-on-ci.mdx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/pages/build/building-on-ci.mdx b/docs/pages/build/building-on-ci.mdx index 68b600e7337d37..d209436d656e27 100644 --- a/docs/pages/build/building-on-ci.mdx +++ b/docs/pages/build/building-on-ci.mdx @@ -54,10 +54,14 @@ Now that we're authenticated with Expo CLI, we can create the build step. To trigger new builds, we will add this script to our configuration: ```sh -npx eas-cli build --platform all --non-interactive +npx eas-cli build --platform all --non-interactive --no-wait ``` -This will trigger a new build on EAS and print the URLs for the built files after the build completes. +This will trigger a new build on EAS. A URL will be printed, linking to the build's progress in the EAS dashboard. + +> **info** The `--no-wait` flag exits the step once the build has been triggered. You are not billed for CI execution time while EAS performs the build. However, your CI will report that the build job is passing only if triggering EAS Build is successful. +> +> If you need to add another CI step to run once the build is complete, remove this flag. @@ -81,7 +85,7 @@ jobs: node_js: lts/* script: - npm ci - - npx eas-cli build --platform all --non-interactive + - npx eas-cli build --platform all --non-interactive --no-wait ``` @@ -112,7 +116,7 @@ eas-build: stage: build script: - apk add --no-cache bash - - npx eas-cli build --platform all --non-interactive + - npx eas-cli build --platform all --non-interactive --no-wait ``` @@ -138,7 +142,7 @@ pipelines: script: - apk add --no-cache bash - npm ci - - npx eas-cli build --platform all --non-interactive + - npx eas-cli build --platform all --non-interactive --no-wait ``` @@ -166,7 +170,7 @@ jobs: command: npm ci - run: name: Trigger build - command: npx eas-cli build --platform all --non-interactive + command: npx eas-cli build --platform all --non-interactive --no-wait workflows: build_app: @@ -208,7 +212,7 @@ jobs: - name: Install dependencies run: npm ci - name: Build on EAS - run: eas build --platform all --non-interactive + run: eas build --platform all --non-interactive --no-wait ``` From 40a6bb20466a06bf79bfc85ea53af7a201b45df8 Mon Sep 17 00:00:00 2001 From: Kevin J Gao <32936811+gaokevin1@users.noreply.github.com> Date: Sat, 30 Dec 2023 00:35:23 -0800 Subject: [PATCH 004/124] [docs] Added Descope as an OAuth Provider option (#26147) --- docs/pages/guides/authentication.mdx | 125 ++++++++++++++++++ .../images/sdk/auth-session/descope.png | Bin 0 -> 28526 bytes docs/ui/components/Authentication/index.ts | 1 + 3 files changed, 126 insertions(+) create mode 100644 docs/public/static/images/sdk/auth-session/descope.png diff --git a/docs/pages/guides/authentication.mdx b/docs/pages/guides/authentication.mdx index 8e4c0781434c00..e47055b7d1c0ed 100644 --- a/docs/pages/guides/authentication.mdx +++ b/docs/pages/guides/authentication.mdx @@ -40,6 +40,7 @@ If you'd like to see more, you can [open a PR](https://github.com/expo/expo/edit /> + {/* End Coinbase */} + + +| Website | Provider | PKCE | Auto Discovery | +| ---------------------------- | -------- | --------- | -------------- | +| [Get Your Config][c-descope] | OpenID | Supported | Available | + +[c-descope]: https://docs.descope.com/ + +- Leverages the Hosted Descope Flow app [Auth-Hosting App](https://github.com/descope/auth-hosting). +- Requests code after successfully authenticating, followed by exchanging code for the auth tokens (PKCE). + + + + + +{/* prettier-ignore */} +```tsx +import * as React from 'react'; +import * as WebBrowser from 'expo-web-browser'; +import * as AuthSession from 'expo-auth-session'; +import { Button, View } from 'react-native'; + +WebBrowser.maybeCompleteAuthSession(); + +const descopeProjectId = ''; // Replace this with your Descope Project ID +const descopeUrl = `https://api.descope.com/${descopeProjectId}`; +const redirectUri = AuthSession.makeRedirectUri(); + +export default function App() { + const [authTokens, setAuthTokens] = React.useState(null); + const discovery = AuthSession.useAutoDiscovery(descopeUrl); + + const [request, response, promptAsync] = AuthSession.useAuthRequest( + { + clientId: descopeProjectId, + responseType: AuthSession.ResponseType.Code, + redirectUri, + usePKCE: true, + scopes: ['openid', 'profile', 'email'], + }, + discovery + ); + + React.useEffect(() => { + if (response) { + if (response.error) { + console.error( + 'Authentication error', + response.params.error_description || 'something went wrong' + ); + return; + } + if (response.type === 'success') { + /* @info Exchange the code for an access token in a server. */ + const exchangeFn = async (exchangeTokenReq) => { + /* @end */ + try { + const exchangeTokenResponse = await AuthSession.exchangeCodeAsync( + exchangeTokenReq, + discovery + ); + setAuthTokens(exchangeTokenResponse); + } catch (error) { + console.error(error); + } + }; + + exchangeFn({ + clientId: descopeProjectId, + code: response.params.code, + redirectUri, + extraParams: { + code_verifier: request.codeVerifier, + }, + }); + } + } + }, [discovery, request, response]); + + const logout = async () => { + const revokeResponse = await AuthSession.revokeAsync( + { + clientId: descopeProjectId, + token: authTokens.refreshToken, + }, + discovery + ); + if (revokeResponse) { + setAuthTokens(null); + } + }; + + return ( + + {authTokens ? ( +