]> git.r.bdr.sh - rbdr/serpentity/commitdiff
Prepare bower with a concatenated file.
authorBen Beltran <redacted>
Tue, 12 Aug 2014 02:03:24 +0000 (21:03 -0500)
committerBen Beltran <redacted>
Tue, 12 Aug 2014 02:03:24 +0000 (21:03 -0500)
README.md
bower.json [moved from lib/serpentity/bower.json with 75% similarity]
browser_test/index.html
dist/serpentity.js [new file with mode: 0644]
gulpfile.js [new file with mode: 0644]
lib/renderer/console.js [deleted file]
package.json

index 4d73f182208efc8b870f5cb21f366c535891cf72..6703b5f0a3e221837179730a5f6bcdd4aad9e055 100644 (file)
--- a/README.md
+++ b/README.md
@@ -95,12 +95,9 @@ Just run `engine.update(dt)` in your game loop :D
 
 ## Checking it in the frontend (dev).
 
 
 ## Checking it in the frontend (dev).
 
-You can link the bower package (bower.json is in `lib/serpentity/` to
-make paths cleaner), then link it again from the root directory and
-spawn a python server (`python -m SimpleHTTPServer`). The test page
-will be available in `http://localhost:8000/browser_test/`
-
-If you just want to use it, it's available as a bower package!
+You can link the bower package to test it out locally.
+Spawn a python server (`python -m SimpleHTTPServer`) to see
+the test page in `http://localhost:8000/browser_test/`
 
 
 ## TO-DO
 
 
 ## TO-DO
