Skip to content

Commit

Permalink
Generated sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Hedlund committed May 3, 2016
1 parent 28ebec5 commit a7d29a4
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"es2015",
"react"
],
"plugins": [
'transform-object-rest-spread'
]
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
indent_style = space
indent_size = 4

[*.{json,yml}]
indent_style = space
indent_size = 4
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.js text eol=lf
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/lib
# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

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

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

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

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

Empty file added .npmignore
Empty file.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git-tag-version=false
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ffe-spinner-react

## Install

```
$ npm install --save ffe-spinner-react
```

## Usage

```javascript
import ffeSpinnerReact from 'ffe-spinner-react';

ffeSpinnerReact('ffe-component');
//=> 'hello ffe-component'
```

## Test

# Local

For å teste endringer lokalt kan man kjøre i dette prosjektes mappe:

```
sudo npm link
```

Og i prosjektet som skal bruke endringene gjort lokalt kan man kjøre:

```
npm link ffe-spinner-react
```
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e

npm install
npm test
npm run lint
44 changes: 44 additions & 0 deletions flow.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Makes functions inherit trap ERR
set -E


trap 'executionFailed ${LINENO}' ERR

function main() {
./build.sh

if should_publish; then
npm run has-published -s || npm publish
else
# must bump version number to succeed.
! npm run has-published -s
fi
}

function should_publish() {
[[ $GIT_BRANCH =~ ^(origin/)?master$ ]]
}

# Fail the build if someone tries to send it parameters since script doesn't handle params at the moment.
if [ $# -ne 0 ] ; then
echo "Failed the build. flow.sh does not support input parameters. Input parameters were '$@'"
exit 1;
fi

function executionFailed() {
# Called when some command fail execution
local self=$(basename "$0")
local parent_lineno="$1"
local message="$2"
local resultCode="${3:-1}"
if [[ -n "$message" ]]; then
echo "${self}: Error on or near line ${parent_lineno}: ${message}; exiting with status ${resultCode}"
else
echo "${self}: Error on or near line ${parent_lineno}; exiting with status ${resultCode}"
fi
exit "${resultCode}"
}

main
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "ffe-spinner-react",
"version": "0.0.0",
"main": "lib/ffe-spinner-react.js",
"scripts": {
"build": "babel -d lib/. --ignore=*.test.js src/.",
"lint": "eslint src/.",
"test:nsp": "nsp check",
"test:spec": "mocha --require babel-register --reporter mocha-tap13 src/**/*.test.js",
"test": "npm run test:spec && npm run test:nsp",
"prepublish": "npm run build",
"has-published": "npm show . versions -s | grep -q ${npm_package_version}"
},
"devDependencies": {
"eslint-plugin-react": "^4.2.2",
"react": "^15.0.0",
"react-addons-test-utils": "^15.0.0",
"enzyme": "^2.0.0",
"react-dom": "^15.0.0",
"babel-core": "^6.5.2",
"babel-plugin-transform-object-rest-spread": "^6.5.0",
"babel-cli": "^6.4.5",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.5.0",
"babel-register": "^6.4.3",
"chai": "^3.5.0",
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.1.0",
"mocha": "^2.4.5",
"mocha-tap13": "0.0.3",
"nsp": "^2.2.0"
},
"publishConfig": {
"registry": "***REMOVED***"
},
"files": [
"lib",
"*.js"
],
"eslintConfig": {
"extends": "airbnb"
},
"repository": "",
"author": "",
"license": "",
"babel": {
"presets": [
"react",
"es2015"
]
}
}
3 changes: 3 additions & 0 deletions src/ffe-spinner-react.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function (str) {
return `hello ${str}`;
}
2 changes: 2 additions & 0 deletions src/ffe-spinner-react.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* global describe, it */
// import { expect } from 'chai';

0 comments on commit a7d29a4

Please sign in to comment.