gina 0.1.1-alpha.94 → 0.1.1-alpha.97

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 (288) hide show
  1. package/README.md +90 -26
  2. package/bin/cli +9 -0
  3. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/AUTHORS +0 -0
  4. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/LICENSE +0 -0
  5. package/framework/v0.1.1-alpha.97/VERSION +1 -0
  6. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/html/nolayout.html +0 -0
  7. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/html/static.html +0 -0
  8. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/android-chrome-192x192.png +0 -0
  9. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/android-chrome-512x512.png +0 -0
  10. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/apple-touch-icon.png +0 -0
  11. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/favicon-16x16.png +0 -0
  12. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/favicon-32x32.png +0 -0
  13. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/img/favicon.ico +0 -0
  14. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.js +0 -0
  15. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.js.map +0 -0
  16. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.min.css +0 -0
  17. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.min.css.map +0 -0
  18. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.min.js +0 -0
  19. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.min.js.map +0 -0
  20. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.onload.min.js +0 -0
  21. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -0
  22. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/readme.md +0 -0
  23. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/asset/js/plugin/uuid.json +0 -0
  24. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/config.js +0 -0
  25. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/index.js +0 -0
  26. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/connector.js +0 -0
  27. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  28. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  29. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/n1ql.js +0 -0
  30. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/session-store.js +0 -0
  31. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  32. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  33. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/controller/controller.framework.js +0 -0
  34. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/controller/controller.js +0 -0
  35. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/controller/index.js +0 -0
  36. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/.travis.yml +0 -0
  37. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/LICENSE +0 -0
  38. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/README.md +0 -0
  39. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  40. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  41. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/lib/main.js +0 -0
  42. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/lib/types/multipart.js +0 -0
  43. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  44. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/lib/utils.js +0 -0
  45. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/busboy/package.json +0 -0
  46. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  47. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/dev/index.js +0 -0
  48. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/dev/lib/class.js +0 -0
  49. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/dev/lib/factory.js +0 -0
  50. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/dev/lib/tools.js +0 -0
  51. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/gna.js +0 -0
  52. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/README.md +0 -0
  53. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/currency.json +0 -0
  54. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/dist/language/en.json +0 -0
  55. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/dist/language/fr.json +0 -0
  56. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/dist/region/en.json +0 -0
  57. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/dist/region/fr.json +0 -0
  58. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/index.js +0 -0
  59. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/src/make.js +0 -0
  60. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/src/resources/currency.csv +0 -0
  61. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/src/resources/region.csv +0 -0
  62. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/locales/src/resources/region.mapping.json +0 -0
  63. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/mime.types +0 -0
  64. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/model/entity.js +0 -0
  65. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/model/index.js +0 -0
  66. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/model/template/entityFactory.js +0 -0
  67. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/model/template/index.js +0 -0
  68. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/README.md +0 -0
  69. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/index.js +0 -0
  70. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/file/README.md +0 -0
  71. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/file/build.json +0 -0
  72. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/file/package.json +0 -0
  73. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/intl/README.md +0 -0
  74. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/intl/build.json +0 -0
  75. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/intl/package.json +0 -0
  76. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/intl/src/main.js +0 -0
  77. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/storage/README.md +0 -0
  78. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/storage/build.json +0 -0
  79. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/storage/package.json +0 -0
  80. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/storage/src/main.js +0 -0
  81. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/validator/README.md +0 -0
  82. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/validator/build.json +0 -0
  83. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/validator/package.json +0 -0
  84. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/validator/src/form-validator.js +0 -0
  85. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/plugins/lib/validator/src/main.js +0 -0
  86. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/router.js +0 -0
  87. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/server.express.js +0 -0
  88. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/server.isaac.js +0 -0
  89. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/server.js +0 -0
  90. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/status.codes +0 -0
  91. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/config/app.json +0 -0
  92. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/config/routing.json +0 -0
  93. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/config/settings.json +0 -0
  94. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  95. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/config/templates.json +0 -0
  96. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  97. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  98. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  99. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle/index.js +0 -0
  100. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  101. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  102. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  103. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  104. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  105. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_public/readme.md +0 -0
  106. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  107. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_templates/html/homepage.html +0 -0
  108. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/boilerplate/bundle_templates/html/layout/main.html +0 -0
  109. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/command/gina.bat.tpl +0 -0
  110. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/command/gina.tpl +0 -0
  111. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/env.json +0 -0
  112. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/manifest.json +0 -0
  113. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/package.json +0 -0
  114. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/settings.json +0 -0
  115. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/statics.json +0 -0
  116. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/conf/templates.json +0 -0
  117. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/client/json/401.json +0 -0
  118. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/client/json/403.json +0 -0
  119. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/client/json/404.json +0 -0
  120. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/server/html/50x.html +0 -0
  121. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/server/json/500.json +0 -0
  122. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/error/server/json/503.json +0 -0
  123. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/core/template/extensions/logger/config.json +0 -0
  124. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/console.js +0 -0
  125. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/context.js +0 -0
  126. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/dateFormat.js +0 -0
  127. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/index.js +0 -0
  128. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/json/README.md +0 -0
  129. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/json/package.json +0 -0
  130. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/json/src/main.js +0 -0
  131. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/path.js +81 -76
  132. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/plugins/README.md +0 -0
  133. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/plugins/package.json +0 -0
  134. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/plugins/src/api-error.js +0 -0
  135. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/plugins/src/main.js +0 -0
  136. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/prototypes.js +0 -0
  137. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/task.js +0 -0
  138. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/helpers/text.js +0 -0
  139. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/archiver/README.md +0 -0
  140. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/archiver/build.json +0 -0
  141. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/archiver/package.json +0 -0
  142. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/archiver/src/dep/jszip.min.js +0 -0
  143. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/archiver/src/main.js +0 -0
  144. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/aliases.json +0 -0
  145. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/add.js +0 -0
  146. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/arguments.json +0 -0
  147. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/copy.js +0 -0
  148. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/cp.js +0 -0
  149. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/help.js +0 -0
  150. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/help.txt +0 -0
  151. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/list.js +0 -0
  152. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/remove.js +0 -0
  153. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/rename.js +0 -0
  154. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/restart.js +0 -0
  155. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/rm.js +0 -0
  156. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/start.js +0 -0
  157. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/status.js +0 -0
  158. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/bundle/stop.js +0 -0
  159. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/add.js +0 -0
  160. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/get.js +0 -0
  161. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/help.js +0 -0
  162. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/help.txt +0 -0
  163. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/link-dev.js +0 -0
  164. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/list.js +0 -0
  165. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/remove.js +0 -0
  166. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/rm.js +0 -0
  167. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/set.js +0 -0
  168. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/unset.js +0 -0
  169. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/env/use.js +0 -0
  170. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/dot.js +0 -0
  171. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/get.js +0 -0
  172. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/help.js +0 -0
  173. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/help.txt +0 -0
  174. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/init.js +25 -13
  175. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/msg.json +0 -0
  176. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/open.js +0 -0
  177. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/restart.js +0 -0
  178. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/set.js +34 -2
  179. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/start.js +0 -0
  180. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/status.js +0 -0
  181. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/stop.js +0 -0
  182. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/tail.js +0 -0
  183. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/update.js +0 -0
  184. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/framework/version.js +0 -0
  185. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/gina-dev.1.md +0 -0
  186. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/gina-framework.1.md +0 -0
  187. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/gina.1.md +0 -0
  188. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/helper.js +0 -0
  189. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/index.js +0 -0
  190. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/msg.json +0 -0
  191. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/port/help.js +0 -0
  192. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/port/help.txt +0 -0
  193. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/port/inc/scan.js +0 -0
  194. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/port/list.js +0 -0
  195. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/port/set.js +0 -0
  196. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/add.js +0 -0
  197. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/arguments.json +0 -0
  198. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/build.js +0 -0
  199. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/help.js +0 -0
  200. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/help.txt +0 -0
  201. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/import.js +0 -0
  202. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/list.js +0 -0
  203. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/move.js +0 -0
  204. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/remove.js +0 -0
  205. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/rename.js +0 -0
  206. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/restart.js +0 -0
  207. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/rm.js +0 -0
  208. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/start.js +0 -0
  209. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/status.js +0 -0
  210. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/project/stop.js +0 -0
  211. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/protocol/help.js +0 -0
  212. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/protocol/help.txt +0 -0
  213. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/protocol/list.js +0 -0
  214. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/protocol/set.js +0 -0
  215. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/help.js +0 -0
  216. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/help.txt +0 -0
  217. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/link-local.js +0 -0
  218. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/list.js +0 -0
  219. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/remove.js +0 -0
  220. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/rm.js +0 -0
  221. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/set.js +0 -0
  222. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/unset.js +0 -0
  223. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/scope/use.js +0 -0
  224. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cmd/view/add.js +0 -0
  225. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/collection/README.md +0 -0
  226. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/collection/build.json +0 -0
  227. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/collection/package.json +0 -0
  228. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/collection/src/main.js +0 -0
  229. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/config.js +0 -0
  230. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cron/README.md +0 -0
  231. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cron/package.json +0 -0
  232. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/cron/src/main.js +0 -0
  233. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/generator/index.js +0 -0
  234. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/index.js +0 -0
  235. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/LICENSE +0 -0
  236. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/README.md +0 -0
  237. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  238. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/example/protected_inheritance.js +0 -0
  239. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/example/simple_inheritance.js +0 -0
  240. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  241. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/package.json +0 -0
  242. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/inherits/src/main.js +0 -0
  243. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/README.md +0 -0
  244. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/package.json +0 -0
  245. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/default/index.js +0 -0
  246. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/file/index.js +0 -0
  247. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  248. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  249. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/mq/index.js +0 -0
  250. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/mq/listener.js +0 -0
  251. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/containers/mq/speaker.js +0 -0
  252. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/helper.js +0 -0
  253. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/logger/src/main.js +0 -0
  254. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/math/index.js +0 -0
  255. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/README.md +0 -0
  256. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/example/merge.js +0 -0
  257. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/example/merge_2_literal objects.js +0 -0
  258. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/example/merge_and_preserve_first.js +0 -0
  259. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/package.json +0 -0
  260. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/merge/src/main.js +0 -0
  261. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/model.js +0 -0
  262. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/proc.js +0 -0
  263. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/routing/README.md +0 -0
  264. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/routing/build.json +0 -0
  265. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/routing/package.json +0 -0
  266. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/routing/src/main.js +0 -0
  267. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/session-store.js +0 -0
  268. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/shell.js +0 -0
  269. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/swig-filters/README.md +0 -0
  270. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/swig-filters/package.json +0 -0
  271. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/swig-filters/src/main.js +0 -0
  272. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/url/README.md +0 -0
  273. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/url/index.js +0 -0
  274. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/url/mocks.json +0 -0
  275. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/url/routing.json +0 -0
  276. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/url/test.js +0 -0
  277. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/lib/validator.js +0 -0
  278. package/framework/{v0.1.1-alpha.94 → v0.1.1-alpha.97}/package.json +0 -0
  279. package/package.json +9 -6
  280. package/resources/home/main.json +3 -0
  281. package/resources/home/settings.json +1 -0
  282. package/resources/package.json.template +24 -20
  283. package/script/post_install.js +267 -183
  284. package/script/post_publish.js +185 -0
  285. package/script/pre_install.js +333 -268
  286. package/script/prepare_version.js +216 -93
  287. package/utils/helper.js +36 -9
  288. package/framework/v0.1.1-alpha.94/VERSION +0 -1
