Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

packages build working

  • Loading branch information...
commit d870fc40d028542692d8da07372f4e34503b11ec 1 parent 6c32811
@moschel moschel authored
View
3  build/css/test/production.js
@@ -1,2 +1 @@
-steal.packages({});steal.has("stealconfig.js","steal/build/css/test/test.js");steal({id:"steal/build/css/test/production.css",waits:!0,has:["steal/build/css/test/css2.css","steal/build/css/test/css/css1.css","steal/build/css/test/css3.css"]});steal.config({map:{"*":{"jquery/jquery.js":"jquery","can/util/util.js":"can/util/jquery/jquery.js"}},paths:{jquery:"can/util/jquery/jquery.1.7.1.js"},ext:{js:"js",css:"css",less:"steal/less/less.js",coffee:"steal/coffee/coffee.js",ejs:"can/view/ejs/ejs.js"}});
-steal.executed("stealconfig.js");steal("./css2.css","./css/css1.css").then("./css3.css");steal.executed("steal/build/css/test/test.js");
+steal.packages({});steal.has("steal/build/css/test/test.js");steal({id:"steal/build/css/test/production.css",waits:!0,has:["steal/build/css/test/css2.css","steal/build/css/test/css/css1.css","steal/build/css/test/css3.css"]});steal("./css2.css","./css/css1.css").then("./css3.css");steal.executed("steal/build/css/test/test.js");
View
1  build/js/jsminify.js
@@ -54,6 +54,7 @@ steal('steal','steal/parse',function(steal, parse){
* several files at once.
*/
js.minify = function(source, options){
+ // return source;
// get the compressor
options = options || {};
var compressor = js.minifiers[options.compressor || "localClosure"]()
View
1  build/open/open.js
@@ -221,7 +221,6 @@ steal('steal',function(s){
}
var items = [];
// iterate
- print("ITERATING "+depth)
iterate(rootSteal, function(stealer){
if( filter(stealer) ) {
View
5 build/packages/test/app.css
@@ -1,5 +0,0 @@
-h3 {
- margin: 0px;
- background-color: yellow;
- background-image: url('../../css/test/upload.PNG');
-}
View
66 build/packages/test/app.html
@@ -1,66 +0,0 @@
-<html>
- <head>
- <style>
- #resize {
- width: 200px;
- height: 200px;
- border: solid 1px black;
- }
- .ui-resizable-s {
- bottom:-3px;
- cursor:s-resize;
- height:7px;
- left:0;
- width:100%;
- }
-
- .ui-resizable-e {
- cursor:e-resize;
- height:100%;
- right:-3px;
- top:0;
- width:7px;
- }
-
- .ui-resizable-se {
- bottom:0px;
- cursor:se-resize;
- height:12px;
- right:0px;
- width:12px;
- background-color: #ddddff;
- }
- </style>
- </head>
- <body>
- <a href='#!accordion'>accordion</a>
- <a href='#!table'>table</a>
- <a href='#!resize'>resize</a>
- <a href='#'>reset</a>
- <div id='accordion'>
- <h3>First</h3>
- <div>Content 1</div>
- <h3>Second</h3>
- <div>Content 2</div>
- </div>
- <div id='wrap'>
- <table id='table'>
- <thead>
- <tr>
- <th>One</th><th>Two</th>
- </tr>
- </thead>
- <tbody>
- <tr><td>First</td><td>Second</td></tr>
- <tr><td>1</td><td>2</td></tr>
- <tr><td>primary</td><td>Secondary</td></tr>
- <tr><td>First</td><td>Second</td></tr>
- <tr><td>1</td><td>2</td></tr>
- </tbody>
- </table>
- </div>
- <div id='resize'></div>
- <script type='text/javascript'
- src='../../../../steal/steal.js?steal/build/packages/test/app.js,production'></script>
- </body>
-</html>
View
30 build/packages/test/app.js
@@ -1,30 +0,0 @@
-steal.packages('steal/build/packages/test/table_scroll.js',
- 'canui/incubator/accordion/accordion.js',
- 'canui/resize/resize.js')
- .then('jquery/controller/route',
- 'jquery/view/ejs','./app.css')
- .then('./ejs.ejs', function(){
-
-$.Controller('Route', {
- "table route" : function(){
- steal('steal/build/packages/test/table_scroll.js', function(){
- $('#table').tableScroll()
- })
- },
- "accordion route" : function(){
- steal('canui/incubator/accordion', function(){
- $('#accordion').accordion()
- })
- },
- "resize route" : function(){
- steal('canui/resize', function(){
- $('#resize').resizable()
- })
- }
-});
-
-new Route(document.body);
-
-
-});
-
View
1  build/packages/test/ejs.ejs
@@ -1 +0,0 @@
-<img src='<%= "foo" %>'/>
View
0  build/packages/test/packages/.gitignore
No changes.
View
39 build/packages/test/packages_test.js
@@ -11,30 +11,31 @@ steal('steal', 'steal/test', function( s ) {
load('steal/rhino/rhino.js');
steal('steal/build/packages',
function(){
- steal.build.packages('steal/build/packages/test/app.html')
+ load('steal/build/packages/test/packages_test/scripts/build.js')
+ s.test.open('steal/build/packages/test/packages_test/prod.html')
+ s.test.ok(typeof window.appA === "undefined");
+ s.test.clear();
+ s.test.open('steal/build/packages/test/packages_test/prod.html#a')
+ s.test.equals(window.appA, true);
// TODO change this test to actually open the app in packages mode instead of hardcoding the files
- var filesToCompare = [
- 'production.css',
+ var filesToRemove = [
'production.js',
- 'packages/accordion.js',
- 'packages/resize.js',
- 'packages/resize-accordion.js',
- 'packages/resize-accordion-table_scroll.js',
- 'packages/resize-table_scroll.js',
- 'packages/table_scroll.js',
- 'packages/table_scroll.css'
+ 'packages/app_a.js',
+ 'packages/app_b.js',
+ 'packages/app_c.js',
+ 'packages/app_d.js',
+ 'packages/app_a-app_b.js',
+ 'packages/app_a-app_b-app_c-app_d.js'
];
- s.test.clear();
- s.test.open('steal/build/packages/test/app.html');
- s.test.ok(window.Route)
- // TODO verify packages load when you click links
-
- // for(var i=0;i<filesToCompare.length; i++){
- // TODO verify each file exists
- // s.test.remove('steal/build/packages/test/'+filesToCompare[i])
- // }
+ var path;
+ for(var i=0;i<filesToRemove.length; i++){
+ path = 'steal/build/packages/test/packages_test/'+filesToRemove[i];
+ // print('checking '+path)
+ s.test.ok(s.File(path).exists())
+ s.test.remove(path)
+ }
s.test.clear();
});
View
6 build/packages/test/table_scroll.css
@@ -1,6 +0,0 @@
-.mxui_layout_table_scroll {
- border: solid 1px black;
-}
-th {
- background-image: url('../../css/test/upload.PNG');
-}
View
1  build/packages/test/table_scroll.js
@@ -1 +0,0 @@
-steal('canui/table_scroll','./table_scroll.css')
View
94 build/test/run.js
@@ -4,59 +4,58 @@
*/
// load('steal/build/pluginify/test/pluginify_test.js')
-load('steal/build/js/js_test.js')
-load('steal/build/open/test/open_test.js')
-load('steal/build/css/test/css_test.js')
-// TODO redo this test and get it working
+// load('steal/build/js/js_test.js')
+// load('steal/build/open/test/open_test.js')
+// load('steal/build/css/test/css_test.js')
// load('steal/build/packages/test/packages_test.js')
load('steal/rhino/rhino.js')
steal('steal', 'steal/test/test.js', function( s ) {
- STEALPRINT = false;
+ // STEALPRINT = false;
s.test.module("steal/build")
- // // s.test.test("steal.dev removes parens", function(){
- // // load('steal/rhino/rhino.js')
- // // var dev = readFile('steal/build/test/dev.js'),
- // // devCleaned = readFile('steal/build/test/devCleaned.js');
- // // steal("steal/build","steal/build/js").then(function(s2){
- // // var a = steal.build.js.clean("var bla;var foo;steal.dev.log('hi')")
- // // s.test.equals(a, "var bla;var foo;", "clean works")
- // // var b = steal.build.js.clean("var bla;steal.dev.log('hi()');var foo;steal.dev.log('onetwo(bla())')")
- // // s.test.equals(b, "var bla;;var foo;", "clean works with parens")
- // // var c = steal.build.js.clean("var bla;steal.dev.warn('hi()');var foo;steal.dev.warn('onetwo(bla())')")
- // // s.test.equals(b, "var bla;;var foo;", "clean works with warn")
- // // var d = steal.build.js.clean(dev);
- // // s.test.equals(d, devCleaned, "clean really works")
- // // });
- // // s.test.clear();
- // // })
-//
- // // s.test.test("less packages correctly", function(){
- // // load('steal/rhino/rhino.js')
- // // steal('steal', "steal/build","steal/build/js","steal/build/css", "steal/build/apps", function(s2){
- // // s2.build("steal/build/test/styles/styles.html", {
- // // to: 'steal/build/test/styles'
- // // })
- // // });
- // // // will throw an error if its not working
- // // AFTERLESS = false;
- // // s.test.open('steal/build/test/styles/prod.html');
- // // s.test.equals(document.getElementsByTagName("link").length, 1, "there is one css in the page")
- // // s.test.equals(document.getElementsByTagName("link")[0].href.indexOf("production.css") != -1, true, "its the production.css")
- // // s.test.equals(AFTERLESS, true, "the callback function runs")
-// //
- // // // this page tests putting link in the head
- // // AFTERLESS = false;
- // // s.test.open('steal/build/test/styles/prod2.html');
- // // s.test.equals(document.getElementsByTagName("link").length, 1, "there is one css in the page")
- // // s.test.equals(document.getElementsByTagName("link")[0].href.indexOf("production.css") != -1, true, "its the production.css")
- // // s.test.equals(AFTERLESS, true, "the callback function runs")
- // // s.test.clear();
- // // s.test.remove('steal/build/test/styles/production.js')
- // // s.test.remove('steal/build/test/styles/production.css')
-// //
- // // });
+ s.test.test("steal.dev removes parens", function(){
+ load('steal/rhino/rhino.js')
+ var dev = readFile('steal/build/test/dev.js'),
+ devCleaned = readFile('steal/build/test/devCleaned.js');
+ steal("steal/build","steal/build/js").then(function(s2){
+ var a = steal.build.js.clean("var bla;var foo;steal.dev.log('hi')")
+ s.test.equals(a, "var bla;var foo;", "clean works")
+ var b = steal.build.js.clean("var bla;steal.dev.log('hi()');var foo;steal.dev.log('onetwo(bla())')")
+ s.test.equals(b, "var bla;;var foo;", "clean works with parens")
+ var c = steal.build.js.clean("var bla;steal.dev.warn('hi()');var foo;steal.dev.warn('onetwo(bla())')")
+ s.test.equals(b, "var bla;;var foo;", "clean works with warn")
+ var d = steal.build.js.clean(dev);
+ s.test.equals(d, devCleaned, "clean really works")
+ });
+ s.test.clear();
+ })
+
+ // s.test.test("less packages correctly", function(){
+ // load('steal/rhino/rhino.js')
+ // steal('steal', "steal/build","steal/build/js","steal/build/css", "steal/build/apps", function(s2){
+ // s2.build("steal/build/test/styles/styles.html", {
+ // to: 'steal/build/test/styles'
+ // })
+ // });
+ // // will throw an error if its not working
+ // AFTERLESS = false;
+ // s.test.open('steal/build/test/styles/prod.html');
+ // s.test.equals(document.getElementsByTagName("link").length, 1, "there is one css in the page")
+ // s.test.equals(document.getElementsByTagName("link")[0].href.indexOf("production.css") != -1, true, "its the production.css")
+ // s.test.equals(AFTERLESS, true, "the callback function runs")
+//
+ // // this page tests putting link in the head
+ // AFTERLESS = false;
+ // s.test.open('steal/build/test/styles/prod2.html');
+ // s.test.equals(document.getElementsByTagName("link").length, 1, "there is one css in the page")
+ // s.test.equals(document.getElementsByTagName("link")[0].href.indexOf("production.css") != -1, true, "its the production.css")
+ // s.test.equals(AFTERLESS, true, "the callback function runs")
+ // s.test.clear();
+ // s.test.remove('steal/build/test/styles/production.js')
+ // s.test.remove('steal/build/test/styles/production.css')
+//
+ // });
s.test.test("open", function(){
load('steal/rhino/rhino.js')
@@ -65,7 +64,6 @@ steal('steal', 'steal/test/test.js', function( s ) {
newSteal.build.open("steal/build/test/stealpage.html", {}, function(scripts){
scripts.each('js', function(options, stl){
count++;
- print(options.buildType, options.id, options.text.length)
// s.test.equals(options.text.length > 1, true, "No content from "+options.id)
})
})
View
7 steal.js
@@ -1168,9 +1168,9 @@
}
// make a steal object
var stel = Resource.make(item);
- if ( packHash[stel.options.rootSrc] && stel.options.type !== 'fn' ) { // if we are production, and this is a package, mark as loading, but steal package?
- steal.has(stel.options.rootSrc);
- stel = Resource.make(packHash[stel.options.rootSrc]);
+ if ( packHash[stel.options.id] && stel.options.type !== 'fn' ) { // if we are production, and this is a package, mark as loading, but steal package?
+ steal.has(""+stel.options.id);
+ stel = Resource.make(packHash[""+stel.options.id]);
}
// has to happen before 'needs' for when reversed...
stealInstances.push(stel);
@@ -1248,6 +1248,7 @@
this.loaded.resolve();
},
execute: function() {
+ debugger;

Whoops!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
var self = this;
if (!self.loaded.isResolved() ) {
self.loaded.resolve();
Please sign in to comment.
Something went wrong with that request. Please try again.