Skip to content

Commit bac0298

Browse files
committed
init
0 parents  commit bac0298

File tree

18 files changed

+314
-0
lines changed

18 files changed

+314
-0
lines changed

.babelrc

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

.eslintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "airbnb",
3+
"rules": {
4+
"arrow-body-style": 0,
5+
"prefer-arrow-callback": 0,
6+
"func-names": 0,
7+
"react/jsx-no-bind": 0,
8+
"react/jsx-uses-react": 1,
9+
"react/prefer-stateless-function": 0
10+
},
11+
"parserOptions": {
12+
"ecmaVersion": 6,
13+
"ecmaFeatures": {
14+
"experimentalObjectRestSpread": true
15+
}
16+
}
17+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*.log
3+
.idea
4+
dist

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src
2+
.babelrc

.scripts/get_gh_pages_url.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// IMPORTANT
2+
// ---------
3+
// This is an auto generated file with React CDK.
4+
// Do not modify this file.
5+
6+
const parse = require('git-url-parse');
7+
var ghUrl = process.argv[2];
8+
const parsedUrl = parse(ghUrl);
9+
10+
const ghPagesUrl = 'https://' + parsedUrl.owner + '.github.io/' + parsedUrl.name;
11+
console.log(ghPagesUrl);

.scripts/mocha_runner.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// IMPORTANT
2+
// ---------
3+
// This is an auto generated file with React CDK.
4+
// Do not modify this file.
5+
// Use `.scripts/user/pretest.js instead`.
6+
7+
require('babel-core/register');
8+
require('babel-polyfill');
9+
10+
// Add jsdom support, which is required for enzyme.
11+
var jsdom = require('jsdom').jsdom;
12+
13+
var exposedProperties = ['window', 'navigator', 'document'];
14+
15+
global.document = jsdom('');
16+
global.window = document.defaultView;
17+
Object.keys(document.defaultView).forEach((property) => {
18+
if (typeof global[property] === 'undefined') {
19+
exposedProperties.push(property);
20+
global[property] = document.defaultView[property];
21+
}
22+
});
23+
24+
global.navigator = {
25+
userAgent: 'node.js'
26+
};
27+
28+
process.on('unhandledRejection', function (error) {
29+
console.error('Unhandled Promise Rejection:');
30+
console.error(error && error.stack || error);
31+
});
32+
33+
require('./user/pretest.js');

.scripts/prepublish.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# IMPORTANT
4+
# ---------
5+
# This is an auto generated file with React CDK.
6+
# Do not modify this file.
7+
# Use `.scripts/user/prepublish.sh instead`.
8+
9+
echo "=> Transpiling 'src' into ES5 ..."
10+
echo ""
11+
rm -rf ./dist
12+
./node_modules/.bin/babel --ignore tests,stories --plugins "transform-runtime" ./src --out-dir ./dist
13+
echo ""
14+
echo "=> Transpiling completed."
15+
16+
. .scripts/user/prepublish.sh

.scripts/publish_storybook.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# IMPORTANT
4+
# ---------
5+
# This is an auto generated file with React CDK.
6+
# Do not modify this file.
7+
8+
set -e # exit with nonzero exit code if anything fails
9+
10+
# get GIT url
11+
12+
GIT_URL=`git config --get remote.origin.url`
13+
if [[ $GIT_URL == "" ]]; then
14+
echo "This project is not configured with a remote git repo".
15+
exit 1
16+
fi
17+
18+
# clear and re-create the out directory
19+
rm -rf .out || exit 0;
20+
mkdir .out;
21+
22+
# run our compile script, discussed above
23+
build-storybook -o .out
24+
25+
# go to the out directory and create a *new* Git repo
26+
cd .out
27+
git init
28+
29+
# inside this git repo we'll pretend to be a new user
30+
git config user.name "GH Pages Bot"
31+
git config user.email "hello@ghbot.com"
32+
33+
# The first and only commit to this new Git repo contains all the
34+
# files present with the commit message "Deploy to GitHub Pages".
35+
git add .
36+
git commit -m "Deploy Storybook to GitHub Pages"
37+
38+
# Force push from the current repo's master branch to the remote
39+
# repo's gh-pages branch. (All previous history on the gh-pages branch
40+
# will be lost, since we are overwriting it.) We redirect any output to
41+
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
42+
git push --force --quiet $GIT_URL master:gh-pages > /dev/null 2>&1
43+
cd ..
44+
rm -rf .out
45+
46+
echo ""
47+
echo "=> Storybook deployed to: `node .scripts/get_gh_pages_url.js $GIT_URL`"

.scripts/user/prepublish.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Use this file to your own code to run at NPM `prepublish` event.

.scripts/user/pretest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Use this file to setup any test utilities.

0 commit comments

Comments
 (0)