-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 663b607
Showing
14 changed files
with
6,890 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# 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 | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://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/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# Generated | ||
dist/ | ||
|
||
# rollup cache | ||
.rpt2_cache | ||
|
||
# Jetbrains | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
sudo: required | ||
|
||
language: node_js | ||
|
||
node_js: | ||
- '10' | ||
|
||
cache: | ||
directories: | ||
- ~/.npm | ||
|
||
notifications: | ||
email: true | ||
|
||
before_install: | ||
- npm install -g yarn@latest | ||
|
||
install: | ||
- yarn install | ||
|
||
script: | ||
- yarn lint | ||
- yarn test --coverage | ||
- yarn build | ||
- yarn coveralls | ||
|
||
after_success: | ||
- yarn travis-deploy-once "yarn semantic-release" | ||
|
||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# typescript-lib-boilerplate | ||
|
||
A boilerplate to create typescript libaries with | ||
* rollup | ||
* jest | ||
* travis | ||
* coveralls | ||
* semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"globals": { | ||
"ts-jest": { | ||
"useBabelrc": true, | ||
"tsConfigFile": "./tsconfig.spec.json" | ||
} | ||
}, | ||
"testURL": "http://localhost/", | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest", | ||
"^.+\\.jsx?$": "<rootDir>/node_modules/babel-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
], | ||
"moduleNameMapper": { | ||
"^~(.*)$": "<rootDir>/src/$1", | ||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js", | ||
"\\.(svg)$": "<rootDir>/__mocks__/svgMock.js", | ||
"\\.(css)$": "<rootDir>/__mocks__/styleMock.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "typescript-lib-boilerplate", | ||
"version": "0.0.0-development", | ||
"main": "dist/index.js", | ||
"repository": "git@github.com:TobiasWalle/typescript-lib-boilerplate.git", | ||
"author": "Tobias Walle", | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
"prepublish": "run-s validate build", | ||
"validate": "run-s check-types lint test", | ||
"check-types": "tsc --noEmit", | ||
"test": "jest --config jest.config.json", | ||
"lint": "tslint -p tsconfig.json", | ||
"build": "run-s build:clear build:bundle", | ||
"build:clear": "rimraf ./dist", | ||
"build:bundle": "rimraf ./dist", | ||
"coveralls": "cat coverage/lcov.info | node node_modules/.bin/coveralls", | ||
"setup-semantic-release": "semantic-release-cli setup", | ||
"travis-deploy-once": "travis-deploy-once", | ||
"semantic-release": "semantic-release" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^23.3.1", | ||
"@types/node": "^10.9.1", | ||
"coveralls": "^3.0.2", | ||
"jest": "^23.5.0", | ||
"npm-run-all": "^4.1.3", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-typescript": "^0.8.1", | ||
"rollup-plugin-typescript2": "^0.16.1", | ||
"semantic-release": "^15.9.9", | ||
"semantic-release-cli": "^4.0.7", | ||
"ts-jest": "^23.1.4", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.0.1", | ||
"travis-deploy-once": "^5.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import typescript from 'rollup-plugin-typescript2'; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: { | ||
format: 'cjs', | ||
file: 'dist/index.js', | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescript() | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { sayHello } from './hello-world'; | ||
|
||
describe('sayHello', () => { | ||
it('should say hello', () => { | ||
console.info = jest.fn(); | ||
|
||
sayHello('User'); | ||
|
||
expect(console.info).toHaveBeenCalledWith('Hello User'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function sayHello(name: string): void { | ||
console.info(`Hello ${name}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './hello-world'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"pretty": true, | ||
"target": "es6", | ||
"module": "esnext", | ||
"lib": [ | ||
"esnext", | ||
"DOM" | ||
], | ||
"jsx": "react", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"composite": false, | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"moduleResolution": "node", | ||
"types": [ | ||
"node", | ||
"jest" | ||
], | ||
"outDir": "./dist", | ||
"esModuleInterop": true | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs" | ||
}, | ||
"include": [ | ||
"./src/**/*.spec.ts", | ||
"./src/**/*.spec.tsx" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"defaultSeverity": "error", | ||
"extends": [ | ||
"tslint:recommended" | ||
], | ||
"jsRules": {}, | ||
"rules": { | ||
"quotemark": [true, "single", "jsx-double"], | ||
"interface-name": false, | ||
"no-empty-interface": false, | ||
"arrow-parens": false, | ||
"variable-name": false, | ||
"no-empty": false, | ||
"object-literal-sort-keys": false, | ||
"trailing-comma": false, | ||
"no-console": [true, "log"], | ||
"max-line-length": [false], | ||
"no-unused-expression": [true, "allow-tagged-template"], | ||
"no-namespace": false | ||
}, | ||
"rulesDirectory": [] | ||
} |
Oops, something went wrong.