-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Henrik Hedlund
committed
May 3, 2016
1 parent
28ebec5
commit a7d29a4
Showing
12 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"presets": [ | ||
"es2015", | ||
"react" | ||
], | ||
"plugins": [ | ||
'transform-object-rest-spread' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto | ||
*.js text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git-tag-version=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -e | ||
|
||
npm install | ||
npm test | ||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function (str) { | ||
return `hello ${str}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* global describe, it */ | ||
// import { expect } from 'chai'; |