gina 0.0.9-p91c → 0.1.1-alpha.3
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.3/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.3}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.3/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.3/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.3/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.3/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.3/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.3/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.3/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.3/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.3/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.3/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.3/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.3/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.3/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.3/core/router.js +664 -0
- package/framework/v0.1.1-alpha.3/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.3/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.3/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.3/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.3/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.3/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.3/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.3/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.3/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.3/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.3/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.3/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.3/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.3/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.3/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.3/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.3/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.3/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.3/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.3/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.3/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.3/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/main.js +739 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.3/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.3/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.3/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.3/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.3/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.3/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 -13732
- 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 -789
- 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
package/core/utils/lib/proc.js
DELETED
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
/* Gina.utils.Proc
|
|
2
|
-
*
|
|
3
|
-
* This file is part of the gina package.
|
|
4
|
-
* Copyright (c) 2016 Rhinostone <gina@rhinostone.com>
|
|
5
|
-
*
|
|
6
|
-
* For the full copyright and license information, please view the LICENSE
|
|
7
|
-
* file that was distributed with this source code.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* { name: 'SIGABRT', action: 'A', desc: 'Process abort signal.' },
|
|
13
|
-
* { name: 'SIGALRM', action: 'T', desc: 'Alarm clock.' },
|
|
14
|
-
* { name: 'SIGBUS', action: 'A', desc: 'Access to an undefined portion of a memory object.' },
|
|
15
|
-
* { name: 'SIGCHLD', action: 'I', desc: 'Child process terminated, stopped, or continued. ' },
|
|
16
|
-
* { name: 'SIGCONT', action: 'C', desc: 'Continue executing, if stopped.' },
|
|
17
|
-
* { name: 'SIGFPE', action: 'A', desc: 'Erroneous arithmetic operation.' },
|
|
18
|
-
* { name: 'SIGHUP', action: 'T', desc: 'Hangup.' },
|
|
19
|
-
* { name: 'SIGILL', action: 'A', desc: 'Illegal instruction.' },
|
|
20
|
-
* { name: 'SIGINT', action: 'T', desc: 'Terminal interrupt signal.' },
|
|
21
|
-
* { name: 'SIGKILL', action: 'T', desc: 'Kill (cannot be caught or ignored).' },
|
|
22
|
-
* { name: 'SIGPIPE', action: 'T', desc: 'Write on a pipe with no one to read it.' },
|
|
23
|
-
* { name: 'SIGQUIT', action: 'A', desc: 'Terminal quit signal.' },
|
|
24
|
-
* { name: 'SIGSEGV', action: 'A', desc: 'Invalid memory reference.' },
|
|
25
|
-
* { name: 'SIGSTOP', action: 'S', desc: 'Stop executing (cannot be caught or ignored).' },
|
|
26
|
-
* { name: 'SIGTERM', action: 'T', desc: 'Termination signal.' },
|
|
27
|
-
* { name: 'SIGTSTP', action: 'S', desc: 'Terminal stop signal.' },
|
|
28
|
-
* { name: 'SIGTTIN', action: 'S', desc: 'Background process attempting read.' },
|
|
29
|
-
* { name: 'SIGTTOU', action: 'S', desc: 'Background process attempting write.' },
|
|
30
|
-
* { name: 'SIGUSR1', action: 'T', desc: 'User-defined signal 1.' },
|
|
31
|
-
* { name: 'SIGUSR2', action: 'T', desc: 'User-defined signal 2.' },
|
|
32
|
-
* { name: 'SIGPOLL', action: 'T', desc: 'Pollable event. ' },
|
|
33
|
-
* { name: 'SIGPROF', action: 'T', desc: 'Profiling timer expired. ' },
|
|
34
|
-
* { name: 'SIGSYS', action: 'A', desc: 'Bad system call.' },
|
|
35
|
-
* { name: 'SIGTRAP', action: 'A', desc: 'Trace/breakpoint trap. ' },
|
|
36
|
-
* { name: 'SIGURG', action: 'I', desc: 'High bandwidth data is available at a socket.' },
|
|
37
|
-
* { name: 'SIGVTALRM', action: 'T', desc: 'Virtual timer expired.' },
|
|
38
|
-
* { name: 'SIGXCPU', action: 'A', desc: 'CPU time limit exceeded.' },
|
|
39
|
-
* { name: 'SIGXFSZ', action: 'A', desc: 'File size limit exceeded. ' }
|
|
40
|
-
* */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//Imports
|
|
44
|
-
var fs = require('fs');
|
|
45
|
-
var Emitter = require('events').EventEmitter;
|
|
46
|
-
var spawn = require('child_process').spawn;
|
|
47
|
-
var UtilsConfig = require( _(__dirname + '/config') );
|
|
48
|
-
var inherits = require( _(__dirname + '/inherits') );
|
|
49
|
-
var console = require( _(__dirname + '/logger') );
|
|
50
|
-
//var helpers = require( _(__dirname + '/helpers') );
|
|
51
|
-
|
|
52
|
-
//console.log('path ? ', getPaths());
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @constructor
|
|
56
|
-
*
|
|
57
|
-
* @param {string} bundle
|
|
58
|
-
*
|
|
59
|
-
* */
|
|
60
|
-
function Proc(bundle, proc, usePidFile){
|
|
61
|
-
|
|
62
|
-
var self = this;
|
|
63
|
-
this.PID = null;
|
|
64
|
-
this.path = null;
|
|
65
|
-
this.master = false;//used only by master.
|
|
66
|
-
this.bundle = bundle;
|
|
67
|
-
this.proc = proc;
|
|
68
|
-
this.bundles = [];
|
|
69
|
-
|
|
70
|
-
if ( typeof(usePidFile) == 'undefined') {
|
|
71
|
-
var usePidFile = true
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Check target path
|
|
76
|
-
* @param {string} path
|
|
77
|
-
* @param {integer} PID Id of the PID to save
|
|
78
|
-
* */
|
|
79
|
-
|
|
80
|
-
var init = function() {
|
|
81
|
-
//Default.
|
|
82
|
-
var pathObj = new _( getPath('root') + '/tmp/pid/' );
|
|
83
|
-
var path = pathObj.toString();
|
|
84
|
-
|
|
85
|
-
//Create dir if needed.
|
|
86
|
-
//console.debug("MKDIR pathObj (pid:"+self.proc.pid+") - ", self.bundle);
|
|
87
|
-
|
|
88
|
-
process.list = (process.list == undefined) ? [] : process.list;
|
|
89
|
-
process.pids = (process.pids == undefined) ? {} : process.pids;
|
|
90
|
-
|
|
91
|
-
self.register(self.bundle, self.proc.pid);
|
|
92
|
-
|
|
93
|
-
if (usePidFile) {
|
|
94
|
-
pathObj.mkdir( function(err, path){
|
|
95
|
-
console.debug('path created ('+path+') now saving PID ' + bundle);
|
|
96
|
-
//logger.info('gina', 'PROC:INFO:1', 'path created ('+path+') now saving PID ' + bundle, __stack);
|
|
97
|
-
//Save file.
|
|
98
|
-
if (!err) {
|
|
99
|
-
self.PID = self.proc.pid;
|
|
100
|
-
self.path = path + pathObj.sep;
|
|
101
|
-
//Add PID file.
|
|
102
|
-
setPID(self.bundle, self.PID, self.proc);
|
|
103
|
-
save(self.bundle, self.PID, self.proc)
|
|
104
|
-
}
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
var isMaster = function() {
|
|
110
|
-
return (self.master) ? true : false;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// var getShutdownConnectorSync = function(bundle) {
|
|
114
|
-
// var bundlesPath = getPath('bundlesPath');
|
|
115
|
-
// var connPath = _(bundlesPath +'/'+ bundle + '/config/connector.json');
|
|
116
|
-
// try {
|
|
117
|
-
// console.log('reading connPath: ', connPath);
|
|
118
|
-
// var content = fs.readFileSync(connPath);
|
|
119
|
-
// return JSON.parse(content).httpClient.shutdown
|
|
120
|
-
// } catch (err) {
|
|
121
|
-
// return undefined
|
|
122
|
-
// }
|
|
123
|
-
// }
|
|
124
|
-
/**
|
|
125
|
-
* Going to force restart by third party (kill 9).
|
|
126
|
-
*
|
|
127
|
-
* @param {string} bundle
|
|
128
|
-
* @param {string} env
|
|
129
|
-
* @param {number} pid
|
|
130
|
-
*
|
|
131
|
-
* @callback callback
|
|
132
|
-
* @param {boolean|string} err
|
|
133
|
-
* */
|
|
134
|
-
var respawn = function(bundle, env, pid, callback) {
|
|
135
|
-
//var loggerInstance = getContext('logger');
|
|
136
|
-
//loggerInstance["trace"]('Fatal error !');
|
|
137
|
-
//console.debug("Exiting and re spawning : ", bundle, env);
|
|
138
|
-
// TODO - Count the restarts and prevent unilimited loop
|
|
139
|
-
// TODO - Send notification to admin or/and root to the Fatal Error Page.
|
|
140
|
-
|
|
141
|
-
var root = getPath('root');
|
|
142
|
-
try {
|
|
143
|
-
var version = process.getVersion(bundle);
|
|
144
|
-
} catch (err) {
|
|
145
|
-
var bundle = process.argv[3];
|
|
146
|
-
//var port = self.getBundlePortByBundleName(bundle);
|
|
147
|
-
//console.log("Bundle ", bundle," already running or port[ "+port+" ] is taken by another process...");
|
|
148
|
-
//loggerInstance["trace"]("Bundle [ "+ bundle +" ] already running or [ "+env+" ] port is use by another process...");
|
|
149
|
-
console.debug("Bundle [ "+ bundle +" ] already running or [ "+env+" ] port is use by another process...");
|
|
150
|
-
dismiss(process.pid);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var outPath = _(root + '/out.'+bundle+'.'+version+'.log');
|
|
155
|
-
var errPath = _(root + '/out.'+bundle+'.'+version+'.log');
|
|
156
|
-
var nodePath = getPath('node');
|
|
157
|
-
var ginaPath = _(root + '/gina');
|
|
158
|
-
|
|
159
|
-
// if (env == 'prod') { //won't loop forever for others env.
|
|
160
|
-
//
|
|
161
|
-
// //var opt = process.getShutdownConnectorSync();
|
|
162
|
-
// var opt = getShutdownConnectorSync(bundle);
|
|
163
|
-
// //Should kill existing one..
|
|
164
|
-
// opt.path = '/' + bundle + '/restart/' + pid + '/' + env;
|
|
165
|
-
//
|
|
166
|
-
// var HttpClient = require('gina.com').Http;
|
|
167
|
-
// var httpClient = new HttpClient();
|
|
168
|
-
//
|
|
169
|
-
// if (httpClient) {
|
|
170
|
-
// //httpClient.query(opt);
|
|
171
|
-
// //We are not waiting for anything particular...do we ?
|
|
172
|
-
// httpClient.query(opt, function (err, msg) {
|
|
173
|
-
// //Now start new bundle.
|
|
174
|
-
// callback(err);
|
|
175
|
-
// });
|
|
176
|
-
// } else {
|
|
177
|
-
// var err = new Error('No shutdown connector found.');
|
|
178
|
-
// console.error(err);
|
|
179
|
-
// callback(err);
|
|
180
|
-
// }
|
|
181
|
-
//
|
|
182
|
-
// } else {
|
|
183
|
-
callback(false);
|
|
184
|
-
//}
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
var setPID = function(bundle, PID, proc) {
|
|
188
|
-
|
|
189
|
-
if (bundle != 'gina') {
|
|
190
|
-
proc.title = 'gina: '+ bundle;
|
|
191
|
-
} else {
|
|
192
|
-
proc.title = bundle;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
//Set event.
|
|
196
|
-
setDefaultEvents(bundle, PID, proc);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
var setDefaultEvents = function(bundle, PID, proc) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
if ( typeof(PID) != "undefined" && typeof(PID) == "number" ) {
|
|
203
|
-
console.debug("setting listeners for ", PID, ':', bundle);
|
|
204
|
-
|
|
205
|
-
proc.dismiss = dismiss;
|
|
206
|
-
proc.isMaster = isMaster;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
proc.on('SIGTERM', function(code){
|
|
210
|
-
proc.exit(code);
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
proc.on('SIGINT', function(code){
|
|
214
|
-
|
|
215
|
-
if (code == undefined) var code = 0;
|
|
216
|
-
console.info("\nGot exit code. Now killing: ", code);
|
|
217
|
-
proc.exit(code);//tigger exit event.
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
//Will prevent the server from stopping.
|
|
221
|
-
proc.on('uncaughtException', function(err) {
|
|
222
|
-
|
|
223
|
-
console.error(err.stack);
|
|
224
|
-
var bundle = self.bundle;
|
|
225
|
-
//console.log("@=>", self.args);
|
|
226
|
-
var env = process.env.NODE_ENV || 'prod';
|
|
227
|
-
var pid = self.getPidByBundleName(bundle);
|
|
228
|
-
|
|
229
|
-
//Wake up buddy !.
|
|
230
|
-
respawn(bundle, env, pid, function(err) {
|
|
231
|
-
//TODO - Send an email to the administrator/dev
|
|
232
|
-
//TODO - Have a delegate handler to allow the dev to do its stuff. Maybe it's already there if any dev can override.
|
|
233
|
-
//proc.exit(1) // don't kill !!! It will stop the server
|
|
234
|
-
})
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
proc.on('exit', function(code){
|
|
238
|
-
|
|
239
|
-
if ( typeof(code) == 'undefined') {
|
|
240
|
-
code = 0;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var bundle = self.bundle;
|
|
244
|
-
var env = process.env.NODE_ENV || 'prod';
|
|
245
|
-
var pid = self.getPidByBundleName(bundle);
|
|
246
|
-
|
|
247
|
-
//console.log('bundle ', bundle, ' vs ', pid, " => ", process.pid);
|
|
248
|
-
|
|
249
|
-
//console.log("got exit code ", "("+code+")", pid, " VS ", pid, " <=> gina: ", process.pid);
|
|
250
|
-
//code = code || 0;
|
|
251
|
-
//var obj = logger.emerg('gina', 'UTILS:EMERG1', 'process exit code ' + code);
|
|
252
|
-
//if (code == 0 && env != "debug" && env != "dev"/***/) {
|
|
253
|
-
|
|
254
|
-
//for (var p=0; p<process.list.count(); p++) {
|
|
255
|
-
// dismiss(process.list[p].pid)
|
|
256
|
-
//}
|
|
257
|
-
|
|
258
|
-
// kill gina
|
|
259
|
-
dismiss(process.list[process.list.count()-1].pid, "SIGKILL")
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
proc.on('SIGHUP', function(code){
|
|
263
|
-
console.debug("Hanging up ! Code: "+ code+"\n"+ process.argv);
|
|
264
|
-
|
|
265
|
-
var bundle = self.bundle;
|
|
266
|
-
var env = process.env.NODE_ENV || 'prod';
|
|
267
|
-
var pid = self.getPidByBundleName(bundle);
|
|
268
|
-
|
|
269
|
-
dismiss(process.pid, "SIGINT");
|
|
270
|
-
dismiss(pid, "SIGINT");
|
|
271
|
-
})
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
var dismiss = function(pid, signal){
|
|
277
|
-
if (pid == undefined) {
|
|
278
|
-
var pid = self.PID;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
try {
|
|
282
|
-
|
|
283
|
-
for (var p in process.list) {
|
|
284
|
-
fs.unlinkSync( _(self.path + process.list[p].pid) )
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
} catch (err) {
|
|
288
|
-
//Means that it does not exists anymore.
|
|
289
|
-
}
|
|
290
|
-
try {
|
|
291
|
-
console.debug('\n=> '+ JSON.stringify(process.list, null, 4));
|
|
292
|
-
for (var p in process.list) {
|
|
293
|
-
if ( process.list[p].name != 'gina' ) {
|
|
294
|
-
fs.unlinkSync( _(getPath('mountPath') + '/' + process.list[p].name) )
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
} catch (err) {
|
|
298
|
-
//Means that it does not exists anymore.
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
process.kill(pid, signal);// soft...
|
|
302
|
-
console.debug('\nsent '+ signal +' signal to end process [ '+ pid +' ]\n');
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Save PID file
|
|
307
|
-
* @param {string} bundle
|
|
308
|
-
* @param {integer} PID Id of the PID to save
|
|
309
|
-
*
|
|
310
|
-
* @private
|
|
311
|
-
* */
|
|
312
|
-
var save = function(){
|
|
313
|
-
var bundle = self.bundle;
|
|
314
|
-
var PID = self.PID;
|
|
315
|
-
var proc = self.proc;
|
|
316
|
-
var path = self.path
|
|
317
|
-
//Get PID path.
|
|
318
|
-
if (
|
|
319
|
-
typeof(bundle) != "undefined" && bundle != ""
|
|
320
|
-
&& typeof(PID) != "undefined" && PID != "" && PID != null
|
|
321
|
-
&& typeof(proc) != "undefined" && proc != "" && proc != null
|
|
322
|
-
) {
|
|
323
|
-
try {
|
|
324
|
-
var fileStream = fs.createWriteStream(path + PID);
|
|
325
|
-
fileStream.once('open', function(fd) {
|
|
326
|
-
fileStream.write(bundle);
|
|
327
|
-
console.debug('registered ', self.proc.pid);
|
|
328
|
-
fileStream.end();
|
|
329
|
-
self.emit('proc#complete', false)
|
|
330
|
-
});
|
|
331
|
-
} catch (err) {
|
|
332
|
-
self.emit('proc#complete', err)
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
} else {
|
|
336
|
-
self.emit('proc#complete', new Error('encountered troubles while trying to save Process file'))
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Get PID
|
|
343
|
-
* @param {string} bundle
|
|
344
|
-
* @return {number} PID
|
|
345
|
-
* */
|
|
346
|
-
this.getPID = function(){
|
|
347
|
-
|
|
348
|
-
try{
|
|
349
|
-
return self.PID;
|
|
350
|
-
} catch (err) {
|
|
351
|
-
console.error('Could not get PID for bundle: '+ self.bundle + (err.stack||err.message));
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
this.getBundleNameByPid = function(pid){
|
|
357
|
-
var list = process.list;
|
|
358
|
-
|
|
359
|
-
for (var i=0; i<list.length; ++i) {
|
|
360
|
-
//console.log("list ", list, ':', list[i][pid]);
|
|
361
|
-
if ( typeof(list[i][pid]) != "undefined")
|
|
362
|
-
return list[i][pid]
|
|
363
|
-
}
|
|
364
|
-
return undefined
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
this.getPidByBundleName = function(bundle){
|
|
369
|
-
var list = process.pids;
|
|
370
|
-
//console.log("list ", list, ':', list[bundle]);
|
|
371
|
-
if ( typeof(list[bundle]) != "undefined")
|
|
372
|
-
return list[bundle]
|
|
373
|
-
else
|
|
374
|
-
return undefined
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
this.setMaster = function(bool){
|
|
378
|
-
if ( typeof(bool) == 'undefined' || bool == true) {
|
|
379
|
-
self.master = true;
|
|
380
|
-
} else {
|
|
381
|
-
self.master = false;
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
this.register = function(bundle, pid) {
|
|
386
|
-
if ( bundle == 'gina' || bundle != 'gina' && self.bundles.indexOf(bundle) == -1 ) {
|
|
387
|
-
if (bundle != 'gina') {
|
|
388
|
-
self.bundles.push(bundle);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
var list = {};
|
|
392
|
-
list['pid'] = pid;
|
|
393
|
-
list['name'] = bundle;
|
|
394
|
-
process.list.push(list);//Running bundles.
|
|
395
|
-
process.pids[bundle] = pid;
|
|
396
|
-
|
|
397
|
-
list = null;
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
this.onReady = function(cb) {
|
|
402
|
-
self.once('proc#complete', function(err){
|
|
403
|
-
cb(err)
|
|
404
|
-
})
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
//Init.
|
|
408
|
-
if ( typeof(this.bundle) == "undefined" ) {
|
|
409
|
-
console.error('Invalid or undefined proc name . Proc naming Aborted')
|
|
410
|
-
} else {
|
|
411
|
-
init()
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
Proc = inherits(Proc, Emitter);
|
|
416
|
-
module.exports = Proc;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of the gina package.
|
|
3
|
-
* Copyright (c) 2016 Rhinostone <gina@rhinostone.com>
|
|
4
|
-
*
|
|
5
|
-
* For the full copyright and license information, please view the LICENSE
|
|
6
|
-
* file that was distributed with this source code.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
//var ContextHelper = require('./context');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Routing
|
|
13
|
-
*
|
|
14
|
-
* @package Gina.Utils
|
|
15
|
-
* @namespace Gina.Utils.Lib.Routing
|
|
16
|
-
* @author Rhinostone <gina@rhinostone.com>
|
|
17
|
-
* */
|
|
18
|
-
|
|
19
|
-
function Routing() {
|
|
20
|
-
|
|
21
|
-
var self = {};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @function getRoute
|
|
25
|
-
*
|
|
26
|
-
* @param {string} rule e.g.: <name>[@<bundle>]
|
|
27
|
-
* @param {object} params
|
|
28
|
-
*
|
|
29
|
-
* @return {object} route
|
|
30
|
-
* */
|
|
31
|
-
self.getRoute = function(rule, params) {
|
|
32
|
-
|
|
33
|
-
var config = getContext('gina').config
|
|
34
|
-
, bundle = null;
|
|
35
|
-
|
|
36
|
-
if ( /\@/.test(rule) ) {
|
|
37
|
-
bundle = rule.split(/\@/)[1];
|
|
38
|
-
} else {
|
|
39
|
-
bundle = config.bundle
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var env = config.env
|
|
43
|
-
, routing = config.getRouting(bundle, env);
|
|
44
|
-
|
|
45
|
-
if ( typeof(routing[rule]) == 'undefined' ) {
|
|
46
|
-
throw new Error('[ RoutingHelper::getRouting(rule, params) ] : `' +rule + '` not found !')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var route = JSON.parse(JSON.stringify(routing[rule]));
|
|
50
|
-
var variable = null
|
|
51
|
-
for (var p in route.param) {
|
|
52
|
-
if ( /^:/.test(route.param[p]) ) {
|
|
53
|
-
variable = route.param[p].substr(1);
|
|
54
|
-
if ( typeof(params[variable]) != 'undefined') {
|
|
55
|
-
route.url = route.url.replace( new RegExp('(/:'+variable+'|/:'+variable+'$)', 'g'), '/'+ params[variable] );
|
|
56
|
-
|
|
57
|
-
if ( typeof(route.param.path) != 'undefined' && /:/.test(route.param.path) ) {
|
|
58
|
-
route.param.path = route.param.path.replace( new RegExp('(:'+variable+'/|:'+variable+'$)', 'g'), params[variable]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if ( Array.isArray(route.url) ) {
|
|
65
|
-
route.url = route.url[0]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return route
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Get route by url
|
|
74
|
-
* N.B.: this will only work with rules declared with `GET` method property
|
|
75
|
-
*
|
|
76
|
-
* @function getRouteByUrl
|
|
77
|
-
*
|
|
78
|
-
* @param {string} url e.g.: /bundle/some/url/path or http
|
|
79
|
-
* @param {string} [bundle] targeted bundle
|
|
80
|
-
*
|
|
81
|
-
* @return {object} route
|
|
82
|
-
* */
|
|
83
|
-
self.getRouteByUrl = function (url, bundle) {
|
|
84
|
-
|
|
85
|
-
var matched = false
|
|
86
|
-
, pathname = null
|
|
87
|
-
, gnaCtx = getContext('gina')
|
|
88
|
-
, config = gnaCtx.config
|
|
89
|
-
, bundle = ( typeof(bundle) != 'undefined' ) ? bundle : config.bundle
|
|
90
|
-
, env = config.env
|
|
91
|
-
, router = new gnaCtx.Router(env)
|
|
92
|
-
, routing = config.getRouting(bundle, env)
|
|
93
|
-
, isRoute = null
|
|
94
|
-
, route = null
|
|
95
|
-
, isXMLRequest = getContext().router.isProcessingXMLRequest
|
|
96
|
-
;
|
|
97
|
-
|
|
98
|
-
var hostname = config.envConf[bundle][env].hostname
|
|
99
|
-
, uri = config.envConf[bundle][env].server.webroot
|
|
100
|
-
, prefix = hostname + uri;
|
|
101
|
-
|
|
102
|
-
pathname = url.replace( new RegExp('^'+ hostname), '');
|
|
103
|
-
|
|
104
|
-
var request = {
|
|
105
|
-
routing: {
|
|
106
|
-
path: unescape(pathname)
|
|
107
|
-
},
|
|
108
|
-
method: 'GET',
|
|
109
|
-
params: {}
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
out:
|
|
114
|
-
for (var rule in routing) {
|
|
115
|
-
if (typeof(routing[rule]['param']) == 'undefined')
|
|
116
|
-
break;
|
|
117
|
-
|
|
118
|
-
if (routing[rule].bundle != bundle) continue;
|
|
119
|
-
|
|
120
|
-
// this will only work with rules declared with `GET` method property
|
|
121
|
-
if ( typeof(routing[rule].method) != 'undefined' && !/^get$/i.test(routing[rule].method) ) continue;
|
|
122
|
-
|
|
123
|
-
//Preparing params to relay to the router.
|
|
124
|
-
params = {
|
|
125
|
-
method : routing[rule].method || 'GET',
|
|
126
|
-
requirements : routing[rule].requirements,
|
|
127
|
-
namespace : routing[rule].namespace || undefined,
|
|
128
|
-
url : unescape(pathname), /// avoid %20
|
|
129
|
-
rule : routing[rule].originalRule || rule,
|
|
130
|
-
param : routing[rule].param,
|
|
131
|
-
middleware : routing[rule].middleware,
|
|
132
|
-
bundle : routing[rule].bundle,
|
|
133
|
-
isXMLRequest : isXMLRequest
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
//Parsing for the right url.
|
|
137
|
-
try {
|
|
138
|
-
isRoute = router.compareUrls(request, params, routing[rule].url);
|
|
139
|
-
} catch (err) {
|
|
140
|
-
throw new Error('Rule [ '+rule+' ] needs your attention.\n' + err.stack);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (isRoute.past) {
|
|
145
|
-
|
|
146
|
-
route = JSON.parse(JSON.stringify(routing[rule]));
|
|
147
|
-
|
|
148
|
-
matched = true;
|
|
149
|
-
isRoute = {};
|
|
150
|
-
break out;
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (!matched) {
|
|
156
|
-
throw new Error('[ RoutingHelper::getRouteByUrl(rule[, bundle]) ] : route not found for url: `' + url + '` !')
|
|
157
|
-
} else {
|
|
158
|
-
return route
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return self
|
|
164
|
-
};
|
|
165
|
-
module.exports = Routing()
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="{{ page.lang }}">
|
|
3
|
-
<head>
|
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<title>{{ page.title }}</title>
|
|
7
|
-
<meta name="generator" content="Gina I/O">
|
|
8
|
-
<meta name="expires" content="never">
|
|
9
|
-
<meta name="robots" content="index, follow, noarchive">
|
|
10
|
-
<meta name="distribution" content="global">
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
12
|
-
{{ page.stylesheets }}
|
|
13
|
-
{{ page.scripts }}
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div>
|
|
17
|
-
{{ page.content }}
|
|
18
|
-
</div>
|
|
19
|
-
{{ page.handler }}
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|