Skip to content

Commit

Permalink
Merge branch 'next-release/main' into mobile/android/update_amplify_c…
Browse files Browse the repository at this point in the history
…onfigure_function
  • Loading branch information
salihgueler authored May 2, 2024
2 parents 8cdf1a8 + 406d1ca commit 4a7e279
Show file tree
Hide file tree
Showing 55 changed files with 638 additions and 2,346 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
/src/themes @aws-amplify/documentation-team
/src/utils @aws-amplify/documentation-team
/tasks @aws-amplify/documentation-team
.github @aws-amplify/documentation-team

#Protected Content
/src/protected @reesscot @srquinn21 @Milan-Shah @swaminator
38 changes: 38 additions & 0 deletions .github/workflows/check_for_console_errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CheckConsoleErrors
on:
pull_request:
branches: [main]
types: [opened, synchronize]
permissions:
contents: read
jobs:
CheckConsoleErrors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2 https://github.com/actions/checkout/commit/b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup Node.js 20.x
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 https://github.com/actions/setup-node/commit/e33196f7422957bea03ed53f6fbb155025ffc7b8
with:
node-version: 20.x
- name: Install Dependencies
run: yarn
- name: Run Build
run: yarn build:release
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Run Server
run: |
python -m http.server 3000 -d ${{ vars.BUILD_DIR }} &
sleep 5
- name: Run Console Errors
id: consoleErrors
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 https://github.com/actions/github-script/commit/d7906e4ad0b1822421a7e6a35d5ca353c962f410
with:
result-encoding: string
script: |
const { consoleErrors } = require('./tasks/console-errors.js');
return await consoleErrors();
- name: Fail if console errors have been found
if: ${{ steps.consoleErrors.outputs.result }}
run: exit 1
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@
"privatesaccess",
"menudetaileditors",
"editorgroupaccess",
"publicauthreadonly",
"authreadonly",
"envs",
"Onetoone",
"onetomany",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"@adobe/css-tools": "4.3.2",
"follow-redirects": "^1.15.6",
"ip": "2.0.1",
"sharp": "0.32.6"
"sharp": "0.32.6",
"ejs": "3.1.10"
},
"scripts": {
"clean": "rm -rf node_modules yarn.lock",
Expand Down
File renamed without changes
8 changes: 4 additions & 4 deletions src/components/BlockSwitcher/__tests__/BlockSwitcher.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ describe('BlockSwitcher', () => {
const blockSwitcher = await screen.findByText(blockAContent);
expect(blockSwitcher).toBeInTheDocument();
});

it('should have more than one Block', async () => {
render(component);
expect(component.props.children.length).toBeGreaterThan(1);
});

it('should show the first Block as default', async () => {
render(component);
const tabs = await screen.getAllByRole('tab');
Expand All @@ -39,7 +39,7 @@ describe('BlockSwitcher', () => {
expect(panels[1]).not.toHaveClass('amplify-tabs__panel--active');
expect(panels[2]).not.toHaveClass('amplify-tabs__panel--active');
});

it('should load all Blocks to the DOM', async () => {
render(component);
const blockA = await screen.findByText(blockAContent);
Expand All @@ -49,7 +49,7 @@ describe('BlockSwitcher', () => {
expect(blockB).toBeInTheDocument();
expect(blockC).toBeInTheDocument();
});

it('should switch tabs upon click', async () => {
render(component);
const tabs = await screen.getAllByRole('tab');
Expand Down
3 changes: 3 additions & 0 deletions src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export const directory = {
},
{
path: 'src/pages/[platform]/build-a-backend/auth/moving-to-production/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/advanced-workflows/index.mdx'
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ An application with Amplify libraries integrated and a minimum target of any of

<Callout>

visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
As new Xcode 15 beta versions are released, the branch will be updated with any necessary fixes on a best effort basis.

For more information on how to use the `visionos-preview` branch, see [Platform Support](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview#platform-support).
Expand Down Expand Up @@ -75,7 +75,7 @@ For more information on how to use the `visionos-preview` branch, see [Platform
</InlineFilter>
## Set up Analytics backend

Use the [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) to create an analytics resource powered by [Amazon Pinpoint](https://aws.amazon.com/pinpoint/).
Use the [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/home.html) to create an analytics resource powered by [Amazon Pinpoint](https://aws.amazon.com/pinpoint/).

```ts title="amplify/backend.ts"
import { auth } from "./auth/resource";
Expand All @@ -85,9 +85,9 @@ import { CfnApp } from "aws-cdk-lib/aws-pinpoint";
import { Stack } from "aws-cdk-lib/core";

const backend = defineBackend({
auth,
auth,
data,
// additional resources
// additional resources
});

const analyticsStack = backend.createStack("analytics-stack");
Expand Down Expand Up @@ -195,7 +195,7 @@ Amplify.configure({
```
</InlineFilter>

<InlineFilter filters={['nextjs']}>
<InlineFilter filters={['nextjs']}>
```js title="pages/_app.tsx"
import { Amplify } from 'aws-amplify';
import { record } from 'aws-amplify/analytics';
Expand Down Expand Up @@ -230,7 +230,7 @@ init() {
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSPinpointAnalyticsPlugin())
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
print("Amplify configured with Auth and Analytics plugins")
} catch {
print("Failed to initialize Amplify with \(error)")
Expand Down Expand Up @@ -260,7 +260,7 @@ func application(
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSPinpointAnalyticsPlugin())
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
print("Amplify configured with Auth and Analytics plugins")
} catch {
print("Failed to initialize Amplify with \(error)")
Expand Down Expand Up @@ -367,7 +367,7 @@ Future<void> main() async {
class MyApp extends StatefulWidget {
const MyApp({Key? key}): super(key: key);
// ...
}
```
Expand Down Expand Up @@ -397,6 +397,8 @@ import com.amplifyframework.AmplifyException;
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin;
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin;
import com.amplifyframework.core.Amplify;
import com.amplifyframework.core.configuration.AmplifyOutputs;

```

```java
Expand Down Expand Up @@ -435,7 +437,8 @@ import com.amplifyframework.AmplifyException
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin
import com.amplifyframework.core.Amplify
```
import com.amplifyframework.core.configuration.AmplifyOutputs
```

```kotlin
Amplify.addPlugin(AWSCognitoAuthPlugin())
Expand All @@ -453,7 +456,7 @@ class MyAmplifyApp : Application() {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSPinpointAnalyticsPlugin())
Amplify.configure(AmplifyOutputs(R.raw.amplify_outputs), applicationContext)
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), applicationContext)

Log.i("MyAmplifyApp", "Initialized Amplify")
} catch (error: AmplifyException) {
Expand All @@ -471,6 +474,7 @@ import android.util.Log;
import com.amplifyframework.AmplifyException;
import com.amplifyframework.analytics.pinpoint.AWSPinpointAnalyticsPlugin;
import com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin;
import com.amplifyframework.core.configuration.AmplifyOutputs;
import com.amplifyframework.rx.RxAmplify;
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ export const meta = {
title: 'Configure a geofence collection',
description: 'Create and manage collections of Geofences',
platforms: [
'android',
'angular',
'javascript',
'nextjs',
'react',
'swift',
'vue'
]
};
Expand Down Expand Up @@ -100,7 +98,7 @@ backend.addOutput({

## Geofence Collection Pricing Plan

The pricing plan for the Geofence Collection will be set to `RequestBasedUsage`. We advice you to go through the [location service pricing](https://aws.amazon.com/location/pricing/) along with the [location service terms](https://aws.amazon.com/service-terms/) (_82.5 section_) to learn more about the pricing plan.
The pricing plan for the Geofence Collection will be set to `RequestBasedUsage`. We advice you to go through the [location service pricing](https://aws.amazon.com/location/pricing/) along with the [location service terms](https://aws.amazon.com/service-terms/) (_82.5 section_) to learn more about the pricing plan.

#### Group access

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ backend.addOutput({
<InlineFilter filters={['javascript', "angular", "react", "vue", "react-native", "nextjs"]}>

## Configure your application

To display a map in your application, you can use the [Amplify React MapView component](https://ui.docs.amplify.aws/react/components/geo) or the [MapLibre GL](https://github.com/maplibre/maplibre-gl-js) with `maplibre-gl-js-amplify` libraries are required.

Install the necessary dependencies by running the following command:

```bash title="Terminal" showLineNumbers={false}
```bash title="Terminal" showLineNumbers={false}
npm add aws-amplify @aws-amplify/geo
```

Expand Down Expand Up @@ -164,7 +164,7 @@ For a full example, please follow the [project setup walkthrough](/[platform]/st

<Callout>

visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
visionOS support is currently in **preview** and can be used by targeting the [`visionos-preview`](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview) branch.
As new Xcode 15 beta versions are released, the branch will be updated with any necessary fixes on a best effort basis.

For more information on how to use the `visionos-preview` branch, see [Platform Support](https://github.com/aws-amplify/amplify-swift/tree/visionos-preview#platform-support).
Expand Down Expand Up @@ -264,7 +264,7 @@ public class MyAmplifyApp extends Application {
```kotlin
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSLocationGeoPlugin())
Amplify.configure(AmplifyOutputs(R.raw.amplify_outputs), applicationContext)
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), applicationContext)
```

Your class will look like this:
Expand All @@ -277,7 +277,7 @@ class MyAmplifyApp : Application() {
try {
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSLocationGeoPlugin())
Amplify.configure(AmplifyOutputs(R.raw.amplify_outputs), applicationContext)
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), applicationContext)
Log.i("MyAmplifyApp", "Initialized Amplify")
} catch (error: AmplifyException) {
Log.e("MyAmplifyApp", "Could not initialize Amplify", error)
Expand Down Expand Up @@ -341,7 +341,7 @@ func configureAmplify() {
do {
try Amplify.add(plugin: AWSCognitoAuthPlugin())
try Amplify.add(plugin: AWSLocationGeoPlugin())
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
print("Initialized Amplify");
} catch {
print("Could not initialize Amplify: \(error)")
Expand Down Expand Up @@ -392,7 +392,7 @@ Initialized Amplify
</InlineFilter>


**Notes:**
**Notes:**
- If you want to use existing Amazon Location Service resources [follow this guide](/[platform]/build-a-backend/add-aws-services/geo/existing-resources/) instead.
- If you want to use Amazon Location Service APIs not directly supported by Geo, use the [escape hatch](/[platform]/build-a-backend/add-aws-services/geo/amazon-location-sdk/) to access the Amazon Location Service SDK.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ do {
let loggingConfiguration = AWSCloudWatchLoggingPluginConfiguration(logGroupName: "<log-group-name>", region: "<region>", localStoreMaxSizeInMB: 2)
let loggingPlugin = AWSCloudWatchLoggingPlugin(loggingPluginConfiguration: loggingConfiguration)
try Amplify.add(plugin: loggingPlugin)
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
} catch {
assert(false, "Error initializing Amplify: \(error)")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ do {
let loggingConfiguration = AWSCloudWatchLoggingPluginConfiguration(logGroupName: "<log-group-name>", region: "<region>", flushIntervalInSeconds: 120)
let loggingPlugin = AWSCloudWatchLoggingPlugin(loggingPluginConfiguration: loggingConfiguration)
try Amplify.add(plugin: loggingPlugin)
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
} catch {
assert(false, "Error initializing Amplify: \(error)")
}
Expand All @@ -145,7 +145,7 @@ You can choose at anytime to flush the log messages that are saved locally on th





<InlineFilter filters={['android']}>

Expand Down Expand Up @@ -227,7 +227,7 @@ import AWSCloudWatchLoggingPlugin
Execute the flush log function from the plugin.

```swift
let cloudWatchPlugin = try Amplify.Logging.getPlugin(for: "awsCloudWatchLoggingPlugin") as? AWSCloudWatchLoggingPlugin
let cloudWatchPlugin = try Amplify.Logging.getPlugin(for: "awsCloudWatchLoggingPlugin") as? AWSCloudWatchLoggingPlugin
try await cloudWatchPlugin?.flushLogs()
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ do {
let remoteConfigProvider = DefaultRemoteLoggingConstraintsProvider(endpoint: endpointUrl, region: "<region>")
let loggingPlugin = AWSCloudWatchLoggingPlugin(remoteLoggingConstraintsProvider: remoteConfigProvider)
try Amplify.add(plugin: loggingPlugin)
try Amplify.configure()
try Amplify.configure(with: .amplifyOutputs)
} catch {
assert(false, "Error initializing Amplify: \(error)")
}
Expand Down
Loading

0 comments on commit 4a7e279

Please sign in to comment.