To run the app, follow these steps.
- Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
- From the project folder, execute the following command:
npm install- Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulpNote: Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
- Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspmNote: jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
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 githuband following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHubSettings > Personal Access Tokens),public_repoaccess for the token is required.
- Install the client-side dependencies with jspm:
jspm install -yNote: Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing
npm install -g unzipand then re-runningjspm install.
- To run the app, execute the following command:
gulp watch- Browse to http://localhost:9000 to see the app. You can make changes in the code found under
srcand the browser should auto-refresh itself as you save files.
The Skeleton App uses BrowserSync for automated page refreshes on code/markup changes concurrently across multiple browsers. If you prefer to disable the mirroring feature set the ghostMode option to false
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:
gulp build
electron index.jsTo run the app under Electron, follow these steps.
- Install Electron
npm install electron --save-dev- From the project folder, execute the following command:
npm install- Ensure that Gulp is installed globally. If you need to install it, use the following command:
npm install -g gulpNote: Gulp must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
- Ensure that jspm is installed globally. If you need to install it, use the following command:
npm install -g jspmNote: jspm must be installed globally, but a local version will also be installed to ensure a compatible version is used for the project.
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 githuband following the prompts. If you choose to authorize jspm by an access token instead of giving your password (see GitHubSettings > Personal Access Tokens),public_repoaccess for the token is required.
- Install the client-side dependencies with jspm:
jspm install -yNote: Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing
npm install -g unzipand then re-runningjspm install.
- To build the app execute the following command (this will give you a dist directory)
gulp build- To start the app, execute the following command:
electron index.jsNote: If typing the command
electron index.jsis too much for you change this line in package.json from"main": "dist/main.js",to"main": "index.js",Then, you can invoke electron by just typing
electron .Note: The electron-packager package relies on
"main"in package.json to know which JS file to use to start the application. To make this work with electron-packager change this line in package.json from"main": "dist/main.js",to"main": "index.js",
-
Follow steps 1-6 in the previous section (Running The App under Electron).
-
Install electron-packager
npm install electron-packager -g- Run the command:
electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> --version <electron version #> [optional flags...]Include the --asar option to create an asar archive from your app.
By default, electron-packager will place the packaged app in a folder under the source folder with the naming convention of <appname>-<platform>-<arch>.
See the electron-packager readme for more details on options.
Bundling is performed by Aurelia Bundler. A gulp task is already configured for that. Use the following command to bundle the app:
gulp bundleYou can also unbundle using the command bellow:
gulp unbundleTo start the bundled app, execute the following command:
gulp serve-bundleThe configuration is done by bundles.js file.
Under options of dist/aurelia add rev: true to add bundle file revision/version.
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:
- Ensure that the Karma CLI is installed. If you need to install it, use the following command:
npm install -g karma-cli- Install Aurelia libs for test visibility:
jspm install aurelia-framework
jspm install aurelia-http-client
jspm install aurelia-router- You can now run the tests with this command:
karma startIntegration tests are performed with Protractor.
- Place your E2E-Tests into the folder
test/e2e/src - Install the necessary webdriver
gulp webdriver-update-
Configure the path to the webdriver by opening the file
protractor.conf.jsand adjusting theseleniumServerJarproperty. Typically its only needed to adjust the version number. -
Make sure your app runs and is accessible
gulp watch- In another console run the E2E-Tests
gulp e2eA gulp task is already configured for that. Use the following command to export the app:
gulp exportThe app will be exported into export directory preserving the directory structure.
To start the exported app, execute the following command:
gulp serve-exportThe configuration is done by bundles.js file.
In addition, export.js file is available for including individual files.