Skip to content

Commit

Permalink
chore: scaffold for ts node
Browse files Browse the repository at this point in the history
  • Loading branch information
pronitdas committed Feb 2, 2021
0 parents commit 196d002
Show file tree
Hide file tree
Showing 22 changed files with 20,244 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .all-contributersrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "pronitdas",
"name": "Pronit Das",
"avatar_url": "https://avatars3.githubusercontent.com/u/15370426?v=4",
"profile": "https://github.com/pronitdas",
"contributions": [
"infra",
"test",
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "ci-cd-nodejs-lambda",
"projectOwner": "pronitdas",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
es6: true,
node: true,
},
ignorePatterns: [".eslintrc.js", "webpack.config.js", "commitlint.config.ts"],
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:@typescript-eslint/eslint-recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript', // this line does the trick
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features es-2018
sourceType: 'module', // Allows for the use of imports
},
rules: {
'no-unused-vars': 'off',
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};
38 changes: 38 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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:
# Fetch and update latest `npm` packages for lib source
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- vinayakkulkarni
- ganesh-geospoc
assignees:
- vinayakkulkarni
- ganesh-geospoc
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'
open-pull-requests-limit: 10
reviewers:
- vinayakkulkarni
assignees:
- vinayakkulkarni
commit-message:
prefix: fix
prefix-development: chore
include: scope
50 changes: 50 additions & 0 deletions .github/deploy-workflows.yml/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci

on:
push:
branches:
- develop
- test
- stage
- main
pull_request:
branches:
- develop
- test
- stage
- main

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout latest code
uses: actions/checkout@v2

- name: Setup node environment
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm i

- name: Check for any linting errors
run: npm run lint

- name: Run tests
run: npm run test
42 changes: 42 additions & 0 deletions .github/deploy-workflows.yml/deploy-layer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is a basic workflow to help you get started with Actions

name: Deploy APP

on:
push:
branches: [ stopped ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v1.4.2
with:
node-version: 12.x

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Get env stuff
run: |
cd $GITHUB_WORKSPACE
aws s3 cp s3://${{ secrets.SECRETS_BUCKET }}/${GITHUB_REF##*/}/${GITHUB_REF##*/}.json .
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Dependency
run: npm install serverless

- name: Geronimo
run: npx sls deploy --stage ${GITHUB_REF##*/} >> slsoutput.txt
42 changes: 42 additions & 0 deletions .github/deploy-workflows.yml/shipjs-manual-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Ship js Manual Prepare
on:
pull_request:
types: [closed]
branches:
- stage
jobs:
manual_prepare:
if: |
github.event.pull_request.merged == true && github.base_ref == 'stage' && github.head_ref =='test'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/setup-node@v1
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ matrix.node }}

- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: stage

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: install
run: npm ci

- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: npm run release -- --yes --no-browse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
42 changes: 42 additions & 0 deletions .github/deploy-workflows.yml/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Ship js trigger
on:
pull_request:
types:
- closed
jobs:
build:
name: Release
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- uses: actions/setup-node@v1
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ matrix.node }}

- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: stage

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
5 changes: 5 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Always validate the PR title AND all the commits
titleAndCommits: false
# Allows use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowMergeCommits: true
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
Loading

0 comments on commit 196d002

Please sign in to comment.