gina 0.1.1-alpha.16 → 0.1.1-alpha.160

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.
Files changed (324) hide show
  1. package/AUTHORS +2 -1
  2. package/LICENSE +1 -1
  3. package/README-4Contributors.md +30 -0
  4. package/README.md +202 -32
  5. package/bin/cli +165 -68
  6. package/bin/cli-debug +49 -18
  7. package/bin/cmd +40 -18
  8. package/bin/gina +48 -37
  9. package/{framework/v0.1.1-alpha.16/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  10. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/AUTHORS +0 -0
  11. package/framework/{v0.1.1-alpha.16/lib/inherits → v0.1.1-alpha.160}/LICENSE +1 -1
  12. package/framework/v0.1.1-alpha.160/VERSION +1 -0
  13. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/html/nolayout.html +0 -0
  14. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/html/static.html +0 -0
  15. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/android-chrome-192x192.png +0 -0
  16. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/android-chrome-512x512.png +0 -0
  17. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/apple-touch-icon.png +0 -0
  18. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/favicon-16x16.png +0 -0
  19. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/favicon-32x32.png +0 -0
  20. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/asset/img/favicon.ico +0 -0
  21. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.js +887 -874
  22. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.js.map +3 -3
  23. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.min.css +0 -0
  24. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.min.css.map +0 -0
  25. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/gina.min.js +739 -0
  26. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/gina.min.js.map +8 -0
  27. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.onload.min.js +0 -0
  28. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/dist/gina.onload.min.js.map +0 -0
  29. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/css/toolbar-min.css +1 -0
  30. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/css/toolbar.css +3 -0
  31. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/css/toolbar.css.map +1 -0
  32. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/js/jquery-3.1.0.min.js +4 -0
  33. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/main.js +1542 -0
  34. package/framework/v0.1.1-alpha.160/core/asset/plugin/dist/toolbar/toolbar.html +251 -0
  35. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/readme.md +6 -6
  36. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.160/core/asset}/plugin/uuid.json +0 -0
  37. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/config.js +29 -14
  38. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/index.js +331 -222
  39. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/connector.js +6 -4
  40. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/connector.v2.js +47 -47
  41. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  42. package/framework/v0.1.1-alpha.160/core/connectors/couchbase/lib/connector.v4.js +384 -0
  43. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/n1ql.js +3 -2
  44. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/session-store.js +6 -5
  45. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  46. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  47. package/framework/v0.1.1-alpha.160/core/connectors/couchbase/lib/session-store.v4.js +362 -0
  48. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/controller/controller.framework.js +0 -0
  49. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/controller/controller.js +691 -677
  50. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/controller/index.js +0 -0
  51. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/.travis.yml +0 -0
  52. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/LICENSE +0 -0
  53. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/README.md +0 -0
  54. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  55. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  56. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/lib/main.js +0 -0
  57. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/lib/types/multipart.js +0 -0
  58. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  59. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/lib/utils.js +0 -0
  60. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/busboy/package.json +0 -0
  61. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  62. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/dev/index.js +1 -1
  63. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/dev/lib/class.js +0 -0
  64. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/dev/lib/factory.js +1 -1
  65. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/dev/lib/tools.js +0 -0
  66. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/gna.js +3 -4
  67. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/README.md +0 -0
  68. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/currency.json +0 -0
  69. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/dist/language/en.json +0 -0
  70. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/dist/language/fr.json +0 -0
  71. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/dist/region/en.json +0 -0
  72. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/dist/region/fr.json +0 -0
  73. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/index.js +2 -2
  74. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/src/make.js +0 -0
  75. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/src/resources/currency.csv +0 -0
  76. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/src/resources/region.csv +0 -0
  77. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/locales/src/resources/region.mapping.json +0 -0
  78. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/mime.types +0 -0
  79. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/model/entity.js +81 -61
  80. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/model/index.js +8 -7
  81. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/model/template/entityFactory.js +1 -1
  82. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/model/template/index.js +1 -1
  83. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/README.md +0 -0
  84. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/index.js +1 -1
  85. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/file/README.md +0 -0
  86. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/file/build.json +0 -0
  87. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/file/package.json +1 -1
  88. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/intl/README.md +0 -0
  89. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/intl/build.json +0 -0
  90. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/intl/package.json +1 -1
  91. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/intl/src/main.js +0 -0
  92. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/storage/README.md +0 -0
  93. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/storage/build.json +0 -0
  94. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/storage/package.json +1 -1
  95. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/storage/src/main.js +0 -0
  96. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/validator/README.md +0 -0
  97. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/validator/build.json +0 -0
  98. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/validator/package.json +1 -1
  99. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/validator/src/form-validator.js +0 -0
  100. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/plugins/lib/validator/src/main.js +0 -0
  101. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/router.js +92 -79
  102. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/server.express.js +0 -0
  103. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/server.isaac.js +117 -108
  104. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/server.js +44 -1
  105. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/status.codes +0 -0
  106. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/config/app.json +0 -0
  107. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/config/routing.json +0 -0
  108. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/config/settings.json +0 -0
  109. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  110. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/config/templates.json +4 -4
  111. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  112. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  113. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  114. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle/index.js +0 -0
  115. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  116. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  117. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  118. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  119. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  120. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_public/readme.md +0 -0
  121. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  122. package/framework/v0.1.1-alpha.160/core/template/boilerplate/bundle_templates/html/content/homepage.html +8 -0
  123. package/framework/v0.1.1-alpha.160/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +11 -0
  124. package/framework/v0.1.1-alpha.160/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +8 -0
  125. package/framework/{v0.1.1-alpha.16/core/template/boilerplate/bundle_templates/html/layout → v0.1.1-alpha.160/core/template/boilerplate/bundle_templates/html/layouts}/main.html +10 -3
  126. package/framework/v0.1.1-alpha.160/core/template/command/gina.bat.tpl +8 -0
  127. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/command/gina.tpl +1 -1
  128. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/env.json +0 -0
  129. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/manifest.json +0 -0
  130. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/package.json +1 -1
  131. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/settings.json +0 -0
  132. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/statics.json +3 -3
  133. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/conf/templates.json +2 -2
  134. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/client/json/401.json +0 -0
  135. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/client/json/403.json +0 -0
  136. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/client/json/404.json +0 -0
  137. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/server/html/50x.html +0 -0
  138. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/server/json/500.json +0 -0
  139. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/error/server/json/503.json +0 -0
  140. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/core/template/extensions/logger/config.json +0 -0
  141. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/console.js +1 -1
  142. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/context.js +145 -5
  143. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/dateFormat.js +4 -2
  144. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/index.js +10 -5
  145. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/json/README.md +0 -0
  146. package/framework/{v0.1.1-alpha.16/helpers/plugins → v0.1.1-alpha.160/helpers/json}/package.json +1 -1
  147. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/json/src/main.js +22 -22
  148. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/path.js +143 -89
  149. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/plugins/README.md +0 -0
  150. package/framework/{v0.1.1-alpha.16/helpers/json → v0.1.1-alpha.160/helpers/plugins}/package.json +1 -1
  151. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/plugins/src/api-error.js +23 -23
  152. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/plugins/src/main.js +2 -2
  153. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/prototypes.js +35 -36
  154. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/task.js +21 -14
  155. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/helpers/text.js +1 -1
  156. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/archiver/README.md +0 -0
  157. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/archiver/build.json +0 -0
  158. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/archiver/package.json +1 -1
  159. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/archiver/src/dep/jszip.min.js +0 -0
  160. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/archiver/src/main.js +167 -167
  161. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/aliases.json +4 -1
  162. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/add.js +43 -17
  163. package/framework/v0.1.1-alpha.160/lib/cmd/bundle/arguments.json +6 -0
  164. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/copy.js +0 -0
  165. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/cp.js +0 -0
  166. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/help.js +0 -0
  167. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/help.txt +2 -2
  168. package/framework/v0.1.1-alpha.160/lib/cmd/bundle/list.js +176 -0
  169. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/remove.js +22 -22
  170. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/rename.js +0 -0
  171. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/restart.js +0 -0
  172. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/rm.js +0 -0
  173. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/start.js +257 -46
  174. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/status.js +0 -0
  175. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/bundle/stop.js +93 -74
  176. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/add.js +0 -0
  177. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/get.js +0 -0
  178. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/help.js +0 -0
  179. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/help.txt +0 -0
  180. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/link-dev.js +0 -0
  181. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/list.js +0 -0
  182. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/remove.js +0 -0
  183. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/rm.js +0 -0
  184. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/set.js +0 -0
  185. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/env/unset.js +0 -0
  186. package/framework/{v0.1.1-alpha.16/lib/cmd/scope → v0.1.1-alpha.160/lib/cmd/env}/use.js +21 -1
  187. package/framework/v0.1.1-alpha.160/lib/cmd/framework/build.js +85 -0
  188. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/dot.js +0 -0
  189. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/get.js +0 -0
  190. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/help.js +0 -0
  191. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/help.txt +0 -0
  192. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/init.js +212 -21
  193. package/framework/v0.1.1-alpha.160/lib/cmd/framework/link-node-modules.js +86 -0
  194. package/framework/v0.1.1-alpha.160/lib/cmd/framework/link.js +94 -0
  195. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/msg.json +0 -0
  196. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/open.js +15 -0
  197. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/restart.js +58 -26
  198. package/framework/v0.1.1-alpha.160/lib/cmd/framework/set.js +264 -0
  199. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/start.js +35 -12
  200. package/framework/v0.1.1-alpha.160/lib/cmd/framework/status.js +138 -0
  201. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/stop.js +44 -28
  202. package/framework/v0.1.1-alpha.160/lib/cmd/framework/tail.js +271 -0
  203. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/update.js +0 -0
  204. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/framework/version.js +12 -3
  205. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/gina-dev.1.md +0 -0
  206. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/gina-framework.1.md +0 -0
  207. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/gina.1.md +0 -0
  208. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/helper.js +74 -5
  209. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/index.js +22 -22
  210. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/msg.json +0 -0
  211. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/port/help.js +0 -0
  212. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/port/help.txt +0 -0
  213. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/port/inc/scan.js +32 -17
  214. package/framework/v0.1.1-alpha.160/lib/cmd/port/list.js +446 -0
  215. package/framework/v0.1.1-alpha.160/lib/cmd/port/reset.js +426 -0
  216. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/port/set.js +0 -0
  217. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/add.js +146 -122
  218. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/arguments.json +0 -0
  219. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/build.js +0 -0
  220. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/help.js +0 -0
  221. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/help.txt +0 -0
  222. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/import.js +0 -0
  223. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/list.js +16 -2
  224. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/move.js +0 -0
  225. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/remove.js +17 -17
  226. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/rename.js +0 -0
  227. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/restart.js +0 -0
  228. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/rm.js +0 -0
  229. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/start.js +0 -0
  230. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/status.js +0 -0
  231. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/project/stop.js +0 -0
  232. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/protocol/help.js +0 -0
  233. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/protocol/help.txt +0 -0
  234. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/protocol/list.js +0 -0
  235. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/protocol/set.js +239 -201
  236. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/help.js +0 -0
  237. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/help.txt +0 -0
  238. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/link-local.js +0 -0
  239. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/list.js +0 -0
  240. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/remove.js +0 -0
  241. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/rm.js +0 -0
  242. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/set.js +0 -0
  243. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/scope/unset.js +0 -0
  244. package/framework/{v0.1.1-alpha.16/lib/cmd/env → v0.1.1-alpha.160/lib/cmd/scope}/use.js +0 -0
  245. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cmd/view/add.js +34 -9
  246. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/collection/README.md +0 -0
  247. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/collection/build.json +0 -0
  248. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/collection/package.json +1 -1
  249. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/collection/src/main.js +0 -0
  250. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/config.js +2 -1
  251. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cron/README.md +0 -0
  252. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cron/package.json +1 -1
  253. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/cron/src/main.js +0 -0
  254. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/generator/index.js +1 -1
  255. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/index.js +1 -1
  256. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160/lib/inherits}/LICENSE +1 -1
  257. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/README.md +0 -0
  258. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  259. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/example/protected_inheritance.js +0 -0
  260. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/example/simple_inheritance.js +0 -0
  261. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  262. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/package.json +1 -1
  263. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/inherits/src/main.js +1 -1
  264. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/README.md +0 -0
  265. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/package.json +1 -1
  266. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/default/index.js +13 -2
  267. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/file/index.js +105 -14
  268. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  269. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  270. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/mq/index.js +2 -1
  271. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/mq/listener.js +16 -14
  272. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/containers/mq/speaker.js +32 -3
  273. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/helper.js +20 -1
  274. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/logger/src/main.js +5 -2
  275. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/math/index.js +7 -7
  276. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/README.md +0 -0
  277. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/example/merge.js +0 -0
  278. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/example/merge_2_literal objects.js +0 -0
  279. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/example/merge_and_preserve_first.js +0 -0
  280. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/package.json +1 -1
  281. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/merge/src/main.js +0 -0
  282. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/model.js +9 -9
  283. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/proc.js +75 -47
  284. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/routing/README.md +0 -0
  285. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/routing/build.json +0 -0
  286. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/routing/package.json +1 -1
  287. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/routing/src/main.js +258 -258
  288. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/session-store.js +6 -6
  289. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/shell.js +3 -3
  290. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/swig-filters/README.md +0 -0
  291. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/swig-filters/package.json +1 -1
  292. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/swig-filters/src/main.js +55 -52
  293. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/url/README.md +0 -0
  294. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/url/index.js +0 -0
  295. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/url/mocks.json +0 -0
  296. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/url/routing.json +0 -0
  297. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/url/test.js +0 -0
  298. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.160}/lib/validator.js +0 -0
  299. package/framework/v0.1.1-alpha.160/package.json +14 -0
  300. package/package.json +33 -24
  301. package/resources/home/main.json +44 -1
  302. package/resources/home/settings.json +7 -0
  303. package/resources/home/user/extensions/logger/default/config.json +1 -1
  304. package/resources/package.json.template +29 -18
  305. package/script/post_install.js +410 -120
  306. package/script/post_publish.js +185 -0
  307. package/script/pre_install.js +424 -76
  308. package/script/prepare_version.js +152 -22
  309. package/utils/helper.js +230 -185
  310. package/utils/prototypes.js +9 -9
  311. package/utils/prototypes.json_clone.js +31 -31
  312. package/doc/framework/cli/doc.json +0 -9
  313. package/doc/framework/index.md +0 -60
  314. package/framework/v0.1.1-alpha.16/VERSION +0 -1
  315. package/framework/v0.1.1-alpha.16/core/asset/js/plugin/dist/gina.min.js +0 -736
  316. package/framework/v0.1.1-alpha.16/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  317. package/framework/v0.1.1-alpha.16/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  318. package/framework/v0.1.1-alpha.16/lib/cmd/bundle/arguments.json +0 -4
  319. package/framework/v0.1.1-alpha.16/lib/cmd/bundle/list.js +0 -129
  320. package/framework/v0.1.1-alpha.16/lib/cmd/framework/set.js +0 -161
  321. package/framework/v0.1.1-alpha.16/lib/cmd/framework/status.js +0 -72
  322. package/framework/v0.1.1-alpha.16/lib/cmd/framework/tail.js +0 -183
  323. package/framework/v0.1.1-alpha.16/lib/cmd/port/list.js +0 -176
  324. package/framework/v0.1.1-alpha.16/package.json +0 -14
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * This file is part of the gina package.
3
- * Copyright (c) 2017 Rhinostone <contact@gina.io>
3
+ * Copyright (c) 2009-2023 Rhinostone <contact@gina.io>
4
4
  *
