Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/next-release/main' into amplif…
Browse files Browse the repository at this point in the history
…yconfiguration-to-outputs
  • Loading branch information
josefaidt committed May 2, 2024
2 parents 1d457b5 + 2c33953 commit 5e423c4
Show file tree
Hide file tree
Showing 64 changed files with 2,819 additions and 2,460 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
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@
"customizable",
"customtabs",
"customui",
"conver",
"dabit",
"dataaccess",
"dataacess",
Expand Down Expand Up @@ -916,6 +917,7 @@
"Neue",
"NEW_PASSWORD_REQUIRED",
"newHire",
"newimage",
"NextActivity.class",
"NextActivity",
"nextActivityClass",
Expand Down Expand Up @@ -1343,6 +1345,7 @@
"Untag",
"updateapi",
"updateauth",
"updatedimage",
"UpdateTable",
"updateTodo",
"uploadData",
Expand Down Expand Up @@ -1517,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
11 changes: 10 additions & 1 deletion src/directory/directory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const directory = {
path: 'src/pages/[platform]/start/manual-installation/index.mdx'
},
{
path: 'src/pages/[platform]/start/gen1-gen2/index.mdx'
path: 'src/pages/[platform]/start/migrate-to-gen2/index.mdx'
}
]
},
Expand Down Expand Up @@ -144,6 +144,9 @@ export const directory = {
{
path: 'src/pages/[platform]/build-a-backend/auth/multi-step-sign-in/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/sign-in-with-web-ui/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/auth/app-uninstall/index.mdx'
},
Expand All @@ -158,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 Expand Up @@ -258,6 +264,9 @@ export const directory = {
}
]
},
{
path: 'src/pages/[platform]/build-a-backend/data/working-with-files/index.mdx'
},
{
path: 'src/pages/[platform]/build-a-backend/data/custom-subscription/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 All @@ -378,6 +378,16 @@ To initialize the Amplify Auth and Analytics categories you call `Amplify.addPlu

Add the following code to your `onCreate()` method in your application class:

<Callout warning>
Before calling the `Amplify.configure` function, make sure to either download the `amplify_outputs.json` file from the console, or generate it with the following command:

```bash title="Terminal" showLineNumbers={false}
npx ampx generate outputs --app-id <app-id> --branch main --out-dir app/src/main/res/raw
```

Next, be sure the file you generated or downloaded is in the appropriate resource directory for your application (for example, `app/src/main/res/raw`) in your Android project. Otherwise, you will not be able to compile your application.
</Callout>

<BlockSwitcher>
<Block name="Java">

Expand All @@ -387,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 All @@ -406,7 +418,7 @@ public class MyAmplifyApp extends Application {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
Amplify.addPlugin(new AWSCognitoAuthPlugin());
Amplify.addPlugin(new AWSPinpointAnalyticsPlugin());
Amplify.configure(getApplicationContext());
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), getApplicationContext());

Log.i("MyAmplifyApp", "Initialized Amplify");
} catch (AmplifyException error) {
Expand All @@ -425,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 @@ -443,7 +456,7 @@ class MyAmplifyApp : Application() {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSPinpointAnalyticsPlugin())
Amplify.configure(applicationContext)
Amplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), applicationContext)

Log.i("MyAmplifyApp", "Initialized Amplify")
} catch (error: AmplifyException) {
Expand All @@ -461,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 All @@ -481,7 +495,7 @@ public class MyAmplifyApp extends Application {
// Add these lines to add the AWSCognitoAuthPlugin and AWSPinpointAnalyticsPlugin plugins
RxAmplify.addPlugin(new AWSCognitoAuthPlugin());
RxAmplify.addPlugin(new AWSPinpointAnalyticsPlugin());
RxAmplify.configure(getApplicationContext());
RxAmplify.configure(AmplifyOutputs.fromResource(R.raw.amplify_outputs), getApplicationContext());

Log.i("MyAmplifyApp", "Initialized Amplify");
} catch (AmplifyException error) {
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
Loading

0 comments on commit 5e423c4

Please sign in to comment.