Skip to content

Commit

Permalink
Project starter
Browse files Browse the repository at this point in the history
  • Loading branch information
rodgeraraujo committed Oct 8, 2020
0 parents commit d01b9ef
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = truew
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on: [push, pull_request]

jobs:
build-node:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
env:
CI: true
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DS_Store
.Trash-*

node_modules/
dist/

logs
*.log
npm-debug.log*

*.lock

.idea
/coverage
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.json"
}
},
moduleFileExtensions: [
"ts",
"js"
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest"
},
testMatch: [
"**/test/**/*.test.(ts|js)"
],
testEnvironment: "node"
};
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "profanity",
"version": "0.1.0",
"description": "",
"main": "index.js",
"keywords": [],
"author": "Rogério Araújo (rodgeraraujo)",
"license": "MIT",
"scripts": {
"prestart": "npm run compile",
"pretest": "npm run compile",
"lint": "tslint --config tslint.json --project .",
"compile": "rimraf ./dist && tsc",
"server": "node dist/index.js",
"start": "npm run serve",
"test": "jest --verbose",
"test-coverage": "jest --forceExit --coverage --verbose",
"watch": "concurrently \"npm run watch-ts\" \"npm run watch-node\" \"watch-test\"",
"watch-node": "nodemon dist/index.js",
"watch-test": "npm run test --watchAll",
"watch-ts": "tsc -w"
},
"devDependencies": {
"@types/jest": "^26.0.14",
"@types/node": "^14.11.5",
"concurrently": "^5.3.0",
"jest": "^26.5.2",
"nodemon": "^2.0.4",
"rimraf": "^3.0.2",
"ts-jest": "^26.4.1",
"tslint": "^6.1.3",
"typescript": "^4.0.3"
},
"dependencies": {
"winston": "^3.3.3"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
}
}
18 changes: 18 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"rootDir": ".",
"outDir": "dist",
"module": "commonjs",
"resolveJsonModule": true,
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"strict": true,
},
"lib": ["es2015"],
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
23 changes: 23 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"defaultSeverity": "error",
"extends": [
"eslint:recommended"
],
"jsRules": {},
"plugins": [
"node"
],
"rules": {
"typedef": false,
"no-console": false,
"eofline": false,
"quotemark": [
true,
"single"
],
"block-scoped-var": "error",
"no-var": "error",
"prefer-const": "error"
},
"rulesDirectory": []
}

0 comments on commit d01b9ef

Please sign in to comment.