-
Notifications
You must be signed in to change notification settings - Fork 47
#FAQ
##installation
###Dependencies
All the dependencies are installed locally, not to mess with your global version, so the npm install
can take a moment. If you feel like the node_modules
folder is too fat, you can extract the modules usually installed globally (like karma
, protractor
, phantomjs
...). Just update the deps (and the npm tasks) in the package.json
.
##gulp
Something about the gulp tasks and the gulp workflow vs npm tasks running directly some scripts (anything that doesn't need gulp ...)
###Why use gulp over other task runners ?
I've used a lot Grunt, this was an opportunity to learn gulp. I started the gulp tasks from scratch to understand all the workflow, but I only used gulp when it was necessary (for protractor
or karma
, for example, I use the specific cli launched with an npm task).
###flags
Some gulp tasks I developed can take flags to override default properties like :
-
gulp serve
- see README -
gulp build
- see README
The --env
flag accepts dev
, dist
and test
.
- It's by default set to
dev
- If an environment variable
ENV
exists, this one will be taken in account - If you pass an
--env
flag, it will be reflected inprocess.env.ENV
Note: If you have an environment variable ENV
, your gulp task will always be executed in that mode. To overload that, pass the flag --env
.
###port
As explained in the README, with the flag --port
, you can override the port for gulp serve
.
The default port number is configured in the config
section of the package.json
file. You can change it without breaking anything (even e2e tests will use it and point to the port you specified - no hardcoded port number).
##Setup
###Travis CI setup
Your build is failing on Travis CI ? If you have the following error :
GitHub rate limit reached. To increase the limit use GitHub authentication.
Run jspm endpoint config github to set this up.
I made a step by step gist to help you resolve this : Travis setup of Github token for jspm
###Travis CI setup SauceLabs
You'll find most of the infos you're looking for in this post.
If you're looking for the way I implemented SauceLabs on this project, check this commit: #7898239
Note: The e2e tests won't pass on node v12 ... I won't investigate anymore since jspm users are most likely to be at least on node v4.
##jspm
###What is jspm ?
jspm is many things :
- The SystemJS module loader (built on top of ES6 Module Loader Polyfill - which implements dynamic module loading, following the ES6 spec)
- The SystemJS Build Tool
- The jspm CLI The package manager which couples the whole together
- Many other things such as the registry, the plugins ...
All you'll need to do is install the cli : npm install -g jspm
You'll learn to install depencencies like this : jspm install jquery
For more infos, see the jspm getting started.
If you have other jspm related question, you might find your answers under the jspm section of the Reminder page
##karma
###Why can't I see my console.logs on the terminal output ?
console.*()
statements are polluting the report in the terminal, so I removed them from karma when you launch it with npm test
.
You can have them launching npm run test-unit
This is done by modifying karma's configuration on the fly, the client.captureConsole
attribute - see #8171d9f for implementation.
##protractor
###Why choose protractor for e2e testing since it's angular specific ?
As I explain in the long term roadmap, my endgoal is to make an angular/es6/jspm stack, so I decided to use protractor since it works very well with angular for e2e testing.
This is the only "angular-specific" tool you'll find in that project.
But since protractor is basically a wrapper around WebDriverJs, you can also use it to test non-angular sites, simply by disabling the browser.ignoreSynchronization
flag in the config.
You can manage this flag by specifying in the config
part of the package.json
file whether you're using angular or not (for the moment it's false
by default) - example;
"config": {
"isAngular": false
}
Note: I added utilities in case you want to test a site in both angular and non-angular.
##Continuous Integration
###Why don't e2e tests run on pull requests ?
As you can see on the .travis.yml file, some encrypted tokens are specified at the top. Some of those are the credentials for SauceLabs, the platform that runs the end to end tests from Travis (read this blog post about Travis & SauceLabs).
For security reasons, the secure tokens aren't exported as environment variables when the pull-requests comes from external forks.
I had two solutions:
Do like Angular, Ember or other frameworks: they leave the username/accesskey in clear, so that e2e tests could be run even on pull-requests - but your credentials stays out in the open (even if you can disable then at any time).
Or disable end to end tests on pull requests.
I decided to disable them, because this project is a boilerplate, not a framework. It's suppose to give you good basis to start with (keeping your API keys private is one of this good practice). Maybe if I get tons of pull-requests, I'll change that, but for the moment ...
##Miscellaneous
###Project name
In versions before v0.5.0, the project was named angular-es6-jspm
, I decided to rename it to vanilla-es6-jspm
and split my project to make an angular/es6/jspm boilerplate in two projects : the one in vanillaJS, the one for angular, so that it could be easier to share/contribute/evolve each versions for me as well as for potentials contributors.