5
5
  * For the full copyright and license information, please view the LICENSE
6
6
  * file that was distributed with this source code.
@@ -8,10 +8,68 @@
8
8
 
9
9
  //Imports
10
10
  var fs = require('fs');
11
+ var os = require("os");
11
12
  var util = require('util');
12
13
  var promisify = util.promisify;
13
14
  const { execSync } = require('child_process');
14
15
 
16
+ var isWin32 = function() {
17
+ return (process.platform === 'win32') ? true : false;
18
+ };
19
+ var isWritableSync = function(path) {
20
+ var canWrite = false;
21
+ if ( fs.accessSync && typeof(fs.accessSync) != 'undefined' ) {
22
+ try {
23
+ fs.accessSync(path, fs.constants.W_OK);
24
+ canWrite = true;
25
+ } catch (err) {
26
+ canWrite = false;
27
+ }
28
+ } else { // support for old version of nodejs
29
+
30
+ try {
31
+ canWrite = (fs.statSync(path).mode & (fs.constants.S_IRUSR | fs.constants.S_IRGRP | fs.constants.S_IROTH));
32
+ } catch (err) {
33
+ canWrite = false
34
+ }
35
+ }
36
+
37
+ return canWrite
38
+ };
39
+
40
+ var getUserHome = function() {
41
+ var home = os.homedir ? os.homedir : function() {
42
+ var homeDir = process.env[(isWin32()) ? 'USERPROFILE' : 'HOME'];
43
+
44
+ if ( !homeDir || homeDir == '' ) {
45
+ throw new Error('Home directory not defined or not found !');
46
+ }
47
+
48
+ if ( !isWritableSync(homeDir) ) {
49
+ throw new Error('Home directory found but not writable: need permissions for `'+ homeDir +'`');
50
+ }
51
+
52
+ return homeDir;
53
+ };
54
+
55
+ return home()
56
+ };
57
+
58
+ // just in case `post_install` is called by hand
59
+ var initialDir = process.cwd();
60
+ var frameworkPath = __dirname +'/..';
61
+ if ( !fs.existsSync(frameworkPath +'/node_modules/colors') ) {
62
+ process.chdir(frameworkPath);
63
+
64
+ var oldConfigGlobal = process.env.npm_config_global;
65
+ process.env.npm_config_global=false;
66
+ var cmd = ( isWin32() ) ? 'npm.cmd install colors@1.4.0' : 'npm install colors@1.4.0';
67
+ execSync(cmd);
68
+ process.env.npm_config_global=oldConfigGlobal;
69
+
70
+ process.chdir(initialDir);
71
+ }
72
+
15
73
  var lib = require('./lib');
