Skip to content

Commit

Permalink
setup tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpogi5 committed May 12, 2020
1 parent ba4d2f0 commit a6189d5
Show file tree
Hide file tree
Showing 15 changed files with 8,556 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime"]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true
# General settings for whole project
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
# Format specific overrides
[*.md]
max_line_length = 0
trim_trailing_whitespace = false
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parser": "babel-eslint",
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
},
"env": {
"commonjs": true,
"node": true,
"jest": true
},
"ignorePatterns": ["node_modules/", "coverage/", "lib/", "bin/"]
}
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
24 changes: 24 additions & 0 deletions .github/workflows/on-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run coverage
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
coverage/
lib/
.serverless
.webpack
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Nodejs Boilerplate
# Create NodeJs

Boilerplate for NodeJs projects
5 changes: 2 additions & 3 deletions bin/kdc-create-nodejs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node

var start = require("../index");

start();
var run = require('../lib');
run();
3 changes: 0 additions & 3 deletions index.js

This file was deleted.

31 changes: 31 additions & 0 deletions index.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

mkdir package-name
cd package-name
npm init -y

echo "# package-name" >> README.md
git init
git add package.json
git add README.md
git commit -m "first commit"

copy .gitignore
copy .editorconfig

npm i -D @babel/core @babel/cli @babel/preset-env

copy .babelrc

npm i -D eslint prettier babel-eslint eslint-plugin-import eslint-plugin-prettier eslint-config-airbnb-base eslint-config-prettier

copy .eslintrc
copy .prettierrc

npm i -D husky lint-staged pretty-quick

npm i -D jest babel-jest @babel/plugin-transform-runtime


# add package.json husky

Loading

0 comments on commit a6189d5

Please sign in to comment.