Skip to content

Commit

Permalink
feat(core): use yarn workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Aug 24, 2018
1 parent 68b72a4 commit 36999cc
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 23 deletions.
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ bootstrap: ##@0 global lerna bootstrap
@./node_modules/.bin/lerna bootstrap

init: ##@0 global cleanup/install/bootstrap
@make clean-all
@$(MAKE) clean-all
@yarn install
@make bootstrap
@make packages-build
@make website-install
@make examples-install
@$(MAKE) bootstrap
@$(MAKE) packages-build
@$(MAKE) website-install
@$(MAKE) examples-install

fmt: ##@0 global format code using prettier (js, css, md)
@./node_modules/.bin/prettier --color --write \
Expand All @@ -71,13 +71,13 @@ fmt-check: ##@0 global check if files were all formatted using prettier
"README.md"

test-all: ##@0 global run all checks/tests (packages, website & examples)
@make fmt-check
@make packages-lint
@make packages-test
@$(MAKE) fmt-check
@$(MAKE) packages-lint
@$(MAKE) packages-test

deploy-all: ##@0 global deploy website & storybook
@make website-deploy
@make storybook-deploy
@$(MAKE) website-deploy
@$(MAKE) storybook-deploy

clean-all: ##@0 global uninstall node modules, remove transpiled code & lock files
@rm -rf node_modules
Expand Down Expand Up @@ -166,13 +166,13 @@ packages-screenshots: ##@1 packages generate screenshots for packages readme (we
@node scripts/capture.js

packages-publish: ##@1 packages publish all packages
@make packages-build
@$(MAKE) packages-build

@echo "${YELLOW}Publishing packages${RESET}"
@./node_modules/.bin/lerna publish ---exact

packages-publish-next: ##@1 packages publish all packages for @next npm tag
@make packages-build
@$(MAKE) packages-build

@echo "${YELLOW}Publishing packages${RESET}"
@./node_modules/.bin/lerna publish ---exact --npm-tag=next
Expand All @@ -185,7 +185,7 @@ package-dev-%: ##@1 packages setup package for development, link to website, run
@echo "${YELLOW}Preparing package ${WHITE}${*}${YELLOW} for development${RESET}"
@cd packages/nivo-${*} && yarn link
@cd website && yarn link @nivo/${*}
@make package-watch-${*}
@$(MAKE) package-watch-${*}

########################################################################################################################
#
Expand All @@ -206,7 +206,7 @@ website-build: ##@2 website build website
@cd website && yarn build

website-deploy: ##@2 website build & deploy website
@make website-build
@$(MAKE) website-build

@echo "${YELLOW}Deploying website${RESET}"
@./node_modules/.bin/gh-pages -d website/build -r [email protected]:plouc/nivo.git -b gh-pages
Expand All @@ -227,7 +227,7 @@ website-links-rm: ##@2 website unlink all linked packages
find node_modules node_modules/\@* -depth 1 -type l -print | awk -F/ '{print $$(NF)}' | while read MODULE; do \
yarn unlink "@nivo/$${MODULE}"; \
done
@make website-install
@$(MAKE) website-install

########################################################################################################################
#
Expand All @@ -243,7 +243,7 @@ storybook-build: ##@3 storybook build storybook
@./node_modules/.bin/build-storybook

storybook-deploy: ##@3 storybook build and deploy storybook
@make storybook-build
@$(MAKE) storybook-build

@echo "${YELLOW}Deploying storybook${RESET}"
@./node_modules/.bin/gh-pages -d storybook-static -r [email protected]:plouc/nivo.git -b gh-pages -e storybook
Expand All @@ -255,7 +255,7 @@ storybook-deploy: ##@3 storybook build and deploy storybook
########################################################################################################################

examples-install: ##@4 examples install all examples dependencies
@make example-install-retro
@$(MAKE) example-install-retro

example-install-%: ##@4 examples install example dependencies, eg. example-install-retro
@echo "${YELLOW}Installing ${WHITE}${*}${YELLOW} example dependencies${RESET}"
Expand All @@ -266,7 +266,7 @@ example-start-%: ##@4 examples start example in dev mode, eg. example-start-retr
@cd examples/${*} && yarn start

