gina 0.1.1-alpha.11 → 0.1.1-alpha.112

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