Skip to content

Commit

Permalink
ES6 dual package requirements (#21)
Browse files Browse the repository at this point in the history
* Fix missing svg issue
lint

* Put back before deploy
Script path

* Readable empty message

* No npmignore

* Fix linux issue with path
  • Loading branch information
jeremierobert-coveo authored Aug 5, 2019
1 parent 3e90fc9 commit 2bd0394
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ script:
- npm run lint
- npm run build
- npm run testCoverage
before_deploy:
before_deploy:
- node ./scripts/before.deploy.js
deploy:
- provider: npm
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.5",
"description": "Small generic components to extend the functionality of Coveo's Search UI framework.",
"main": "./bin/commonjs/CoveoJsSearchExtensions.js",
"module": "./bin/es6/index.js",
"module": "./bin/es6/Index.js",
"types": "./bin/typings",
"sideEffects": [
"./bin/es6/components/UserActions/Strings.js"
Expand All @@ -30,7 +30,12 @@
"lint-fix"
],
"files": [
"bin/**/*"
"bin/commonjs/**/*",
"bin/es6/**/*",
"bin/css/**/*",
"bin/img/**/*",
"bin/typings/**/*",
"src/**/*.scss"
],
"keywords": [
"coveo",
Expand Down
8 changes: 4 additions & 4 deletions scripts/before.deploy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { readFileSync, writeFileSync } = require('fs');
const { resolve } = require('path');

const BRANCH = process.env.TRAVIS_BRANCH;
if (!BRANCH) {
throw new Error('TRAVIS_BRANCH is not define in the current environment');
const TAG = process.env.TRAVIS_TAG;
if (!TAG) {
throw new Error('TRAVIS_TAG is not defined in the current environment');
}

const VERSION = BRANCH.slice(BRANCH.indexOf('v') + 1, BRANCH.length);
const VERSION = TAG.slice(TAG.indexOf('v') + 1, TAG.length);
const PACKAGE_JSON_LOCATION = resolve('package.json');

const PACKAGE = JSON.parse(readFileSync(PACKAGE_JSON_LOCATION, { encoding: 'utf8' }));
Expand Down
25 changes: 13 additions & 12 deletions scripts/setup.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use strict';
const ncp = require('ncp').ncp;
const { ncp } = require('ncp');
const { resolve } = require('path');
const { mkdirSync, existsSync } = require('fs');

const folderToCopy = [
{
src: './pages',
dest: './bin'
},
{
src: './img',
dest: './bin/img'
}
];
const folderToCopy = [{ src: resolve('./pages'), dest: resolve('./bin/pages') }, { src: resolve('./img'), dest: resolve('./bin/img') }];

folderToCopy.forEach(folder => ncp(folder.src, folder.dest));
if (!existsSync(resolve('./bin'))) {
mkdirSync(resolve('./bin'), { recursive: true });
}

folderToCopy.forEach(folder =>
ncp(folder.src, folder.dest, err => {
if (err) throw err;
})
);
5 changes: 5 additions & 0 deletions src/components/UserActions/UserActions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ $search-ui-dropdown-header-color: #1d4f76;
margin: 0.5em 0;
}

.coveo-no-actions {
padding: 3em;
text-align: center;
}

.coveo-close {
display: inline-block;
width: 1em;
Expand Down

0 comments on commit 2bd0394

Please # to comment.