Skip to content

Commit

Permalink
fix(publish): publish react-instantsearch/dist instead of root (#1884)
Browse files Browse the repository at this point in the history
Before this commit, we broke the publishing process
  • Loading branch information
vvo authored Jan 20, 2017
1 parent 3f9952c commit 64414e0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/react-instantsearch-theme-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

yarn build &&
npm publish
2 changes: 1 addition & 1 deletion packages/react-instantsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions packages/react-instantsearch/scripts/build-and-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

yarn build &&
cd dist/ &&
npm publish &&
rm -rf dist/
18 changes: 8 additions & 10 deletions packages/react-instantsearch/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 64414e0

Please sign in to comment.