Permalink
Browse files

Release 0.1.2

  • Loading branch information...
1 parent 7bfa600 commit a9eca21a6410feb6664f3251c26382da0ebb59a9 @DAddYE committed Feb 27, 2012
View
20 LICENCE
@@ -1,20 +0,0 @@
-Copyright (C) 2011 Tim Oxley
-
-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
@@ -1,2 +1,4 @@
all:
- echo '#!/usr/bin/env node \n' > ./bin/stitchup && coffee -p ./src/stitchup.coffee >> ./bin/stitchup && chmod 755 ./bin/stitchup
+ mkdir -p ./bin
+ echo "#!/usr/bin/env node" > ./bin/stitchme
+ coffee -p ./src/stitchme.coffee >> ./bin/stitchme && chmod 755 ./bin/stitchme
View
@@ -1,59 +0,0 @@
-# Browser-side require(), minifier & packager for CommonJS modules
-
-Easily use Javascript & Coffeescript CommonJS modules in the browser using this handy commandline tool, even for non-NodeJS projects.
-
-A directory of [CommonJS modules](http://wiki.commonjs.org/wiki/Modules/1.0) is minified into a single javascript file, and each module can be exposed on demand in the browser via synchronous `require()`.
-
-StitchUp wraps the amazing stitch library https://github.com/sstephenson/stitch Thanks heaps sstephenson.
-
-Minification is provided by the uglify library https://github.com/mishoo/UglifyJS/
-
-## Installation
- $ npm install -g stitchup
-
-## Usage
-
-### Stitch up CommonJS modules located in `app` to `public/bundle.js`
- $ stitchup -o public/bundle.js app
-
-### Compile in development (uncompressed) mode
- $ stitchup -o public/bundle.js -m DEVELOPMENT app
-
-### Load modules via synchronous require()
-
- # Stitch up modules in the ./app directory as ./public/bundle.js:
- $ stitchup -o ./public/bundle.js ./app
-
- # Load the bundle on your website:
- <script src="/bundle.js"></script>
- <script>
- $(function() {
- var app = require('controllers/app');
- app.init();
- })
- </script>
-
- # Use require() to reference modules from modules:
- module.exports = {
- init: function() {
- var myCar = require('models/cars');
- myCar.drive();
- }
- }
-
-### Run the provided example:
- $ git clone git://github.com/secoif/StitchUp.git
- Cloning into StitchUp...
- $ cd StitchUp
- $ cd example
- $ stitchup -o ./public/app.js ./app
- Compiled ./public/app.js.
- $ cd public/
- $ python -m "SimpleHTTPServer"
- Serving HTTP on 0.0.0.0 port 8000 ...
- Navigate to 0.0.0.0:8000 via your web browser and you should see that stitchup is working
-
-## Future
-
- * Ability to `watch` a directory and automatically recompile
-
View
@@ -0,0 +1,67 @@
+# Browser-side require() for CommonJS modules
+
+Easily use Javascript & Coffeescript CommonJS modules in the browser using this handy commandline tool, even for non-NodeJS projects.
+
+A directory of [CommonJS modules](http://wiki.commonjs.org/wiki/Modules/1.0) is minified into a single javascript file,
+and each module can be exposed on demand in the browser via synchronous `require()`.
+
+Stitchme wraps the amazing stitch library https://github.com/sstephenson/stitch.
+
+Thanks heaps @sstephenson.
+Thanks hepas @timoxley (original author).
+
+
+## Installation
+ $ npm install -g stitchme
+
+## Usage
+
+#### Stitch up CommonJS modules located in `app` to `public/bundle.js`
+
+ $ stitchme -o public/bundle.js app
+
+#### Compile in development (uncompressed) mode
+
+ $ stitchme -o public/bundle.js -m DEVELOPMENT
+
+### Load modules via synchronous require()
+
+ # Stitch up modules in the ./app directory as ./public/bundle.js:
+ $ stitchme -o ./public/bundle.js ./app
+
+ # Load the bundle on your website:
+ <script src="/bundle.js"></script>
+ <script>
+ $(function() {
+ var app = require('controllers/app');
+ app.init();
+ })
+ </script>
+
+ # Use require() to reference modules from modules:
+ module.exports = {
+ init: function() {
+ var myCar = require('models/cars');
+ myCar.drive();
+ }
+ }
+
+## About me
+
+DAddYE, you can follow me on twitter [@daddye](http://twitter.com/daddye) or take a look at my site [daddye.it](http://www.daddye.it)
+
+## Copyright
+
+Copyright (C) 2011 Davide D'Agostino - [@daddye](http://twitter.com/daddye)
+
+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 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.
@@ -1,5 +1,4 @@
-#!/usr/bin/env node
-
+#!/usr/bin/env node
(function() {
var argv, assert, fs, mode, outfile, package, sources, stitch;
@@ -11,14 +10,10 @@
assert = require('assert');
- argv = require('optimist').usage('Usage: stitchup [-o OUTFILE] [-m MODE] SOURCES').wrap(80).option('outfile', {
+ argv = require('optimist').usage('Usage: stitchme [-o OUTFILE] SOURCES').wrap(80).option('outfile', {
alias: 'o',
desc: 'Write the stitched bundle to this file',
- "default": 'application.js'
- }).option('mode', {
- alias: 'm',
- desc: 'use DEVELOPMENT to compile uncompressed js',
- "default": 'PRODUCTION'
+ "default": 'app.js'
}).demand(1).argv;
mode = argv.mode;
@@ -27,24 +22,12 @@
sources = argv._;
- console.log(sources);
-
package = stitch.createPackage({
paths: sources
});
package.compile(function(err, source) {
- var ast, final_code, jsp, pro;
assert.ok(source, 'Invalid source file given.');
- if (mode !== "DEVELOPMENT") {
- jsp = require("uglify-js").parser;
- pro = require("uglify-js").uglify;
- ast = jsp.parse(source);
- ast = pro.ast_mangle(ast);
- ast = pro.ast_squeeze(ast);
- final_code = pro.gen_code(ast);
- source = final_code;
- }
return fs.writeFile(outfile, source, function(err) {
if (err) throw err;
return console.log('Compiled ' + outfile + '.');
@@ -1,15 +0,0 @@
-/*
- File: example/app/app.controller.js
- This file is require()'d by script on the destination page
-*/
-module.exports = {
- init: function() {
- var stitchedModel = require('awesome.model');
- console.log('loaded model...');
- if (stitchedModel.is_working) {
- $('#status').html('working')
- console.log('model appears to be working!');
- console.log(stitchedModel);
- }
- }
-}
@@ -1,9 +0,0 @@
-/*
- File: example/app/awesome.model.js
-*/
-module.exports = {
- awesome: 'yes',
- is_working: function() {
- return this.awesome == 'yes';
- }
-}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>StitchUp Demo</title>
- <script src="/app.js"></script>
- <script src="/jquery.js"></script>
- <style>
- body {
- background: #FDF2E8;
- }
- #content {
- width: 300px;
- margin: 300px auto;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 32px;
- text-align: left;
- color: #CA9E99;
-
- font-weight: bold;
- letter-spacing: -1px;
- }
- h2 {
- margin: 0;
- }
- #status {
- text-align: right;
- color: #CA9E99;
- text-transform: uppercase;
- }
- </style>
- <script>
- $(function() {
- var app = require('app.controller');
- app.init();
- })
- </script>
-</head>
-<body>
- <div id="content">
- <h2>StitchUp is&hellip; </h2>
- <h2 id="status">Borken :(</h2>
- </div>
-<body>
-</html>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,22 +1,20 @@
{
- "name": "stitchup",
- "description": "Use stitch from the commandline. Minify your JS and get browser-side require().",
+ "name": "stitchme",
+ "description": "Use stitch from the command-line and get browser-side require()",
"contributors": [
"Tim Oxley"
],
- "version": "0.1.7",
- "main": "./bin/stitchup",
+ "version": "0.1.2",
"repository": {
"type": "git",
- "url": "git@github.com:timoxley/stitchup.git"
+ "url": "git@git.github.com:daddye/stitchme.git"
},
"bin": {
- "stitchup": "./lib/stitchup.js"
+ "stitchme": "./bin/stitchme"
},
"dependencies": {
- "stitch": "~0.3.3",
- "uglify-js": "~1.2.5",
- "optimist": "~0.3.1"
+ "stitch": ">=0.3.3",
+ "optimist": ">=0.3.1"
},
"preferGlobal": "true",
"devDependencies": {
@@ -26,9 +24,6 @@
"engines": {
"node": "*"
},
- "author": "Tim Oxley <secoif@gmail.com> (unit.io)",
- "homepage": "https://github.com/timoxley/stitchup",
- "scripts": {
- "test": "mocha test/*.coffee"
- }
+ "author": "DAddYE <d.dagostino@lipsiasoft.com> (daddye.it)",
+ "homepage": "https://github.com/daddye/stitchme"
}
View
@@ -0,0 +1,29 @@
+argv = process.argv.slice(2)
+stitch = require('stitch')
+fs = require('fs')
+assert = require('assert')
+
+argv = require('optimist')
+ .usage('Usage: stitchme [-o OUTFILE] SOURCES')
+ .wrap(80)
+ .option('outfile',
+ alias: 'o'
+ desc: 'Write the stitched bundle to this file'
+ default: 'app.js'
+ )
+ .demand(1)
+ .argv
+
+mode = argv.mode
+outfile = argv.outfile
+sources = argv._
+
+package = stitch.createPackage
+ paths: sources
+
+package.compile (err, source) ->
+ assert.ok(source, 'Invalid source file given.')
+
+ fs.writeFile outfile, source, (err) ->
+ throw err if err
+ console.log 'Compiled ' + outfile + '.'
Oops, something went wrong.

0 comments on commit a9eca21

Please sign in to comment.