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 @@ + + + + wru test + + + + + + + +
+ + + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..130706c --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "version": "0.0.0", + "name": "", + "description": "", + "homepage": "https://github.com/WebReflection/main", + "keywords": ["node"], + "author": { + "name": "Andrea Giammarchi", + "web": "http://webreflection.blogspot.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/WebReflection/main.git" + }, + "main": "./build/main.node.js" +} \ No newline at end of file diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main.js @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/template/amd.after b/template/amd.after new file mode 100644 index 0000000..8916587 --- /dev/null +++ b/template/amd.after @@ -0,0 +1 @@ +); \ No newline at end of file diff --git a/template/amd.before b/template/amd.before new file mode 100644 index 0000000..4c15333 --- /dev/null +++ b/template/amd.before @@ -0,0 +1 @@ +define( \ No newline at end of file diff --git a/template/copyright b/template/copyright new file mode 100644 index 0000000..8c603a6 --- /dev/null +++ b/template/copyright @@ -0,0 +1 @@ +/*! (C) WebReflection Mit Style License */ diff --git a/template/license.after b/template/license.after new file mode 100644 index 0000000..d7365df --- /dev/null +++ b/template/license.after @@ -0,0 +1,2 @@ + +*/ diff --git a/template/license.before b/template/license.before new file mode 100644 index 0000000..bf11147 --- /dev/null +++ b/template/license.before @@ -0,0 +1 @@ +/*! diff --git a/template/node.after b/template/node.after new file mode 100644 index 0000000..1c8a0e7 --- /dev/null +++ b/template/node.after @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/template/node.before b/template/node.before new file mode 100644 index 0000000..e6bf414 --- /dev/null +++ b/template/node.before @@ -0,0 +1 @@ +module.exports = \ No newline at end of file diff --git a/template/var.after b/template/var.after new file mode 100644 index 0000000..1c8a0e7 --- /dev/null +++ b/template/var.after @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/template/var.before b/template/var.before new file mode 100644 index 0000000..5b5a4cc --- /dev/null +++ b/template/var.before @@ -0,0 +1 @@ +var main = \ No newline at end of file diff --git a/test/main.js b/test/main.js new file mode 100644 index 0000000..9cbb6c4 --- /dev/null +++ b/test/main.js @@ -0,0 +1,12 @@ +//remove: +var main = require('../build/main.node.js'); +//:remove + +wru.test([ + { + name: "main", + test: function () { + wru.assert(typeof main == "object"); + } + } +]); \ No newline at end of file