Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3 from roalcantara/chore-bump-typescript
Browse files Browse the repository at this point in the history
Bump Typescript, and Jest and CI
  • Loading branch information
roalcantara authored Feb 3, 2020
2 parents 26189f0 + 08a7673 commit 437c525
Show file tree
Hide file tree
Showing 52 changed files with 9,206 additions and 3,518 deletions.
22 changes: 22 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
extends:
- '@commitlint/config-conventional'
rules:
header-max-length: [1, 'always', 72]
type-enum:
- 2
- always
- - feat
- fix
- docs
- style
- ref
- test
- revert
- chore
- ci
- build
- perf
- git
scope-case: [2, 'always', 'kebab-case']
subject-case: [2, 'always', 'sentence-case']
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build
run: yarn install
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TYPESCRIPT_CLI_RELEASE_TOKEN }}
run: npx semantic-release
22 changes: 22 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Validation
on:
pull_request:
branches:
- master
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build
run: yarn install
- name: Lint
run: yarn lint
- name: Test
run: yarn test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10.18.1
9 changes: 9 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
branch: master
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/npm'
- npmPublish: false
- '@semantic-release/changelog'
- '@semantic-release/git'
- '@semantic-release/github'
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Inspired by the excellent article ["How to build a command-line app in Node.js u

[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

## Dependencies

To run this project you need to have:
Expand Down
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
testMatch: ['<rootDir>/src/**/*.spec.ts'],
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js', 'html', 'json'],
transform: {
'^.+\\.html?$': 'html-loader-jest'
},
moduleFileExtensions: ['ts', 'js', 'json'],
coverageReporters: ['text'],
moduleDirectories: ['<rootDir>/node_modules', '<rootDir>/src/tests']
}
103 changes: 65 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@
"name": "typescript-cli-boilerplate",
"version": "0.1.0",
"description": "A Typescript CLI Boilerplate",
"main": "src/index.ts",
"engines": {
"node": "10",
"yarn": ">=1.9.0 <2.0.0"
},
"main": "ts-node src/main.ts",
"scripts": {
"build": "tsc",
"tsc": "tsc",
"lint": "tslint --project tsconfig.json src/**/*.ts",
"test": "./node_modules/.bin/ts-mocha -p . src/**/**.spec.ts",
"pokedex": "ts-node src/commands/pokedex.cmd.ts",
"imdb": "ts-node src/commands/imdb.cmd.ts"
"setup": "yarn global add typescript && prettier && npx && jest && @commitlint/cli && husky",
"clear": "rm -r ./dist && rm -r .tmp || true",
"purge": "yarn clear && rm -rf node_modules",
"reset": "yarn purge && yarn",
"build": "npx tsc --p tsconfig.json",
"tsc": "npx tsc",
"lint": "npx tslint --project tsconfig.json src/**/*.ts",
"test": "npx jest",
"start": "ts-node src/lib/main.ts",
"commit": "commit",
"semantic-release": "semantic-release",
"semantic-release:dry-run": "export $(cat .env | xargs) && npx semantic-release --dry-run --no-ci --debug"
},
"keywords": [
"typescript",
Expand All @@ -20,41 +30,58 @@
"url": "https://github.com/roalcantara/typescript-cli-boilerplate/issues",
"email": "rogerio.alcantara@gmail.com",
"license": "MIT",
"private": true,
"devDependencies": {
"@types/chai": "^4.1.2",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.1",
"@semantic-release/npm": "^7.0.2",
"@semantic-release/release-notes-generator": "^9.0.0",
"@types/chalk": "^2.2.0",
"@types/cheerio": "^0.22.7",
"@types/commander": "^2.12.2",
"@types/faker": "^4.1.2",
"@types/inquirer": "^0.0.38",
"@types/mocha": "^5.0.0",
"@types/node": "^9.6.0",
"@types/ora": "^1.3.3",
"@types/puppeteer": "^1.2.0",
"@types/sinon": "^4.3.0",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"factory-girl": "^5.0.2",
"@types/cheerio": "^0.22.16",
"@types/faker": "^4.1.9",
"@types/inquirer": "^6.5.0",
"@types/jest": "^25.1.1",
"@types/lodash": "^4.14.149",
"@types/node": "^13.7.0",
"@types/ora": "^3.2.0",
"factory-bot-ts": "^0.1.5",
"faker": "^4.1.0",
"mocha": "^5.0.5",
"rxjs-tslint-rules": "^3.15.0",
"sinon": "^4.4.8",
"sinon-chai": "^3.0.0",
"ts-mocha": "^1.1.0",
"ts-node": "^5.0.1",
"tslint": "^5.9.1",
"tslint-clean-code": "^0.2.5",
"tslint-eslint-rules": "^5.1.0",
"typescript": "^2.7.2"
"html-loader-jest": "^0.2.1",
"husky": "^4.2.1",
"jest": "^25.1.0",
"prettier": "^1.19.1",
"pretty-quick": "^2.0.1",
"semantic-release": "^17.0.2",
"ts-jest": "^25.1.0",
"ts-node": "^8.6.2",
"tslint": "^6.0.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.5"
},
"dependencies": {
"chalk": "^2.3.2",
"cheerio": "^1.0.0-rc.2",
"commander": "^2.15.1",
"inquirer": "^5.1.0",
"ora": "^2.0.0",
"pokedex-promise-v2": "^3.1.1",
"puppeteer": "^1.2.0",
"rxjs": "^5.5.7"
"chalk": "^3.0.0",
"cheerio": "^1.0.0-rc.3",
"inquirer": "^7.0.4",
"lodash": "^4.17.15",
"ora": "^4.0.3",
"pokedex-promise-v2": "^3.2.0",
"puppeteer": "^2.1.0",
"rxjs": "^6.5.4",
"yargs": "^15.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/roalcantara/typescript-cli-boilerplate.git"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "npx pretty-quick --staged",
"postcommit": "git update-index -g"
}
}
}
67 changes: 0 additions & 67 deletions src/commands/imdb.cmd.ts

This file was deleted.

44 changes: 0 additions & 44 deletions src/commands/pokedex.cmd.ts

This file was deleted.

Empty file removed src/index.ts
Empty file.
Loading

0 comments on commit 437c525

Please sign in to comment.