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

Big update to boilerplate to some newer tech #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .babelrc

This file was deleted.

18 changes: 0 additions & 18 deletions .codeclimate.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions .eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## copy to .npmignore
.DS_Store
.idea
.vscode
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand All @@ -10,7 +9,6 @@ node_modules/
.eslintcache
/coverage/
/.nyc_output/
/tmp/
/decl/

## only ignore in git
Expand Down
6 changes: 6 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "yarn check-types && yarn lint-staged",
"pre-push": "yarn validate"
}
}
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ node_modules/
.eslintcache
/coverage/
/.nyc_output/
/tmp/
/decl/

# .npmignore
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
12
28 changes: 0 additions & 28 deletions .nycrc

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# for potential vendor files in src
lib/**/*
src/lib/vendor/**/*
/decl/**/*
/docs/**/*
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@ cache: yarn

node_js:
- 'stable'
- '8'
- '10'
- '12'

sudo: false

before_install:
- yarn global add codeclimate-test-reporter

script:
- yarn test

after_script:
- codeclimate-test-reporter < coverage/lcov.info
- node_modules/.bin/coveralls < coverage/lcov.info

deploy:
- provider: npm
email: 'devmonk@mediamonks.com'
Expand All @@ -27,8 +20,3 @@ deploy:
tags: true
node: 'stable'
skip_cleanup: true

addons:
code_climate:
repo_token:
secure: 'jMib2LNFGzfKiINRK0fOwibNgHnizTh87Fb1YK0Q2UpWtF7WiigEBhNyiX3pF02HH3iRuICHKYzE1QrZbIzk88XVTUhilO7vI+h1VpgbcuOxq7nkE+kSfxAiTpkD6eY7c0s8wSViKTPOVPPrpRfp8RYYLx6Vcox9jlN7StOHAgDuiwGwHPZ6lz2KGzX1xx8Z8ZLnHIIihv7rqQgetu7BNoPcrPv2Dz63qZI3DbFPWVJIe05B6I7iuiPgzlRZzIvUWofpp6zM5jT9ktrGyF786sh15mDzixoDzUDKmw6ptbc7MeoEuT2Co7FYr4LibXClSaoXcfKJ37/6E5Xzya1e7Sz/83+H1Xi34LCUcVHySzmCWSMWa1fGnZMCHJUdhCVmY5EJMQSGJEvPwHt+1beRYsWAm0cP2RsZ3LhIj9uB6jVXUz1pmhlkL2AFiuBZ2D3vKw4DTtnKqBounsI/FFm0Z0bhsOfkUs7HzAtdnPGjkzlHYW//YvncmTaO0fnMswJVLTKlMq9J/VnqLF1bH2CVYO9zBXIvf786SwgNrWAW/nmyOHE0kOzo79OVfm147qTPmF93ajwLWA814HUK8xpPZ5nMLgFaPpqlNO8co/5gpGm3cRrxRQ2yeOMCealz/EVJYS9LUmYugR42Ayg6iHLRoqwCKdtsjhMFZNEAOwsMs80='
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Add a description here...

[![Travis](https://img.shields.io/travis/mediamonks/seng-boilerplate.svg?maxAge=2592000)](https://travis-ci.org/mediamonks/seng-boilerplate)
[![Code Climate](https://img.shields.io/codeclimate/github/mediamonks/seng-boilerplate.svg?maxAge=2592000)](https://codeclimate.com/github/mediamonks/seng-boilerplate)
[![Coveralls](https://img.shields.io/coveralls/mediamonks/seng-boilerplate.svg?maxAge=2592000)](https://coveralls.io/github/mediamonks/seng-boilerplate?branch=master)
[![npm](https://img.shields.io/npm/v/seng-boilerplate.svg?maxAge=2592000)](https://www.npmjs.com/package/seng-boilerplate)
[![npm](https://img.shields.io/npm/dm/seng-boilerplate.svg?maxAge=2592000)](https://www.npmjs.com/package/seng-boilerplate)

Expand Down Expand Up @@ -152,24 +150,15 @@ of multiple sections.

1. Defines the `node_js` [language](https://docs.travis-ci.com/user/languages/javascript-with-nodejs),
and tells travis on which node versions to run the process.
2. Before running, it needs to install some global dependencies, and
when it processes some coverage results.
3. It can do a [npm deploy](https://docs.travis-ci.com/user/deployment/npm),
2. It can do a [npm deploy](https://docs.travis-ci.com/user/deployment/npm),
telling it to keep the generated artifacts and only publish when run
on node 8 and when a tag was committed. It also contains the email
on node stable and when a tag was committed. It also contains the email
address and api key of the npm user.
4. Code Climate has a [travis plugin](https://docs.travis-ci.com/user/code-climate/)
that automatically uploads the code coverage results.

Because we want to keep the npm api key secret, we add the token to the Travis Repo settings
where it will be stored secure:
https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
Because we want to keep the npm api key secret, we reference an environment variable that can be
entered in the travis settings.

Before we can do this, we must make sure that the repository is added
to Travis, because Travis needs the repository owner/name info to make
sure the encrypted values only work for that repository.

1. Then make sure you are logged in to your npm account with the
1. Make sure you are logged in to your npm account with the
[adduser](https://docs.npmjs.com/cli/adduser) command:

```sh
Expand Down
17 changes: 17 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
presets: [
[
'@babel/env',
{
targets: {
browsers: ['last 2 versions'],
node: '10',
},
loose: true,
useBuiltIns: false,
},
],
'@babel/typescript',
],
plugins: ['@babel/proposal-class-properties'],
};
42 changes: 42 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePaths: ['<rootDir>'],
transformIgnorePatterns: [
'this-is-just-here-to-not-match-anything-and-make-sure-the-node-modules-are-not-ignored-in-the-transforms',
],
transform: {
'\\.ts$': 'ts-jest',
'\\.js$': 'babel-jest', // if you have jsx tests too
},
globals: {
'ts-jest': {
// tsConfig: '<rootDir>/test-utils/tsconfig.jest.json',
babelConfig: true,
isolatedModules: true,
},
},
collectCoverageFrom: ['src/**/*.{js,ts}', '!test/**/*.spec.{js,ts}', '!src/lib/vendor/**/*.*'],
coverageDirectory: './coverage',
coverageReporters: ['lcov', 'text-summary'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
'src/index.ts': {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
'src/lib/Dummy.ts': {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
};
4 changes: 4 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'src/**/*.{js,ts,json}': ['yarn prettify', 'git add'],
'src/**/*.ts': ['yarn lint:ts'],
};
Loading