gina 0.1.1-alpha.93 → 0.1.1-alpha.96

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 (283) hide show
  1. package/README.md +87 -26
  2. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/AUTHORS +0 -0
  3. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/LICENSE +0 -0
  4. package/framework/v0.1.1-alpha.96/VERSION +1 -0
  5. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/html/nolayout.html +0 -0
  6. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/html/static.html +0 -0
  7. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/android-chrome-192x192.png +0 -0
  8. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/android-chrome-512x512.png +0 -0
  9. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/apple-touch-icon.png +0 -0
  10. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/favicon-16x16.png +0 -0
  11. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/favicon-32x32.png +0 -0
  12. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/img/favicon.ico +0 -0
  13. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.js +0 -0
  14. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.js.map +0 -0
  15. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.min.css +0 -0
  16. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.min.css.map +0 -0
  17. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.min.js +0 -0
  18. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.min.js.map +0 -0
  19. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.onload.min.js +0 -0
  20. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -0
  21. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/readme.md +0 -0
  22. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/asset/js/plugin/uuid.json +0 -0
  23. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/config.js +0 -0
  24. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/index.js +0 -0
  25. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/connector.js +0 -0
  26. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  27. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  28. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/n1ql.js +0 -0
  29. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/session-store.js +0 -0
  30. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  31. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  32. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/controller/controller.framework.js +0 -0
  33. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/controller/controller.js +0 -0
  34. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/controller/index.js +0 -0
  35. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/.travis.yml +0 -0
  36. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/LICENSE +0 -0
  37. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/README.md +0 -0
  38. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  39. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  40. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/lib/main.js +0 -0
  41. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/lib/types/multipart.js +0 -0
  42. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  43. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/lib/utils.js +0 -0
  44. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/busboy/package.json +0 -0
  45. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  46. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/dev/index.js +0 -0
  47. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/dev/lib/class.js +0 -0
  48. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/dev/lib/factory.js +0 -0
  49. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/dev/lib/tools.js +0 -0
  50. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/gna.js +0 -0
  51. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/README.md +0 -0
  52. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/currency.json +0 -0
  53. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/dist/language/en.json +0 -0
  54. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/dist/language/fr.json +0 -0
  55. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/dist/region/en.json +0 -0
  56. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/dist/region/fr.json +0 -0
  57. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/index.js +0 -0
  58. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/src/make.js +0 -0
  59. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/src/resources/currency.csv +0 -0
  60. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/src/resources/region.csv +0 -0
  61. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/locales/src/resources/region.mapping.json +0 -0
  62. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/mime.types +0 -0
  63. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/model/entity.js +0 -0
  64. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/model/index.js +0 -0
  65. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/model/template/entityFactory.js +0 -0
  66. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/model/template/index.js +0 -0
  67. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/README.md +0 -0
  68. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/index.js +0 -0
  69. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/file/README.md +0 -0
  70. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/file/build.json +0 -0
  71. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/file/package.json +0 -0
  72. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/intl/README.md +0 -0
  73. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/intl/build.json +0 -0
  74. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/intl/package.json +0 -0
  75. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/intl/src/main.js +0 -0
  76. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/storage/README.md +0 -0
  77. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/storage/build.json +0 -0
  78. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/storage/package.json +0 -0
  79. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/storage/src/main.js +0 -0
  80. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/validator/README.md +0 -0
  81. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/validator/build.json +0 -0
  82. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/validator/package.json +0 -0
  83. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/validator/src/form-validator.js +0 -0
  84. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/plugins/lib/validator/src/main.js +0 -0
  85. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/router.js +0 -0
  86. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/server.express.js +0 -0
  87. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/server.isaac.js +0 -0
  88. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/server.js +0 -0
  89. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/status.codes +0 -0
  90. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/config/app.json +0 -0
  91. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/config/routing.json +0 -0
  92. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/config/settings.json +0 -0
  93. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  94. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/config/templates.json +0 -0
  95. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  96. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  97. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  98. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle/index.js +0 -0
  99. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  100. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  101. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  102. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  103. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  104. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_public/readme.md +0 -0
  105. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  106. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_templates/html/homepage.html +0 -0
  107. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/boilerplate/bundle_templates/html/layout/main.html +0 -0
  108. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/command/gina.bat.tpl +0 -0
  109. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/command/gina.tpl +0 -0
  110. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/env.json +0 -0
  111. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/manifest.json +0 -0
  112. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/package.json +0 -0
  113. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/settings.json +0 -0
  114. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/statics.json +0 -0
  115. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/conf/templates.json +0 -0
  116. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/client/json/401.json +0 -0
  117. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/client/json/403.json +0 -0
  118. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/client/json/404.json +0 -0
  119. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/server/html/50x.html +0 -0
  120. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/server/json/500.json +0 -0
  121. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/error/server/json/503.json +0 -0
  122. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/core/template/extensions/logger/config.json +0 -0
  123. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/console.js +0 -0
  124. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/context.js +0 -0
  125. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/dateFormat.js +0 -0
  126. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/index.js +0 -0
  127. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/json/README.md +0 -0
  128. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/json/package.json +0 -0
  129. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/json/src/main.js +0 -0
  130. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/path.js +81 -76
  131. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/plugins/README.md +0 -0
  132. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/plugins/package.json +0 -0
  133. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/plugins/src/api-error.js +0 -0
  134. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/plugins/src/main.js +0 -0
  135. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/prototypes.js +0 -0
  136. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/task.js +0 -0
  137. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/helpers/text.js +0 -0
  138. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/archiver/README.md +0 -0
  139. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/archiver/build.json +0 -0
  140. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/archiver/package.json +0 -0
  141. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/archiver/src/dep/jszip.min.js +0 -0
  142. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/archiver/src/main.js +0 -0
  143. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/aliases.json +0 -0
  144. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/add.js +0 -0
  145. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/arguments.json +0 -0
  146. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/copy.js +0 -0
  147. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/cp.js +0 -0
  148. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/help.js +0 -0
  149. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/help.txt +0 -0
  150. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/list.js +0 -0
  151. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/remove.js +0 -0
  152. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/rename.js +0 -0
  153. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/restart.js +0 -0
  154. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/rm.js +0 -0
  155. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/start.js +0 -0
  156. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/status.js +0 -0
  157. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/bundle/stop.js +0 -0
  158. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/add.js +0 -0
  159. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/get.js +0 -0
  160. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/help.js +0 -0
  161. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/help.txt +0 -0
  162. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/link-dev.js +0 -0
  163. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/list.js +0 -0
  164. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/remove.js +0 -0
  165. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/rm.js +0 -0
  166. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/set.js +0 -0
  167. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/unset.js +0 -0
  168. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/env/use.js +0 -0
  169. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/dot.js +0 -0
  170. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/get.js +0 -0
  171. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/help.js +0 -0
  172. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/help.txt +0 -0
  173. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/init.js +1 -1
  174. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/msg.json +0 -0
  175. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/open.js +0 -0
  176. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/restart.js +0 -0
  177. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/set.js +0 -0
  178. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/start.js +0 -0
  179. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/status.js +0 -0
  180. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/stop.js +0 -0
  181. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/tail.js +0 -0
  182. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/update.js +0 -0
  183. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/framework/version.js +0 -0
  184. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/gina-dev.1.md +0 -0
  185. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/gina-framework.1.md +0 -0
  186. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/gina.1.md +0 -0
  187. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/helper.js +0 -0
  188. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/index.js +0 -0
  189. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/msg.json +0 -0
  190. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/port/help.js +0 -0
  191. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/port/help.txt +0 -0
  192. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/port/inc/scan.js +0 -0
  193. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/port/list.js +0 -0
  194. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/port/set.js +0 -0
  195. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/add.js +0 -0
  196. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/arguments.json +0 -0
  197. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/build.js +0 -0
  198. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/help.js +0 -0
  199. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/help.txt +0 -0
  200. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/import.js +0 -0
  201. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/list.js +0 -0
  202. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/move.js +0 -0
  203. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/remove.js +0 -0
  204. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/rename.js +0 -0
  205. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/restart.js +0 -0
  206. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/rm.js +0 -0
  207. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/start.js +0 -0
  208. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/status.js +0 -0
  209. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/project/stop.js +0 -0
  210. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/protocol/help.js +0 -0
  211. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/protocol/help.txt +0 -0
  212. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/protocol/list.js +0 -0
  213. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/protocol/set.js +0 -0
  214. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/help.js +0 -0
  215. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/help.txt +0 -0
  216. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/link-local.js +0 -0
  217. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/list.js +0 -0
  218. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/remove.js +0 -0
  219. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/rm.js +0 -0
  220. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/set.js +0 -0
  221. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/unset.js +0 -0
  222. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/scope/use.js +0 -0
  223. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cmd/view/add.js +0 -0
  224. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/collection/README.md +0 -0
  225. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/collection/build.json +0 -0
  226. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/collection/package.json +0 -0
  227. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/collection/src/main.js +0 -0
  228. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/config.js +0 -0
  229. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cron/README.md +0 -0
  230. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cron/package.json +0 -0
  231. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/cron/src/main.js +0 -0
  232. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/generator/index.js +0 -0
  233. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/index.js +0 -0
  234. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/LICENSE +0 -0
  235. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/README.md +0 -0
  236. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  237. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/example/protected_inheritance.js +0 -0
  238. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/example/simple_inheritance.js +0 -0
  239. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  240. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/package.json +0 -0
  241. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/inherits/src/main.js +0 -0
  242. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/README.md +0 -0
  243. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/package.json +0 -0
  244. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/default/index.js +0 -0
  245. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/file/index.js +0 -0
  246. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  247. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  248. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/mq/index.js +0 -0
  249. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/mq/listener.js +0 -0
  250. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/containers/mq/speaker.js +0 -0
  251. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/helper.js +0 -0
  252. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/logger/src/main.js +0 -0
  253. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/math/index.js +0 -0
  254. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/README.md +0 -0
  255. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/example/merge.js +0 -0
  256. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/example/merge_2_literal objects.js +0 -0
  257. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/example/merge_and_preserve_first.js +0 -0
  258. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/package.json +0 -0
  259. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/merge/src/main.js +0 -0
  260. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/model.js +0 -0
  261. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/proc.js +0 -0
  262. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/routing/README.md +0 -0
  263. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/routing/build.json +0 -0
  264. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/routing/package.json +0 -0
  265. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/routing/src/main.js +0 -0
  266. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/session-store.js +0 -0
  267. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/shell.js +0 -0
  268. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/swig-filters/README.md +0 -0
  269. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/swig-filters/package.json +0 -0
  270. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/swig-filters/src/main.js +0 -0
  271. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/url/README.md +0 -0
  272. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/url/index.js +0 -0
  273. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/url/mocks.json +0 -0
  274. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/url/routing.json +0 -0
  275. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/url/test.js +0 -0
  276. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/lib/validator.js +0 -0
  277. package/framework/{v0.1.1-alpha.93 → v0.1.1-alpha.96}/package.json +0 -0
  278. package/package.json +7 -9
  279. package/script/post_install.js +240 -185
  280. package/script/pre_install.js +333 -273
  281. package/script/prepare_version.js +212 -93
  282. package/utils/helper.js +26 -9
  283. package/framework/v0.1.1-alpha.93/VERSION +0 -1
