Skip to content

Commit

Permalink
update so build_fragment is a plugin and AMD tests work with latest c…
Browse files Browse the repository at this point in the history
…an-simple-dom
  • Loading branch information
justinbmeyer committed May 26, 2015
1 parent b1e5a1a commit 62e2722
Show file tree
Hide file tree
Showing 41 changed files with 83 additions and 36 deletions.
33 changes: 17 additions & 16 deletions build/config_stealPluginify.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ var allModuleNames = _.map(modules,function(mod){
return mod.moduleName;
}),
coreModules = _.map(_.filter(modules, "isDefault"),"moduleName"),
config = path.join(__dirname,"..","package.json!npm");
config = path.join(__dirname,"..","package.json!npm"),
makeSystemConfig = function(options){
return _.extend({
config: config,
buildForClient: true
}, options);
};

var canNormalize = function(name, depLoad, curName){
if( depLoad.address.indexOf("node_modules") >= 0 ) {
Expand All @@ -31,13 +37,12 @@ var npmify = function(moduleName){
var makeStandaloneAndStealUtil = function(lib){
var libUtilName = "util/"+lib+"/"+lib+".js";
var configuration = {
system: {
config: config,
system: makeSystemConfig({
main: coreModules,
paths: {
"can/util/util": libUtilName
}
},
}),
options : {
//verbose: true
},
Expand Down Expand Up @@ -81,10 +86,9 @@ var pkg = require('../package.json');
var makeAmdUtil = function(lib){
var moduleName = "can/util/"+lib+"/"+lib;
return {
system: {
config: config,
system: makeSystemConfig({
main: moduleName
},
}),
options : {
//quiet: true
},
Expand Down Expand Up @@ -120,10 +124,9 @@ var testModules = modules.filter(function(mod){
module.exports = function(){
return {
"tests": {
system: {
system: makeSystemConfig({
main: testModules,
config: config
},
}),
options : {
//verbose: true
},
Expand All @@ -145,10 +148,9 @@ module.exports = function(){
},
// standalone & steal - plugins, jquery core, and jquery steal
"cjs-jquery": {
system: {
config: config,
system: makeSystemConfig({
main: allModuleNames.concat(['can'])
},
}),
options : {
//verbose: true
},
Expand Down Expand Up @@ -246,13 +248,12 @@ module.exports = function(){
"standalone & steal - core & utils - zepto": makeStandaloneAndStealUtil("zepto"),
"standalone & steal - core & utils - mootools": makeStandaloneAndStealUtil("mootools"),
"amd": {
system: {
config: config,
system: makeSystemConfig({
main: allModuleNames.concat(["can"]),
map: {
"can/util/util" : "can/util/library"
}
},
}),
options : {
quiet: true
},
Expand Down
5 changes: 5 additions & 0 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@
"type": "plugin",
"hidden": true,
"hasTest": false
},
"can/util/vdom/build_fragment/build_fragment": {
"name": "can.util.vdom.buildFragment",
"type": "plugin",
"hidden": true
}
},
"types": {
Expand Down
6 changes: 3 additions & 3 deletions component/component_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
steal("can-simple-dom", "can/util/vdom/build_fragment.js","can", "can/map/define", "can/component", "can/view/stache" ,"can/route", "steal-qunit", function (simpleDom) {
steal("can-simple-dom", "can/util/vdom/build_fragment","can", "can/map/define", "can/component", "can/view/stache" ,"can/route", "steal-qunit", function () {

var simpleDocument = new simpleDom.Document();
var simpleDocument = new SimpleDOM.Document();

var serializer = new simpleDom.HTMLSerializer(simpleDom.voidMap);
var serializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);

var innerHTML = function(node){
if("innerHTML" in node) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"./view/mustache/system": "./dist/cjs/view/mustache/system",
"./view/ejs/system": "./dist/cjs/view/ejs/system",
"./util/event": "./dist/cjs/util/event",
"./map/sort/sort": "./dist/cjs/map/sort/sort"
"./map/sort/sort": "./dist/cjs/map/sort/sort",
"./util/vdom/build_fragment/build_fragment": "./dist/cjs/util/vdom/build_fragment/build_fragment"
}
}
2 changes: 1 addition & 1 deletion system-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var MySystem = require('@loader');

if(MySystem.env === "development" && typeof window === "undefined") {
if(MySystem.env === "development" && typeof window === "undefined" && !MySystem.buildForClient) {
exports.systemConfig = {
meta: {
'jquery': {
Expand Down
6 changes: 4 additions & 2 deletions test/amd/dojo.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ <h2 id="qunit-userAgent"></h2>
"baseUrl": "../..",
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo"
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom"
},
"map": {
"*": {
Expand All @@ -53,7 +54,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
4 changes: 3 additions & 1 deletion test/amd/jquery-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2 id="qunit-userAgent"></h2>
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom",
"jquery": "bower_components/jquery/dist/jquery"
},
"map": {
Expand All @@ -55,7 +56,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
4 changes: 3 additions & 1 deletion test/amd/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2 id="qunit-userAgent"></h2>
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom",
"jquery": "node_modules/jquery/dist/jquery"
},
"map": {
Expand All @@ -55,7 +56,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
4 changes: 3 additions & 1 deletion test/amd/mootools.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2 id="qunit-userAgent"></h2>
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom",
"mootools": "bower_components/mootools/dist/mootools-core"
},
"map": {
Expand All @@ -54,7 +55,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
4 changes: 3 additions & 1 deletion test/amd/yui.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2 id="qunit-userAgent"></h2>
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom",
"yui": "util/yui/yui-3.7.3"
},
"map": {
Expand All @@ -54,7 +55,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
4 changes: 3 additions & 1 deletion test/amd/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h2 id="qunit-userAgent"></h2>
"paths": {
"can": "dist/amd/can",
"dojo": "bower_components/dojo",
"simple-dom": "node_modules/can-simple-dom/dist/amd/simple-dom",
"zepto": "bower_components/zepto/zepto"
},
"map": {
Expand All @@ -54,7 +55,8 @@ <h2 id="qunit-userAgent"></h2>
"can/util/fixture", "can/view/bindings",
"can/view/live", "can/view/scope",
"can/util/tests", "can/util/object",
"can/util/function", "can/view/autorender"
"can/util/function", "can/view/autorender",
"can/util/vdom/build_fragment"
]), function() {
require(["test/pluginified/latest"], function() {
QUnit.start();
Expand Down
1 change: 1 addition & 0 deletions test/compatibility/dojo.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/compatibility/jquery-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/compatibility/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/compatibility/mootools.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/compatibility/yui.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/compatibility/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>

<script type="text/javascript" src="test/pluginified/2.0.5.test.js"></script>

Expand Down
1 change: 1 addition & 0 deletions test/dev/dojo.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dev/jquery-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dev/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dev/mootools.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dev/yui.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dev/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/dojo.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/jquery-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/mootools.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/yui.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dist/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
<script type="text/javascript" src="dist/can.object.js"></script>
<script type="text/javascript" src="dist/can.util.function.js"></script>
<script type="text/javascript" src="dist/can.autorender.js"></script>
<script type="text/javascript" src="dist/can.util.vdom.buildfragment.js"></script>
<script type="text/javascript" src="test/pluginified/latest.js"></script>

<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions test/dojo.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"can/util/object/object_test.js",
"can/util/function/function_test.js",
"can/view/autorender/autorender_test.js",
"can/util/vdom/build_fragment/build_fragment_test.js",
function() {
can.dev.logLevel = 3;
});
Expand Down
1 change: 1 addition & 0 deletions test/jquery-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"can/util/object/object_test.js",
"can/util/function/function_test.js",
"can/view/autorender/autorender_test.js",
"can/util/vdom/build_fragment/build_fragment_test.js",
function() {
can.dev.logLevel = 3;
});
Expand Down
Loading

0 comments on commit 62e2722

Please sign in to comment.