PageRenderTime 42ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/README.md

https://gitlab.com/alpox/anaplot
Markdown | 185 lines | 133 code | 52 blank | 0 comment | 0 complexity | e670303b24a56d3489dcfd87574f271d MD5 | raw file
  1. # aurelia-skeleton-navigation
  2. ## Running The App
  3. To run the app, follow these steps.
  4. 1. Ensure that [NodeJS](http://nodejs.org/) is installed. This provides the platform on which the build tooling runs.
  5. 2. From the project folder, execute the following command:
  6. ```shell
  7. npm install
  8. ```
  9. 3. Ensure that [Gulp](http://gulpjs.com/) is installed globally. If you need to install it, use the following command:
  10. ```shell
  11. npm install -g gulp
  12. ```
  13. > **Note:** Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
  14. 4. Ensure that [jspm](http://jspm.io/) is installed globally. If you need to install it, use the following command:
  15. ```shell
  16. npm install -g jspm
  17. ```
  18. > **Note:** jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
  19. > **Note:** jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing `jspm registry config github` and following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHub `Settings > Personal Access Tokens`), `public_repo` access for the token is required.
  20. 5. Install the client-side dependencies with jspm:
  21. ```shell
  22. jspm install -y
  23. ```
  24. >**Note:** Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing `npm install -g unzip` and then re-running `jspm install`.
  25. 6. To run the app, execute the following command:
  26. ```shell
  27. gulp watch
  28. ```
  29. 7. Browse to [http://localhost:9000](http://localhost:9000) to see the app. You can make changes in the code found under `src` and the browser should auto-refresh itself as you save files.
  30. > The Skeleton App uses [BrowserSync](http://www.browsersync.io/) for automated page refreshes on code/markup changes concurrently across multiple browsers. If you prefer to disable the mirroring feature set the [ghostMode option](http://www.browsersync.io/docs/options/#option-ghostMode) to false
  31. ## Running The App under Electron
  32. #### Note:
  33. The first five steps below are identical to the first five steps for running this app the "standard' way, using the jspm / systemjs tooling. The difference is in the command to run the app, where the standard `gulp watch` command is replaced by the sequence of two commands:
  34. ```shell
  35. gulp build
  36. electron index.js
  37. ```
  38. To run the app under [Electron](http://electron.atom.io), follow these steps.
  39. 1. Install [Electron](http://electron.atom.io)
  40. ```shell
  41. npm install electron-prebuilt -g
  42. ```
  43. 2. From the project folder, execute the following command:
  44. ```shell
  45. npm install
  46. ```
  47. 3. Ensure that [Gulp](http://gulpjs.com/) is installed globally. If you need to install it, use the following command:
  48. ```shell
  49. npm install -g gulp
  50. ```
  51. > **Note:** Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
  52. 4. Ensure that [jspm](http://jspm.io/) is installed globally. If you need to install it, use the following command:
  53. ```shell
  54. npm install -g jspm
  55. ```
  56. > **Note:** jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
  57. > **Note:** jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing `jspm registry config github` and following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHub `Settings > Personal Access Tokens`), `public_repo` access for the token is required.
  58. 5. Install the client-side dependencies with jspm:
  59. ```shell
  60. jspm install -y
  61. ```
  62. >**Note:** Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing `npm install -g unzip` and then re-running `jspm install`.
  63. 6. To build the app execute the following command (this will give you a dist directory)
  64. ```shell
  65. gulp build
  66. ```
  67. 7. To start the app, execute the following command:
  68. ```shell
  69. electron index.js
  70. ```
  71. >**Note:** If typing the command `electron index.js` is too much for you change this line in package.json from `"main": "dist/main.js",` to `"main": "index.js",`
  72. > Then, you can invoke electron by just typing
  73. ```shell
  74. electron .
  75. ```
  76. ## Bundling
  77. Bundling is performed by [Aurelia Bundler](http://github.com/aurelia/bundler). A gulp task is already configured for that. Use the following command to bundle the app:
  78. ```shell
  79. gulp bundle
  80. ```
  81. You can also unbundle using the command bellow:
  82. ```shell
  83. gulp unbundle
  84. ```
  85. To start the bundled app, execute the following command:
  86. ```shell
  87. gulp serve-bundle
  88. ```
  89. #### Configuration
  90. The configuration is done by ```bundles.js``` file.
  91. ##### Optional
  92. Under ```options``` of ```dist/aurelia``` add ```rev: true``` to add bundle file revision/version.
  93. ## Running The Unit Tests
  94. To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:
  95. 1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command:
  96. ```shell
  97. npm install -g karma-cli
  98. ```
  99. 2. Install Aurelia libs for test visibility:
  100. ```shell
  101. jspm install aurelia-framework
  102. jspm install aurelia-http-client
  103. jspm install aurelia-router
  104. ```
  105. 3. You can now run the tests with this command:
  106. ```shell
  107. karma start
  108. ```
  109. ## Running The E2E Tests
  110. Integration tests are performed with [Protractor](http://angular.github.io/protractor/#/).
  111. 1. Place your E2E-Tests into the folder ```test/e2e/src```
  112. 2. Install the necessary webdriver
  113. ```shell
  114. gulp webdriver-update
  115. ```
  116. 3. Configure the path to the webdriver by opening the file ```protractor.conf.js``` and adjusting the ```seleniumServerJar``` property. Typically its only needed to adjust the version number.
  117. 4. Make sure your app runs and is accessible
  118. ```shell
  119. gulp watch
  120. ```
  121. 5. In another console run the E2E-Tests
  122. ```shell
  123. gulp e2e
  124. ```
  125. ## Exporting bundled production version
  126. A gulp task is already configured for that. Use the following command to export the app:
  127. ```shell
  128. gulp export
  129. ```
  130. The app will be exported into ```export``` directory preserving the directory structure.
  131. #### Configuration
  132. The configuration is done by ```bundles.js``` file.
  133. In addition, ```export.js``` file is available for including individual files.