similarity index 75%
rename from lib/serpentity/bower.json
rename to bower.json
index d93dd89d713791cf1f175539aeb4d55af43532ae..ebd6bcd0278ddf87367587f5f2326ba8e0ddfbcd 100644 (file)
@@ -7,12 +7,7 @@
   ],
   "description": "A simple entity framework inspired by ash",
   "main": [
   ],
   "description": "A simple entity framework inspired by ash",
   "main": [
-    "./serpentity.js",
-    "./entity.js",
-    "./node.js",
-    "./node_collection.js",
-    "./component.js",
-    "./system.js"
+    "./dist/serpentity.js"
   ],
   "keywords": [
     "entity"
   ],
   "keywords": [
     "entity"
     "node_modules",
     "bower_components",
     "test",
     "node_modules",
     "bower_components",
     "test",
-    "tests"
+    "tests",
+    "bin",
+    "browser_test",
+    "LICENSE",
+    "bower.json",
+    "README.md",
+    "lib"
   ],
   "dependencies": {
     "neon": "*"
   ],
   "dependencies": {
     "neon": "*"
index 3be1f38f4db2496d6883552a417c72cfd47fe574..82921b71c5180fe95bbea86fba7873c996aec759 100644 (file)
@@ -3,12 +3,7 @@
   <head>
     <title>Serpentity Browser Test</title>
     <script src="/bower_components/neon/neon.js"></script>
   <head>
     <title>Serpentity Browser Test</title>
     <script src="/bower_components/neon/neon.js"></script>
-    <script src="/bower_components/serpentity/serpentity.js"></script>
-    <script src="/bower_components/serpentity/entity.js"></script>
-    <script src="/bower_components/serpentity/node.js"></script>
-    <script src="/bower_components/serpentity/node_collection.js"></script>
-    <script src="/bower_components/serpentity/component.js"></script>
-    <script src="/bower_components/serpentity/system.js"></script>
+    <script src="/bower_components/serpentity/dist/serpentity.js"></script>
     <script type="application/javascript">
         /////////////////
         // Load the stuff
     <script type="application/javascript">
         /////////////////
         // Load the stuff
diff --git a/dist/serpentity.js b/dist/serpentity.js
new file mode 100644 (file)
index 0000000..cfeb5c6
--- /dev/null
@@ -0,0 +1,6 @@
+"undefined"!=typeof require&&require("neon"),Class("Serpentity")({prototype:{systems:null,nodeCollections:null,entities:null,init:function(e){var t;e=e||{},this.systems=[],this.entities=[],this.nodeCollections={};for(t in e)e.hasOwnProperty(t)&&(this[t]=e[t])},addSystem:function(e,t){var i,s;return this.systems.indexOf(e)>=0?!1:(e.priority=t,s=!1,i=0,this.systems.some(function(t,n){return i=n,t.priority>=e.priority?(s=!0,!0):void 0}),s||(i+=1),this.systems.splice(i,0,e),e.added(this),!0)},removeSystem:function(e){var t;return t=this.systems.indexOf(e),t>=0?(this.systems[t].removed(this),this.systems.splice(t,1),!0):!1},addEntity:function(e){var t;if(this.entities.indexOf(e)>=0)return!1;this.entities.push(e);for(t in this.nodeCollections)this.nodeCollections.hasOwnProperty(t)&&this.nodeCollections[t].add(e);return!0},removeEntity:function(e){var t;if(t=this.entities.indexOf(e),t>=0){for(property in this.nodeCollections)this.nodeCollections.hasOwnProperty(property)&&this.nodeCollections[property].remove(e);return this.entities.splice(t,1),!0}return!1},getNodes:function(e){var t;return this.nodeCollections.hasOwnProperty(e)?this.nodeCollections[e].nodes:(t=new Serpentity.NodeCollection({type:e}),this.nodeCollections[e]=t,this.entities.forEach(function(e){t.add(e)}),t.nodes)},update:function(e){this.systems.forEach(function(t){t.update(e)})}}}),"undefined"!=typeof require&&(require("./component.js"),require("./entity.js"),require("./node.js"),require("./node_collection.js"),require("./system.js"));
+Class(Serpentity,"Entity")({prototype:{addedComponents:null,init:function(n){var t;this.components={};for(t in n)n.hasOwnProperty(t)&&(this[t]=n[t])},add:function(n){return this.components.hasOwnProperty(n.constructor)?!1:(this.components[n.constructor]=n,!0)},hasComponent:function(n){return this.components.hasOwnProperty(n)?!0:!1}}});
+Class(Serpentity,"Node")({matches:function(t){var s,r,n;n=this.types;for(s in this.types)if(this.types.hasOwnProperty(s)&&(r=!1,t.hasComponent(n[s])&&(r=!0),!r))return!1;return!0},prototype:{types:null,init:function(){var t;this.types={};for(t in this.constructor)this.constructor.hasOwnProperty(t)&&(this.types[t]=this.constructor[t])}}});
+Class(Serpentity,"NodeCollection")({prototype:{type:null,nodes:null,init:function(t){var n;t=t||{},this.nodes=[];for(n in t)t.hasOwnProperty(n)&&(this[n]=t[n])},add:function(t){var n,e,i;if(this.type.matches(t)&&!this._entityExists(t)){n=new this.type({}),n.entity=t,e=this.type.types;for(i in e)e.hasOwnProperty(i)&&(n[i]=t.components[e[i]]);return this.nodes.push(n),!0}return!1},remove:function(t){var n;return n=-1,this.nodes.forEach(function(e,i){e.entity===t&&(n=i)}),n>=0?(this.nodes.splice(n,1),!0):!1},_entityExists:function(t){var n;return n=!1,this.nodes.forEach(function(e){e.entity===t&&(n=!0)}),n}}});
+Class(Serpentity,"Component")({});
+Class(Serpentity,"System")({prototype:{added:function(){},removed:function(){},update:function(){}}});
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644 (file)
index 0000000..f1fb5e6
--- /dev/null
@@ -0,0 +1,17 @@
+var gulp = require('gulp');
+var uglify = require('gulp-uglify');
+var concat = require('gulp-concat');
+
+gulp.task('build', function() {
+  gulp.src([
+              'lib/serpentity/serpentity.js',
+              'lib/serpentity/entity.js',
+              'lib/serpentity/node.js',
+              'lib/serpentity/node_collection.js',
+              'lib/serpentity/component.js',
+              'lib/serpentity/system.js',
+          ])
+    .pipe(uglify())
+    .pipe(concat('serpentity.js'))
+    .pipe(gulp.dest('dist'))
+});
diff --git a/lib/renderer/console.js b/lib/renderer/console.js
deleted file mode 100644 (file)
index e69de29..0000000
index 573eb9d247d76260b2fd2ea184f7161def96e4a4..5ab315744dd0345680ef93462fd8e7e54f7c72f7 100644 (file)
   },
   "devDependencies": {
     "colors": "0.6.2",
   },
   "devDependencies": {
     "colors": "0.6.2",
-    "tellurium": "2.0.x"
+    "tellurium": "2.0.x",
+    "gulp-uglify": "~0.3.1",
+    "gulp": "~3.8.7",
+    "gulp-concat": "~2.3.4"
   },
   "engines": {
     "node": ">= 0.10.0"
   },
   "engines": {
     "node": ">= 0.10.0"