Skip to content

Commit e47e223

Browse files
committed
Init project
1 parent 496a035 commit e47e223

40 files changed

+1659
-249
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-0", "react"]
3+
}

.eslintrc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"extends": "airbnb",
3+
"parser": "babel-eslint",
4+
"rules": {
5+
"arrow-body-style": 0,
6+
"prefer-arrow-callback": 0,
7+
"func-names": 0,
8+
"eqeqeq": 1,
9+
"no-unused-vars": 1,
10+
"react/jsx-no-bind": 1,
11+
"react/jsx-uses-react": 1,
12+
"react/prefer-stateless-function": 0,
13+
// indentation
14+
"indent": [ 2, 4 ],
15+
"max-len": [1, 100],
16+
// comment
17+
'spaced-comment': ['warn', 'always', {
18+
exceptions: ['-', '+','todo'],
19+
markers: ['=', '!'] // space here to support sprockets directives
20+
}],
21+
"no-use-before-define": [ 2, { "functions": false } ],
22+
},
23+
"parserOptions": {
24+
"ecmaVersion": 6,
25+
"ecmaFeatures": {
26+
"experimentalObjectRestSpread": true
27+
}
28+
}
29+
}

.npmignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
node_modules
2-
develop
2+
.#develop
33
example
44
src
5-
docs
5+
doc
66
.babelrc
77
.eslintrc
88
.scripts

.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/lint.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var path = require('path');
2+
var shell = require('shelljs');
3+
var chalk = require('chalk');
4+
var lint = ['node_modules', '.bin', 'eslint'].join(path.sep);
5+
6+
shell.exec(lint + ' src --ext .jsx,.js --color');

.scripts/lintfix.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var path = require('path');
2+
var shell = require('shelljs');
3+
var chalk = require('chalk');
4+
var lint = ['node_modules', '.bin', 'eslint'].join(path.sep);
5+
6+
shell.exec(lint + ' src --ext .jsx,.js --fix');

.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/npm-postpublish.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var path = require('path');
2+
var shell = require('shelljs');
3+
var chalk = require('chalk');
4+
var babel = ['node_modules', '.bin', 'babel'].join(path.sep);
5+
6+
shell.echo(chalk.blue('Package was published'))

.scripts/npm-prepublish.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var path = require('path');
2+
var shell = require('shelljs');
3+
var chalk = require('chalk');
4+
var babel = ['node_modules', '.bin', 'babel'].join(path.sep);
5+
6+
shell.echo(chalk.blue('Transpiling \'src\' into ES5 ...'));
7+
shell.echo('');
8+
9+
shell.rm('-rf', 'dist');
10+
shell.exec(babel + ' --ignore tests,stories,story.jsx src --out-dir dist');
11+
12+
shell.echo('');
13+
shell.echo(chalk.blue('Transpiling completed.'));
14+
shell.echo('');

.scripts/prepublish.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "Transpiling 'src' into ES5 ..."
2+
if [ -e dist ]
3+
then
4+
rm -r dist
5+
fi
6+
./node_modules/.bin/babel --ignore tests,stories --plugins "transform-runtime" ./src --out-dir ./dist
7+
echo "Transpiling completed."

0 commit comments

Comments
 (0)