diff --git a/.eslintignore b/.eslintignore index bf7da6a..fa72a74 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,3 +5,4 @@ scripts/** submodules/** generators/app/templates/** generators/web/templates/** +temp \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index e5e02dd..7302faa 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,8 +2,9 @@ "extends": "springworks", "rules": { "no-sync": 0, - "dot-location": 0, + "dot-location": 1, "no-console": 0, - "no-process-exit": 0 + "no-process-exit": 0, + "object-curly-spacing": 1 } } diff --git a/.gitignore b/.gitignore index e2b1220..6744d0f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ results npm-debug.log node_modules +temp # IntelliJ .idea diff --git a/.travis.yml b/.travis.yml index 760c7a8..ad204ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: node_js node_js: - - '0.12' + - "0.10" + - "0.12" + - "iojs" script: - npm run lint - npm test @@ -10,3 +12,4 @@ notifications: email: false slack: secure: V3v+RTLnSF0V1cXRvQTsluiBusOIp2pR/54uD6CjQhv16GCjd2iB7orhbCcynMeaDR5e1eiJLybCKGeXFcfg/M/cZUk+H93nIGvK2jzj0xHAEB6cCOjEAf3BCqD9F3kX/EnMO7TgXO+5ZNK7SvcUw7qhJhYcjPgjdP9ihIwXChU= +sudo: false diff --git a/generators/app/index.js b/generators/app/index.js index 24cca4e..e6ca846 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -93,15 +93,15 @@ module.exports = yeoman.generators.Base.extend({ } }, + testFiles: function() { + this.copy('.istanbul.yml', '.istanbul.yml'); + this.copy('test/mocha.opts', 'test/mocha.opts'); + }, + lintFiles: function() { this.copy('eslintignore', '.eslintignore'); this.copy('eslintrc', '.eslintrc'); this.copy('test/eslintrc', 'test/.eslintrc'); - this.copy('gjslintrc', '.gjslintrc'); // Skoog specific ;) - }, - - npmFiles: function() { - this.copy('npmignore', '.npmignore'); } }, diff --git a/generators/app/templates/.istanbul.yml b/generators/app/templates/.istanbul.yml new file mode 100644 index 0000000..0801504 --- /dev/null +++ b/generators/app/templates/.istanbul.yml @@ -0,0 +1,8 @@ +instrumentation: + include-all-sources: true + +reporting: + print: summary + reports: + - lcov + - teamcity diff --git a/generators/app/templates/_package.json b/generators/app/templates/_package.json index b0827ac..d7dfc17 100644 --- a/generators/app/templates/_package.json +++ b/generators/app/templates/_package.json @@ -4,21 +4,15 @@ "description": "<%= projectDescription %>", "private": <%= privateProject %>,<% if (!privateProject) { %> "license": "MIT",<% } %> - "engines": { - "node": ">=0.10.33" - }, "scripts": { - "test": "NODE_ENV=test istanbul cover --report teamcity --report lcov _mocha -- --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' test", + "test": "NODE_ENV=test istanbul cover _mocha", "lint": "eslint .",<% if (!privateProject) { %> - "coveralls": "NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"<% } else { %> - "inspectjs": "jsinspect --threshold 30 ./lib", - "buddyjs": "buddy ./lib", - "quality": "npm run buddyjs && npm run inspectjs && npm run lint", - "test-acceptance": "NODE_ENV=test istanbul cover --report teamcity --report lcov _mocha -- --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' $(find test/**/acceptance test/acceptance -name '*.js' 2>/dev/null)", - "test-changed": "NODE_ENV=test mocha --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' $(git diff --name-only test | grep -E '(\\.js)$')", - "test-component": "NODE_ENV=test istanbul cover --report teamcity --report lcov _mocha -- --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' $(find test/**/component test/component -name *.js 2>/dev/null)", - "test-no-cov": "NODE_ENV=test mocha --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' test", - "test-unit": "NODE_ENV=test istanbul cover --report teamcity --report lcov _mocha -- --ui bdd --check-leaks --recursive --slow 200 --reporter spec --globals 'Intl,IntlPolyfill' $(find test/**/unit test/unit -name '*.js' 2>/dev/null)"<% } %> + "coveralls": "cat ./coverage/lcov.info | coveralls"<% } else { %> + "test-acceptance": "NODE_ENV=test istanbul cover _mocha -- $(find test/**/acceptance test/acceptance -name '*.js' 2>/dev/null)", + "test-changed": "NODE_ENV=test istanbul cover _mocha -- $(git diff --name-only test | grep -E '(\\.js)$')", + "test-component": "NODE_ENV=test istanbul cover _mocha -- $(find test/**/component test/component -name *.js 2>/dev/null)", + "test-no-cov": "NODE_ENV=test mocha", + "test-unit": "NODE_ENV=test istanbul cover _mocha -- $(find test/**/unit test/unit -name '*.js' 2>/dev/null)"<% } %> }, "repository": { "type": "git", @@ -31,14 +25,13 @@ "dependencies": { }, "devDependencies": { - "buddy.js": "^0.8.0",<% if (!privateProject) { %> + <% if (!privateProject) { %> "coveralls": "^2.11.2",<% } %> - "istanbul": "^0.3.13", - "eslint": "^0.21.2", - "eslint-config-springworks": "^1.0.1", - "eslint-plugin-mocha": "^0.2.2", - "jsinspect": "^0.5.0", - "mocha": "^2.2.1", - "chai": "^2.2.0" + "eslint": "0.23.0", + "eslint-config-springworks": "2.1.2", + "eslint-plugin-mocha": "0.2.2", + "istanbul": "^0.3.15", + "mocha": "^2.2.5", + "@springworks/test-harness": "^1.0.0" } } diff --git a/generators/app/templates/gitignore b/generators/app/templates/gitignore index f80fd95..f1f7070 100644 --- a/generators/app/templates/gitignore +++ b/generators/app/templates/gitignore @@ -23,13 +23,11 @@ pids logs results -npm-debug.log node_modules # IntelliJ -.idea/workspace.xml -.idea/tasks.xml -/.idea/misc.xml +.idea +*.iml coverage diff --git a/generators/app/templates/gjslintrc b/generators/app/templates/gjslintrc deleted file mode 100644 index 973cb20..0000000 --- a/generators/app/templates/gjslintrc +++ /dev/null @@ -1,4 +0,0 @@ ---strict ---max_line_length=100 ---disable=0002, 0006 ---exclude_directories='.idea, coverage, node_modules, scripts' diff --git a/generators/app/templates/npmignore b/generators/app/templates/npmignore deleted file mode 100644 index c4c50d9..0000000 --- a/generators/app/templates/npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test/** -test-util/** diff --git a/generators/app/templates/test/mocha.opts b/generators/app/templates/test/mocha.opts new file mode 100644 index 0000000..7f35bf3 --- /dev/null +++ b/generators/app/templates/test/mocha.opts @@ -0,0 +1,6 @@ +--ui bdd +--check-leaks +--recursive +--slow 200 +--reporter spec +--require @springworks/test-harness diff --git a/generators/app/templates/travis.yml b/generators/app/templates/travis.yml index a54cebe..0a509d9 100644 --- a/generators/app/templates/travis.yml +++ b/generators/app/templates/travis.yml @@ -1,8 +1,13 @@ language: node_js node_js: - "0.10" + - "0.12" + - "iojs" script: - npm run lint - npm test after_success: - npm run coveralls +notifications: + email: false +sudo: false diff --git a/package.json b/package.json index 11457b1..21a4779 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "devDependencies": { "chai": "^2.2.0", "coveralls": "^2.11.2", - "eslint": "^0.21.2", - "eslint-config-springworks": "^1.0.1", - "eslint-plugin-mocha": "^0.2.2", + "eslint": "0.23.0", + "eslint-config-springworks": "2.1.2", + "eslint-plugin-mocha": "0.3.0", "istanbul": "^0.3.13", "mocha": "^2.2.1", "mocha-lcov-reporter": "0.0.1" diff --git a/test/private-project-test.js b/test/private-project-test.js index e269959..15d10b7 100644 --- a/test/private-project-test.js +++ b/test/private-project-test.js @@ -23,8 +23,9 @@ describe('springworks:app (private)', function() { '.gitattributes', '.eslintignore', '.eslintrc', - '.gjslintrc', - '.npmignore', + 'test/.eslintrc', + 'test/mocha.opts', + '.istanbul.yml', 'README.md' ]; assert.file(expected); diff --git a/test/public-project-test.js b/test/public-project-test.js index 651915d..07d0021 100644 --- a/test/public-project-test.js +++ b/test/public-project-test.js @@ -24,8 +24,6 @@ describe('springworks:app (public)', function() { 'LICENSE', '.eslintignore', '.eslintrc', - '.gjslintrc', - '.npmignore', 'README.md' ]; assert.file(expected);