gina 0.1.1-alpha.15 → 0.1.1-alpha.150

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