diff --git a/.gitignore b/.gitignore index 8dc9c779..2fe58e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/ /dist/*/ +/.nvmrc diff --git a/.gitmodules b/.gitmodules index 6a68fec1..3fab7b31 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "jsdoc"] path = gulp/jsdoc url = https://github.com/paperjs/jsdoc.git +[submodule "paper-jsdom"] + path = packages/paper-jsdom + url = https://github.com/paperjs/paper-jsdom.git +[submodule "paper-jsdom-canvas"] + path = packages/paper-jsdom-canvas + url = https://github.com/paperjs/paper-jsdom-canvas.git diff --git a/bower.json b/bower.json index 7206f550..c1ae758a 100644 --- a/bower.json +++ b/bower.json @@ -18,6 +18,7 @@ "gulpfile.js", "gulp", "node_modules", + "packages", "projects", "src", "test", diff --git a/gulp/tasks/publish.js b/gulp/tasks/publish.js index 5ddbe2fb..6ea67072 100644 --- a/gulp/tasks/publish.js +++ b/gulp/tasks/publish.js @@ -11,18 +11,23 @@ */ var gulp = require('gulp'), - bump = require('gulp-bump'), + jsonEditor = require('gulp-json-editor'), git = require('gulp-git-streamed'), run = require('run-sequence'), shell = require('gulp-shell'), options = require('../utils/options.js'); +var jsonOptions = { + end_with_newline: true +}; + gulp.task('publish', function() { if (options.branch !== 'develop') { throw new Error('Publishing is only allowed on the develop branch.'); } return run( 'publish:version', + 'publish:packages', 'publish:dist', 'publish:commit', 'publish:release', @@ -34,11 +39,25 @@ gulp.task('publish:version', function() { // Reset the version value since we're executing this on the develop branch, // but we don't wan the published version suffixed with '-develop'. options.resetVersion(); - return gulp.src([ 'package.json' ]) - .pipe(bump({ version: options.version })) + return gulp.src(['package.json']) + .pipe(jsonEditor({ + version: options.version + }, jsonOptions)) .pipe(gulp.dest('.')); }); +gulp.task('publish:packages', function() { + options.resetVersion(); // See 'publish:version' + return gulp.src(['packages/**/*.json']) + .pipe(jsonEditor({ + version: options.version, + dependencies: { + paper: options.version + } + }, jsonOptions)) + .pipe(gulp.dest('packages')); +}); + gulp.task('publish:dist', ['dist']); gulp.task('publish:commit', function() { diff --git a/package.json b/package.json index ef33aefd..cc2076cb 100644 --- a/package.json +++ b/package.json @@ -36,19 +36,15 @@ "engines": { "node": ">=4.0.0 <8.0.0" }, - "optionalDependencies": { - "canvas": "^1.3.5", - "jsdom": "^9.4.0", - "source-map-support": "^0.4.0" - }, "devDependencies": { "acorn": "~0.5.0", + "canvas": "^1.3.5", "del": "^2.2.1", "gulp": "^3.9.1", - "gulp-bump": "^2.2.0", "gulp-cached": "^1.1.0", "gulp-git-streamed": "^1.8.0", "gulp-jshint": "^2.0.0", + "gulp-json-editor": "^2.2.1", "gulp-prepro": "^2.4.0", "gulp-qunits": "^2.1.1", "gulp-rename": "^1.2.2", @@ -61,6 +57,7 @@ "gulp-whitespace": "^0.1.0", "gulp-zip": "^3.2.0", "husky": "^0.11.4", + "jsdom": "^9.4.0", "jshint": "^2.9.2", "jshint-summary": "^0.4.0", "merge-stream": "^1.0.0", @@ -70,14 +67,11 @@ "require-dir": "^0.3.0", "resemblejs": "^2.2.1", "run-sequence": "^1.2.2", + "source-map-support": "^0.4.0", "stats.js": "0.16.0", "straps": "^2.1.0" }, "browser": { - "canvas": false, - "jsdom": false, - "jsdom/lib/jsdom/living/generated/utils": false, - "source-map-support": false, "./dist/node/self.js": false, "./dist/node/extend.js": false }, diff --git a/packages/paper-jsdom b/packages/paper-jsdom new file mode 160000 index 00000000..2bed95b9 --- /dev/null +++ b/packages/paper-jsdom @@ -0,0 +1 @@ +Subproject commit 2bed95b950805864a91999afeaed469ac4403338 diff --git a/packages/paper-jsdom-canvas b/packages/paper-jsdom-canvas new file mode 160000 index 00000000..807961a7 --- /dev/null +++ b/packages/paper-jsdom-canvas @@ -0,0 +1 @@ +Subproject commit 807961a794f920e107c483ce5301867af8c0cb27 diff --git a/projects/paperjs.sublime-project b/projects/paperjs.sublime-project index 7275b5be..25794e38 100644 --- a/projects/paperjs.sublime-project +++ b/projects/paperjs.sublime-project @@ -14,6 +14,9 @@ "path": "../gulp", "folder_exclude_patterns": ["jsdoc"] }, + { + "path": "../packages", + }, { "path": "../travis", },