@@ -16,17 +16,57 @@ const { execSync } = require('child_process');
16
16
  var isWin32 = function() {
17
17
  return (process.platform === 'win32') ? true : false;
18
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
+
19
57
  // just in case `post_install` is called by hand
20
58
  var initialDir = process.cwd();
21
59
  var frameworkPath = __dirname +'/..';
22
60
  if ( !fs.existsSync(frameworkPath +'/node_modules/colors') ) {
23
61
  process.chdir(frameworkPath);
62
+
24
63
  var oldConfigGlobal = process.env.npm_config_global;
25
64
  process.env.npm_config_global=false;
26
65
  var cmd = ( isWin32() ) ? 'npm.cmd install colors@1.4.0' : 'npm install colors@1.4.0';
27
66
  execSync(cmd);
28
- process.chdir(initialDir);
29
67
  process.env.npm_config_global=oldConfigGlobal;
68
+
69
+ process.chdir(initialDir);
30
70
  }
31
71
 
32
72
  var lib = require('./lib');
@@ -46,79 +86,126 @@ var helpers = null;
46
86
  * */
47
87
  function PostInstall() {
48
88
 
49
- var self = {}, _this = this;
89
+ var self = {};
50
90
 
51
- //Initialize post installation scripts.
52
- var init = function() {
53
- self.isWin32 = isWin32();//getEnvVar('GINA_IS_WIN32');
54
- self.path = getEnvVar('GINA_FRAMEWORK');
55
- self.gina = getEnvVar('GINA_DIR');
56
- self.root = self.gina; // by default
57
- self.isGlobalInstall = false;
58
- self.prefix = process.env.npm_config_prefix || execSync('npm config get prefix').toString().replace(/\n/g, '');
59
- 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
+ }
60
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
+ pkg = execSync('npm list -g gina --long --json').toString().replace(/\n$/g, '');
105
+ } catch(err) {
106
+ throw err
107
+ }
108
+ self.optionalPrefix = JSON.parse(pkg).dependencies.gina.config.optionalPrefix.replace(/^\~/, getUserHome());
109
+
110
+ // `process.env.npm_config_prefix` is only retrieved on `npm install gina`
111
+ // and it should always be equal to `self.defaultPrefix`
112
+ self.prefix = process.env.npm_config_prefix || self.defaultPrefix;
113
+ self.isCustomPrefix = false;
114
+ self.isGinaInstalled = false;
115
+
116
+ // Overriding thru passed arguments
61
117
  var args = process.argv, i = 0, len = args.length;
62
118
  for (; i < len; ++i) {
63
119
  if ( /^(\-g|\-\-global)$/.test(args[i]) ) {
64
120
  self.isGlobalInstall = true;
65
121
  continue;
66
122
  }
123
+
124
+ if ( /^\-\-reset$/.test(args[i]) ) {
125
+ self.isResetNeeded = true;
126
+ continue;
127
+ }
128
+
67
129
  if ( /^\-\-prefix\=/.test(args[i] ) ) {
68
130
  self.isCustomPrefix = true;
69
131
  self.prefix = args[i].split(/\=/)[1];
132
+ self.prefix = self.prefix.replace(/^\~/, getUserHome());
70
133
  continue;
71
134
  }
72
135
  }
73
136
 
74
- if (
75
- // process.env.npm_config_prefix
76
- // &&
77
- self.prefix != process.env.npm_config_prefix
78
- ) {
79
- // self.prefix = process.env.npm_config_prefix;
80
- self.isCustomPrefix = true;
81
- }
82
-
83
- if ( !self.isGlobalInstall ) { // none global install
84
- // process.env.npm_config_prefix = process.cwd();
85
- self.prefix = process.cwd();
86
- // self.root = process.cwd(); // project path
87
- // console.error('local installation is not supported for this version at the moment.');
88
- // console.info('please use `npm install -g gina`');
89
- // process.exit(1);
137
+ // For local install
138
+ console.debug('self.isGlobalInstall => '+ self.isGlobalInstall);
139
+ if ( !self.isGlobalInstall ) {
140
+ console.warn('Local installation is not fully supported at the moment.');
141
+ 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');
142
+ // Just in case someone is trying to run pre_install from the `gina` module
143
+ if (!/node\_modules(\\\\|\/)gina$/.test(process.cwd())) {
144
+ self.prefix = process.cwd();
145
+ }
90
146
  }
91
- // setEnvVar('GINA_PREFIX', self.prefix); // for the `helper.js`
92
-
93
- // check for ~/.gina (first installation ?)
94
- var ginaHomeDir = getUserHome() + ( isWin32() ? '\\.gina' : '/.gina' );
95
- self.version = require( self.gina + ( isWin32() ? '\\' : '/' ) +'package.json' ).version;
96
- self.shortVersion = self.version.split('.');
97
- self.shortVersion.splice(2);
98
- self.shortVersion = self.shortVersion.join('.');
99
-
100
147
 
148
+ // checking permission
149
+ var hasPermissionsForBin = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'bin');
150
+ var hasPermissionsForLib = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'lib');
151
+ var hasPermissionsForVar = isWritableSync(self.prefix + ( isWin32() ? '\\' : '/' ) + 'var');
152
+ if ( !hasPermissionsForBin || !hasPermissionsForLib || !hasPermissionsForVar) {
153
+ if (!hasPermissionsForBin) {
154
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'bin')
155
+ }
156
+ if (!hasPermissionsForLib) {
157
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'lib')
158
+ }
159
+ if (!hasPermissionsForVar) {
160
+ console.warn('Path not accessible or missing: '+ self.prefix + ( isWin32() ? '\\' : '/' ) + 'var')
161
+ }
101
162
 
