Skip to content

A starter kit for building a standard navigation-style electron app with Aurelia, typescript and materialize.

License

Notifications You must be signed in to change notification settings

pyarmak/aurelia-electron-starter

Repository files navigation

aurelia-skeleton-navigation

ZenHub Join the chat at https://gitter.im/aurelia/discuss

This is a TypeScript implementation of navigation skeleton of the Aurelia platform. It sets up a standard navigation-style app using gulp to compile your TypeScript code with gulp-typescript plugin. Karma/Jasmine testing is also configured. Additional features include electron support and using materialize instead of bootstrap.

This repository does not require Visual Studio to run.

To keep up to date on Aurelia, please visit and subscribe to the official blog. If you have questions, we invite you to join us on Gitter. If you would like to have deeper insight into our development process, please install the ZenHub Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting the framework board.

Notes regarding conversion of original skeleton application from ES6 to TypeScript

  1. Structure of folders was changed in order to let TypeScript compiler, System.js and Karma runner to reference all files correctly.
  2. All dependencies to Babel were removed, instead gulp-typescript plugin is used.
  3. Original skeleton navigation extends Protractor / WebDriver, so we have added appropriate d.ts file to cover this extended functionality (dts/aurelia-protractor.d.ts).
  4. gulp tdd task was updated to enable watching and recompiling of both main and test sources and re-running karma when a change occurs. Note: you will need to use gulp tdd command instead of karma start if you want your TypeScript files to be watched.
  5. gulp e2e command was also updated to include TypeScript compilation step (of only e2e test sources).

Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. Special thanks to Mike Graham for his Aurelia typings.

Running The App

To run the app, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:
npm install
  1. Ensure that Gulp is installed. If you need to install it, use the following command:
npm install -g gulp
  1. Ensure that jspm is installed. If you need to install it, use the following command:
npm install -g jspm

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.

  1. Ensure jspm-bower-endpoint is configured
npm install -g jspm-bower-endpoint
jspm registry create bower jspm-bower-endpoint
  1. Install the client-side dependencies with jspm:
jspm install -y

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.

  1. To run the app, execute the following command:
gulp watch
  1. Browse to 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.

  2. To run electron execute:

gulp electron
  1. To create an electron distribution execute:
gulp electron:release

Note: configuration options for paths is found under build/paths.js and electron configuration is found under build/config.js

Note: At present there is a bug in the HTMLImports polyfill which only occurs on IE. We have submitted a pull request to the team with the fix. In the mean time, if you want to test on IE, you can work around the issue by explicitly adding a script tag before you load system.js. The script tag should look something like this (be sure to confirm the version number):

<script src="jspm_packages/github/webcomponents/webcomponentsjs@0.5.2/HTMLImports.js"></script>

Running The Unit Tests

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:

  1. Install Aurelia libs for test visibility:
jspm install aurelia-framework
jspm install aurelia-http-client
jspm install aurelia-router
  1. You can now run the tests once with this command. This command does TypeScript sources compilation (both main and test) and executes tests. The test commands are set up with Gulp in mind, so it is not required to have global installation of Karma:
gulp test

Or if you want to do it TDD style use the following command. This command watches both main and test sources for change and when it detects one it automatically recompiles sources and runs tests again.

gulp tdd

Running The E2E Tests

Integration tests are performed with Protractor.

  1. Place your E2E-Tests into the folder src/test/e2e
  2. Install the necessary webdriver
gulp webdriver_update
  1. 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.

  2. Make sure your app runs and is accessible

gulp watch
  1. In another console run the E2E-Tests
gulp e2e

About

A starter kit for building a standard navigation-style electron app with Aurelia, typescript and materialize.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published