Skip to content

Commit

Permalink
chore: init 6 πŸŽ‰
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed May 9, 2023
0 parents commit ba83bf1
Show file tree
Hide file tree
Showing 42 changed files with 10,990 additions and 0 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults, not IE 11, maintained node versions
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=
32 changes: 32 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2022,
sourceType: 'module',
lib: ['es2022'],
ecmaFeatures: {
jsx: false,
},
},
plugins: ['jsdoc', 'prettier', 'security', 'import', '@typescript-eslint'],
extends: [
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsdoc/recommended',
'plugin:security/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
// add your custom rules here
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
46 changes: 46 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/'
schedule:
interval: daily
time: '00:00'
reviewers:
- vinayakkulkarni
assignees:
- vinayakkulkarni
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `npm` packages
- package-ecosystem: npm
versioning-strategy: increase
directory: '/example'
schedule:
interval: daily
time: '00:00'
reviewers:
- vinayakkulkarni
assignees:
- vinayakkulkarni
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
reviewers:
- vinayakkulkarni
assignees:
- vinayakkulkarni
commit-message:
prefix: fix
prefix-development: chore
include: scope
Binary file added .github/images/averageHeatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/densityHeatmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions .github/workflows/automerger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Automerge Dependabot PRs'

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata πŸ€–
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
with:
alert-lookup: true
compat-lookup: true
github-token: ${{ secrets.DEPENDABOT_TOKEN }}

- name: Authenticate CLI with PAT πŸ”
run: echo "${{ secrets.DEPENDABOT_TOKEN }}" | gh auth login --with-token

- name: Approve Dependabot PRs πŸ‘
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}

- name: Auto-merge Dependabot PRs πŸ•Ί
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Continuous Integration'

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

permissions:
checks: write
contents: read

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository ✨ (non dependabot)
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/checkout@v3

- name: Check out repository πŸŽ‰ (dependabot)
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node env πŸ“¦
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'

- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Run linter(s) πŸ‘€
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
continue_on_error: false
neutral_check_on_warning: true
auto_fix: false
eslint: true
eslint_extensions: js,ts
prettier: true
prettier_extensions: js,ts

- name: Perform tests πŸ§ͺ
run: npm run test

- name: Run build 🏁
run: npm run build
43 changes: 43 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'CodeQL'

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '45 23 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [javascript]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{ matrix.language }}'
40 changes: 40 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Deploy to Pages'

on:
push:
branches:
- main

jobs:
deploy-demo:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './example/'
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup node env πŸ“¦
uses: actions/setup-node@v3
with:
node-version: 'current'
check-latest: true
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Run build 🏁
run: npm run build
env:
VITE_WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}

- name: Deploy to GitHub Pages πŸš€
uses: peaceiris/actions-gh-pages@v3.9.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./example/dist
28 changes: 28 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

check-sign-off:
if: startsWith(github.head_ref, 'releases/v') == false
name: Write comment if unsigned commits found
env:
FORCE_COLOR: 1
runs-on: ubuntu-latest
steps:
- uses: live627/check-pr-signoff-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Ship js trigger

on:
pull_request:
types:
- closed

jobs:
build:
name: Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- name: Checkout code πŸ›Ž
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main

- name: Setup GitHub Actor
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Setup node environment πŸ“¦
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
check-latest: true
cache: 'npm'

- name: Install dependencies πŸš€
run: npm ci --prefer-offline --no-audit --omit=optional

- name: Trigger a release πŸ₯³
run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
Loading

0 comments on commit ba83bf1

Please sign in to comment.