|
1 | 1 | # Project setup |
2 | 2 |
|
3 | | -Documentation is coming soon. |
| 3 | +## Running angularity |
| 4 | + |
| 5 | +Ensure that angularity has been installed correctly and is accessible from the command line: |
| 6 | + |
| 7 | + which angularity |
| 8 | + #should output the path where it is located |
| 9 | + |
| 10 | +If you wish to run angularity directly from the project folder, |
| 11 | +instead of from the command line after a global `npm` installation, |
| 12 | +you can do this instead: |
| 13 | + |
| 14 | + cd angularity # where you have the project checked out |
| 15 | + node bin/cli.js |
| 16 | + |
| 17 | +### `.angularity` |
| 18 | + |
| 19 | +Upon your running angularity, |
| 20 | +you might encounter a warning that looks like this: |
| 21 | + |
| 22 | +```bash |
| 23 | +Error validating .angularity field(s): serverHttpPort consoleWidth |
| 24 | +``` |
| 25 | + |
| 26 | +This is caused by a stale configuration file, |
| 27 | +you can choose to either edit the file to fix the values, |
| 28 | +or simply delete it and run angularity again: |
| 29 | + |
| 30 | +```bash |
| 31 | +rm ${HOME}/.angularity |
| 32 | +angularity |
| 33 | +``` |
| 34 | + |
| 35 | +Upon which you should see the following output: |
| 36 | + |
| 37 | +```bash |
| 38 | +default settings are being written to a global configuration. |
| 39 | +To change your defaults edit your /home/YOUR_USER_NAME/.angularity file |
| 40 | +``` |
| 41 | + |
| 42 | +## First run |
| 43 | + |
| 44 | +You will be given some options to pick from when you run Angularity. |
| 45 | +On the very first run, it is advisable to choose |
| 46 | + |
| 47 | +- `Install WebStorm Tools`. |
| 48 | +- Next pick `External Tools`. |
| 49 | +- Next pick `continue` |
| 50 | + |
| 51 | +This makes makes the Webstorm IDE aware of |
| 52 | +a number of tasks exposed by Angularity. |
| 53 | +Be sure to completely quit Webstorm and open it again, |
| 54 | +if it is already running. |
| 55 | + |
| 56 | +## Scaffold a new project |
| 57 | + |
| 58 | +Angularity will generate a scaffold for a new project |
| 59 | +which can be opened in the Webstorm IDE. |
| 60 | +To do this, run Angularity from the command line, |
| 61 | +where you wish to create a project in a subdirectory |
| 62 | +of the current working directory. |
| 63 | + |
| 64 | +```bash |
| 65 | +cd ${CODE} |
| 66 | +angularity |
| 67 | +``` |
| 68 | + |
| 69 | +- Pick `Generate Project` |
| 70 | +- Next, pick `minimal-es6`, if you wish to develop using ES6 Javascript |
| 71 | +- Or, pick `minimal-es5`, if you wish to develop using ES5 Javascript |
| 72 | +- Next, type the name of your project |
| 73 | +- Next, choose the directory where the project will be created, |
| 74 | + or accept the suggested one |
| 75 | + |
| 76 | +Now wait for a while while dependencies are installed, |
| 77 | +and then Angularity should finish generating the project, |
| 78 | +and fire up the Webstorm IDE with this project opened. |
| 79 | + |
| 80 | +## Webstorm tools |
| 81 | + |
| 82 | +### Tools --> Angularity |
| 83 | + |
| 84 | +This menu exposes certain tasks via a menu that you could run on the command line. |
| 85 | +It is simply a matter of convenience. |
| 86 | + |
| 87 | +- build |
| 88 | +- build nominify |
| 89 | +- watch |
| 90 | +- watch nominify |
| 91 | +- release |
| 92 | +- test |
| 93 | + |
| 94 | +### Debugging |
| 95 | + |
| 96 | +There is no difference in debugging an Angularity app, |
| 97 | +from debugging other Javascript applications. |
| 98 | +The only thing that you should be aware of, |
| 99 | +is that minification doesn't lend itself well to debugging, |
| 100 | +especially for AngularJs apps. |
| 101 | +That is what Angularity provides the |
| 102 | +`build nominify` and `watch nominify` tasks for. |
| 103 | + |
| 104 | +Here is a quick run down for those who have not used Webstorm debuigging before. |
| 105 | + |
| 106 | +In the top right hand corner, there should be a green bug icon. |
| 107 | +Click this (or use the `Shift+F9` keyboard shortcut), |
| 108 | +to run the project in debug mode. |
| 109 | + |
| 110 | +If this is the first time, you will need to install Jetbrains IDE Support plugin |
| 111 | +in your browser. |
| 112 | +Here is the [Chrome or Chromium plugin](https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji) |
| 113 | + |
| 114 | +Once installed, the browser should open, and display the default app. |
| 115 | + |
0 commit comments