Skip to content

Commit 97e4350

Browse files
committed
Prepare package for NPM publishing
1 parent dd5e5d2 commit 97e4350

File tree

11 files changed

+52
-1032
lines changed

11 files changed

+52
-1032
lines changed

.npmignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Development
22
src
3-
demo
43
.babelrc
54
.eslintrc
5+
node_modules
66

77
# Webpack
88
webpack.config.js
@@ -11,5 +11,5 @@ webpack.config.dev.js
1111
webpack.config.prod.js
1212

1313
# Testing
14-
index.html
14+
spec
1515
coverage

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ npm install react-line-graph
3737

3838
Usage is quite simple. First, import the component (React 16.8.0 or higher is required as an installed dependency or CDN):
3939
```sh
40-
import { LineGraph } from 'react-line-graph'
40+
import LineGraph from 'react-line-graph'
4141
```
4242

4343
Render the line:
@@ -141,13 +141,12 @@ Distributed under the MIT license. See ``LICENSE`` for more information.
141141
- Fix smoothing algorithm to be more precise using cubic Beziers
142142
- Clean up prop passing in InteractionLayer*
143143
- Refactor hover to not use setState (better performance)
144-
- Update compression algorithm to be two-way (compress highs and lows)
144+
- Update compression algorithm to be two-way (compress highs and lows)*
145145
- Allow 3 different data input types (create helper function 'parse')
146146
- Remove unnecessary re-render of graph upon setState in parent component
147147
- Refactor LineGraph's index.jsx with React Hooks*
148-
- Publish on NPM, update README tags
148+
- Publish on NPM, update README tags*
149149
- Allow multiple transformation functions in drawPath function, using piping
150-
- Add X-Y padding option
151150
- Prevent re-run of findCtrlPoint function upon hover
152151
153152
## Challenges

dist/main.js

Lines changed: 0 additions & 447 deletions
This file was deleted.

lib/Component.js

Lines changed: 0 additions & 520 deletions
This file was deleted.

lib/index.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

lib/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "react-line-graph",
3-
"version": "1.0.0",
3+
"version": "1.0.3",
44
"description": "A simple and lightweight line graph",
5-
"main": "dist/main.js",
5+
"main": "lib/index.js",
66
"scripts": {
77
"test": "jest --coverage --verbose --watch",
88
"start": "webpack-dev-server --open --env=dev",
9-
"build": "webpack -d --watch --env=prod"
9+
"build": "webpack --watch --env=prod"
1010
},
1111
"repository": {
1212
"type": "git",
13-
"url": "git+https://github.com/umairnadeem/react-npm.git"
13+
"url": "git+https://github.com/umairnadeem/react-line-graph.git"
1414
},
1515
"keywords": [
1616
"npm",
@@ -20,25 +20,18 @@
2020
"author": "Umair Nadeem",
2121
"license": "MIT",
2222
"bugs": {
23-
"url": "https://github.com/umairnadeem/react-npm/issues"
23+
"url": "https://github.com/umairnadeem/react-line-graph/issues"
2424
},
25-
"homepage": "https://github.com/umairnadeem/react-npm#readme",
25+
"homepage": "https://github.com/umairnadeem/react-line-graph#readme",
2626
"dependencies": {
2727
"react": "^16.9.0",
28-
"react-dom": "^16.9.0",
2928
"prop-types": "^15.7.2"
3029
},
3130
"peerDependencies": {
3231
"react": ">=16.8.0",
33-
"react-dom": ">=16.8.0",
3432
"prop-types": ">=15.7.2"
3533
},
3634
"devDependencies": {
37-
"@babel/core": "^7.5.5",
38-
"@babel/preset-env": "^7.5.5",
39-
"@babel/preset-react": "^7.0.0",
40-
"babel-eslint": "^10.0.2",
41-
"babel-loader": "^8.0.6",
4235
"enzyme": "^3.10.0",
4336
"enzyme-adapter-react-16": "^1.14.0",
4437
"eslint": "^6.2.0",
@@ -51,7 +44,12 @@
5144
"path": "^0.12.7",
5245
"webpack": "^4.39.2",
5346
"webpack-cli": "^3.3.7",
54-
"webpack-dev-server": "^3.8.0"
47+
"webpack-dev-server": "^3.8.0",
48+
"@babel/core": "^7.5.5",
49+
"@babel/preset-env": "^7.5.5",
50+
"@babel/preset-react": "^7.0.0",
51+
"babel-eslint": "^10.0.2",
52+
"babel-loader": "^8.0.6"
5553
},
5654
"jest": {
5755
"collectCoverageFrom": [

src/index.jsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import App from './components/App';
1+
// import React from 'react';
2+
// import ReactDOM from 'react-dom';
3+
// import App from './components/App';
44

5-
ReactDOM.render(<App />, document.getElementById('main'));
5+
// ReactDOM.render(<App />, document.getElementById('main'));
6+
7+
import LineGraph from './components/LineGraph';
8+
9+
export default LineGraph;
10+
11+
// import React, { useState } from "react";
12+
13+
// const ReactColorSquare = props => {
14+
// const { width, height, color, text } = props;
15+
// const [state, setState] = useState(0);
16+
// return (
17+
// <div
18+
// style={{
19+
// width: width || 100,
20+
// height: height || 100,
21+
// backgroundColor: color || "blue"
22+
// }}
23+
// >
24+
// hey bruh
25+
// {text}
26+
// </div>
27+
// );
28+
// };
29+
30+
// export default ReactColorSquare;

webpack.config.base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
entry: path.resolve('src'),
55
output: {
66
path: path.resolve('lib'),
7-
filename: 'Component.js',
7+
filename: 'index.js',
88
},
99
module: {
1010
rules: [

0 commit comments

Comments
 (0)