Skip to content

Commit fb21430

Browse files
committed
[RFR] Bootstrap
- bootstrap project with babel, eslint, prettier & jest - includes files for POC from graphql demo - includes example data
1 parent a17e2e7 commit fb21430

10 files changed

+40179
-0
lines changed

.babelrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"stage-0"
5+
],
6+
"plugins": [
7+
[
8+
"transform-runtime",
9+
{
10+
"polyfill": false,
11+
"regenerator": true
12+
}
13+
]
14+
],
15+
"env": {
16+
"test": {
17+
"plugins": [
18+
["istanbul", { "exclude": "**/*.spec.js" }]
19+
]
20+
}
21+
}
22+
}

.eslintrc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parser": "babel-eslint",
3+
"env": {
4+
"es6": true,
5+
"mocha": true,
6+
"node": true,
7+
"jest/globals": true
8+
},
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:import/errors",
12+
"plugin:import/warnings",
13+
"prettier"
14+
],
15+
"plugins": [
16+
"prettier",
17+
"jest"
18+
],
19+
"rules": {
20+
"prettier/prettier": ["error", {
21+
"singleQuote": true,
22+
"tabWidth": 4,
23+
"trailingComma": "all"
24+
}],
25+
"import/no-extraneous-dependencies": "off",
26+
"no-console": ["error", { "allow": ["warn", "error"] }],
27+
"no-unused-vars": ["error", { "ignoreRestSiblings": true }]
28+
}
29+
}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
lib
2+
node_modules
3+
.nvmrc
4+
.nyc_output
5+
.coverage-cache
6+
coverage
7+
yarn-error.log

.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src
2+
.babelrc
3+
.eslintrc
4+
Makefile

Makefile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: build help
2+
3+
help:
4+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5+
6+
install: package.json ## Install dependencies
7+
@yarn
8+
9+
clean: ## Clean up the lib folder for building
10+
@rm -rf lib
11+
12+
build: clean ## Compile ES6 files to JS
13+
@NODE_ENV=production ./node_modules/.bin/babel \
14+
--out-dir=lib \
15+
--ignore=*.test.js \
16+
./src
17+
18+
watch: ## continuously compile ES6 files to JS
19+
@NODE_ENV=production ./node_modules/.bin/babel \
20+
--out-dir=lib \
21+
--ignore='*.test.js' \
22+
--watch \
23+
./src
24+
25+
test: ## Launch unit tests
26+
@./node_modules/.bin/jest"
27+
28+
watch-test: ## Launch unit tests and watch for changes
29+
@./node_modules/.bin/jest --watch"
30+
31+
format: ## Format the source code
32+
@./node_modules/.bin/eslint --fix ./src

0 commit comments

Comments
 (0)