Skip to content

Commit 1bb92f7

Browse files
author
nzambello
committed
initial commit
0 parents  commit 1bb92f7

File tree

9 files changed

+2942
-0
lines changed

9 files changed

+2942
-0
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"env",
4+
"react"
5+
]
6+
}

.gitignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
### Node ###
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# node-waf configuration
25+
.lock-wscript
26+
27+
# Compiled binary addons (http://nodejs.org/api/addons.html)
28+
build/Release
29+
30+
# Dependency directories
31+
node_modules/
32+
jspm_packages/
33+
34+
# Typescript v1 declaration files
35+
typings/
36+
37+
# Optional npm cache directory
38+
.npm
39+
40+
# Optional eslint cache
41+
.eslintcache
42+
43+
# Optional REPL history
44+
.node_repl_history
45+
46+
# Output of 'npm pack'
47+
*.tgz
48+
49+
# Yarn Integrity file
50+
.yarn-integrity
51+
52+
# dotenv environment variables file
53+
.env
54+
55+
56+
### Vim ###
57+
# swap
58+
[._]*.s[a-v][a-z]
59+
[._]*.sw[a-p]
60+
[._]s[a-v][a-z]
61+
[._]sw[a-p]
62+
# session
63+
Session.vim
64+
# temporary
65+
.netrwhist
66+
*~
67+
# auto-generated tag files
68+
tags

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# react-csv-reader
2+
React component that handles csv file input.
3+
4+
## Installation
5+
Install the package with either yarn or npm.
6+
7+
With yarn:
8+
```sh
9+
$ yarn add react-csv-reader
10+
```
11+
12+
With npm:
13+
```sh
14+
$ npm install --save react-csv-reader
15+
```

dist/react-csv-reader.js

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

dist/react-csv-reader.js.map

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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "react-csv-reader",
3+
"version": "0.1.0",
4+
"description": "React component that handles csv file input.",
5+
"main": "dist/react-csv-reader.js",
6+
"repository": "https://github.com/nzambello/react-csv-reader",
7+
"bugs": "https://github.com/nzambello/react-csv-reader/issues",
8+
"author": "Nicola Zambello (github.com/nzambello)",
9+
"homepage": "https://github.com/nzambello/react-csv-reader#readme",
10+
"license": "MIT",
11+
"devDependencies": {
12+
"babel-core": "^6.24.1",
13+
"babel-loader": "^7.0.0",
14+
"babel-preset-env": "^1.5.0",
15+
"babel-preset-react": "^6.24.1",
16+
"react": "^15.5.4",
17+
"react-dom": "^15.5.4",
18+
"webpack": "^2.5.1"
19+
},
20+
"peerDependencies": {
21+
"prop-types": "*",
22+
"react": "*",
23+
"react-dom": "*"
24+
},
25+
"scripts": {
26+
"build": "webpack -p",
27+
"watch": "webpack --watch --progress"
28+
}
29+
}

src/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react"
2+
import { func } from "prop-types"
3+
4+
const CSVReader = ({ onFileLoaded, onError }) => {
5+
return (
6+
<div>
7+
<p>Welcome to CSVReader</p>
8+
</div>
9+
)
10+
}
11+
12+
CSVReader.propTypes = {
13+
onFileLoaded: func,
14+
onError: func
15+
}
16+
17+
export default CSVReader

webpack.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
var path = require("path")
2+
3+
module.exports = {
4+
devtool: "source-map",
5+
entry: "./src/index.js",
6+
output: {
7+
filename: "react-csv-reader.js",
8+
path: path.resolve(__dirname, "dist"),
9+
library: "CSVReader",
10+
libraryTarget: "commonjs2"
11+
},
12+
module: {
13+
rules: [
14+
{
15+
test: /\.js$/,
16+
exclude: /node_modules/,
17+
loader: "babel-loader"
18+
}
19+
]
20+
},
21+
externals: {
22+
react: {
23+
commonjs: "react",
24+
commonjs2: "react",
25+
amd: "react",
26+
root: "React"
27+
},
28+
"prop-types": {
29+
commonjs: "prop-types",
30+
commonjs2: "prop-types",
31+
amd: "prop-types",
32+
root: "PropTypes"
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)