examples-build: ##@4 examples build all examples
@make example-build-retro
@$(MAKE) example-build-retro

example-build-%: ##@4 examples build an example, eg. example-build-retro
@echo "${YELLOW}Building ${WHITE}${*}${YELLOW} example${RESET}"
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"packages/*"
],
"version": "0.43.0",
"npmClient": "yarn"
"npmClient": "yarn",
"useWorkspaces": true
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nivo",
"version": "0.31.0",
"private": true,
"licenses": [
{
"type": "MIT",
Expand Down Expand Up @@ -54,5 +55,8 @@
"fmt": "prettier --print-width=100 --tab-width=4 --bracket-spacing --no-semi --trailing-comma es5 --single-quote --color --write \"{src,specs,test,.storybook,stories}/**/*.js\"",
"fmt:check": "prettier --print-width=100 --tab-width=4 --bracket-spacing --no-semi --trailing-comma es5 --single-quote --list-different \"{src,specs,test,.storybook,stories}/**/*.js\"",
"changelog": "rm CHANGELOG.md && node scripts/generate-changelog.js"
}
},
"workspaces": [
"packages/*"
]
}
137 changes: 134 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,10 @@ chalk@^2.3.2:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"

change-emitter@^0.1.2:
version "0.1.6"
resolved "https://registry.yarnpkg.com/change-emitter/-/change-emitter-0.1.6.tgz#e8b2fe3d7f1ab7d69a32199aff91ea6931409515"

chardet@^0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
Expand Down Expand Up @@ -2881,7 +2885,77 @@ cyclist@~0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"

d3-time-format@^2.0.5:
d3-array@1, d3-array@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.1.tgz#d1ca33de2f6ac31efadb8e050a021d7e2396d5dc"

d3-chord@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/d3-chord/-/d3-chord-1.0.4.tgz#7dec4f0ba886f713fe111c45f763414f6f74ca2c"
dependencies:
d3-array "1"
d3-path "1"

d3-collection@1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.4.tgz#342dfd12837c90974f33f1cc0a785aea570dcdc2"

d3-color@1, d3-color@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.2.0.tgz#d1ea19db5859c86854586276ec892cf93148459a"

d3-format@1, d3-format@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.3.0.tgz#a3ac44269a2011cdb87c7b5693040c18cddfff11"

d3-hierarchy@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/d3-hierarchy/-/d3-hierarchy-1.1.6.tgz#842c1372090f870b7ea013ebae5c0c8d9f56229c"

d3-interpolate@1, d3-interpolate@^1.1.5:
version "1.2.0"
resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.2.0.tgz#40d81bd8e959ff021c5ea7545bc79b8d22331c41"
dependencies:
d3-color "1"

d3-path@1:
version "1.0.5"
resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-1.0.5.tgz#241eb1849bd9e9e8021c0d0a799f8a0e8e441764"

d3-sankey@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/d3-sankey/-/d3-sankey-0.7.1.tgz#d229832268fc69a7fec84803e96c2256a614c521"
dependencies:
d3-array "1"
d3-collection "1"
d3-shape "^1.2.0"

d3-scale-chromatic@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/d3-scale-chromatic/-/d3-scale-chromatic-1.3.0.tgz#7ee38ffcaa7ad55cfed83a6a668aac5570c653c4"
dependencies:
d3-color "1"
d3-interpolate "1"

d3-scale@^1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-1.0.7.tgz#fa90324b3ea8a776422bd0472afab0b252a0945d"
dependencies:
d3-array "^1.2.0"
d3-collection "1"
d3-color "1"
d3-format "1"
d3-interpolate "1"
d3-time "1"
d3-time-format "2"

d3-shape@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-1.2.0.tgz#45d01538f064bafd05ea3d6d2cb748fd8c41f777"
dependencies:
d3-path "1"

