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
|
@@ -1,686 +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
|
-
/**
|
|
10
|
-
* AppCommand Class
|
|
11
|
-
*
|
|
12
|
-
* @package Gina.Utils.Cmd
|
|
13
|
-
* @author Rhinostone <gina@rhinostone.com>
|
|
14
|
-
*/
|
|
15
|
-
var fs = require('fs');
|
|
16
|
-
var spawn = require('child_process').spawn;
|
|
17
|
-
var os = require('os');
|
|
18
|
-
var console = require('../logger');
|
|
19
|
-
var Proc = require('../proc');
|
|
20
|
-
var EventEmitter = require('events').EventEmitter;
|
|
21
|
-
var inherits = require('../inherits');
|
|
22
|
-
//var generator = require('../generator');
|
|
23
|
-
|
|
24
|
-
var AppCommand = {
|
|
25
|
-
opt : {},
|
|
26
|
-
allowedOptions : [
|
|
27
|
-
'-a',
|
|
28
|
-
'--add',
|
|
29
|
-
'-b',
|
|
30
|
-
'--build',
|
|
31
|
-
'-d',
|
|
32
|
-
'--delete',
|
|
33
|
-
'--deploy',
|
|
34
|
-
'--deploy-init',
|
|
35
|
-
'-i',
|
|
36
|
-
'--init',
|
|
37
|
-
'-s',
|
|
38
|
-
'--start',
|
|
39
|
-
'-av',
|
|
40
|
-
'-a -v',
|
|
41
|
-
'--add-views'
|
|
42
|
-
//'-k',
|
|
43
|
-
//'--kill',
|
|
44
|
-
//'--stop',
|
|
45
|
-
//'-r',
|
|
46
|
-
//'--restart',
|
|
47
|
-
//'-t',
|
|
48
|
-
//'--status'
|
|
49
|
-
],
|
|
50
|
-
allowedArguments : [
|
|
51
|
-
'-t',
|
|
52
|
-
'--type',
|
|
53
|
-
'dev',
|
|
54
|
-
'debug',
|
|
55
|
-
//'--stack',
|
|
56
|
-
'stage',
|
|
57
|
-
'prod'
|
|
58
|
-
],
|
|
59
|
-
envs : ['dev', 'debug', 'stage', 'prod'],
|
|
60
|
-
allowedTypes : [
|
|
61
|
-
'blog',
|
|
62
|
-
'cms',
|
|
63
|
-
'app'
|
|
64
|
-
],
|
|
65
|
-
checkEnv : function() {
|
|
66
|
-
var envFound = false;
|
|
67
|
-
var envs = this.envs;
|
|
68
|
-
|
|
69
|
-
if (envs.indexOf(process.argv[4]) > -1 || envs.indexOf(process.argv[3]) > -1) {
|
|
70
|
-
envFound = true;
|
|
71
|
-
this.env = process.argv[4] || process.argv[3]
|
|
72
|
-
} else {
|
|
73
|
-
process.argv[4] = this.env
|
|
74
|
-
}
|
|
75
|
-
return envFound
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Run cmd
|
|
79
|
-
*
|
|
80
|
-
* @param {object} options
|
|
81
|
-
* @param {object} message
|
|
82
|
-
* @param {boolean} longCMD
|
|
83
|
-
* */
|
|
84
|
-
run : function(options, message, longCMD){
|
|
85
|
-
|
|
86
|
-
//inherited from utils.
|
|
87
|
-
var root = getPath('root');
|
|
88
|
-
//Setting log paths.
|
|
89
|
-
// console.getLogger({
|
|
90
|
-
// name: 'gina',
|
|
91
|
-
// containers: [
|
|
92
|
-
// {
|
|
93
|
-
// type: 'file',
|
|
94
|
-
// //template: '',
|
|
95
|
-
// path: _(root + '/logs'),
|
|
96
|
-
// keep: 5
|
|
97
|
-
// }
|
|
98
|
-
// ]
|
|
99
|
-
// });
|
|
100
|
-
|
|
101
|
-
this.options = options;
|
|
102
|
-
this.msg = message;
|
|
103
|
-
this.opt['option'] = process.argv[2];
|
|
104
|
-
this.env = 'prod'; // by default
|
|
105
|
-
var envFound = this.checkEnv();
|
|
106
|
-
|
|
107
|
-
if (process.argv[2] == '-s' || process.argv[2] == '--start') {
|
|
108
|
-
//use registeredEnvs for this.....
|
|
109
|
-
if (process.argv.length >= 5 && !envFound) {
|
|
110
|
-
this.env = 'prod';
|
|
111
|
-
process.argv.splice(4, 0, this.env);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
this.PID = new Proc('gina', process);
|
|
115
|
-
//herited from gna.js.
|
|
116
|
-
|
|
117
|
-
} else {
|
|
118
|
-
this.PID = new Proc('gina', process, false);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
this.PID.setMaster(process.pid);
|
|
122
|
-
|
|
123
|
-
this.opt['argument'] = process.argv[4];
|
|
124
|
-
|
|
125
|
-
for (var a = 4, aLen = process.argv.length; a < aLen; ++a) {
|
|
126
|
-
if (process.argv[a] != undefined && process.argv[a].indexOf('=')) {
|
|
127
|
-
var p = process.argv[a].split(/=/);
|
|
128
|
-
this.opt[p[0]] = p[1];
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
this.bundle = process.argv[3].replace(/.js/, '');
|
|
133
|
-
|
|
134
|
-
// logger.setEnv(this.env);
|
|
135
|
-
// logger.init({
|
|
136
|
-
// logs : _(this.options.root + '/logs'),
|
|
137
|
-
// core : _(this.options.core)
|
|
138
|
-
// });
|
|
139
|
-
process.env.NODE_ENV = this.env;
|
|
140
|
-
this.isAllowedOption(this.opt)
|
|
141
|
-
},
|
|
142
|
-
isAllowedOption : function(opt){
|
|
143
|
-
var found = false;
|
|
144
|
-
for (var i=0; i<this.allowedOptions.length; ++i) {
|
|
145
|
-
if (opt['option'] == this.allowedOptions[i]) {
|
|
146
|
-
found = true;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (found) {
|
|
151
|
-
this.map(opt);
|
|
152
|
-
} else {
|
|
153
|
-
console.error(this.msg.default[0].replace(
|
|
154
|
-
"%command%",
|
|
155
|
-
"gina " + opt['option']
|
|
156
|
-
) +'\n'+ this.msg.app[3]);
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
isAllowedArgument : function(opt, callback){
|
|
160
|
-
var found = false;
|
|
161
|
-
for (var i=0; i<this.allowedArguments.length; ++i) {
|
|
162
|
-
if (this.opt['argument'] == this.allowedArguments[i]) {
|
|
163
|
-
found = true;
|
|
164
|
-
break
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (found || this.opt['argument'] == undefined) {
|
|
168
|
-
callback(true)
|
|
169
|
-
} else {
|
|
170
|
-
console.error(this.msg.default[2]
|
|
171
|
-
.replace("%arg%", this.opt['argument']));
|
|
172
|
-
callback(false)
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
isAllowedType : function(opt, callback){
|
|
176
|
-
var found = false;
|
|
177
|
-
for (var i=0; i<this.allowedTypes.length; ++i) {
|
|
178
|
-
if (opt['type'] == this.allowedTypes[i]) {
|
|
179
|
-
found = true;
|
|
180
|
-
break
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
callback(found)
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
isRealApp : function(callback){
|
|
187
|
-
var self = this;
|
|
188
|
-
var allClear = false;
|
|
189
|
-
var p, d;
|
|
190
|
-
var bundle = this.bundle;
|
|
191
|
-
var env = this.env;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
try {
|
|
195
|
-
//This is mostly for dev.
|
|
196
|
-
var pkg = require( _(this.options.root + '/project.json') ).bundles;
|
|
197
|
-
if ( typeof(pkg[bundle].release.version) == 'undefined' && typeof(pkg[bundle].tag) != 'undefined') {
|
|
198
|
-
pkg[bundle].release.version = pkg[bundle].tag
|
|
199
|
-
}
|
|
200
|
-
if (
|
|
201
|
-
pkg[bundle] != 'undefined' && pkg[bundle]['src'] != 'undefined' && env == 'dev'
|
|
202
|
-
|| pkg[bundle] != 'undefined' && pkg[bundle]['src'] != 'undefined' && env == 'debug'
|
|
203
|
-
) {
|
|
204
|
-
var path = pkg[bundle].src;
|
|
205
|
-
|
|
206
|
-
p = _( this.options.root +"/"+ path );//path.replace('/' + bundle, '')
|
|
207
|
-
d = _( this.options.root +"/"+ path + '/index.js' );
|
|
208
|
-
this.bundleDir = path.replace('/' + bundle, '');
|
|
209
|
-
setContext("bundle_dir", this.bundleDir);
|
|
210
|
-
this.bundlesPath = _( this.options.root +"/"+ this.bundleDir );
|
|
211
|
-
this.bundleInit = d;
|
|
212
|
-
|
|
213
|
-
} else {
|
|
214
|
-
//Others releases.
|
|
215
|
-
var path = 'releases/'+ bundle +'/' + env +'/'+ pkg[bundle].release.version;
|
|
216
|
-
var version = pkg[bundle].release.version;
|
|
217
|
-
p = _( this.options.root +"/"+ path );//path.replace('/' + bundle, '')
|
|
218
|
-
d = _( this.options.root +"/"+ path + '/index.js' );
|
|
219
|
-
|
|
220
|
-
this.bundleDir = path;
|
|
221
|
-
this.bundlesPath = _(this.options.root + '/'+ this.bundleDir);
|
|
222
|
-
this.bundleInit = d;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
} catch (err) {
|
|
226
|
-
// default bundlesPath.
|
|
227
|
-
// TODO - log warn ?
|
|
228
|
-
this.bundleDir = 'bundles';
|
|
229
|
-
this.bundlesPath = _(this.options.root + '/'+this.bundleDir);
|
|
230
|
-
p = _(this.options.root + '/'+this.bundleDir+'/' + this.bundle);
|
|
231
|
-
d = _(this.options.root + '/'+this.bundleDir+'/' + this.bundle + '/index.js');
|
|
232
|
-
this.bundleInit = d;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
//p = _(this.options.root + '/' + this.bundle + '.js'),
|
|
238
|
-
console.info("checking... ", p, " && ", d, " => ", this.bundleDir);
|
|
239
|
-
//process.exit(42);
|
|
240
|
-
//Checking root.
|
|
241
|
-
fs.exists(d, function(exists) {
|
|
242
|
-
if (exists) {
|
|
243
|
-
//checking bundle directory.
|
|
244
|
-
fs.stat(p, function(err, stats) {
|
|
245
|
-
|
|
246
|
-
if (err) {
|
|
247
|
-
callback(err)
|
|
248
|
-
} else {
|
|
249
|
-
|
|
250
|
-
if ( stats.isDirectory() ) {
|
|
251
|
-
callback(false)
|
|
252
|
-
} else {
|
|
253
|
-
callback('[ '+ d +' ] is not a directory')
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
} else {
|
|
258
|
-
callback('[ '+ d +' ] does not exists')
|
|
259
|
-
}
|
|
260
|
-
})
|
|
261
|
-
},
|
|
262
|
-
map : function(opt){
|
|
263
|
-
var self = this;
|
|
264
|
-
|
|
265
|
-
switch (opt['option']) {
|
|
266
|
-
case '-a':
|
|
267
|
-
case '--add':
|
|
268
|
-
this.env = 'dev';
|
|
269
|
-
this.isAllowedArgument(opt, function(found) {
|
|
270
|
-
if (found) {
|
|
271
|
-
self.add(opt);
|
|
272
|
-
} else {
|
|
273
|
-
var msg = self.msg.app[2]
|
|
274
|
-
.replace("%type%", opt['type'])
|
|
275
|
-
.replace("%command%", 'gina '
|
|
276
|
-
+ opt['option'] +' '
|
|
277
|
-
+ self.bundle
|
|
278
|
-
+' '+ opt['argument']
|
|
279
|
-
+' '+ opt['type']);
|
|
280
|
-
console.error(msg);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
break;
|
|
284
|
-
|
|
285
|
-
case '-b':
|
|
286
|
-
case '--build':
|
|
287
|
-
|
|
288
|
-
self.isAllowedArgument(opt, function(found){
|
|
289
|
-
if (found && self.env != 'dev') {
|
|
290
|
-
self.build(opt.option);
|
|
291
|
-
} else {
|
|
292
|
-
var msg = self.msg.app[5]
|
|
293
|
-
.replace("%env%", self.env)
|
|
294
|
-
.replace("%bundle%", self.bundle);
|
|
295
|
-
|
|
296
|
-
console.error(msg);
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
break;
|
|
300
|
-
|
|
301
|
-
case '-d':
|
|
302
|
-
case '--delete':
|
|
303
|
-
this.env = 'dev';
|
|
304
|
-
this.remove(opt);
|
|
305
|
-
break;
|
|
306
|
-
|
|
307
|
-
case '--deploy':
|
|
308
|
-
case '--deploy-init':
|
|
309
|
-
self.isAllowedArgument(opt, function(found){
|
|
310
|
-
if (found) {
|
|
311
|
-
self.deploy(opt.option);
|
|
312
|
-
}
|
|
313
|
-
return false;
|
|
314
|
-
});
|
|
315
|
-
break;
|
|
316
|
-
|
|
317
|
-
case '-i':
|
|
318
|
-
case '--init':
|
|
319
|
-
self.isAllowedArgument(opt, function(found){
|
|
320
|
-
if (found) {
|
|
321
|
-
self.initProject(opt.option);
|
|
322
|
-
}
|
|
323
|
-
return false;
|
|
324
|
-
});
|
|
325
|
-
break;
|
|
326
|
-
|
|
327
|
-
case '-k':
|
|
328
|
-
case '--kill':
|
|
329
|
-
case '--stop':
|
|
330
|
-
this.kill(opt);
|
|
331
|
-
break;
|
|
332
|
-
|
|
333
|
-
case '-r':
|
|
334
|
-
case '--restart':
|
|
335
|
-
this.restart(opt);
|
|
336
|
-
break;
|
|
337
|
-
|
|
338
|
-
case '-s':
|
|
339
|
-
case '--start':
|
|
340
|
-
self.isAllowedArgument(opt, function(found){
|
|
341
|
-
if (found) {
|
|
342
|
-
self.start(opt);
|
|
343
|
-
}
|
|
344
|
-
return false;
|
|
345
|
-
});
|
|
346
|
-
break;
|
|
347
|
-
|
|
348
|
-
case '-av':
|
|
349
|
-
case '-a -v':
|
|
350
|
-
case '--add-views':
|
|
351
|
-
this.env = 'dev';
|
|
352
|
-
this.addViews();
|
|
353
|
-
break;
|
|
354
|
-
|
|
355
|
-
case '-t':
|
|
356
|
-
case '--status':
|
|
357
|
-
this.env = 'dev';
|
|
358
|
-
this.getStatus(opt);
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
abort : function(code, err) {
|
|
363
|
-
|
|
364
|
-
},
|
|
365
|
-
add : function(opt) {
|
|
366
|
-
var project = _(getPath('root') + '/project.json');
|
|
367
|
-
var envDotJson = _(getPath('root') + '/env.json');
|
|
368
|
-
var bundle = this.bundle;
|
|
369
|
-
|
|
370
|
-
//is Real bundle ?.
|
|
371
|
-
if ( typeof(bundle) != 'undefined' ) {
|
|
372
|
-
var addCmd = require('./gina-add-bundle')(opt, project, envDotJson, bundle)
|
|
373
|
-
} else {
|
|
374
|
-
console.warn('bundle is undefined !')
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
addViews : function() {
|
|
378
|
-
var self = this;
|
|
379
|
-
this.isRealApp( function(err) {
|
|
380
|
-
var real = false;
|
|
381
|
-
if (err) {
|
|
382
|
-
console.error(err.stack);
|
|
383
|
-
process.exit(1)
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
try {
|
|
387
|
-
var addViews = require('./gina-add-views')(self.bundle, self.env)
|
|
388
|
-
} catch (err) {
|
|
389
|
-
console.error(err.stack);
|
|
390
|
-
process.exit(1)
|
|
391
|
-
}
|
|
392
|
-
})
|
|
393
|
-
},
|
|
394
|
-
build : function(opt, argument) {
|
|
395
|
-
|
|
396
|
-
console.info('Releasing build...');
|
|
397
|
-
var bundle = this.bundle;
|
|
398
|
-
var projectConfPath = _(getPath('root') + '/project.json');
|
|
399
|
-
try {
|
|
400
|
-
var project = require(projectConfPath);
|
|
401
|
-
} catch (err) {
|
|
402
|
-
console.warn(err.stack);
|
|
403
|
-
}
|
|
404
|
-
var defaultBuildScript = 'script/build.js';
|
|
405
|
-
if ( typeof(project.bundles[bundle]) == 'undefined') {
|
|
406
|
-
console.error('bundle [ '+bundle+' ] not found in project');
|
|
407
|
-
process.exit(1)
|
|
408
|
-
}
|
|
409
|
-
var defaultBuildScriptPath = _(_( getPath('root') +'/'+ project.bundles[bundle].src +'/'+defaultBuildScript ));
|
|
410
|
-
|
|
411
|
-
//Getting project infos.
|
|
412
|
-
try {
|
|
413
|
-
//is Real bundle ?.
|
|
414
|
-
if ( typeof(bundle) != 'undefined' && typeof(project.bundles[bundle]) != 'undefined') {
|
|
415
|
-
var BuildCmd = require('./gina-build');
|
|
416
|
-
if (
|
|
417
|
-
typeof(project.bundles[bundle]['script']) != 'undefined' && typeof(project.bundles[bundle]['script']['build']) != 'undefined' ||
|
|
418
|
-
fs.existsSync(defaultBuildScriptPath)
|
|
419
|
-
) {
|
|
420
|
-
// found default build script but, no build description found in project.json
|
|
421
|
-
if ( typeof(project.bundles[bundle]['script']) == 'undefined' ) { // updating project.json then
|
|
422
|
-
if ( typeof(project.bundles[bundle]['script']) == 'undefined') {
|
|
423
|
-
project.bundles[bundle]['script'] = {}
|
|
424
|
-
}
|
|
425
|
-
project.bundles[bundle]['script']['build'] = defaultBuildScript;
|
|
426
|
-
fs.writeFileSync(projectConfPath, JSON.stringify(project, null, 4))
|
|
427
|
-
}
|
|
428
|
-
var CustomBuild = require(_(getPath('root') +'/'+ project.bundles[bundle].src + '/' + project.bundles[bundle].script.build));
|
|
429
|
-
CustomBuild = inherits(CustomBuild, BuildCmd);
|
|
430
|
-
|
|
431
|
-
var buildCmd = new CustomBuild(project, bundle);
|
|
432
|
-
} else {
|
|
433
|
-
var buildCmd = new BuildCmd(project, bundle);
|
|
434
|
-
buildCmd.init()
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
} else if (bundle == undefined) {
|
|
438
|
-
var buildCmd = require('./gina-build')(project);
|
|
439
|
-
buildCmd.init()
|
|
440
|
-
} else {
|
|
441
|
-
console.error('Bundle [ '+ bundle +' ] not found.')
|
|
442
|
-
}
|
|
443
|
-
} catch (err) {
|
|
444
|
-
console.error(err.stack);
|
|
445
|
-
process.exit(1)
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
initProject : function() {
|
|
450
|
-
var project = process.argv[3];
|
|
451
|
-
try {
|
|
452
|
-
console.log('creating new project...');
|
|
453
|
-
var initCmd = require('./gina-init-project')(project)
|
|
454
|
-
} catch (err) {
|
|
455
|
-
console.error(err.stack);
|
|
456
|
-
process.exit(1)
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
remove : function(opt) {
|
|
460
|
-
try {
|
|
461
|
-
var bundle = this.bundle;
|
|
462
|
-
var project = _(getPath('root') + '/project.json');
|
|
463
|
-
var projectData = require(project);
|
|
464
|
-
var envPath = _(getPath('root') + '/env.json');
|
|
465
|
-
var isWorking = false;
|
|
466
|
-
|
|
467
|
-
if (fs.existsSync(_(getPath('root')+'/tmp/pid'))) {
|
|
468
|
-
var pids = fs.readdirSync(getPath('root')+'/tmp/pid');
|
|
469
|
-
var i = pids.length-1;
|
|
470
|
-
var tmpContent = null;
|
|
471
|
-
while ( i >= 0 && tmpContent == null) {
|
|
472
|
-
tmpContent = fs.readFileSync(getPath('root')+'/tmp/pid/'+pids[i]);
|
|
473
|
-
if (tmpContent != bundle) {
|
|
474
|
-
tmpContent = null
|
|
475
|
-
}
|
|
476
|
-
--i
|
|
477
|
-
}
|
|
478
|
-
if (tmpContent != null) {
|
|
479
|
-
isWorking = true
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if ( typeof(bundle) != 'undefined' && typeof(projectData.bundles[bundle]) != 'undefined' && !isWorking) {
|
|
484
|
-
var DeleteCmd = require('./gina-delete-bundle');
|
|
485
|
-
var deleteCmd = null;
|
|
486
|
-
if ( typeof(projectData.bundles[bundle]['script']) != 'undefined' && typeof(projectData.bundles[bundle]['script']['delete']) != 'undefined') {
|
|
487
|
-
var CustomDelete = require(_(getPath('root') +'/'+ projectData.bundles[bundle].src + '/' + projectData.bundles[bundle].script.delete));
|
|
488
|
-
CustomDelete = inherits(CustomDelete, DeleteCmd);
|
|
489
|
-
CustomDelete = inherits(CustomDelete, EventEmitter);
|
|
490
|
-
deleteCmd = new CustomDelete(project, envPath, bundle)
|
|
491
|
-
} else {
|
|
492
|
-
DeleteCmd = inherits(DeleteCmd, EventEmitter);
|
|
493
|
-
deleteCmd = new DeleteCmd(project, envPath, bundle);
|
|
494
|
-
deleteCmd.init()
|
|
495
|
-
}
|
|
496
|
-
} else if (typeof(bundle) == 'undefined') {
|
|
497
|
-
console.log('bundle is undefined !')
|
|
498
|
-
} else if (typeof(projectData.bundles[bundle]) == 'undefined') {
|
|
499
|
-
console.error('Bundle [ '+bundle+' ] does not exist !')
|
|
500
|
-
} else {
|
|
501
|
-
console.error('Please, stop Bundle [ '+bundle+' ] before removing !')
|
|
502
|
-
}
|
|
503
|
-
} catch (err) {
|
|
504
|
-
console.error(err.stack);
|
|
505
|
-
process.exit(1)
|
|
506
|
-
}
|
|
507
|
-
},
|
|
508
|
-
|
|
509
|
-
deploy : function(opt) {
|
|
510
|
-
console.log('env ?? ', this.env, opt);
|
|
511
|
-
opt = opt.replace(/(--deploy-|--deploy)/, '');
|
|
512
|
-
|
|
513
|
-
// loading options
|
|
514
|
-
try {
|
|
515
|
-
var conf = require(getPath('root') + '/deploy/' + this.env + '/config.json');
|
|
516
|
-
conf.env = this.env;
|
|
517
|
-
} catch(err) {
|
|
518
|
-
console.error(err.stack);
|
|
519
|
-
process.exit(1);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
var root = getPath('root') + '/deploy';
|
|
523
|
-
var file = (opt) ? opt : 'script'; // init, or custom script
|
|
524
|
-
|
|
525
|
-
var userScript = root +'/'+ this.env + '/' + file+'.js';
|
|
526
|
-
var path = ( typeof(conf.strategy) != 'undefined' && opt == '' ) ? root +'/bin/'+ conf.strategy + '.js' : userScript;
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
if ( fs.existsSync(path) && path != userScript ) {
|
|
530
|
-
|
|
531
|
-
// user script and available strategies inherit from Deploy
|
|
532
|
-
// if a strategy is applied, you can catch complete event to do something in the end
|
|
533
|
-
if ( fs.existsSync(userScript) && typeof(conf.strategy) != 'undefined') {
|
|
534
|
-
var UserStrategy = require( userScript );
|
|
535
|
-
var deploy = new UserStrategy(conf);
|
|
536
|
-
} else {
|
|
537
|
-
var Strategy = require( path );
|
|
538
|
-
var deploy = new Strategy(conf);
|
|
539
|
-
}
|
|
540
|
-
} else if (path == userScript) {
|
|
541
|
-
var UserStrategy = require( userScript );
|
|
542
|
-
var deploy = new UserStrategy(conf);
|
|
543
|
-
//deploy.onComplete( function(err) {
|
|
544
|
-
// console.info('user\'s deploy script completed without errors');
|
|
545
|
-
//})
|
|
546
|
-
} else {
|
|
547
|
-
console.error('no deploy strategy found')
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
restart : function(opt) {
|
|
551
|
-
console.info('restarting app now...', opt);
|
|
552
|
-
},
|
|
553
|
-
/**
|
|
554
|
-
* Start server
|
|
555
|
-
* @param {object} opt Options
|
|
556
|
-
* */
|
|
557
|
-
start : function(opt) {
|
|
558
|
-
var self = this;
|
|
559
|
-
|
|
560
|
-
console.debug('starting with options ', opt);
|
|
561
|
-
this.isRealApp( function(err) {
|
|
562
|
-
var real = false;
|
|
563
|
-
if (err) {
|
|
564
|
-
console.error(err.stack)
|
|
565
|
-
} else {
|
|
566
|
-
real = true
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
// var loggerInstance = new (Winston.Logger)({
|
|
570
|
-
// levels : logger.custom.levels,
|
|
571
|
-
// transports : [
|
|
572
|
-
// new (Winston.transports.Console)({
|
|
573
|
-
// colorize: true
|
|
574
|
-
// })
|
|
575
|
-
// ],
|
|
576
|
-
// colors : logger.custom.colors
|
|
577
|
-
// });
|
|
578
|
-
|
|
579
|
-
//setContext('logger', loggerInstance);
|
|
580
|
-
|
|
581
|
-
if (!real) {
|
|
582
|
-
console.error(self.msg.app[4].replace("%app%", self.bundle))
|
|
583
|
-
|
|
584
|
-
} else {
|
|
585
|
-
|
|
586
|
-
var appPath = self.bundleInit;
|
|
587
|
-
var isPath = (/\//).test(appPath);
|
|
588
|
-
if (!isPath) {
|
|
589
|
-
appPath = _(self.bundlesPath +'/'+ appPath + '/index');
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
process.list = (process.list == undefined) ? [] : process.list;
|
|
593
|
-
setContext('processList', process.list);
|
|
594
|
-
setContext('gina.process', process.pid);
|
|
595
|
-
var params = [
|
|
596
|
-
appPath,
|
|
597
|
-
opt['argument'],
|
|
598
|
-
JSON.stringify( getContext() )//Passing context to child.
|
|
599
|
-
];
|
|
600
|
-
|
|
601
|
-
// passing V8 options
|
|
602
|
-
for (var name in opt) {
|
|
603
|
-
if ( /\-\-/.test(name) ) {
|
|
604
|
-
params.unshift(name +'='+ opt[name])
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
for (var i=0; i<params.length; ++i) {
|
|
609
|
-
if (params[i] == '') {
|
|
610
|
-
params.splice(i,1);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
self.prc = spawn('node', params,
|
|
615
|
-
{
|
|
616
|
-
detached : true
|
|
617
|
-
}
|
|
618
|
-
);
|
|
619
|
-
self.PID.register(self.bundle, self.prc.pid);
|
|
620
|
-
|
|
621
|
-
//On message.
|
|
622
|
-
self.prc.stdout.setEncoding('utf8');//Set encoding.
|
|
623
|
-
self.prc.stdout.on('data', function(data){
|
|
624
|
-
if ( typeof(data) == "undefined" )
|
|
625
|
-
var data = "";
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
//Catching all console.log(..)
|
|
629
|
-
// TODO - Bind or prototype console.log => logger.trace(...) to have the same stack time/order
|
|
630
|
-
if ( data.substr(0, 5) != "[LOG]" ) {
|
|
631
|
-
//console.log("traces => ", data);
|
|
632
|
-
var out = data;
|
|
633
|
-
//loggerInstance["trace"](out);//Not shared with the main flow...
|
|
634
|
-
console.info(out.toString());
|
|
635
|
-
//fix it...
|
|
636
|
-
//logger.warn('gina', 'CONSOLE:LOG:1', data);
|
|
637
|
-
} else {
|
|
638
|
-
//var data = JSON.parse(data);
|
|
639
|
-
//console.log("[traces] => ", data);
|
|
640
|
-
|
|
641
|
-
// TODO - Few exception to take in consideration.
|
|
642
|
-
//loggerInstance.onMessage(data, function(msg){
|
|
643
|
-
|
|
644
|
-
// logger.onMessage(data, function(msg){
|
|
645
|
-
// loggerInstance[msg.level](msg);
|
|
646
|
-
//
|
|
647
|
-
// //logger[msg.level](msg);
|
|
648
|
-
// });
|
|
649
|
-
console.info(data.toString())
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
});
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
//On error. Might be useless.
|
|
656
|
-
self.prc.stderr.setEncoding('utf8');//Set encoding.
|
|
657
|
-
self.prc.stderr.on('data', function(err) {
|
|
658
|
-
console.error(err.toString());
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
});//EO this.isRealApp.
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
getStatus : function(opt){
|
|
667
|
-
console.info('getting status for app now...', opt);
|
|
668
|
-
},
|
|
669
|
-
/**
|
|
670
|
-
* Stop server
|
|
671
|
-
* @param {Object} opt Options
|
|
672
|
-
* */
|
|
673
|
-
stop : function(opt){
|
|
674
|
-
var self = this, row = "";
|
|
675
|
-
|
|
676
|
-
this.isRealApp( function(err){
|
|
677
|
-
if (err) {
|
|
678
|
-
console.error(err.stack);
|
|
679
|
-
console.error(self.msg.app[4].replace("%app%", self.bundle));
|
|
680
|
-
process.exit(1);
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
module.exports = AppCommand;
|