diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58b805f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules/ \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0256718 --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +src/* +test/* +template/* +node_modules/* +build/*.amd.js +Makefile +index.html \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..b450f64 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2013 by Andrea Giammarchi, @WebReflection + +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. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7ecb1f6 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +.PHONY: var node amd clean test web dependencies + +# repository name +REPO = main + +# default build task +build: + make var + make node + make amd + make test + +# build generic version +var: + mkdir -p build + cat template/var.before src/$(REPO).js template/var.after >build/no-copy.$(REPO).max.js + node node_modules/uglify-js/bin/uglifyjs --verbose build/no-copy.$(REPO).max.js >build/no-copy.$(REPO).js + cat template/license.before LICENSE.txt template/license.after build/no-copy.$(REPO).max.js >build/$(REPO).max.js + cat template/copyright build/no-copy.$(REPO).js >build/$(REPO).js + rm build/no-copy.$(REPO).max.js + rm build/no-copy.$(REPO).js + +# build node.js version +node: + mkdir -p build + cat template/license.before LICENSE.txt template/license.after template/node.before src/$(REPO).js template/node.after >build/$(REPO).node.js + +# build AMD version +amd: + mkdir -p build + cat template/amd.before src/$(REPO).js template/amd.after >build/no-copy.$(REPO).max.amd.js + node node_modules/uglify-js/bin/uglifyjs --verbose build/no-copy.$(REPO).max.amd.js >build/no-copy.$(REPO).amd.js + cat template/license.before LICENSE.txt template/license.after build/no-copy.$(REPO).max.amd.js >build/$(REPO).max.amd.js + cat template/copyright build/no-copy.$(REPO).amd.js >build/$(REPO).amd.js + rm build/no-copy.$(REPO).max.amd.js + rm build/no-copy.$(REPO).amd.js + +# clean/remove build folder +clean: + rm -rf build + +# tests, as usual and of course +test: + node node_modules/wru/node/program.js test/$(REPO).js + +# launch polpetta (ctrl+click to open the page) +web: + node node_modules/polpetta/build/polpetta ./ + +# modules used in this repo +dependencies: + rm -rf node_modules + mkdir node_modules + npm install wru + npm install polpetta + npm install uglify-js@1 diff --git a/README.md b/README.md new file mode 100644 index 0000000..c390808 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +gitstrap +======== + +A basic structure to start a JS project \ No newline at end of file diff --git a/build/main.amd.js b/build/main.amd.js new file mode 100644 index 0000000..f4de4bd --- /dev/null +++ b/build/main.amd.js @@ -0,0 +1,2 @@ +/*! (C) WebReflection Mit Style License */ +define({}); \ No newline at end of file diff --git a/build/main.js b/build/main.js new file mode 100644 index 0000000..d12511b --- /dev/null +++ b/build/main.js @@ -0,0 +1,2 @@ +/*! (C) WebReflection Mit Style License */ +var main={}; \ No newline at end of file diff --git a/build/main.max.amd.js b/build/main.max.amd.js new file mode 100644 index 0000000..fc25205 --- /dev/null +++ b/build/main.max.amd.js @@ -0,0 +1,22 @@ +/*! +Copyright (C) 2013 by Andrea Giammarchi, @WebReflection + +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. +*/ +define({}); \ No newline at end of file diff --git a/build/main.max.js b/build/main.max.js new file mode 100644 index 0000000..963cb7a --- /dev/null +++ b/build/main.max.js @@ -0,0 +1,22 @@ +/*! +Copyright (C) 2013 by Andrea Giammarchi, @WebReflection + +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 main = {}; \ No newline at end of file diff --git a/build/main.node.js b/build/main.node.js new file mode 100644 index 0000000..58993d1 --- /dev/null +++ b/build/main.node.js @@ -0,0 +1,22 @@ +/*! +Copyright (C) 2013 by Andrea Giammarchi, @WebReflection + +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. +*/ +module.exports = {}; \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..ffad9eb --- /dev/null +++ b/index.html @@ -0,0 +1,84 @@ + + +
+