@@ -39,11 +39,49 @@ var lib = null;
39
39
  * @constructor
40
40
  * */
41
41
  function PrepareVersion() {
42
- var self = {};
42
+ var self = {
43
+ isWin32: isWin32(),
44
+ git : {
45
+ tag: 'latest',
46
+ msg: null
47
+ },
48
+ isGitPushNeeded : false
49
+
50
+ };
51
+
52
+ var configure = function() {
53
+ // TODO - handle windows case
54
+ if ( /^true$/i.test(isWin32()) ) {
55
+ throw new Error('Windows in not yet fully supported. Thank you for your patience');
56
+ }
57
+
58
+ // Overriding thru passed arguments
59
+ var args = process.argv, i = 0, len = args.length;
60
+ for (; i < len; ++i) {
61
+ if ( /^\-\-tag/.test(args[i]) ) {
62
+ var tag = args[i].split(/\=/)[1];
63
+ if ( tag != self.git.tag) {
64
+ self.git.tag = tag;
65
+ self.isGitPushNeeded = ( typeof(process.env.npm_config_dry_run) != 'undefined' ) ? false : true
66
+ }
67
+ continue;
68
+ }
69
+
70
+ if ( /^(\-m|\-\-message)$/.test(args[i]) ) {
71
+ var m = args[i];
72
+ if (/^(.*)\=/.test(m)) {
73
+ m = m.split(/\=/)[1]
74
+ }
75
+ self.git.msg = m.replace(/^(\-m|\-\-message)/g, '').replace(/(\"|\')/g, '');
76
+ continue;
77
+ }
78
+ }
79
+
80
+ self.gina = __dirname +'/..';
81
+ }
43
82
 
44
83
  var init = function() {
45
- self.isWin32 = isWin32();
46
- self.prefix = execSync('npm config get prefix');
84
+ configure();
47
85
 
48
86
  begin(0);
49
87
  };
@@ -267,7 +305,7 @@ function PrepareVersion() {
267
305
  var versionsFolders = null, frameworkPath = null;
268
306
  try {
269
307
  frameworkPath = _(self.ginaPath +'/framework', true);
270
- console.info('frameworkPath: ', frameworkPath);
308
+ console.debug('frameworkPath: ', frameworkPath);
271
309
  if ( !new _(frameworkPath).existsSync() ) {
272
310
  return done();
273
311
  }
@@ -297,107 +335,114 @@ function PrepareVersion() {
297
335
  }
298
336
 
299
337
 
300
- // self.pushChangesToGit = function(done) {
338
+ self.pushChangesToGitIfNeeded = function(done) {
301
339
 
302
- // var cmd = null;
303
- // var version = self.selectedVersion.replace(/^[a-z]+/ig, '');
340
+ var cmd = null;
341
+ var version = self.selectedVersion.replace(/^[a-z]+/ig, '');
304
342
 
305
- // // getting current branch
306
- // // git rev-parse --abbrev-ref HEAD
307
- // // => 010
308
- // var currentBranch = null;
309
- // try {
310
- // currentBranch = execSync("git rev-parse --abbrev-ref HEAD")
311
- // .toString()
312
- // .replace(/(\n|\r|\t)/g, '');
313
- // } catch (err) {
314
- // // nothing to do
315
- // return done( new Error('[GIT] No branch selected') )
316
- // }
343
+ // getting current branch
344
+ // git rev-parse --abbrev-ref HEAD
345
+ // => 010
346
+ var currentBranch = null;
347
+ try {
348
+ currentBranch = execSync("git rev-parse --abbrev-ref HEAD")
349
+ .toString()
350
+ .replace(/(\n|\r|\t)/g, '');
351
+ } catch (err) {
352
+ // nothing to do
353
+ return done( new Error('[GIT] No branch selected') )
354
+ }
317
355
 
318
356
 
319
- // // create new branch if needed
320
- // // e.g: 0.1.0-alpha.1 -> 010-alpha1
321
- // var targetedBranch = version.replace(/\./g, '');
322
- // self.targetedBranch = targetedBranch;
357
+ // create new branch if needed
358
+ // e.g: 0.1.0-alpha.1 -> 010-alpha1
359
+ var targetedBranch = version.replace(/\./g, '');
360
+ self.targetedBranch = targetedBranch;
323
361
 
324
- // console.debug('[GIT] Current branch: '+ currentBranch);
325
- // console.debug('[GIT] Targeted branch: '+ targetedBranch);
362
+ console.debug('[GIT] Current branch: '+ currentBranch);
363
+ console.debug('[GIT] Targeted branch: '+ targetedBranch);
326
364
 
327
365
 
328
- // // check if targeted branch exists
329
- // // git rev-parse --verify 011
330
- // var branchExists = null;
331
- // try {
332
- // branchExists = execSync("git rev-parse --verify "+ targetedBranch)
333
- // .toString()
334
- // .replace(/(\n|\r|\t)/g, '');
335
- // } catch (err) {
336
- // // nothing to do
337
- // }
366
+ // check if targeted branch exists
367
+ // git rev-parse --verify 011
368
+ var branchExists = null;
369
+ try {
370
+ branchExists = execSync("git rev-parse --verify "+ targetedBranch)
371
+ .toString()
372
+ .replace(/(\n|\r|\t)/g, '');
373
+ } catch (err) {
374
+ // nothing to do
375
+ }
338
376
 
339
- // if (!branchExists) {
340
- // console.debug('No existing branch found, creating a new one !');
341
- // try {
342
- // execSync("git checkout -b "+ targetedBranch);
343
- // // pushing to new branch
344
- // console.debug('setting up remote branch `'+ targetedBranch +'` to git ...');
345
- // execSync("git push --set-upstream origin "+ targetedBranch);
346
- // } catch (err) {
347
- // console.error(err.stack||err.message||err);
348
- // return done(err);
349
- // }
350
- // }
351
- // // use existing to push updates
352
- // else {
353
-
354
- // if (currentBranch != targetedBranch) {
355
- // console.debug('Switching from branch `'+ currentBranch +'` to branch `'+ targetedBranch +'`');
356
- // // git checkout 010
357
- // try {
358
- // cmd = execSync("git checkout "+ targetedBranch);
359
- // } catch (err) {
360
- // console.error(err.stack||err.message||err);
361
- // return done(err);
362
- // }
363
- // } else {
364
- // console.debug('Reusing branch `'+ targetedBranch +'`');
365
- // }
366
- // }
367
377
 
378
+ if (!branchExists) {
379
+ console.debug('No existing branch found, creating a new one !');
380
+ try {
381
+ execSync("git checkout -b "+ targetedBranch);
382
+ if (self.isGitPushNeeded) {
383
+ // pushing to new branch
384
+ console.debug('setting up remote branch `'+ targetedBranch +'` to git ...');
385
+ execSync("git push --set-upstream origin "+ targetedBranch);
386
+ }
387
+ } catch (err) {
388
+ console.error(err.stack||err.message||err);
389
+ return done(err);
390
+ }
391
+ }
392
+ // use existing to push updates
393
+ else {
394
+
395
+ if (currentBranch != targetedBranch) {
396
+ console.debug('Switching from branch `'+ currentBranch +'` to branch `'+ targetedBranch +'`');
397
+ // git checkout 010
398
+ try {
399
+ cmd = execSync("git checkout "+ targetedBranch);
400
+ } catch (err) {
401
+ console.error(err.stack||err.message||err);
402
+ return done(err);
403
+ }
404
+ } else {
405
+ console.debug('Reusing branch `'+ targetedBranch +'`');
406
+ }
407
+ }
368
408
 
369
- // // git add --all
370
- // try {
371
- // cmd = execSync("git add --all ");
372
- // } catch (err) {
373
- // //console.debug('`git add --all`failed ');
374
- // console.error(err.stack||err.message||err);
375
- // return done(err);
376
- // }
377
- // // git commit -m'Packaging version v'+ version
378
- // try {
379
- // var msg = (!branchExists) ? 'New version' : 'Prerelease update - '+ new Date().format("isoDateTime");
380
- // cmd = execSync("git commit -am'"+ msg +"'");
381
- // } catch (err) {
382
- // if (!/Your branch is up to date/i.test( err.output.toString() )) {
383
- // console.error(err.stack||err.message||err);
384
- // return done(err);
385
- // }
386
- // }
409
+ // commit changes
410
+ try {
411
+ cmd = execSync("git add --all ");
412
+ } catch (err) {
413
+ //console.debug('`git add --all`failed ');
414
+ console.error(err.stack||err.message||err);
415
+ return done(err);
416
+ }
417
+ // git commit -m'Packaging version v'+ version
418
+ try {
419
+ var msg = (!branchExists) ? 'New version' : 'Prerelease update'; //+ new Date().format("isoDateTime");
420
+ if (self.git.msg) {
421
+ msg += ' - '+ self.git.msg
422
+ }
423
+ cmd = execSync("git commit -am'"+ msg +"'");
424
+ } catch (err) {
425
+ if (!/Your branch is up to date|nothing to commit, working tree clean/i.test( err.output.toString() )) {
426
+ console.error(err.stack||err.message||err);
427
+ return done(err);
428
+ }
429
+ }
387
430
 
388
- // console.debug('Pushing changes made on branch `'+ targetedBranch +'` to git `origin/'+ targetedBranch +'`');
389
- // // git push origin 010
390
- // try {
391
- // cmd = execSync("git push origin "+ targetedBranch );
392
- // } catch (err) {
393
- // if (!/Everything up-to-date/i.test( err.output.toString() )) {
394
- // console.error(err.stack||err.message||err);
395
- // return done(err);
396
- // }
397
- // }
431
+ if (self.isGitPushNeeded) {
432
+ console.debug('Pushing changes made on branch `'+ targetedBranch +'` to git `origin/'+ targetedBranch +'`');
433
+ // git push origin 010
434
+ try {
435
+ cmd = execSync("git push origin "+ targetedBranch );
436
+ } catch (err) {
437
+ if (!/Everything up-to-date/i.test( err.output.toString() )) {
438
+ console.error(err.stack||err.message||err);
439
+ return done(err);
440
+ }
441
+ }
442
+ }
398
443
 
399
- // done()
400
- // }
444
+ done()
445
+ }
401
446
 
402
447
 
403
448
 
@@ -422,6 +467,84 @@ function PrepareVersion() {
422
467
  // }
423
468
 
424
469
 
470
+ var restoreSymlinks = function(done) {
471
+
472
+ if ( typeof(process.env.npm_config_dry_run) == 'undefined' || !process.env.npm_config_dry_run ) {
473
+ // ignoring for now, after publishing completion
474
+ return
475
+ }
476
+ var archivesPath = _(getUserHome() + '/.gina/archives/framework', true);
477
+ var frameworkPath = _(self.gina +'/framework', true);
478
+
479
+ if ( !new _(archivesPath).existsSync() ) {
480
+ return;
481
+ }
482
+ // get current framework version
483
+ var package = require(pack);
484
+ var currentVersion = 'v'+ package.version.replace(/^v/, '');
485
+
486
+ // cleanup first
487
+ var versionsFolders = fs.readdirSync(frameworkPath);
488
+ for (let i = 0, len = versionsFolders.length; i < len; i++) {
489
+ let dir = versionsFolders[i];
490
+ // skip junk
491
+ if ( /^\./i.test(dir) || /(\s+copy|\.old)$/i.test(dir) ) {
492
+ continue;
493
+ }
494
+
495
+ // intercept & remove existing symlinks or old versions dir
496
+ try {
497
+ if ( fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isSymbolicLink() ) {
498
+ console.debug('Removing Symlink: '+ _(frameworkPath +'/'+ dir, true) );
499
+ // new _(frameworkPath +'/'+ dir, true).rmSync();
500
+ fs.unlinkSync(_(frameworkPath +'/'+ dir, true));
501
+ continue;
502
+ }
503
+
504
+ if (
505
+ dir != currentVersion
506
+ && fs.lstatSync( _(frameworkPath +'/'+ dir, true) ).isDirectory()
507
+ ) {
508
+ console.debug('Removing old version: '+ _(frameworkPath +'/'+ dir, true));
509
+ new _(frameworkPath +'/'+ dir, true).rmSync()
510
+ }
511
+ } catch (e) {
512
+ continue;
513
+ }
514
+ }
515
+
516
+ // restoring symlinks from archives
517
+ versionsFolders = fs.readdirSync(archivesPath);
518
+ for (let i = 0, len = versionsFolders.length; i < len; i++) {
519
+ let dir = versionsFolders[i];
520
+ // skip junk
521
+ if ( /^\./i.test(dir) || /(\s+copy|\.old)$/i.test(dir) ) {
522
+ continue;
523
+ }
524
+
525
+ // skip selected - for dev team only
526
+ if ( new _(frameworkPath +'/'+ dir, true).existsSync() ) {
527
+ continue;
528
+ }
529
+
530
+ // creating symlinks
531
+ try {
532
+ console.debug( 'Creating symlink: '+ _(archivesPath +'/'+ dir, true) +' -> '+ _(frameworkPath +'/'+ dir, true));
533
+ new _(archivesPath +'/'+ dir, true).symlinkSync(_(frameworkPath +'/'+ dir, true) );
534
+ } catch (e) {
535
+ return done(e)
536
+ }
537
+ }
538
+ }
539
+
540
+ self.end = function(done) {
541
+
542
+ // restoreSymlinks(done);
543
+
544
+ done()
545
+ }
546
+
547
+
425
548
 
426
549
  init()
427
550
  }
package/utils/helper.js CHANGED
@@ -26,11 +26,36 @@ function MainHelper(opt) {
26
26
  var packObj = require(pack);
27
27
  var version = getEnvVar('GINA_VERSION') || packObj.version;
28
28
  var frameworkPath = ginaPath + '/framework/v' + version;
29
-
29
+ var pkg = null, cmd = null, prefix = null;
30
+ self.isGlobalInstall = getEnvVar('GINA_GLOBAL_MODE') || ( typeof(packObj.config) != 'undefined' && typeof(packObj.config.globalMode) != 'undefined' ) ? packObj.config.globalMode : true;
30
31
  try {
31
32
  lib = require(frameworkPath + '/lib');
32
33
  console = lib.logger;
33
34
  merge = lib.merge;
35
+
36
+ try {
37
+ pkg = packObj;
38
+ self.defaultPrefix = ( typeof(packObj.config) != 'undefined' && typeof(packObj.config.prefix) != 'undefined' ) ? packObj.config.prefix : execSync('npm config get prefix').toString().replace(/\n$/g, '');
39
+ self.defaultPrefix = self.defaultPrefix.replace(/^\~/, getUserHome());
40
+ prefix = getEnvVar('GINA_PREFIX') || self.defaultPrefix;
41
+ self.optionalPrefix = pkg.config.optionalPrefix.replace(/^\~/, getUserHome());
42
+ } catch(err) {
43
+ console.warn('MainHelper::Init() Execption: '+ err.stack);
44
+ console.debug('Trying alternative config');
45
+ try {
46
+ self.defaultPrefix = execSync('npm config get prefix').toString().replace(/\n$/g, '');
47
+ prefix = getEnvVar('GINA_PREFIX') || self.defaultPrefix;
48
+ cmd = 'npm list gina --long --json --prefix='+ prefix;
49
+ if (self.isGlobalInstall) {
50
+ cmd += ' -g';
51
+ }
52
+ pkg = execSync(cmd).toString().replace(/\n$/g, '');
53
+ self.optionalPrefix = JSON.parse(pkg).dependencies.gina.config.optionalPrefix.replace(/^\~/, getUserHome());
54
+ } catch (_err) {
55
+ throw new Error(_err.stack +'\n'+ err.stack)
56
+ }
57
+ }
58
+
34
59
  } catch (err) {
35
60
  // this can happen in certain conditions
36
61
  // like scripts running out of the framework context
@@ -295,7 +320,7 @@ function MainHelper(opt) {
295
320
  return logDir
296
321
  }
297
322
 
298
- var prefix = getEnvVar('GINA_PREFIX') || execSync('npm config get prefix').toString().replace(/\n/g, '');
323
+ var prefix = getEnvVar('GINA_PREFIX') || self.defaultPrefix || execSync('npm config get prefix').toString().replace(/\n$/g, '');
299
324
 
300
325
  if ( isWin32() ) {
301
326
  logDir = process.env.LOG ||
@@ -341,7 +366,7 @@ function MainHelper(opt) {
341
366
  logDirObj.mkdirSync();
342
367
  }
343
368
 
344
- if ( !/gina$/.test(logDir) ) {
369
+ if ( !/gina$/.test(logDir) && self.optionalPrefix != prefix ) {
345
370
  logDir += '/gina';
346
371
  logDirObj = new _(logDir);
347
372
  }
@@ -371,7 +396,7 @@ function MainHelper(opt) {
371
396
  return runDir
372
397
  }
373
398
 
374
- var prefix = getEnvVar('GINA_PREFIX') || execSync('npm config get prefix').toString().replace(/\n/g, '');
399
+ var prefix = getEnvVar('GINA_PREFIX') || self.defaultPrefix || execSync('npm config get prefix').toString().replace(/\n$/g, '');
375
400
 
376
401
  runDir = (isWin32()) ? getUserHome() + '\\.gina\\run' : prefix + '/var/lock';
377
402
 
@@ -414,10 +439,12 @@ function MainHelper(opt) {
414
439
  throw new Error('location error: `'+ runDir+'`\n'+ err.stack);
415
440
  }
416
441
 
417
- runDir += ( isWin32() ) ? '\\gina' : '/gina';
418
- runDirObj = new _( runDir, true );
419
- if ( !runDirObj.existsSync() ) {
420
- fs.mkdirSync(runDir)
442
+ if (self.optionalPrefix != prefix) {
443
+ runDir += ( isWin32() ) ? '\\gina' : '/gina';
444
+ runDirObj = new _( runDir, true );
445
+ if ( !runDirObj.existsSync() ) {
446
+ fs.mkdirSync(runDir)
447
+ }
421
448
  }
422
449
 
423
450
  return runDir;
@@ -434,7 +461,7 @@ function MainHelper(opt) {
434
461
  return dir
435
462
  }
436
463
 
437
- var prefix = getEnvVar('GINA_PREFIX') || execSync('npm config get prefix').toString().replace(/\n/g, '');
464
+ var prefix = getEnvVar('GINA_PREFIX') || self.defaultPrefix || execSync('npm config get prefix').toString().replace(/\n$/g, '');
438
465
 
439
466
  // support for node 0.10.x & 0.11.x
440
467
  var tmp = (os.tmpdir) ? os.tmpdir : function() {
@@ -1 +0,0 @@
1
- 0.1.1-alpha.94