Skip to content

Commit

Permalink
Project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Jimenez committed Mar 18, 2022
1 parent d144093 commit 59ea5b2
Show file tree
Hide file tree
Showing 29 changed files with 31,564 additions and 27,302 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:react-hooks/recommended',
'prettier',
],
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'react/function-component-definition': 0,
'react/boolean-prop-naming': 0,
'react/prop-types': 0,
'react-hooks/exhaustive-deps': 1,
'react/react-in-jsx-scope': 0,
'no-unused-vars': 1,
'react/display-name': [0],
},
};
10 changes: 5 additions & 5 deletions .github/.github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ pip-sync

## Useful CDK commands

- `cdk ls` list all stacks in the app
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
- `cdk diff` compare deployed stack with current state
- `cdk docs` open CDK documentation
- `cdk ls` list all stacks in the app
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
- `cdk diff` compare deployed stack with current state
- `cdk docs` open CDK documentation

[getting-started]: https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html
[black]: https://github.com/psf/black
Expand Down
8 changes: 4 additions & 4 deletions .github/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
294 changes: 147 additions & 147 deletions .github/.github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,154 +1,154 @@
name: pr

on:
pull_request:
branches:
- main
pull_request:
branches:
- main

env:
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: GitHub
GIT_COMMITTER_EMAIL: [email protected]
CDK_DEFAULT_ACCOUNT: 111111111111
CDK_DEFAULT_REGION: us-east-1
CDK_DEPLOY_STAGES: dev int tp prod
CDK_DEPLOY_dev_ACCOUNTS: 111111111111
CDK_DEPLOY_int_ACCOUNTS: 111111111111
CDK_DEPLOY_tp_ACCOUNTS: 333333333333
CDK_DEPLOY_prod_ACCOUNTS: 333333333333
CDK_DEPLOY_dev_111111111111_REGIONS: us-east-1
CDK_DEPLOY_int_111111111111_REGIONS: us-east-1
CDK_DEPLOY_tp_333333333333_REGIONS: us-east-1
CDK_DEPLOY_prod_333333333333_REGIONS: us-east-1
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: GitHub
GIT_COMMITTER_EMAIL: [email protected]
CDK_DEFAULT_ACCOUNT: 111111111111
CDK_DEFAULT_REGION: us-east-1
CDK_DEPLOY_STAGES: dev int tp prod
CDK_DEPLOY_dev_ACCOUNTS: 111111111111
CDK_DEPLOY_int_ACCOUNTS: 111111111111
CDK_DEPLOY_tp_ACCOUNTS: 333333333333
CDK_DEPLOY_prod_ACCOUNTS: 333333333333
CDK_DEPLOY_dev_111111111111_REGIONS: us-east-1
CDK_DEPLOY_int_111111111111_REGIONS: us-east-1
CDK_DEPLOY_tp_333333333333_REGIONS: us-east-1
CDK_DEPLOY_prod_333333333333_REGIONS: us-east-1

jobs:
cdk-diff:
runs-on: ubuntu-latest
steps:
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: "12"

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install CDK
run: npm install -g aws-cdk@1

- name: Checkout main
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0

- name: Setup Artifactory
uses: blackboard-innersource/gh-action-setup-artifactory@main
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_PYPI_INDEX: ${{ secrets.ARTIFACTORY_PYPI_INDEX }}
ARTIFACTORY_NPM_REGISTRY: ${{ secrets.ARTIFACTORY_NPM_REGISTRY }}

- name: Install main dependencies
run: pip install pip-tools && pip-sync

- name: CDK synth main
run: cdk synth -o base.cdk.out

- name: Checkout PR branch
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
clean: false

- name: Merge main to PR branch
run: git merge origin/main

- name: Install PR branch dependencies
run: pip-sync

- name: CDK synth PR branch
run: cdk synth -o head.cdk.out

