Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1e63d6f
Added docker commands to Makefile
bentonam Jan 17, 2018
a2696cd
Added support for flow
bentonam Jan 17, 2018
1e436d4
Added debug as a peerDependency
bentonam Jan 17, 2018
db78eb6
Merge branch 'release/v2.0.0' of https://github.com/bentonam/fakeit i…
bentonam Jan 17, 2018
369a1ff
Updated config
bentonam Jan 18, 2018
5763e1f
Input Structure
bentonam Jan 18, 2018
1cd8c4b
Added flow-typed and libdefs
bentonam Jan 18, 2018
098f327
Moved docker-compose.yaml to plugin directory
bentonam Jan 18, 2018
4fdc6ae
Added flow-typed libdefs for input and file-loader
bentonam Jan 18, 2018
20d7e07
Added Input / FileLoader structure
bentonam Jan 18, 2018
77e6175
Updated sample loading in fakeit/core
bentonam Jan 18, 2018
80fcbf7
Removed property that shouldn’t be there
bentonam Jan 18, 2018
aee7db5
added the base setup for fakeit models
tjbenton Jan 24, 2018
d1c46cb
Removed flow-typed libdefs
bentonam Jan 25, 2018
8738a10
Added flow-typed npm libdefs to .gitignore
bentonam Jan 25, 2018
e534b74
Simplified `make deep-clean`
bentonam Jan 25, 2018
35f9584
trailingComma for all
bentonam Jan 25, 2018
4010444
Refactored input
bentonam Jan 25, 2018
8678203
Merge branch 'feature/fakeit-core-setup' of https://github.com/benton…
tjbenton Jan 25, 2018
8d2c380
Merge branch 'release/v2.0.0' of https://github.com/bentonam/fakeit i…
tjbenton Jan 25, 2018
ae39b3b
removed @fakeit/input
tjbenton Jan 25, 2018
187980a
fixed a couple issues with gulp
tjbenton Jan 26, 2018
434f61b
Merge branch 'hotfix/gulp' of https://github.com/bentonam/fakeit into…
tjbenton Jan 26, 2018
22363f0
changed max lines to be larger for test files
tjbenton Jan 26, 2018
49cee7d
added ava config
tjbenton Jan 26, 2018
20e496a
added validation and tests
tjbenton Jan 26, 2018
eab07f5
Merge branch 'dev' of https://github.com/bentonam/fakeit into feature…
tjbenton Jan 26, 2018
5867787
removed the pointless examples
tjbenton Jan 27, 2018
f510f0d
fixed the base filter function
tjbenton Jan 27, 2018
fc4477c
update lint-rules
tjbenton Jan 31, 2018
3e39c01
initial api setup
tjbenton Jan 31, 2018
c87c877
updated plugins to work with the new api
tjbenton Feb 1, 2018
dc0c0a5
added a way to pass in options after config files are loaded
tjbenton Feb 5, 2018
eac735f
updated base config
tjbenton Feb 8, 2018
920cdb2
added tests
tjbenton Feb 8, 2018
0450dc5
updated plugins to work with the new api
tjbenton Feb 9, 2018
51d4261
added better errors
tjbenton Feb 12, 2018
22b738b
updated babel config
tjbenton Feb 13, 2018
53d0327
updated the base module
tjbenton Feb 13, 2018
0bf1be4
added in the missing `count` and `seed` seetings
tjbenton Feb 13, 2018
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
28 changes: 25 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
{
"presets": ["env", "flow"],
"presets": [
[
"env",
{
"targets": {
"node": "6"
}
}
],
"flow",
"stage-0"
],
"plugins": [
"external-helpers",
"transform-runtime"
]
"transform-runtime",
[
"transform-private",
{
"pattern": "^_"
}
]
],
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
92 changes: 70 additions & 22 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,39 @@
"parser": "babel-eslint",
"plugins": ["fat-arrow-same-line", "flowtype"],
"rules": {
"flowtype/boolean-style": [2, "boolean"],
"flowtype/define-flow-type": 1,
"flowtype/delimiter-dangle": [2, "never"],
"flowtype/generic-spacing": [2, "never"],
"flowtype/no-primitive-constructor-types": 2,
"flowtype/no-types-missing-file-annotation": 2,
"flowtype/boolean-style": ["error", "boolean"],
"flowtype/define-flow-type": "warn",
"flowtype/delimiter-dangle": ["error", "never"],
"flowtype/generic-spacing": ["error", "never"],
"flowtype/no-primitive-constructor-types": "error",
"flowtype/no-types-missing-file-annotation": "error",
"flowtype/no-weak-types": "off",
"flowtype/object-type-delimiter": [2, "comma"],
"flowtype/require-parameter-type": 2,
"flowtype/object-type-delimiter": ["error", "comma"],
"flowtype/require-parameter-type": [
"error",
{
"excludeParameterMatch":
"^(resolve|reject|e|err|error|array|i|index|next)$|^_"
}
],
"flowtype/require-return-type": [
2,
"error",
"always",
{ "annotateUndefined": "never" }
{
"excludeArrowFunctions": true,
"annotateUndefined": "always",
"excludeMatching": ["constructor"]
}
],
"flowtype/require-valid-file-annotation": 2,
"flowtype/semi": [2, "always"],
"flowtype/space-after-type-colon": [2, "always"],
"flowtype/space-before-generic-bracket": [2, "never"],
"flowtype/space-before-type-colon": [2, "never"],
"flowtype/type-id-match": [2, "^([A-Z][a-z0-9]+)+Type$"],
"flowtype/union-intersection-spacing": [2, "always"],
"flowtype/use-flow-type": 1,
"flowtype/valid-syntax": 1,
"flowtype/require-valid-file-annotation": "error",
"flowtype/semi": ["error", "always"],
"flowtype/space-after-type-colon": ["error", "always"],
"flowtype/space-before-generic-bracket": ["error", "never"],
"flowtype/space-before-type-colon": ["error", "never"],
"flowtype/type-id-match": ["error", "^([A-Z][a-z0-9]+)+Type$"],
"flowtype/union-intersection-spacing": ["error", "always"],
"flowtype/use-flow-type": "warn",
"flowtype/valid-syntax": "warn",
"curly": ["error", "multi-line"],
"no-case-declarations": "error",
"accessor-pairs": ["error", { "getWithoutSet": true }],
Expand Down Expand Up @@ -163,18 +173,56 @@
],
"no-undefined": "error",
"consistent-return": "off",
"import/extensions": "off"
"import/extensions": "off",
"no-underscore-dangle": "off"
},
"env": {
"node": true
},
"overrides": [
{
"files": ["packages/*/test/**/*.test.js"],
"files": [
"packages/*/test/**/*.test.js",
"packages/*/fakeitfile.js",
"packages/*/test/fixtures/**/*.js"
],
"rules": {
"import/no-extraneous-dependencies": "off",
"id-length": "off",
"no-shadow": "off"
"no-shadow": "off",
"flowtype/boolean-style": "off",
"flowtype/define-flow-type": "off",
"flowtype/delimiter-dangle": "off",
"flowtype/generic-spacing": "off",
"flowtype/no-primitive-constructor-types": "off",
"flowtype/no-types-missing-file-annotation": "off",
"flowtype/no-weak-types": "off",
"flowtype/object-type-delimiter": "off",
"flowtype/require-parameter-type": "off",
"flowtype/require-return-type": "off",
"flowtype/require-valid-file-annotation": "off",
"flowtype/semi": "off",
"flowtype/space-after-type-colon": "off",
"flowtype/space-before-generic-bracket": "off",
"flowtype/space-before-type-colon": "off",
"flowtype/type-id-match": "off",
"flowtype/union-intersection-spacing": "off",
"flowtype/use-flow-type": "off",
"flowtype/valid-syntax": "off",
"newline-per-chained-call": [
"error",
{
"ignoreChainWithDepth": 3
}
],
"max-lines": [
"error",
{
"max": 600,
"skipBlankLines": true,
"skipComments": true
}
]
}
}
]
Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PROJECT_ROOT>/flow-typed
.*/packages/.*/dist
.*/packages/.*/test
.*/packages/.*/fakeitfile.js

