gina 0.0.9-p91b → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.2/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.2}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.2/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.2/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.2/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.2/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.2/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.2/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.2/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.2/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.2/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.2/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.2/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.2/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.2/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.2/core/router.js +664 -0
- package/framework/v0.1.1-alpha.2/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.2/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.2/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.2/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.2/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.2/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.2/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.2/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.2/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.2/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.2/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.2/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.2/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.2/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.2/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.2/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.2/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.2/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.2/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.2/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.2/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.2/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/main.js +734 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.2/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.2/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.2/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.2/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.2/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.2/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13731
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -788
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -1,452 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
var EventEmitter = require('events').EventEmitter;
|
|
4
|
-
var spawn = require('child_process').spawn;
|
|
5
|
-
var helpers = require('../../helpers');
|
|
6
|
-
var inherits = require('../inherits');
|
|
7
|
-
var console = require('../logger');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* TODO - onInitialize event
|
|
12
|
-
* TODO - deploy bundle only
|
|
13
|
-
* */
|
|
14
|
-
function Deploy(opt) {
|
|
15
|
-
|
|
16
|
-
var self = Deploy.instance || this;
|
|
17
|
-
var local = {};
|
|
18
|
-
var error = false;
|
|
19
|
-
var hosts = {};
|
|
20
|
-
this.env = opt.env;
|
|
21
|
-
this.task = 'deploy';
|
|
22
|
-
this.bundle = opt.bundle;
|
|
23
|
-
|
|
24
|
-
setPath('deploy', _(getPath('root') +'/'+ this.task));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.init = this.onInitialize = function(cb) {
|
|
28
|
-
|
|
29
|
-
if (self.initialized == undefined && !Deploy.instance) {
|
|
30
|
-
self.initialized = true;
|
|
31
|
-
|
|
32
|
-
if (typeof(cb) != 'undefined' && typeof(cb) == 'function') {
|
|
33
|
-
cb(init)
|
|
34
|
-
} else {
|
|
35
|
-
init()
|
|
36
|
-
}
|
|
37
|
-
return self
|
|
38
|
-
} else {
|
|
39
|
-
return Deploy.instance
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
var init = function() {
|
|
44
|
-
// main init code goes here...
|
|
45
|
-
if ( typeof(opt['set']) != 'undefined') {
|
|
46
|
-
|
|
47
|
-
var dic = {};
|
|
48
|
-
for (var k in opt['set']) {
|
|
49
|
-
//normalizing home path alias (nixes only)
|
|
50
|
-
if (k == 'target' && opt['set'][k] === '~/') {
|
|
51
|
-
opt['set'][k] = '~'
|
|
52
|
-
} else if (k == 'target' && opt['set'][k] === '/') {
|
|
53
|
-
opt['set'][k] = ''
|
|
54
|
-
}
|
|
55
|
-
// by default
|
|
56
|
-
if (k == 'target') {
|
|
57
|
-
self['releases_path'] = opt['set'][k] +'/releases';
|
|
58
|
-
dic['releases_path'] = opt['set'][k] +'/releases';
|
|
59
|
-
if ( typeof(opt.set.release) != 'undefined') {
|
|
60
|
-
self.release = opt.set.release
|
|
61
|
-
} else {
|
|
62
|
-
self.release = self.makeReleaseNumber()
|
|
63
|
-
}
|
|
64
|
-
self['release_relative_path'] = './releases/' + self.release;
|
|
65
|
-
self['release_path'] = self['releases_path'] + '/' + self.release;
|
|
66
|
-
dic['release_path'] = self['releases_path'] + '/' + self.release;
|
|
67
|
-
dic['release'] = +self.release;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
opt['set'][k] = whisper(dic, opt['set'][k]);
|
|
72
|
-
self[k] = opt['set'][k];
|
|
73
|
-
dic[k] = opt['set'][k];
|
|
74
|
-
}
|
|
75
|
-
//update dic
|
|
76
|
-
dic = whisper(dic, dic);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if ( typeof(self['shared_path']) == 'undefined') {
|
|
81
|
-
self['shared_path'] = self.target + '/shared'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if ( typeof(self['shared']) == 'undefined') {
|
|
85
|
-
self['shared'] = {}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if ( typeof(self['tasks']) == 'undefined') {
|
|
89
|
-
self['tasks'] = {
|
|
90
|
-
"onInitialize" : [],
|
|
91
|
-
"onDeployed" : []
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if ( typeof(self['host']) == 'undefined') {
|
|
96
|
-
self['host'] = self.user +'@'+ self.server
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if ( typeof(self['keep_releases']) == 'undefined') {
|
|
100
|
-
self['keep_releases'] = 5
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if ( typeof(self['sources']) == 'undefined') {
|
|
104
|
-
self['sources'] = './releases';
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// link to current task added to the end
|
|
108
|
-
for (var t in self.tasks.onDeployed) {
|
|
109
|
-
self.tasks.onDeployed[t] = self.tasks.onDeployed[t].replace(/\/current/g, '/releases/'+self.release)
|
|
110
|
-
}
|
|
111
|
-
self.tasks.onDeployed.push('cd '+self.target+'/; rm ./current; ln -s ' + self.release_relative_path +' ./current');
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
self.tasks = whisper(dic, self.tasks);
|
|
115
|
-
|
|
116
|
-
self = whisper(dic, self);//closing to ensure replacement
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (self.releases_path == '/' || self.releases_path == '/.' || self.releases_path == '~' || self.releases_path == '~/' || self.releases_path == '~/.') {
|
|
120
|
-
console.log('releases path cannot be root');
|
|
121
|
-
process.exit(1)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
//get enabled bundles
|
|
126
|
-
self
|
|
127
|
-
.run('ls '+ self.sources, true)
|
|
128
|
-
.onComplete( function onBundle(err, data) {
|
|
129
|
-
if (err) {
|
|
130
|
-
console.emerg('releases dir not found: try to build then retry to deploy');
|
|
131
|
-
process.exit(1)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (!data) {
|
|
135
|
-
console.emerg('releases dir is empty: try to build then retry to deploy');
|
|
136
|
-
process.exit(1)
|
|
137
|
-
}
|
|
138
|
-
var a = data.split('\n'), list = [];
|
|
139
|
-
|
|
140
|
-
for (var i=0; i<a.length; ++i) {
|
|
141
|
-
if (a[i] && a.indexOf(i) < 0)
|
|
142
|
-
list.push(a[i])
|
|
143
|
-
}
|
|
144
|
-
self.bundles = list;
|
|
145
|
-
finalizeInit()
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
var finalizeInit = function() {
|
|
149
|
-
if (self.bundles.length > 0) {
|
|
150
|
-
Deploy.instance = self;
|
|
151
|
-
|
|
152
|
-
//self.removeAllReleases( function onRemoved() {
|
|
153
|
-
// self.emit('init#complete', false)
|
|
154
|
-
//})
|
|
155
|
-
self.emit('init#complete', false)
|
|
156
|
-
} else {
|
|
157
|
-
console.error('could not deploy: no bundle found !')
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
this.getIgnoreList = function() {
|
|
163
|
-
var list = [];
|
|
164
|
-
var path = getPath('root') + '/deploy/' + self.env + '/.ignore';
|
|
165
|
-
|
|
166
|
-
if ( fs.existsSync(path) ) {
|
|
167
|
-
var arr = fs.readFileSync(path).toString().split(/\n/);
|
|
168
|
-
var tmp =''
|
|
169
|
-
for (var i=0; i<arr.length; ++i) {
|
|
170
|
-
tmp = arr[i].trim();
|
|
171
|
-
if ( tmp.substr(0, 1) != "#" && tmp!= '') {
|
|
172
|
-
if (tmp.indexOf('#') > -1) {
|
|
173
|
-
tmp = tmp.substr(0, tmp.indexOf('#')).trim()
|
|
174
|
-
}
|
|
175
|
-
list.push(tmp)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var envsList = [], bundleList = [];
|
|
182
|
-
var path = '';
|
|
183
|
-
try {
|
|
184
|
-
var envs = require(getPath('root') +'/env.json');
|
|
185
|
-
|
|
186
|
-
for (var b in envs) {
|
|
187
|
-
bundleList.push(b);
|
|
188
|
-
for (var e in envs[b]) {
|
|
189
|
-
if (list.indexOf('*/'+ e +'/*') < 0 && e != self.env ) {
|
|
190
|
-
list.push('*/'+ e +'/*')
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
path = './releases/'+ b +'/'+ e;
|
|
194
|
-
if (list.indexOf(path) < 0 && e != self.env ) {
|
|
195
|
-
list.push(path)
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} catch (err) {
|
|
200
|
-
if (!self.bundles[0]) {
|
|
201
|
-
console.error(err.stack);
|
|
202
|
-
process.exit(1)
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return list
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
this.makeReleaseNumber = function() {
|
|
209
|
-
return new Date().getTime()
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
this.removeAllReleases = function(cb) {
|
|
213
|
-
|
|
214
|
-
var removeRelease = function(list, i, cb) {
|
|
215
|
-
if ( list.length > ~~self['keep_releases'] ) {
|
|
216
|
-
if (list[i] == '') { //avoid empty
|
|
217
|
-
list.splice(0, 1);
|
|
218
|
-
removeRelease(list, 0, cb)
|
|
219
|
-
} else {
|
|
220
|
-
self
|
|
221
|
-
.run('rm -Rf ' + self.releases_path + '/' + list[i])
|
|
222
|
-
.onComplete( function(err, data) {
|
|
223
|
-
if (!err) {
|
|
224
|
-
list.splice(0, 1);
|
|
225
|
-
removeRelease(list, 0, cb)
|
|
226
|
-
} else {
|
|
227
|
-
console.error(err);
|
|
228
|
-
process.exit(1)
|
|
229
|
-
}
|
|
230
|
-
})
|
|
231
|
-
}
|
|
232
|
-
} else {
|
|
233
|
-
cb(false)
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
self
|
|
238
|
-
.run('ls ' + self.releases_path + '/')
|
|
239
|
-
.onComplete( function(err, data) {
|
|
240
|
-
if (!err && data != undefined) {
|
|
241
|
-
var list = data.toString().split('\n');
|
|
242
|
-
removeRelease(list, 0, cb)
|
|
243
|
-
} else {
|
|
244
|
-
self
|
|
245
|
-
.run('mkdir ' + self.releases_path)
|
|
246
|
-
.onComplete(cb)
|
|
247
|
-
}
|
|
248
|
-
})
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Run commande
|
|
254
|
-
*
|
|
255
|
-
* @param cmdLine {array|string}
|
|
256
|
-
*
|
|
257
|
-
* */
|
|
258
|
-
this.run = function(cmdline, runLocal) {
|
|
259
|
-
//var runLocal = runLocal||false;
|
|
260
|
-
var outFile = _(getPath('globalTmpPath') + '/out.log');
|
|
261
|
-
var errFile = _(getPath('globalTmpPath') + '/err.log');
|
|
262
|
-
var out = fs.openSync(outFile, 'a');
|
|
263
|
-
var err = fs.openSync(errFile, 'a');
|
|
264
|
-
|
|
265
|
-
var root = getPath('root');
|
|
266
|
-
|
|
267
|
-
var result, error = false;
|
|
268
|
-
var hasCalledBack = false;
|
|
269
|
-
var e = new EventEmitter();
|
|
270
|
-
|
|
271
|
-
var cmd;
|
|
272
|
-
if ( isWin32() ) {
|
|
273
|
-
throw new Error('Windows platform not supported yet for command line forward');
|
|
274
|
-
process.exit(1)
|
|
275
|
-
}
|
|
276
|
-
if ( typeof(runLocal) != 'undefined' && runLocal == true ) {
|
|
277
|
-
|
|
278
|
-
//process.chdir(root);
|
|
279
|
-
// cmdline must be an array !!
|
|
280
|
-
if (typeof(cmdline) == 'string') {
|
|
281
|
-
cmdline = cmdline.split(' ')
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
//console.info('running: ', cmdline.join(' '));
|
|
285
|
-
|
|
286
|
-
cmd = spawn(cmdline.splice(0,1).toString(), cmdline, { cwd: root, stdio: [ 'ignore', out, err ] })
|
|
287
|
-
|
|
288
|
-
} else {
|
|
289
|
-
console.info('running: [ ssh ] ', cmdline);
|
|
290
|
-
cmd = spawn('ssh', [ self.host, cmdline ], { stdio: [ 'ignore', out, err ] })
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
cmd.on('stdout', function(data) {
|
|
294
|
-
var str = data.toString();
|
|
295
|
-
var lines = str.split(/(\r?\n)/g);
|
|
296
|
-
result = lines.join('');
|
|
297
|
-
//console.info('out: ', result);
|
|
298
|
-
e.emit('run#data', result)
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
// Errors are readable in the onComplete callback
|
|
302
|
-
cmd.on('stderr', function (err) {
|
|
303
|
-
var str = err.toString();
|
|
304
|
-
error = str || false;
|
|
305
|
-
//console.error('err: ', error);
|
|
306
|
-
e.emit('run#err', error)
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
cmd.on('close', function (code) {
|
|
310
|
-
|
|
311
|
-
try {
|
|
312
|
-
var error = ( fs.existsSync(errFile) ) ? fs.readFileSync(errFile).toString() : false;
|
|
313
|
-
//closing
|
|
314
|
-
fs.closeSync(err);
|
|
315
|
-
if ( fs.existsSync(errFile) ) fs.unlinkSync(errFile);
|
|
316
|
-
|
|
317
|
-
if (error) {
|
|
318
|
-
cmd.emit('stderr', new Buffer(error))
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
var data = ( fs.existsSync(outFile) ) ? fs.readFileSync(outFile).toString() : undefined;
|
|
323
|
-
//closing
|
|
324
|
-
fs.closeSync(out);
|
|
325
|
-
if (fs.existsSync(outFile) ) fs.unlinkSync(outFile);
|
|
326
|
-
|
|
327
|
-
if ( data ) {
|
|
328
|
-
cmd.emit('stdout', new Buffer(data))
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
if (error == '') {
|
|
333
|
-
error = false
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
if (code == 0 ) {
|
|
337
|
-
e.emit('run#complete', error, result)
|
|
338
|
-
} else {
|
|
339
|
-
e.emit('run#complete', 'project deploy encountered an error: ' + error, result)
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
} catch (err) {
|
|
344
|
-
console.error(err.stack)
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
e.onData = function(callback) {
|
|
349
|
-
|
|
350
|
-
e.once('run#data', function(data) {
|
|
351
|
-
callback(data)
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
e.once('run#err', function(err, data) {
|
|
355
|
-
callback(err, data)
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
return e
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
e.onComplete = function(callback) {
|
|
363
|
-
e.once('run#complete', function(err, data) {
|
|
364
|
-
callback(err, data)
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
return e
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
return e
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
var makeStartUpScript = function() {
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* runOnDeployedTasks
|
|
380
|
-
* @description Tasks to run after deploy is complete.
|
|
381
|
-
*
|
|
382
|
-
* @param {number} t - task id
|
|
383
|
-
* */
|
|
384
|
-
this.runOnDeployedTasks = function(t) {
|
|
385
|
-
console.info('running onDeployedTasks');
|
|
386
|
-
var t = t || 0;
|
|
387
|
-
|
|
388
|
-
if ( typeof(self.tasks) != 'undefined' && typeof(self.tasks.onDeployed[t]) != 'undefined') {
|
|
389
|
-
self
|
|
390
|
-
.run(self.tasks.onDeployed[t])
|
|
391
|
-
.onComplete( function(err, msg) {
|
|
392
|
-
if (err) console.warn(err.stack||err.message||err);
|
|
393
|
-
if (msg) console.info(msg);
|
|
394
|
-
self.runOnDeployedTasks(t+1)
|
|
395
|
-
})
|
|
396
|
-
|
|
397
|
-
} else {
|
|
398
|
-
self.emit('deploy-tasks#complete', false)
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
this.onComplete = function(callback) {
|
|
402
|
-
|
|
403
|
-
self.once('deploy-tasks#complete' , function(err) {
|
|
404
|
-
if (!err) {
|
|
405
|
-
console.log('finalizing... ')
|
|
406
|
-
}
|
|
407
|
-
callback(err)
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
// look into bin to create complete event
|
|
411
|
-
// then redirect to script when done in your local strategy
|
|
412
|
-
// with: [ self.emit('deploy#complete', err) ]
|
|
413
|
-
|
|
414
|
-
//return self
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
return self
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.onInitialized = function(callback) {
|
|
422
|
-
|
|
423
|
-
self.once('init#complete' , function(err) {
|
|
424
|
-
if (!err) {
|
|
425
|
-
console.log('init complete')
|
|
426
|
-
}
|
|
427
|
-
callback(err)
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
return self
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
this.onComplete = function(callback) {
|
|
434
|
-
|
|
435
|
-
self.once('deploy#complete' , function(err) {
|
|
436
|
-
if (!err) {
|
|
437
|
-
self.removeAllReleases( function onRemoved() {
|
|
438
|
-
console.info('removed old releases')
|
|
439
|
-
})
|
|
440
|
-
console.info('deploy complete !')
|
|
441
|
-
}
|
|
442
|
-
callback(err)
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
return self
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
return this
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
Deploy = inherits(Deploy, EventEmitter);
|
|
452
|
-
module.exports = Deploy
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//imports
|
|
3
|
-
var fs = require('fs');
|
|
4
|
-
var utils = require(__dirname + '/../../index');
|
|
5
|
-
var GINA_PATH = _( getPath('gina').core );
|
|
6
|
-
var readline = require('readline');
|
|
7
|
-
var rl = readline.createInterface(process.stdin, process.stdout);
|
|
8
|
-
|
|
9
|
-
function iniProject(name) {
|
|
10
|
-
|
|
11
|
-
var self = this;
|
|
12
|
-
self.task = 'init';//important for later in config init
|
|
13
|
-
|
|
14
|
-
var init = function(name) {
|
|
15
|
-
self.root = getPath('root');
|
|
16
|
-
self.name = name;
|
|
17
|
-
var err = false;
|
|
18
|
-
|
|
19
|
-
if ( !isValidName() ) {
|
|
20
|
-
console.error('[ '+name+' ] is not a valid project name. Please, try something else: [a-Z0-9].');
|
|
21
|
-
process.exit(1)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// creating project file
|
|
25
|
-
var file = new _(self.root + '/project.json');
|
|
26
|
-
var exists = file.existsSync();
|
|
27
|
-
if ( !exists ) {
|
|
28
|
-
createProjectFile( file.toString() )
|
|
29
|
-
} else {
|
|
30
|
-
console.warn('a project already exists in this location: '+ file);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// creating package file
|
|
34
|
-
file = new _(self.root + '/package.json');
|
|
35
|
-
exists = file.existsSync();
|
|
36
|
-
if ( !exists ) {
|
|
37
|
-
createPackageFile( file.toString() )
|
|
38
|
-
} else {
|
|
39
|
-
console.warn('a package already exists in this location: '+ file);
|
|
40
|
-
|
|
41
|
-
end()
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var isValidName = function() {
|
|
47
|
-
var patt = /[a-z0-9]/gi;
|
|
48
|
-
return patt.test(name)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var createProjectFile = function(target) {
|
|
52
|
-
var conf = GINA_PATH +'/template/conf/project.json';
|
|
53
|
-
var contentFile = require(conf);
|
|
54
|
-
var dic = {
|
|
55
|
-
"project" : self.name
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
contentFile = whisper(dic, contentFile);//data
|
|
59
|
-
fs.writeFileSync(target, JSON.stringify(contentFile, null, 4))
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var createPackageFile = function(target) {
|
|
63
|
-
var conf = GINA_PATH +'/template/conf/package.json';
|
|
64
|
-
var contentFile = require(conf);
|
|
65
|
-
var dic = {
|
|
66
|
-
"project" : self.name
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
contentFile = whisper(dic, contentFile);//data
|
|
70
|
-
fs.writeFileSync(target, JSON.stringify(contentFile, null, 4));
|
|
71
|
-
|
|
72
|
-
end()
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
var end = function() {
|
|
76
|
-
// new _(self.root+'/common/'))
|
|
77
|
-
console.log('project [ '+ self.name +' ] ready');
|
|
78
|
-
process.exit(0)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
init(name)
|
|
82
|
-
};
|
|
83
|
-
module.exports = iniProject
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Gina.Utils.cmd
|
|
3
|
-
* Copyright (c) 2016 Rhinostone <gina@rhinostone.com>
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
* in the Software without restriction, including without limitation the rights
|
|
8
|
-
* to use, copy, modify, extend, publish, distribute, sublicense, and/or sell
|
|
9
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
* furnished to do so, subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be included in
|
|
13
|
-
* all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
* THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
var fs = require('fs');
|
|
25
|
-
var helpers = require('../../helpers');
|
|
26
|
-
|
|
27
|
-
var cmd = {},
|
|
28
|
-
argCount = process.argv.length - 2;
|
|
29
|
-
|
|
30
|
-
cmd.option = [];
|
|
31
|
-
cmd.setOption = function(option){
|
|
32
|
-
if (option instanceof Array) {
|
|
33
|
-
for (var i=0; i<option.length; ++i) {
|
|
34
|
-
cmd.option[option[i].name] = option[i].content;
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
cmd.option[options.name] = option.content;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
cmd.getString = function() {
|
|
41
|
-
var cmd = process.argv.toString()
|
|
42
|
-
.replace(/,/g,' ')
|
|
43
|
-
.replace(/node/g, 'gina');
|
|
44
|
-
var cmdArr = cmd.split('/');
|
|
45
|
-
cmd = cmdArr[cmdArr.length-1];
|
|
46
|
-
return cmd;
|
|
47
|
-
};
|
|
48
|
-
cmd.getOption = function(name) {
|
|
49
|
-
return cmd.option[name];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
cmd.getOptions = function() {
|
|
53
|
-
return cmd.option;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
cmd.onExec = function() {
|
|
57
|
-
cmd.msg = require( _(__dirname + '/msg.json') );
|
|
58
|
-
|
|
59
|
-
var _this = this, ignore = function(){
|
|
60
|
-
console.log(_this.msg.default[0].replace("%command%", cmd.getString()));
|
|
61
|
-
return
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
if (argCount <= 0) {
|
|
65
|
-
console.log("Command gina must have argument(s) !"
|
|
66
|
-
+"\nTry this to get help: gina -h")
|
|
67
|
-
} else if (argCount == 1) {
|
|
68
|
-
var p = _(__dirname + '/basic.js');
|
|
69
|
-
cmd.Basic = require(p).run(cmd.getOptions(), cmd.msg)
|
|
70
|
-
} else if (argCount >= 2 && argCount <4 || argCount == 4) {
|
|
71
|
-
var longcmd = (argCount>2) ? true : false;
|
|
72
|
-
if (argCount == 4 && process.argv[2] != '-s' && process.argv[2] != '--start') {
|
|
73
|
-
ignore()
|
|
74
|
-
} else {
|
|
75
|
-
var p = _(__dirname + '/app.js');
|
|
76
|
-
cmd.App = require(p).run( cmd.getOptions(), cmd.msg, longcmd )
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
} else if ( process.argv[2] == '-s' && argCount > 2 || process.argv[2] == '--start' && argCount > 2 ) {
|
|
80
|
-
var p = _(__dirname + '/app.js');
|
|
81
|
-
cmd.App = require(p).run( cmd.getOptions(), cmd.msg, true )
|
|
82
|
-
} else {
|
|
83
|
-
ignore()
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
cmd.load = function(root, package){
|
|
88
|
-
|
|
89
|
-
//Setting root for helpers.
|
|
90
|
-
setPath('root', root);
|
|
91
|
-
|
|
92
|
-
//Getting package.
|
|
93
|
-
var p = require( _(root + package) ),
|
|
94
|
-
ginaPath = _(root + package.replace('/package.json', '')),
|
|
95
|
-
middleware = fs.readFileSync(_(ginaPath + '/MIDDLEWARE')).toString() || 'none';
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
cmd.setOption([
|
|
99
|
-
{
|
|
100
|
-
'name' : 'version',
|
|
101
|
-
'content' : p.version
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
'name' : 'copyright',
|
|
105
|
-
'content' : p.copyright
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
'name' : 'root',
|
|
109
|
-
'content' : root
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
'name' : 'core',
|
|
113
|
-
'content' : _(ginaPath +'/core')
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
'name' : 'middleware',
|
|
117
|
-
'content': middleware
|
|
118
|
-
}
|
|
119
|
-
]);
|
|
120
|
-
|
|
121
|
-
//Set gina path.
|
|
122
|
-
setPath('gina.root', ginaPath);
|
|
123
|
-
setPath('gina.core', _(ginaPath +'/core'));
|
|
124
|
-
setPath('gina.utils', _(ginaPath +'/core/utils/lib'));
|
|
125
|
-
setPath('gina.utils', _(ginaPath +'/core/utils/lib'));
|
|
126
|
-
setPath('gina.plugins', _(ginaPath +'/core/plugins/lib'));
|
|
127
|
-
setPath('gina.documentation', _(ginaPath +'/documentation'));
|
|
128
|
-
|
|
129
|
-
var defaultConf = require( _(ginaPath + '/core/template/conf/env.json') );
|
|
130
|
-
//mountPath
|
|
131
|
-
var bundlesPath = defaultConf['mountPath'];
|
|
132
|
-
bundlesPath = _(bundlesPath.replace('{executionPath}', root));
|
|
133
|
-
|
|
134
|
-
//Set path for the global tmp repertory.
|
|
135
|
-
var gTmpPath = defaultConf['globalTmpPath'];
|
|
136
|
-
gTmpPath = _(gTmpPath.replace('{executionPath}', root));
|
|
137
|
-
|
|
138
|
-
var logsPath = defaultConf['logsPath'];
|
|
139
|
-
logsPath = _(logsPath .replace('{executionPath}', root));
|
|
140
|
-
|
|
141
|
-
//To make it globally accessible when you are in the gina process.
|
|
142
|
-
var globalPaths = {
|
|
143
|
-
"logsPath" : logsPath,
|
|
144
|
-
"globalTmpPath" : gTmpPath,
|
|
145
|
-
"mountPath" : bundlesPath
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
setPath(globalPaths);
|
|
149
|
-
cmd.onExec()
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
cmd.respawn = function(){
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
module.exports = cmd;
|