Prebuilt module for commit c35814f94f

This commit is contained in:
Paper.js Bot 2016-02-15 23:03:10 +00:00
parent 541f74fb6f
commit 3bf9d838be
7 changed files with 44 additions and 43 deletions

View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Mon Feb 15 23:58:40 2016 +0100
* Date: Mon Feb 15 23:59:31 2016 +0100
*
***
*

73
dist/node/extend.js vendored
View file

@ -12,46 +12,47 @@
var fs = require('fs'),
path = require('path');
Canvas = require('canvas');
module.exports = function(paper) {
var sourceMaps = {},
sourceMapSupprt = 'require("source-map-support").install(paper.PaperScript.sourceMapSupport);\n';
if (paper.PaperScript) {
var sourceMapSupprt = 'require("source-map-support").install(paper.PaperScript.sourceMapSupport);\n',
sourceMaps = {};
paper.PaperScript.sourceMapSupport = {
retrieveSourceMap: function(source) {
var map = sourceMaps[source];
return map ? { url: source, map: map } : null;
}
};
// Register the .pjs extension for automatic compilation as PaperScript
require.extensions['.pjs'] = function(module, filename) {
// Requiring a PaperScript on Node.js returns an initialize method which
// needs to receive a Canvas object when called and returns the
// PaperScope.
module.exports = function(canvas) {
var source = fs.readFileSync(filename, 'utf8'),
code = sourceMapSupprt + source,
compiled = paper.PaperScript.compile(code, {
url: filename,
source: source,
sourceMaps: true,
offset: -1 // remove sourceMapSupprt...
}),
scope = new paper.PaperScope();
// Keep track of sourceMaps so retrieveSourceMap() can link them up
scope.setup(canvas);
scope.__filename = filename;
scope.__dirname = path.dirname(filename);
// Expose core methods and values
scope.require = require;
scope.console = console;
sourceMaps[filename] = compiled.map;
paper.PaperScript.execute(compiled, scope);
return scope;
paper.PaperScript.sourceMapSupport = {
retrieveSourceMap: function(source) {
var map = sourceMaps[source];
return map ? { url: source, map: map } : null;
}
};
};
// Register the .pjs extension for automatic compilation as PaperScript
require.extensions['.pjs'] = function(module, filename) {
// Requiring a PaperScript on Node.js returns an initialize method which
// needs to receive a Canvas object when called and returns the
// PaperScope.
module.exports = function(canvas) {
var source = fs.readFileSync(filename, 'utf8'),
code = sourceMapSupprt + source,
compiled = paper.PaperScript.compile(code, {
url: filename,
source: source,
sourceMaps: true,
offset: -1 // remove sourceMapSupprt...
}),
scope = new paper.PaperScope();
// Keep track of sourceMaps so retrieveSourceMap() can link them up
scope.setup(canvas);
scope.__filename = filename;
scope.__dirname = path.dirname(filename);
// Expose core methods and values
scope.require = require;
scope.console = console;
sourceMaps[filename] = compiled.map;
paper.PaperScript.execute(compiled, scope);
return scope;
};
};
}
paper.PaperScope.inject({
createCanvas: function(width, height, type) {

2
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Mon Feb 15 23:58:40 2016 +0100
* Date: Mon Feb 15 23:59:31 2016 +0100
*
***
*

View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Mon Feb 15 23:58:40 2016 +0100
* Date: Mon Feb 15 23:59:31 2016 +0100
*
***
*

2
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Mon Feb 15 23:58:40 2016 +0100
* Date: Mon Feb 15 23:59:31 2016 +0100
*
***
*

View file

@ -9,7 +9,7 @@
*
* All rights reserved.
*
* Date: Mon Feb 15 23:58:40 2016 +0100
* Date: Mon Feb 15 23:59:31 2016 +0100
*
***
*

View file

@ -46,7 +46,7 @@
"gulp-cached": "^1.1.0",
"gulp-git-streamed": "^1.0.0",
"gulp-jshint": "^2.0.0",
"gulp-prepro": "^2.3.0",
"gulp-prepro": "^2.4.0",
"gulp-qunits": "^2.0.1",
"gulp-rename": "^1.2.2",
"gulp-shell": "^0.5.2",
@ -60,7 +60,7 @@
"jshint": "2.8.x",
"jshint-summary": "^0.4.0",
"merge-stream": "^1.0.0",
"prepro": "^2.3.0",
"prepro": "^2.4.0",
"qunitjs": "^1.20.0",
"require-dir": "^0.3.0",
"resemblejs": "^2.1.0",