Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel LOURENCO committed Dec 20, 2024
1 parent 063448e commit 48c8073
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
dist
.docz
.github
node_modules
# Parsing error in cypress/commons/services/stubbing.js,
# remove this exception after migration to eslint 8 (with parser option "ecmaVersion": 2022)
cypress/commons/services/stubbing.js
cypress/reports
scripts/migration/src/*/templates
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"env": {
"browser": true,
"es2021": true,
"jest/globals": true,
"cypress/globals": true
},
"extends": [
"plugin:react/recommended",
"standard",
"eslint:recommended",
"plugin:jest/recommended",
"plugin:cypress/recommended",
"prettier",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "react-hooks", "jest", "cypress", "prettier"],
"rules": {
"no-constant-binary-expression": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"cypress/no-assigning-return-values": "error",
"cypress/no-unnecessary-waiting": "error",
"cypress/assertion-before-screenshot": "warn",
"cypress/no-force": "error",
"cypress/no-async-tests": "error",
"semi": [2, "always"],
"max-len": ["error", { "code": 120 }]
},
"settings": {
"react": {
"version": "detect"
}
}
}
6 changes: 6 additions & 0 deletions .git-hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# fix for windows systems
PATH="/c/Program Files/nodejs:$HOME/AppData/Roaming/npm/:$PATH"

git-conventional-commits commit-msg-hook "$1"
Empty file added .gitattributes
Empty file.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Before creating a PR, please check that:
- [ ] Code is clean
- [ ] Tests are still working (cypress tests and `yarn test`)
- [ ] Changes don't cause new errors or warnings in browser console
- [ ] Documentation is up-to-date
- [ ] Breaking changes are clearly identified with [conventional commits](https://kapeli.com/cheat_sheets/Conventional_Commits.docset/Contents/Resources/Documents/index)
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
commit-message:
prefix: "GitHub Actions"
labels:
- dependencies
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
commit-message:
prefix: "npm"
labels:
- dependencies
45 changes: 45 additions & 0 deletions .github/workflows/azure-static-web-apps-nice-wave-0f618f503.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
build_and_deploy_job:
if: ${{ ! startsWith(github.head_ref, 'dependabot/') && ( github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') ) }}
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_WAVE_0F618F503 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "api" # Api source code path - optional
output_location: "build" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: ${{ ! startsWith(github.head_ref, 'dependabot/') && (github.event_name == 'pull_request' && github.event.action == 'closed') }}
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_WAVE_0F618F503 }}
action: "close"
27 changes: 27 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on:
pull_request:
branches:
- '**'
push:
branches:
- '**'
jobs:
eslint:
if: ${{ ! startsWith(github.head_ref, 'dependabot/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Run eslint
run: yarn install && yarn eslint .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
pull_request:
branches:
- '**'
push:
branches:
- '**'
jobs:
tests:
if: ${{ ! startsWith(github.head_ref, 'dependabot/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Run tests
run: yarn install && yarn test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.yarn
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.azure
.env

# vim
*~
*.swp

# vscode
.vscode

# idea
.idea

# npm: use only warn lock file
package-lock.json

# python
__pycache__

# yalc
.yalc
yalc.lock
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build
dist
.docz
.github
node_modules
stats.html
cypress/reports
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"singleQuote": true,
"printWidth": 120,
"trailingComma": "es5",
"importOrder": ["react", "prop-types", "<THIRD_PARTY_MODULES>", "^@cosmotech/(.*)$", "^[./]"],
"importOrderSeparation": false
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules

0 comments on commit 48c8073

Please sign in to comment.