Updated build scripts

This commit is contained in:
Kristofer
2017-12-03 16:14:21 +01:00
parent 94445ab9ff
commit 00f01c3cb3
6 changed files with 8649 additions and 2430 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/
node_modules/*

File diff suppressed because it is too large Load Diff

6940
build/litegraph.min.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,23 +1,9 @@
{
"name": "litegraph.js",
"version": "0.1.2",
"description": "A graph node editor similar to PD or UDK Blueprints, it works in a HTML5 Canvas and allow to exported graphs to be included in applications.",
"name": "litegraph.js",
"main": "litegraph.js",
"directories": {
"doc": "doc"
},
"private": false,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kriffe/litegraph.js.git"
},
"description": "A graph node editor similar to PD or UDK Blueprints, it works in a HTML5 Canvas and allow to exported graphs to be included in applications.",
"author": "jagenjo",
"license": "MIT",
"bugs": {
"url": "https://github.com/jagenjo/litegraph.js/issues"
},
"homepage": "https://github.com/kriffe/litegraph.js#readme"
}
"scripts": {}
}

82
gruntfile.js Normal file
View File

@@ -0,0 +1,82 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
projectFiles: ['src/litegraph.js',
'src/nodes/base.js',
'src/nodes/events.js',
'src/nodes/interface.js',
'src/nodes/input.js',
'src/nodes/math.js',
'src/nodes/logic.js',
'src/nodes/image.js',
'src/nodes/gltextures.js',
'src/nodes/glfx.js',
'src/nodes/midi.js',
'src/nodes/audio.js'
],
concat: {
build: {
src: '<%= projectFiles %>',
dest: 'build/litegraph.js'
}
},
copy: {
parts: {
files: [
{
expand: true,
flatten: true,
cwd: '',
src: ['README.md'],
dest: 'build/'
}
]
}
},
clean: {
build: {src: ['build/*']}
},
closureCompiler: {
options: {
compilerFile: 'node_modules/google-closure-compiler/compiler.jar',
compilerOpts: {
formatting: 'pretty_print',
warning_level: 'default'
},
d32: false, // will use 'java -client -d32 -jar compiler.jar'
TieredCompilation: false// will use 'java -server -XX:+TieredCompilation -jar compiler.jar',
// ,output_wrapper: '"var LiteGraph = (function(){%output% return LiteGraph;}).call(this);"' //* Make container for all
},
targetName: {
src: '<%= projectFiles %>',
dest: 'build/litegraph.min.js'
}
}
})
grunt.registerTask('buildPackage', function () {
var pkg = grunt.config.data.pkg
var newPackage = {
version: pkg.version,
name: 'litegraph.js', //* Static name without ogranisation
main: 'litegraph.js',
description: pkg.description,
dependencies: pkg.dependencies,
author: pkg.author,
license: 'MIT',
scripts: {
}
}
grunt.file.write('build/package.json', JSON.stringify(newPackage, undefined, 2))
})
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-closure-tools')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.registerTask('build', ['buildPackage', 'copy:parts', 'concat:build', 'closureCompiler'])
}

View File

@@ -8,16 +8,26 @@
},
"private": false,
"scripts": {
"prebuild": "grunt clean:build",
"build": "grunt build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kriffe/litegraph.js.git"
"url": "git+https://github.com/jagenjo/litegraph.js.git"
},
"author": "jagenjo",
"license": "MIT",
"bugs": {
"url": "https://github.com/kriffe/litegraph.js/issues"
"url": "https://github.com/jagenjo/litegraph.js/issues"
},
"homepage": "https://github.com/kriffe/litegraph.js#readme"
"homepage": "https://github.com/kriffe/litegraph.js#readme",
"devDependencies": {
"google-closure-compiler": "^20171112.0.0",
"grunt": "^1.0.1",
"grunt-closure-tools": "^1.0.0",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0"
}
}