diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..1a45f8b --- /dev/null +++ b/.eslintrc @@ -0,0 +1,39 @@ +{ + "env": { + "node": true, + }, + "rules": { + "valid-jsdoc": [2, { + "prefer": { "return": "returns" }, + "requireReturn": true, + "requireParamDescription": true, + "requireReturnDescription": false + }], + "camelcase": 1, + "no-multi-spaces": 0, + "comma-spacing": 1, + "comma-style": [2, "first"], + "consistent-return": 0, + "eol-last": 1, + "indent": [1, 4], + "no-use-before-define": [2, "nofunc"], + "no-process-exit": 0, + "no-trailing-spaces": 1, + "no-underscore-dangle": 0, + "no-unused-vars": 1, + "space-infix-ops": 1, + "quotes": [1, "single"], + "semi": [1, "always"], + "semi-spacing": 1, + "strict": [2, "global"], + "yoda": [1, "never"] + }, + "globals": { + "describe": true, + "it": true, + "before": true, + "beforeEach": true, + "after": true, + "afterEach": true + } +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..816f195 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" +before_install: npm install -g grunt-cli +install: npm install diff --git a/Gruntfile.js b/Gruntfile.js index 418bb23..a7b19a1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,21 +1,41 @@ +'use strict'; + module.exports = function(grunt) { - grunt.initConfig({ - ts: { - options: { - verbose: true - , sourceMap: false - , compiler: './node_modules/typescript/bin/tsc' + grunt.initConfig({ + run: { + options: {} + , cc: { + cmd: 'node' + , args: [ 'app.js', 'cc' ] + } + , cs6: { + cmd: 'node' + , args: [ 'app.js', 'cs6' ] + } } - , default : { - options: { - module: "commonjs" - } - , files: { - "./": ["app.ts"] - } + , ts: { + options: { + verbose: true + , sourceMap: false + , compiler: './node_modules/typescript/bin/tsc' + } + , default: { + options: { + module: 'commonjs' + } + , files: { + './': ['app.ts'] + } + } + , testCC: { files: { './': [ 'dist/cc/**' ] } } + , testCS6: { files: { './': [ 'dist/cc/**' ] } } } - } - }); - grunt.loadNpmTasks("grunt-ts"); - grunt.registerTask("default", ["ts"]); + }); + + grunt.loadNpmTasks('grunt-ts'); + grunt.loadNpmTasks('grunt-run'); + grunt.registerTask('build', ['ts']); + grunt.registerTask('convert', ['run:cc', 'run:cs6']); + grunt.registerTask('test', ['ts:testCC', 'ts:testCS6']); + grunt.registerTask('default', ['build', 'convert', 'test']); }; diff --git a/package.json b/package.json index 760532d..e438ae7 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "Typescript declarations for photoshop", "main": "app.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "make": "tsc --module commonjs app.ts && node app.js" + "test": "grunt" }, "repository": { "type": "git", @@ -23,12 +22,13 @@ "url": "https://github.com/felixschl/photoshop.d.ts/issues" }, "devDependencies": { - "lodash": "~2.4.1", "bennu": "~17.2.2", "fs-extra": "~0.13.0", - "wordwrap": "0.0.2", "grunt": "^0.4.5", + "grunt-run": "^0.3.0", "grunt-ts": "^2.0.1", - "typescript": "1.3.0" + "lodash": "~2.4.1", + "typescript": "1.3.0", + "wordwrap": "0.0.2" } }