diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..0ba15a7 --- /dev/null +++ b/.babelrc @@ -0,0 +1,24 @@ +{ + "presets": ["es2015", "stage-0"], + "plugins": [ + "add-module-exports", + "transform-runtime" + ], + "env": { + "development": { + "plugins": [ + "syntax-flow", + "tcomb", + "transform-flow-strip-types" + ] + }, + "production": { + "plugins": [ + "babel-plugin-transform-remove-console", + "babel-plugin-transform-remove-debugger", + "babel-plugin-dev-expression", + "syntax-flow", + "transform-flow-strip-types" + ] + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..881f934 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yml] +indent_style = space +indent_size = 2 + +[*.{json,js,jsx,html,css}] +indent_style = space +indent_size = 2 + +[.eslintrc] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..b8da0c5 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,84 @@ +{ + "parser": "babel-eslint", + "extends": "airbnb", + "env": { + "browser": true, + "node": true, + "es6": true + }, + "rules": { + "arrow-parens": 0, + "class-methods-use-this": 0, # HACK: Classes will be replaced by pure fn's + "comma-dangle": ["error", "never"], + "consistent-return": 2, + "func-names": 2, + # "fp/no-class": "error", # TODO: In progress + "fp/no-delete": "error", + "fp/no-events": "error", + "fp/no-let": "error", + "fp/no-loops": "error", + "fp/no-mutating-assign": "error", + "flowtype-errors/show-errors": 2, + # "fp/no-mutation": "error", # TODO: In progress + # "fp/no-nil": "error", # TODO: In progress + # "fp/no-proxy": "error", # TODO: In progress + # "fp/no-this": "error", # TODO: In progress + # "fp/no-throw": "error", # TODO: In progress + # "fp/no-unused-expression": "error", # TODO: In progress + "generator-star-spacing": [0], # HACK: https://github.com/airbnb/javascript/issues/948 + "import/no-extraneous-dependencies": ["off"], + "import/no-unresolved": [2, { "ignore": ["electron"] }], + "jsx-filename-extension": 0, + "jsx-a11y/no-static-element-interactions": 0, + "new-cap": 0, + "no-implicit-coercion": "error", + "no-mixed-operators": 0, + "no-use-before-define": 0, + "no-nested-ternary": 0, + "no-underscore-dangle": 0, + "no-console": 0, + "no-var": "error", + "promise/param-names": 2, + "promise/always-return": 2, + "promise/catch-or-return": 2, + "promise/no-native": 0, + "flowtype/define-flow-type": 2, + # "flowtype/require-parameter-type": 2, + # "flowtype/require-return-type": [ # TODO: In progress + # 2, + # "always", + # { + # "annotateUndefined": "never" + # } + # ], + "flowtype/space-after-type-colon": [ + 2, + "always" + ], + "flowtype/space-before-type-colon": [ + 2, + "never" + ], + "flowtype/type-id-match": [ + 2, + "^([A-Z][a-z0-9]+)+Type$" + ], + "flowtype/use-flow-type": 2, + "flowtype/valid-syntax": 2 + }, + "plugins": [ + "import", + "fp", + "promise", + "flowtype", + "flowtype-errors" + ], + "settings": { + "webpack": { + "config": "webpack.config.eslint.js" + }, + "flowtype": { + "onlyFilesWithFlowAnnotation": false + } + } +} diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 0000000..6f42b2d --- /dev/null +++ b/.flowconfig @@ -0,0 +1,15 @@ +[ignore] +.*/node_modules/fbjs/.* +.*/node_modules/* +.*/git/.* + +[include] +./app/*.js +./node_modules/ + +[libs] + +[options] +esproposal.class_static_fields=enable +esproposal.class_instance_fields=enable +esproposal.export_star_as=enable diff --git a/.gitignore b/.gitignore index 24d8c7d..b50bf09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,55 @@ -node_modules +# Logs +logs *.log +npm-debug.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 + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# nyc test coverage +.nyc_output + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules +app/node_modules + +# OSX .DS_Store -npm-debug.log \ No newline at end of file + +# Packaged and compiled files +dist +app/dist +app/main.js +app/main.js.map +release + +# Env configuration +.env + +# Editor +.idea diff --git a/package.json b/package.json index c773d2b..f4ab8e0 100644 --- a/package.json +++ b/package.json @@ -1,60 +1,89 @@ { - "name": "paralleljs", - "version": "0.2.1", - "author": "Adam Savitzky ", - "contributors": [ - "Sebastian Mayr (http://s3bmaster.blogspot.co.at/)" - ], - "description": "parallel.js enables easy multi-thread processing in javascript", - "main": "lib/parallel.js", - "repository": { - "type": "git", - "url": "https://github.com/adambom/parallel.js.git" - }, - "directories": { - "lib": "lib", - "test": "test" - }, - "keywords": [ - "parallel", - "spawn", - "map", - "thread", - "parallel.js", - "workers", - "webworkers" - ], - "devDependencies": { - "jasmine-node": "x", - "q": "x" - }, - "license": "BSD", - "scripts": { - "test": "jasmine-node --verbose test/specs" - }, - "browser": { - "child_process": false - }, - "engines": { - "node": ">=0.9.10" - }, - "testling" : { - "scripts": [ - "lib/parallel.js", - "test/jasmine/jasmine.js", - "test/jasmine/jasmine.tap_reporter.js", - "test/specs/*.js", - "test/runner.js" - ], - "browsers": [ - "ie/9..latest", - "chrome/22..latest", - "firefox/16..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", - "ipad/6", - "android-browser/latest" - ] - } + "name": "paralleljs", + "version": "0.2.1", + "author": "Adam Savitzky ", + "contributors": [ + "Sebastian Mayr (http://s3bmaster.blogspot.co.at/)", + "Amila Welihinda (http://amilawelihinda.com/)" + ], + "description": "parallel.js enables easy multi-thread processing in javascript", + "license": "BSD", + "scripts": { + "lint": "eslint test lib *.js", + "test": "npm run lint && jasmine-node --verbose test/specs" + }, + "main": "lib/parallel.js", + "repository": { + "type": "git", + "url": "https://github.com/adambom/parallel.js.git" + }, + "directories": { + "lib": "lib", + "test": "test" + }, + "keywords": [ + "parallel", + "spawn", + "map", + "thread", + "parallel.js", + "workers", + "webworkers" + ], + "devDependencies": { + "babel-eslint": "^6.1.2", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-dev-expression": "^0.2.1", + "babel-plugin-module-alias": "^1.6.0", + "babel-plugin-syntax-flow": "^6.13.0", + "babel-plugin-tcomb": "^0.3.14", + "babel-plugin-transform-flow-strip-types": "^6.14.0", + "babel-plugin-transform-remove-console": "^6.8.0", + "babel-plugin-transform-remove-debugger": "^6.8.0", + "babel-plugin-transform-runtime": "^6.15.0", + "babel-polyfill": "^6.13.0", + "babel-preset-stage-0": "^6.5.0", + "babel-register": "^6.14.0", + "babel-runtime": "^6.11.6", + "eslint": "^3.6.1", + "eslint-config-airbnb": "^12.0.0", + "eslint-formatter-pretty": "^1.0.0", + "eslint-import-resolver-webpack": "^0.6.0", + "eslint-nibble-ignore": "^3.0.0", + "eslint-plugin-flowtype": "^2.19.0", + "eslint-plugin-flowtype-errors": "^1.2.0", + "eslint-plugin-fp": "^2.2.0", + "eslint-plugin-import": "^1.16.0", + "eslint-plugin-jsx-a11y": "^2.2.2", + "eslint-plugin-mocha": "^4.5.1", + "eslint-plugin-promise": "^2.0.1", + "eslint-plugin-react": "^6.3.0", + "jasmine-node": "x", + "q": "x" + }, + "browser": { + "child_process": false + }, + "engines": { + "node": ">=0.9.10" + }, + "testling": { + "scripts": [ + "lib/parallel.js", + "test/jasmine/jasmine.js", + "test/jasmine/jasmine.tap_reporter.js", + "test/specs/*.js", + "test/runner.js" + ], + "browsers": [ + "ie/9..latest", + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6", + "android-browser/latest" + ] + } }