Skip to content

Commit

Permalink
Updated dependencies and added coveralls.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegron committed Mar 15, 2019
1 parent 31897c8 commit cfaf8a3
Show file tree
Hide file tree
Showing 11 changed files with 13,777 additions and 12,336 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: node_js
node_js:
- "lts/*"
- 'lts/*'

addons:
chrome: stable
chrome: stable

script:
- npm run testCoverage
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# search-ui-extensions

![Travis Status](https://img.shields.io/travis/coveo/search-ui-extensions.svg)
![Coveralls status](https://img.shields.io/coveralls/github/coveo/search-ui-extensions.svg)

This repository contains additionnal components meant to be used in conjunction with [Coveo Javascript Search Framework](https://github.com/coveo/search-ui) to provide additionnal functionnalities.

## Setup
Expand All @@ -13,21 +16,22 @@ Requires Node JS >= 8.0.

The code is written in [typescript](http://www.typescriptlang.org/) and compiled using [webpack](https://webpack.github.io/).

* Under the `pages` folder, you have a working search page (index.html). At build time, it is copied to the `bin` folder.
* It references 2 style sheets (the base one from the Coveo Javascript Search Framework, and the one from the extension).
* It references 3 javascript file (the extension one built in this project, and the basic templates and library scripts).
- Under the `pages` folder, you have a working search page (index.html). At build time, it is copied to the `bin` folder.

- It references 2 style sheets (the base one from the Coveo Javascript Search Framework, and the one from the extension).
- It references 3 javascript file (the extension one built in this project, and the basic templates and library scripts).

* Under the `src` folder, you have all the typescript source code for the custom components, with `src/Index.ts` being the starting point of the application.
- Under the `src` folder, you have all the typescript source code for the custom components, with `src/Index.ts` being the starting point of the application.

* Under the `sass` folder, you have all the css for the extension.
- Under the `sass` folder, you have all the css for the extension.

* Under the `tests` folder, you have all the tests for the custom components.
- Under the `tests` folder, you have all the tests for the custom components.

## Build tasks

* `npm run setup ` will copy the needed ressources (`index.html`, `templates`, etc.) in the `bin` folder.
* `npm run css` will build the sass files into a css file in the `bin` folder.
* `npm run build` will run the `setup`, `css` task, then compile the typescript code.
- `npm run setup` will copy the needed ressources (`index.html`, `templates`, etc.) in the `bin` folder.
- `npm run css` will build the sass files into a css file in the `bin` folder.
- `npm run build` will run the `setup`, `css` task, then compile the typescript code.

## Dev

Expand All @@ -37,5 +41,5 @@ Then, anytime you hit save in a typescript file, the server will reload your app

## Tests

* `npm run test` will execute the tests one time and give you the report
* `npm run watchTest` will watch changes and reexecute the tests and coverage when saving a file.
- `npm run test` will execute the tests one time and give you the report
- `npm run watchTest` will watch changes and reexecute the tests and coverage when saving a file.
12 changes: 8 additions & 4 deletions css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
let sass = require('node-sass');
let fs = require('fs');

let basePath = './bin/css/';
let result = sass.renderSync({
file: './src/sass/Index.scss',
outFile: './bin/css/CoveoJsSearchExtensions.css'
})
file: './src/sass/Index.scss',
outFile: `${basePath}CoveoJsSearchExtensions.css`
});

fs.writeFileSync('./bin/css/CoveoJsSearchExtensions.css', result.css);
if (!fs.existsSync(basePath)) {
fs.mkdirSync(basePath, { recursive: true });
}
fs.writeFileSync(`${basePath}CoveoJsSearchExtensions.css`, result.css);
18 changes: 8 additions & 10 deletions dev.server.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
'use strict';
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const argv = require('yargs').argv
const argv = require('yargs').argv;

const port = argv.port || 8080;

let webpackConfig = require('./webpack.config.js');
webpackConfig.entry['webpack_hm_client'] = `webpack-dev-server/client?http://localhost:${port}/`;
webpackConfig.entry[
'webpack_hm_client'
] = `webpack-dev-server/client?http://localhost:${port}/`;
const compiler = webpack(webpackConfig);

var server = new WebpackDevServer(compiler, {
contentBase: [
'bin/',
'node_modules/coveo-search-ui/bin/'
],
publicPath: '/js/',
compress: true
});
server.listen(port, 'localhost', function () {
contentBase: ['bin/', 'node_modules/coveo-search-ui/bin/'],
publicPath: '/js/',
compress: true
});
server.listen(port, 'localhost', function() {});
20 changes: 8 additions & 12 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ var configuration = {
files: [
// Both CoveoJsSearch and CoveoJsSearchTests are included as externals, so you need include them in your testing environment.
{
pattern: 'node_modules/coveo-search-ui/bin/js/CoveoJsSearch.js',
pattern: 'node_modules/coveo-search-ui/bin/js/CoveoJsSearch.js',
watched: false
},
{
pattern: 'node_modules/coveo-search-ui-tests/bin/js/CoveoJsSearchTests.js',
pattern:
'node_modules/coveo-search-ui-tests/bin/js/CoveoJsSearchTests.js',
watched: false
},
{ pattern: 'src/Index.ts' },
Expand All @@ -18,24 +19,19 @@ var configuration = {
preprocessors: {
// Builds both the components and the tests.
'src/**/*.ts': ['webpack'],
'src/tests/**/*.spec.ts': ['webpack'],
'src/tests/**/*.spec.ts': ['webpack']
},
// Required for Chrome, if you use it.
mime: { 'text/x-typescript': ['ts'] },
// Creates coverage files.
reporters: ['coverage-istanbul', 'spec'],
coverageIstanbulReporter: {
dir: './bin/coverage',
reports: [
'cobertura',
'json',
'lcov',
'text-summary'
],
reports: ['cobertura', 'json', 'lcov', 'text-summary'],
fixWebpackSourcePaths: true
},
webpack: webpackConfig,
browsers:['ChromeHeadlessNoSandbox'],
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
Expand All @@ -45,5 +41,5 @@ var configuration = {
};

module.exports = function(config) {
config.set(configuration);
};
config.set(configuration);
};
Loading

0 comments on commit cfaf8a3

Please sign in to comment.