- name: Comment on Pull Request
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: fs.readFileSync('${{ steps.diff.outputs.comment_file }}', 'utf8')
})
# Always run this last as it can push new changes and actions will not rerun.
pre-commit:
needs: [cdk-diff]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install PreCommit
run: pip install pre-commit

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: PreCommit
id: pre-commit
run: |
if SKIP=flake8 pre-commit run --show-diff-on-failure --color=always --all-files; then
echo "::set-output name=failed::0"
else
echo "::set-output name=failed::1"
fi
if [ -n "$(git status -s)" ]; then
echo "::set-output name=dirty::1"
else
echo "::set-output name=dirty::0"
fi
# Run a second time to verify that everything has indeed been fixed.
- name: PreCommit verify
if: steps.pre-commit.outputs.failed == 1
run: |
SKIP=flake8 pre-commit run --show-diff-on-failure --color=always --all-files
- name: Commit and Push to Pull Request
if: steps.pre-commit.outputs.failed == 1 && steps.pre-commit.outputs.dirty == 1
run: |
git add .
git status
git commit -m "Automated formatting changes"
git push origin ${{ github.head_ref }}
- name: Comment on Pull Request
if: steps.pre-commit.outputs.failed == 1 && steps.pre-commit.outputs.dirty == 1
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ':sparkles: :star: A new commit has been added to your pull request to fix formatting! :star: :sparkles:'
})
cdk-diff:
runs-on: ubuntu-latest
steps:
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: '12'

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install CDK
run: npm install -g aws-cdk@1

- name: Checkout main
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0

- name: Setup Artifactory
uses: blackboard-innersource/gh-action-setup-artifactory@main
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_PYPI_INDEX: ${{ secrets.ARTIFACTORY_PYPI_INDEX }}
ARTIFACTORY_NPM_REGISTRY: ${{ secrets.ARTIFACTORY_NPM_REGISTRY }}

- name: Install main dependencies
run: pip install pip-tools && pip-sync

- name: CDK synth main
run: cdk synth -o base.cdk.out

- name: Checkout PR branch
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
clean: false

- name: Merge main to PR branch
run: git merge origin/main

- name: Install PR branch dependencies
run: pip-sync

- name: CDK synth PR branch
run: cdk synth -o head.cdk.out

- name: Comment on Pull Request
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: fs.readFileSync('${{ steps.diff.outputs.comment_file }}', 'utf8')
})
# Always run this last as it can push new changes and actions will not rerun.
pre-commit:
needs: [cdk-diff]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install PreCommit
run: pip install pre-commit

- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: PreCommit
id: pre-commit
run: |
if SKIP=flake8 pre-commit run --show-diff-on-failure --color=always --all-files; then
echo "::set-output name=failed::0"
else
echo "::set-output name=failed::1"
fi
if [ -n "$(git status -s)" ]; then
echo "::set-output name=dirty::1"
else
echo "::set-output name=dirty::0"
fi
# Run a second time to verify that everything has indeed been fixed.
- name: PreCommit verify
if: steps.pre-commit.outputs.failed == 1
run: |
SKIP=flake8 pre-commit run --show-diff-on-failure --color=always --all-files
- name: Commit and Push to Pull Request
if: steps.pre-commit.outputs.failed == 1 && steps.pre-commit.outputs.dirty == 1
run: |
git add .
git status
git commit -m "Automated formatting changes"
git push origin ${{ github.head_ref }}
- name: Comment on Pull Request
if: steps.pre-commit.outputs.failed == 1 && steps.pre-commit.outputs.dirty == 1
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ':sparkles: :star: A new commit has been added to your pull request to fix formatting! :star: :sparkles:'
})
10 changes: 5 additions & 5 deletions .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ pip-sync

## Useful CDK commands

- `cdk ls` list all stacks in the app
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
- `cdk diff` compare deployed stack with current state
- `cdk docs` open CDK documentation
- `cdk ls` list all stacks in the app
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
- `cdk diff` compare deployed stack with current state
- `cdk docs` open CDK documentation

[getting-started]: https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html
[black]: https://github.com/psf/black
Expand Down
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
Loading

0 comments on commit 59ea5b2

Please sign in to comment.