Skip to content

Commit

Permalink
fix(storybook): force hoist react for hooks compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Oct 9, 2019
1 parent cbfbecc commit 6f84234
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 579 deletions.
8 changes: 2 additions & 6 deletions js/Makefile
Expand Up @@ -8,8 +8,6 @@ author = Berty Technologies <oss@berty.tech>
contributor = $(shell git config --get user.name) <$(shell git config --get user.email)>
license = (Apache-2.0 or MIT)

export SHELL = /usr/bin/env bash

global_bin := /usr/local/bin
ifeq ($(UNAME_S),Linux)
global_bin := /usr/bin
Expand Down Expand Up @@ -47,7 +45,7 @@ env:
.PHONY: deps
deps: $(mod) $(pkg_mod)

$(mod): $(PWD)/package.json
$(mod): $(PWD)/package.json $(pkg_desc)
$(lerna) $(lerna_flags) init
$(lerna) $(lerna_flags) bootstrap
touch $(mod)
Expand All @@ -60,12 +58,10 @@ $(lerna): $(yarn)
$(yarn) global add lerna

.NOTPARALLEL: $(pkg_mod) $(pkg_mod)/%
$(pkg_mod)/%: $(patsubst %,%/package.json,$(pkg))
$(pkg_mod)/%: $(patsubst %,%/package.json,$(pkg)) $(mod)
mkdir -p $(pkg_mod)
touch $(pkg_mod) $@

$(pkg_desc): $(mod)

.PHONY: yarn
yarn $(yarn):
ifeq ($(UNAME_S),Darwin)
Expand Down
6 changes: 0 additions & 6 deletions js/lerna.json
Expand Up @@ -4,11 +4,5 @@
"packages": [
"packages/*"
],
"nohoist": [
"**/react-native",
"**/react-native/**",
"**/react-native-*",
"**/react-native-*/**"
],
"version": "0.0.0"
}
6 changes: 2 additions & 4 deletions js/packages/berty-app/package.json
Expand Up @@ -12,11 +12,9 @@
"@berty-tech/react-native-example": "^1.0.0",
"clisim": "^2.4.0",
"react": "^16.9.0",
"react-native": "^0.60.5",
"react-native": "0.61.0",
"react-native-config": "^0.11.7",
"react-native-reanimated": "^1.3.0",
"react-native-swiper": "^1.5.14",
"react-native-ui-kitten": "^4.1.1"
"react-native-reanimated": "^1.3.0"
},
"devDependencies": {
"@babel/core": "^7.6.2",
Expand Down
9 changes: 6 additions & 3 deletions js/packages/berty-storybook/package.json
Expand Up @@ -22,13 +22,16 @@
"url": "https://github.com/n0izn0iz/berty/issues"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react": "^16.9.0",
"react-native": "0.61.0",
"react-native-reanimated": "^1.3.0"
},
"optionalDependencies": {
"@storybook/addon-links": "^5.2.1"
},
"dependencies": {
"@berty-tech/shared-storybook": "^0.0.0",
"@eva-design/eva": "^1.0.1",
"@storybook/addon-links": "^5.2.1",
"react-native-easy-grid": "^0.2.2",
"react-native-elements": "^1.2.3",
"react-native-swiper": "^1.6.0-rc.1",
Expand Down
3 changes: 2 additions & 1 deletion js/packages/react-native-core/package.json
Expand Up @@ -23,6 +23,7 @@
"readmeFilename": "README.md",
"peerDependencies": {
"react": "^16.8.1",
"react-native": ">=0.59.0-rc.0 <1.0.x"
"react-native": "0.61.0"
}
}

7 changes: 2 additions & 5 deletions js/packages/react-native-example/package.json
Expand Up @@ -19,11 +19,8 @@
"readmeFilename": "README.md",
"title": "React Native Example",
"peerDependencies": {
"react": "^16.8.1",
"react-native": ">=0.59.0-rc.0 <1.0.x"
},
"devDependencies": {
"react": "^16.9.0",
"react-native": "^0.61.1"
"react-native": "0.61.0"
}
}

4 changes: 2 additions & 2 deletions js/packages/shared-storybook/package.json
Expand Up @@ -22,8 +22,8 @@
"url": "https://github.com/berty/berty/issues"
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react": "^16.9.0",
"react-native": "0.61.0"
},
"dependencies": {
"react-native-easy-grid": "^0.2.2",
Expand Down
2 changes: 1 addition & 1 deletion js/packages/storybook-mobile/Makefile
Expand Up @@ -7,7 +7,7 @@ export SHELL ?= env bash
deps.storybook.mobile\

deps.storybook.mobile: export PWD := $(PWD)
deps.storybook.mobile: $(PWD)/node_modules $(PWD)/storybook/storyLoader
deps.storybook.mobile: $(PWD)/node_modules $(PWD)/storybook/storyLoader.js
cd $(PWD) && lsof -t -i :7007 || echo Y | start-storybook --config-dir storybook &
kill $$(lsof -t -i :8081) || true
cd $(PWD) && PWD=$(PWD) react-native start --reset-cache &
Expand Down

0 comments on commit 6f84234

Please sign in to comment.