[include]
packages/*/src
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/*/test/**/snapshots/**/*.md
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ docs-build docs-compile:
# so build files with source maps
watch:
@make clean
@gulp watch
@NODE_ENV="test" gulp watch

# formats and lints all the files
lint:
@make lint-js lint-json lint-md --jobs

# formats your js code with prettier, then lints them with eslint
lint-js:
@prettier-eslint 'packages/*/+(src|app|test)/**/*.js' '*.js' --list-different --single-quote --trailing-comma all --write
@prettier-eslint 'packages/*/+(src|app|test)/**/*.js' '*.js' --list-different --single-quote --trailing-comma all --parser flow --write
@eslint --cache 'packages/*/+(src|app|test)/**/*.js' '*.js'

# formats your markdown files with prettier
Expand All @@ -65,7 +65,7 @@ lint-md:

# formats your json files with prettier
lint-json:
@prettier 'packages/*/+(src|app|test)/**/*.json' 'packages/*/*.json' '*.json' --parser json --write
@prettier 'packages/*/+(src|app|test)/**/*.json' 'packages/*/*.json' '*.json' '.babelrc' --parser json --write

# run unit tests
test:
Expand Down
3 changes: 3 additions & 0 deletions flow-typed/fakeit-input_vx.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '@fakeit/input' {
declare module.exports: any;
}
4 changes: 3 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ gulp.task('build', () => {

return gulp
.src(packages, { base })
.pipe($.sourcemaps.init())
.pipe($.plumber({
errorHandler (err) {
$.util.log(err.stack)
},
}))
.pipe($.changed('dist', {
.pipe($.changed(base, {
transformPath: swapSrcWithDist,
}))
.pipe(through.obj((file, enc, callback) => {
Expand All @@ -36,6 +37,7 @@ gulp.task('build', () => {
file.path = path.resolve(file.base, swapSrcWithDist(file.relative))
callback(null, file)
}))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest(base))
})

Expand Down
32 changes: 28 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-istanbul": "~4.1.5",
"babel-plugin-transform-private": "~0.1.3",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-stage-0": "~6.24.1",
"babel-register": "~6.26.0",
"chalk": "~2.3.0",
"eslint": "~4.15.0",
Expand All @@ -48,31 +51,52 @@
"eslint-plugin-import": "~2.8.0",
"flow-bin": "^0.63.1",
"flow-typed": "2.2.3",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-babel": "~7.0.0",
"gulp-changed": "~3.2.0",
"gulp-cli": "~2.0.0",
"gulp-load-plugins": "~1.5.0",
"gulp-plumber": "~1.2.0",
"gulp-sourcemaps": "~1.12.1",
"gulp-util": "~3.0.8",
"gulp-watch": "~5.0.0",
"husky": "~0.14.3",
"lerna": "^2.7.0",
"lint-staged": "~6.0.0",
"lodash": "~4.17.4",
"nyc": "~11.4.1",
"prettier": "^1.10.2",
"prettier-eslint-cli": "~4.7.0",
"through2": "~2.0.3"
},
"lint-staged": {
"*.js": ["prettier-eslint --write", "eslint --fix", "git add"],
"*.js": [
"prettier-eslint --write --parser flow",
"eslint --fix",
"git add"
],
"*.scss": [
"prettier --parser scss --single-quote --write",
"stylelint --fix",
"git add"
],
"*.md": ["prettier --parser markdown --single-quote --write", "git add"],
"*.json": ["prettier --parser json --write", "git add"]
"*.@(json|babelrc)": ["prettier --parser json --write", "git add"]
},
"dependencies": {},
"nyc": {
"require": ["babel-register"],
"exclude": ["packages/*/test/**/*", "packages/*/dist/**/*"],
"sourceMap": false,
"instrument": false
},
"dependencies": {
"gulp": "github:gulpjs/gulp#4.0"
"ava": {
"require": ["babel-register"],
"files": ["packages/*/test/**/*.test.js"],
"source": [
"packages/*/dist/**/*",
"packages/*/test/fixtures/**/*",
"packages/*/test/utils.js"
]
}
}
3 changes: 3 additions & 0 deletions packages/fakeit-core/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// this is exported here as well as index.js so that someone can import
// it through `import FakeitApi from '@fakeit/core/api'` or `import { Api } from '@fakeit/core'`
module.exports = require('./dist/api.js').default
4 changes: 4 additions & 0 deletions packages/fakeit-core/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// this is exported here as well as index.js so that someone can import
// it through `import FakeitError from '@fakeit/core/error'` or
// `import { FakeitError } from '@fakeit/core'`
module.exports = require('./dist/error.js').default
31 changes: 15 additions & 16 deletions packages/fakeit-core/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@fakeit/core",
"description": "FakeIt core",
"author": "Aaron Benton <bentonam@gmail.com> (https://github.com/bentonam)",
"contributors": [
"Aaron Benton <bentonam@gmail.com> (https://github.com/bentonam)",
"Tyler Benton <tjbenton21@gmail.com> (https://github.com/tjbenton)"
],
"version": "1.0.0",
Expand All @@ -19,24 +19,23 @@
"license": "MIT",
"homepage": "https://github.com/bentonam/fakeit#readme",
"dependencies": {
"@fakeit/file-loader": "^1.0.0",
"@fakeit/format-json": "^1.0.0",
"async-array-methods": "~2.1.0",
"callable-instance": "~1.0.0",
"callsite-record": "~4.1.1",
"chance": "^1.0.13",
"debug": "^3.1.0",
"faker": "^4.1.0",
"find-root": "~1.1.0",
"fs-extra-promisify": "0.0.2",
"globby": "~7.1.1",
"joi": "~13.1.1",
"lodash": "~4.17.4",
"relieve": "^2.2.1",
"@fakeit/file-loader": "^1.0.0"
"source-map-support": "~0.5.3"
},
"plugins": [
"@fakeit/format-csv",
"@fakeit/format-cson",
"@fakeit/format-js",
"@fakeit/format-json",
"@fakeit/format-yaml",
"@fakeit/plugin-console",
"@fakeit/plugin-couchbase",
"@fakeit/plugin-directory",
"@fakeit/plugin-file",
"@fakeit/plugin-http",
"@fakeit/plugin-sync-gateway",
"@fakeit/plugin-zip"
]
"devDependencies": {
"caporal": "~0.9.0"
}
}
Loading