102
- var frameworkVersionPath = __dirname +'/../framework/v'+ self.version;
103
- helpers = require(frameworkVersionPath+ '/helpers');
104
-
105
- // if not found -> skip because it means that gina might not be installed or configured yet
106
- if ( !new _(ginaHomeDir).existsSync() ) {
107
- new _(ginaHomeDir).mkdirSync()
108
- }
109
- if ( !new _(ginaHomeDir +'/'+ self.shortVersion ).existsSync() ) {
110
- new _(ginaHomeDir +'/'+ self.shortVersion).mkdirSync()
163
+ // console.warn('You do not have sufficient permissions. Switching to `--prefix='+ self.optionalPrefix +'`');
164
+ // process.env.npm_config_prefix = self.prefix = self.optionalPrefix;
111
165
  }
112
166
 
113
- console.debug('Is this for Windows ? ' + self.isWin32);
114
-
167
+ if ( self.prefix != self.defaultPrefix ) {
168
+ self.isCustomPrefix = true;
169
+ }
115
170
 
171
+ self.gina = __dirname +'/..';
172
+ // tying to figure out if gina is already install the given prefix
173
+ var hasFoundGina = pkg;
174
+ try {
175
+ hasFoundGina = JSON.parse(hasFoundGina);
176
+ if ( hasFoundGina.dependencies && typeof(hasFoundGina.dependencies.gina) != 'undefined' ) {
177
+ self.isGinaInstalled = true;
178
+ self.versionPath = self.gina;
179
+ self.versionPath += (isWin32()) ? '\\framework\\' : '/framework/';
180
+ self.version = hasFoundGina.dependencies.gina.version;
181
+ self.versionPath += 'v'+ self.version;
182
+
183
+ self.shortVersion = self.version.split('.');
184
+ self.shortVersion.splice(2);
185
+ self.shortVersion = self.shortVersion.join('.');
186
+
187
+ console.debug('Install path => '+ hasFoundGina.dependencies.gina.path);
188
+
189
+ // OK ... found installed gina but on a different prefix
190
+ // In this case, let's assume that it is not really installed
191
+ if ( !new RegExp('^'+ self.prefix).test(hasFoundGina.dependencies.gina.path) ) {
192
+ self.isGinaInstalled = false;
193
+ }
194
+ }
195
+ } catch (err) {}
196
+
197
+ console.debug('self.defaultPrefix => '+ self.defaultPrefix);
198
+ console.debug('self.optionalPrefix => '+ self.optionalPrefix );
199
+ console.debug('self.prefix => '+ self.prefix);
200
+ console.debug('self.isCustomPrefix => ', self.isCustomPrefix);
201
+ // only available when running the script with NPM
202
+ console.debug('process.env.npm_config_prefix => '+ process.env.npm_config_prefix);
203
+ }
116
204
 
