Skip to content

Commit 7de3b2d

Browse files
authored
chore: format codebase (#12020)
* chore: format codebase * chore: make linter happy again * chore: ignore .yarn * chore: more formats * chore: ignore changelogs * chore: restore changelogs
1 parent ae4d9a1 commit 7de3b2d

File tree

1,250 files changed

+17553
-20233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,250 files changed

+17553
-20233
lines changed

.circleci/config.base.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ executors:
4141
environment:
4242
AMPLIFY_DIR: /home/circleci/repo/out
4343
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
44-
# If you update this name, make sure to update it in split-e2e-tests.ts as well
44+
# If you update this name, make sure to update it in split-e2e-tests.ts as well
4545
l_large: &linux-e2e-executor-large
4646
docker:
4747
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
@@ -50,7 +50,7 @@ executors:
5050
environment:
5151
AMPLIFY_DIR: /home/circleci/repo/out
5252
AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux-x64
53-
# If you update this name, make sure to update it in split-e2e-tests.ts as well
53+
# If you update this name, make sure to update it in split-e2e-tests.ts as well
5454
l_medium: &linux-e2e-executor-medium
5555
docker:
5656
- image: public.ecr.aws/j4f5f3h7/amplify-cli-e2e-base-image-repo-public:latest
@@ -875,10 +875,10 @@ jobs:
875875
- run:
876876
name: 'Wait for all required jobs to finish'
877877
command: |
878-
while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_TOKEN"| jq -r '.items[]|select(.name != "wait_for_all")|.status' | grep -c "running") -gt 0 ]]
879-
do
880-
sleep 60
881-
done
878+
while [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CIRCLECI_TOKEN"| jq -r '.items[]|select(.name != "wait_for_all")|.status' | grep -c "running") -gt 0 ]]
879+
do
880+
sleep 60
881+
done
882882
no_output_timeout: 180m
883883
- run:
884884
name: 'Collect Results'
@@ -1018,8 +1018,8 @@ workflows:
10181018
- /run-e2e\/.*/
10191019
- cleanup_resources:
10201020
context:
1021-
- cleanup-resources
1022-
- e2e-test-context
1021+
- cleanup-resources
1022+
- e2e-test-context
10231023
requires:
10241024
- build
10251025
filters:

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
- restore_cache:
191191
key: >-
192192
amplify-cli-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
193-
- when:
193+
- when:
194194
condition:
195195
equal: [true, << pipeline.parameters.e2e_workflow_cleanup >>]
196196
steps:
@@ -201,7 +201,7 @@ jobs:
201201
cd packages/amplify-e2e-tests
202202
yarn clean-e2e-resources workflow << pipeline.parameters.e2e_workflow_cleanup_workflow_id >>
203203
no_output_timeout: 90m
204-
- when:
204+
- when:
205205
condition:
206206
equal: [true, << pipeline.parameters.e2e_resource_cleanup >>]
207207
steps:
@@ -245,7 +245,7 @@ workflows:
245245
- build
246246
- publish_to_local_registry
247247
e2e_resource_cleanup:
248-
when:
248+
when:
249249
or:
250250
- equal: [true, << pipeline.parameters.e2e_resource_cleanup >>]
251251
- equal: [true, << pipeline.parameters.e2e_workflow_cleanup >>]

.circleci/scan_artifacts.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import { ARTIFACT_STORAGE_PATH_ALLOW_LIST } from '../scripts/artifact-storage-pa
88
// This is because of the location of this file in ~/repo/.circleci/scan_artifacts
99
const ROOT_FOLDER_ABSOLUTE_PATH = path.normalize(path.join(__dirname, '..', '..'));
1010

11-
1211
export const hasMatchingContentInFolder = (
1312
patterns: string[],
1413
folder: string,
15-
excludeFolder = '{node_modules,.cache,.git,\.cache,\.git}',
14+
excludeFolder = '{node_modules,.cache,.git,.cache,.git}',
1615
): boolean => {
17-
console.log("Scanning folder:", folder);
16+
console.log('Scanning folder:', folder);
1817
const patternParam = patterns.reduce<string[]>((acc, v) => [...acc, '-e', v], []);
1918

2019
try {
@@ -25,21 +24,21 @@ export const hasMatchingContentInFolder = (
2524
if (e.exitCode === 1) {
2625
return false;
2726
}
28-
if (e.message.includes('No such file or directory')){
29-
console.log("No artifacts found at:", folder);
27+
if (e.message.includes('No such file or directory')) {
28+
console.log('No artifacts found at:', folder);
3029
return false;
3130
}
3231
throw new Error('Scanning artifacts failed');
3332
}
3433
};
3534

3635
const main = () => {
37-
const envVarNameWithCredentialValues = (process.env.ENV_VAR_WITH_SECRETS || '').split(',').map(v => v.trim());
38-
const values = envVarNameWithCredentialValues.map(v => process.env[v]).filter(Boolean);
36+
const envVarNameWithCredentialValues = (process.env.ENV_VAR_WITH_SECRETS || '').split(',').map((v) => v.trim());
37+
const values = envVarNameWithCredentialValues.map((v) => process.env[v]).filter(Boolean);
3938
if (values.length) {
40-
for(let folder of ARTIFACT_STORAGE_PATH_ALLOW_LIST){
41-
if (folder.startsWith("~/")) {
42-
const normalizedFolder = path.normalize(folder.replace("~", ROOT_FOLDER_ABSOLUTE_PATH));
39+
for (let folder of ARTIFACT_STORAGE_PATH_ALLOW_LIST) {
40+
if (folder.startsWith('~/')) {
41+
const normalizedFolder = path.normalize(folder.replace('~', ROOT_FOLDER_ABSOLUTE_PATH));
4342
const hasContent = hasMatchingContentInFolder(values, normalizedFolder);
4443
if (hasContent) {
4544
console.log('Scanning artifact has found secret value. Failing the build: ', normalizedFolder);

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
'@typescript-eslint/no-misused-promises': 'error',
4444
'no-bitwise': 'warn',
4545
'consistent-return': 'error',
46-
'eol-last': [ 'error', 'always' ],
46+
'eol-last': ['error', 'always'],
4747
'no-restricted-syntax': [
4848
'error',
4949
{
@@ -104,7 +104,7 @@ module.exports = {
104104
},
105105
{
106106
// disable spell checker in tests
107-
files: ['**/__tests__/**','**/__test__/**', '*.test.ts', 'packages/amplify-e2e-*/**', '**/test/**', '**/tests/**'],
107+
files: ['**/__tests__/**', '**/__test__/**', '*.test.ts', 'packages/amplify-e2e-*/**', '**/test/**', '**/tests/**'],
108108
plugins: ['jest'],
109109
extends: ['plugin:jest/recommended'],
110110
rules: {

.github/CODE_OF_CONDUCT.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Code of Conduct
2-
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3-
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4-
[email protected] with any additional questions or comments.
2+
3+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5+
[email protected] with any additional questions or comments.

.github/ISSUE_TEMPLATE/1.bug_report.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: Create a report to help us improve Amplify CLI
3-
labels: ["pending-triage"]
3+
labels: ['pending-triage']
44

55
body:
66
- type: markdown
@@ -19,7 +19,7 @@ body:
1919
- type: input
2020
attributes:
2121
label: How did you install the Amplify CLI?
22-
description: "For example: npm, yarn, curl, etc."
22+
description: 'For example: npm, yarn, curl, etc.'
2323
- type: input
2424
attributes:
2525
label: If applicable, what version of Node.js are you using?
@@ -33,13 +33,13 @@ body:
3333
- type: input
3434
attributes:
3535
label: What operating system are you using?
36-
description: "For example: Mac, Windows, Ubuntu."
36+
description: 'For example: Mac, Windows, Ubuntu.'
3737
validations:
3838
required: true
3939
- type: textarea
4040
attributes:
4141
label: Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
42-
description: "For example: \"Deleted DynamoDB GSIs from the AWS Console or using AWS CLI\" Or \"No manual changes made\""
42+
description: 'For example: "Deleted DynamoDB GSIs from the AWS Console or using AWS CLI" Or "No manual changes made"'
4343
validations:
4444
required: true
4545
- type: markdown

.github/ISSUE_TEMPLATE/2.feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature Request
22
description: Suggest an idea for the CLI
3-
labels: ["pending-triage"]
3+
labels: ['pending-triage']
44

55
body:
66
- type: markdown

.github/ISSUE_TEMPLATE/3.usage_question.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Usage Question
22
description: Ask a question about AWS Amplify CLI usage
3-
labels: ["question", "pending-triage"]
3+
labels: ['question', 'pending-triage']
44
body:
55
- type: markdown
66
attributes:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: true
22
contact_links:
33
- name: I want help writing my Amplify application
44
url: https://discord.com/invite/amplify
5-
about: Check out the `*-help` channels on Amplify's community Discord to ask your questions about building applications with the CLI or other Amplify libraries.
5+
about: Check out the `*-help` channels on Amplify's community Discord to ask your questions about building applications with the CLI or other Amplify libraries.

.github/workflows/codeql.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Ref: https://tinyurl.com/5d6rr8s7
2-
name: "CodeQL"
2+
name: 'CodeQL'
33

44
on:
55
push:
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
language: ["javascript"]
20+
language: ['javascript']
2121

2222
steps:
2323
- name: Checkout repository
@@ -33,4 +33,4 @@ jobs:
3333
- name: Perform CodeQL Analysis
3434
uses: github/codeql-action/analyze@v2
3535
with:
36-
category: "/language:${{matrix.language}}"
36+
category: '/language:${{matrix.language}}'

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.yarn
2+
packages/*/lib
3+
coverage
4+
node_modules
5+
API.md
6+
CHANGELOG.md

.prettierrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"trailingComma": "all",
3-
"singleQuote": true,
4-
"printWidth": 140,
5-
"tabWidth": 2,
6-
"bracketSpacing": true,
7-
"semi": true,
8-
"useTabs": false,
9-
"bracketSameLine": false
2+
"trailingComma": "all",
3+
"singleQuote": true,
4+
"printWidth": 140,
5+
"tabWidth": 2,
6+
"bracketSpacing": true,
7+
"semi": true,
8+
"useTabs": false,
9+
"bracketSameLine": false
1010
}

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The Amplify CLI supports the commands shown in the following table.
6565
| amplify pull | Fetch upstream backend environment definition changes from the cloud and updates the local environment to match that definition. |
6666
| amplify publish | Runs `amplify push`, publishes a static assets to Amazon S3 and Amazon CloudFront (\*hosting category is required). |
6767
| amplify status [ `<category>`...] | Displays the state of local resources that haven't been pushed to the cloud (Create/Update/Delete). |
68-
| amplify status -v [ `<category>`...] | Verbose mode - Shows the detailed verbose diff between local and deployed resources, including cloudformation-diff |
68+
| amplify status -v [ `<category>`...] | Verbose mode - Shows the detailed verbose diff between local and deployed resources, including cloudformation-diff |
6969
| amplify serve | Runs `amplify push`, and then executes the project's start command to test run the client-side application. |
7070
| amplify delete | Deletes resources tied to the project. |
7171
| amplify help \| amplify `<category>` help | Displays help for the core CLI. |

artifacts/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CircleCI Workflow results are stored in this artifacts directory.
22

3-
After each e2e run, you can locate the artifact file here & observe the workflow results summary.
3+
After each e2e run, you can locate the artifact file here & observe the workflow results summary.

cypress.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"baseUrl": "http://localhost:3000/"
3-
}
2+
"baseUrl": "http://localhost:3000/"
3+
}

cypress/fixtures/example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"name": "Using fixtures to represent data",
33
"email": "[email protected]",
44
"body": "Fixtures are a great way to mock data for responses to routes"
5-
}
5+
}

cypress/integration/api_spec.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
describe('API test post and get', {
2-
// Configure retry attempts for `cypress run` (will run a total pf 3 times)
3-
// retries added as the test is getting response greater than default responseTimeout = 30s on first try
4-
retries: {
1+
describe(
2+
'API test post and get',
3+
{
4+
// Configure retry attempts for `cypress run` (will run a total pf 3 times)
5+
// retries added as the test is getting response greater than default responseTimeout = 30s on first try
6+
retries: {
57
runMode: 2,
68
},
7-
}, function() {
8-
beforeEach(function() {
9-
cy.visit('/');
10-
});
9+
},
10+
function () {
11+
beforeEach(function () {
12+
cy.visit('/');
13+
});
1114

12-
it('successfully adds data to dynamodb', function() {
13-
// Check for user not signed up
14-
cy.get('input[name=itemNo]').type('1');
15-
cy.get('.amplify-submit-put-button')
16-
.contains('Put')
17-
.click();
18-
cy.get('.amplify-put-result').contains('post call succeed!');
19-
});
15+
it('successfully adds data to dynamodb', function () {
16+
// Check for user not signed up
17+
cy.get('input[name=itemNo]').type('1');
18+
cy.get('.amplify-submit-put-button').contains('Put').click();
19+
cy.get('.amplify-put-result').contains('post call succeed!');
20+
});
2021

21-
it('successfully get data from dynamodb', function() {
22-
// Check for user not signed up
23-
cy.get('.amplify-submit-get-button')
24-
.contains('Get')
25-
.click();
26-
cy.get('.amplify-get-result').contains('"itemNo":1');
27-
});
28-
});
22+
it('successfully get data from dynamodb', function () {
23+
// Check for user not signed up
24+
cy.get('.amplify-submit-get-button').contains('Get').click();
25+
cy.get('.amplify-get-result').contains('"itemNo":1');
26+
});
27+
},
28+
);

cypress/integration/auth_spec.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
describe('withAuthenticator Sign In', {
2-
// Configure retry attempts for `cypress run` (will run a total pf 3 times)
3-
// retries added as the test is getting response greater than default responseTimeout = 30s on first try
4-
retries: {
1+
describe(
2+
'withAuthenticator Sign In',
3+
{
4+
// Configure retry attempts for `cypress run` (will run a total pf 3 times)
5+
// retries added as the test is getting response greater than default responseTimeout = 30s on first try
6+
retries: {
57
runMode: 2,
68
},
7-
}, function() {
8-
beforeEach(function() {
9-
cy.visit('/');
10-
});
9+
},
10+
function () {
11+
beforeEach(function () {
12+
cy.visit('/');
13+
});
1114

12-
it('throws error when user is not signed up', function() {
13-
// Check for user not signed up
14-
cy.get('input[name=username]').type('testuser');
15-
cy.get('input[name=password]').type('testPassword');
16-
cy.get('button')
17-
.contains('Sign In')
18-
.click();
19-
cy.get('div').contains('User does not exist');
20-
});
21-
});
15+
it('throws error when user is not signed up', function () {
16+
// Check for user not signed up
17+
cy.get('input[name=username]').type('testuser');
18+
cy.get('input[name=password]').type('testPassword');
19+
cy.get('button').contains('Sign In').click();
20+
cy.get('div').contains('User does not exist');
21+
});
22+
},
23+
);

lerna.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"packages": [
3-
"packages/*"
4-
],
2+
"packages": ["packages/*"],
53
"version": "independent",
64
"npmClient": "yarn",
75
"useWorkspaces": true

0 commit comments

Comments
 (0)