Skip to content

Commit

Permalink
feat(split): init multi packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored and Raphaël Benitte committed Dec 5, 2017
1 parent 06b0ae0 commit 158a349
Show file tree
Hide file tree
Showing 540 changed files with 40,301 additions and 6,967 deletions.
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
.idea
*.log*
node_modules
/lib
/es
/coverage
/storybook-static
/storybook-static

package-lock.json
yarn.lock

build

/packages/*/lib
/packages/*/es

*.lerna_backup

14 changes: 12 additions & 2 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

import { configure } from '@storybook/react'
import { setDefaults } from '@storybook/addon-info'
import './style.css'

setDefaults({
header: false,
inline: true,
propTables: false,
maxPropObjectKeys: 10000,
maxPropArrayLength: 10000,
maxPropStringLength: 10000
})

const req = require.context('../stories', true, /\.stories\.js$/)
const req = require.context('../packages', true, /\.stories\.js$/)

function loadStories() {
req.keys().forEach(filename => req(filename))
Expand Down
File renamed without changes.
69 changes: 69 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
SOURCES = packages

.PHONY: help bootstrap build-all clean-all test

########################################################################################################################
#
# HELP
#
########################################################################################################################

# COLORS
RED = $(shell printf "\33[31m")
GREEN = $(shell printf "\33[32m")
WHITE = $(shell printf "\33[37m")
YELLOW = $(shell printf "\33[33m")
RESET = $(shell printf "\33[0m")

# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
# A category can be added with @category
HELP_HELPER = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-\%]+)\s*:.*\#\#(?:@([a-zA-Z\-\%]+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; \
for (sort keys %help) { \
print "${WHITE}$$_:${RESET}\n"; \
for (@{$$help{$$_}}) { \
$$sep = " " x (32 - length $$_->[0]); \
print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
}; \
print "\n"; }

help: ##prints help
@perl -e '$(HELP_HELPER)' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help

init: ##@init cleanup/install/bootstrap
make clean-all
yarn install
./node_modules/.bin/lerna bootstrap
make build-all

build-all: ##@build build all packages
$(foreach source, $(SOURCES), $(call clean-source-lib, $(source)))
./node_modules/.bin/lerna run --ignore nivo-demo --ignore nivo-example-retro build

########################################################################################################################
#
# CLEANUP
#
########################################################################################################################

clean-all: ##@cleanup
rm -rf node_modules
rm -rf package-lock.json
$(foreach source, $(SOURCES), $(call clean-source-all, $(source)))

define clean-source-lib
rm -rf $(1)/*/es
rm -rf $(1)/*/lib
endef

define clean-source-all
rm -rf $(1)/*/es
rm -rf $(1)/*/lib
rm -rf $(1)/*/node_modules
rm -rf $(1)/*/package-lock.json
endef
11 changes: 11 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# nivo-website

Sources for [nivo](https://github.com/plouc/nivo) [website](https://plouc.github.io/nivo/).

## Repositories

- [nivo](https://github.com/plouc/nivo) - the nivo library
- [nivo-api](https://github.com/plouc/nivo-api) - the nivo http api
- [nivo-api-docker](https://github.com/plouc/nivo-api-docker) - a Docker image for the nivo http api
- [nivo-generators](https://github.com/plouc/nivo-generators) - the data generators used for nivo-website and http API samples
- [nivo-website](https://github.com/plouc/nivo-website) - the source for the nivo website
59 changes: 59 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "nivo-demo",
"version": "0.32.0-0",
"private": true,
"description": "nivo demo",
"author": "Raphaël Benitte <[email protected]>",
"devDependencies": {
"gh-pages": "^1.0.0",
"prettier": "^1.7.4",
"react-scripts": "1.0.14",
"source-map-explorer": "^1.5.0"
},
"dependencies": {
"@nivo/bar": "0.32.0-0",
"@nivo/calendar": "0.32.0-0",
"@nivo/chord": "0.32.0-0",
"@nivo/circle-packing": "0.32.0-0",
"@nivo/core": "0.32.0-0",
"@nivo/heatmap": "0.32.0-0",
"@nivo/line": "0.32.0-0",
"@nivo/pie": "0.32.0-0",
"@nivo/radar": "0.32.0-0",
"@nivo/sankey": "0.32.0-0",
"@nivo/stream": "0.32.0-0",
"@nivo/sunburst": "0.32.0-0",
"@nivo/treemap": "0.32.0-0",
"@nivo/voronoi": "0.32.0-0",
"classnames": "2.2.4",
"d3-scale": "^1.0.6",
"d3-scale-chromatic": "^1.1.1",
"d3-time": "^1.0.7",
"d3-time-format": "^2.0.5",
"dedent-js": "^1.0.1",
"lodash": "^4.17.4",
"nivo-generators": "0.9.3",
"prop-types": "^15.5.10",
"react": "16.0.0",
"react-colors-picker": "2.3.1",
"react-dom": "^16.0.0",
"react-helmet": "5.1.3",
"react-icons": "^2.2.5",
"react-motion": "^0.5.0",
"react-responsive": "1.3.4",
"react-router-dom": "^4.2.2",
"react-select": "1.0.0-rc.10",
"react-syntax-highlighter": "^5.7.0",
"styled-components": "^2.1.1",
"url-search-params": "^0.10.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"analyze": "source-map-explorer build/static/js/main.*",
"fmt": "prettier --print-width=100 --tab-width=4 --bracket-spacing --no-semi --trailing-comma es5 --single-quote --write 'src/**/*.js' 'src/**/*.css'",
"fmt:check": "prettier --print-width=100 --tab-width=4 --bracket-spacing --no-semi --trailing-comma es5 --single-quote --list-different 'src/**/*.js' 'src/**/*.css'",
"demo:publish": "npm run build && gh-pages -d build -r [email protected]:plouc/nivo.git -b gh-pages",
"sprites": "glue --img src/assets --css src/styles src/assets/icons"
}
}
1 change: 1 addition & 0 deletions demo/public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nivo.rocks
Binary file added demo/public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions demo/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, shrink-to-fit=no">
<meta name="theme-color" content="#e25d47">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<title>nivo | demo</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>
15 changes: 15 additions & 0 deletions demo/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "nivo",
"name": "nivo dataviz components",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#e25d47"
}
Loading

0 comments on commit 158a349

Please sign in to comment.