mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Prebuilt module for commit c35814f94f
This commit is contained in:
parent
541f74fb6f
commit
3bf9d838be
7 changed files with 44 additions and 43 deletions
2
dist/docs/assets/js/paper.js
vendored
2
dist/docs/assets/js/paper.js
vendored
|
@ -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
73
dist/node/extend.js
vendored
|
@ -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
2
dist/paper-core.js
vendored
|
@ -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-core.min.js
vendored
2
dist/paper-core.min.js
vendored
|
@ -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
2
dist/paper-full.js
vendored
|
@ -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.min.js
vendored
2
dist/paper-full.min.js
vendored
|
@ -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
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue