This is a purely Front End project ( only static files ).
The only dependencies you need is NodeJS and Gulp installed.
npm install -g gulp
npm installinside the directory. (You only have to do this once)
Inside the directory run:
There are several options when using gulp, to list them, run:
You can point the API requests at client-test enviroment by using the following flag:
By default the project runs pointing at your local API:
You can point the front end to use any API url you like by using the following:
gulp --api http://amatravel.localhost
Which will point all API requests at the specified url.
By default the project runs using the feature settings specified in
If you would like to override one of the feature toggles at runtime, you can enable features by doing:
gulp --features sponsoredListings,feature2,feature3
gulp -f sponsoredListings,feature2,feature3
!~! WARNING !~! Features must be comma seperated, and no spaces between them.
Gulp can automatically generate JS/HTML doc files from the source code. This is useful for when you want to read through some source code in a annotated and user friendly way.
We currently use docker.js for this, you can learn more here: docker.js docs
To generate and view the docs, run:
This will generate docs for any .js or .html file in the
app/ directory. After docs are generated it will automatically open a tab with the generated docs. Any subsequent changes to .js or .html files will auto regenerate the associated doc file and refresh the browser, showing the updated doc.
The project runs with NodeJS proxying all API requests to the desired api url.
You can disable the proxy and point the front end directly at the api url by running:
To build the project, which puts all built files into
dist/ run the following:
console.login the code
By default NPM downloads
styleguide as normal npm packages.
If you would like to work on something in common or styleguide and see the results instantly inside of search-ui you need to locally link the NPM projects.
To do so, download both common and styleguide repo's locally. In each directory run:
This will give you an output similar to:
/usr/local/lib/node_modules/styleguide -> /Users/qrpike/tst/styleguide
We only need the 2nd part. Go into the search-ui directory and run the following:
npm link /Users/qrpike/tst/styleguide
Now NPM symlinks the npm package to your local copy so all changes are instantly seen inside of search-ui project. You need to do this for both