jazz-jss 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/dist/handlebars/handlebars.js +1493 -0
- data/dist/hashchange/{jquery.ba-hashchange.js → hashchange.js} +0 -0
- data/dist/jazz/lib/controller.js +1 -1
- data/dist/jazz/lib/core.js +3 -0
- data/dist/jazz/lib/db.js +1 -1
- data/dist/jazz/lib/helper.js +2 -1
- data/dist/jazz/lib/model.js +11 -4
- data/dist/jazz/lib/view.js +1 -1
- data/dist/jazz/module.js +15 -0
- data/dist/jquery/jquery.js +0 -0
- data/dist/require/require.js +0 -0
- data/dist/require/template.js +98 -0
- data/dist/underscore/underscore.js +0 -0
- data/lib/jazz/app_detector.rb +6 -3
- data/lib/jazz/app_generator.rb +12 -8
- data/lib/jazz/helper_generator.rb +30 -0
- data/lib/jazz/scaffold_generator.rb +4 -0
- data/templates/app_root/Rakefile +11 -0
- data/templates/app_root/{app → development/app}/assets/javascripts/application.js +0 -0
- data/templates/app_root/{app → development/app}/assets/stylesheets/application.css +0 -0
- data/templates/app_root/development/app/controllers/application_controller.js +11 -0
- data/templates/app_root/development/app/helpers/application_helper.js +7 -0
- data/templates/app_root/development/config/glue.js +9 -0
- data/templates/app_root/development/config/routes.js +5 -0
- data/templates/app_root/scripts/build.js +30 -0
- data/templates/app_root/scripts/r.js/LICENSE +58 -0
- data/templates/app_root/scripts/r.js/README.md +177 -0
- data/templates/app_root/scripts/r.js/build/build.js +26 -0
- data/templates/app_root/scripts/r.js/build/buildebug.sh +4 -0
- data/templates/app_root/scripts/r.js/build/example.build.js +296 -0
- data/templates/app_root/scripts/r.js/build/jslib/blank.js +4 -0
- data/templates/app_root/scripts/r.js/build/jslib/build.js +952 -0
- data/templates/app_root/scripts/r.js/build/jslib/commandLine.js +23 -0
- data/templates/app_root/scripts/r.js/build/jslib/commonJs.js +152 -0
- data/templates/app_root/scripts/r.js/build/jslib/env.js +47 -0
- data/templates/app_root/scripts/r.js/build/jslib/lang.js +49 -0
- data/templates/app_root/scripts/r.js/build/jslib/logger.js +58 -0
- data/templates/app_root/scripts/r.js/build/jslib/node.js +106 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/args.js +20 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/file.js +263 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/load.js +17 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/optimize.js +10 -0
- data/templates/app_root/scripts/r.js/build/jslib/node/print.js +16 -0
- data/templates/app_root/scripts/r.js/build/jslib/optimize.js +279 -0
- data/templates/app_root/scripts/r.js/build/jslib/opto.build.js +11 -0
- data/templates/app_root/scripts/r.js/build/jslib/parse.js +590 -0
- data/templates/app_root/scripts/r.js/build/jslib/pragma.js +251 -0
- data/templates/app_root/scripts/r.js/build/jslib/requirePatch.js +286 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino.js +22 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/args.js +21 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/file.js +244 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/load.js +12 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/optimize.js +100 -0
- data/templates/app_root/scripts/r.js/build/jslib/rhino/print.js +12 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/README.md +16 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/index.js +21 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/parse-js.js +1342 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/process.js +2005 -0
- data/templates/app_root/scripts/r.js/build/jslib/uglifyjs/squeeze-more.js +55 -0
- data/templates/app_root/scripts/r.js/build/jslib/x.js +243 -0
- data/templates/app_root/scripts/r.js/build/tests/all.js +47 -0
- data/templates/app_root/scripts/r.js/build/tests/allj.sh +3 -0
- data/templates/app_root/scripts/r.js/build/tests/alln.sh +18 -0
- data/templates/app_root/scripts/r.js/build/tests/anonSimple.build.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/buildUtils.js +19 -0
- data/templates/app_root/scripts/r.js/build/tests/builds.js +489 -0
- data/templates/app_root/scripts/r.js/build/tests/circular.build.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/convert.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/css.build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/css/common/common.css +4 -0
- data/templates/app_root/scripts/r.js/build/tests/css/master.css +10 -0
- data/templates/app_root/scripts/r.js/build/tests/css/sub/sub1.css +7 -0
- data/templates/app_root/scripts/r.js/build/tests/cssTestCompare.css +13 -0
- data/templates/app_root/scripts/r.js/build/tests/end.frag +3 -0
- data/templates/app_root/scripts/r.js/build/tests/expected/unoExcludeShallow.js +23 -0
- data/templates/app_root/scripts/r.js/build/tests/exports.build.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.build.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/hasTestModule.js +30 -0
- data/templates/app_root/scripts/r.js/build/tests/http/httpBuild.js +70 -0
- data/templates/app_root/scripts/r.js/build/tests/http/main.html +28 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/main.js +18 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/one.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/three.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/http/scripts/two.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/i18n.build.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/indexBuilder.build.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/a.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/b.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/c.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/d.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/expected.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/LICENSE +58 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/amdefine.js +188 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/amdefine/node_modules/amdefine/package.json +21 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/bang.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/expected.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/comments/license.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/app.build.js +15 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main-expected.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/dotpackage/scripts/main.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/build.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/expected.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/main.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub1.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/empty/sub2.js +1 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/expected.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nameInsertion/main.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/build.js +8 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/expected.js +47 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/main.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/four.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/one.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/three.js +14 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/namespace/modules/two.js +5 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/a.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/b.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/buildWithCE.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/c.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/d.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/e.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-built.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/expected-builtWithCE.js +42 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/main.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nested/top.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/a.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/b.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedAll.js +9 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedB.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedC.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNeedD.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/buildNested.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/c.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/d.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-built.js +21 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedAll.js +31 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedB.js +24 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedC.js +24 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNeedD.js +25 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/expected-builtNested.js +31 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/nestedHas/main.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/build.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/converter.js +11 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/main.js +6 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/plug.js +29 -0
- data/templates/app_root/scripts/r.js/build/tests/lib/plugins/util.js +7 -0
- data/templates/app_root/scripts/r.js/build/tests/nameOnly.build.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeAll.js +3 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimize.js +12 -0
- data/templates/app_root/scripts/r.js/build/tests/nodeOptimizeNoCallback.js +10 -0
- data/templates/app_root/scripts/r.js/build/tests/order.build.js +16 -0
- data/templates/app_root/scripts/r.js/build/tests/override/override.js +36 -0
- data/templates/app_root/scripts/r.js/build/tests/packages.build.js +59 -0
- data/templates/app_root/scripts/r.js/build/tests/parse.js +103 -0
- data/templates/app_root/scripts/r.js/build/tests/simple.build.js +13 -0
- data/templates/app_root/scripts/r.js/build/tests/simpleNamespace.build.js +17 -0
- data/templates/app_root/scripts/r.js/build/tests/start.frag +4 -0
- data/templates/app_root/scripts/r.js/build/tests/text.build.js +16 -0
- data/templates/app_root/scripts/r.js/build/tests/textExclude.build.js +16 -0
- data/templates/app_root/scripts/r.js/dist.js +95 -0
- data/templates/app_root/scripts/r.js/dist/README.md +6 -0
- data/templates/app_root/scripts/r.js/dist/r-1.0.0.js +9042 -0
- data/templates/app_root/scripts/r.js/dist/r-edge.js +9191 -0
- data/templates/app_root/scripts/r.js/dist/r.js +9099 -0
- data/templates/app_root/scripts/r.js/lib/closure/COPYING +202 -0
- data/templates/app_root/scripts/r.js/lib/closure/README +292 -0
- data/templates/app_root/scripts/r.js/lib/closure/compiler.jar +0 -0
- data/templates/app_root/scripts/r.js/lib/rhino/LICENSE +4 -0
- data/templates/app_root/scripts/r.js/lib/rhino/js.jar +0 -0
- data/templates/app_root/scripts/r.js/require.js +1952 -0
- data/templates/app_root/scripts/r.js/tasks.txt +2 -0
- data/templates/app_root/scripts/r.js/tests/all.js +49 -0
- data/templates/app_root/scripts/r.js/tests/allNode.js +3 -0
- data/templates/app_root/scripts/r.js/tests/allj.sh +1 -0
- data/templates/app_root/scripts/r.js/tests/alln.sh +2 -0
- data/templates/app_root/scripts/r.js/tests/alpha.js +3 -0
- data/templates/app_root/scripts/r.js/tests/beta.js +6 -0
- data/templates/app_root/scripts/r.js/tests/doh/LICENSE +195 -0
- data/templates/app_root/scripts/r.js/tests/doh/README +12 -0
- data/templates/app_root/scripts/r.js/tests/doh/_browserRunner.js +855 -0
- data/templates/app_root/scripts/r.js/tests/doh/_nodeRunner.js +20 -0
- data/templates/app_root/scripts/r.js/tests/doh/_rhinoRunner.js +17 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/LICENSE +10 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/doh.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/dohaaa.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/_sounds/woohoo.wav +0 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.html +316 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.js +1499 -0
- data/templates/app_root/scripts/r.js/tests/doh/runner.sh +3 -0
- data/templates/app_root/scripts/r.js/tests/doh/small_logo.png +0 -0
- data/templates/app_root/scripts/r.js/tests/node/canvasTest.js +39 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/README.md +15 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/coffee/foo.coffee +1 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/main.js +13 -0
- data/templates/app_root/scripts/r.js/tests/node/embedded/scripts/bar.js +13 -0
- data/templates/app_root/scripts/r.js/tests/node/index.js +11 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/foo.js +6 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/alpha/hello.html +9 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/foo.js +3 -0
- data/templates/app_root/scripts/r.js/tests/node/tests/server.js +11 -0
- data/templates/app_root/scripts/r.js/tests/relative.js +10 -0
- data/templates/app_root/scripts/r.js/tests/sub/betaSub.js +3 -0
- data/templates/application.js +6 -5
- data/templates/boot.js +42 -0
- data/templates/helper.js +9 -0
- data/templates/index.html +1 -1
- metadata +201 -11
- data/dist/jazz/main.js +0 -65
- data/dist/mustache/mustache.js +0 -324
- data/templates/app_root/config/routes.js +0 -4
- data/templates/glue.js +0 -4
@@ -0,0 +1,18 @@
|
|
1
|
+
//A simple build file using the circular tests for requirejs
|
2
|
+
({
|
3
|
+
baseUrl: "../../../requirejs/tests",
|
4
|
+
optimize: "none",
|
5
|
+
dir: "builds/circular",
|
6
|
+
|
7
|
+
modules: [
|
8
|
+
{
|
9
|
+
name: "two"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: "funcTwo"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
name: "funcThree"
|
16
|
+
}
|
17
|
+
]
|
18
|
+
})
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*jslint plusplus: false, strict: false */
|
2
|
+
/*global doh: false, define: false */
|
3
|
+
|
4
|
+
define(['commonJs'], function (commonJs) {
|
5
|
+
doh.register(
|
6
|
+
"convert",
|
7
|
+
[
|
8
|
+
function commonJsConvert(t) {
|
9
|
+
var source1 = 'define("fake", {lol: "you guise"});',
|
10
|
+
source2 = 'define("fake", [],\nfunction(){\nreturn{lol : \'you guise\'};\n});';
|
11
|
+
|
12
|
+
t.is(source1, commonJs.convert('fake.js', source1));
|
13
|
+
t.is(source2, commonJs.convert('fake.js', source2));
|
14
|
+
}
|
15
|
+
]
|
16
|
+
);
|
17
|
+
doh.run();
|
18
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
define('tres',[],
|
3
|
+
function() {
|
4
|
+
return {
|
5
|
+
name: "tres"
|
6
|
+
};
|
7
|
+
}
|
8
|
+
);
|
9
|
+
|
10
|
+
define("uno",
|
11
|
+
["dos", "tres"],
|
12
|
+
function(dos, tres) {
|
13
|
+
return {
|
14
|
+
name: "uno",
|
15
|
+
doSomething: function() {
|
16
|
+
return {
|
17
|
+
dosName: dos.name,
|
18
|
+
tresName: tres.name
|
19
|
+
};
|
20
|
+
}
|
21
|
+
};
|
22
|
+
}
|
23
|
+
);
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/**
|
2
|
+
* Just a test module that tests has replacements. Not usable on its own.
|
3
|
+
*/
|
4
|
+
define(function (require) {
|
5
|
+
var foo, bar, baz, blurp, bat, blip;
|
6
|
+
|
7
|
+
if (has("aTrueValue")) {
|
8
|
+
foo = "is true";
|
9
|
+
} else {
|
10
|
+
foo = "is false";
|
11
|
+
}
|
12
|
+
|
13
|
+
if (has("aFalseValue")) {
|
14
|
+
bar = "is true";
|
15
|
+
} else {
|
16
|
+
bar = "is false";
|
17
|
+
}
|
18
|
+
|
19
|
+
if (has("some skipped value")) {
|
20
|
+
baz = "what";
|
21
|
+
} else {
|
22
|
+
baz = "ever";
|
23
|
+
}
|
24
|
+
|
25
|
+
blurp = has("aTrueValue") ? "OK" : "FAIL";
|
26
|
+
bat = has ('aFalseValue') ? "FAIL" : "OK";
|
27
|
+
blip = has("some skipped value") ? "what" : "ever";
|
28
|
+
|
29
|
+
return foo + bar + baz + blurp + bat + blip;
|
30
|
+
});
|
@@ -0,0 +1,70 @@
|
|
1
|
+
/*jslint strict: false*/
|
2
|
+
/*global require: false, console: false */
|
3
|
+
|
4
|
+
//If you install requirejs via npm, replace this line with require('requirejs')
|
5
|
+
var requirejs = require('../../../r.js'),
|
6
|
+
http = require('http'),
|
7
|
+
fs = require('fs'),
|
8
|
+
host = '127.0.0.1',
|
9
|
+
port = 4304,
|
10
|
+
config;
|
11
|
+
|
12
|
+
//Set up the config passed to the optimizer
|
13
|
+
config = {
|
14
|
+
baseUrl: 'scripts',
|
15
|
+
paths: {
|
16
|
+
//Put path to require.js in here, leaving off .js
|
17
|
+
//since it is a module ID path mapping. For final deployment,
|
18
|
+
//if a smaller AMD loader is desired, no dynamic
|
19
|
+
//loading needs to be done, and loader plugins are not
|
20
|
+
//in use, change this path to that file. One possibility
|
21
|
+
//could be the one at:
|
22
|
+
//https://github.com/ajaxorg/ace/blob/master/build_support/mini_require.js
|
23
|
+
requireLib: '../../../../../requirejs/require'
|
24
|
+
},
|
25
|
+
//Uncomment this line if uglify minification is not wanted.
|
26
|
+
//optimize: 'none',
|
27
|
+
//Specify the optimization target. Choose the requireLib,
|
28
|
+
//so that it is first in the output, then include the main.js
|
29
|
+
//for this project.
|
30
|
+
name: 'requireLib',
|
31
|
+
include: ['main'],
|
32
|
+
//Uncomment this if you want to debug three.js by itself
|
33
|
+
//excludeShallow: ['three'],
|
34
|
+
out: 'scripts/main-built.js'
|
35
|
+
};
|
36
|
+
|
37
|
+
function respond(res, code, contents) {
|
38
|
+
res.writeHead(code, {
|
39
|
+
'Content-Type': (code === 200 ? 'application/javascript;charset=UTF-8' : 'text/plain'),
|
40
|
+
'Content-Length': contents.length
|
41
|
+
});
|
42
|
+
|
43
|
+
res.write(contents, 'utf8');
|
44
|
+
res.end();
|
45
|
+
}
|
46
|
+
|
47
|
+
http.createServer(function (req, res) {
|
48
|
+
|
49
|
+
req.on('close', function (err) {
|
50
|
+
res.end();
|
51
|
+
});
|
52
|
+
|
53
|
+
req.on('end', function () {
|
54
|
+
//Does not matter what the request is,
|
55
|
+
//the answer is always OPTIMIZED JS!
|
56
|
+
try {
|
57
|
+
requirejs.optimize(config, function (buildResponse) {
|
58
|
+
//buildResponse is just a text output of the modules
|
59
|
+
//included. Load the built file for the contents.
|
60
|
+
var contents = fs.readFileSync(config.out, 'utf8');
|
61
|
+
respond(res, 200, contents);
|
62
|
+
});
|
63
|
+
} catch (e) {
|
64
|
+
respond(res, 500, e.toString());
|
65
|
+
}
|
66
|
+
});
|
67
|
+
|
68
|
+
}).listen(port, host);
|
69
|
+
|
70
|
+
console.log('Server running at http://' + host + ':' + port + '/');
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title></title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
<h1>One script via RequireJS optimizer</h1>
|
8
|
+
|
9
|
+
<p><strong>Be sure to start up the server: node httpBuild.js</strong></p>
|
10
|
+
|
11
|
+
<p>Demonstrates how to use the RequireJS optimizer to only load
|
12
|
+
one script in the page using Node as the server to serve the optimized
|
13
|
+
script. Using the "excludeShallow" build config option inside httpBuild.js
|
14
|
+
allows debugging one script separate from the rest of the optimized file.</p>
|
15
|
+
|
16
|
+
<p>See httpBuild.js in the same directory as this file for more information.</p>
|
17
|
+
|
18
|
+
<hr>
|
19
|
+
|
20
|
+
<!-- Successful load will print something after the hr tag -->
|
21
|
+
|
22
|
+
<!-- httpBuild.js will return optimized content no matter what the URL
|
23
|
+
is below. For deployment, replace this script tag to one that
|
24
|
+
loads main-built.js, or whatever the config.out name value is
|
25
|
+
inside httpBuild.js -->
|
26
|
+
<script src="http://127.0.0.1:4304/main.js"></script>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
//Set the baseUrl for scripts, for use
|
3
|
+
//if individually debuggin files via
|
4
|
+
//excludeShallow in httpBuild.js
|
5
|
+
require.config({
|
6
|
+
baseUrl: 'scripts'
|
7
|
+
});
|
8
|
+
|
9
|
+
require(['one', 'two'], function (one, two) {
|
10
|
+
var html = "<b>Success!</b> One's name is: " + one.name +
|
11
|
+
", two's name is: " + two.name +
|
12
|
+
", three's name is: " + two.threeName,
|
13
|
+
node = document.createElement('div');
|
14
|
+
|
15
|
+
node.innerHTML = html;
|
16
|
+
|
17
|
+
document.getElementsByTagName('body')[0].appendChild(node);
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
//A simple build file using the tests directory for requirejs
|
2
|
+
{
|
3
|
+
appDir: "../../../requirejs",
|
4
|
+
baseUrl: "tests/i18n",
|
5
|
+
inlineText: false,
|
6
|
+
dir: "builds/i18n",
|
7
|
+
locale: "en-us-surfer",
|
8
|
+
optimize: "none",
|
9
|
+
paths: {
|
10
|
+
"i18n": "../../i18n"
|
11
|
+
},
|
12
|
+
modules: [
|
13
|
+
{
|
14
|
+
name: "testModule"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
if(typeof define !== 'function'){
|
2
|
+
var define = (require('amdefine'))(module);
|
3
|
+
}
|
4
|
+
|
5
|
+
define(function (require) {
|
6
|
+
var b = require('./b'),
|
7
|
+
c = require('./c');
|
8
|
+
|
9
|
+
|
10
|
+
console.log('got b name: ' + b.name);
|
11
|
+
console.log('got c name: ' + c.name);
|
12
|
+
console.log('and I am a');
|
13
|
+
|
14
|
+
return {
|
15
|
+
name: 'a'
|
16
|
+
};
|
17
|
+
});
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
define('d',{
|
5
|
+
name: 'd'
|
6
|
+
});
|
7
|
+
|
8
|
+
|
9
|
+
define('b',['./d'], function (d) {
|
10
|
+
console.log('got d name: ' + d.name);
|
11
|
+
return {
|
12
|
+
name: 'b'
|
13
|
+
};
|
14
|
+
});
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
define('c',{
|
19
|
+
name: 'c'
|
20
|
+
});
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
define('a',['require','./b','./c'],function (require) {
|
25
|
+
var b = require('./b'),
|
26
|
+
c = require('./c');
|
27
|
+
|
28
|
+
|
29
|
+
console.log('got b name: ' + b.name);
|
30
|
+
console.log('got c name: ' + c.name);
|
31
|
+
console.log('and I am a');
|
32
|
+
|
33
|
+
return {
|
34
|
+
name: 'a'
|
35
|
+
};
|
36
|
+
});
|
@@ -0,0 +1,58 @@
|
|
1
|
+
amdefine is released under two licenses: new BSD, and MIT. You may pick the
|
2
|
+
license that best suits your development needs. The text of both licenses are
|
3
|
+
provided below.
|
4
|
+
|
5
|
+
|
6
|
+
The "New" BSD License:
|
7
|
+
----------------------
|
8
|
+
|
9
|
+
Copyright (c) 2011, The Dojo Foundation
|
10
|
+
All rights reserved.
|
11
|
+
|
12
|
+
Redistribution and use in source and binary forms, with or without
|
13
|
+
modification, are permitted provided that the following conditions are met:
|
14
|
+
|
15
|
+
* Redistributions of source code must retain the above copyright notice, this
|
16
|
+
list of conditions and the following disclaimer.
|
17
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
19
|
+
and/or other materials provided with the distribution.
|
20
|
+
* Neither the name of the Dojo Foundation nor the names of its contributors
|
21
|
+
may be used to endorse or promote products derived from this software
|
22
|
+
without specific prior written permission.
|
23
|
+
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
25
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
33
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
MIT License
|
38
|
+
-----------
|
39
|
+
|
40
|
+
Copyright (c) 2011, The Dojo Foundation
|
41
|
+
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
43
|
+
of this software and associated documentation files (the "Software"), to deal
|
44
|
+
in the Software without restriction, including without limitation the rights
|
45
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
46
|
+
copies of the Software, and to permit persons to whom the Software is
|
47
|
+
furnished to do so, subject to the following conditions:
|
48
|
+
|
49
|
+
The above copyright notice and this permission notice shall be included in
|
50
|
+
all copies or substantial portions of the Software.
|
51
|
+
|
52
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
53
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
54
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
55
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
56
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
57
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
58
|
+
THE SOFTWARE.
|