From 64414e0b14614c710cd4608b673d9e1cd9450598 Mon Sep 17 00:00:00 2001 From: Vincent Voyer Date: Fri, 20 Jan 2017 13:18:08 +0100 Subject: [PATCH] fix(publish): publish react-instantsearch/dist instead of root (#1884) Before this commit, we broke the publishing process --- .../package.json | 2 +- .../scripts/build-and-publish.sh | 4 ++++ packages/react-instantsearch/package.json | 2 +- .../scripts/build-and-publish.sh | 6 ++++++ packages/react-instantsearch/scripts/build.sh | 18 ++++++++---------- scripts/release.sh | 4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) create mode 100755 packages/react-instantsearch-theme-algolia/scripts/build-and-publish.sh create mode 100755 packages/react-instantsearch/scripts/build-and-publish.sh diff --git a/packages/react-instantsearch-theme-algolia/package.json b/packages/react-instantsearch-theme-algolia/package.json index 96bf4ef529..7bf5149b6e 100644 --- a/packages/react-instantsearch-theme-algolia/package.json +++ b/packages/react-instantsearch-theme-algolia/package.json @@ -10,7 +10,7 @@ "license": "MIT", "scripts": { "build": "babel-node scripts/build.js", - "prepublish": "yarn build" + "build-and-publish": "./scripts/build-and-publish.sh" }, "devDependencies": { "autoprefixer": "^6.6.1", diff --git a/packages/react-instantsearch-theme-algolia/scripts/build-and-publish.sh b/packages/react-instantsearch-theme-algolia/scripts/build-and-publish.sh new file mode 100755 index 0000000000..2ed7c29252 --- /dev/null +++ b/packages/react-instantsearch-theme-algolia/scripts/build-and-publish.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +yarn build && +npm publish diff --git a/packages/react-instantsearch/package.json b/packages/react-instantsearch/package.json index 73fe7a386f..ea0fb6c824 100644 --- a/packages/react-instantsearch/package.json +++ b/packages/react-instantsearch/package.json @@ -8,7 +8,7 @@ "version": "2.2.3", "scripts": { "build": "./scripts/build.sh", - "prepublish": "yarn build && rm -rf dist/" + "build-and-publish": "./scripts/build-and-publish.sh" }, "homepage": "https://community.algolia.com/instantsearch.js/react/", "repository": { diff --git a/packages/react-instantsearch/scripts/build-and-publish.sh b/packages/react-instantsearch/scripts/build-and-publish.sh new file mode 100755 index 0000000000..5b1331e09b --- /dev/null +++ b/packages/react-instantsearch/scripts/build-and-publish.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +yarn build && +cd dist/ && +npm publish && +rm -rf dist/ diff --git a/packages/react-instantsearch/scripts/build.sh b/packages/react-instantsearch/scripts/build.sh index cd6efd5c8b..0e2bf98753 100755 --- a/packages/react-instantsearch/scripts/build.sh +++ b/packages/react-instantsearch/scripts/build.sh @@ -1,13 +1,11 @@ #!/usr/bin/env bash -set -e # exit when error - -mkdir -p dist/ -rm -rf dist/* -cp package.json dist/ -cp README.md dist/ -babel -q index.js -o dist/index.js -babel -q dom.js -o dist/dom.js -babel -q connectors.js -o dist/connectors.js -babel -q native.js -o dist/native.js +mkdir -p dist/ && +rm -rf dist/* && +cp package.json dist/ && +cp README.md dist/ && +babel -q index.js -o dist/index.js && +babel -q dom.js -o dist/dom.js && +babel -q connectors.js -o dist/connectors.js && +babel -q native.js -o dist/native.js && babel -q --ignore test.js,__mocks__ --out-dir dist/src src diff --git a/scripts/release.sh b/scripts/release.sh index c9b7514310..1d844cdbe8 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -85,12 +85,12 @@ git push origin --tags ( cd packages/react-instantsearch -npm publish # This cannot be moved to yarn yet +npm run build-and-publish ) ( cd packages/react-instantsearch-theme-algolia -npm publish # This cannot be moved to yarn yet +npm run build-and-publish ) printf "Release: