Merge branch 'develop'

This commit is contained in:
Jürg Lehni 2017-04-19 22:17:03 +02:00
commit 3b85fd05d7
21 changed files with 112 additions and 91 deletions

4
.gitmodules vendored
View file

@ -2,8 +2,8 @@
path = gulp/jsdoc
url = https://github.com/paperjs/jsdoc.git
[submodule "paper-jsdom"]
path = packages/paper-jsdom
path = packages/paper-jsdom
url = https://github.com/paperjs/paper-jsdom.git
[submodule "paper-jsdom-canvas"]
path = packages/paper-jsdom-canvas
path = packages/paper-jsdom-canvas
url = https://github.com/paperjs/paper-jsdom-canvas.git

View file

@ -1,6 +1,6 @@
# Change Log
## `0.10.4`
## `0.11.0`
### Changed
- Separate `paper` module on NPM into: `paper`, `paper-jsdom` and
@ -8,9 +8,11 @@
- `paper` is the main library, and can be used directly in a browser
context, e.g. a web browser or worker.
- `paper-jsdom` is a shim module for Node.js, offering headless use with SVG
importing / exporting.
- `paper-jsdom-canvas` is a shim module for Node.js, offering rendering
through Node Canvas.
importing and exporting through [jsdom](https://github.com/tmpvar/jsdom).
- `paper-jsdom-canvas` is a shim module for Node.js, canvas rendering
through [Node-Canvas](https://github.com/Automattic/node-canvas) as well
as SVG importing and exporting through
[jsdom](https://github.com/tmpvar/jsdom).
### Added
- PaperScript: Support newer, external versions of Acorn.js for PaperScript

View file

@ -14,25 +14,23 @@ and [`prebuilt/dist`](https://github.com/paperjs/paper.js/tree/prebuilt/dist) br
## Installing Paper.js
The recommended way to install and maintain Paper.js as a dependency in your
project is through NPM or Bower for browsers, and through NPM for Node.js.
project is through the [Node.js Package Manager (NPM)](https://www.npmjs.com/)
for browsers, Node.js or Electron, as well as through Bower for browsers.
If NPM or Bower is already installed, simply type one of these
commands in your project folder:
npm install paper
or:
bower install paper
```sh
npm install paper
# Or:
bower install paper
```
Upon execution, you will find a `paper` folder inside the project's
`node_modules` / `bower_components` folder.
For more information on how to install NPM and Bower, read the chapter
[Installing Node.js, NPM and Bower](#installing-nodejs-npm-and-bower).
To learn more about its features for dependence tracking, see
<http://bower.io/>.
For more information on how to install Node.js and NPM, read the chapter
[Installing Node.js and NPM](#installing-nodejs-and-npm).
### Which Version to Use?
@ -45,48 +43,50 @@ Paper.js, in minified and normal variants:
support nor Acorn.js. You can use this to shave off some bytes and compilation
time when working with JavaScript directly.
### Installing Node.js, NPM and Bower
### Installing Node.js and NPM
Node.js is required by Bower, as well as by Gulp.js, which needs to be installed
if you intend to build the library or its documentation by yourself.
Node.js comes with the Node Package Manager (NPM). There are many tutorials
explaining the different ways to install Node.js on different platforms. It is
generally not recommended to install Node.js through OS-supplied package
managers, as the its development cycles move fast and these versions are often
out-of-date.
There are many tutorials explaining the different ways to install Node.js on
different platforms. It is generally not recommended to install Node.js through
OS-supplied package managers, as the its development cycles move fast and these
versions are often out-of-date.
NVM can be used instead to install and maintain multiple versions of Node.js on
the same platform, as often required by different projects:
<http://blog.dynamicprogrammer.com/2014/02/18/installing-node-js-on-mac-osx.html>
[NVM](https://github.com/creationix/nvm) can be used instead to install and
maintain multiple versions of Node.js on the same platform, as often required by
different projects:
<https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/>
on OSX, [Homebrew](http://brew.sh/) is also a good option if one version of
Node.js on the platform is enough:
<http://blog.teamtreehouse.com/install-node-js-npm-mac>
Node.js that is kept up to date with `brew update` is enough:
<http://treehouse.github.io/installation-guides/mac/node-mac.html>
Homebrew is recommended on OSX also if you intend to install Paper.js for
Node.js, as described in the next paragraph.
For Linux see <http://nodejs.org/download/> to locate 32-bit and 64-bit nodejs
binaries as well as sources, or use NVM: <http://learn.bevry.me/node/install/>
Once Node.js (with NPM) has been installed you can install bower *globally*
using the following command:
npm install -g bower
And from there onwards, you should be able to use Bower like this:
bower search paperjs
For Linux, see <http://nodejs.org/download/> to locate 32-bit and 64-bit Node.js
binaries as well as sources, or use NVM, as described in the paragraph above.
### Installing Paper.js for Node.js
NPM is used to install Paper.js for use in Node.js. But before installing, you
need the Cairo Graphics library installed, see: <http://cairographics.org/>.
Paper.js comes in three different versions on NPM: `paper`, `paper-jsdom` and
`paper-jsdom-canvas`. Depending on your use case, you need to required a
different one:
- `paper` is the main library, and can be used directly in a browser
context, e.g. a web browser or worker.
- `paper-jsdom` is a shim module for Node.js, offering headless use with SVG
importing and exporting through [jsdom](https://github.com/tmpvar/jsdom).
- `paper-jsdom-canvas` is a shim module for Node.js, offering canvas rendering
through [Node-Canvas](https://github.com/Automattic/node-canvas) as well as
SVG importing and exporting through [jsdom](https://github.com/tmpvar/jsdom).
In order to install `paper-jsdom-canvas`, you need the [Cairo Graphics
library](http://cairographics.org/) installed in your system:
##### Installing Cairo and Pango on OSX:
The easiest way to install Cairo is install Homebrew
<http://mxcl.github.io/homebrew/> then issue the command:
The easiest way to install Cairo is through [Homebrew](http://brew.sh/), by
issuing the command:
brew install cairo pango
@ -121,17 +121,18 @@ build from c++ sources:
##### After Cairo has been installed:
You should now be able to install the Paper.js module from NPM:
You should now be able to install the Paper.js module with jsdom and Canvas
rendering from NPM:
npm install paper
npm install paper-jsdom-canvas
### Installing Paper.js for Electron
### Installing Paper.js with Node-Canvas for Electron
[Node-Canvas](https://github.com/Automattic/node-canvas) is a native dependency.
In order to build it for use in Electron, which is likely to use a different
version of V8 than the Node binary installed in your system, you need to
manually specify the location of Electrons headers. Follow these steps to do
so:
In order to build it for use of `paper-jsdom-canvas` in Electron, which is
likely to use a different version of V8 than the Node binary installed in your
system, you need to manually specify the location of Electrons headers. Follow
these steps to do so:
[Electron — Using Native Node
Modules](https://electron.atom.io/docs/tutorial/using-native-node-modules/)

6
dist/paper-core.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Paper.js v0.10.4 - The Swiss Army Knife of Vector Graphics Scripting.
* Paper.js v0.11.0 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Wed Apr 19 19:53:39 2017 +0200
* Date: Wed Apr 19 20:32:12 2017 +0200
*
***
*
@ -769,7 +769,7 @@ var PaperScope = Base.extend({
}
},
version: "0.10.4",
version: "0.11.0",
getView: function() {
var project = this.project;

File diff suppressed because one or more lines are too long

6
dist/paper-full.js vendored
View file

@ -1,5 +1,5 @@
/*!
* Paper.js v0.10.4 - The Swiss Army Knife of Vector Graphics Scripting.
* Paper.js v0.11.0 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Wed Apr 19 19:53:39 2017 +0200
* Date: Wed Apr 19 20:32:12 2017 +0200
*
***
*
@ -769,7 +769,7 @@ var PaperScope = Base.extend({
}
},
version: "0.10.4",
version: "0.11.0",
getView: function() {
var project = this.project;

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
paper.setup(new paper.Size(1024, 768));

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
var http = require('http');

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
var path = require('path');
var fs = require('fs');

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
var fs = require('fs');

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
var path = require('path');
var fs = require('fs');

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-core.js');
paper.setup(new paper.Size(300, 600));

View file

@ -1,6 +1,6 @@
// Please note: When loading paper as a normal module installed in node_modules,
// you would use this instead:
// var paper = require('paper');
// var paper = require('paper-jsdom-canvas');
var paper = require('../../dist/paper-full.js');
var scope = require('./Tadpoles.pjs')(new paper.Size(1024, 768));

View file

@ -11,15 +11,17 @@
*/
var gulp = require('gulp'),
jsonEditor = require('gulp-json-editor'),
git = require('gulp-git-streamed'),
jsonEditor = require('gulp-json-editor'),
merge = require('merge-stream'),
run = require('run-sequence'),
shell = require('gulp-shell'),
options = require('../utils/options.js');
var jsonOptions = {
end_with_newline: true
};
var packages = ['paper-jsdom', 'paper-jsdom-canvas'],
jsonOptions = {
end_with_newline: true
};
gulp.task('publish', function() {
if (options.branch !== 'develop') {
@ -46,16 +48,32 @@ gulp.task('publish:version', function() {
.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:packages',
packages.map(function(name) {
return 'publish:packages:' + name;
})
);
packages.forEach(function(name) {
gulp.task('publish:packages:' + name, function() {
options.resetVersion(); // See 'publish:version'
var message = 'Release version ' + options.version,
path = 'packages/' + name,
opts = { cwd: path };
gulp.src(['package.json'], opts)
.pipe(jsonEditor({
version: options.version,
dependencies: {
paper: options.version
}
}, jsonOptions))
.pipe(gulp.dest(path))
.pipe(git.add(opts))
.pipe(git.commit(message, opts))
.pipe(git.tag('v' + options.version, message, opts))
.pipe(git.push('origin', 'master', { args: '--tags', cwd: path }))
.pipe(shell('npm publish', opts));
});
});
gulp.task('publish:dist', ['dist']);

View file

@ -1,6 +1,6 @@
{
"name": "paper",
"version": "0.10.4",
"version": "0.11.0",
"description": "The Swiss Army Knife of Vector Graphics Scripting",
"license": "MIT",
"homepage": "http://paperjs.org",

@ -1 +1 @@
Subproject commit 2bed95b950805864a91999afeaed469ac4403338
Subproject commit 5dea0850de4560ef5db932d7cbfbd02ac1b31b0e

@ -1 +1 @@
Subproject commit 807961a794f920e107c483ce5301867af8c0cb27
Subproject commit a2de585e79c4259b9e25a94c8ee688ba424181ff

View file

@ -12,7 +12,7 @@
// Add some useful extensions to HTMLCanvasElement:
// - HTMLCanvasElement#type, so we can switch to a PDF canvas
// - Various Node Canvas methods, routed through from HTMLCanvasElement:
// - Various Node-Canvas methods, routed through from HTMLCanvasElement:
// toBuffer, pngStream, createPNGStream, jpgStream, createJPGStream
module.exports = function(self, requireName) {

View file

@ -17,7 +17,7 @@
// The paper.js version.
// NOTE: Adjust value here before calling `gulp publish`, which then updates and
// publishes the various JSON package files automatically.
var version = '0.10.4';
var version = '0.11.0';
// If this file is loaded in the browser, we're in load.js mode.
var load = typeof window === 'object';