d3-time-format@2, d3-time-format@^2.0.5:
version "2.1.1"
resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-2.1.1.tgz#85b7cdfbc9ffca187f14d3c456ffda268081bb31"
dependencies:
Expand All @@ -2891,6 +2965,10 @@ d3-time@1, d3-time@^1.0.7:
version "1.0.8"
resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-1.0.8.tgz#dbd2d6007bf416fe67a76d17947b784bffea1e84"

d3-voronoi@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/d3-voronoi/-/d3-voronoi-1.1.2.tgz#1687667e8f13a2d158c80c1480c5a29cb0d8973c"

d@1:
version "1.0.0"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f"
Expand Down Expand Up @@ -3778,6 +3856,18 @@ fb-watchman@^2.0.0:
dependencies:
bser "^2.0.0"

fbjs@^0.8.1:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.18"

fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.4, fbjs@^0.8.9:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
Expand Down Expand Up @@ -4044,6 +4134,10 @@ get-caller-file@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5"

get-node-dimensions@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/get-node-dimensions/-/get-node-dimensions-1.2.1.tgz#fb7b4bb57060fb4247dd51c9d690dfbec56b0823"

get-pkg-repo@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d"
Expand Down Expand Up @@ -4409,6 +4503,10 @@ [email protected], hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"

hoist-non-react-statics@^2.3.1:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"

home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
Expand Down Expand Up @@ -7127,7 +7225,7 @@ radium@^0.19.0:
inline-style-prefixer "^2.0.5"
prop-types "^15.5.8"

raf@^3.4.0:
raf@^3.1.0, raf@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575"
dependencies:
Expand Down Expand Up @@ -7306,6 +7404,14 @@ react-lifecycles-compat@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"

react-measure@^2.0.2:
version "2.1.0"
resolved "https://registry.yarnpkg.com/react-measure/-/react-measure-2.1.0.tgz#e9a4645066d6fed54cf0ce44aa7a28da6dd7a9f7"
dependencies:
get-node-dimensions "^1.2.0"
prop-types "^15.5.10"
resize-observer-polyfill "^1.4.2"

react-modal@^3.3.2:
version "3.4.4"
resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.4.4.tgz#e9dde25e9e85a59c76831f2a2b468712a546aded"
Expand All @@ -7315,6 +7421,14 @@ react-modal@^3.3.2:
react-lifecycles-compat "^3.0.0"
warning "^3.0.0"

react-motion@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/react-motion/-/react-motion-0.5.2.tgz#0dd3a69e411316567927917c6626551ba0607316"
dependencies:
performance-now "^0.2.0"
prop-types "^15.5.8"
raf "^3.1.0"

react-onclickoutside@^6.5.0:
version "6.7.0"
resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.7.0.tgz#997a4d533114c9a0a104913638aa26afc084f75c"
Expand Down Expand Up @@ -7501,6 +7615,15 @@ rechoir@^0.6.2:
dependencies:
resolve "^1.1.6"

recompose@^0.26.0:
version "0.26.0"
resolved "https://registry.yarnpkg.com/recompose/-/recompose-0.26.0.tgz#9babff039cb72ba5bd17366d55d7232fbdfb2d30"
dependencies:
change-emitter "^0.1.2"
fbjs "^0.8.1"
hoist-non-react-statics "^2.3.1"
symbol-observable "^1.0.4"

[email protected]:
version "2.2.1"
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.1.tgz#90ef231d0778c5ce093c9a48d74e5c5422d13a99"
Expand Down Expand Up @@ -7740,6 +7863,10 @@ requires-port@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"

resize-observer-polyfill@^1.4.2:
version "1.5.0"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69"

resolve-cwd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
Expand Down Expand Up @@ -8452,7 +8579,7 @@ svgo@^0.7.0:
sax "~1.2.1"
whet.extend "~0.9.9"

symbol-observable@^1.0.3:
symbol-observable@^1.0.3, symbol-observable@^1.0.4:
version "1.2.0"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"

Expand Down Expand Up @@ -8709,6 +8836,10 @@ typescript@^2.9.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.1.tgz#fdb19d2c67a15d11995fd15640e373e09ab09961"

ua-parser-js@^0.7.18:
version "0.7.18"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"

ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
Expand Down

0 comments on commit 36999cc

Please sign in to comment.