From 2821dff46f4cdb82cb24a2f6d565014dbf3af816 Mon Sep 17 00:00:00 2001 From: Felix Schlitter Date: Fri, 24 Jul 2015 18:47:01 +1200 Subject: [PATCH 1/3] Create .travis.yml --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..455116f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" +before_install: npm install -g grunt-cli +install: npm install +before_script: grunt build From 1d37b3149b25126161d23cd7e89fde445a048ffc Mon Sep 17 00:00:00 2001 From: Felix Schlitter Date: Fri, 24 Jul 2015 18:49:26 +1200 Subject: [PATCH 2/3] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 455116f..c46d59a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ node_js: - "0.10" before_install: npm install -g grunt-cli install: npm install -before_script: grunt build +before_script: grunt From 31c9182ec19edbadd21834ddc5d113aed7d30ec9 Mon Sep 17 00:00:00 2001 From: Felix Schlitter Date: Fri, 24 Jul 2015 19:18:30 +1200 Subject: [PATCH 3/3] Update gruntfile --- .eslintrc | 39 +++++++++++++++++++++++++++++++++++++ .travis.yml | 1 - Gruntfile.js | 54 +++++++++++++++++++++++++++++++++++----------------- package.json | 10 +++++----- 4 files changed, 81 insertions(+), 23 deletions(-) create mode 100644 .eslintrc 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 index c46d59a..816f195 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,3 @@ node_js: - "0.10" before_install: npm install -g grunt-cli install: npm install -before_script: grunt 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" } }