Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tooling #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
86 changes: 86 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
version: 2

jobs:
install:
working_directory: ~/reduck
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- attach_workspace:
at: ~/reduck
- run:
name: NPM Install
command: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/reduck
paths: ./node_modules
build:
working_directory: ~/reduck
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- attach_workspace:
at: ~/reduck
- run:
name: Build
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
NODE_ENV=production \
npm run build
else
NODE_ENV=development \
npm run build
fi
- persist_to_workspace:
root: ~/reduck
paths:
- ./dist
- ./es
lint:
working_directory: ~/reduck
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- attach_workspace:
at: ~/reduck
- run:
name: Lint
command: npm run lint
test:
working_directory: ~/reduck
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- attach_workspace:
at: ~/reduck
- run:
name: Lint
command: npm run test

workflows:
version: 2
install_build_lint_test:
jobs:
- install
- build:
requires:
- install
- lint:
requires:
- install
- test:
requires:
- install
14 changes: 3 additions & 11 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
---
env:
jest/globals: true
plugins:
- flowtype
- jest
extends:
- standard
- plugin:import/warnings
- plugin:import/errors
- "@enkidevs/eslint-config-backend"
- plugin:flowtype/recommended
parser: babel-eslint
rules:
jest/no-disabled-tests: 1
jest/no-focused-test: 0
jest/no-identical-title: 2
jest/valid-expect: 2
node/no-unsupported-features/es-syntax: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fix this one by adding to package.json:

  "engines": {
    "node": "8.10.0"
  },

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it but eslint seemed to ignore it, so i left the rule

Copy link
Author

@mihaiberq mihaiberq Nov 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo this should be ok, since they the rule is included in the engines field anyway

no-unused-vars: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using on, off, and warn instead of the numbers cause it's more readable

no-new: 0
globals:
localStorage: true
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ build

# npm
node_modules
package-lock.json

# Logs
logs
Expand All @@ -18,5 +17,3 @@ npm-debug.log*

# Optional Env variables
.env

.vscode/
2 changes: 2 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
singleQuote: true
trailingComma: es5
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Makefile

This file was deleted.

36 changes: 0 additions & 36 deletions _tests_/reduck-tests/test-variables.js

This file was deleted.

102 changes: 0 additions & 102 deletions _tests_/redux-tests/ducks/comments.js

This file was deleted.

6 changes: 0 additions & 6 deletions _tests_/redux-tests/redux/actions.js

This file was deleted.

5 changes: 0 additions & 5 deletions _tests_/redux-tests/redux/reducers.js

This file was deleted.

18 changes: 0 additions & 18 deletions _tests_/redux-tests/redux/store.js

This file was deleted.

4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
testRegex: 'src/__tests__/.*\\.test.js$',
collectCoverageFrom: ['src/**/*.js'],
};
Loading