Skip to content
Browse files

Improveed browserification

  • Loading branch information...
1 parent ddab670 commit 19f02b072acd8c9e84207760e70c5dcc2762c91f @ixti ixti committed
Showing with 136 additions and 12 deletions.
  1. +22 −0 .browserify/00_license
  2. +2 −0 .browserify/40_before
  3. +1 −0 .browserify/50_js-yaml.js
  4. +9 −0 .browserify/60_after
  5. +1 −0 .npmignore
  6. +10 −7 Makefile
  7. +2 −2 demo/js/demo.js
  8. +33 −0 demo/js/js-yaml.js
  9. +33 −0 js-yaml.js
  10. +23 −3 js-yaml.min.js
View
22 .browserify/00_license
@@ -0,0 +1,22 @@
+/*!
+ * Copyright (C) 2011 by Vitaly Puzrin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
View
2 .browserify/40_before
@@ -0,0 +1,2 @@
+;var jsyaml = (function () {
+ var __jsyaml__ = (function () {
View
1 .browserify/50_js-yaml.js
@@ -0,0 +1 @@
+/* this is a stub and will be replaced during browserification */
View
9 .browserify/60_after
@@ -0,0 +1,9 @@
+ return require('/lib/js-yaml');
+ }());
+
+ if ('function' === typeof define && define.amd) {
+ define('jsyaml', [], function () { return __jsyaml__; }, 'jsyaml');
+ }
+
+ return __jsyaml__;
+}());
View
1 .npmignore
@@ -1,2 +1,3 @@
/src/
/test/unported/
+/.browserify/
View
17 Makefile
@@ -12,20 +12,20 @@ REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)
test: test-functional test-issues
-test-issues:
+test-functional:
echo
- echo "## ISSUES ######################################################################"
+ echo "## FUNCTIONAL ##################################################################"
echo "################################################################################"
echo
- node ./test/issues/run.js
+ node ./test/functional/run.js
echo
-test-functional:
+test-issues:
echo
- echo "## FUNCTIONAL ##################################################################"
+ echo "## ISSUES ######################################################################"
echo "################################################################################"
echo
- node ./test/functional/run.js
+ node ./test/issues/run.js
echo
@@ -33,7 +33,10 @@ build: browserify uglify
browserify:
if test ! `which browserify` ; then npm install browserify ; fi
- browserify index.js -o js-yaml.js
+ cp -r .browserify/ ${TMP_DIR}
+ browserify index.js -o ${TMP_DIR}/50_js-yaml.js
+ cat ${TMP_DIR}/* > js-yaml.js
+ rm -rf ${TMP_DIR}
cp js-yaml.js demo/js/
uglify:
View
4 demo/js/demo.js
@@ -1,6 +1,6 @@
window.runDemo = function runDemo() {
- var jsyaml = require('/lib/js-yaml'), source, result, initial, permalink,
- timer1, timer2 = null, hash = location.hash.toString();
+ var source, result, initial, permalink, timer1, timer2 = null,
+ hash = location.hash.toString();
function parse() {
var str;
View
33 demo/js/js-yaml.js
@@ -1,3 +1,27 @@
+/*!
+ * Copyright (C) 2011 by Vitaly Puzrin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+;var jsyaml = (function () {
+ var __jsyaml__ = (function () {
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
var mod = require.modules[resolved];
@@ -5073,3 +5097,12 @@ require.define("/index.js", function (require, module, exports, __dirname, __fil
});
require("/index.js");
+ return require('/lib/js-yaml');
+ }());
+
+ if ('function' === typeof define && define.amd) {
+ define('jsyaml', [], function () { return __jsyaml__; }, 'jsyaml');
+ }
+
+ return __jsyaml__;
+}());
View
33 js-yaml.js
@@ -1,3 +1,27 @@
+/*!
+ * Copyright (C) 2011 by Vitaly Puzrin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+;var jsyaml = (function () {
+ var __jsyaml__ = (function () {
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
var mod = require.modules[resolved];
@@ -5073,3 +5097,12 @@ require.define("/index.js", function (require, module, exports, __dirname, __fil
});
require("/index.js");
+ return require('/lib/js-yaml');
+ }());
+
+ if ('function' === typeof define && define.amd) {
+ define('jsyaml', [], function () { return __jsyaml__; }, 'jsyaml');
+ }
+
+ return __jsyaml__;
+}());
View
26 js-yaml.min.js
23 additions, 3 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 19f02b0

Please sign in to comment.
Something went wrong with that request. Please try again.