117
- console.debug('prefix path: ' + self.prefix);
118
- console.debug('framework path: ' + self.gina);
119
- console.debug('framework version path: ' + self.path);
120
- console.debug('cwd path: ' + self.root );
121
- console.debug('this is a global install ...');
205
+ //Initialize post installation scripts.
206
+ var init = function() {
207
+ configure();
208
+ helpers = require(self.versionPath+ '/helpers');
122
209
 
123
210
  begin(0);
124
211
  }
@@ -206,7 +293,7 @@ function PostInstall() {
206
293
  var version = self.version;
207
294
  console.debug('writting version number: '+ version);
208
295
 
209
- var target = _(self.path + '/VERSION');
296
+ var target = _(self.versionPath + '/VERSION');
210
297
  try {
211
298
  if ( fs.existsSync(target) ) {
212
299
  fs.unlinkSync(target)
@@ -219,6 +306,7 @@ function PostInstall() {
219
306
  done();
220
307
  }
221
308
 
309
+ // TODO - Remove this part
222
310
  var configureGina = function() {
223
311
  // link to ./bin/cli to binaries dir
224
312
  if (!self.isWin32) {
@@ -252,7 +340,7 @@ function PostInstall() {
252
340
 
253
341
  // var cmd = 'ln -s '+ self.gina +'/bin/gina '+ binPath;
254
342
  // console.debug('running: '+ cmd);
255
- // run(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
343
+ // run(cmd, { cwd: _(self.versionPath), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
256
344
  // .onData(function(data){
257
345
  // console.info(data)
258
346
  // })
@@ -267,7 +355,7 @@ function PostInstall() {
267
355
  //
268
356
  // TODO - remove this part for the next version
269
357
  // cmd = 'ln -s '+ self.gina +'/bin/cli-debug '+ binPath +'/gina-debug';
270
- // run(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
358
+ // run(cmd, { cwd: _(self.versionPath), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
271
359
  // .onData(function(data){
272
360
  // console.info(data)
273
361
  // })
@@ -285,44 +373,51 @@ function PostInstall() {
285
373
 
286
374
  //Creating framework command line file for nix.
287
375
  var createGinaFile = function(win32Name, callback) {
376
+ // Created by NPM for global installations
377
+ if (self.isGlobalInstall) {
378
+ return callback(false);
379
+ }
380
+
288
381
  console.info('Current prefix: '+ self.prefix );
289
- console.info('Creating framework command line: '+ _(self.gina + '/package.json', true) );
290
- var name = require( _(self.gina + '/package.json') ).name;
382
+ console.info('Current package.json: '+ _(self.gina + '/package.json', true) );
383
+
384
+ var name = require( _(self.gina + '/package.json', true) ).name;
291
385
  console.info('Package name: '+ name );
386
+ console.info('Creating framework command line:');
387
+ var appPath = process.cwd();
388
+ // _( self.gina.substring(0, (self.gina.length - ("node_modules/" + name + '/').length)) );
292
389
 
293
- var appPath = _( self.gina.substring(0, (self.gina.length - ("node_modules/" + name + '/').length)) );
294
390
 
295
- var source = _(self.path + '/core/template/command/gina.tpl');
296
- var target = _(appPath +'/'+ name);
297
- if ( typeof(win32Name) != 'undefined') {
391
+ console.debug('App path: '+ appPath);
392
+ var source = _(self.versionPath + '/core/template/command/gina.tpl', true);
393
+ console.debug('Source: '+ source);
394
+ var target = _(appPath +'/'+ name, true);
395
+ console.debug('Target: '+ target);
396
+
397
+ if ( win32Name && typeof(win32Name) != 'undefined') {
298
398
  target = _(appPath +'/'+ win32Name)
299
399
  }
300
400
  //Will override.
301
401
  console.info('linking to binaries dir: '+ source +' -> '+ target);
302
- if ( typeof(callback) != 'undefined') {
402
+ if ( callback && typeof(callback) != 'undefined') {
303
403
  if ( !self.isGlobalInstall ) { // local install only
304
404
  lib.generator.createFileFromTemplate(source, target, function onGinaFileCreated(err) {
305
- callback(err)
306
-
405
+ return callback(err)
307
406
  })
308
407
  } else {
309
-
310
408
  // configureGina();
311
- callback(false)
409
+ return callback(false)
312
410
  }
313
411
  } else {
314
412
  if ( !self.isGlobalInstall ) {
315
413
  lib.generator.createFileFromTemplate(source, target)
316
414
  }
317
- // else {
318
- // configureGina();
319
- // }
320
415
  }
321
416
  }
322
417
 
323
418
  self.createGinaFileForPlatform = async function(done) {
324
419
  console.info('Creating platform file');
325
- var name = require( _(self.path + '/package.json') ).name;
420
+ var name = require( _(self.versionPath + '/package.json') ).name;
326
421
 
327
422
  var filename = ( (self.isWin32) ? '.' : '' ) + name;
328
423
 
@@ -334,7 +429,7 @@ function PostInstall() {
334
429
  }
335
430
 
336
431
  // this is done to allow multiple calls of post_install.js
337
- var filename = _(self.path + '/SUCCESS');
432
+ var filename = _(self.versionPath + '/SUCCESS');
338
433
  var installed = fs.existsSync( filename );
339
434
  if (installed) {
340
435
  fs.unlinkSync( filename );
@@ -356,7 +451,7 @@ function PostInstall() {
356
451
  if ( !hasNodeModulesSync() ) {
357
452
  return npmInstall(done)
358
453
  } else {
359
- var target = new _(self.path + '/node_modules');
454
+ var target = new _(self.versionPath + '/node_modules');
360
455
  console.debug('replacing: ', target.toString() );
361
456
  return target
362
457
  .rm( function onRemove(err) {
@@ -372,8 +467,9 @@ function PostInstall() {
372
467
  }
373
468
 
374
469
  if (self.isWin32) {
375
- var appPath = _( self.path.substring(0, (self.path.length - ("node_modules/" + name + '/').length)) );
376
- var source = _(self.path + '/core/template/command/gina.bat.tpl');
470
+ // var appPath = _( self.versionPath.substring(0, (self.versionPath.length - ("node_modules/" + name + '/').length)) );
471
+ var appPath = process.cwd()
472
+ var source = _(self.versionPath + '/core/template/command/gina.bat.tpl');
377
473
  var target = _(appPath +'/'+ name + '.bat');
378
474
  if ( fs.existsSync(target) ) {
379
475
  fs.unlinkSync(target);
@@ -394,53 +490,30 @@ function PostInstall() {
394
490
 
395
491
 
396
492
  var hasNodeModulesSync = function() {
397
- return fs.existsSync( _(self.path + '/node_modules') )
493
+ return fs.existsSync( _(self.versionPath + '/node_modules') )
398
494
  }
399
495
 
400
496
 
401
497
  var npmInstall = function(done) {
402
498
 
403
- console.info('now installing modules: please, wait ...');
499
+ console.info('Now installing modules: please, wait ...');
404
500
  console.info('Prefix ('+ self.isCustomPrefix +'): '+ self.prefix);
405
501
  var initialDir = process.cwd();
406
502
 
407
503
 
408
504
  var cmd = ( isWin32() ) ? 'npm.cmd install' : 'npm install';
409
505
 
410
- process.chdir( self.path );
506
+ process.chdir( self.versionPath );
507
+
411
508
  console.info('running: `'+ cmd +'` from '+ process.cwd() );
412
509
  console.info('running using TMPDIR: '+ _(getTmpDir(), true) );
413
-
414
- process.env.npm_config_global=false;
510
+ var oldConfigGlobal = process.env.npm_config_global;
511
+ process.env.npm_config_global = false;
415
512
  execSync(cmd);
416
-
417
- // var deps = require(_(self.path + '/package.json', true)).dependencies;
418
- // for (let d in deps) {
419
- // try {
420
- // console.info('running: `'+ cmd +' '+ d +'@"'+ deps[d] +'"` from '+ self.path );
421
- // execSync(cmd +' '+ d +'@"'+ deps[d] +'"');
422
- // } catch (err) {
423
- // return done(err)
424
- // }
425
- // }
426
513
  process.chdir(initialDir);
427
- process.env.npm_config_global=true;
514
+ process.env.npm_config_global = oldConfigGlobal;
428
515
 
429
516
  done()
430
-
431
-
432
- // run(cmd, { cwd: _(self.path), tmp: _(getTmpDir(), true), outToProcessSTD: true })
433
- // .onData(function onData(data){
434
- // console.info(data)
435
- // })
436
- // .onComplete( function onDone(err, data){
437
- // if (!err || /^false$/i.test(err) ) {
438
- // console.info('completed: '+ cmd);
439
- // return done()
440
- // }
441
- // console.debug('error found: '+ err + '\n=> '+ data);
442
- // done(err)
443
- // })
444
517
  }
445
518
 
446
519
  self.cleanupIfNeeded = function(done) {
@@ -527,7 +600,6 @@ function PostInstall() {
527
600
 
528
601
  let files = []
529
602
  , extDir = _(ext +'/'+ dir, true)
530
- , extDirObj = new _(extDir)
531
603
  ;
532
604
  try {
533
605
 
@@ -564,7 +636,7 @@ function PostInstall() {
564
636
  });
565
637
 
566
638
  if (err) {
567
- throw err;
639
+ return done(err);
568
640
  }
569
641
  }
570
642
  }
@@ -575,76 +647,62 @@ function PostInstall() {
575
647
  }
576
648
 
577
649
  /**
578
- * Link binary to profile
579
- * Will edit ~/.profile, check and add if needed path to ~/.npm-global
650
+ * Updated user's profile
651
+ * Will edit ~/.profile, check and add if needed path to Gina binary
580
652
  *
581
653
  */
582
- // self.linkBinaryToProfile = async function(done) {
583
-
584
- // // create a directory for global installations
585
- // var npmGlobalPath = _(getUserHome() + '/.npm-global', true);
654
+ self.updateUserProfile = async function(done) {
586
655
 
587
- // if (self.prefix != npmGlobalPath ) {
588
- // done()
589
- // }
656
+ if ( !self.isGlobalInstall || isWin32() ) {
657
+ return done()
658
+ }
659
+ if (!self.isCustomPrefix || self.prefix == self.defaultPrefix) {
660
+ return done()
661
+ }
590
662
 
591
- // console.info('Setting npm global path: '+ npmGlobalPath +' '+ new _(npmGlobalPath).existsSync() );
592
- // var npmGlobalPathObj = new _(npmGlobalPath);
593
- // if ( !npmGlobalPathObj.existsSync() ) {
594
- // npmGlobalPathObj.mkdirSync()
595
- // }
596
- // // from `/usr/local` -> `~/.npm-global`
597
- // var cmd = 'npm config set prefix '+ getUserHome() +'/.npm-global';
598
- // await promisify(run)(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
599
- // .catch(function onError(err){
600
- // if (err) {
601
- // console.warn('try to run: sudo ' + cmd);
602
- // return done(err);
603
- // }
604
- // });
605
-
606
- // var profilePath = getUserHome() + '/.profile';
607
- // var profilePathObj = new _(profilePath);
608
- // if ( !profilePathObj.existsSync() ) {
609
- // cmd = 'touch '+ profilePath;
610
- // await promisify(run)(cmd, { cwd: _(self.path), tmp: _(self.root +'/tmp'), outToProcessSTD: true })
611
- // .catch(function onError(err){
612
- // if (err) {
613
- // console.warn('try to run: sudo ' + cmd);
614
- // return done(err);
615
- // }
616
- // });
617
- // }
663
+ var profilePath = getUserHome() + '/.profile';
664
+ var profilePathObj = new _(profilePath);
665
+ if ( !profilePathObj.existsSync() ) {
666
+ cmd = 'touch '+ profilePath;
667
+ await promisify(run)(cmd, { cwd: _(self.versionPath), tmp: _(getTmpDir(), true), outToProcessSTD: true })
668
+ .catch(function onError(err){
669
+ if (err) {
670
+ console.warn('try to run: sudo ' + cmd);
671
+ return done(err);
672
+ }
673
+ });
674
+ }
618
675
 
619
- // var inFile = null;
620
- // try {
621
- // inFile = execSync("cat ~/.profile | grep .npm-global/bin").toString();
622
- // } catch (err) {
623
- // // nothing to do
624
- // }
676
+ var inFile = null;
677
+ var patt = _(self.prefix.replace( new RegExp( '^' +getUserHome() ), '(.*)[$]HOME') + '/bin', true);
678
+ try {
679
+ inFile = execSync("cat ~/.profile | grep -Eo '" + patt +"'").toString();
680
+ } catch (err) {
681
+ // nothing to do
682
+ }
625
683
 
626
- // if (!inFile) {
627
- // inFile = "\n# set PATH so it includes user‘s private npm bin if exists"
628
- // inFile += '\nif [ -d "$HOME/.npm-global/bin" ]; then';
629
- // inFile += '\n PATH="$HOME/.npm-global/bin:$PATH"';
630
- // inFile += '\nfi\n';
631
- // try {
632
- // fs.appendFileSync( getUserHome()+'/.profile', inFile );
633
- // } catch (err) {
634
- // return done(err);
635
- // }
636
- // inFile = null;
684
+ if (!inFile) {
685
+ patt = patt.replace('(.*)[$]', '$');
686
+ inFile = '\nif [ -d "'+ patt +'" ]; then';
687
+ inFile += '\n PATH="'+ patt +':$PATH"';
688
+ inFile += '\nfi\n';
689
+ try {
690
+ fs.appendFileSync( getUserHome()+'/.profile', inFile );
691
+ } catch (err) {
692
+ return done(err);
693
+ }
694
+ inFile = null;
637
695
 
638
- // // we need to source/update ~/.profile
639
- // try {
640
- // execSync("source "+ profilePath);
641
- // } catch (err) {
642
- // return done(err)
643
- // }
644
- // }
696
+ // we need to source/update ~/.profile
697
+ try {
698
+ execSync("source "+ profilePath);
699
+ } catch (err) {
700
+ return done(err)
701
+ }
702
+ }
645
703
 
646
- // done()
647
- // }
704
+ done()
705
+ }
648
706
 
649
707
  var restoreSymlinks = function() {
650
708
  var archivesPath = _(getUserHome() + '/.gina/archives/framework', true);
@@ -669,15 +727,17 @@ function PostInstall() {
669
727
  // intercept & remove existing symlinks or old versions dir
670
728
  try {
671
729
  if ( fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isSymbolicLink() ) {
672
- new _(frameworkPath +'/'+ dir, true).rmSync();
673
- console.debug('Removing Symlink: '+ dir);
730
+ console.debug('Removing Symlink: '+ _(frameworkPath +'/'+ dir, true) );
731
+ // new _(frameworkPath +'/'+ dir, true).rmSync();
732
+ fs.unlinkSync(_(frameworkPath +'/'+ dir, true));
674
733
  continue;
675
734
  }
676
- else if (
735
+
736
+ if (
677
737
  dir != currentVersion
678
738
  && fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isDirectory()
679
739
  ) {
680
- console.debug('Removing old version: '+ dir);
740
+ console.debug('Removing old version: '+ _(frameworkPath +'/'+ dir, true));
681
741
  new _(frameworkPath +'/'+ dir, true).rmSync()
682
742
  }
683
743
  } catch (e) {
@@ -712,13 +772,15 @@ function PostInstall() {
712
772
  self.end = function(done) {
713
773
 
714
774
  restoreSymlinks();
715
-
775
+ // set settings prefix
776
+ var ginaBinanry = _(self.gina + '/bin/gina', true);
777
+ execSync(ginaBinanry + ' framework:set --prefix='+ self.prefix);
716
778
 
717
779
  // Update middleware file
718
- var filename = _(self.path) + '/MIDDLEWARE';
780
+ var filename = _(self.versionPath) + '/MIDDLEWARE';
719
781
  var msg = "Gina's command line tool has been installed.";
720
782
 
721
- var deps = require(_(self.path) + '/package.json').dependecies;
783
+ var deps = require(_(self.versionPath) + '/package.json').dependecies;
722
784
 
723
785
  var version = require( _(self.gina + '/package.json') ).version;
724
786
  var middleware = 'isaac@'+version; // by default
@@ -729,7 +791,7 @@ function PostInstall() {
729
791
  }
730
792
  }
731
793
 
732
- var expressPackage = _(self.path + '/node_modules/express/package.json');
794
+ var expressPackage = _(self.versionPath + '/node_modules/express/package.json');
733
795
  if ( typeof(middleware) == 'undefined' && fs.existsSync(expressPackage) ) {
734
796
  middleware = require(expressPackage).version;
735
797
  middleware = 'express@' + middleware;
@@ -746,7 +808,7 @@ function PostInstall() {
746
808
  if (err) {
747
809
  return done(err)
748
810
  }
749
- console.info('def !== middleware case');
811
+ console.debug('Updated: def !== middleware case');
750
812
  // execSync(self.prefix +'/bin/gina framework:set --prefix='+ self.prefix);
751
813
  console.info(msg);
752
814
  done()
@@ -759,11 +821,6 @@ function PostInstall() {
759
821
  }
760
822
  console.info('File created case');
761
823
 
762
- // var cmd = self.prefix;
763
- // cmd += '/gina framework:set --prefix=';
764
- // cmd += self.prefix;
765
- // execSync(cmd);
766
-
767
824
  console.info(msg);
768
825
  done()
769
826
  })
@@ -771,8 +828,6 @@ function PostInstall() {
771
828
  }
772
829
 
773
830
 
774
- // setTimeout(() => {
775
- init()
776
- // }, 1000);
831
+ init()
777
832
  }
778
833
  new PostInstall()