16
74
  var console = lib.logger;
17
75
 
@@ -20,6 +78,7 @@ var ginaPath = (scriptPath.replace(/\\/g, '/')).replace('/script', '');
20
78
  var help = require(ginaPath + '/utils/helper.js');
21
79
  var pack = ginaPath + '/package.json';
22
80
  pack = (isWin32()) ? pack.replace(/\//g, '\\') : pack;
81
+ var helpers = null;
23
82
 
24
83
 
25
84
  /**
@@ -28,47 +87,156 @@ pack = (isWin32()) ? pack.replace(/\//g, '\\') : pack;
28
87
  * */
29
88
  function PostInstall() {
30
89
 
31
- var self = {}, _this = this;
90
+ var self = {};
32
91
 
33
- //Initialize post installation scripts.
34
- var init = function() {
35
- self.isWin32 = isWin32();//getEnvVar('GINA_IS_WIN32');
36
- self.path = getEnvVar('GINA_FRAMEWORK');
37
- self.gina = getEnvVar('GINA_DIR');
38
- self.root = self.gina; // by default
39
- self.isGlobalInstall = false;
40
- self.prefix = execSync('npm config get prefix');
41
- self.isCustomPrefix = false;
92
+ var configure = function() {
42
93
 
94
+ // TODO - handle windows case
95
+ if ( /^true$/i.test(isWin32()) ) {
96
+ throw new Error('Windows in not yet fully supported. Thank you for your patience');
97
+ }
98
+
99
+ self.isWin32 = isWin32();
100
+ self.isGlobalInstall = process.env.npm_config_global || false;
101
+ self.isResetNeeded = process.env.npm_config_reset || false;
102
+ self.defaultPrefix = execSync('npm config get prefix').toString().replace(/\n$/g, '');
103
+ // var pkg = null;
104
+ // try {
105
+ // if (self.isGlobalInstall) {
106
+ // pkg = execSync('npm list -g gina --long --json').toString().replace(/\n$/g, '');
107
+ // } else {
108
+ // pkg = execSync('npm list gina --long --json').toString().replace(/\n$/g, '');
109
+ // }
110
+ // } catch(err) {
111
+ // throw err
112
+ // }
113
+ // self.optionalPrefix = JSON.parse(pkg).dependencies.gina.config.optionalPrefix.replace(/^\~/, getUserHome());
114
+
115
+ // `process.env.npm_config_prefix` is only retrieved on `npm install gina`
116
+ // and it should always be equal to `self.defaultPrefix`
117
+ self.prefix = process.env.npm_config_prefix || self.defaultPrefix;
118
+ self.isCustomPrefix = false;
119
+ self.isGinaInstalled = false;
120
+
121
+ // Overriding thru passed arguments
43
122
  var args = process.argv, i = 0, len = args.length;
44
123
  for (; i < len; ++i) {
45
- if (args[i] == '-g' ) {
124
+ if ( /^(\-g|\-\-global)$/.test(args[i]) ) {
46
125
  self.isGlobalInstall = true;
47
126
  continue;
48
127
  }
49
- if (args[i] == '--prefix' ) {
128
+
129
+ if ( /^\-\-reset$/.test(args[i]) ) {
130
+ self.isResetNeeded = true;
131
+ continue;
132
+ }
133
+
134
+ if ( /^\-\-prefix\=/.test(args[i] ) ) {
50
135
  self.isCustomPrefix = true;
51
136
  self.prefix = args[i].split(/\=/)[1];
137
+ self.prefix = self.prefix.replace(/^\~/, getUserHome());
52
138
  continue;
53
139
  }
140
+
141
+ if ( /^\-\-log-level\=/.test(args[i]) ) {
142
+ var logLevel = args[i].split(/\=/)[1];
143
+ console.setLevel(logLevel, 'gina');
144
+ process.env.LOG_LEVEL=logLevel;
145
+ }
54
146
  }
55
147
 
56
- self.prefix = self.prefix.toString().replace(/\n/g, '');
148
+ if (self.prefix != self.defaultPrefix) {
149
+ self.isCustomPrefix = true;
150
+ }
57
151
 
58
- console.debug('Is this for Windows ? ' + self.isWin32);
152
+ // For local install
153
+ console.debug('self.isGlobalInstall => '+ self.isGlobalInstall);
154
+ if ( !self.isGlobalInstall ) {
155
+ console.warn('Local installation is not fully supported at the moment.');
156
+ console.warn('You are encouraged to use `npm install -g gina`\nor, if you are trying to link gina to your project, use `npm link gina` if Gina has already been installed globally\n');
157
+ // Just in case someone is trying to run pre_install from the `gina` module
158
+ if (!/node\_modules(\\\\|\/)gina$/.test(process.env.INIT_CWD)) {
159
+ self.prefix = process.env.INIT_CWD;//process.cwd();
160
+ }
161
+ }
59
162
 
60
- if ( !self.isGlobalInstall ) { //global install
61
- self.root = process.cwd(); // project path
62
- console.error('local installation is not supported for this version at the moment.');
63
- console.info('please use `npm install -g gina`');
64
- process.exit(1);
163
+ // checking permission
164
+ var hasPermissionsForBin = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'bin');
165
+ var hasPermissionsForLib = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'lib');
166
+ var hasPermissionsForVar = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'var');
167
+ if ( !hasPermissionsForBin || !hasPermissionsForLib || !hasPermissionsForVar) {
168
+ if (!hasPermissionsForBin) {
169
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'bin')
170
+ }
171
+ if (!hasPermissionsForLib) {
172
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'lib')
173
+ }
174
+ if (!hasPermissionsForVar) {
175
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'var')
176
+ }
177
+
178
+ // console.warn('You do not have sufficient permissions. Switching to `--prefix='+ self.optionalPrefix +'`');
179
+ // process.env.npm_config_prefix = self.prefix = self.optionalPrefix;
180
+ }
181
+
182
+ var pkg = null, pkgObj = null, cmd = null;
183
+ try {
184
+ cmd = 'npm list gina --long --json --prefix='+ self.prefix;
185
+ if (self.isGlobalInstall) {
186
+ cmd += ' -g';
187
+ }
188
+ pkg = execSync(cmd).toString().replace(/\n$/g, '');
189
+ self.optionalPrefix = JSON.parse(pkg).dependencies.gina.config.optionalPrefix.replace(/^\~/, getUserHome());
190
+
191
+ } catch(err) {
192
+ throw err
193
+ }
194
+ pkgObj = JSON.parse(pkg);
195
+ self.optionalPrefix = pkgObj.dependencies.gina.config.optionalPrefix.replace(/^\~/, getUserHome());
196
+
197
+
198
+ if ( self.prefix != self.defaultPrefix ) {
199
+ self.isCustomPrefix = true;
65
200
  }
66
201
 
67
- console.debug('prefix path: ' + self.prefix);
68
- console.debug('framework path: ' + self.gina);
69
- console.debug('framework version path: ' + self.path);
70
- console.debug('cwd path: ' + self.root );
71
- console.debug('this is a global install ...');
202
+ self.gina = __dirname +'/..';
203
+ // tying to figure out if gina is already install the given prefix
204
+ var hasFoundGina = pkg;
205
+ try {
206
+ hasFoundGina = JSON.parse(hasFoundGina);
207
+ if ( hasFoundGina.dependencies && typeof(hasFoundGina.dependencies.gina) != 'undefined' ) {
208
+ self.isGinaInstalled = true;
209
+ self.versionPath = self.gina;
210
+ self.versionPath += (isWin32()) ? '\\framework\\' : '/framework/';
211
+ self.version = hasFoundGina.dependencies.gina.version;
212
+ self.versionPath += 'v'+ self.version;
213
+
214
+ self.shortVersion = self.version.split('.');
215
+ self.shortVersion.splice(2);
216
+ self.shortVersion = self.shortVersion.join('.');
217
+
218
+ console.debug('Install path => '+ hasFoundGina.dependencies.gina.path);
219
+
220
+ // OK ... found installed gina but on a different prefix
221
+ // In this case, let's assume that it is not really installed
222
+ if ( !new RegExp('^'+ self.prefix).test(hasFoundGina.dependencies.gina.path) ) {
223
+ self.isGinaInstalled = false;
224
+ }
225
+ }
226
+ } catch (err) {}
227
+
228
+ console.debug('self.defaultPrefix => '+ self.defaultPrefix);
229
+ console.debug('self.optionalPrefix => '+ self.optionalPrefix );
230
+ console.debug('self.prefix => '+ self.prefix);
231
+ console.debug('self.isCustomPrefix => ', self.isCustomPrefix);
232
+ // only available when running the script with NPM
233
+ console.debug('process.env.npm_config_prefix => '+ process.env.npm_config_prefix);
234
+ }
235
+
236
+ //Initialize post installation scripts.
237
+ var init = function() {
238
+ configure();
239
+ helpers = require(self.versionPath+ '/helpers');
72
240
 
73
241
  begin(0);
74
242
  }
