From 2bd039462691bbb40d4a17788393b3ffbc5761b6 Mon Sep 17 00:00:00 2001 From: jeremierobert-coveo <43446516+jeremierobert-coveo@users.noreply.github.com> Date: Mon, 5 Aug 2019 09:20:33 -0400 Subject: [PATCH] ES6 dual package requirements (#21) * Fix missing svg issue lint * Put back before deploy Script path * Readable empty message * No npmignore * Fix linux issue with path --- .travis.yml | 2 +- package.json | 9 ++++++-- scripts/before.deploy.js | 8 +++---- scripts/setup.js | 25 +++++++++++---------- src/components/UserActions/UserActions.scss | 5 +++++ 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index a174559a..317e64c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/package.json b/package.json index 4869d1ef..b5034310 100644 --- a/package.json +++ b/package.json @@ -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" @@ -30,7 +30,12 @@ "lint-fix" ], "files": [ - "bin/**/*" + "bin/commonjs/**/*", + "bin/es6/**/*", + "bin/css/**/*", + "bin/img/**/*", + "bin/typings/**/*", + "src/**/*.scss" ], "keywords": [ "coveo", diff --git a/scripts/before.deploy.js b/scripts/before.deploy.js index 01a25bbc..02ac9f19 100644 --- a/scripts/before.deploy.js +++ b/scripts/before.deploy.js @@ -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' })); diff --git a/scripts/setup.js b/scripts/setup.js index 97525a33..b02f7a85 100644 --- a/scripts/setup.js +++ b/scripts/setup.js @@ -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; + }) +); diff --git a/src/components/UserActions/UserActions.scss b/src/components/UserActions/UserActions.scss index e123548b..fa5b4217 100644 --- a/src/components/UserActions/UserActions.scss +++ b/src/components/UserActions/UserActions.scss @@ -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;