Skip to content

Commit

Permalink
Merge branch 'main' into @evanbacon/expo/cli/auth-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Jan 28, 2022
2 parents c36aae5 + 77f4451 commit fb3dbe2
Show file tree
Hide file tree
Showing 212 changed files with 7,864 additions and 4,571 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/client-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
ANDROID_KEY_ALIAS: ExponentKey
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/19.2.5345600/
IS_APP_BUNDLE: ${{ github.event.inputs.releaseGooglePlay == 'release-google-play' }}
IS_RELEASE_BUILD: ${{ github.event.inputs.releaseAPK == 'release-apk' || github.event.inputs.releaseGooglePlay == 'release-google-play' }}
IS_VERSIONED_FLAVOR: ${{ github.event_name == 'schedule' || steps.flavor.outputs.versioned == 'true' }}
run: |
Expand All @@ -137,7 +138,7 @@ jobs:
else
echo "Internal build detected, APK will be signed"
echo $ANDROID_KEYSTORE_B64 | base64 -d > android/app/release-key.jks
bin/fastlane android build build_type:$BUILD_TYPE flavor:$FLAVOR
bin/fastlane android build build_type:$BUILD_TYPE flavor:$FLAVOR aab:$IS_APP_BUNDLE
fi
- name: 💾 Upload APK artifact
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ Package-specific changes not released in any SDK will be added here just before
- Removed `expo-payments-stripe`. Please use `@stripe/stripe-react-native` instead. ([#14382](https://github.com/expo/expo/pull/14382) by [@cruzach](https://github.com/cruzach))
- Updated firebase to version 9.0.2, including support for compat libraries and new modular style. ([#14616](https://github.com/expo/expo/pull/14616) by [@sebastianwilczek](https://github.com/sebastianwilczek))
- `navigator.geolocation` is no longer defined automatically as a side effect of the `expo` package. It previously provided a warning that you needed to install `expo-location`. ([#14441](https://github.com/expo/expo/pull/14441) by [@brentvatne](https://github.com/brentvatne)
- Require scopeKey in custom push notifications. ([#12964](https://github.com/expo/expo/pull/12964) by [@wschurman](https://github.com/wschurman)
- **`expo-ads-admob`**
- Dropped support for iOS 11.0 ([#14383](https://github.com/expo/expo/pull/14383) by [@cruzach](https://github.com/cruzach))
- **`expo-ads-facebook`**
Expand Down
35 changes: 15 additions & 20 deletions android/expoview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'de.undercouch.download'
apply plugin: 'kotlin-kapt'

Expand All @@ -9,30 +9,25 @@ apply plugin: 'kotlin-kapt'
group = 'host.exp.exponent'
version = '44.0.0'


//Upload android library to maven with javadoc and android sources
configurations {
deployerJars
}

//Creating sources with comments
// Creating sources with comments
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

//Put the androidSources and javadoc to the artifacts
artifacts {
archives androidSourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: mavenLocal().url) {
//if your repository needs authentication
// authentication(userName: "username", password: "password")
afterEvaluate {
publishing {
publications {
// use `versionedRelease` configuration when publishing to maven
versionedRelease(MavenPublication) {
from components.versionedRelease
// Add additional sourcesJar to artifacts
artifact(androidSourcesJar)
}
}
repositories {
maven {
url = mavenLocal().url
}
}
}
Expand Down
1 change: 0 additions & 1 deletion android/versioned-abis/expoview-abi42_0_0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'de.undercouch.download'

Expand Down
1 change: 0 additions & 1 deletion android/versioned-abis/expoview-abi43_0_0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: 'de.undercouch.download'
apply plugin: 'kotlin-kapt'

Expand Down
1 change: 0 additions & 1 deletion android/versioned-abis/expoview-abi44_0_0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'
apply plugin: 'de.undercouch.download'
apply plugin: 'kotlin-kapt'

Expand Down
17 changes: 11 additions & 6 deletions docs/components/DocumentationFooter.test.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
import { render } from '@testing-library/react';
import Router, { NextRouter } from 'next/router';
import * as React from 'react';

import DocumentationFooter, { githubUrl } from './DocumentationFooter';

const mockRouter = (router: Partial<NextRouter>): NextRouter => ({ ...Router, ...router });

describe('DocumentationFooter', () => {
test('displays default links', () => {
const { container } = render(
<DocumentationFooter asPath="/" url={{ pathname: '/example/' }} title="test-title" />
);
const router = mockRouter({ asPath: '/', pathname: '/example/' });
const { container } = render(<DocumentationFooter router={router} title="test-title" />);

expect(container).toHaveTextContent('Ask a question on the forums');
expect(container).toHaveTextContent('Edit this page');
});

test('displays forums link with tag', () => {
const { container } = render(<DocumentationFooter asPath="/sdk/" title="test-title" />);
const router = mockRouter({ asPath: '/sdk/', pathname: '' });
const { container } = render(<DocumentationFooter router={router} title="test-title" />);

expect(container).toHaveTextContent(
'Get help from the community and ask questions about test-title'
);
});

test('displays issues link', () => {
const { container } = render(<DocumentationFooter asPath="/sdk/" title="test-title" />);
const router = mockRouter({ asPath: '/sdk/', pathname: '' });
const { container } = render(<DocumentationFooter router={router} title="test-title" />);

expect(container).toHaveTextContent('View open bug reports for test-title');
});

test('displays source code link', () => {
const router = mockRouter({ asPath: '/sdk/', pathname: '' });
const { container } = render(
<DocumentationFooter asPath="/sdk/" title="test-title" sourceCodeUrl="/" />
<DocumentationFooter router={router} title="test-title" sourceCodeUrl="/" />
);

expect(container).toHaveTextContent('View source code for test-title');
Expand Down
15 changes: 7 additions & 8 deletions docs/components/DocumentationFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { css } from '@emotion/react';
import { theme } from '@expo/styleguide';
import { NextRouter } from 'next/router';
import * as React from 'react';

import { UL, LI } from '~/components/base/list';
import Bug from '~/components/icons/Bug';
import ChatBoxes from '~/components/icons/ChatBoxes';
import Pencil from '~/components/icons/Pencil';
import Spectacles from '~/components/icons/Spectacles';
import { Url } from '~/types/common';

const STYLES_FOOTER = css`
border-top: 1px solid ${theme.border.default};
Expand Down Expand Up @@ -58,8 +58,7 @@ export function githubUrl(path: string) {
const SDK_BLACKLIST = ['Overview'];

type Props = {
asPath: string;
url?: Url;
router: NextRouter;
title: string;
sourceCodeUrl?: string;
};
Expand All @@ -79,7 +78,7 @@ export default class DocumentationFooter extends React.PureComponent<Props> {
}

private renderForumsLink() {
if (!this.props.asPath.includes('/sdk/') || SDK_BLACKLIST.includes(this.props.title)) {
if (!this.props.router.asPath.includes('/sdk/') || SDK_BLACKLIST.includes(this.props.title)) {
return (
<LI>
<a
Expand Down Expand Up @@ -113,14 +112,14 @@ export default class DocumentationFooter extends React.PureComponent<Props> {
}

private maybeRenderGithubUrl() {
if (this.props.url) {
if (this.props.router) {
return (
<LI>
<a
css={STYLES_FOOTER_LINK}
target="_blank"
rel="noopener"
href={githubUrl(this.props.url.pathname)}>
href={githubUrl(this.props.router.pathname)}>
<span css={STYLES_FOOTER_ICON}>
<Pencil fillColor="currentColor" />
</span>
Expand All @@ -132,7 +131,7 @@ export default class DocumentationFooter extends React.PureComponent<Props> {
}

private maybeRenderIssuesLink = () => {
if (!this.props.asPath.includes('/sdk/') || SDK_BLACKLIST.includes(this.props.title)) {
if (!this.props.router.asPath.includes('/sdk/') || SDK_BLACKLIST.includes(this.props.title)) {
return;
}

Expand All @@ -152,7 +151,7 @@ export default class DocumentationFooter extends React.PureComponent<Props> {
};

private maybeRenderSourceCodeLink = () => {
if (!this.props.asPath.includes('/sdk/') || !this.props.sourceCodeUrl) {
if (!this.props.router.asPath.includes('/sdk/') || !this.props.sourceCodeUrl) {
return;
}

Expand Down
49 changes: 25 additions & 24 deletions docs/components/DocumentationPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css } from '@emotion/react';
import { theme } from '@expo/styleguide';
import some from 'lodash/some';
import Router from 'next/router';
import Router, { NextRouter } from 'next/router';
import NProgress from 'nprogress';
import * as React from 'react';

Expand All @@ -20,16 +20,17 @@ import { H1 } from '~/components/base/headings';
import navigation from '~/constants/navigation';
import * as Constants from '~/constants/theme';
import { VERSIONS } from '~/constants/versions';
import { NavigationRoute, Url } from '~/types/common';
import { NavigationRoute } from '~/types/common';

const STYLES_DOCUMENT = css`
background: ${theme.background.default};
margin: 0 auto;
padding: 40px 56px;
hr {
border-top: 1px solid ${theme.border.default};
border-bottom: 0px;
border: 0;
height: 0.01rem;
background-color: ${theme.border.default};
}
@media screen and (max-width: ${Constants.breakpoints.mobile}) {
Expand All @@ -50,9 +51,8 @@ const HIDDEN_ON_DESKTOP = css`
`;

type Props = {
url: Url;
router: NextRouter;
title: string;
asPath: string;
sourceCodeUrl?: string;
/** API Page NPM package name, exposed through context for various React components that consistently use the package name. */
packageName?: string;
Expand Down Expand Up @@ -105,7 +105,7 @@ export default class DocumentationPage extends React.Component<Props, State> {
};

private handleSetVersion = (version: string) => {
let newPath = Utilities.replaceVersionInUrl(this.props.url.pathname, version);
let newPath = Utilities.replaceVersionInUrl(this.props.router.pathname, version);

if (!newPath.endsWith('/')) {
newPath += '/';
Expand Down Expand Up @@ -142,46 +142,50 @@ export default class DocumentationPage extends React.Component<Props, State> {
};

private isReferencePath = () => {
return this.props.url.pathname.startsWith('/versions');
return this.props.router.pathname.startsWith('/versions');
};

private isGeneralPath = () => {
return some(navigation.generalDirectories, name =>
this.props.url.pathname.startsWith(`/${name}`)
this.props.router.pathname.startsWith(`/${name}`)
);
};

private isGettingStartedPath = () => {
return (
this.props.url.pathname === '/' ||
some(navigation.startingDirectories, name => this.props.url.pathname.startsWith(`/${name}`))
this.props.router.pathname === '/' ||
some(navigation.startingDirectories, name =>
this.props.router.pathname.startsWith(`/${name}`)
)
);
};

private isFeaturePreviewPath = () => {
return some(navigation.featurePreviewDirectories, name =>
this.props.url.pathname.startsWith(`/${name}`)
this.props.router.pathname.startsWith(`/${name}`)
);
};

private isPreviewPath = () => {
return some(navigation.previewDirectories, name =>
this.props.url.pathname.startsWith(`/${name}`)
this.props.router.pathname.startsWith(`/${name}`)
);
};

private isEasPath = () => {
return some(navigation.easDirectories, name => this.props.url.pathname.startsWith(`/${name}`));
return some(navigation.easDirectories, name =>
this.props.router.pathname.startsWith(`/${name}`)
);
};

private getCanonicalUrl = () => {
if (this.isReferencePath()) {
return `https://docs.expo.dev${Utilities.replaceVersionInUrl(
this.props.url.pathname,
this.props.router.pathname,
'latest'
)}`;
} else {
return `https://docs.expo.dev${this.props.url.pathname}`;
return `https://docs.expo.dev${this.props.router.pathname}`;
}
};

Expand All @@ -194,7 +198,7 @@ export default class DocumentationPage extends React.Component<Props, State> {
};

private getVersion = () => {
let version = (this.props.asPath || this.props.url.pathname).split(`/`)[2];
let version = (this.props.router.asPath || this.props.router.pathname).split(`/`)[2];
if (!version || !VERSIONS.includes(version)) {
version = 'latest';
}
Expand Down Expand Up @@ -251,8 +255,7 @@ export default class DocumentationPage extends React.Component<Props, State> {

const sidebarElement = (
<DocumentationSidebar
url={this.props.url}
asPath={this.props.asPath}
router={this.props.router}
routes={routes}
version={version}
onSetVersion={this.handleSetVersion}
Expand Down Expand Up @@ -326,9 +329,8 @@ export default class DocumentationPage extends React.Component<Props, State> {
{this.props.children}
</DocumentationPageContext.Provider>
<DocumentationFooter
router={this.props.router}
title={this.props.title}
url={this.props.url}
asPath={this.props.asPath}
sourceCodeUrl={this.props.sourceCodeUrl}
/>
</div>
Expand All @@ -341,15 +343,14 @@ export default class DocumentationPage extends React.Component<Props, State> {
{this.props.children}
</DocumentationPageContext.Provider>
<DocumentationFooter
router={this.props.router}
title={this.props.title}
asPath={this.props.asPath}
sourceCodeUrl={this.props.sourceCodeUrl}
/>
</div>
<div css={HIDDEN_ON_DESKTOP}>
<DocumentationSidebar
url={this.props.url}
asPath={this.props.asPath}
router={this.props.router}
routes={routes}
version={version}
onSetVersion={this.handleSetVersion}
Expand Down

0 comments on commit fb3dbe2

Please sign in to comment.