gina 0.1.1-alpha.13 → 0.1.1-alpha.130

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