From f346d58a722066ed6e4baa24e9ba61342455ca62 Mon Sep 17 00:00:00 2001 From: Brandon Cotter Date: Fri, 15 Mar 2024 11:11:11 -0700 Subject: [PATCH] deleted README, removed additional linting references, added licensing headers --- .../scenarios/react-web-app/README.md | 30 ------------------- .../scenarios/react-web-app/src/App.tsx | 3 ++ .../react-web-app/src/authService.ts | 3 ++ .../scenarios/react-web-app/src/config.json | 6 ++-- .../react-web-app/src/confirmUserPage.tsx | 3 ++ .../scenarios/react-web-app/src/homePage.tsx | 3 ++ .../scenarios/react-web-app/src/loginPage.tsx | 3 ++ .../scenarios/react-web-app/src/main.tsx | 3 ++ .../scenarios/react-web-app/vite.config.ts | 3 ++ 9 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/README.md diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/README.md b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/README.md deleted file mode 100644 index 0d6babeddbd..00000000000 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# React + TypeScript + Vite - -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. - -Currently, two official plugins are available: - -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: - -- Configure the top-level `parserOptions` property like this: - -```js -export default { - // other rules... - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - project: ['./tsconfig.json', './tsconfig.node.json'], - tsconfigRootDir: __dirname, - }, -} -``` - -- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` -- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/App.tsx b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/App.tsx index 6192ade7d06..a0d5e1a08db 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/App.tsx +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/App.tsx @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import React from 'react'; import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; import LoginPage from './loginPage'; diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/authService.ts b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/authService.ts index 6a821d5ffad..8229ad4268f 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/authService.ts +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/authService.ts @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import { CognitoIdentityProviderClient, InitiateAuthCommand, SignUpCommand, ConfirmSignUpCommand } from "@aws-sdk/client-cognito-identity-provider"; import config from "./config.json"; diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/config.json b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/config.json index 174396c671d..fe32a8f5061 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/config.json +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/config.json @@ -1,5 +1,5 @@ { - "region": "us-west-2", - "userPoolId": "us-west-2_ywDJHlIfU", - "clientId": "14pq32c5q2uq2q7keorloqvb23" + "region": "[Enter a Region]", + "userPoolId": "[Enter a user pool ID like us-east-1_EXAMPLE]", + "clientId": "[Enter an app client ID like 1example23456789]" } diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/confirmUserPage.tsx b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/confirmUserPage.tsx index 1875d5cdbf4..915f068db43 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/confirmUserPage.tsx +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/confirmUserPage.tsx @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import React, { useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { confirmSignUp } from './authService'; diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/homePage.tsx b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/homePage.tsx index f68b3b59580..8b46ae85bee 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/homePage.tsx +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/homePage.tsx @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import React from 'react'; import { useNavigate } from 'react-router-dom'; diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/loginPage.tsx b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/loginPage.tsx index 37c03fc41a8..4eabecda431 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/loginPage.tsx +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/loginPage.tsx @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { signIn, signUp } from './authService'; diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/main.tsx b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/main.tsx index 3d7150da80e..3ac7e53b921 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/main.tsx +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/src/main.tsx @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import React from 'react' import ReactDOM from 'react-dom/client' import App from './App.tsx' diff --git a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/vite.config.ts b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/vite.config.ts index 5a33944a9b4..2eadebed493 100644 --- a/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/vite.config.ts +++ b/javascriptv3/example_code/cognito-identity-provider/scenarios/react-web-app/vite.config.ts @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + import { defineConfig } from 'vite' import react from '@vitejs/plugin-react'