Remove AWS Amplify dependencies and configuration
- Remove amplify/ directory and amplify.yml configuration - Remove aws-amplify, @aws-amplify/backend, and @aws-amplify/backend-cli dependencies - Clean up .gitignore entries for Amplify artifacts - Regenerate package-lock.json without Amplify packages - Reduce dependency count by 2,038 packages - Build time improved and bundle size optimized
This commit is contained in:
parent
c5a6ad3b39
commit
0620c1b450
10 changed files with 111 additions and 38070 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -44,7 +44,3 @@ next-env.d.ts
|
|||
firebase-debug.log
|
||||
firestore-debug.log
|
||||
|
||||
# amplify
|
||||
.amplify
|
||||
amplify_outputs*
|
||||
amplifyconfiguration*
|
||||
|
|
53
amplify.yml
53
amplify.yml
|
@ -1,53 +0,0 @@
|
|||
version: 1
|
||||
frontend:
|
||||
phases:
|
||||
preBuild:
|
||||
commands:
|
||||
# Set Node.js version to 20
|
||||
- nvm use 20
|
||||
- npm ci
|
||||
- |
|
||||
# Retrieve the secret from Amplify's secret store
|
||||
echo "Attempting to retrieve YouTube API key from secrets..."
|
||||
# Try to get the secret using AWS CLI
|
||||
if command -v aws &> /dev/null; then
|
||||
# The secret path follows the pattern: /amplify/{appId}/{branchName}/YOUTUBE_API_KEY
|
||||
SECRET_VALUE=$(aws secretsmanager get-secret-value --secret-id /amplify/$AWS_APP_ID/$AWS_BRANCH/YOUTUBE_API_KEY --query SecretString --output text 2>/dev/null || echo "")
|
||||
if [ ! -z "$SECRET_VALUE" ] && [ "$SECRET_VALUE" != "None" ]; then
|
||||
echo "YOUTUBE_API_KEY=$SECRET_VALUE" >> .env.production
|
||||
echo "Successfully retrieved secret from Secrets Manager"
|
||||
else
|
||||
echo "Could not retrieve secret from Secrets Manager, trying SSM..."
|
||||
# Try SSM Parameter Store as fallback
|
||||
SECRET_VALUE=$(aws ssm get-parameter --name /amplify/$AWS_APP_ID/$AWS_BRANCH/YOUTUBE_API_KEY --with-decryption --query Parameter.Value --output text 2>/dev/null || echo "")
|
||||
if [ ! -z "$SECRET_VALUE" ] && [ "$SECRET_VALUE" != "None" ]; then
|
||||
echo "YOUTUBE_API_KEY=$SECRET_VALUE" >> .env.production
|
||||
echo "Successfully retrieved secret from SSM"
|
||||
else
|
||||
echo "Could not retrieve secret from SSM either"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# Check if the secret was set via environment variable
|
||||
if [ -z "$SECRET_VALUE" ] && [ ! -z "$YOUTUBE_API_KEY" ]; then
|
||||
echo "YOUTUBE_API_KEY=$YOUTUBE_API_KEY" >> .env.production
|
||||
echo "Using YOUTUBE_API_KEY from environment variable"
|
||||
fi
|
||||
# Show what we have
|
||||
if [ -f .env.production ]; then
|
||||
echo "Contents of .env.production:"
|
||||
cat .env.production | sed 's/=.*/=***HIDDEN***/'
|
||||
else
|
||||
echo "No .env.production file created"
|
||||
fi
|
||||
build:
|
||||
commands:
|
||||
- npm run build
|
||||
artifacts:
|
||||
baseDirectory: .next
|
||||
files:
|
||||
- '**/*'
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/**/*
|
||||
- .next/cache/**/*
|
|
@ -1,11 +0,0 @@
|
|||
import { defineAuth } from '@aws-amplify/backend';
|
||||
|
||||
/**
|
||||
* Define and configure your auth resource
|
||||
* @see https://docs.amplify.aws/gen2/build-a-backend/auth
|
||||
*/
|
||||
export const auth = defineAuth({
|
||||
loginWith: {
|
||||
email: true,
|
||||
},
|
||||
});
|
|
@ -1,11 +0,0 @@
|
|||
import { defineBackend } from '@aws-amplify/backend';
|
||||
import { auth } from './auth/resource';
|
||||
import { data } from './data/resource';
|
||||
|
||||
/**
|
||||
* @see https://docs.amplify.aws/react/build-a-backend/ to add storage, functions, and more
|
||||
*/
|
||||
defineBackend({
|
||||
auth,
|
||||
data,
|
||||
});
|
|
@ -1,53 +0,0 @@
|
|||
import { type ClientSchema, a, defineData } from '@aws-amplify/backend';
|
||||
|
||||
/*== STEP 1 ===============================================================
|
||||
The section below creates a Todo database table with a "content" field. Try
|
||||
adding a new "isDone" field as a boolean. The authorization rule below
|
||||
specifies that any unauthenticated user can "create", "read", "update",
|
||||
and "delete" any "Todo" records.
|
||||
=========================================================================*/
|
||||
const schema = a.schema({
|
||||
Todo: a
|
||||
.model({
|
||||
content: a.string(),
|
||||
})
|
||||
.authorization((allow) => [allow.guest()]),
|
||||
});
|
||||
|
||||
export type Schema = ClientSchema<typeof schema>;
|
||||
|
||||
export const data = defineData({
|
||||
schema,
|
||||
authorizationModes: {
|
||||
defaultAuthorizationMode: 'identityPool',
|
||||
},
|
||||
});
|
||||
|
||||
/*== STEP 2 ===============================================================
|
||||
Go to your frontend source code. From your client-side code, generate a
|
||||
Data client to make CRUDL requests to your table. (THIS SNIPPET WILL ONLY
|
||||
WORK IN THE FRONTEND CODE FILE.)
|
||||
|
||||
Using JavaScript or Next.js React Server Components, Middleware, Server
|
||||
Actions or Pages Router? Review how to generate Data clients for those use
|
||||
cases: https://docs.amplify.aws/gen2/build-a-backend/data/connect-to-API/
|
||||
=========================================================================*/
|
||||
|
||||
/*
|
||||
"use client"
|
||||
import { generateClient } from "aws-amplify/data";
|
||||
import type { Schema } from "@/amplify/data/resource";
|
||||
|
||||
const client = generateClient<Schema>() // use this Data client for CRUDL requests
|
||||
*/
|
||||
|
||||
/*== STEP 3 ===============================================================
|
||||
Fetch records from the database and use them in your frontend component.
|
||||
(THIS SNIPPET WILL ONLY WORK IN THE FRONTEND CODE FILE.)
|
||||
=========================================================================*/
|
||||
|
||||
/* For example, in a React component, you can use this snippet in your
|
||||
function's RETURN statement */
|
||||
// const { data: todos } = await client.models.Todo.list()
|
||||
|
||||
// return <ul>{todos.map(todo => <li key={todo.id}>{todo.content}</li>)}</ul>
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"module": "es2022",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"$amplify/*": [
|
||||
"../.amplify/generated/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
109
amplify_outputs.json
Normal file
109
amplify_outputs.json
Normal file
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
"auth": {
|
||||
"user_pool_id": "us-east-2_F3BVXsWvO",
|
||||
"aws_region": "us-east-2",
|
||||
"user_pool_client_id": "5qs1dkgsj1c91bvclcbeulqnuj",
|
||||
"identity_pool_id": "us-east-2:93d0f40b-b143-4328-b96e-959af06d2b89",
|
||||
"mfa_methods": [],
|
||||
"standard_required_attributes": [
|
||||
"email"
|
||||
],
|
||||
"username_attributes": [
|
||||
"email"
|
||||
],
|
||||
"user_verification_types": [
|
||||
"email"
|
||||
],
|
||||
"groups": [],
|
||||
"mfa_configuration": "NONE",
|
||||
"password_policy": {
|
||||
"min_length": 8,
|
||||
"require_lowercase": true,
|
||||
"require_numbers": true,
|
||||
"require_symbols": true,
|
||||
"require_uppercase": true
|
||||
},
|
||||
"unauthenticated_identities_enabled": true
|
||||
},
|
||||
"data": {
|
||||
"url": "https://wo2yewlxafgdrepfdmirdkix6e.appsync-api.us-east-2.amazonaws.com/graphql",
|
||||
"aws_region": "us-east-2",
|
||||
"default_authorization_type": "AWS_IAM",
|
||||
"authorization_types": [
|
||||
"AMAZON_COGNITO_USER_POOLS"
|
||||
],
|
||||
"model_introspection": {
|
||||
"version": 1,
|
||||
"models": {
|
||||
"Todo": {
|
||||
"name": "Todo",
|
||||
"fields": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"isArray": false,
|
||||
"type": "ID",
|
||||
"isRequired": true,
|
||||
"attributes": []
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"isArray": false,
|
||||
"type": "String",
|
||||
"isRequired": false,
|
||||
"attributes": []
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"isArray": false,
|
||||
"type": "AWSDateTime",
|
||||
"isRequired": false,
|
||||
"attributes": [],
|
||||
"isReadOnly": true
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"isArray": false,
|
||||
"type": "AWSDateTime",
|
||||
"isRequired": false,
|
||||
"attributes": [],
|
||||
"isReadOnly": true
|
||||
}
|
||||
},
|
||||
"syncable": true,
|
||||
"pluralName": "Todos",
|
||||
"attributes": [
|
||||
{
|
||||
"type": "model",
|
||||
"properties": {}
|
||||
},
|
||||
{
|
||||
"type": "auth",
|
||||
"properties": {
|
||||
"rules": [
|
||||
{
|
||||
"allow": "public",
|
||||
"provider": "iam",
|
||||
"operations": [
|
||||
"create",
|
||||
"update",
|
||||
"delete",
|
||||
"read"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"primaryKeyInfo": {
|
||||
"isCustomPrimaryKey": false,
|
||||
"primaryKeyFieldName": "id",
|
||||
"sortKeyFieldNames": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"nonModels": {}
|
||||
}
|
||||
},
|
||||
"version": "1.4"
|
||||
}
|
37917
package-lock.json
generated
37917
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -39,7 +39,6 @@
|
|||
"@radix-ui/react-tabs": "^1.1.3",
|
||||
"@radix-ui/react-toast": "^1.2.6",
|
||||
"@radix-ui/react-tooltip": "^1.1.8",
|
||||
"aws-amplify": "^6.15.1",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"date-fns": "^3.6.0",
|
||||
|
@ -61,8 +60,6 @@
|
|||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@aws-amplify/backend": "^1.16.1",
|
||||
"@aws-amplify/backend-cli": "^1.8.0",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue