# HG changeset patch # User Matthew Wild # Date 1248559456 -3600 # Node ID 3d4ba37b15545ffed2a26d9444bb5264618bd50c # Parent aaf1b38007d8212d363bc163e726e2e88e40886f Add README and COPYRIGHT files diff -r aaf1b38007d8 -r 3d4ba37b1554 COPYRIGHT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/COPYRIGHT Sat Jul 25 23:04:16 2009 +0100 @@ -0,0 +1,22 @@ +Squish (C) 2009 Matthew Wild + +This project is licensed under the same MIT license as Lua 5.1. + +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. + diff -r aaf1b38007d8 -r 3d4ba37b1554 README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Sat Jul 25 23:04:16 2009 +0100 @@ -0,0 +1,80 @@ + +# Squish - One language to write them all, one squisher to squish them + +Squish is a simple script to build a single file out of multiple scripts, modules, and other files. + +For example if you have a script called A, and it requires modules X, Y and Z, all of them could be squished +into a single file, B. + +When run, Squish reads a file called 'squishy' in the current (or specified) directory, which contains +instructions on how to squish a project. + +For an example you can see Squish's own squishy file, included in this package. For reference, see below. + +## Squishing + +Running squish will search for a 'squishy' file in the current directory. Alternatively you can pass to squish +a directory to look in. + +Command-line options vary depending on what features squish has been built with. Below are the standard ones. + +### Minify +'Minification' is the act of condensing source code by stripping out spaces, line breaks, comments and anything +that isn't required to be there. Although the source code is re-organised and changed, the program is still the +same and runs without any changes. + +#### --no-minify +Disable minification of the output file after squishing. Default is to minify. + +#### --minify-level=level +The level may be one of: none, basic, default, full + +They vary in effectiveness, and the time taken to process large files. Experiment! + +### Uglify +'Uglification' is the name Squish gives to a certain basic form of compression. With large files it can reduce the +size by some kilobytes, even after full minification. It works by replacing Lua keywords with a single byte and +inserting code at the start of the script to expand the keywords when it is run. + +#### --uglify +Enable the uglification filter. Default is to not uglify. + +### Compile +Squish can compile the resulting file to Lua bytecode. This is experimental at this stage (you may get better results +with luac right now), however it's a work in progress. Compiling to bytecode can actually increase the size of +minified output, but it can speed up loading (not that you would notice it anyway, since the Lua compiler is so fast). + +#### --compile +Enables compilation of the output file. + +## Squishy reference + +A squishy file is actually a Lua script which calls some Squish functions. These functions are listed here. + +### Module "name" "path" +Adds the specified module to the list of those to be squished into the output file. The optional path specifies +where to find the file (relative to the squishy file), otherwise Squish will attempt to find the module itself. + +### Main "script.lua" +Adds a script into the squished output. Scripts are executed in the order specified in the squishy file, but only +after all modules have been loaded. + +### Output "filename.lua" +Names the output file. If none is specified, the default is 'squished.out.lua'. + +### Option "name" "value" +Sets the specified option, to 'true', or to the optional given value. This allows a squishy file to set default +command-line options. + +### GetOption "name" +Returns the current value of the given option. + +### Resource "name" "path" +Adds a 'resource' to the squished file. A resource may be any file, text, binary, large or small. Scripts can +retrieve the resource at runtime by calling require_resource("name"). If no path is given then the name is used +as the path. + +### AutoFetchURL "url" +**Experimental** feature which is subject to change. When specified, all the following Module statements will be +fetched via HTTP if not found on the filesystem. A ? (question mark) in the URL is replaced by the relative path +of the module file that was given in the Module statement. diff -r aaf1b38007d8 -r 3d4ba37b1554 minify/COPYRIGHT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/minify/COPYRIGHT Sat Jul 25 23:04:16 2009 +0100 @@ -0,0 +1,46 @@ + +The squish minify extension is built from the excellent LuaSrcDiet code. The +original copyright file for that project is below. + +Modifications are (C) 2009 Matthew Wild, and placed under the same license as +Squish and Lua 5.1. + + +LuaSrcDiet License +------------------ + +LuaSrcDiet is licensed under the terms of the MIT license reproduced +below. This means that LuaSrcDiet is free software and can be used for +both academic and commercial purposes at absolutely no cost. + +Parts of LuaSrcDiet is based on Lua 5 code. See COPYRIGHT_Lua51 +(Lua 5.1.3) for Lua 5 license information. + +For details and rationale, see http://www.lua.org/license.html . + +=============================================================================== + +Copyright (C) 2005-2008 Kein-Hong Man +Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio. + +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. + +=============================================================================== + +(end of COPYRIGHT)