Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Dec 23, 2017
0 parents commit 1bb92f7
Show file tree
Hide file tree
Showing 9 changed files with 2,942 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"env",
"react"
]
}
68 changes: 68 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# react-csv-reader
React component that handles csv file input.

## Installation
Install the package with either yarn or npm.

With yarn:
```sh
$ yarn add react-csv-reader
```

With npm:
```sh
$ npm install --save react-csv-reader
```
125 changes: 125 additions & 0 deletions dist/react-csv-reader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/react-csv-reader.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "react-csv-reader",
"version": "0.1.0",
"description": "React component that handles csv file input.",
"main": "dist/react-csv-reader.js",
"repository": "https://github.com/nzambello/react-csv-reader",
"bugs": "https://github.com/nzambello/react-csv-reader/issues",
"author": "Nicola Zambello (github.com/nzambello)",
"homepage": "https://github.com/nzambello/react-csv-reader#readme",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-preset-env": "^1.5.0",
"babel-preset-react": "^6.24.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"webpack": "^2.5.1"
},
"peerDependencies": {
"prop-types": "*",
"react": "*",
"react-dom": "*"
},
"scripts": {
"build": "webpack -p",
"watch": "webpack --watch --progress"
}
}
17 changes: 17 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react"
import { func } from "prop-types"

const CSVReader = ({ onFileLoaded, onError }) => {
return (
<div>
<p>Welcome to CSVReader</p>
</div>
)
}

CSVReader.propTypes = {
onFileLoaded: func,
onError: func
}

export default CSVReader
35 changes: 35 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var path = require("path")

module.exports = {
devtool: "source-map",
entry: "./src/index.js",
output: {
filename: "react-csv-reader.js",
path: path.resolve(__dirname, "dist"),
library: "CSVReader",
libraryTarget: "commonjs2"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
},
externals: {
react: {
commonjs: "react",
commonjs2: "react",
amd: "react",
root: "React"
},
"prop-types": {
commonjs: "prop-types",
commonjs2: "prop-types",
amd: "prop-types",
root: "PropTypes"
}
}
}
Loading

0 comments on commit 1bb92f7

Please sign in to comment.