Skip to content

Commit

Permalink
build: refactored build process
Browse files Browse the repository at this point in the history
fixes #106, #80, #82
  • Loading branch information
Federico Zivolo committed Mar 23, 2018
1 parent 1bd24d8 commit 645ccaf
Show file tree
Hide file tree
Showing 24 changed files with 1,546 additions and 3,294 deletions.
11 changes: 2 additions & 9 deletions .babelrc
@@ -1,11 +1,4 @@
{
"presets": [
["env"],
"react"
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"transform-export-extensions"
]
"presets": ["env", "stage-2", "react"],
"plugins": ["transform-class-properties"]
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -21,3 +21,4 @@ yarn-error.log
.project
.tmp
.vscode
*.log
2 changes: 1 addition & 1 deletion example/animated.jsx → demo/animated.jsx
Expand Up @@ -3,7 +3,7 @@ import { findDOMNode } from 'react-dom'
import Transition from 'react-transition-group/Transition'
import PropTypes from 'prop-types'
import outy from 'outy'
import { Manager, Target, Popper } from '../src/react-popper'
import { Manager, Target, Popper } from '../src/index'

const duration = 300

Expand Down
File renamed without changes.
File renamed without changes
7 changes: 5 additions & 2 deletions example/index.html → demo/index.html
@@ -1,12 +1,15 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Component</title>
<link href="https://fonts.googleapis.com/css?family=Bungee|Lato:400,900" rel="stylesheet">
</head>

<body>
<div id="app"></div>
<script src="bundle.js"></script>
<script src="./index.js"></script>
</body>
</html>

</html>
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion example/modifiers.jsx → demo/modifiers.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { Portal } from 'react-portal'
import { Manager, Target, Popper, Arrow } from '../src/react-popper'
import { Manager, Target, Popper, Arrow } from '../src/index'
import { modifiers } from './common'

class MultipleExample extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion example/multiple.jsx → demo/multiple.jsx
@@ -1,7 +1,7 @@
import React from 'react'
import PopperJS from 'popper.js'
import { Portal } from 'react-portal'
import { Manager, Target, Popper, Arrow } from '../src/react-popper'
import { Manager, Target, Popper, Arrow } from '../src/index'

const modifiers = {
customStyle: {
Expand Down
2 changes: 1 addition & 1 deletion example/standalone.jsx → demo/standalone.jsx
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'
import { Popper, Arrow } from '../src/react-popper'
import { Popper, Arrow } from '../src/index'

class StandaloneExample extends PureComponent {
state = {
Expand Down
2 changes: 1 addition & 1 deletion example/standaloneObject.jsx → demo/standaloneObject.jsx
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'
import { Popper, Arrow } from '../src/react-popper'
import { Popper, Arrow } from '../src/index'

class StandaloneObjectExample extends PureComponent {
state = {
Expand Down
2 changes: 1 addition & 1 deletion example/toggleable.jsx → demo/toggleable.jsx
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'
import { Manager, Target, Popper, Arrow } from '../src/react-popper'
import { Manager, Target, Popper, Arrow } from '../src/index'

class ToggleableExample extends PureComponent {
state = {
Expand Down
85 changes: 41 additions & 44 deletions package.json
@@ -1,18 +1,30 @@
{
"name": "react-popper",
"version": "0.8.3",
"version": "0.9.0",
"description": "React wrapper around PopperJS.",
"license": "MIT",
"author": "Travis Arnold <travis@souporserious.com> (http://souporserious.com)",
"homepage": "https://github.com/souporserious/react-popper",
"main": "dist/react-popper.js",
"umd:main": "dist/react-popper.umd.js",
"module": "lib/react-popper.js",
"types": "react-popper.d.ts",
"files": [
"dist",
"lib",
"react-popper.d.ts"
"lib"
],
"license": "MIT",
"author": "Travis Arnold <travis@souporserious.com> (http://souporserious.com)",
"homepage": "https://github.com/souporserious/react-popper",
"scripts": {
"build": "npm run build:clean && npm run build:es && npm run build:umd && npm run build:cjs",
"build:clean": "rm -rf dist/ && rm -rf lib/",
"build:es": "babel src --out-dir lib && mv lib/index.js lib/react-popper.js",
"build:umd": "rollup -c --output.format umd --output.name 'react-popper' --output.file dist/react-popper.umd.js",
"build:cjs": "rollup -c --output.format cjs --output.name 'react-popper' --output.file dist/react-popper.js",
"demo": "parcel --out-dir demo/dist demo/index.html",
"prepare": "npm run build",
"precommit": "lint-staged",
"format": "npm run lint -- --fix --quiet",
"lint": "eslint --ext .js,.jsx src/ example/"
},
"repository": {
"type": "git",
"url": "https://github.com/souporserious/react-popper"
Expand All @@ -35,17 +47,6 @@
"git add"
]
},
"scripts": {
"precommit": "lint-staged",
"format": "npm run lint -- --fix --quiet",
"lint": "eslint --ext .js,.jsx src/ example/",
"build:lib": "babel src --out-dir lib",
"build": "npm run build:lib && cross-env NODE_ENV=production webpack --config webpack.prod.config.js",
"dev": "webpack-dev-server --hot --progress --host 0.0.0.0",
"postbuild": "cross-env NODE_ENV=production && cross-env TARGET=minify webpack --config webpack.prod.config.js",
"prebuild": "rimraf dist && mkdir dist",
"prepare": "npm run build"
},
"peerDependencies": {
"react": "0.14.x || ^15.0.0 || ^16.0.0",
"react-dom": "0.14.x || ^15.0.0 || ^16.0.0"
Expand All @@ -57,36 +58,32 @@
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.16.0",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"eslint": "^4.19.0",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^11.0.0",
"eslint-config-standard-react": "^6.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"husky": "^0.14.3",
"lint-staged": "^7.0.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"chokidar": "^1.6.1",
"create-styled-element": "^0.4.0",
"glamor": "^2.20.24",
"glamorous": "^3.11.1",
"node-libs-browser": "^1.0.0",
"outy": "^0.1.2",
"prettier": "^1.11.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-portal": "^4.1.3",
"parcel-bundler": "^1.6.2",
"react": "15.3.2",
"react-dom": "15.3.2",
"react-measure": "^1.4.6",
"react-motion-ui-pack": "^0.10.2",
"react-portal": "^4.1.4",
"react-transition-group": "^2.2.1",
"rimraf": "^2.6.2",
"style-loader": "^0.20.3",
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.2"
"react-travel": "^1.3.0",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-node-globals": "^1.2.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"velocity-react": "^1.2.2"
}
}
15 changes: 15 additions & 0 deletions rollup.config.js
@@ -0,0 +1,15 @@
import babel from 'rollup-plugin-babel';

export default {
entry: 'src/index.js',
plugins: [
babel({
babelrc: false,
presets: [['env', { modules: false }], 'stage-2', 'react'],
plugins: [
'external-helpers',
['transform-react-remove-prop-types', { mode: 'wrap' }],
],
}),
],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/index.js
@@ -0,0 +1,4 @@
export { default as Manager } from './Manager';
export { default as Target } from './Target';
export { default as Popper } from './Popper';
export { default as Arrow } from './Arrow';
4 changes: 0 additions & 4 deletions src/react-popper.js

This file was deleted.

19 changes: 0 additions & 19 deletions webpack.banner.js

This file was deleted.

29 changes: 0 additions & 29 deletions webpack.config.js

This file was deleted.

0 comments on commit 645ccaf

Please sign in to comment.