Skip to content

Commit

Permalink
Merge pull request #8 from riteshsp2000/boilerplate
Browse files Browse the repository at this point in the history
Boilerplate
  • Loading branch information
riteshsp2000 authored Mar 17, 2021
2 parents 9a9fe36 + a80c53a commit e4c84d0
Show file tree
Hide file tree
Showing 62 changed files with 5,673 additions and 18,609 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/prDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: GitHub Page PR Preview Deploy

on:
pull_request:
types: [labeled]

jobs:
firebase-pr-preview:
name: GitHub Pages PR Deploy
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'create-live-preview')
steps:
- name: Checkout Repository
uses: actions/checkout@master

- name: Setup Node v14
uses: actions/setup-node@master
with:
node-version: "14.x"

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: cd client && yarn install --frozen-lockfile

- name: Build React WebApp
run: cd client && yarn build

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Deploy to GitHub Page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/build
publish_branch: ${{ steps.extract_branch.outputs.branch }}

- name: removelabel
uses: buildsville/add-remove-label@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
deploy_key: ${{secrets.ACTIONS_DEPLOY_KEY}}
label: create-live-preview
type: remove
30 changes: 30 additions & 0 deletions .github/workflows/prodDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: GitHub Pages Staging Deploy

on:
release:
types: [released]

jobs:
firebase-prod-deploy:
name: GitHub Pages Production Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master

- name: Setup Node v14
uses: actions/setup-node@master
with:
node-version: "14.x"

- name: Install Dependencies
run: cd client && yarn install --frozen-lockfile

- name: Build React WebApp
run: cd client && yarn build

- name: Deploy to GitHub Page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/build
32 changes: 32 additions & 0 deletions .github/workflows/stageDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: GitHub Pages Staging Deploy

on:
push:
branches: [main]
paths:
- "client/**"

jobs:
firebase-stage-deploy:
name: GitHub Pages Development Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master

- name: Setup Node v14
uses: actions/setup-node@master
with:
node-version: "14.x"

- name: Install Dependencies
run: cd client && yarn install --frozen-lockfile

- name: Build React WebApp
run: cd client && yarn build

- name: Deploy to GitHub Page
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/build
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"formulahendry.auto-rename-tag",
"mgmcdermott.vscode-language-babel",
"VisualStudioExptTeam.vscodeintellicode"
]
}
60 changes: 60 additions & 0 deletions .vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.detectIndentation": true,
"editor.snippetSuggestions": "top",
"editor.wordBasedSuggestions": false,
"editor.suggest.localityBonus": true,
"editor.acceptSuggestionOnCommitCharacter": false,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed",
"editor.suggest.showKeywords": false
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed",
"editor.suggest.showKeywords": false
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed",
"editor.suggest.showKeywords": false
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.renderWhitespace": "boundary",
"files.exclude": {
"USE_GITIGNORE": true
},
"files.defaultLanguage": "{activeEditorLanguage}",
"javascript.validate.enable": false,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/coverage": true,
"**/dist": true,
"**/build": true,
"**/.build": true,
"**/.gh-pages": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"npm.runSilent": true,
"explorer.confirmDragAndDrop": false,
"editor.formatOnPaste": false,
"editor.cursorSmoothCaretAnimation": true,
"editor.smoothScrolling": true
}
7 changes: 7 additions & 0 deletions client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
build
coverage
public
.docz
scripts/workshop-setup.js
.eslintrc.js
19 changes: 0 additions & 19 deletions client/.eslintrc

This file was deleted.

39 changes: 39 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
root: true,
extends: [
'airbnb-typescript',
'airbnb/hooks',
'prettier',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['react', '@typescript-eslint', 'prettier'],
env: {
browser: true,
jest: true,
node: true,
es6: true,
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {jsx: true},
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
settings: {
react: {
pragma: 'React',
version: 'detect',
},
},
rules: {
'@typescript-eslint/dot-notation': 0,
'no-plusplus': 0,
},
};
60 changes: 19 additions & 41 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
# Logs
logs
*.log
.DS_Store

#environment
.env

#package
package-lock.json

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Coverage directory used by tools like istanbul
coverage
# dependencies
/node_modules
/.pnp
.pnp.js

# Jest Clutter
__snapshots__
# testing
/coverage

# IDE
.idea
.vscode
# production
/build

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Ignore build files
public
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
5 changes: 4 additions & 1 deletion client/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
dist
build
coverage
public
.docz
24 changes: 14 additions & 10 deletions client/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"arrowParens": "avoid",
"bracketSpacing": false,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "auto",
"proseWrap": "preserve",
"quoteProps": "as-needed",
"jsxBracketSameLine": false,
"jsxSingleQuote": true
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
Loading

0 comments on commit e4c84d0

Please sign in to comment.