mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
first pass at migrating the old Ruby build to Grunt
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@ jsdoc-master
|
|||||||
dist
|
dist
|
||||||
tests/js/unitTests.js
|
tests/js/unitTests.js
|
||||||
analysis
|
analysis
|
||||||
|
node_modules
|
||||||
|
|
||||||
# Numerous always-ignore extensions
|
# Numerous always-ignore extensions
|
||||||
*.diff
|
*.diff
|
||||||
|
94
Gruntfile.js
Normal file
94
Gruntfile.js
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
// Project configuration.
|
||||||
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
concat: {
|
||||||
|
options: {
|
||||||
|
separator: ';'
|
||||||
|
},
|
||||||
|
dist: {
|
||||||
|
src: [
|
||||||
|
// core / anim + tween + dd
|
||||||
|
'src/Global.js',
|
||||||
|
'src/Util.js',
|
||||||
|
'src/Canvas.js',
|
||||||
|
'src/Node.js',
|
||||||
|
'src/Animation.js',
|
||||||
|
'src/Tween.js',
|
||||||
|
'src/DragAndDrop.js',
|
||||||
|
'src/Container.js',
|
||||||
|
'src/Shape.js',
|
||||||
|
'src/Stage.js',
|
||||||
|
'src/Layer.js',
|
||||||
|
'src/Group.js',
|
||||||
|
|
||||||
|
// shapes
|
||||||
|
'src/shapes/Rect.js',
|
||||||
|
'src/shapes/Circle.js',
|
||||||
|
'src/shapes/Wedge.js',
|
||||||
|
'src/shapes/Image.js',
|
||||||
|
'src/shapes/Polygon.js',
|
||||||
|
'src/shapes/Text.js',
|
||||||
|
'src/shapes/Line.js',
|
||||||
|
'src/shapes/Spline.js',
|
||||||
|
'src/shapes/Blob.js',
|
||||||
|
'src/shapes/Sprite.js',
|
||||||
|
|
||||||
|
// plugins
|
||||||
|
'src/plugins/Path.js',
|
||||||
|
'src/plugins/TextPath.js',
|
||||||
|
'src/plugins/RegularPolygon.js',
|
||||||
|
'src/plugins/Star.js',
|
||||||
|
'src/plugins/Label.js',
|
||||||
|
|
||||||
|
// filters
|
||||||
|
'src/filters/Grayscale.js',
|
||||||
|
'src/filters/Brighten.js',
|
||||||
|
'src/filters/Invert.js',
|
||||||
|
'src/filters/Blur.js',
|
||||||
|
'src/filters/Mask.js'
|
||||||
|
],
|
||||||
|
dest: 'dist/kinetic-v<%= pkg.version %>.js'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
replace: {
|
||||||
|
dist: {
|
||||||
|
options: {
|
||||||
|
variables: {
|
||||||
|
'version': '<%= pkg.version %>',
|
||||||
|
'date': '<%= grunt.template.today("yyyy-mm-dd") %>'
|
||||||
|
},
|
||||||
|
prefix: '@@'
|
||||||
|
},
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
flatten: true,
|
||||||
|
src: ['dist/kinetic-v<%= pkg.version %>.js'],
|
||||||
|
dest: 'dist/'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uglify: {
|
||||||
|
options: {
|
||||||
|
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> http://www.kineticjs.com - MIT License https://github.com/ericdrowell/KineticJS/wiki/License*/\n'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
src: 'dist/kinetic-v<%= pkg.version %>.js',
|
||||||
|
dest: 'dist/kinetic-v<%= pkg.version %>.min.js'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Load plugins
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||||
|
grunt.loadNpmTasks('grunt-replace');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
|
|
||||||
|
// Tasks
|
||||||
|
grunt.registerTask('dev', ['concat', 'replace']);
|
||||||
|
grunt.registerTask('prod', ['concat', 'replace', 'uglify']);
|
||||||
|
|
||||||
|
};
|
28
package.json
Normal file
28
package.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "KineticJS",
|
||||||
|
"version": "4.5.4",
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "~0.4.1",
|
||||||
|
"grunt-contrib-jshint": "~0.1.1",
|
||||||
|
"grunt-contrib-nodeunit": "~0.1.2",
|
||||||
|
"grunt-contrib-uglify": "~0.2.2",
|
||||||
|
"grunt-contrib-concat": "~0.3.0",
|
||||||
|
"grunt-replace": "~0.4.4"
|
||||||
|
},
|
||||||
|
"readmeFilename": "README.md",
|
||||||
|
"gitHead": "7b9322c15c08b3ff78f64f5cfd3e9f88850dcadc",
|
||||||
|
"description": "To build the framework, you need to have Ruby and Rubygems installed. After that, run `gem install thor`, `gem install json_pure`, and `gem install uglifier` to install the dependencies.",
|
||||||
|
"main": "Gruntfile.js",
|
||||||
|
"directories": {
|
||||||
|
"test": "tests"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/ericdrowell/KineticJS.git"
|
||||||
|
},
|
||||||
|
"author": "Eric Rowell",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
@@ -1,9 +1,9 @@
|
|||||||
/**
|
/*
|
||||||
* KineticJS JavaScript Framework v{{version}}
|
* KineticJS JavaScript Framework v@@version
|
||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2013, Eric Rowell
|
* Copyright 2013, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: {{date}}
|
* Date: @@date
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2013 by Eric Rowell
|
* Copyright (C) 2011 - 2013 by Eric Rowell
|
||||||
*
|
*
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
var Kinetic = {};
|
var Kinetic = {};
|
||||||
(function() {
|
(function() {
|
||||||
Kinetic.version = '{{version}}';
|
Kinetic.version = '@@version';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace Filters
|
* @namespace Filters
|
||||||
|
Reference in New Issue
Block a user