gina 0.0.9-p91b → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.2/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.2}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.2/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.2/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.2/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.2/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.2/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.2/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.2/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.2/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.2/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.2/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.2/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.2/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.2/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.2/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.2/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.2/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.2/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.2/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.2/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.2/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.2/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.2/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.2/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.2/core/router.js +664 -0
- package/framework/v0.1.1-alpha.2/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.2/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.2/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.2/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.2/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.2/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.2/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.2/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.2/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.2/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.2/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.2/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.2/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.2/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.2/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.2/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.2/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.2/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.2/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.2}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.2/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.2/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.2/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.2/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.2/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.2/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.2/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.2/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.2/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.2/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.2/lib/logger/src/main.js +734 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.2/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.2/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.2/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.2/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.2/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.2/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.2/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.2}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.2/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13731
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -788
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
var console = lib.logger;
|
|
3
|
+
/**
|
|
4
|
+
* List bundles for a given project
|
|
5
|
+
*
|
|
6
|
+
* e.g.
|
|
7
|
+
* gina bundle:list [ @<project_name> ]
|
|
8
|
+
* gina bundle:list --all
|
|
9
|
+
*
|
|
10
|
+
* */
|
|
11
|
+
function List(opt, cmd) {
|
|
12
|
+
var self = {};
|
|
13
|
+
|
|
14
|
+
var init = function() {
|
|
15
|
+
self.projects = require(_(GINA_HOMEDIR + '/projects.json'));
|
|
16
|
+
|
|
17
|
+
if ( typeof(process.argv[3]) != 'undefined') {
|
|
18
|
+
if (process.argv[3] === '--all') {
|
|
19
|
+
listAll()
|
|
20
|
+
} else if ( !isValidName(process.argv[3]) ) {
|
|
21
|
+
console.error('[ '+process.argv[3]+' ] is not a valid project name. Please, try something else: @[a-z0-9_.].');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
// is current path == project path ?
|
|
26
|
+
var root = process.cwd();
|
|
27
|
+
var name = new _(root).toArray().last();
|
|
28
|
+
if ( isDefined(name) ) {
|
|
29
|
+
self.name = name
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if ( typeof(self.name) == 'undefined' ) {
|
|
34
|
+
listAll()
|
|
35
|
+
} else if ( typeof(self.name) != 'undefined' && isDefined(self.name) ) {
|
|
36
|
+
listProjectOnly()
|
|
37
|
+
} else {
|
|
38
|
+
console.error('[ '+self.name+' ] is not a valid project name.');
|
|
39
|
+
process.exit(1)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var isDefined = function(name) {
|
|
44
|
+
if ( typeof(self.projects[name]) != 'undefined' ) {
|
|
45
|
+
return true
|
|
46
|
+
}
|
|
47
|
+
return false
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var isValidName = function(name) {
|
|
51
|
+
if (name == undefined) return false;
|
|
52
|
+
|
|
53
|
+
self.name = name.replace(/\@/, '');
|
|
54
|
+
var patt = /^[a-z0-9_.]/;
|
|
55
|
+
return patt.test(self.name)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
var listAll = function() {
|
|
60
|
+
var projects = self.projects
|
|
61
|
+
, list = []
|
|
62
|
+
, p = ''
|
|
63
|
+
, path
|
|
64
|
+
, bundles
|
|
65
|
+
, b
|
|
66
|
+
, str = '';
|
|
67
|
+
|
|
68
|
+
for (p in projects) {
|
|
69
|
+
list.push(p)
|
|
70
|
+
}
|
|
71
|
+
list.sort();
|
|
72
|
+
|
|
73
|
+
p = 0;
|
|
74
|
+
for (; p<list.length; ++p) {
|
|
75
|
+
try {
|
|
76
|
+
path = projects[list[p]].path;
|
|
77
|
+
bundles = require( _(path +'/manifest.json')).bundles;
|
|
78
|
+
|
|
79
|
+
str += '------------------------------------\n\r';
|
|
80
|
+
if ( !fs.existsSync(projects[list[p]].path) ) {
|
|
81
|
+
str += '?! '
|
|
82
|
+
}
|
|
83
|
+
str += list[p] + '\n\r';
|
|
84
|
+
str += '------------------------------------\n\r';
|
|
85
|
+
for (b in bundles) {
|
|
86
|
+
if ( fs.existsSync(_(path + '/'+ bundles[b].src)) ) {
|
|
87
|
+
str += '[ ok ] ' + b
|
|
88
|
+
} else {
|
|
89
|
+
str += '[ ?! ] ' + b
|
|
90
|
+
}
|
|
91
|
+
str += '\n\r'
|
|
92
|
+
}
|
|
93
|
+
str += '\n\r'
|
|
94
|
+
} catch (err) {
|
|
95
|
+
str += '------------------------------------\n\r';
|
|
96
|
+
if ( !fs.existsSync(projects[list[p]].path) ) {
|
|
97
|
+
str += '?! '
|
|
98
|
+
}
|
|
99
|
+
str += list[p] + '\n\r';
|
|
100
|
+
str += '------------------------------------\n\r';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log(str)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var listProjectOnly = function () {
|
|
109
|
+
var path = self.projects[self.name].path
|
|
110
|
+
, bundles = require( _(path +'/manifest.json')).bundles
|
|
111
|
+
, b
|
|
112
|
+
, str = '';
|
|
113
|
+
|
|
114
|
+
for (b in bundles) {
|
|
115
|
+
if ( fs.existsSync(_(path + '/'+ bundles[b].src)) ) {
|
|
116
|
+
str += '[ ok ] ' + b
|
|
117
|
+
} else {
|
|
118
|
+
str += '[ ?! ] ' + b
|
|
119
|
+
}
|
|
120
|
+
str += '\n\r'
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
console.log(str)
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
init()
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
module.exports = List
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
var readline = require('readline');
|
|
3
|
+
var rl = readline.createInterface(process.stdin, process.stdout);
|
|
4
|
+
|
|
5
|
+
var CmdHelper = require('./../helper');
|
|
6
|
+
var console = lib.logger;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Remove existing bundle from a given project.
|
|
10
|
+
* NB.: If bundle exists, it won't be replaced. You'll only get warnings.
|
|
11
|
+
*
|
|
12
|
+
* TODO - Remove multiple bundles at once - ref. bundle/add
|
|
13
|
+
* */
|
|
14
|
+
function Remove(opt, cmd) {
|
|
15
|
+
|
|
16
|
+
var self = {}
|
|
17
|
+
, local = {
|
|
18
|
+
b : 0,
|
|
19
|
+
bundle : null,
|
|
20
|
+
force : false
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
|
|
24
|
+
var init = function(opt) {
|
|
25
|
+
|
|
26
|
+
// import CMD helpers
|
|
27
|
+
new CmdHelper(self, opt.client, { port: opt.debugPort, brkEnabled: opt.debugBrkEnabled });
|
|
28
|
+
|
|
29
|
+
// check CMD configuration
|
|
30
|
+
if ( !isCmdConfigured() ) return false;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if ( typeof(self.projects[self.projectName].path) == 'undefined' ) {
|
|
34
|
+
console.error('project path not defined in ~/.gina/projects.json for [ '+ self.projectName + ' ]');
|
|
35
|
+
process.exit(1)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (isDefined('project', self.projectName)) {
|
|
39
|
+
removeBundle(0)
|
|
40
|
+
} else {
|
|
41
|
+
//console.error('[ '+ self.projectName+' ] is not an existing project');
|
|
42
|
+
if ( self.bundles.length == 0) {
|
|
43
|
+
console.error('Missing argument <bundle_name>');
|
|
44
|
+
} else if (!isDefined('project', self.projectName) ) {
|
|
45
|
+
console.error('[' + self.projectName +'] is not an existing project.');
|
|
46
|
+
} else {
|
|
47
|
+
console.error('Missing argument @<project_name>');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
process.exit(1)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//var Proc = require( getPath('gina').lib + '/proc');
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var removeBundle = function (b) {
|
|
60
|
+
|
|
61
|
+
if (b > self.bundles.length-1) { // exits when done
|
|
62
|
+
end()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
local.b = b;
|
|
66
|
+
local.bundle = self.bundles[b];
|
|
67
|
+
local.envFileSaved = false;
|
|
68
|
+
local.force = ( typeof(self.params['force']) != 'undefined' ) ? self.params['force'] : false;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if (local.force) {
|
|
72
|
+
// remove without checking
|
|
73
|
+
remove(local.bundle)
|
|
74
|
+
} else {
|
|
75
|
+
check()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var check = function() {
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
rl.setPrompt('['+ local.bundle +'@'+ self.projectName +'] Also remove bundle files ? (Y/n):');
|
|
84
|
+
|
|
85
|
+
rl.prompt();
|
|
86
|
+
|
|
87
|
+
rl
|
|
88
|
+
.on('line', function(line) {
|
|
89
|
+
switch( line.trim().toLowerCase() ) {
|
|
90
|
+
case 'y':
|
|
91
|
+
case 'yes':
|
|
92
|
+
rl.clearLine();
|
|
93
|
+
remove(local.bundle);
|
|
94
|
+
|
|
95
|
+
break;
|
|
96
|
+
case 'n':
|
|
97
|
+
case 'no':
|
|
98
|
+
rl.clearLine();
|
|
99
|
+
// continue to next bundle
|
|
100
|
+
++local.b;
|
|
101
|
+
removeBundle(local.b);
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
default:
|
|
105
|
+
console.log('Please, write "yes" or "no" to proceed.');
|
|
106
|
+
rl.prompt();
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
.on('close', function() {
|
|
111
|
+
rl.clearLine();
|
|
112
|
+
console.log('Action cancelled !');
|
|
113
|
+
process.exit(0)
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var remove = function (bundle) {
|
|
118
|
+
|
|
119
|
+
// reload assets context with changes
|
|
120
|
+
loadAssets();
|
|
121
|
+
|
|
122
|
+
var hasFolder = true, folderPath = null, folder = null;
|
|
123
|
+
console.debug('Removing bundle: ', bundle);
|
|
124
|
+
try {
|
|
125
|
+
folderPath = _(self.projects[self.projectName].path + '/' + self.projectData.bundles[bundle].src, true);
|
|
126
|
+
folder = new _(folderPath);
|
|
127
|
+
|
|
128
|
+
if ( !folder.isValidPath() ) {
|
|
129
|
+
console.warn('`'+ folder.toString() +'` is not a valid path')
|
|
130
|
+
} else {
|
|
131
|
+
|
|
132
|
+
// removing mounting point: just in case
|
|
133
|
+
var coreEnv = getCoreEnv(bundle);
|
|
134
|
+
new _(coreEnv.mountPath +'/'+ bundle, true).rmSync();
|
|
135
|
+
|
|
136
|
+
// removing folder
|
|
137
|
+
folder = folder.rmSync();
|
|
138
|
+
if (folder instanceof Error) {
|
|
139
|
+
console.error(folder.stack);
|
|
140
|
+
process.exit(1)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} catch(folderException) {
|
|
144
|
+
hasFolder = false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
// updating project env
|
|
150
|
+
if ( typeof(self.envData) != 'undefined' && typeof(self.envData[bundle]) != 'undefined' ) (
|
|
151
|
+
delete self.envData[bundle]
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
// updating project bundles
|
|
155
|
+
if ( typeof(self.projectData.bundles) != 'undefined' && typeof(self.projectData.bundles[bundle]) != 'undefined' ) (
|
|
156
|
+
delete self.projectData.bundles[bundle]
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
// removing ports
|
|
160
|
+
var ports = JSON.clone(self.portsData)
|
|
161
|
+
, portsReverse = JSON.clone(self.portsReverseData)
|
|
162
|
+
, re = null
|
|
163
|
+
;
|
|
164
|
+
|
|
165
|
+
for (let protocol in ports) {
|
|
166
|
+
for (let scheme in ports[protocol]) {
|
|
167
|
+
for (let port in ports[protocol][scheme]) {
|
|
168
|
+
re = new RegExp(bundle +"\@"+ self.projectName +"\/");
|
|
169
|
+
if ( re.test(ports[protocol][scheme][port]) ) {
|
|
170
|
+
delete ports[protocol][scheme][port];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
for (let bundleAddress in portsReverse) {
|
|
177
|
+
re = new RegExp(bundle +"\@"+ self.projectName);
|
|
178
|
+
if ( re.test(bundleAddress) ) {
|
|
179
|
+
delete portsReverse[bundleAddress];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// now writing
|
|
184
|
+
lib.generator.createFileFromDataSync(ports, self.portsPath);
|
|
185
|
+
lib.generator.createFileFromDataSync(portsReverse, self.portsReversePath);
|
|
186
|
+
|
|
187
|
+
// env
|
|
188
|
+
// var envData = JSON.clone(self.envData);
|
|
189
|
+
// if ( typeof(envData[bundle]) != 'undefined' ) {
|
|
190
|
+
// delete envData[bundle];
|
|
191
|
+
lib.generator.createFileFromDataSync(
|
|
192
|
+
self.envData,
|
|
193
|
+
self.envPath
|
|
194
|
+
);
|
|
195
|
+
// }
|
|
196
|
+
|
|
197
|
+
// manifest
|
|
198
|
+
// var projectData = JSON.clone(self.projectData);
|
|
199
|
+
// if ( typeof(projectData.bundles) != 'undefined' && typeof(projectData.bundles[bundle]) != 'undefined' ) {
|
|
200
|
+
// delete projectData.bundles[bundle];
|
|
201
|
+
// if (projectData.bundles.count() == 0) {
|
|
202
|
+
// delete projectData.bundles
|
|
203
|
+
// }
|
|
204
|
+
lib.generator.createFileFromDataSync(
|
|
205
|
+
self.projectData,
|
|
206
|
+
self.projectPath
|
|
207
|
+
);
|
|
208
|
+
// }
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
console.log('Bundle [ '+ bundle+'@'+self.projectName+' ] removed');
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
++local.b;
|
|
215
|
+
removeBundle(local.b);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
var end = function() {
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
process.exit(0)
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
init(opt)
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
module.exports = Remove
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
const { runMain } = require('module');
|
|
3
|
+
var exec = require('child_process').exec;
|
|
4
|
+
|
|
5
|
+
var CmdHelper = require('./../helper');
|
|
6
|
+
var console = lib.logger;
|
|
7
|
+
// var Shell = lib.Shell;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Restart a given bundle or Restart all running bundles at once
|
|
11
|
+
*
|
|
12
|
+
* e.g.
|
|
13
|
+
* gina bundle:restart <bundle_name> @<project_name>
|
|
14
|
+
* gina bundle:restart @<project_name>
|
|
15
|
+
* gina bundle:restart --online
|
|
16
|
+
*
|
|
17
|
+
* */
|
|
18
|
+
function Restart(opt, cmd) {
|
|
19
|
+
|
|
20
|
+
var self = {};
|
|
21
|
+
|
|
22
|
+
var init = function(opt, cmd) {
|
|
23
|
+
// import CMD helpers
|
|
24
|
+
new CmdHelper(self, opt.client, { port: opt.debugPort, brkEnabled: opt.debugBrkEnabled });
|
|
25
|
+
|
|
26
|
+
// check CMD configuration
|
|
27
|
+
if (!isCmdConfigured()) return false;
|
|
28
|
+
|
|
29
|
+
self.cmdStr = process.argv.splice(0, 2).join(' ');
|
|
30
|
+
|
|
31
|
+
self.inheritedArgv = [];
|
|
32
|
+
for (let i = 0, len = process.argv.length; i < len; i++) {
|
|
33
|
+
if ( /^\-\-/.test(process.argv[i]) ) {
|
|
34
|
+
self.inheritedArgv.push(process.argv[i])
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// start all bundles
|
|
39
|
+
opt.onlineCount = 0;
|
|
40
|
+
opt.notStarted = [];
|
|
41
|
+
if (!self.name) {
|
|
42
|
+
restart(opt, cmd, 0);
|
|
43
|
+
} else {
|
|
44
|
+
restart(opt, cmd);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
var restart = function(opt, cmd, bundleIndex) {
|
|
49
|
+
|
|
50
|
+
var isBulkRestart = (typeof(bundleIndex) != 'undefined') ? true : false;
|
|
51
|
+
var bundle = (isBulkRestart) ? self.bundles[bundleIndex] : self.name;
|
|
52
|
+
|
|
53
|
+
// console.debug('bundle -> ', bundle);
|
|
54
|
+
var env = ( typeof(self.bundlesByProject[self.projectName][bundle].def_env) != 'undefined') ? self.bundlesByProject[self.projectName][bundle].def_env : self.defaultEnv;
|
|
55
|
+
// console.debug('env -> ', env);
|
|
56
|
+
var protocol = self.bundlesByProject[self.projectName][bundle].def_protocol;
|
|
57
|
+
// console.debug('protocol -> ', protocol);
|
|
58
|
+
var scheme = self.bundlesByProject[self.projectName][bundle].def_scheme;
|
|
59
|
+
// console.debug('scheme -> ', scheme);
|
|
60
|
+
var bundlePort = self.portsReverseData[bundle + '@' + self.projectName][env][protocol][scheme];
|
|
61
|
+
// console.debug('port -> ', bundlePort);
|
|
62
|
+
|
|
63
|
+
var msg = null;
|
|
64
|
+
if (!isDefined('bundle', bundle)) {
|
|
65
|
+
|
|
66
|
+
msg = 'Bundle [ ' + bundle + ' ] is not registered inside `@' + self.projectName + '`';
|
|
67
|
+
console.error(msg);
|
|
68
|
+
opt.client.write(msg);
|
|
69
|
+
end(opt, cmd, isBulkRestart, bundleIndex, true)
|
|
70
|
+
|
|
71
|
+
} else {
|
|
72
|
+
|
|
73
|
+
isRealApp(bundle, function(err, appPath) {
|
|
74
|
+
if (err) {
|
|
75
|
+
console.error(err.stack || err.message)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
var error = null;
|
|
80
|
+
//console.debug(' OPTIONS => ', opt.debugPort, opt.debugBrkEnabled);
|
|
81
|
+
//console.info('running: gina bundle:restart '+ bundle + '@' + self.projectName);
|
|
82
|
+
msg = 'Restarting, please wait ...';
|
|
83
|
+
cmd = '$gina bundle:stop ' + bundle + ' @' + self.projectName + ' && $gina bundle:start ' + bundle + ' @' + self.projectName;
|
|
84
|
+
if (self.inheritedArgv != '') {
|
|
85
|
+
cmd += ' '+ self.inheritedArgv;
|
|
86
|
+
}
|
|
87
|
+
if (opt.debugPort) {
|
|
88
|
+
cmd += ' --inspect';
|
|
89
|
+
if (opt.debugBrkEnabled) {
|
|
90
|
+
cmd += '-brk'
|
|
91
|
+
}
|
|
92
|
+
cmd += '='+ opt.debugPort;
|
|
93
|
+
msg = 'You should now start your debug session on port #'+opt.debugPort;
|
|
94
|
+
}
|
|
95
|
+
cmd = cmd.replace(/\$(gina)/g, self.cmdStr);
|
|
96
|
+
|
|
97
|
+
console.debug('Executing: '+cmd);
|
|
98
|
+
|
|
99
|
+
opt.client.write('\n\r'+msg +'\n');
|
|
100
|
+
|
|
101
|
+
// If it is stuck, the problem is not here ... cmd.start should be a good start
|
|
102
|
+
exec(cmd, function(err, stdout, stderr) {
|
|
103
|
+
|
|
104
|
+
if (err) {
|
|
105
|
+
error = err.toString();
|
|
106
|
+
console.error(error);
|
|
107
|
+
//opt.notStopped.push(bundle + '@' + self.projectName);
|
|
108
|
+
return setTimeout(() => {
|
|
109
|
+
end(opt, cmd, isBulkRestart, bundleIndex, true)
|
|
110
|
+
}, 500);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// retrieve messages from the parent stdout
|
|
114
|
+
if (stdout) {
|
|
115
|
+
console.log(stdout.replace(/\n\rTrying to.*/gm, ''));
|
|
116
|
+
}
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
//opt.client.write(' => bundle [ ' + bundle + '@' + self.projectName + ' ] restarted on port #'+ bundlePort+' :D\n');
|
|
119
|
+
end(opt, cmd, isBulkRestart, bundleIndex)
|
|
120
|
+
}, 500);
|
|
121
|
+
})
|
|
122
|
+
})//EO isRealApp
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var end = function (opt, cmd, isBulkRestart, i, error) {
|
|
127
|
+
if (isBulkRestart) {
|
|
128
|
+
++i;
|
|
129
|
+
if ( typeof(self.bundles[i]) != 'undefined' ) {
|
|
130
|
+
restart(opt, cmd, i)
|
|
131
|
+
} else {
|
|
132
|
+
|
|
133
|
+
if ( typeof(error) != 'undefined') {
|
|
134
|
+
return process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
if (!opt.client.destroyed)
|
|
137
|
+
opt.client.emit('end');
|
|
138
|
+
|
|
139
|
+
process.exit(0);
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
if ( typeof(error) != 'undefined') {
|
|
143
|
+
return process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!opt.client.destroyed)
|
|
147
|
+
opt.client.emit('end');
|
|
148
|
+
|
|
149
|
+
process.exit(0);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var isRealApp = function(bundle, callback) {
|
|
154
|
+
|
|
155
|
+
var p = null
|
|
156
|
+
, d = null
|
|
157
|
+
, env = self.projects[self.projectName]['def_env']
|
|
158
|
+
, isDev = GINA_ENV_IS_DEV
|
|
159
|
+
, root = self.projects[self.projectName].path
|
|
160
|
+
, bundleDir = null
|
|
161
|
+
, bundlesPath = null
|
|
162
|
+
, bundleInit = null
|
|
163
|
+
;
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
//This is mostly for dev.
|
|
167
|
+
var pkg = require( _(root + '/manifest.json') ).bundles;
|
|
168
|
+
|
|
169
|
+
if ( typeof(pkg[bundle].version) == 'undefined' && typeof(pkg[bundle].tag) != 'undefined') {
|
|
170
|
+
pkg[bundle].version = pkg[bundle].tag
|
|
171
|
+
}
|
|
172
|
+
if (
|
|
173
|
+
pkg[bundle] != 'undefined' && pkg[bundle]['src'] != 'undefined' && isDev
|
|
174
|
+
) {
|
|
175
|
+
var path = pkg[bundle].src;
|
|
176
|
+
|
|
177
|
+
p = _( root +'/'+ path );//path.replace('/' + bundle, '')
|
|
178
|
+
d = _( root +'/'+ path + '/index.js' );
|
|
179
|
+
|
|
180
|
+
bundleDir = path.replace('/' + bundle, '');
|
|
181
|
+
setContext('bundle_dir', bundleDir);
|
|
182
|
+
bundlesPath = _( root +'/'+ bundleDir );
|
|
183
|
+
bundleInit = d;
|
|
184
|
+
|
|
185
|
+
} else {
|
|
186
|
+
//Others releases.
|
|
187
|
+
var path = 'releases/'+ bundle +'/' + env +'/'+ pkg[bundle].version;
|
|
188
|
+
var version = pkg[bundle].version;
|
|
189
|
+
p = _( root +'/'+ path );//path.replace('/' + bundle, '')
|
|
190
|
+
d = _( root +'/'+ path + '/index.js' );
|
|
191
|
+
|
|
192
|
+
bundleDir = path;
|
|
193
|
+
bundlesPath = _(root + '/'+ bundleDir);
|
|
194
|
+
bundleInit = d;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
} catch (err) {
|
|
198
|
+
// default bundlesPath.
|
|
199
|
+
// TODO - log warn ?
|
|
200
|
+
console.warn(err.stack||err.message);
|
|
201
|
+
bundleDir = 'bundles';
|
|
202
|
+
bundlesPath = _(root +'/'+ bundleDir);
|
|
203
|
+
p = _(root +'/'+ bundleDir +'/'+ bundle);
|
|
204
|
+
d = _(root + '/'+ bundleDir +'/'+ bundle + '/index.js');
|
|
205
|
+
bundleInit = d;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
//Checking root.
|
|
210
|
+
if ( new _(d, true).existsSync() ) {
|
|
211
|
+
//checking bundle directory.
|
|
212
|
+
fs.stat(p, function(err, stats) {
|
|
213
|
+
|
|
214
|
+
if (err) {
|
|
215
|
+
callback(err)
|
|
216
|
+
} else {
|
|
217
|
+
|
|
218
|
+
if (stats.isDirectory()) {
|
|
219
|
+
callback(false, d)
|
|
220
|
+
} else {
|
|
221
|
+
callback(new Error('[ ' + d + ' ] is not a directory'))
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
console.debug('[ ' + d + ' ] does not exists');
|
|
228
|
+
callback(false)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
init(opt, cmd)
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
module.exports = Restart
|