@@ -153,10 +321,10 @@ function PostInstall() {
153
321
 
154
322
 
155
323
  self.createVersionFile = function(done) {
156
- var version = require( _(self.gina + '/package.json') ).version;
324
+ var version = self.version;
157
325
  console.debug('writting version number: '+ version);
158
326
 
159
- var target = _(self.path + '/VERSION');
327
+ var target = _(self.versionPath + '/VERSION');
160
328
  try {
161
329
  if ( fs.existsSync(target) ) {
162
330
  fs.unlinkSync(target)
@@ -169,13 +337,20 @@ function PostInstall() {
169
337
  done();
170
338
  }
171
339
 
340
+ // TODO - Remove this part
172
341
  var configureGina = function() {
173
342
  // link to ./bin/cli to binaries dir
174
343
  if (!self.isWin32) {
175
- var binPath = _(self.prefix+'/bin', true);
176
- var cli = _(binPath +'/gina');
344
+ var binPath = null;
345
+ if ( !self.isGlobalInstall() ) {
346
+ binPath = new _(self.prefix+'/node_modules/.bin', true).existsSync() ? _(self.prefix+'/node_modules/.bin', true) : '';
347
+ } else {
348
+ binPath = new _(self.prefix+'/lib/node_modules/gina/bin', true)
349
+ }
350
+
351
+ var cli = _(binPath +'/gina', true);
177
352
  // TODO - remove this part for the next version
178
- var cliDebug = _(binPath +'/gina-debug');
353
+ var cliDebug = _(binPath +'/gina-debug', true);
179
354
 
180
355
  if ( fs.existsSync(cli) ) {
181
356
  fs.unlinkSync(cli)
@@ -185,24 +360,33 @@ function PostInstall() {
185
360
  fs.unlinkSync(cliDebug)
186
361
  }
187
362
 
188
- var cmd = 'ln -s '+ self.gina +'/bin/gina '+ binPath +'/gina';
189
- console.debug('running: '+ cmd);
190
- run(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
191
- .onData(function(data){
192
- console.info(data)
193
- })
194
- .onComplete( function onDone(err, data){
195
- if (err) {
196
- console.error(err);
197
- console.warn('try to run : sudo ' + cmd);
198
- }
199
- });
363
+
364
+ if ( !self.isGlobalInstall() ) {
365
+ new _(cli, true).symlinkSync( _(self.prefix +'/gina', true) )
366
+ }
367
+ // else {
368
+ // new _(cli, true).symlinkSync( _(self.prefix +'/bin/', true) )
369
+ // }
370
+
371
+
372
+ // var cmd = 'ln -s '+ self.gina +'/bin/gina '+ binPath;
373
+ // console.debug('running: '+ cmd);
374
+ // run(cmd, { cwd: _(self.versionPath), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
375
+ // .onData(function(data){
376
+ // console.info(data)
377
+ // })
378
+ // .onComplete( function onDone(err, data){
379
+ // if (err) {
380
+ // console.error(err);
381
+ // console.warn('try to run : sudo ' + cmd);
382
+ // }
383
+ // });
200
384
  // To debug, you just need to run:
201
385
  // gina <topic>:<task> --inspect-gina
202
386
  //
203
387
  // TODO - remove this part for the next version
204
388
  // cmd = 'ln -s '+ self.gina +'/bin/cli-debug '+ binPath +'/gina-debug';
205
- // run(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
389
+ // run(cmd, { cwd: _(self.versionPath), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
206
390
  // .onData(function(data){
207
391
  // console.info(data)
208
392
  // })
@@ -219,52 +403,57 @@ function PostInstall() {
219
403
  }
220
404
 
221
405
  //Creating framework command line file for nix.
222
- var createGinaFile = function(win32Name, callback) {
223
- var name = require( _(self.path + '/package.json') ).name;
224
- var appPath = _( self.path.substring(0, (self.path.length - ("node_modules/" + name + '/').length)) );
225
- var source = _(self.path + '/core/template/command/gina.tpl');
226
- var target = _(appPath +'/'+ name);
227
- if ( typeof(win32Name) != 'undefined') {
228
- target = _(appPath +'/'+ win32Name)
229
- }
230
- //Will override.
231
- console.info('linking to binaries dir ... ');
232
- if ( typeof(callback) != 'undefined') {
233
- if ( !self.isGlobalInstall ) { // local install only
234
- lib.generator.createFileFromTemplate(source, target, function onGinaFileCreated(err) {
235
- callback(err)
406
+ var createGinaFile = function(callback) {
407
+ // local install only
408
+ if (self.isGlobalInstall) {
409
+ return callback(false);
410
+ }
236
411
 
237
- })
238
- } else {
412
+ console.info('Current prefix: '+ self.prefix );
413
+ console.info('Current package.json: '+ _(self.gina + '/package.json', true) );
414
+
415
+ console.info('Creating framework command line:');
416
+ var appPath = process.env.INIT_CWD;
417
+ console.debug('App path: '+ appPath);
418
+ var source = _(appPath + '/node_modules/.bin/gina', true);
419
+ var target = _(appPath +'/gina', true);
420
+ if ( isWin32() ) {
421
+ source = _(appPath + '/node_modules/.bin/gina.bat', true)
422
+ target = _(appPath +'/gina.bat', true)
423
+ }
424
+ console.debug('Source: '+ source);
425
+ console.debug('Target: '+ target);
239
426
 
240
- // configureGina();
241
- callback(false)
242
- }
243
- } else {
244
- if ( !self.isGlobalInstall ) {
245
- lib.generator.createFileFromTemplate(source, target)
427
+ if ( callback && typeof(callback) != 'undefined') {
428
+ console.info('linking to binaries dir: '+ source +' -> '+ target);
429
+ try {
430
+ if ( fs.existsSync(target) ) {
431
+ fs.unlinkSync(target)
432
+ }
433
+ new _(source).symlinkSync(target)
434
+ } catch (err) {
435
+ return callback(err)
246
436
  }
247
- // else {
248
- // configureGina();
249
- // }
437
+
438
+ return callback(false);
250
439
  }
251
440
  }
252
441
 
253
442
  self.createGinaFileForPlatform = async function(done) {
254
443
  console.info('Creating platform file');
255
- var name = require( _(self.path + '/package.json') ).name;
444
+ // var name = require( _(self.versionPath + '/package.json') ).name;
256
445
 
257
- var filename = ( (self.isWin32) ? '.' : '' ) + name;
446
+ // var filename = ( (self.isWin32) ? '.' : '' ) + name;
258
447
 
259
- var keepGoing = function(filename) {
448
+ var keepGoing = function() {
260
449
 
261
- createGinaFile(filename, function onFileCreated(err) {
450
+ createGinaFile(function onFileCreated(err) {
262
451
  if (err) {
263
452
  return done(err)
264
453
  }
265
454
 
266
455
  // this is done to allow multiple calls of post_install.js
267
- var filename = _(self.path + '/SUCCESS');
456
+ var filename = _(self.versionPath + '/SUCCESS');
268
457
  var installed = fs.existsSync( filename );
269
458
  if (installed) {
270
459
  fs.unlinkSync( filename );
@@ -286,7 +475,7 @@ function PostInstall() {
286
475
  if ( !hasNodeModulesSync() ) {
287
476
  return npmInstall(done)
288
477
  } else {
289
- var target = new _(self.path + '/node_modules');
478
+ var target = new _(self.versionPath + '/node_modules');
290
479
  console.debug('replacing: ', target.toString() );
291
480
  return target
292
481
  .rm( function onRemove(err) {
@@ -301,49 +490,55 @@ function PostInstall() {
301
490
  })
302
491
  }
303
492
 
304
- if (self.isWin32) {
305
- var appPath = _( self.path.substring(0, (self.path.length - ("node_modules/" + name + '/').length)) );
306
- var source = _(self.path + '/core/template/command/gina.bat.tpl');
307
- var target = _(appPath +'/'+ name + '.bat');
308
- if ( fs.existsSync(target) ) {
309
- fs.unlinkSync(target);
310
- // have to wait for windows to complete this
311
- setTimeout( async function(){
312
- lib.generator.createFileFromTemplate(source, target);
313
- await keepGoing(filename)
314
- }, 1000)
315
- } else {
316
- lib.generator.createFileFromTemplate(source, target);
317
- await keepGoing(filename)
318
- }
319
-
320
- } else {
321
- await keepGoing(filename)
322
- }
493
+ // if (self.isWin32) {
494
+ // // var appPath = _( self.versionPath.substring(0, (self.versionPath.length - ("node_modules/" + name + '/').length)) );
495
+ // var appPath = process.cwd()
496
+ // var source = _(self.versionPath + '/core/template/command/gina.bat.tpl');
497
+ // var target = _(appPath +'/'+ name + '.bat');
498
+ // if ( fs.existsSync(target) ) {
499
+ // fs.unlinkSync(target);
500
+ // // have to wait for windows to complete this
501
+ // setTimeout( async function(){
502
+ // lib.generator.createFileFromTemplate(source, target);
503
+ // await keepGoing(filename)
504
+ // }, 1000)
505
+ // } else {
506
+ // lib.generator.createFileFromTemplate(source, target);
507
+ // await keepGoing(filename)
508
+ // }
509
+
510
+ // } else {
511
+ await keepGoing()
512
+ // }
323
513
  }
324
514
 
325
515
 
326
516
  var hasNodeModulesSync = function() {
327
- return fs.existsSync( _(self.path + '/node_modules') )
517
+ return fs.existsSync( _(self.versionPath + '/node_modules') )
328
518
  }
329
519
 
330
520
 
331
521
  var npmInstall = function(done) {
332
- console.info('now installing modules: please, wait ...');
522
+
523
+ console.info('Now installing modules: please, wait ...');
333
524
  console.info('Prefix ('+ self.isCustomPrefix +'): '+ self.prefix);
334
- var cmd = self.prefix +'/bin/';
335
- cmd += ( isWin32() ) ? 'npm.cmd install' : 'npm install';
336
- console.info('running: '+ cmd +' from '+ _(self.path) );
337
- run(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
338
- .onData(function onData(data){
339
- console.info(data)
340
- })
341
- .onComplete( function onDone(err, data){
342
- if (!err) {
343
- return done()
344
- }
345
- done(err)
346
- })
525
+ console.info('Default prefix: '+ self.defaultPrefix);
526
+ var initialDir = process.cwd();
527
+
528
+
529
+ var cmd = ( isWin32() ) ? 'npm.cmd install' : 'npm install';
530
+
531
+ process.chdir( self.versionPath );
532
+
533
+ console.info('running: `'+ cmd +'` from '+ process.cwd() );
534
+ console.info('running using TMPDIR: '+ _(getTmpDir(), true) );
535
+ var oldConfigGlobal = process.env.npm_config_global;
536
+ process.env.npm_config_global = false;
537
+ execSync(cmd);
538
+ process.chdir(initialDir);
539
+ process.env.npm_config_global = oldConfigGlobal;
540
+
541
+ done()
347
542
  }
348
543
 
349
544
  self.cleanupIfNeeded = function(done) {
@@ -355,16 +550,24 @@ function PostInstall() {
355
550
  if ( new _(frameworkPath +'/node_modules/colors', true).existsSync() ) {
356
551
  var initialDir = process.cwd();
357
552
  process.chdir(frameworkPath);
358
- var cmd = self.prefix +'/bin/';
359
- cmd += ( isWin32() ) ? 'npm.cmd rm colors' : 'npm rm colors';
553
+ var oldConfigGlobal = process.env.npm_config_global;
554
+ process.env.npm_config_global=false;
555
+
556
+ // var cmd = self.prefix +'/bin/';
557
+ // cmd += ( isWin32() ) ? 'npm.cmd rm colors' : 'npm rm colors';
558
+
559
+ var cmd = ( isWin32() ) ? 'npm.cmd rm colors' : 'npm rm colors';
560
+
360
561
  try {
361
562
  execSync(cmd);
362
563
  console.debug('Removed default `colors` module from `GINA_DIR`... This is normal ;)');
363
564
  } catch (npmErr) {
565
+ process.chdir(initialDir);
364
566
  return done(npmErr);
365
567
  }
366
568
 
367
569
  process.chdir(initialDir);
570
+ process.env.npm_config_global=oldConfigGlobal;
368
571
  }
369
572
 
370
573
  done()
@@ -388,6 +591,9 @@ function PostInstall() {
388
591
 
389
592
  // reading default extensions
390
593
  var ext = _(self.gina +'/resources/home/user/extensions', true);
594
+ // if (!self.isCustomPrefix) {
595
+ // ext = _( self.defaultPrefix + '/lib/node_modules/gina/bin/gina')
596
+ // }
391
597
  var folders = [];
392
598
  try {
393
599
  console.debug('Reading : '+ ext + ' - isDirectory ? '+ fs.lstatSync( ext ).isDirectory() );
@@ -422,7 +628,6 @@ function PostInstall() {
422
628
 
423
629
  let files = []
424
630
  , extDir = _(ext +'/'+ dir, true)
425
- , extDirObj = new _(extDir)
426
631
  ;
427
632
  try {
428
633
 
@@ -459,7 +664,7 @@ function PostInstall() {
459
664
  });
460
665
 
461
666
  if (err) {
462
- throw err;
667
+ return done(err);
463
668
  }
464
669
  }
465
670
  }
@@ -469,6 +674,64 @@ function PostInstall() {
469
674
  done()
470
675
  }
471
676
 
677
+ /**
678
+ * Updated user's profile
679
+ * Will edit ~/.profile, check and add if needed path to Gina binary
680
+ *
681
+ */
682
+ self.updateUserProfile = async function(done) {
683
+
684
+ if ( !self.isGlobalInstall || isWin32() ) {
685
+ return done()
686
+ }
687
+ if (!self.isCustomPrefix || self.prefix == self.defaultPrefix) {
688
+ return done()
689
+ }
690
+
691
+ var profilePath = getUserHome() + '/.profile';
692
+ var profilePathObj = new _(profilePath);
693
+ if ( !profilePathObj.existsSync() ) {
694
+ cmd = 'touch '+ profilePath;
695
+ await promisify(run)(cmd, { cwd: _(self.versionPath), tmp: _(getTmpDir(), true), outToProcessSTD: true, shell: "/bin/bash"})
696
+ .catch(function onError(err){
697
+ if (err) {
698
+ console.warn('try to run: sudo ' + cmd);
699
+ return done(err);
700
+ }
701
+ });
702
+ }
703
+
704
+ var inFile = null;
705
+ var patt = _(self.prefix.replace( new RegExp( '^' +getUserHome() ), '(.*)[$]HOME') + '/bin', true);
706
+ try {
707
+ inFile = execSync("cat ~/.profile | grep -Eo '" + patt +"'", {shell: "/bin/bash"}).toString();
708
+ } catch (err) {
709
+ // nothing to do
710
+ }
711
+
712
+ if (!inFile) {
713
+ patt = patt.replace('(.*)[$]', '$');
714
+ inFile = '\nif [ -d "'+ patt +'" ]; then';
715
+ inFile += '\n PATH="'+ patt +':$PATH"';
716
+ inFile += '\nfi\n';
717
+ try {
718
+ fs.appendFileSync( getUserHome()+'/.profile', inFile );
719
+ } catch (err) {
720
+ return done(err);
721
+ }
722
+ inFile = null;
723
+
724
+ // we need to source/update ~/.profile
725
+ try {
726
+ execSync("source "+ profilePath, {shell: "/bin/bash"});
727
+ } catch (err) {
728
+ return done(err)
729
+ }
730
+ }
731
+
732
+ done()
733
+ }
734
+
472
735
  var restoreSymlinks = function() {
473
736
  var archivesPath = _(getUserHome() + '/.gina/archives/framework', true);
474
737
  var frameworkPath = _(self.gina +'/framework', true);
@@ -492,15 +755,17 @@ function PostInstall() {
492
755
  // intercept & remove existing symlinks or old versions dir
493
756
  try {
494
757
  if ( fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isSymbolicLink() ) {
495
- new _(frameworkPath +'/'+ dir, true).rmSync();
496
- console.debug('Removing Symlink: '+ dir);
758
+ console.debug('Removing Symlink: '+ _(frameworkPath +'/'+ dir, true) );
759
+ // new _(frameworkPath +'/'+ dir, true).rmSync();
760
+ fs.unlinkSync(_(frameworkPath +'/'+ dir, true));
497
761
  continue;
498
762
  }
499
- else if (
763
+
764
+ if (
500
765
  dir != currentVersion
501
766
  && fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isDirectory()
502
767
  ) {
503
- console.debug('Removing old version: '+ dir);
768
+ console.debug('Removing old version: '+ _(frameworkPath +'/'+ dir, true));
504
769
  new _(frameworkPath +'/'+ dir, true).rmSync()
505
770
  }
506
771
  } catch (e) {
@@ -532,15 +797,34 @@ function PostInstall() {
532
797
  }
533
798
  }
534
799
 
800
+
535
801
  self.end = function(done) {
536
802
 
537
803
  restoreSymlinks();
538
804
 
805
+ // configuring Gina
806
+ var ginaBinanry = _(self.gina + '/bin/gina', true);
807
+ if (!self.isCustomPrefix && self.isGlobalInstall) {
808
+ ginaBinanry = _( self.defaultPrefix + '/lib/node_modules/gina/bin/gina')
809
+ }
810
+
811
+ if ( !fs.existsSync(ginaBinanry) ) {
812
+ console.error('`'+ ginaBinanry +'` not found !');
813
+ }
814
+
815
+ try {
816
+ execSync(ginaBinanry + ' framework:set --global-mode='+ self.isGlobalInstall);
817
+ execSync(ginaBinanry + ' framework:set --prefix='+ self.prefix);
818
+ } catch (err) {
819
+ return done(err)
820
+ }
821
+
822
+
539
823
  // Update middleware file
540
- var filename = _(self.path) + '/MIDDLEWARE';
824
+ var filename = _(self.versionPath) + '/MIDDLEWARE';
541
825
  var msg = "Gina's command line tool has been installed.";
542
826
 
543
- var deps = require(_(self.path) + '/package.json').dependecies;
827
+ var deps = require(_(self.versionPath) + '/package.json').dependecies;
544
828
 
545
829
  var version = require( _(self.gina + '/package.json') ).version;
546
830
  var middleware = 'isaac@'+version; // by default
@@ -551,11 +835,12 @@ function PostInstall() {
551
835
  }
552
836
  }
553
837
 
554
- var expressPackage = _(self.path + '/node_modules/express/package.json');
838
+ var expressPackage = _(self.versionPath + '/node_modules/express/package.json');
555
839
  if ( typeof(middleware) == 'undefined' && fs.existsSync(expressPackage) ) {
556
840
  middleware = require(expressPackage).version;
557
841
  middleware = 'express@' + middleware;
558
- } else if (typeof(middleware) == 'undefined') {
842
+ }
843
+ else if (typeof(middleware) == 'undefined') {
559
844
  return done( new Error('No middleware found !!') );
560
845
  }
561
846
 
@@ -567,6 +852,8 @@ function PostInstall() {
567
852
  if (err) {
568
853
  return done(err)
569
854
  }
855
+ console.debug('Updated: def !== middleware case');
856
+ // execSync(self.prefix +'/bin/gina framework:set --prefix='+ self.prefix);
570
857
  console.info(msg);
571
858
  done()
572
859
  })
@@ -576,12 +863,15 @@ function PostInstall() {
576
863
  if (err) {
577
864
  return done(err)
578
865
  }
866
+ console.info('File created case');
867
+
579
868
  console.info(msg);
580
869
  done()
581
870
  })
582
871
  }
583
872
  }
584
873
 
874
+
585
875
  init()
586
876
  }
587
877
  new PostInstall()